md2x 0.5.0 → 0.5.2

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.
@@ -1,5 +1,5 @@
1
- import{c as We}from"./chunk-5DRL26RK.js";import*as he from"fs";import*as M from"path";import{createRequire as pn}from"module";import{fileURLToPath as Je,pathToFileURL as _e}from"url";import*as P from"fs";import*as Ve from"os";import*as E from"path";import{fileURLToPath as an,pathToFileURL as Se}from"url";function ln(){return globalThis.__md2x_module_dir__?globalThis.__md2x_module_dir__:E.dirname(an(import.meta.url))}var Te=null;function sn(){let e=ln();return E.join(e,"renderer","puppeteer-render.html")}function cn(e){switch(e){case"Letter":return{widthIn:8.5,heightIn:11};case"Legal":return{widthIn:8.5,heightIn:14};case"A3":return{widthIn:11.69,heightIn:16.54};case"A5":return{widthIn:5.83,heightIn:8.27};case"A4":default:return{widthIn:8.27,heightIn:11.69}}}function un(e){switch(e){case"A3":return{top:"25mm",bottom:"25mm",left:"20mm",right:"20mm"};case"A5":return{top:"15mm",bottom:"15mm",left:"12mm",right:"12mm"};case"Legal":return{top:"25mm",bottom:"25mm",left:"20mm",right:"20mm"};case"Letter":case"A4":default:return{top:"20mm",bottom:"20mm",left:"15mm",right:"15mm"}}}function ue(e){if(typeof e=="number")return e/96;let r=String(e??"").trim();if(!r)return null;let n=r.match(/^(-?\d+(?:\.\d+)?)(px|in|mm|cm)$/i);if(!n)return null;let t=parseFloat(n[1]);if(!Number.isFinite(t))return null;let i=n[2].toLowerCase();return i==="in"?t:i==="cm"?t/2.54:i==="mm"?t/25.4:i==="px"?t/96:null}async function fe(){try{Te=await import("puppeteer")}catch{return console.warn("Puppeteer dependency not found. Diagrams/HTML/SVG will be skipped."),console.warn("If you are using the published CLI, run via `npx md2x ...` (it installs Puppeteer automatically)."),console.warn("If you are running from this repo, install CLI deps first: `npm -C node i` (or `pnpm -C node i`)."),null}let e=null,r=null,n=null,t=[],i=a=>{t.push(a),t.length>60&&t.shift()},l=()=>{let a=[E.join(process.cwd(),".md2x-"),E.join(Ve.tmpdir(),"md2x-")];for(let s of a)try{return P.mkdirSync(E.dirname(s),{recursive:!0}),P.mkdtempSync(s)}catch{}throw new Error("Unable to create a writable temp directory for Chromium runtime files")},o=async a=>{if(!r||!a)return;let s=Se(a+E.sep).href;await r.evaluate(c=>{let f=window;if(typeof f.__md2xSetBaseHref=="function"){f.__md2xSetBaseHref(c);return}let u=document.querySelector("base");u||(u=document.createElement("base"),document.head.appendChild(u)),u.href=c},s)};return{async initialize(){if(!Te)return;let a=sn();if(!P.existsSync(a))throw new Error(`Missing renderer assets: ${a}
2
- Run \`npm run node\` to build the CLI (it generates node/dist/renderer/*).`);n=l();let s=E.join(n,"chrome-profile");P.mkdirSync(s,{recursive:!0}),e=await Te.launch({headless:!0,userDataDir:s,env:{...process.env,HOME:n,XDG_CACHE_HOME:E.join(n,"xdg-cache"),XDG_CONFIG_HOME:E.join(n,"xdg-config"),XDG_DATA_HOME:E.join(n,"xdg-data")},args:["--no-sandbox","--disable-setuid-sandbox","--disable-web-security","--allow-file-access-from-files","--disable-breakpad","--disable-crash-reporter","--disable-features=Crashpad","--no-first-run","--no-default-browser-check"]}),r=await e.newPage(),r.on("console",c=>{i(`[console.${c.type()}] ${c.text()}`)}),r.on("pageerror",c=>{let f=c instanceof Error?c.message:String(c);i(`[pageerror] ${f}`)}),r.on("requestfailed",c=>{let f=c.failure();i(`[requestfailed] ${c.url()} ${f?.errorText??""}`.trim())}),await r.setViewport({width:2e3,height:2e3}),await r.goto(Se(a).href,{waitUntil:"domcontentloaded"});try{await r.waitForFunction(()=>window.__md2xRenderReady===!0,{timeout:3e4})}catch(c){let f=`Renderer page did not become ready within 30s.
1
+ import{c as We}from"./chunk-5DRL26RK.js";import*as he from"fs";import*as M from"path";import{createRequire as dn}from"module";import{fileURLToPath as pn,pathToFileURL as Ee}from"url";import*as P from"fs";import*as Ve from"os";import*as E from"path";import{fileURLToPath as on,pathToFileURL as Te}from"url";function an(){return globalThis.__md2x_module_dir__?globalThis.__md2x_module_dir__:E.dirname(on(import.meta.url))}var ke=null;function ln(){let e=an();return E.join(e,"renderer","puppeteer-render.html")}function sn(e){switch(e){case"Letter":return{widthIn:8.5,heightIn:11};case"Legal":return{widthIn:8.5,heightIn:14};case"A3":return{widthIn:11.69,heightIn:16.54};case"A5":return{widthIn:5.83,heightIn:8.27};case"A4":default:return{widthIn:8.27,heightIn:11.69}}}function cn(e){switch(e){case"A3":return{top:"25mm",bottom:"25mm",left:"20mm",right:"20mm"};case"A5":return{top:"15mm",bottom:"15mm",left:"12mm",right:"12mm"};case"Legal":return{top:"25mm",bottom:"25mm",left:"20mm",right:"20mm"};case"Letter":case"A4":default:return{top:"20mm",bottom:"20mm",left:"15mm",right:"15mm"}}}function ue(e){if(typeof e=="number")return e/96;let r=String(e??"").trim();if(!r)return null;let n=r.match(/^(-?\d+(?:\.\d+)?)(px|in|mm|cm)$/i);if(!n)return null;let t=parseFloat(n[1]);if(!Number.isFinite(t))return null;let i=n[2].toLowerCase();return i==="in"?t:i==="cm"?t/2.54:i==="mm"?t/25.4:i==="px"?t/96:null}async function fe(){try{ke=await import("puppeteer")}catch{return console.warn("Puppeteer dependency not found. Diagrams/HTML/SVG will be skipped."),console.warn("If you are using the published CLI, run via `npx md2x ...` (it installs Puppeteer automatically)."),console.warn("If you are running from this repo, install CLI deps first: `npm -C node i` (or `pnpm -C node i`)."),null}let e=null,r=null,n=null,t=[],i=a=>{t.push(a),t.length>60&&t.shift()},l=()=>{let a=[E.join(process.cwd(),".md2x-"),E.join(Ve.tmpdir(),"md2x-")];for(let s of a)try{return P.mkdirSync(E.dirname(s),{recursive:!0}),P.mkdtempSync(s)}catch{}throw new Error("Unable to create a writable temp directory for Chromium runtime files")},o=async a=>{if(!r||!a)return;let s=Te(a+E.sep).href;await r.evaluate(c=>{let f=window;if(typeof f.__md2xSetBaseHref=="function"){f.__md2xSetBaseHref(c);return}let u=document.querySelector("base");u||(u=document.createElement("base"),document.head.appendChild(u)),u.href=c},s)};return{async initialize(){if(!ke)return;let a=ln();if(!P.existsSync(a))throw new Error(`Missing renderer assets: ${a}
2
+ Run \`npm run node\` to build the CLI (it generates node/dist/renderer/*).`);n=l();let s=E.join(n,"chrome-profile");P.mkdirSync(s,{recursive:!0}),e=await ke.launch({headless:!0,userDataDir:s,env:{...process.env,HOME:n,XDG_CACHE_HOME:E.join(n,"xdg-cache"),XDG_CONFIG_HOME:E.join(n,"xdg-config"),XDG_DATA_HOME:E.join(n,"xdg-data")},args:["--no-sandbox","--disable-setuid-sandbox","--disable-web-security","--allow-file-access-from-files","--disable-breakpad","--disable-crash-reporter","--disable-features=Crashpad","--no-first-run","--no-default-browser-check"]}),r=await e.newPage(),r.on("console",c=>{i(`[console.${c.type()}] ${c.text()}`)}),r.on("pageerror",c=>{let f=c instanceof Error?c.message:String(c);i(`[pageerror] ${f}`)}),r.on("requestfailed",c=>{let f=c.failure();i(`[requestfailed] ${c.url()} ${f?.errorText??""}`.trim())}),await r.setViewport({width:2e3,height:2e3}),await r.goto(Te(a).href,{waitUntil:"domcontentloaded"});try{await r.waitForFunction(()=>window.__md2xRenderReady===!0,{timeout:3e4})}catch(c){let f=`Renderer page did not become ready within 30s.
3
3
  Common causes:
4
4
  - \`puppeteer-render.html\` has a <base> that breaks relative script loading
5
5
  - missing/broken \`node/dist/renderer/puppeteer-render-worker.js\`
@@ -19,7 +19,7 @@ Original error: ${d}${u}`)}},async render(a,s,c,f){if(!r)return null;try{return
19
19
  <body>
20
20
  <div id="markdown-content">${a}</div>
21
21
  </body>
22
- </html>`;f?(d=E.join(f,`__md2x_temp_${Date.now()}.html`),P.writeFileSync(d,g,"utf-8"),await u.goto(Se(d).href,{waitUntil:"networkidle0"})):await u.setContent(g,{waitUntil:"networkidle0"});let h=c.format||"A4",x=c.landscape||!1,w=c.scale||1,{widthIn:y,heightIn:$}=cn(h),W=x?y:$,F=un(h),V=ue(c.margin?.top??F.top)??ue(F.top),z=ue(c.margin?.bottom??F.bottom)??ue(F.bottom),U=(W-V-z)*96/w;await u.evaluate(S=>{let K=document.getElementById("markdown-content");if(!K)return;let Ae=window.getComputedStyle(K),Ce=parseFloat(Ae.paddingTop||"0")||0,ee=parseFloat(Ae.paddingBottom||"0")||0,re=Math.max(0,S-Ce-ee);K.querySelectorAll(".md2x-diagram img.md2x-diagram, img.md2x-diagram").forEach(ce=>{let Y=ce,Ge=Y.getBoundingClientRect().height||Y.naturalHeight||0;Ge&&(Ge<=re+.5||(Y.style.maxHeight=`${re}px`,Y.style.height="auto",Y.style.width="auto",Y.style.maxWidth="100%",Y.style.objectFit="contain"))})},U),await u.evaluate(()=>{let S=document.getElementById("markdown-content");if(!S)return;let K=S.clientWidth;if(!K)return;S.querySelectorAll(':scope > div[style*="width"]').forEach(Ce=>{let ee=Ce,re=ee.style.width?.match(/^(\d+(?:\.\d+)?)px$/);if(!re)return;let se=parseFloat(re[1]);if(!Number.isFinite(se)||se<=0)return;let ce=Math.min(1,K/se);ce>=.999||(ee.style.transformOrigin="top left",ee.style.transform=`scale(${ce})`)})});let L={printBackground:c.printBackground!==!1,scale:c.scale||1,displayHeaderFooter:c.displayHeaderFooter||!1,headerTemplate:c.headerTemplate||"",footerTemplate:c.footerTemplate||"",margin:{top:c.margin?.top??F.top,bottom:c.margin?.bottom??F.bottom,left:c.margin?.left??F.left,right:c.margin?.right??F.right}};c.width&&c.height?(L.width=c.width,L.height=c.height):(L.format=c.format||"A4",L.landscape=c.landscape||!1);let I=await u.pdf(L);return Buffer.from(I)}finally{if(await u.close(),d)try{P.unlinkSync(d)}catch{}}},async close(){if(e&&(await e.close(),e=null,r=null),n){try{P.rmSync(n,{recursive:!0,force:!0})}catch{}n=null}}}}import*as j from"fs";import*as A from"path";import{pathToFileURL as Ke}from"url";function fn(e){if(j.existsSync(A.join(e,"themes")))return e;let r=A.resolve(e,"../../src");if(j.existsSync(A.join(r,"themes")))return r;let n=A.resolve(process.cwd(),"src");if(j.existsSync(A.join(n,"themes")))return n;throw new Error("Unable to locate themes assets (expected themes/ directory).")}function dn(e){j.mkdirSync(A.dirname(e),{recursive:!0})}var ke=class{constructor(){this.documentPath="";this.documentDir="";this.baseUrl="";this.needsUriRewrite=!1}setDocumentPath(r,n){this.documentPath=r,this.documentDir=A.dirname(r),this.baseUrl=n??Ke(this.documentDir+A.sep).href,this.needsUriRewrite=!1}resolvePath(r){return r.startsWith("file://")?new URL(r).pathname:A.isAbsolute(r)?r:A.resolve(this.documentDir||process.cwd(),r)}toResourceUrl(r){return Ke(r).href}async readFile(r,n){let t=await j.promises.readFile(r);return n?.binary?t.toString("base64"):t.toString("utf8")}async readRelativeFile(r,n){let t=this.resolvePath(r);return await this.readFile(t,n)}async fetchRemote(r){let n=await fetch(r,{signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let t=await n.arrayBuffer();return new Uint8Array(t)}};function de(e){let r=fn(e.moduleDir),n=new Map;n.set("selectedTheme",e.selectedThemeId),e.settings&&n.set("markdownViewerSettings",e.settings);let t=null,i=new ke;return i.setDocumentPath(A.join(process.cwd(),"__md2x__.md")),{platform:{platform:"node",cache:{async init(){},async calculateHash(){return""},async generateKey(){return""},async get(){return null},async set(){return!1},async clear(){return!0},async getStats(){return null}},renderer:{async init(){},setThemeConfig(){},getThemeConfig(){return null},async render(){throw new Error("RendererService not available in Node platform")}},storage:{async get(o){let a={};for(let s of o)n.has(s)&&(a[s]=n.get(s));return a},async set(o){for(let[a,s]of Object.entries(o))n.set(a,s)},async remove(o){for(let a of o)n.delete(a)}},file:{async download(o,a,s){let c=typeof o=="string"?Buffer.from(o,"base64"):Buffer.from(await o.arrayBuffer());if(s?.onProgress&&s.onProgress({uploaded:c.length,total:c.length}),e.output.kind==="buffer"){t=c;return}dn(a),await j.promises.writeFile(a,c)}},resource:{async fetch(o){let a=o;if(a.startsWith("file://")){let c=new URL(a);return await j.promises.readFile(c.pathname,"utf8")}a.startsWith("./")&&(a=a.slice(2)),a.startsWith("/")&&(a=a.slice(1));let s=A.join(r,a);return await j.promises.readFile(s,"utf8")},getURL(o){return`./${o}`}},i18n:{translate(o){return o},getUILanguage(){return"en"}},message:{async send(){return null},addListener(){}},document:i},getCapturedBuffer:()=>t}}function Ee(){return globalThis.__md2x_module_dir__?globalThis.__md2x_module_dir__:M.dirname(Je(import.meta.url))}function Oe(){typeof globalThis.atob!="function"&&(globalThis.atob=e=>Buffer.from(e,"base64").toString("binary")),typeof globalThis.btoa!="function"&&(globalThis.btoa=e=>Buffer.from(e,"binary").toString("base64"))}async function Pe(e){let n=await globalThis.platform.resource.fetch(`themes/presets/${e}.json`),t=JSON.parse(n),i=t?.fontScheme?.body?.fontFamily,l=t?.fontScheme?.body?.fontSize?parseFloat(t.fontScheme.body.fontSize):void 0;return{fontFamily:typeof i=="string"?i:void 0,fontSize:typeof l=="number"&&Number.isFinite(l)?l:void 0}}function mn(e,r,n){return e?{async render(t,i){let l=await e.render(t,i,r,n);return l||null}}:null}function Fe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function hn(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&#x3C;/gi,"<").replace(/&#x3E;/gi,">").replace(/&#x26;/gi,"&").replace(/&#60;/g,"<").replace(/&#62;/g,">").replace(/&#38;/g,"&")}async function gn(e,r,n,t,i){if(i!=="img"||!r)return e;let l=We.filter(f=>f.nodeSelector.includes("code")).map(f=>f.language).filter(f=>f!==null),o=["graphviz","gv","vegalite"],a=[...l,...o].join("|");if(!a)return e;let s=new RegExp(`<pre><code class="(?:hljs )?language-(${a})">([\\s\\S]*?)<\\/code><\\/pre>`,"gi"),c=[...e.matchAll(s)];for(let f of c){let[u,d,p]=f,g=hn(p),h=d.toLowerCase();(h==="graphviz"||h==="gv")&&(h="dot"),h==="vegalite"&&(h="vega-lite");try{let x=await r.render(h,g,n,t);if(x&&x.base64){let w=`<div class="md2x-diagram"><img class="md2x-diagram" src="data:image/${x.format};base64,${x.base64}" alt="${Fe(`${d} diagram`)}" style="max-width: 100%;" /></div>`;e=e.replace(u,w)}}catch(x){console.warn(`Failed to render ${d} diagram:`,x)}}return e}async function Xe(e,r,n,t,i){let{unified:l}=await import("./unified-PU53JLVJ.js"),o=(await import("./remark-parse-QC7TSXTK.js")).default,a=(await import("./remark-gfm-BUZ4SLP3.js")).default,s=(await import("./remark-math-HEZQAPFK.js")).default,c=(await import("./remark-super-sub-EP2AQS54.js")).default,f=(await import("./remark-rehype-C2LX643P.js")).default,u=(await import("./rehype-katex-FXTCTSUE.js")).default,d=(await import("./rehype-highlight-Y4Q4RX67.js")).default,p=(await import("./rehype-stringify-4CQSSRDL.js")).default,{visit:g}=await import("./unist-util-visit-SBSD62C6.js");function h(){return $=>{g($,"element",W=>{if(W.tagName!=="p")return;let F=W.children||[];if(F.length===0)return;let V=0,z=-1,U=!1,L=!1;for(let I=0;I<F.length;I++){let S=F[I];S.type==="element"&&S.tagName==="img"?(V++,z=I,L=!0):L&&(S.type==="text"&&S.value.trim()!==""||S.type==="element"&&S.tagName!=="br")&&(U=!0)}if(V===1&&!U&&z>=0){let I=F[z];I.properties=I.properties||{};let S=I.properties.className||[];I.properties.className=Array.isArray(S)?[...S,"block-image"]:[S,"block-image"]}})}}let w=await l().use(o).use(a,{singleTilde:!1}).use(s).use(c).use(f,{allowDangerousHtml:!0}).use(u).use(d).use(h).use(p,{allowDangerousHtml:!0}).process(e),y=String(w);return y=await gn(y,r,n,t,i),y}var pe=class{async exportToBuffer(r,n={}){Oe();let t=n.theme||"default",i=n.basePath??process.cwd(),l=Ee(),{platform:o,getCapturedBuffer:a}=de({moduleDir:l,selectedThemeId:t,output:{kind:"buffer"},settings:{docxHrAsPageBreak:n.hrAsPageBreak??!0}}),s=globalThis.platform;globalThis.platform=o;let c=M.join(i,"__md2x__.md"),f=null;try{f=await fe(),f&&await f.initialize();let u=await Pe(t),d=mn(f,i,u),{default:p}=await import("./docx-exporter-FGXU5MTK.js"),g=new p(d);g.setBaseUrl?.(_e(c).href);let h=await g.exportToDocx(r,"__md2x__.docx",null);if(!h.success)throw new Error(h.error||"DOCX export failed");let x=a();if(!x)throw new Error("DOCX export produced no output buffer");return x}finally{try{f&&await f.close()}finally{globalThis.platform=s}}}};async function Qe(e){let r=globalThis.platform;await(await import("./theme-manager-AZBU2SLL.js")).default.initialize();let t=await r.resource.fetch(`themes/presets/${e}.json`),i=JSON.parse(t),l=await r.resource.fetch(`themes/layout-schemes/${i.layoutScheme}.json`),o=JSON.parse(l),a=await r.resource.fetch(`themes/color-schemes/${i.colorScheme}.json`),s=JSON.parse(a),c=await r.resource.fetch(`themes/table-styles/${i.tableStyle}.json`),f=JSON.parse(c),u=await r.resource.fetch(`themes/code-themes/${i.codeTheme}.json`),d=JSON.parse(u),{themeToCSS:p}=await import("./theme-to-css-GLV3WYDU.js");return p(i,o,s,f,d)}async function Ze(e=!0){return`
22
+ </html>`;f?(d=E.join(f,`__md2x_temp_${Date.now()}.html`),P.writeFileSync(d,g,"utf-8"),await u.goto(Te(d).href,{waitUntil:"networkidle0"})):await u.setContent(g,{waitUntil:"networkidle0"});let h=c.format||"A4",x=c.landscape||!1,w=c.scale||1,{widthIn:y,heightIn:$}=sn(h),W=x?y:$,F=cn(h),V=ue(c.margin?.top??F.top)??ue(F.top),z=ue(c.margin?.bottom??F.bottom)??ue(F.bottom),U=(W-V-z)*96/w;await u.evaluate(S=>{let K=document.getElementById("markdown-content");if(!K)return;let Ce=window.getComputedStyle(K),Se=parseFloat(Ce.paddingTop||"0")||0,ee=parseFloat(Ce.paddingBottom||"0")||0,re=Math.max(0,S-Se-ee);K.querySelectorAll(".md2x-diagram img.md2x-diagram, img.md2x-diagram").forEach(ce=>{let Y=ce,Ge=Y.getBoundingClientRect().height||Y.naturalHeight||0;Ge&&(Ge<=re+.5||(Y.style.maxHeight=`${re}px`,Y.style.height="auto",Y.style.width="auto",Y.style.maxWidth="100%",Y.style.objectFit="contain"))})},U),await u.evaluate(()=>{let S=document.getElementById("markdown-content");if(!S)return;let K=S.clientWidth;if(!K)return;S.querySelectorAll(':scope > div[style*="width"]').forEach(Se=>{let ee=Se,re=ee.style.width?.match(/^(\d+(?:\.\d+)?)px$/);if(!re)return;let se=parseFloat(re[1]);if(!Number.isFinite(se)||se<=0)return;let ce=Math.min(1,K/se);ce>=.999||(ee.style.transformOrigin="top left",ee.style.transform=`scale(${ce})`)})});let L={printBackground:c.printBackground!==!1,scale:c.scale||1,displayHeaderFooter:c.displayHeaderFooter||!1,headerTemplate:c.headerTemplate||"",footerTemplate:c.footerTemplate||"",margin:{top:c.margin?.top??F.top,bottom:c.margin?.bottom??F.bottom,left:c.margin?.left??F.left,right:c.margin?.right??F.right}};c.width&&c.height?(L.width=c.width,L.height=c.height):(L.format=c.format||"A4",L.landscape=c.landscape||!1);let I=await u.pdf(L);return Buffer.from(I)}finally{if(await u.close(),d)try{P.unlinkSync(d)}catch{}}},async close(){if(e&&(await e.close(),e=null,r=null),n){try{P.rmSync(n,{recursive:!0,force:!0})}catch{}n=null}}}}import*as j from"fs";import*as A from"path";import{pathToFileURL as Ke}from"url";function un(e){if(j.existsSync(A.join(e,"themes")))return e;let r=A.resolve(e,"../../src");if(j.existsSync(A.join(r,"themes")))return r;let n=A.resolve(process.cwd(),"src");if(j.existsSync(A.join(n,"themes")))return n;throw new Error("Unable to locate themes assets (expected themes/ directory).")}function fn(e){j.mkdirSync(A.dirname(e),{recursive:!0})}var Fe=class{constructor(){this.documentPath="";this.documentDir="";this.baseUrl="";this.needsUriRewrite=!1}setDocumentPath(r,n){this.documentPath=r,this.documentDir=A.dirname(r),this.baseUrl=n??Ke(this.documentDir+A.sep).href,this.needsUriRewrite=!1}resolvePath(r){return r.startsWith("file://")?new URL(r).pathname:A.isAbsolute(r)?r:A.resolve(this.documentDir||process.cwd(),r)}toResourceUrl(r){return Ke(r).href}async readFile(r,n){let t=await j.promises.readFile(r);return n?.binary?t.toString("base64"):t.toString("utf8")}async readRelativeFile(r,n){let t=this.resolvePath(r);return await this.readFile(t,n)}async fetchRemote(r){let n=await fetch(r,{signal:AbortSignal.timeout(15e3)});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let t=await n.arrayBuffer();return new Uint8Array(t)}};function de(e){let r=un(e.moduleDir),n=new Map;n.set("selectedTheme",e.selectedThemeId),e.settings&&n.set("markdownViewerSettings",e.settings);let t=null,i=new Fe;return i.setDocumentPath(A.join(process.cwd(),"__md2x__.md")),{platform:{platform:"node",cache:{async init(){},async calculateHash(){return""},async generateKey(){return""},async get(){return null},async set(){return!1},async clear(){return!0},async getStats(){return null}},renderer:{async init(){},setThemeConfig(){},getThemeConfig(){return null},async render(){throw new Error("RendererService not available in Node platform")}},storage:{async get(o){let a={};for(let s of o)n.has(s)&&(a[s]=n.get(s));return a},async set(o){for(let[a,s]of Object.entries(o))n.set(a,s)},async remove(o){for(let a of o)n.delete(a)}},file:{async download(o,a,s){let c=typeof o=="string"?Buffer.from(o,"base64"):Buffer.from(await o.arrayBuffer());if(s?.onProgress&&s.onProgress({uploaded:c.length,total:c.length}),e.output.kind==="buffer"){t=c;return}fn(a),await j.promises.writeFile(a,c)}},resource:{async fetch(o){let a=o;if(a.startsWith("file://")){let c=new URL(a);return await j.promises.readFile(c.pathname,"utf8")}a.startsWith("./")&&(a=a.slice(2)),a.startsWith("/")&&(a=a.slice(1));let s=A.join(r,a);return await j.promises.readFile(s,"utf8")},getURL(o){return`./${o}`}},i18n:{translate(o){return o},getUILanguage(){return"en"}},message:{async send(){return null},addListener(){}},document:i},getCapturedBuffer:()=>t}}function ge(){return globalThis.__md2x_module_dir__?globalThis.__md2x_module_dir__:M.dirname(pn(import.meta.url))}function Oe(){typeof globalThis.atob!="function"&&(globalThis.atob=e=>Buffer.from(e,"base64").toString("binary")),typeof globalThis.btoa!="function"&&(globalThis.btoa=e=>Buffer.from(e,"binary").toString("base64"))}async function Pe(e){let n=await globalThis.platform.resource.fetch(`themes/presets/${e}.json`),t=JSON.parse(n),i=t?.fontScheme?.body?.fontFamily,l=t?.fontScheme?.body?.fontSize?parseFloat(t.fontScheme.body.fontSize):void 0;return{fontFamily:typeof i=="string"?i:void 0,fontSize:typeof l=="number"&&Number.isFinite(l)?l:void 0}}function mn(e,r,n){return e?{async render(t,i){let l=await e.render(t,i,r,n);return l||null}}:null}function _e(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function hn(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/").replace(/&#x3C;/gi,"<").replace(/&#x3E;/gi,">").replace(/&#x26;/gi,"&").replace(/&#60;/g,"<").replace(/&#62;/g,">").replace(/&#38;/g,"&")}async function gn(e,r,n,t,i){if(i!=="img"||!r)return e;let l=We.filter(f=>f.nodeSelector.includes("code")).map(f=>f.language).filter(f=>f!==null),o=["graphviz","gv","vegalite"],a=[...l,...o].join("|");if(!a)return e;let s=new RegExp(`<pre><code class="(?:hljs )?language-(${a})">([\\s\\S]*?)<\\/code><\\/pre>`,"gi"),c=[...e.matchAll(s)];for(let f of c){let[u,d,p]=f,g=hn(p),h=d.toLowerCase();(h==="graphviz"||h==="gv")&&(h="dot"),h==="vegalite"&&(h="vega-lite");try{let x=await r.render(h,g,n,t);if(x&&x.base64){let w=`<div class="md2x-diagram"><img class="md2x-diagram" src="data:image/${x.format};base64,${x.base64}" alt="${_e(`${d} diagram`)}" style="max-width: 100%;" /></div>`;e=e.replace(u,w)}}catch(x){console.warn(`Failed to render ${d} diagram:`,x)}}return e}async function Je(e,r,n,t,i){let{unified:l}=await import("./unified-PU53JLVJ.js"),o=(await import("./remark-parse-QC7TSXTK.js")).default,a=(await import("./remark-gfm-BUZ4SLP3.js")).default,s=(await import("./remark-math-HEZQAPFK.js")).default,c=(await import("./remark-super-sub-EP2AQS54.js")).default,f=(await import("./remark-rehype-C2LX643P.js")).default,u=(await import("./rehype-katex-FXTCTSUE.js")).default,d=(await import("./rehype-highlight-Y4Q4RX67.js")).default,p=(await import("./rehype-stringify-4CQSSRDL.js")).default,{visit:g}=await import("./unist-util-visit-SBSD62C6.js");function h(){return $=>{g($,"element",W=>{if(W.tagName!=="p")return;let F=W.children||[];if(F.length===0)return;let V=0,z=-1,U=!1,L=!1;for(let I=0;I<F.length;I++){let S=F[I];S.type==="element"&&S.tagName==="img"?(V++,z=I,L=!0):L&&(S.type==="text"&&S.value.trim()!==""||S.type==="element"&&S.tagName!=="br")&&(U=!0)}if(V===1&&!U&&z>=0){let I=F[z];I.properties=I.properties||{};let S=I.properties.className||[];I.properties.className=Array.isArray(S)?[...S,"block-image"]:[S,"block-image"]}})}}let w=await l().use(o).use(a,{singleTilde:!1}).use(s).use(c).use(f,{allowDangerousHtml:!0}).use(u).use(d).use(h).use(p,{allowDangerousHtml:!0}).process(e),y=String(w);return y=await gn(y,r,n,t,i),y}var pe=class{async exportToBuffer(r,n={}){Oe();let t=n.theme||"default",i=n.basePath??process.cwd(),l=ge(),{platform:o,getCapturedBuffer:a}=de({moduleDir:l,selectedThemeId:t,output:{kind:"buffer"},settings:{docxHrAsPageBreak:n.hrAsPageBreak??!0}}),s=globalThis.platform;globalThis.platform=o;let c=M.join(i,"__md2x__.md"),f=null;try{f=await fe(),f&&await f.initialize();let u=await Pe(t),d=mn(f,i,u),{default:p}=await import("./docx-exporter-FGXU5MTK.js"),g=new p(d);g.setBaseUrl?.(Ee(c).href);let h=await g.exportToDocx(r,"__md2x__.docx",null);if(!h.success)throw new Error(h.error||"DOCX export failed");let x=a();if(!x)throw new Error("DOCX export produced no output buffer");return x}finally{try{f&&await f.close()}finally{globalThis.platform=s}}}};async function Xe(e){let r=globalThis.platform;await(await import("./theme-manager-AZBU2SLL.js")).default.initialize();let t=await r.resource.fetch(`themes/presets/${e}.json`),i=JSON.parse(t),l=await r.resource.fetch(`themes/layout-schemes/${i.layoutScheme}.json`),o=JSON.parse(l),a=await r.resource.fetch(`themes/color-schemes/${i.colorScheme}.json`),s=JSON.parse(a),c=await r.resource.fetch(`themes/table-styles/${i.tableStyle}.json`),f=JSON.parse(c),u=await r.resource.fetch(`themes/code-themes/${i.codeTheme}.json`),d=JSON.parse(u),{themeToCSS:p}=await import("./theme-to-css-GLV3WYDU.js");return p(i,o,s,f,d)}async function Qe(e=!0){return`
23
23
  /* Base PDF Styles */
24
24
  * {
25
25
  box-sizing: border-box;
@@ -362,11 +362,11 @@ hr {
362
362
  background-color: #e1e4e8;
363
363
  border: 0;
364
364
  }`}
365
- `}function er(){let e=M.dirname(Je(import.meta.url)),r=M.join(e,"vendor","katex","katex.min.css"),n=r;he.existsSync(r)||(n=pn(import.meta.url).resolve("katex/dist/katex.min.css"));let t=M.dirname(n),i=_e(M.join(t,"fonts")+M.sep).href,l=he.readFileSync(n,"utf-8");return l=l.replace(/url\((['"]?)(?:\.\/)?fonts\//g,`url($1${i}`),l}var me=class{async exportToBuffer(r,n={}){Oe();let t=n.theme||"default",i=n.basePath??process.cwd(),l=Ee(),{platform:o}=de({moduleDir:l,selectedThemeId:t,output:{kind:"buffer"}}),a=globalThis.platform;globalThis.platform=o;let s=null;try{if(s=await fe(),!s)throw new Error("Failed to create browser renderer. Puppeteer is required for PDF export.");await s.initialize();let c=await Pe(t),f=await Xe(r,s,i,c,"img"),u="";try{u=er()}catch(h){console.warn("Failed to load KaTeX CSS for PDF export:",h)}let d=await Ze(n.hrAsPageBreak??!0),p="";try{p=await Qe(t)}catch(h){console.warn("Failed to load theme CSS, using base styles only:",h)}let g=u+`
365
+ `}function Ze(){let e=ge(),r=M.join(e,"vendor","katex","katex.min.css"),n=r;he.existsSync(r)||(n=dn(import.meta.url).resolve("katex/dist/katex.min.css"));let t=M.dirname(n),i=Ee(M.join(t,"fonts")+M.sep).href,l=he.readFileSync(n,"utf-8");return l=l.replace(/url\((['"]?)(?:\.\/)?fonts\//g,`url($1${i}`),l}var me=class{async exportToBuffer(r,n={}){Oe();let t=n.theme||"default",i=n.basePath??process.cwd(),l=ge(),{platform:o}=de({moduleDir:l,selectedThemeId:t,output:{kind:"buffer"}}),a=globalThis.platform;globalThis.platform=o;let s=null;try{if(s=await fe(),!s)throw new Error("Failed to create browser renderer. Puppeteer is required for PDF export.");await s.initialize();let c=await Pe(t),f=await Je(r,s,i,c,"img"),u="";try{u=Ze()}catch(h){console.warn("Failed to load KaTeX CSS for PDF export:",h)}let d=await Qe(n.hrAsPageBreak??!0),p="";try{p=await Xe(t)}catch(h){console.warn("Failed to load theme CSS, using base styles only:",h)}let g=u+`
366
366
  `+d+`
367
- `+p;return await s.exportToPdf(f,g,n.pdf,i)}finally{try{s&&await s.close()}finally{globalThis.platform=a}}}},ne=class{async exportToString(r,n={}){Oe();let t=n.theme||"default",i=n.basePath??process.cwd(),l=Ee(),o=n.diagramMode||"live",{platform:a}=de({moduleDir:l,selectedThemeId:t,output:{kind:"buffer"}}),s=globalThis.platform;globalThis.platform=a;let c=null;try{let f=await Pe(t);o==="img"&&(c=await fe(),c&&await c.initialize());let u=await Xe(r,c,i,f,o);if(!(n.standalone!==!1))return u;let p="";try{p=er()}catch(L){console.warn("Failed to load KaTeX CSS for HTML export:",L)}let g=await Ze(n.hrAsPageBreak??!1),h="";try{h=await Qe(t)}catch(L){console.warn("Failed to load theme CSS for HTML export, using base styles only:",L)}let x=p+`
367
+ `+p;return await s.exportToPdf(f,g,n.pdf,i)}finally{try{s&&await s.close()}finally{globalThis.platform=a}}}},ne=class{async exportToString(r,n={}){Oe();let t=n.theme||"default",i=n.basePath??process.cwd(),l=ge(),o=n.diagramMode||"live",{platform:a}=de({moduleDir:l,selectedThemeId:t,output:{kind:"buffer"}}),s=globalThis.platform;globalThis.platform=a;let c=null;try{let f=await Pe(t);o==="img"&&(c=await fe(),c&&await c.initialize());let u=await Je(r,c,i,f,o);if(!(n.standalone!==!1))return u;let p="";try{p=Ze()}catch(L){console.warn("Failed to load KaTeX CSS for HTML export:",L)}let g=await Qe(n.hrAsPageBreak??!1),h="";try{h=await Xe(t)}catch(L){console.warn("Failed to load theme CSS for HTML export, using base styles only:",L)}let x=p+`
368
368
  `+g+`
369
- `+h,w=n.title||"Document",$=n.baseTag!==!1&&!!i?_e(i+M.sep).href:"",W=$?` <base href="${Fe($)}" />
369
+ `+h,w=n.title||"Document",$=n.baseTag!==!1&&!!i?Ee(i+M.sep).href:"",W=$?` <base href="${_e($)}" />
370
370
  `:"",F={mermaid:"https://cdn.jsdelivr.net/npm/mermaid@11.12.2/dist/mermaid.min.js",vizGlobal:"https://cdn.jsdelivr.net/npm/@viz-js/viz@3.24.0/dist/viz-global.js",viz:"https://cdn.jsdelivr.net/npm/viz.js@2.1.2/viz.js",vizRender:"https://cdn.jsdelivr.net/npm/viz.js@2.1.2/full.render.js",infographic:"https://cdn.jsdelivr.net/npm/@antv/infographic@0.2.7/dist/infographic.min.js"},V={5:{vega:"https://cdn.jsdelivr.net/npm/vega@5/build/vega.min.js",vegaLite:"https://cdn.jsdelivr.net/npm/vega-lite@5/build/vega-lite.min.js",vegaEmbed:"https://cdn.jsdelivr.net/npm/vega-embed@6/build/vega-embed.min.js"},6:{vega:"https://cdn.jsdelivr.net/npm/vega@6/build/vega.min.js",vegaLite:"https://cdn.jsdelivr.net/npm/vega-lite@6/build/vega-lite.min.js",vegaEmbed:"https://cdn.jsdelivr.net/npm/vega-embed@7/build/vega-embed.min.js"}},z=n.cdn??{},U=o!=="live"?"":`
371
371
  <!-- md2x live diagram renderer (CDN) -->
372
372
  <script>
@@ -677,45 +677,45 @@ hr {
677
677
  <head>
678
678
  <meta charset="UTF-8" />
679
679
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
680
- ${W} <title>${Fe(w)}</title>
680
+ ${W} <title>${_e(w)}</title>
681
681
  <style>${x}</style>
682
682
  </head>
683
683
  <body>
684
684
  <div id="markdown-content" class="markdown-body">${u}</div>
685
685
  ${U}
686
686
  </body>
687
- </html>`}finally{try{c&&await c.close()}finally{globalThis.platform=s}}}async exportToBuffer(r,n={}){let t=await this.exportToString(r,n);return Buffer.from(t,"utf8")}};import*as B from"fs";import*as k from"path";function gr(e){return typeof e>"u"||e===null}function xn(e){return typeof e=="object"&&e!==null}function yn(e){return Array.isArray(e)?e:gr(e)?[]:[e]}function bn(e,r){var n,t,i,l;if(r)for(l=Object.keys(r),n=0,t=l.length;n<t;n+=1)i=l[n],e[i]=r[i];return e}function wn(e,r){var n="",t;for(t=0;t<r;t+=1)n+=e;return n}function vn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var An=gr,Cn=xn,Sn=yn,Tn=wn,kn=vn,Fn=bn,v={isNothing:An,isObject:Cn,toArray:Sn,repeat:Tn,isNegativeZero:kn,extend:Fn};function xr(e,r){var n="",t=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(n+=`
687
+ </html>`}finally{try{c&&await c.close()}finally{globalThis.platform=s}}}async exportToBuffer(r,n={}){let t=await this.exportToString(r,n);return Buffer.from(t,"utf8")}};import*as B from"fs";import*as k from"path";function hr(e){return typeof e>"u"||e===null}function xn(e){return typeof e=="object"&&e!==null}function yn(e){return Array.isArray(e)?e:hr(e)?[]:[e]}function bn(e,r){var n,t,i,l;if(r)for(l=Object.keys(r),n=0,t=l.length;n<t;n+=1)i=l[n],e[i]=r[i];return e}function wn(e,r){var n="",t;for(t=0;t<r;t+=1)n+=e;return n}function vn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var An=hr,Cn=xn,Sn=yn,Tn=wn,kn=vn,Fn=bn,v={isNothing:An,isObject:Cn,toArray:Sn,repeat:Tn,isNegativeZero:kn,extend:Fn};function gr(e,r){var n="",t=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(n+=`
688
688
 
689
- `+e.mark.snippet),t+" "+n):t}function te(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=xr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}te.prototype=Object.create(Error.prototype);te.prototype.constructor=te;te.prototype.toString=function(r){return this.name+": "+xr(this,r)};var _=te;function Le(e,r,n,t,i){var l="",o="",a=Math.floor(i/2)-1;return t-r>a&&(l=" ... ",r=t-a+l.length),n-t>a&&(o=" ...",n=t+a-o.length),{str:l+e.slice(r,n).replace(/\t/g,"\u2192")+o,pos:t-r+l.length}}function Ie(e,r){return v.repeat(" ",r-e.length)+e}function _n(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,t=[0],i=[],l,o=-1;l=n.exec(e.buffer);)i.push(l.index),t.push(l.index+l[0].length),e.position<=l.index&&o<0&&(o=t.length-2);o<0&&(o=t.length-1);var a="",s,c,f=Math.min(e.line+r.linesAfter,i.length).toString().length,u=r.maxLength-(r.indent+f+3);for(s=1;s<=r.linesBefore&&!(o-s<0);s++)c=Le(e.buffer,t[o-s],i[o-s],e.position-(t[o]-t[o-s]),u),a=v.repeat(" ",r.indent)+Ie((e.line-s+1).toString(),f)+" | "+c.str+`
689
+ `+e.mark.snippet),t+" "+n):t}function te(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=gr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}te.prototype=Object.create(Error.prototype);te.prototype.constructor=te;te.prototype.toString=function(r){return this.name+": "+gr(this,r)};var _=te;function Le(e,r,n,t,i){var l="",o="",a=Math.floor(i/2)-1;return t-r>a&&(l=" ... ",r=t-a+l.length),n-t>a&&(o=" ...",n=t+a-o.length),{str:l+e.slice(r,n).replace(/\t/g,"\u2192")+o,pos:t-r+l.length}}function Ie(e,r){return v.repeat(" ",r-e.length)+e}function _n(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,t=[0],i=[],l,o=-1;l=n.exec(e.buffer);)i.push(l.index),t.push(l.index+l[0].length),e.position<=l.index&&o<0&&(o=t.length-2);o<0&&(o=t.length-1);var a="",s,c,f=Math.min(e.line+r.linesAfter,i.length).toString().length,u=r.maxLength-(r.indent+f+3);for(s=1;s<=r.linesBefore&&!(o-s<0);s++)c=Le(e.buffer,t[o-s],i[o-s],e.position-(t[o]-t[o-s]),u),a=v.repeat(" ",r.indent)+Ie((e.line-s+1).toString(),f)+" | "+c.str+`
690
690
  `+a;for(c=Le(e.buffer,t[o],i[o],e.position,u),a+=v.repeat(" ",r.indent)+Ie((e.line+1).toString(),f)+" | "+c.str+`
691
691
  `,a+=v.repeat("-",r.indent+f+3+c.pos)+`^
692
692
  `,s=1;s<=r.linesAfter&&!(o+s>=i.length);s++)c=Le(e.buffer,t[o+s],i[o+s],e.position-(t[o]-t[o+s]),u),a+=v.repeat(" ",r.indent)+Ie((e.line+s+1).toString(),f)+" | "+c.str+`
693
- `;return a.replace(/\n$/,"")}var En=_n,On=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Pn=["scalar","sequence","mapping"];function Ln(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(t){r[String(t)]=n})}),r}function In(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(On.indexOf(n)===-1)throw new _('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Ln(r.styleAliases||null),Pn.indexOf(this.kind)===-1)throw new _('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var C=In;function rr(e,r){var n=[];return e[r].forEach(function(t){var i=n.length;n.forEach(function(l,o){l.tag===t.tag&&l.kind===t.kind&&l.multi===t.multi&&(i=o)}),n[i]=t}),n}function jn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function t(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(t);return e}function Me(e){return this.extend(e)}Me.prototype.extend=function(r){var n=[],t=[];if(r instanceof C)t.push(r);else if(Array.isArray(r))t=t.concat(r);else if(r&&(Array.isArray(r.implicit)||Array.isArray(r.explicit)))r.implicit&&(n=n.concat(r.implicit)),r.explicit&&(t=t.concat(r.explicit));else throw new _("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof C))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new _("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new _("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),t.forEach(function(l){if(!(l instanceof C))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Me.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(t),i.compiledImplicit=rr(i,"implicit"),i.compiledExplicit=rr(i,"explicit"),i.compiledTypeMap=jn(i.compiledImplicit,i.compiledExplicit),i};var yr=Me,br=new C("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),wr=new C("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),vr=new C("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ar=new yr({explicit:[br,wr,vr]});function Mn(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Dn(){return null}function Rn(e){return e===null}var Cr=new C("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mn,construct:Dn,predicate:Rn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Bn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Nn(e){return e==="true"||e==="True"||e==="TRUE"}function Hn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Sr=new C("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Bn,construct:Nn,predicate:Hn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function $n(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function zn(e){return 48<=e&&e<=55}function Un(e){return 48<=e&&e<=57}function Yn(e){if(e===null)return!1;var r=e.length,n=0,t=!1,i;if(!r)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===r)return!0;if(i=e[++n],i==="b"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;t=!0}return t&&i!=="_"}if(i==="x"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!$n(e.charCodeAt(n)))return!1;t=!0}return t&&i!=="_"}if(i==="o"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!zn(e.charCodeAt(n)))return!1;t=!0}return t&&i!=="_"}}if(i==="_")return!1;for(;n<r;n++)if(i=e[n],i!=="_"){if(!Un(e.charCodeAt(n)))return!1;t=!0}return!(!t||i==="_")}function qn(e){var r=e,n=1,t;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),t=r[0],(t==="-"||t==="+")&&(t==="-"&&(n=-1),r=r.slice(1),t=r[0]),r==="0")return 0;if(t==="0"){if(r[1]==="b")return n*parseInt(r.slice(2),2);if(r[1]==="x")return n*parseInt(r.slice(2),16);if(r[1]==="o")return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)}function Gn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!v.isNegativeZero(e)}var Tr=new C("tag:yaml.org,2002:int",{kind:"scalar",resolve:Yn,construct:qn,predicate:Gn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Wn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Vn(e){return!(e===null||!Wn.test(e)||e[e.length-1]==="_")}function Kn(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}var Jn=/^[-+]?[0-9]+e/;function Xn(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(v.isNegativeZero(e))return"-0.0";return n=e.toString(10),Jn.test(n)?n.replace("e",".e"):n}function Qn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||v.isNegativeZero(e))}var kr=new C("tag:yaml.org,2002:float",{kind:"scalar",resolve:Vn,construct:Kn,predicate:Qn,represent:Xn,defaultStyle:"lowercase"}),Fr=Ar.extend({implicit:[Cr,Sr,Tr,kr]}),_r=Fr,Er=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Or=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Zn(e){return e===null?!1:Er.exec(e)!==null||Or.exec(e)!==null}function ei(e){var r,n,t,i,l,o,a,s=0,c=null,f,u,d;if(r=Er.exec(e),r===null&&(r=Or.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],t=+r[2]-1,i=+r[3],!r[4])return new Date(Date.UTC(n,t,i));if(l=+r[4],o=+r[5],a=+r[6],r[7]){for(s=r[7].slice(0,3);s.length<3;)s+="0";s=+s}return r[9]&&(f=+r[10],u=+(r[11]||0),c=(f*60+u)*6e4,r[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,t,i,l,o,a,s)),c&&d.setTime(d.getTime()-c),d}function ri(e){return e.toISOString()}var Pr=new C("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Zn,construct:ei,instanceOf:Date,represent:ri});function ni(e){return e==="<<"||e===null}var Lr=new C("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ni}),He=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
694
- \r`;function ii(e){if(e===null)return!1;var r,n,t=0,i=e.length,l=He;for(n=0;n<i;n++)if(r=l.indexOf(e.charAt(n)),!(r>64)){if(r<0)return!1;t+=6}return t%8===0}function ti(e){var r,n,t=e.replace(/[\r\n=]/g,""),i=t.length,l=He,o=0,a=[];for(r=0;r<i;r++)r%4===0&&r&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|l.indexOf(t.charAt(r));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function oi(e){var r="",n=0,t,i,l=e.length,o=He;for(t=0;t<l;t++)t%3===0&&t&&(r+=o[n>>18&63],r+=o[n>>12&63],r+=o[n>>6&63],r+=o[n&63]),n=(n<<8)+e[t];return i=l%3,i===0?(r+=o[n>>18&63],r+=o[n>>12&63],r+=o[n>>6&63],r+=o[n&63]):i===2?(r+=o[n>>10&63],r+=o[n>>4&63],r+=o[n<<2&63],r+=o[64]):i===1&&(r+=o[n>>2&63],r+=o[n<<4&63],r+=o[64],r+=o[64]),r}function ai(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Ir=new C("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ii,construct:ti,predicate:ai,represent:oi}),li=Object.prototype.hasOwnProperty,si=Object.prototype.toString;function ci(e){if(e===null)return!0;var r=[],n,t,i,l,o,a=e;for(n=0,t=a.length;n<t;n+=1){if(i=a[n],o=!1,si.call(i)!=="[object Object]")return!1;for(l in i)if(li.call(i,l))if(!o)o=!0;else return!1;if(!o)return!1;if(r.indexOf(l)===-1)r.push(l);else return!1}return!0}function ui(e){return e!==null?e:[]}var jr=new C("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ci,construct:ui}),fi=Object.prototype.toString;function di(e){if(e===null)return!0;var r,n,t,i,l,o=e;for(l=new Array(o.length),r=0,n=o.length;r<n;r+=1){if(t=o[r],fi.call(t)!=="[object Object]"||(i=Object.keys(t),i.length!==1))return!1;l[r]=[i[0],t[i[0]]]}return!0}function pi(e){if(e===null)return[];var r,n,t,i,l,o=e;for(l=new Array(o.length),r=0,n=o.length;r<n;r+=1)t=o[r],i=Object.keys(t),l[r]=[i[0],t[i[0]]];return l}var Mr=new C("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:di,construct:pi}),mi=Object.prototype.hasOwnProperty;function hi(e){if(e===null)return!0;var r,n=e;for(r in n)if(mi.call(n,r)&&n[r]!==null)return!1;return!0}function gi(e){return e!==null?e:{}}var Dr=new C("tag:yaml.org,2002:set",{kind:"mapping",resolve:hi,construct:gi}),$e=_r.extend({implicit:[Pr,Lr],explicit:[Ir,jr,Mr,Dr]}),H=Object.prototype.hasOwnProperty,ge=1,Rr=2,Br=3,xe=4,je=1,xi=2,nr=3,yi=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,bi=/[\x85\u2028\u2029]/,wi=/[,\[\]\{\}]/,Nr=/^(?:!|!!|![a-z\-]+!)$/i,Hr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ir(e){return Object.prototype.toString.call(e)}function D(e){return e===10||e===13}function G(e){return e===9||e===32}function O(e){return e===9||e===32||e===10||e===13}function X(e){return e===44||e===91||e===93||e===123||e===125}function vi(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Ai(e){return e===120?2:e===117?4:e===85?8:0}function Ci(e){return 48<=e&&e<=57?e-48:-1}function tr(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
695
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Si(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function $r(e,r,n){r==="__proto__"?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[r]=n}var zr=new Array(256),Ur=new Array(256);for(q=0;q<256;q++)zr[q]=tr(q)?1:0,Ur[q]=tr(q);var q;function Ti(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||$e,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Yr(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=En(n),new _(r,n)}function m(e,r){throw Yr(e,r)}function ye(e,r){e.onWarning&&e.onWarning.call(null,Yr(e,r))}var or={YAML:function(r,n,t){var i,l,o;r.version!==null&&m(r,"duplication of %YAML directive"),t.length!==1&&m(r,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(t[0]),i===null&&m(r,"ill-formed argument of the YAML directive"),l=parseInt(i[1],10),o=parseInt(i[2],10),l!==1&&m(r,"unacceptable YAML version of the document"),r.version=t[0],r.checkLineBreaks=o<2,o!==1&&o!==2&&ye(r,"unsupported YAML version of the document")},TAG:function(r,n,t){var i,l;t.length!==2&&m(r,"TAG directive accepts exactly two arguments"),i=t[0],l=t[1],Nr.test(i)||m(r,"ill-formed tag handle (first argument) of the TAG directive"),H.call(r.tagMap,i)&&m(r,'there is a previously declared suffix for "'+i+'" tag handle'),Hr.test(l)||m(r,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{m(r,"tag prefix is malformed: "+l)}r.tagMap[i]=l}};function N(e,r,n,t){var i,l,o,a;if(r<n){if(a=e.input.slice(r,n),t)for(i=0,l=a.length;i<l;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||m(e,"expected valid JSON character");else yi.test(a)&&m(e,"the stream contains non-printable characters");e.result+=a}}function ar(e,r,n,t){var i,l,o,a;for(v.isObject(n)||m(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)l=i[o],H.call(r,l)||($r(r,l,n[l]),t[l]=!0)}function Q(e,r,n,t,i,l,o,a,s){var c,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,f=i.length;c<f;c+=1)Array.isArray(i[c])&&m(e,"nested arrays are not supported inside keys"),typeof i=="object"&&ir(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&ir(i)==="[object Object]"&&(i="[object Object]"),i=String(i),r===null&&(r={}),t==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(c=0,f=l.length;c<f;c+=1)ar(e,r,l[c],n);else ar(e,r,l,n);else!e.json&&!H.call(n,i)&&H.call(r,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=s||e.position,m(e,"duplicated mapping key")),$r(r,i,l),delete n[i];return r}function ze(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):m(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function b(e,r,n){for(var t=0,i=e.input.charCodeAt(e.position);i!==0;){for(;G(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(r&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(D(i))for(ze(e),i=e.input.charCodeAt(e.position),t++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&t!==0&&e.lineIndent<n&&ye(e,"deficient indentation"),t}function ve(e){var r=e.position,n;return n=e.input.charCodeAt(r),!!((n===45||n===46)&&n===e.input.charCodeAt(r+1)&&n===e.input.charCodeAt(r+2)&&(r+=3,n=e.input.charCodeAt(r),n===0||O(n)))}function Ue(e,r){r===1?e.result+=" ":r>1&&(e.result+=v.repeat(`
696
- `,r-1))}function ki(e,r,n){var t,i,l,o,a,s,c,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),O(p)||X(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),O(i)||n&&X(i)))return!1;for(e.kind="scalar",e.result="",l=o=e.position,a=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),O(i)||n&&X(i))break}else if(p===35){if(t=e.input.charCodeAt(e.position-1),O(t))break}else{if(e.position===e.lineStart&&ve(e)||n&&X(p))break;if(D(p))if(s=e.line,c=e.lineStart,f=e.lineIndent,b(e,!1,-1),e.lineIndent>=r){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=s,e.lineStart=c,e.lineIndent=f;break}}a&&(N(e,l,o,!1),Ue(e,e.line-s),l=o=e.position,a=!1),G(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return N(e,l,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function Fi(e,r){var n,t,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,t=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(N(e,t,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)t=e.position,e.position++,i=e.position;else return!0;else D(n)?(N(e,t,i,!0),Ue(e,b(e,!1,r)),t=i=e.position):e.position===e.lineStart&&ve(e)?m(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);m(e,"unexpected end of the stream within a single quoted scalar")}function _i(e,r){var n,t,i,l,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=t=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return N(e,n,e.position,!0),e.position++,!0;if(a===92){if(N(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),D(a))b(e,!1,r);else if(a<256&&zr[a])e.result+=Ur[a],e.position++;else if((o=Ai(a))>0){for(i=o,l=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=vi(a))>=0?l=(l<<4)+o:m(e,"expected hexadecimal character");e.result+=Si(l),e.position++}else m(e,"unknown escape sequence");n=t=e.position}else D(a)?(N(e,n,t,!0),Ue(e,b(e,!1,r)),n=t=e.position):e.position===e.lineStart&&ve(e)?m(e,"unexpected end of the document within a double quoted scalar"):(e.position++,t=e.position)}m(e,"unexpected end of the stream within a double quoted scalar")}function Ei(e,r){var n=!0,t,i,l,o=e.tag,a,s=e.anchor,c,f,u,d,p,g=Object.create(null),h,x,w,y;if(y=e.input.charCodeAt(e.position),y===91)f=93,p=!1,a=[];else if(y===123)f=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),y=e.input.charCodeAt(++e.position);y!==0;){if(b(e,!0,r),y=e.input.charCodeAt(e.position),y===f)return e.position++,e.tag=o,e.anchor=s,e.kind=p?"mapping":"sequence",e.result=a,!0;n?y===44&&m(e,"expected the node content, but found ','"):m(e,"missed comma between flow collection entries"),x=h=w=null,u=d=!1,y===63&&(c=e.input.charCodeAt(e.position+1),O(c)&&(u=d=!0,e.position++,b(e,!0,r))),t=e.line,i=e.lineStart,l=e.position,Z(e,r,ge,!1,!0),x=e.tag,h=e.result,b(e,!0,r),y=e.input.charCodeAt(e.position),(d||e.line===t)&&y===58&&(u=!0,y=e.input.charCodeAt(++e.position),b(e,!0,r),Z(e,r,ge,!1,!0),w=e.result),p?Q(e,a,g,x,h,w,t,i,l):u?a.push(Q(e,null,g,x,h,w,t,i,l)):a.push(h),b(e,!0,r),y=e.input.charCodeAt(e.position),y===44?(n=!0,y=e.input.charCodeAt(++e.position)):n=!1}m(e,"unexpected end of the stream within a flow collection")}function Oi(e,r){var n,t,i=je,l=!1,o=!1,a=r,s=0,c=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)t=!1;else if(u===62)t=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)je===i?i=u===43?nr:xi:m(e,"repeat of a chomping mode identifier");else if((f=Ci(u))>=0)f===0?m(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?m(e,"repeat of an indentation width identifier"):(a=r+f-1,o=!0);else break;if(G(u)){do u=e.input.charCodeAt(++e.position);while(G(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!D(u)&&u!==0)}for(;u!==0;){for(ze(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),D(u)){s++;continue}if(e.lineIndent<a){i===nr?e.result+=v.repeat(`
693
+ `;return a.replace(/\n$/,"")}var En=_n,On=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Pn=["scalar","sequence","mapping"];function Ln(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(t){r[String(t)]=n})}),r}function In(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(On.indexOf(n)===-1)throw new _('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Ln(r.styleAliases||null),Pn.indexOf(this.kind)===-1)throw new _('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var C=In;function er(e,r){var n=[];return e[r].forEach(function(t){var i=n.length;n.forEach(function(l,o){l.tag===t.tag&&l.kind===t.kind&&l.multi===t.multi&&(i=o)}),n[i]=t}),n}function jn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function t(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(t);return e}function Me(e){return this.extend(e)}Me.prototype.extend=function(r){var n=[],t=[];if(r instanceof C)t.push(r);else if(Array.isArray(r))t=t.concat(r);else if(r&&(Array.isArray(r.implicit)||Array.isArray(r.explicit)))r.implicit&&(n=n.concat(r.implicit)),r.explicit&&(t=t.concat(r.explicit));else throw new _("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof C))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new _("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new _("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),t.forEach(function(l){if(!(l instanceof C))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Me.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(t),i.compiledImplicit=er(i,"implicit"),i.compiledExplicit=er(i,"explicit"),i.compiledTypeMap=jn(i.compiledImplicit,i.compiledExplicit),i};var xr=Me,yr=new C("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),br=new C("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),wr=new C("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),vr=new xr({explicit:[yr,br,wr]});function Mn(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Dn(){return null}function Rn(e){return e===null}var Ar=new C("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mn,construct:Dn,predicate:Rn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Bn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Nn(e){return e==="true"||e==="True"||e==="TRUE"}function Hn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Cr=new C("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Bn,construct:Nn,predicate:Hn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function $n(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function zn(e){return 48<=e&&e<=55}function Un(e){return 48<=e&&e<=57}function Yn(e){if(e===null)return!1;var r=e.length,n=0,t=!1,i;if(!r)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===r)return!0;if(i=e[++n],i==="b"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;t=!0}return t&&i!=="_"}if(i==="x"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!$n(e.charCodeAt(n)))return!1;t=!0}return t&&i!=="_"}if(i==="o"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!zn(e.charCodeAt(n)))return!1;t=!0}return t&&i!=="_"}}if(i==="_")return!1;for(;n<r;n++)if(i=e[n],i!=="_"){if(!Un(e.charCodeAt(n)))return!1;t=!0}return!(!t||i==="_")}function qn(e){var r=e,n=1,t;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),t=r[0],(t==="-"||t==="+")&&(t==="-"&&(n=-1),r=r.slice(1),t=r[0]),r==="0")return 0;if(t==="0"){if(r[1]==="b")return n*parseInt(r.slice(2),2);if(r[1]==="x")return n*parseInt(r.slice(2),16);if(r[1]==="o")return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)}function Gn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!v.isNegativeZero(e)}var Sr=new C("tag:yaml.org,2002:int",{kind:"scalar",resolve:Yn,construct:qn,predicate:Gn,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Wn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Vn(e){return!(e===null||!Wn.test(e)||e[e.length-1]==="_")}function Kn(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}var Jn=/^[-+]?[0-9]+e/;function Xn(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(v.isNegativeZero(e))return"-0.0";return n=e.toString(10),Jn.test(n)?n.replace("e",".e"):n}function Qn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||v.isNegativeZero(e))}var Tr=new C("tag:yaml.org,2002:float",{kind:"scalar",resolve:Vn,construct:Kn,predicate:Qn,represent:Xn,defaultStyle:"lowercase"}),kr=vr.extend({implicit:[Ar,Cr,Sr,Tr]}),Fr=kr,_r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Er=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Zn(e){return e===null?!1:_r.exec(e)!==null||Er.exec(e)!==null}function ei(e){var r,n,t,i,l,o,a,s=0,c=null,f,u,d;if(r=_r.exec(e),r===null&&(r=Er.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],t=+r[2]-1,i=+r[3],!r[4])return new Date(Date.UTC(n,t,i));if(l=+r[4],o=+r[5],a=+r[6],r[7]){for(s=r[7].slice(0,3);s.length<3;)s+="0";s=+s}return r[9]&&(f=+r[10],u=+(r[11]||0),c=(f*60+u)*6e4,r[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,t,i,l,o,a,s)),c&&d.setTime(d.getTime()-c),d}function ri(e){return e.toISOString()}var Or=new C("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Zn,construct:ei,instanceOf:Date,represent:ri});function ni(e){return e==="<<"||e===null}var Pr=new C("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ni}),He=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
694
+ \r`;function ii(e){if(e===null)return!1;var r,n,t=0,i=e.length,l=He;for(n=0;n<i;n++)if(r=l.indexOf(e.charAt(n)),!(r>64)){if(r<0)return!1;t+=6}return t%8===0}function ti(e){var r,n,t=e.replace(/[\r\n=]/g,""),i=t.length,l=He,o=0,a=[];for(r=0;r<i;r++)r%4===0&&r&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|l.indexOf(t.charAt(r));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function oi(e){var r="",n=0,t,i,l=e.length,o=He;for(t=0;t<l;t++)t%3===0&&t&&(r+=o[n>>18&63],r+=o[n>>12&63],r+=o[n>>6&63],r+=o[n&63]),n=(n<<8)+e[t];return i=l%3,i===0?(r+=o[n>>18&63],r+=o[n>>12&63],r+=o[n>>6&63],r+=o[n&63]):i===2?(r+=o[n>>10&63],r+=o[n>>4&63],r+=o[n<<2&63],r+=o[64]):i===1&&(r+=o[n>>2&63],r+=o[n<<4&63],r+=o[64],r+=o[64]),r}function ai(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Lr=new C("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ii,construct:ti,predicate:ai,represent:oi}),li=Object.prototype.hasOwnProperty,si=Object.prototype.toString;function ci(e){if(e===null)return!0;var r=[],n,t,i,l,o,a=e;for(n=0,t=a.length;n<t;n+=1){if(i=a[n],o=!1,si.call(i)!=="[object Object]")return!1;for(l in i)if(li.call(i,l))if(!o)o=!0;else return!1;if(!o)return!1;if(r.indexOf(l)===-1)r.push(l);else return!1}return!0}function ui(e){return e!==null?e:[]}var Ir=new C("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ci,construct:ui}),fi=Object.prototype.toString;function di(e){if(e===null)return!0;var r,n,t,i,l,o=e;for(l=new Array(o.length),r=0,n=o.length;r<n;r+=1){if(t=o[r],fi.call(t)!=="[object Object]"||(i=Object.keys(t),i.length!==1))return!1;l[r]=[i[0],t[i[0]]]}return!0}function pi(e){if(e===null)return[];var r,n,t,i,l,o=e;for(l=new Array(o.length),r=0,n=o.length;r<n;r+=1)t=o[r],i=Object.keys(t),l[r]=[i[0],t[i[0]]];return l}var jr=new C("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:di,construct:pi}),mi=Object.prototype.hasOwnProperty;function hi(e){if(e===null)return!0;var r,n=e;for(r in n)if(mi.call(n,r)&&n[r]!==null)return!1;return!0}function gi(e){return e!==null?e:{}}var Mr=new C("tag:yaml.org,2002:set",{kind:"mapping",resolve:hi,construct:gi}),$e=Fr.extend({implicit:[Or,Pr],explicit:[Lr,Ir,jr,Mr]}),H=Object.prototype.hasOwnProperty,xe=1,Dr=2,Rr=3,ye=4,je=1,xi=2,rr=3,yi=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,bi=/[\x85\u2028\u2029]/,wi=/[,\[\]\{\}]/,Br=/^(?:!|!!|![a-z\-]+!)$/i,Nr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function nr(e){return Object.prototype.toString.call(e)}function D(e){return e===10||e===13}function G(e){return e===9||e===32}function O(e){return e===9||e===32||e===10||e===13}function X(e){return e===44||e===91||e===93||e===123||e===125}function vi(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Ai(e){return e===120?2:e===117?4:e===85?8:0}function Ci(e){return 48<=e&&e<=57?e-48:-1}function ir(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
695
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Si(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Hr(e,r,n){r==="__proto__"?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[r]=n}var $r=new Array(256),zr=new Array(256);for(q=0;q<256;q++)$r[q]=ir(q)?1:0,zr[q]=ir(q);var q;function Ti(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||$e,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ur(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=En(n),new _(r,n)}function m(e,r){throw Ur(e,r)}function be(e,r){e.onWarning&&e.onWarning.call(null,Ur(e,r))}var tr={YAML:function(r,n,t){var i,l,o;r.version!==null&&m(r,"duplication of %YAML directive"),t.length!==1&&m(r,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(t[0]),i===null&&m(r,"ill-formed argument of the YAML directive"),l=parseInt(i[1],10),o=parseInt(i[2],10),l!==1&&m(r,"unacceptable YAML version of the document"),r.version=t[0],r.checkLineBreaks=o<2,o!==1&&o!==2&&be(r,"unsupported YAML version of the document")},TAG:function(r,n,t){var i,l;t.length!==2&&m(r,"TAG directive accepts exactly two arguments"),i=t[0],l=t[1],Br.test(i)||m(r,"ill-formed tag handle (first argument) of the TAG directive"),H.call(r.tagMap,i)&&m(r,'there is a previously declared suffix for "'+i+'" tag handle'),Nr.test(l)||m(r,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{m(r,"tag prefix is malformed: "+l)}r.tagMap[i]=l}};function N(e,r,n,t){var i,l,o,a;if(r<n){if(a=e.input.slice(r,n),t)for(i=0,l=a.length;i<l;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||m(e,"expected valid JSON character");else yi.test(a)&&m(e,"the stream contains non-printable characters");e.result+=a}}function or(e,r,n,t){var i,l,o,a;for(v.isObject(n)||m(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)l=i[o],H.call(r,l)||(Hr(r,l,n[l]),t[l]=!0)}function Q(e,r,n,t,i,l,o,a,s){var c,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,f=i.length;c<f;c+=1)Array.isArray(i[c])&&m(e,"nested arrays are not supported inside keys"),typeof i=="object"&&nr(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&nr(i)==="[object Object]"&&(i="[object Object]"),i=String(i),r===null&&(r={}),t==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(c=0,f=l.length;c<f;c+=1)or(e,r,l[c],n);else or(e,r,l,n);else!e.json&&!H.call(n,i)&&H.call(r,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=s||e.position,m(e,"duplicated mapping key")),Hr(r,i,l),delete n[i];return r}function ze(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):m(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function b(e,r,n){for(var t=0,i=e.input.charCodeAt(e.position);i!==0;){for(;G(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(r&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(D(i))for(ze(e),i=e.input.charCodeAt(e.position),t++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&t!==0&&e.lineIndent<n&&be(e,"deficient indentation"),t}function Ae(e){var r=e.position,n;return n=e.input.charCodeAt(r),!!((n===45||n===46)&&n===e.input.charCodeAt(r+1)&&n===e.input.charCodeAt(r+2)&&(r+=3,n=e.input.charCodeAt(r),n===0||O(n)))}function Ue(e,r){r===1?e.result+=" ":r>1&&(e.result+=v.repeat(`
696
+ `,r-1))}function ki(e,r,n){var t,i,l,o,a,s,c,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),O(p)||X(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),O(i)||n&&X(i)))return!1;for(e.kind="scalar",e.result="",l=o=e.position,a=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),O(i)||n&&X(i))break}else if(p===35){if(t=e.input.charCodeAt(e.position-1),O(t))break}else{if(e.position===e.lineStart&&Ae(e)||n&&X(p))break;if(D(p))if(s=e.line,c=e.lineStart,f=e.lineIndent,b(e,!1,-1),e.lineIndent>=r){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=s,e.lineStart=c,e.lineIndent=f;break}}a&&(N(e,l,o,!1),Ue(e,e.line-s),l=o=e.position,a=!1),G(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return N(e,l,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function Fi(e,r){var n,t,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,t=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(N(e,t,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)t=e.position,e.position++,i=e.position;else return!0;else D(n)?(N(e,t,i,!0),Ue(e,b(e,!1,r)),t=i=e.position):e.position===e.lineStart&&Ae(e)?m(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);m(e,"unexpected end of the stream within a single quoted scalar")}function _i(e,r){var n,t,i,l,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=t=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return N(e,n,e.position,!0),e.position++,!0;if(a===92){if(N(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),D(a))b(e,!1,r);else if(a<256&&$r[a])e.result+=zr[a],e.position++;else if((o=Ai(a))>0){for(i=o,l=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=vi(a))>=0?l=(l<<4)+o:m(e,"expected hexadecimal character");e.result+=Si(l),e.position++}else m(e,"unknown escape sequence");n=t=e.position}else D(a)?(N(e,n,t,!0),Ue(e,b(e,!1,r)),n=t=e.position):e.position===e.lineStart&&Ae(e)?m(e,"unexpected end of the document within a double quoted scalar"):(e.position++,t=e.position)}m(e,"unexpected end of the stream within a double quoted scalar")}function Ei(e,r){var n=!0,t,i,l,o=e.tag,a,s=e.anchor,c,f,u,d,p,g=Object.create(null),h,x,w,y;if(y=e.input.charCodeAt(e.position),y===91)f=93,p=!1,a=[];else if(y===123)f=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),y=e.input.charCodeAt(++e.position);y!==0;){if(b(e,!0,r),y=e.input.charCodeAt(e.position),y===f)return e.position++,e.tag=o,e.anchor=s,e.kind=p?"mapping":"sequence",e.result=a,!0;n?y===44&&m(e,"expected the node content, but found ','"):m(e,"missed comma between flow collection entries"),x=h=w=null,u=d=!1,y===63&&(c=e.input.charCodeAt(e.position+1),O(c)&&(u=d=!0,e.position++,b(e,!0,r))),t=e.line,i=e.lineStart,l=e.position,Z(e,r,xe,!1,!0),x=e.tag,h=e.result,b(e,!0,r),y=e.input.charCodeAt(e.position),(d||e.line===t)&&y===58&&(u=!0,y=e.input.charCodeAt(++e.position),b(e,!0,r),Z(e,r,xe,!1,!0),w=e.result),p?Q(e,a,g,x,h,w,t,i,l):u?a.push(Q(e,null,g,x,h,w,t,i,l)):a.push(h),b(e,!0,r),y=e.input.charCodeAt(e.position),y===44?(n=!0,y=e.input.charCodeAt(++e.position)):n=!1}m(e,"unexpected end of the stream within a flow collection")}function Oi(e,r){var n,t,i=je,l=!1,o=!1,a=r,s=0,c=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)t=!1;else if(u===62)t=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)je===i?i=u===43?rr:xi:m(e,"repeat of a chomping mode identifier");else if((f=Ci(u))>=0)f===0?m(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?m(e,"repeat of an indentation width identifier"):(a=r+f-1,o=!0);else break;if(G(u)){do u=e.input.charCodeAt(++e.position);while(G(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!D(u)&&u!==0)}for(;u!==0;){for(ze(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),D(u)){s++;continue}if(e.lineIndent<a){i===rr?e.result+=v.repeat(`
697
697
  `,l?1+s:s):i===je&&l&&(e.result+=`
698
698
  `);break}for(t?G(u)?(c=!0,e.result+=v.repeat(`
699
699
  `,l?1+s:s)):c?(c=!1,e.result+=v.repeat(`
700
700
  `,s+1)):s===0?l&&(e.result+=" "):e.result+=v.repeat(`
701
701
  `,s):e.result+=v.repeat(`
702
- `,l?1+s:s),l=!0,o=!0,s=0,n=e.position;!D(u)&&u!==0;)u=e.input.charCodeAt(++e.position);N(e,n,e.position,!1)}return!0}function lr(e,r){var n,t=e.tag,i=e.anchor,l=[],o,a=!1,s;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),s=e.input.charCodeAt(e.position);s!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,m(e,"tab characters must not be used in indentation")),!(s!==45||(o=e.input.charCodeAt(e.position+1),!O(o))));){if(a=!0,e.position++,b(e,!0,-1)&&e.lineIndent<=r){l.push(null),s=e.input.charCodeAt(e.position);continue}if(n=e.line,Z(e,r,Br,!1,!0),l.push(e.result),b(e,!0,-1),s=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>r)&&s!==0)m(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return a?(e.tag=t,e.anchor=i,e.kind="sequence",e.result=l,!0):!1}function Pi(e,r,n){var t,i,l,o,a,s,c=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,g=null,h=null,x=!1,w=!1,y;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),y=e.input.charCodeAt(e.position);y!==0;){if(!x&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,m(e,"tab characters must not be used in indentation")),t=e.input.charCodeAt(e.position+1),l=e.line,(y===63||y===58)&&O(t))y===63?(x&&(Q(e,u,d,p,g,null,o,a,s),p=g=h=null),w=!0,x=!0,i=!0):x?(x=!1,i=!0):m(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,y=t;else{if(o=e.line,a=e.lineStart,s=e.position,!Z(e,n,Rr,!1,!0))break;if(e.line===l){for(y=e.input.charCodeAt(e.position);G(y);)y=e.input.charCodeAt(++e.position);if(y===58)y=e.input.charCodeAt(++e.position),O(y)||m(e,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(Q(e,u,d,p,g,null,o,a,s),p=g=h=null),w=!0,x=!1,i=!1,p=e.tag,g=e.result;else if(w)m(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(w)m(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===l||e.lineIndent>r)&&(x&&(o=e.line,a=e.lineStart,s=e.position),Z(e,r,xe,!0,i)&&(x?g=e.result:h=e.result),x||(Q(e,u,d,p,g,h,o,a,s),p=g=h=null),b(e,!0,-1),y=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>r)&&y!==0)m(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return x&&Q(e,u,d,p,g,null,o,a,s),w&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),w}function Li(e){var r,n=!1,t=!1,i,l,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&m(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(t=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",r=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(l=e.input.slice(r,e.position),o=e.input.charCodeAt(++e.position)):m(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!O(o);)o===33&&(t?m(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(r-1,e.position+1),Nr.test(i)||m(e,"named tag handle cannot contain such characters"),t=!0,r=e.position+1)),o=e.input.charCodeAt(++e.position);l=e.input.slice(r,e.position),wi.test(l)&&m(e,"tag suffix cannot contain flow indicator characters")}l&&!Hr.test(l)&&m(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{m(e,"tag name is malformed: "+l)}return n?e.tag=l:H.call(e.tagMap,i)?e.tag=e.tagMap[i]+l:i==="!"?e.tag="!"+l:i==="!!"?e.tag="tag:yaml.org,2002:"+l:m(e,'undeclared tag handle "'+i+'"'),!0}function Ii(e){var r,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&m(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),r=e.position;n!==0&&!O(n)&&!X(n);)n=e.input.charCodeAt(++e.position);return e.position===r&&m(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function ji(e){var r,n,t;if(t=e.input.charCodeAt(e.position),t!==42)return!1;for(t=e.input.charCodeAt(++e.position),r=e.position;t!==0&&!O(t)&&!X(t);)t=e.input.charCodeAt(++e.position);return e.position===r&&m(e,"name of an alias node must contain at least one character"),n=e.input.slice(r,e.position),H.call(e.anchorMap,n)||m(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],b(e,!0,-1),!0}function Z(e,r,n,t,i){var l,o,a,s=1,c=!1,f=!1,u,d,p,g,h,x;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=o=a=xe===n||Br===n,t&&b(e,!0,-1)&&(c=!0,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)),s===1)for(;Li(e)||Ii(e);)b(e,!0,-1)?(c=!0,a=l,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)):a=!1;if(a&&(a=c||i),(s===1||xe===n)&&(ge===n||Rr===n?h=r:h=r+1,x=e.position-e.lineStart,s===1?a&&(lr(e,x)||Pi(e,x,h))||Ei(e,h)?f=!0:(o&&Oi(e,h)||Fi(e,h)||_i(e,h)?f=!0:ji(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&m(e,"alias node should not have any properties")):ki(e,h,ge===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):s===0&&(f=a&&lr(e,x))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&m(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(H.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,p=e.typeMap.multi[e.kind||"fallback"],u=0,d=p.length;u<d;u+=1)if(e.tag.slice(0,p[u].tag.length)===p[u].tag){g=p[u];break}g||m(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&m(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Mi(e){var r=e.position,n,t,i,l=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(b(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(l=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!O(o);)o=e.input.charCodeAt(++e.position);for(t=e.input.slice(n,e.position),i=[],t.length<1&&m(e,"directive name must not be less than one character in length");o!==0;){for(;G(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!D(o));break}if(D(o))break;for(n=e.position;o!==0&&!O(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&ze(e),H.call(or,t)?or[t](e,t,i):ye(e,'unknown document directive "'+t+'"')}if(b(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,b(e,!0,-1)):l&&m(e,"directives end mark is expected"),Z(e,e.lineIndent-1,xe,!1,!0),b(e,!0,-1),e.checkLineBreaks&&bi.test(e.input.slice(r,e.position))&&ye(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ve(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,b(e,!0,-1));return}if(e.position<e.length-1)m(e,"end of the stream or a document separator is expected");else return}function qr(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
703
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Ti(e,r),t=e.indexOf("\0");for(t!==-1&&(n.position=t,m(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Mi(n);return n.documents}function Di(e,r,n){r!==null&&typeof r=="object"&&typeof n>"u"&&(n=r,r=null);var t=qr(e,n);if(typeof r!="function")return t;for(var i=0,l=t.length;i<l;i+=1)r(t[i])}function Ri(e,r){var n=qr(e,r);if(n.length!==0){if(n.length===1)return n[0];throw new _("expected a single document in the stream, but found more")}}var Bi=Di,Ni=Ri,Gr={loadAll:Bi,load:Ni},Wr=Object.prototype.toString,Vr=Object.prototype.hasOwnProperty,Ye=65279,Hi=9,oe=10,$i=13,zi=32,Ui=33,Yi=34,De=35,qi=37,Gi=38,Wi=39,Vi=42,Kr=44,Ki=45,be=58,Ji=61,Xi=62,Qi=63,Zi=64,Jr=91,Xr=93,et=96,Qr=123,rt=124,Zr=125,T={};T[0]="\\0";T[7]="\\a";T[8]="\\b";T[9]="\\t";T[10]="\\n";T[11]="\\v";T[12]="\\f";T[13]="\\r";T[27]="\\e";T[34]='\\"';T[92]="\\\\";T[133]="\\N";T[160]="\\_";T[8232]="\\L";T[8233]="\\P";var nt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],it=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function tt(e,r){var n,t,i,l,o,a,s;if(r===null)return{};for(n={},t=Object.keys(r),i=0,l=t.length;i<l;i+=1)o=t[i],a=String(r[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),s=e.compiledTypeMap.fallback[o],s&&Vr.call(s.styleAliases,a)&&(a=s.styleAliases[a]),n[o]=a;return n}function ot(e){var r,n,t;if(r=e.toString(16).toUpperCase(),e<=255)n="x",t=2;else if(e<=65535)n="u",t=4;else if(e<=4294967295)n="U",t=8;else throw new _("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+v.repeat("0",t-r.length)+r}var at=1,ae=2;function lt(e){this.schema=e.schema||$e,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=v.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=tt(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ae:at,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function sr(e,r){for(var n=v.repeat(" ",r),t=0,i=-1,l="",o,a=e.length;t<a;)i=e.indexOf(`
702
+ `,l?1+s:s),l=!0,o=!0,s=0,n=e.position;!D(u)&&u!==0;)u=e.input.charCodeAt(++e.position);N(e,n,e.position,!1)}return!0}function ar(e,r){var n,t=e.tag,i=e.anchor,l=[],o,a=!1,s;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),s=e.input.charCodeAt(e.position);s!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,m(e,"tab characters must not be used in indentation")),!(s!==45||(o=e.input.charCodeAt(e.position+1),!O(o))));){if(a=!0,e.position++,b(e,!0,-1)&&e.lineIndent<=r){l.push(null),s=e.input.charCodeAt(e.position);continue}if(n=e.line,Z(e,r,Rr,!1,!0),l.push(e.result),b(e,!0,-1),s=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>r)&&s!==0)m(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return a?(e.tag=t,e.anchor=i,e.kind="sequence",e.result=l,!0):!1}function Pi(e,r,n){var t,i,l,o,a,s,c=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,g=null,h=null,x=!1,w=!1,y;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),y=e.input.charCodeAt(e.position);y!==0;){if(!x&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,m(e,"tab characters must not be used in indentation")),t=e.input.charCodeAt(e.position+1),l=e.line,(y===63||y===58)&&O(t))y===63?(x&&(Q(e,u,d,p,g,null,o,a,s),p=g=h=null),w=!0,x=!0,i=!0):x?(x=!1,i=!0):m(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,y=t;else{if(o=e.line,a=e.lineStart,s=e.position,!Z(e,n,Dr,!1,!0))break;if(e.line===l){for(y=e.input.charCodeAt(e.position);G(y);)y=e.input.charCodeAt(++e.position);if(y===58)y=e.input.charCodeAt(++e.position),O(y)||m(e,"a whitespace character is expected after the key-value separator within a block mapping"),x&&(Q(e,u,d,p,g,null,o,a,s),p=g=h=null),w=!0,x=!1,i=!1,p=e.tag,g=e.result;else if(w)m(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(w)m(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===l||e.lineIndent>r)&&(x&&(o=e.line,a=e.lineStart,s=e.position),Z(e,r,ye,!0,i)&&(x?g=e.result:h=e.result),x||(Q(e,u,d,p,g,h,o,a,s),p=g=h=null),b(e,!0,-1),y=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>r)&&y!==0)m(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return x&&Q(e,u,d,p,g,null,o,a,s),w&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),w}function Li(e){var r,n=!1,t=!1,i,l,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&m(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(t=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",r=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(l=e.input.slice(r,e.position),o=e.input.charCodeAt(++e.position)):m(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!O(o);)o===33&&(t?m(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(r-1,e.position+1),Br.test(i)||m(e,"named tag handle cannot contain such characters"),t=!0,r=e.position+1)),o=e.input.charCodeAt(++e.position);l=e.input.slice(r,e.position),wi.test(l)&&m(e,"tag suffix cannot contain flow indicator characters")}l&&!Nr.test(l)&&m(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{m(e,"tag name is malformed: "+l)}return n?e.tag=l:H.call(e.tagMap,i)?e.tag=e.tagMap[i]+l:i==="!"?e.tag="!"+l:i==="!!"?e.tag="tag:yaml.org,2002:"+l:m(e,'undeclared tag handle "'+i+'"'),!0}function Ii(e){var r,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&m(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),r=e.position;n!==0&&!O(n)&&!X(n);)n=e.input.charCodeAt(++e.position);return e.position===r&&m(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function ji(e){var r,n,t;if(t=e.input.charCodeAt(e.position),t!==42)return!1;for(t=e.input.charCodeAt(++e.position),r=e.position;t!==0&&!O(t)&&!X(t);)t=e.input.charCodeAt(++e.position);return e.position===r&&m(e,"name of an alias node must contain at least one character"),n=e.input.slice(r,e.position),H.call(e.anchorMap,n)||m(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],b(e,!0,-1),!0}function Z(e,r,n,t,i){var l,o,a,s=1,c=!1,f=!1,u,d,p,g,h,x;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=o=a=ye===n||Rr===n,t&&b(e,!0,-1)&&(c=!0,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)),s===1)for(;Li(e)||Ii(e);)b(e,!0,-1)?(c=!0,a=l,e.lineIndent>r?s=1:e.lineIndent===r?s=0:e.lineIndent<r&&(s=-1)):a=!1;if(a&&(a=c||i),(s===1||ye===n)&&(xe===n||Dr===n?h=r:h=r+1,x=e.position-e.lineStart,s===1?a&&(ar(e,x)||Pi(e,x,h))||Ei(e,h)?f=!0:(o&&Oi(e,h)||Fi(e,h)||_i(e,h)?f=!0:ji(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&m(e,"alias node should not have any properties")):ki(e,h,xe===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):s===0&&(f=a&&ar(e,x))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&m(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(H.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,p=e.typeMap.multi[e.kind||"fallback"],u=0,d=p.length;u<d;u+=1)if(e.tag.slice(0,p[u].tag.length)===p[u].tag){g=p[u];break}g||m(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&m(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Mi(e){var r=e.position,n,t,i,l=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(b(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(l=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!O(o);)o=e.input.charCodeAt(++e.position);for(t=e.input.slice(n,e.position),i=[],t.length<1&&m(e,"directive name must not be less than one character in length");o!==0;){for(;G(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!D(o));break}if(D(o))break;for(n=e.position;o!==0&&!O(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&ze(e),H.call(tr,t)?tr[t](e,t,i):be(e,'unknown document directive "'+t+'"')}if(b(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,b(e,!0,-1)):l&&m(e,"directives end mark is expected"),Z(e,e.lineIndent-1,ye,!1,!0),b(e,!0,-1),e.checkLineBreaks&&bi.test(e.input.slice(r,e.position))&&be(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ae(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,b(e,!0,-1));return}if(e.position<e.length-1)m(e,"end of the stream or a document separator is expected");else return}function Yr(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
703
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Ti(e,r),t=e.indexOf("\0");for(t!==-1&&(n.position=t,m(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Mi(n);return n.documents}function Di(e,r,n){r!==null&&typeof r=="object"&&typeof n>"u"&&(n=r,r=null);var t=Yr(e,n);if(typeof r!="function")return t;for(var i=0,l=t.length;i<l;i+=1)r(t[i])}function Ri(e,r){var n=Yr(e,r);if(n.length!==0){if(n.length===1)return n[0];throw new _("expected a single document in the stream, but found more")}}var Bi=Di,Ni=Ri,qr={loadAll:Bi,load:Ni},Gr=Object.prototype.toString,Wr=Object.prototype.hasOwnProperty,Ye=65279,Hi=9,oe=10,$i=13,zi=32,Ui=33,Yi=34,De=35,qi=37,Gi=38,Wi=39,Vi=42,Vr=44,Ki=45,we=58,Ji=61,Xi=62,Qi=63,Zi=64,Kr=91,Jr=93,et=96,Xr=123,rt=124,Qr=125,T={};T[0]="\\0";T[7]="\\a";T[8]="\\b";T[9]="\\t";T[10]="\\n";T[11]="\\v";T[12]="\\f";T[13]="\\r";T[27]="\\e";T[34]='\\"';T[92]="\\\\";T[133]="\\N";T[160]="\\_";T[8232]="\\L";T[8233]="\\P";var nt=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],it=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function tt(e,r){var n,t,i,l,o,a,s;if(r===null)return{};for(n={},t=Object.keys(r),i=0,l=t.length;i<l;i+=1)o=t[i],a=String(r[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),s=e.compiledTypeMap.fallback[o],s&&Wr.call(s.styleAliases,a)&&(a=s.styleAliases[a]),n[o]=a;return n}function ot(e){var r,n,t;if(r=e.toString(16).toUpperCase(),e<=255)n="x",t=2;else if(e<=65535)n="u",t=4;else if(e<=4294967295)n="U",t=8;else throw new _("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+v.repeat("0",t-r.length)+r}var at=1,ae=2;function lt(e){this.schema=e.schema||$e,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=v.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=tt(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ae:at,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function lr(e,r){for(var n=v.repeat(" ",r),t=0,i=-1,l="",o,a=e.length;t<a;)i=e.indexOf(`
704
704
  `,t),i===-1?(o=e.slice(t),t=a):(o=e.slice(t,i+1),t=i+1),o.length&&o!==`
705
705
  `&&(l+=n),l+=o;return l}function Re(e,r){return`
706
- `+v.repeat(" ",e.indent*r)}function st(e,r){var n,t,i;for(n=0,t=e.implicitTypes.length;n<t;n+=1)if(i=e.implicitTypes[n],i.resolve(r))return!0;return!1}function we(e){return e===zi||e===Hi}function le(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ye||65536<=e&&e<=1114111}function cr(e){return le(e)&&e!==Ye&&e!==$i&&e!==oe}function ur(e,r,n){var t=cr(e),i=t&&!we(e);return(n?t:t&&e!==Kr&&e!==Jr&&e!==Xr&&e!==Qr&&e!==Zr)&&e!==De&&!(r===be&&!i)||cr(r)&&!we(r)&&e===De||r===be&&i}function ct(e){return le(e)&&e!==Ye&&!we(e)&&e!==Ki&&e!==Qi&&e!==be&&e!==Kr&&e!==Jr&&e!==Xr&&e!==Qr&&e!==Zr&&e!==De&&e!==Gi&&e!==Vi&&e!==Ui&&e!==rt&&e!==Ji&&e!==Xi&&e!==Wi&&e!==Yi&&e!==qi&&e!==Zi&&e!==et}function ut(e){return!we(e)&&e!==be}function ie(e,r){var n=e.charCodeAt(r),t;return n>=55296&&n<=56319&&r+1<e.length&&(t=e.charCodeAt(r+1),t>=56320&&t<=57343)?(n-55296)*1024+t-56320+65536:n}function en(e){var r=/^\n* /;return r.test(e)}var rn=1,Be=2,nn=3,tn=4,J=5;function ft(e,r,n,t,i,l,o,a){var s,c=0,f=null,u=!1,d=!1,p=t!==-1,g=-1,h=ct(ie(e,0))&&ut(ie(e,e.length-1));if(r||o)for(s=0;s<e.length;c>=65536?s+=2:s++){if(c=ie(e,s),!le(c))return J;h=h&&ur(c,f,a),f=c}else{for(s=0;s<e.length;c>=65536?s+=2:s++){if(c=ie(e,s),c===oe)u=!0,p&&(d=d||s-g-1>t&&e[g+1]!==" ",g=s);else if(!le(c))return J;h=h&&ur(c,f,a),f=c}d=d||p&&s-g-1>t&&e[g+1]!==" "}return!u&&!d?h&&!o&&!i(e)?rn:l===ae?J:Be:n>9&&en(e)?J:o?l===ae?J:Be:d?tn:nn}function dt(e,r,n,t,i){e.dump=(function(){if(r.length===0)return e.quotingType===ae?'""':"''";if(!e.noCompatMode&&(nt.indexOf(r)!==-1||it.test(r)))return e.quotingType===ae?'"'+r+'"':"'"+r+"'";var l=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),a=t||e.flowLevel>-1&&n>=e.flowLevel;function s(c){return st(e,c)}switch(ft(r,a,e.indent,o,s,e.quotingType,e.forceQuotes&&!t,i)){case rn:return r;case Be:return"'"+r.replace(/'/g,"''")+"'";case nn:return"|"+fr(r,e.indent)+dr(sr(r,l));case tn:return">"+fr(r,e.indent)+dr(sr(pt(r,o),l));case J:return'"'+mt(r)+'"';default:throw new _("impossible error: invalid scalar style")}})()}function fr(e,r){var n=en(e)?String(r):"",t=e[e.length-1]===`
706
+ `+v.repeat(" ",e.indent*r)}function st(e,r){var n,t,i;for(n=0,t=e.implicitTypes.length;n<t;n+=1)if(i=e.implicitTypes[n],i.resolve(r))return!0;return!1}function ve(e){return e===zi||e===Hi}function le(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ye||65536<=e&&e<=1114111}function sr(e){return le(e)&&e!==Ye&&e!==$i&&e!==oe}function cr(e,r,n){var t=sr(e),i=t&&!ve(e);return(n?t:t&&e!==Vr&&e!==Kr&&e!==Jr&&e!==Xr&&e!==Qr)&&e!==De&&!(r===we&&!i)||sr(r)&&!ve(r)&&e===De||r===we&&i}function ct(e){return le(e)&&e!==Ye&&!ve(e)&&e!==Ki&&e!==Qi&&e!==we&&e!==Vr&&e!==Kr&&e!==Jr&&e!==Xr&&e!==Qr&&e!==De&&e!==Gi&&e!==Vi&&e!==Ui&&e!==rt&&e!==Ji&&e!==Xi&&e!==Wi&&e!==Yi&&e!==qi&&e!==Zi&&e!==et}function ut(e){return!ve(e)&&e!==we}function ie(e,r){var n=e.charCodeAt(r),t;return n>=55296&&n<=56319&&r+1<e.length&&(t=e.charCodeAt(r+1),t>=56320&&t<=57343)?(n-55296)*1024+t-56320+65536:n}function Zr(e){var r=/^\n* /;return r.test(e)}var en=1,Be=2,rn=3,nn=4,J=5;function ft(e,r,n,t,i,l,o,a){var s,c=0,f=null,u=!1,d=!1,p=t!==-1,g=-1,h=ct(ie(e,0))&&ut(ie(e,e.length-1));if(r||o)for(s=0;s<e.length;c>=65536?s+=2:s++){if(c=ie(e,s),!le(c))return J;h=h&&cr(c,f,a),f=c}else{for(s=0;s<e.length;c>=65536?s+=2:s++){if(c=ie(e,s),c===oe)u=!0,p&&(d=d||s-g-1>t&&e[g+1]!==" ",g=s);else if(!le(c))return J;h=h&&cr(c,f,a),f=c}d=d||p&&s-g-1>t&&e[g+1]!==" "}return!u&&!d?h&&!o&&!i(e)?en:l===ae?J:Be:n>9&&Zr(e)?J:o?l===ae?J:Be:d?nn:rn}function dt(e,r,n,t,i){e.dump=(function(){if(r.length===0)return e.quotingType===ae?'""':"''";if(!e.noCompatMode&&(nt.indexOf(r)!==-1||it.test(r)))return e.quotingType===ae?'"'+r+'"':"'"+r+"'";var l=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),a=t||e.flowLevel>-1&&n>=e.flowLevel;function s(c){return st(e,c)}switch(ft(r,a,e.indent,o,s,e.quotingType,e.forceQuotes&&!t,i)){case en:return r;case Be:return"'"+r.replace(/'/g,"''")+"'";case rn:return"|"+ur(r,e.indent)+fr(lr(r,l));case nn:return">"+ur(r,e.indent)+fr(lr(pt(r,o),l));case J:return'"'+mt(r)+'"';default:throw new _("impossible error: invalid scalar style")}})()}function ur(e,r){var n=Zr(e)?String(r):"",t=e[e.length-1]===`
707
707
  `,i=t&&(e[e.length-2]===`
708
708
  `||e===`
709
709
  `),l=i?"+":t?"":"-";return n+l+`
710
- `}function dr(e){return e[e.length-1]===`
710
+ `}function fr(e){return e[e.length-1]===`
711
711
  `?e.slice(0,-1):e}function pt(e,r){for(var n=/(\n+)([^\n]*)/g,t=(function(){var c=e.indexOf(`
712
- `);return c=c!==-1?c:e.length,n.lastIndex=c,pr(e.slice(0,c),r)})(),i=e[0]===`
712
+ `);return c=c!==-1?c:e.length,n.lastIndex=c,dr(e.slice(0,c),r)})(),i=e[0]===`
713
713
  `||e[0]===" ",l,o;o=n.exec(e);){var a=o[1],s=o[2];l=s[0]===" ",t+=a+(!i&&!l&&s!==""?`
714
- `:"")+pr(s,r),i=l}return t}function pr(e,r){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,t,i=0,l,o=0,a=0,s="";t=n.exec(e);)a=t.index,a-i>r&&(l=o>i?o:a,s+=`
714
+ `:"")+dr(s,r),i=l}return t}function dr(e,r){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,t,i=0,l,o=0,a=0,s="";t=n.exec(e);)a=t.index,a-i>r&&(l=o>i?o:a,s+=`
715
715
  `+e.slice(i,l),i=l+1),o=a;return s+=`
716
716
  `,e.length-i>r&&o>i?s+=e.slice(i,o)+`
717
- `+e.slice(o+1):s+=e.slice(i),s.slice(1)}function mt(e){for(var r="",n=0,t,i=0;i<e.length;n>=65536?i+=2:i++)n=ie(e,i),t=T[n],!t&&le(n)?(r+=e[i],n>=65536&&(r+=e[i+1])):r+=t||ot(n);return r}function ht(e,r,n){var t="",i=e.tag,l,o,a;for(l=0,o=n.length;l<o;l+=1)a=n[l],e.replacer&&(a=e.replacer.call(n,String(l),a)),(R(e,r,a,!1,!1)||typeof a>"u"&&R(e,r,null,!1,!1))&&(t!==""&&(t+=","+(e.condenseFlow?"":" ")),t+=e.dump);e.tag=i,e.dump="["+t+"]"}function mr(e,r,n,t){var i="",l=e.tag,o,a,s;for(o=0,a=n.length;o<a;o+=1)s=n[o],e.replacer&&(s=e.replacer.call(n,String(o),s)),(R(e,r+1,s,!0,!0,!1,!0)||typeof s>"u"&&R(e,r+1,null,!0,!0,!1,!0))&&((!t||i!=="")&&(i+=Re(e,r)),e.dump&&oe===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=l,e.dump=i||"[]"}function gt(e,r,n){var t="",i=e.tag,l=Object.keys(n),o,a,s,c,f;for(o=0,a=l.length;o<a;o+=1)f="",t!==""&&(f+=", "),e.condenseFlow&&(f+='"'),s=l[o],c=n[s],e.replacer&&(c=e.replacer.call(n,s,c)),R(e,r,s,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),R(e,r,c,!1,!1)&&(f+=e.dump,t+=f));e.tag=i,e.dump="{"+t+"}"}function xt(e,r,n,t){var i="",l=e.tag,o=Object.keys(n),a,s,c,f,u,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new _("sortKeys must be a boolean or a function");for(a=0,s=o.length;a<s;a+=1)d="",(!t||i!=="")&&(d+=Re(e,r)),c=o[a],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),R(e,r+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&oe===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=Re(e,r)),R(e,r+1,f,!0,u)&&(e.dump&&oe===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=l,e.dump=i||"{}"}function hr(e,r,n){var t,i,l,o,a,s;for(i=n?e.explicitTypes:e.implicitTypes,l=0,o=i.length;l<o;l+=1)if(a=i[l],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof r=="object"&&r instanceof a.instanceOf)&&(!a.predicate||a.predicate(r))){if(n?a.multi&&a.representName?e.tag=a.representName(r):e.tag=a.tag:e.tag="?",a.represent){if(s=e.styleMap[a.tag]||a.defaultStyle,Wr.call(a.represent)==="[object Function]")t=a.represent(r,s);else if(Vr.call(a.represent,s))t=a.represent[s](r,s);else throw new _("!<"+a.tag+'> tag resolver accepts not "'+s+'" style');e.dump=t}return!0}return!1}function R(e,r,n,t,i,l,o){e.tag=null,e.dump=n,hr(e,n,!1)||hr(e,n,!0);var a=Wr.call(e.dump),s=t,c;t&&(t=e.flowLevel<0||e.flowLevel>r);var f=a==="[object Object]"||a==="[object Array]",u,d;if(f&&(u=e.duplicates.indexOf(n),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&r>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),a==="[object Object]")t&&Object.keys(e.dump).length!==0?(xt(e,r,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(gt(e,r,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object Array]")t&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?mr(e,r-1,e.dump,i):mr(e,r,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(ht(e,r,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&dt(e,e.dump,r,l,s);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function yt(e,r){var n=[],t=[],i,l;for(Ne(e,n,t),i=0,l=t.length;i<l;i+=1)r.duplicates.push(n[t[i]]);r.usedDuplicates=new Array(l)}function Ne(e,r,n){var t,i,l;if(e!==null&&typeof e=="object")if(i=r.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,l=e.length;i<l;i+=1)Ne(e[i],r,n);else for(t=Object.keys(e),i=0,l=t.length;i<l;i+=1)Ne(e[t[i]],r,n)}function bt(e,r){r=r||{};var n=new lt(r);n.noRefs||yt(e,n);var t=e;return n.replacer&&(t=n.replacer.call({"":t},"",t)),R(n,0,t,!0,!0)?n.dump+`
718
- `:""}var wt=bt,vt={dump:wt};function qe(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var At=C,Ct=yr,St=Ar,Tt=Fr,kt=_r,Ft=$e,_t=Gr.load,Et=Gr.loadAll,Ot=vt.dump,Pt=_,Lt={binary:Ir,float:kr,map:vr,null:Cr,pairs:Mr,set:Dr,timestamp:Pr,bool:Sr,int:Tr,merge:Lr,omap:jr,seq:wr,str:br},It=qe("safeLoad","load"),jt=qe("safeLoadAll","loadAll"),Mt=qe("safeDump","dump"),on={Type:At,Schema:Ct,FAILSAFE_SCHEMA:St,JSON_SCHEMA:Tt,CORE_SCHEMA:kt,DEFAULT_SCHEMA:Ft,load:_t,loadAll:Et,dump:Ot,YAMLException:Pt,types:Lt,safeLoad:It,safeLoadAll:jt,safeDump:Mt};function Dt(e){let n=String(e).match(/^---\s*[\r\n]([\s\S]*?)[\r\n](?:---|\.\.\.)\s*(?:[\r\n]([\s\S]*))?$/);if(!n)return{content:e,data:{},hasFrontMatter:!1};try{let t=on.load(n[1]),i=n[2]||"",l=Object.keys(t).length>0;return{content:i,data:t,hasFrontMatter:l}}catch{return{content:e,data:{},hasFrontMatter:!1}}}function Rt(e){let r={};if(typeof e.theme=="string"&&(r.theme=e.theme),typeof e.hrAsPageBreak=="boolean"&&(r.hrAsPageBreak=e.hrAsPageBreak),typeof e.format=="string"){let n=e.format.toLowerCase();(n==="pdf"||n==="docx"||n==="html")&&(r.format=n)}if(typeof e.title=="string"&&(r.title=e.title),typeof e.standalone=="boolean"&&(r.standalone=e.standalone),typeof e.baseTag=="boolean"&&(r.baseTag=e.baseTag),typeof e.diagramMode=="string"){let n=e.diagramMode.toLowerCase();(n==="img"||n==="live"||n==="none")&&(r.diagramMode=n)}return e.cdn&&typeof e.cdn=="object"&&(r.cdn=e.cdn),e.pdf&&typeof e.pdf=="object"&&(r.pdf=e.pdf),r}async function Bt(e,r={}){return new pe().exportToBuffer(e,r)}async function Nt(e,r={}){return new me().exportToBuffer(e,r)}async function io(e,r={}){return new ne().exportToString(e,r)}async function Ht(e,r={}){return new ne().exportToBuffer(e,r)}function $t(e){let r=k.extname(e).toLowerCase();return r===".pdf"?"pdf":r===".docx"?"docx":r===".html"||r===".htm"?"html":null}async function zt(e,r={}){let n=r.skipFrontMatter?{content:e,data:{},hasFrontMatter:!1}:Dt(e),t=n.hasFrontMatter?Rt(n.data):{},i=r.format??t.format??"pdf",l=r.theme??t.theme??"default",o=r.diagramMode??t.diagramMode??"live",a=r.hrAsPageBreak??t.hrAsPageBreak??i!=="html",s=r.basePath??process.cwd(),c=n.content,f;return i==="pdf"?f=await Nt(c,{theme:l,basePath:s,hrAsPageBreak:a,pdf:{...r.pdf,...t.pdf,title:r.title??t.title??"Document"}}):i==="docx"?f=await Bt(c,{theme:l,basePath:s,hrAsPageBreak:a}):f=await Ht(c,{theme:l,basePath:s,diagramMode:o,hrAsPageBreak:a,title:r.title??t.title??"Document",standalone:r.standalone??t.standalone,baseTag:r.baseTag??t.baseTag,cdn:r.cdn??t.cdn}),{buffer:f,format:i}}async function to(e,r,n={}){let t=k.resolve(e);if(!B.existsSync(t))throw new Error(`Input file not found: ${t}`);let i=B.readFileSync(t,"utf-8"),l=n.format;!l&&r&&(l=$t(r)??void 0);let o=k.basename(t,k.extname(t)),a=await zt(i,{...n,format:l,basePath:n.basePath??k.dirname(t),title:n.title??o}),s;if(r)s=k.resolve(r);else{let f=k.dirname(t),u=k.basename(t,k.extname(t)),d=a.format==="pdf"?".pdf":a.format==="docx"?".docx":".html";s=k.join(f,`${u}${d}`)}let c=k.dirname(s);return B.existsSync(c)||B.mkdirSync(c,{recursive:!0}),B.writeFileSync(s,a.buffer),{buffer:a.buffer,outputPath:s,format:a.format}}export{pe as a,me as b,ne as c,Dt as d,Rt as e,Bt as f,Nt as g,io as h,Ht as i,zt as j,to as k};
717
+ `+e.slice(o+1):s+=e.slice(i),s.slice(1)}function mt(e){for(var r="",n=0,t,i=0;i<e.length;n>=65536?i+=2:i++)n=ie(e,i),t=T[n],!t&&le(n)?(r+=e[i],n>=65536&&(r+=e[i+1])):r+=t||ot(n);return r}function ht(e,r,n){var t="",i=e.tag,l,o,a;for(l=0,o=n.length;l<o;l+=1)a=n[l],e.replacer&&(a=e.replacer.call(n,String(l),a)),(R(e,r,a,!1,!1)||typeof a>"u"&&R(e,r,null,!1,!1))&&(t!==""&&(t+=","+(e.condenseFlow?"":" ")),t+=e.dump);e.tag=i,e.dump="["+t+"]"}function pr(e,r,n,t){var i="",l=e.tag,o,a,s;for(o=0,a=n.length;o<a;o+=1)s=n[o],e.replacer&&(s=e.replacer.call(n,String(o),s)),(R(e,r+1,s,!0,!0,!1,!0)||typeof s>"u"&&R(e,r+1,null,!0,!0,!1,!0))&&((!t||i!=="")&&(i+=Re(e,r)),e.dump&&oe===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=l,e.dump=i||"[]"}function gt(e,r,n){var t="",i=e.tag,l=Object.keys(n),o,a,s,c,f;for(o=0,a=l.length;o<a;o+=1)f="",t!==""&&(f+=", "),e.condenseFlow&&(f+='"'),s=l[o],c=n[s],e.replacer&&(c=e.replacer.call(n,s,c)),R(e,r,s,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),R(e,r,c,!1,!1)&&(f+=e.dump,t+=f));e.tag=i,e.dump="{"+t+"}"}function xt(e,r,n,t){var i="",l=e.tag,o=Object.keys(n),a,s,c,f,u,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new _("sortKeys must be a boolean or a function");for(a=0,s=o.length;a<s;a+=1)d="",(!t||i!=="")&&(d+=Re(e,r)),c=o[a],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),R(e,r+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&oe===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=Re(e,r)),R(e,r+1,f,!0,u)&&(e.dump&&oe===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=l,e.dump=i||"{}"}function mr(e,r,n){var t,i,l,o,a,s;for(i=n?e.explicitTypes:e.implicitTypes,l=0,o=i.length;l<o;l+=1)if(a=i[l],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof r=="object"&&r instanceof a.instanceOf)&&(!a.predicate||a.predicate(r))){if(n?a.multi&&a.representName?e.tag=a.representName(r):e.tag=a.tag:e.tag="?",a.represent){if(s=e.styleMap[a.tag]||a.defaultStyle,Gr.call(a.represent)==="[object Function]")t=a.represent(r,s);else if(Wr.call(a.represent,s))t=a.represent[s](r,s);else throw new _("!<"+a.tag+'> tag resolver accepts not "'+s+'" style');e.dump=t}return!0}return!1}function R(e,r,n,t,i,l,o){e.tag=null,e.dump=n,mr(e,n,!1)||mr(e,n,!0);var a=Gr.call(e.dump),s=t,c;t&&(t=e.flowLevel<0||e.flowLevel>r);var f=a==="[object Object]"||a==="[object Array]",u,d;if(f&&(u=e.duplicates.indexOf(n),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&r>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),a==="[object Object]")t&&Object.keys(e.dump).length!==0?(xt(e,r,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(gt(e,r,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object Array]")t&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?pr(e,r-1,e.dump,i):pr(e,r,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(ht(e,r,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&dt(e,e.dump,r,l,s);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function yt(e,r){var n=[],t=[],i,l;for(Ne(e,n,t),i=0,l=t.length;i<l;i+=1)r.duplicates.push(n[t[i]]);r.usedDuplicates=new Array(l)}function Ne(e,r,n){var t,i,l;if(e!==null&&typeof e=="object")if(i=r.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,l=e.length;i<l;i+=1)Ne(e[i],r,n);else for(t=Object.keys(e),i=0,l=t.length;i<l;i+=1)Ne(e[t[i]],r,n)}function bt(e,r){r=r||{};var n=new lt(r);n.noRefs||yt(e,n);var t=e;return n.replacer&&(t=n.replacer.call({"":t},"",t)),R(n,0,t,!0,!0)?n.dump+`
718
+ `:""}var wt=bt,vt={dump:wt};function qe(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var At=C,Ct=xr,St=vr,Tt=kr,kt=Fr,Ft=$e,_t=qr.load,Et=qr.loadAll,Ot=vt.dump,Pt=_,Lt={binary:Lr,float:Tr,map:wr,null:Ar,pairs:jr,set:Mr,timestamp:Or,bool:Cr,int:Sr,merge:Pr,omap:Ir,seq:br,str:yr},It=qe("safeLoad","load"),jt=qe("safeLoadAll","loadAll"),Mt=qe("safeDump","dump"),tn={Type:At,Schema:Ct,FAILSAFE_SCHEMA:St,JSON_SCHEMA:Tt,CORE_SCHEMA:kt,DEFAULT_SCHEMA:Ft,load:_t,loadAll:Et,dump:Ot,YAMLException:Pt,types:Lt,safeLoad:It,safeLoadAll:jt,safeDump:Mt};function Dt(e){let n=String(e).match(/^---\s*[\r\n]([\s\S]*?)[\r\n](?:---|\.\.\.)\s*(?:[\r\n]([\s\S]*))?$/);if(!n)return{content:e,data:{},hasFrontMatter:!1};try{let t=tn.load(n[1]),i=n[2]||"",l=Object.keys(t).length>0;return{content:i,data:t,hasFrontMatter:l}}catch{return{content:e,data:{},hasFrontMatter:!1}}}function Rt(e){let r={};if(typeof e.theme=="string"&&(r.theme=e.theme),typeof e.hrAsPageBreak=="boolean"&&(r.hrAsPageBreak=e.hrAsPageBreak),typeof e.format=="string"){let n=e.format.toLowerCase();(n==="pdf"||n==="docx"||n==="html")&&(r.format=n)}if(typeof e.title=="string"&&(r.title=e.title),typeof e.standalone=="boolean"&&(r.standalone=e.standalone),typeof e.baseTag=="boolean"&&(r.baseTag=e.baseTag),typeof e.diagramMode=="string"){let n=e.diagramMode.toLowerCase();(n==="img"||n==="live"||n==="none")&&(r.diagramMode=n)}return e.cdn&&typeof e.cdn=="object"&&(r.cdn=e.cdn),e.pdf&&typeof e.pdf=="object"&&(r.pdf=e.pdf),r}async function Bt(e,r={}){return new pe().exportToBuffer(e,r)}async function Nt(e,r={}){return new me().exportToBuffer(e,r)}async function io(e,r={}){return new ne().exportToString(e,r)}async function Ht(e,r={}){return new ne().exportToBuffer(e,r)}function $t(e){let r=k.extname(e).toLowerCase();return r===".pdf"?"pdf":r===".docx"?"docx":r===".html"||r===".htm"?"html":null}async function zt(e,r={}){let n=r.skipFrontMatter?{content:e,data:{},hasFrontMatter:!1}:Dt(e),t=n.hasFrontMatter?Rt(n.data):{},i=r.format??t.format??"pdf",l=r.theme??t.theme??"default",o=r.diagramMode??t.diagramMode??"live",a=r.hrAsPageBreak??t.hrAsPageBreak??i!=="html",s=r.basePath??process.cwd(),c=n.content,f;return i==="pdf"?f=await Nt(c,{theme:l,basePath:s,hrAsPageBreak:a,pdf:{...r.pdf,...t.pdf,title:r.title??t.title??"Document"}}):i==="docx"?f=await Bt(c,{theme:l,basePath:s,hrAsPageBreak:a}):f=await Ht(c,{theme:l,basePath:s,diagramMode:o,hrAsPageBreak:a,title:r.title??t.title??"Document",standalone:r.standalone??t.standalone,baseTag:r.baseTag??t.baseTag,cdn:r.cdn??t.cdn}),{buffer:f,format:i}}async function to(e,r,n={}){let t=k.resolve(e);if(!B.existsSync(t))throw new Error(`Input file not found: ${t}`);let i=B.readFileSync(t,"utf-8"),l=n.format;!l&&r&&(l=$t(r)??void 0);let o=k.basename(t,k.extname(t)),a=await zt(i,{...n,format:l,basePath:n.basePath??k.dirname(t),title:n.title??o}),s;if(r)s=k.resolve(r);else{let f=k.dirname(t),u=k.basename(t,k.extname(t)),d=a.format==="pdf"?".pdf":a.format==="docx"?".docx":".html";s=k.join(f,`${u}${d}`)}let c=k.dirname(s);return B.existsSync(c)||B.mkdirSync(c,{recursive:!0}),B.writeFileSync(s,a.buffer),{buffer:a.buffer,outputPath:s,format:a.format}}export{pe as a,me as b,ne as c,Dt as d,Rt as e,Bt as f,Nt as g,io as h,Ht as i,zt as j,to as k};
719
719
  /*! Bundled license information:
720
720
 
721
721
  js-yaml/dist/js-yaml.mjs:
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as t,b as r,c as e,d as p,e as n,f as m,g as a,h as d,i as f,j as i,k as s}from"./chunks/chunk-PXO7VHRW.js";import"./chunks/chunk-5DRL26RK.js";import"./chunks/chunk-DFROP2PD.js";import"./chunks/chunk-3P5X57NT.js";import"./chunks/chunk-CVKZIRZW.js";import"./chunks/chunk-DJGIYXVP.js";import"./chunks/chunk-URO5RPHJ.js";import"./chunks/chunk-YFL3W3OS.js";import"./chunks/chunk-3VL755NO.js";import"./chunks/chunk-2LPNL4GA.js";import"./chunks/chunk-MHCTK6WW.js";import"./chunks/chunk-R6G2575A.js";import"./chunks/chunk-AK6TXLWO.js";import"./chunks/chunk-PUOHPY5L.js";import"./chunks/chunk-R65AQGTF.js";import"./chunks/chunk-TRGQPVRY.js";import"./chunks/chunk-CN4F5HOV.js";import"./chunks/chunk-LLCWR7UA.js";import"./chunks/chunk-PARPCLXM.js";import"./chunks/chunk-IENSDROB.js";import"./chunks/chunk-5DPTQTJJ.js";import"./chunks/chunk-Z4LVGK7Y.js";import"./chunks/chunk-NM6J3ND7.js";import*as o from"path";import{fileURLToPath as l}from"url";var x=l(import.meta.url),_=o.dirname(x);globalThis.__md2x_module_dir__=_;export{t as NodeDocxExporter,e as NodeHtmlExporter,r as NodePdfExporter,i as convert,s as convertFile,n as frontMatterToOptions,m as markdownToDocxBuffer,f as markdownToHtmlBuffer,d as markdownToHtmlString,a as markdownToPdfBuffer,p as parseFrontMatter};
1
+ import{a as t,b as r,c as e,d as p,e as n,f as m,g as a,h as d,i as f,j as i,k as s}from"./chunks/chunk-KEWRLSTT.js";import"./chunks/chunk-5DRL26RK.js";import"./chunks/chunk-DFROP2PD.js";import"./chunks/chunk-3P5X57NT.js";import"./chunks/chunk-CVKZIRZW.js";import"./chunks/chunk-DJGIYXVP.js";import"./chunks/chunk-URO5RPHJ.js";import"./chunks/chunk-YFL3W3OS.js";import"./chunks/chunk-3VL755NO.js";import"./chunks/chunk-2LPNL4GA.js";import"./chunks/chunk-MHCTK6WW.js";import"./chunks/chunk-R6G2575A.js";import"./chunks/chunk-AK6TXLWO.js";import"./chunks/chunk-PUOHPY5L.js";import"./chunks/chunk-R65AQGTF.js";import"./chunks/chunk-TRGQPVRY.js";import"./chunks/chunk-CN4F5HOV.js";import"./chunks/chunk-LLCWR7UA.js";import"./chunks/chunk-PARPCLXM.js";import"./chunks/chunk-IENSDROB.js";import"./chunks/chunk-5DPTQTJJ.js";import"./chunks/chunk-Z4LVGK7Y.js";import"./chunks/chunk-NM6J3ND7.js";import*as o from"path";import{fileURLToPath as l}from"url";var x=l(import.meta.url),_=o.dirname(x);globalThis.__md2x_module_dir__=_;export{t as NodeDocxExporter,e as NodeHtmlExporter,r as NodePdfExporter,i as convert,s as convertFile,n as frontMatterToOptions,m as markdownToDocxBuffer,f as markdownToHtmlBuffer,d as markdownToHtmlString,a as markdownToPdfBuffer,p as parseFrontMatter};
package/dist/md2x.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{d as x,e as v,j as b}from"./chunks/chunk-PXO7VHRW.js";import"./chunks/chunk-5DRL26RK.js";import"./chunks/chunk-DFROP2PD.js";import"./chunks/chunk-3P5X57NT.js";import"./chunks/chunk-CVKZIRZW.js";import"./chunks/chunk-DJGIYXVP.js";import"./chunks/chunk-URO5RPHJ.js";import"./chunks/chunk-YFL3W3OS.js";import"./chunks/chunk-3VL755NO.js";import"./chunks/chunk-2LPNL4GA.js";import"./chunks/chunk-MHCTK6WW.js";import"./chunks/chunk-R6G2575A.js";import"./chunks/chunk-AK6TXLWO.js";import"./chunks/chunk-PUOHPY5L.js";import"./chunks/chunk-R65AQGTF.js";import"./chunks/chunk-TRGQPVRY.js";import"./chunks/chunk-CN4F5HOV.js";import"./chunks/chunk-LLCWR7UA.js";import"./chunks/chunk-PARPCLXM.js";import"./chunks/chunk-IENSDROB.js";import"./chunks/chunk-5DPTQTJJ.js";import"./chunks/chunk-Z4LVGK7Y.js";import"./chunks/chunk-NM6J3ND7.js";import*as i from"fs";import*as n from"path";import{fileURLToPath as $}from"url";var w=$(import.meta.url),M=n.dirname(w);globalThis.__md2x_module_dir__=M;function _(){return globalThis.__md2x_module_dir__||M}function O(){let o=_(),e=[n.join(o,"themes","presets"),n.resolve(o,"../../src/themes/presets"),n.resolve(process.cwd(),"src/themes/presets")];for(let t of e)try{if(i.existsSync(t)&&i.statSync(t).isDirectory())return t}catch{}return null}function d(){let o=O();if(!o)return["default"];try{let e=i.readdirSync(o,{withFileTypes:!0}).filter(r=>r.isFile()&&r.name.endsWith(".json")).map(r=>r.name.replace(/\.json$/i,"")).filter(r=>r.length>0).sort();return["default",...Array.from(new Set(e)).filter(r=>r!=="default")]}catch{return["default"]}}function k(o){return o.join(", ")}function E(){let o=d();console.log(`
2
+ import{d as x,e as v,j as b}from"./chunks/chunk-KEWRLSTT.js";import"./chunks/chunk-5DRL26RK.js";import"./chunks/chunk-DFROP2PD.js";import"./chunks/chunk-3P5X57NT.js";import"./chunks/chunk-CVKZIRZW.js";import"./chunks/chunk-DJGIYXVP.js";import"./chunks/chunk-URO5RPHJ.js";import"./chunks/chunk-YFL3W3OS.js";import"./chunks/chunk-3VL755NO.js";import"./chunks/chunk-2LPNL4GA.js";import"./chunks/chunk-MHCTK6WW.js";import"./chunks/chunk-R6G2575A.js";import"./chunks/chunk-AK6TXLWO.js";import"./chunks/chunk-PUOHPY5L.js";import"./chunks/chunk-R65AQGTF.js";import"./chunks/chunk-TRGQPVRY.js";import"./chunks/chunk-CN4F5HOV.js";import"./chunks/chunk-LLCWR7UA.js";import"./chunks/chunk-PARPCLXM.js";import"./chunks/chunk-IENSDROB.js";import"./chunks/chunk-5DPTQTJJ.js";import"./chunks/chunk-Z4LVGK7Y.js";import"./chunks/chunk-NM6J3ND7.js";import*as i from"fs";import*as n from"path";import{fileURLToPath as $}from"url";var w=$(import.meta.url),M=n.dirname(w);globalThis.__md2x_module_dir__=M;function _(){return globalThis.__md2x_module_dir__||M}function O(){let o=_(),e=[n.join(o,"themes","presets"),n.resolve(o,"../../src/themes/presets"),n.resolve(process.cwd(),"src/themes/presets")];for(let t of e)try{if(i.existsSync(t)&&i.statSync(t).isDirectory())return t}catch{}return null}function d(){let o=O();if(!o)return["default"];try{let e=i.readdirSync(o,{withFileTypes:!0}).filter(r=>r.isFile()&&r.name.endsWith(".json")).map(r=>r.name.replace(/\.json$/i,"")).filter(r=>r.length>0).sort();return["default",...Array.from(new Set(e)).filter(r=>r!=="default")]}catch{return["default"]}}function k(o){return o.join(", ")}function E(){let o=d();console.log(`
3
3
  md2x - Convert Markdown to PDF, DOCX, or HTML
4
4
 
5
5
  Usage:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md2x",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Markdown converter (local, no server). Supports Mermaid/Graphviz/Vega/HTML/SVG rendering, math, and code highlighting.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -23,7 +23,6 @@
23
23
  "dev": "node build.mjs --watch --run",
24
24
  "cli": "node dist/md2x.js",
25
25
  "test": "node --test test/*.test.mjs",
26
- "postinstall": "puppeteer browsers install chrome",
27
26
  "prepublishOnly": "node build.mjs"
28
27
  },
29
28
  "keywords": [