"use strict";var dl=e=>{throw TypeError(e)};var gl=(e,l,t)=>l.has(e)||dl("Cannot "+t);var Zl=(e,l,t)=>(gl(e,l,"read from private field"),t?t.call(e):l.get(e)),bl=(e,l,t)=>l.has(e)?dl("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(e):l.set(e,t),ml=(e,l,t,n)=>(gl(e,l,"write to private field"),n?n.call(e,t):l.set(e,t),t);/*! THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository https://github.com/mokeyish/obsidian-enhancing-export . */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Ie=require("obsidian"),wn=require("child_process"),pt=require("process"),Pl=require("electron"),Dl=require("fs"),ae=require("path"),Sn=require("util");function Dt(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const En=Dt(Ie),ye=Dt(Pl),Bt=Dt(Dl),dt={Markdown:{name:"Markdown",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown.lua" -s -o "${outputPath}" -t commonmark_x-attributes',extension:".md"},"Markdown (Hugo)":{name:"Markdown (Hugo)",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown+hugo.lua" -s -o "${outputPath}" -t commonmark_x-attributes',extension:".md"},Html:{name:"Html",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/math_block.lua" --embed-resources --standalone --metadata title="${currentFileName}" -s -o "${outputPath}" -t html',customArguments:'--mathjax="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg-full.js"',extension:".html"},TextBundle:{name:"TextBundle",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown.lua" -V media_dir="${outputDir}/${outputFileName}.textbundle/assets" -s -o "${outputDir}/${outputFileName}.textbundle/text.md" -t commonmark_x-attributes',extension:".md"},Typst:{name:"Typst",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown.lua" -s -o "${outputPath}" -t typst',extension:".typ"},PDF:{name:"PDF",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/pdf.lua" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } -o "${outputPath}" -t pdf',customArguments:"--pdf-engine=pdflatex",optionsMeta:{textemplate:"preset:textemplate"},extension:".pdf"},"Word (.docx)":{name:"Word (.docx)",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t docx',extension:".docx"},OpenOffice:{name:"OpenOffice",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t odt',extension:".odt"},RTF:{name:"RTF",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t rtf',extension:".rtf"},Epub:{name:"Epub",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t epub',extension:".epub"},Latex:{name:"Latex",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } --extract-media="${outputDir}" -s -o "${outputPath}" -t latex',optionsMeta:{textemplate:"preset:textemplate"},extension:".tex"},"Media Wiki":{name:"Media Wiki",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t mediawiki',extension:".mediawiki"},reStructuredText:{name:"reStructuredText",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t rst',extension:".rst"},Textile:{name:"Textile",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t textile',extension:".textile"},OPML:{name:"OPML",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t opml',extension:".opml"},"Bibliography (.bib)":{name:"Bibliography",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/citefilter.lua" -o "${outputPath}" --to=bibtex "${currentPath}"',extension:".bib"},Custom:{name:"Custom",type:"custom",command:"your command",targetFileExtensions:".ext"}};function Ae(e,l,t){return typeof l=="string"&&l.trim()===""&&(l=void 0),t instanceof Array?t.reduce((n,c)=>Ae(n,l,c),e):(t??(t=pt.platform),{...e??{},[t]:l})}function de(e,l){e??(e={});const t=e[l??pt.platform],n=e["*"];return n&&typeof n=="object"?Object.assign({},n,t):t??n}function M(e,...l){return function(...t){const n=t[t.length-1]||{},c=[e[0]];return l.forEach(function(i,o){const s=Number.isInteger(i)?t[i]:n[i];c.push(s,e[o+1])}),c.join("")}}function zt(e,l){return l=l??{},new Promise((t,n)=>{wn.exec(e,l,(c,i,o)=>{if(c){n(c),console.error(i,c);return}if(o&&o!==""){n(o),console.error(i,c);return}(i==null?void 0:i.trim().length)===0&&localStorage.getItem("debug-plugin")==="1"&&console.log(i),t(i)})})}function Kn(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.substring(1,e.length-1):e}function Ut(e,l={}){for(;;)try{const t=Object.keys(l).filter(Qn),n=t.map(c=>l[c]);return new Function(...t,`{ return \`${e.replaceAll("\\","\\\\")}\` }`).bind(l)(...n)}catch(t){if(t instanceof ReferenceError&&t.message.endsWith("is not defined")){const n=t.message.substring(0,t.message.indexOf(" ")),c=Object.keys(l).filter(i=>i.toLowerCase()===n.toLowerCase()).map(i=>l[i])[0]??`\${${n}}`;l[n]=c}else throw t}}const Qn=e=>{if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0},zn={textemplate:{title:"Latex Template",type:"dropdown",options:[{name:"None",value:null},{name:"Dissertation",value:"dissertation.tex"},{name:"Academic Paper",value:"neurips.tex"}]}},De=(()=>{let e={};return e=Ae(e,{HOME:"${HOME}",PATH:"${PATH}",TEXINPUTS:"${pluginDir}/textemplate/:"},"*"),e=Ae(e,{TEXINPUTS:"${pluginDir}/textemplate/;",PATH:"${HOME}\\AppData\\Local\\Pandoc;${PATH}"},"win32"),e=Ae(e,{PATH:"/opt/homebrew/bin:/usr/local/bin:/Library/TeX/texbin:${PATH}"},"darwin"),e})(),Le={items:Object.values(dt).filter(e=>e.type!=="custom"),pandocPath:void 0,defaultExportDirectoryMode:"Auto",openExportedFile:!0,env:De,showExportProgressBar:!0};function _l(e){var l;return e.type==="pandoc"?e.extension:e.type==="custom"?(l=e.targetFileExtensions)==null?void 0:l.split(",")[0]:""}function ql(e,l){return e=Object.assign({},de(De),e),l=Object.assign({HOME:process.env.HOME??process.env.USERPROFILE},process.env,l??{}),Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Ut(n,l)]))}function Un(e){return e?Object.fromEntries(Object.entries(e).map(([l,t])=>[l,typeof t=="string"?zn[t.startsWith("preset:")?t.substring(7):""]:t])):{}}const jn=(e,l)=>e===l,pe=Symbol("solid-proxy"),jt=Symbol("solid-track"),mt={equals:jn};let en=on;const Fe=1,ut=2,tn={owned:null,cleanups:null,context:null,owner:null};var $=null;let yt=null,Ln=null,O=null,le=null,Je=null,Xt=0;function we(e,l){const t=O,n=$,c=e.length===0,i=n,o=c?tn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=c?e:()=>e(()=>P(()=>ft(o)));$=o,O=null;try{return Ue(s,!0)}finally{O=t,$=n}}function oe(e,l){l=l?Object.assign({},mt,l):mt;const t={value:e,observers:null,observerSlots:null,comparator:l.equals||void 0},n=c=>(typeof c=="function"&&(c=c(t.value)),sn(t,c));return[cn.bind(t),n]}function te(e,l,t){const n=_t(e,l,!1,Fe);tt(n)}function Ye(e,l,t){en=Pn;const n=_t(e,l,!1,Fe);n.user=!0,Je?Je.push(n):tt(n)}function ee(e,l,t){t=t?Object.assign({},mt,t):mt;const n=_t(e,l,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=t.equals||void 0,tt(n),cn.bind(n)}function gt(e){return Ue(e,!1)}function P(e){if(O===null)return e();const l=O;O=null;try{return e()}finally{O=l}}function ln(e){Ye(()=>P(e))}function ze(e){return $===null||($.cleanups===null?$.cleanups=[e]:$.cleanups.push(e)),e}function Lt(){return O}function Mn(e,l){const t=Symbol("context");return{id:t,Provider:_n(t),defaultValue:e}}function Tn(e){let l;return $&&$.context&&(l=$.context[e.id])!==void 0?l:e.defaultValue}function nn(e){const l=ee(e),t=ee(()=>Mt(l()));return t.toArray=()=>{const n=t();return Array.isArray(n)?n:n!=null?[n]:[]},t}function cn(){if(this.sources&&this.state)if(this.state===Fe)tt(this);else{const e=le;le=null,Ue(()=>It(this),!1),le=e}if(O){const e=this.observers?this.observers.length:0;O.sources?(O.sources.push(this),O.sourceSlots.push(e)):(O.sources=[this],O.sourceSlots=[e]),this.observers?(this.observers.push(O),this.observerSlots.push(O.sources.length-1)):(this.observers=[O],this.observerSlots=[O.sources.length-1])}return this.value}function sn(e,l,t){let n=e.value;return(!e.comparator||!e.comparator(n,l))&&(e.value=l,e.observers&&e.observers.length&&Ue(()=>{for(let c=0;c1e6)throw le=[],new Error},!1)),l}function tt(e){if(!e.fn)return;ft(e);const l=Xt;$n(e,e.value,l)}function $n(e,l,t){let n;const c=$,i=O;O=$=e;try{n=e.fn(l)}catch(o){return e.pure&&(e.state=Fe,e.owned&&e.owned.forEach(ft),e.owned=null),e.updatedAt=t+1,rn(o)}finally{O=i,$=c}(!e.updatedAt||e.updatedAt<=t)&&(e.updatedAt!=null&&"observers"in e?sn(e,n):e.value=n,e.updatedAt=t)}function _t(e,l,t,n=Fe,c){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:l,owner:$,context:$?$.context:null,pure:t};return $===null||$!==tn&&($.owned?$.owned.push(i):$.owned=[i]),i}function Gt(e){if(e.state===0)return;if(e.state===ut)return It(e);if(e.suspense&&P(e.suspense.inFallback))return e.suspense.effects.push(e);const l=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;t--)if(e=l[t],e.state===Fe)tt(e);else if(e.state===ut){const n=le;le=null,Ue(()=>It(e,l[0]),!1),le=n}}function Ue(e,l){if(le)return e();let t=!1;l||(le=[]),Je?t=!0:Je=[],Xt++;try{const n=e();return On(t),n}catch(n){t||(Je=null),le=null,rn(n)}}function On(e){if(le&&(on(le),le=null),e)return;const l=Je;Je=null,l.length&&Ue(()=>en(l),!1)}function on(e){for(let l=0;l=0;l--)ft(e.owned[l]);e.owned=null}if(e.cleanups){for(l=e.cleanups.length-1;l>=0;l--)e.cleanups[l]();e.cleanups=null}e.state=0}function Dn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function rn(e,l=$){throw Dn(e)}function Mt(e){if(typeof e=="function"&&!e.length)return Mt(e());if(Array.isArray(e)){const l=[];for(let t=0;tc=P(()=>($.context={...$.context,[e]:n.value},nn(()=>n.children))),void 0),c}}const qn=Symbol("fallback");function ul(e){for(let l=0;l1?[]:null;return ze(()=>ul(i)),()=>{let a=e()||[],Z=a.length,u,b;return a[jt],P(()=>{let p,Y,L,m,K,S,E,T,Q;if(Z===0)o!==0&&(ul(i),i=[],n=[],c=[],o=0,s&&(s=[])),t.fallback&&(n=[qn],c[0]=we(ge=>(i[0]=ge,t.fallback())),o=1);else if(o===0){for(c=new Array(Z),b=0;b=S&&T>=S&&n[E]===a[T];E--,T--)L[T]=c[E],m[T]=i[E],s&&(K[T]=s[E]);for(p=new Map,Y=new Array(T+1),b=T;b>=S;b--)Q=a[b],u=p.get(Q),Y[b]=u===void 0?-1:u,p.set(Q,b);for(u=S;u<=E;u++)Q=n[u],b=p.get(Q),b!==void 0&&b!==-1?(L[b]=c[u],m[b]=i[u],s&&(K[b]=s[u]),b=Y[b],p.set(Q,b)):i[u]();for(b=S;be(l||{}))}function ct(){return!0}const Gl={get(e,l,t){return l===pe?t:e.get(l)},has(e,l){return l===pe?!0:e.has(l)},set:ct,deleteProperty:ct,getOwnPropertyDescriptor(e,l){return{configurable:!0,enumerable:!0,get(){return e.get(l)},set:ct,deleteProperty:ct}},ownKeys(e){return e.keys()}};function tc(e,...l){if(pe in e){const c=new Set(l.length>1?l.flat():l[0]),i=l.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},Gl));return i.push(new Proxy({get(o){return c.has(o)?void 0:e[o]},has(o){return c.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!c.has(o))}},Gl)),i}const t={},n=l.map(()=>({}));for(const c of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,c),o=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let s=!1,a=0;for(const Z of l)Z.includes(c)&&(s=!0,o?n[a][c]=i.value:Object.defineProperty(n[a],c,i)),++a;s||(o?t[c]=i.value:Object.defineProperty(t,c,i))}return[...n,t]}const dn=e=>`Stale read from <${e}>.`;function gn(e){const l="fallback"in e&&{fallback:()=>e.fallback};return ee(ec(()=>e.each,e.children,l||void 0))}function Zt(e){const l=e.keyed,t=ee(()=>e.when,void 0,{equals:(n,c)=>l?n===c:!n==!c});return ee(()=>{const n=t();if(n){const c=e.children;return typeof c=="function"&&c.length>0?P(()=>c(l?n:()=>{if(!P(t))throw dn("Show");return e.when})):c}return e.fallback},void 0,void 0)}function lc(e){let l=!1;const t=(i,o)=>(l?i[1]===o[1]:!i[1]==!o[1])&&i[2]===o[2],n=nn(()=>e.children),c=ee(()=>{let i=n();Array.isArray(i)||(i=[i]);for(let o=0;o{const[i,o,s]=c();if(i<0)return e.fallback;const a=s.children;return typeof a=="function"&&a.length>0?P(()=>a(l?o:()=>{if(P(c)[0]!==i)throw dn("Match");return s.when})):a},void 0,void 0)}function Il(e){return e}const nc=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],cc=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...nc]),ic=new Set(["innerHTML","textContent","innerText","children"]),sc=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),oc=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ac(e,l){const t=oc[e];return typeof t=="object"?t[l]?t.$:void 0:t}const rc=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),dc=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),gc={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Zc(e,l,t){let n=t.length,c=l.length,i=n,o=0,s=0,a=l[c-1].nextSibling,Z=null;for(;ou-s){const Y=l[o];for(;s{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},i=()=>(n||(n=c())).cloneNode(!0);return i.cloneNode=i,i}function qt(e,l=window.document){const t=l[Cl]||(l[Cl]=new Set);for(let n=0,c=e.length;nc.call(e,t[1],i))}else e.addEventListener(l,t)}function mc(e,l,t={}){const n=Object.keys(l||{}),c=Object.keys(t);let i,o;for(i=0,o=c.length;ic.children=_e(e,l.children,c.children)),te(()=>typeof l.ref=="function"&&Rt(l.ref,e)),te(()=>Gc(e,l,t,!0,c,!0)),c}function Rt(e,l,t){return P(()=>e(l,t))}function ne(e,l,t,n){if(t!==void 0&&!n&&(n=[]),typeof l!="function")return _e(e,l,n,t);te(c=>_e(e,l(),c,t),n)}function Gc(e,l,t,n,c={},i=!1){l||(l={});for(const o in c)if(!(o in l)){if(o==="children")continue;c[o]=hl(e,o,null,c[o],t,i)}for(const o in l){if(o==="children")continue;const s=l[o];c[o]=hl(e,o,s,c[o],t,i)}}function Ic(e){return e.toLowerCase().replace(/-([a-z])/g,(l,t)=>t.toUpperCase())}function Wl(e,l,t){const n=l.trim().split(/\s+/);for(let c=0,i=n.length;c-1&&gc[l.split(":")[0]];b?bc(e,b,l,t):xe(e,sc[l]||l,t)}return t}function Cc(e){const l=`$$${e.type}`;let t=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==t&&Object.defineProperty(e,"target",{configurable:!0,value:t}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}});t;){const n=t[l];if(n&&!t.disabled){const c=t[`${l}Data`];if(c!==void 0?n.call(t,c,e):n.call(t,e),e.cancelBubble)return}t=t._$host||t.parentNode||t.host}}function _e(e,l,t,n,c){for(;typeof t=="function";)t=t();if(l===t)return t;const i=typeof l,o=n!==void 0;if(e=o&&t[0]&&t[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(l=l.toString(),l===t))return t;if(o){let s=t[0];s&&s.nodeType===3?s.data!==l&&(s.data=l):s=document.createTextNode(l),t=ve(e,t,n,s)}else t!==""&&typeof t=="string"?t=e.firstChild.data=l:t=e.textContent=l}else if(l==null||i==="boolean")t=ve(e,t,n);else{if(i==="function")return te(()=>{let s=l();for(;typeof s=="function";)s=s();t=_e(e,s,t,n)}),()=>t;if(Array.isArray(l)){const s=[],a=t&&Array.isArray(t);if(Tt(s,l,t,c))return te(()=>t=_e(e,s,t,n,!0)),()=>t;if(s.length===0){if(t=ve(e,t,n),o)return t}else a?t.length===0?pl(e,s,n):Zc(e,t,s):(t&&ve(e),pl(e,s));t=s}else if(l.nodeType){if(Array.isArray(t)){if(o)return t=ve(e,t,n,l);ve(e,t,null,l)}else t==null||t===""||!e.firstChild?e.appendChild(l):e.replaceChild(l,e.firstChild);t=l}}return t}function Tt(e,l,t,n){let c=!1;for(let i=0,o=l.length;i=0;o--){const s=l[o];if(c!==s){const a=s.parentNode===e;!i&&!o?a?e.replaceChild(c,s):e.insertBefore(c,t):a&&s.remove()}else i=!0}}else e.insertBefore(c,t);return[c]}const Wc="http://www.w3.org/2000/svg";function hc(e,l=!1){return l?document.createElementNS(Wc,e):document.createElement(e)}function pc(e){const[l,t]=tc(e,["component"]),n=ee(()=>l.component);return ee(()=>{const c=n();switch(typeof c){case"function":return P(()=>c(t));case"string":const i=dc.has(c),o=hc(c,i);return uc(o,t,i),o}})}/** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */function Te(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let t="",n=!1;const c=e.match(/^-+/);for(let i=c?c[0].length:0;i0?n+=`${l}${t.charAt(c)}`:n+=o}return n}function mn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}/** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */function Xc(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let l=0,t=null,n=null,c=null;const i=[];for(let o=0;o{typeof g=="number"&&(m.nargs[r]=g,m.keys.push(r))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([r,g])=>{typeof g=="function"&&(m.coercions[r]=g,m.keys.push(r))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(r){m.configs[r]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([r,g])=>{(typeof g=="boolean"||typeof g=="function")&&(m.configs[r]=g)})),q(n.key,o,n.default,m.arrays),Object.keys(a).forEach(function(r){(m.aliases[r]||[]).forEach(function(g){a[g]=a[r]})});let E=null;kn();let T=[];const Q=Object.assign(Object.create(null),{_:[]}),ge={};for(let r=0;r=3&&(V(A[1],m.arrays)?r=f(r,A[1],c,A[2]):V(A[1],m.nargs)!==!1?r=X(r,A[1],c,A[2]):R(A[1],A[2],!0));else if(g.match(S)&&s["boolean-negation"])A=g.match(S),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],R(d,V(d,m.arrays)?[!1]:!1));else if(g.match(/^--.+/)||!s["short-option-groups"]&&g.match(/^-[^-]+/))A=g.match(/^--?(.+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],V(d,m.arrays)?r=f(r,d,c):V(d,m.nargs)!==!1?r=X(r,d,c):(B=c[r+1],B!==void 0&&(!B.match(/^-/)||B.match(K))&&!V(d,m.bools)&&!V(d,m.counts)||/^(true|false)$/.test(B)?(R(d,B),r++):R(d,Ne(d))));else if(g.match(/^-.\..+=/))A=g.match(/^-([^=]+)=([\s\S]*)$/),A!==null&&Array.isArray(A)&&A.length>=3&&R(A[1],A[2]);else if(g.match(/^-.\..+/)&&!g.match(K))B=c[r+1],A=g.match(/^-(.\..+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],B!==void 0&&!B.match(/^-/)&&!V(d,m.bools)&&!V(d,m.counts)?(R(d,B),r++):R(d,Ne(d)));else if(g.match(/^-[^-]+/)&&!g.match(K)){x=g.slice(1,-1).split(""),G=!1;for(let ie=0;ier!=="--"&&r.includes("-")).forEach(r=>{delete Q[r]}),s["strip-aliased"]&&[].concat(...Object.keys(o).map(r=>o[r])).forEach(r=>{s["camel-case-expansion"]&&r.includes("-")&&delete Q[r.split(".").map(g=>Te(g)).join(".")],delete Q[r]});function Ze(r){const g=W("_",r);(typeof g=="string"||typeof g=="number")&&Q._.push(g)}function X(r,g,h,G){let d,x=V(g,m.nargs);if(x=typeof x!="number"||isNaN(x)?1:x,x===0)return fe(G)||(E=Error(L("Argument unexpected for: %s",g))),R(g,Ne(g)),r;let A=fe(G)?0:1;if(s["nargs-eats-options"])h.length-(r+1)+A0&&(R(g,G),B--),d=r+1;d0||A&&typeof A=="number"&&d.length>=A||(x=h[B],/^-/.test(x)&&!K.test(x)&&!He(x)));B++)r=B,d.push(D(g,x,i))}return typeof A=="number"&&(A&&d.length1&&s["dot-notation"]&&(m.aliases[d[0]]||[]).forEach(function(x){let A=x.split(".");const B=[].concat(d);B.shift(),A=A.concat(B),(m.aliases[r]||[]).includes(A.join("."))||U(Q,A,G)}),V(r,m.normalize)&&!V(r,m.arrays)&&[r].concat(m.aliases[r]||[]).forEach(function(A){Object.defineProperty(ge,A,{enumerable:!0,get(){return g},set(B){g=typeof B=="string"?Re.normalize(B):B}})})}function v(r,g){m.aliases[r]&&m.aliases[r].length||(m.aliases[r]=[g],p[g]=!0),m.aliases[g]&&m.aliases[g].length||v(g,r)}function D(r,g,h){h&&(g=Vc(g)),(V(r,m.bools)||V(r,m.counts))&&typeof g=="string"&&(g=g==="true");let G=Array.isArray(g)?g.map(function(d){return W(r,d)}):W(r,g);return V(r,m.counts)&&(fe(G)||typeof G=="boolean")&&(G=Ft()),V(r,m.normalize)&&V(r,m.arrays)&&(Array.isArray(g)?G=g.map(d=>Re.normalize(d)):G=Re.normalize(g)),G}function W(r,g){return!s["parse-positional-numbers"]&&r==="_"||!V(r,m.strings)&&!V(r,m.bools)&&!Array.isArray(g)&&(mn(g)&&s["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${g}`)))||!fe(g)&&V(r,m.numbers))&&(g=Number(g)),g}function C(r){const g=Object.create(null);z(g,m.aliases,a),Object.keys(m.configs).forEach(function(h){const G=r[h]||g[h];if(G)try{let d=null;const x=Re.resolve(Re.cwd(),G),A=m.configs[h];if(typeof A=="function"){try{d=A(x)}catch(B){d=B}if(d instanceof Error){E=d;return}}else d=Re.require(x);H(d)}catch(d){d.name==="PermissionDenied"?E=d:r[h]&&(E=Error(L("Invalid JSON config file: %s",G)))}})}function H(r,g){Object.keys(r).forEach(function(h){const G=r[h],d=g?g+"."+h:h;typeof G=="object"&&G!==null&&!Array.isArray(G)&&s["dot-notation"]?H(G,d):(!w(Q,d.split("."))||V(d,m.arrays)&&s["combine-arrays"])&&R(d,G)})}function y(){typeof Z<"u"&&Z.forEach(function(r){H(r)})}function F(r,g){if(typeof u>"u")return;const h=typeof u=="string"?u:"",G=Re.env();Object.keys(G).forEach(function(d){if(h===""||d.lastIndexOf(h,0)===0){const x=d.split("__").map(function(A,B){return B===0&&(A=A.substring(h.length)),Te(A)});(g&&m.configs[x.join(".")]||!g)&&!w(r,x)&&R(x.join("."),G[d])}})}function J(r){let g;const h=new Set;Object.keys(r).forEach(function(G){if(!h.has(G)&&(g=V(G,m.coercions),typeof g=="function"))try{const d=W(G,g(r[G]));[].concat(m.aliases[G]||[],G).forEach(x=>{h.add(x),r[x]=d})}catch(d){E=d}})}function k(r){return m.keys.forEach(g=>{~g.indexOf(".")||typeof r[g]>"u"&&(r[g]=void 0)}),r}function z(r,g,h,G=!1){Object.keys(h).forEach(function(d){w(r,d.split("."))||(U(r,d.split("."),h[d]),G&&(Y[d]=!0),(g[d]||[]).forEach(function(x){w(r,x.split("."))||U(r,x.split("."),h[d])}))})}function w(r,g){let h=r;s["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(d){h=h[d]||{}});const G=g[g.length-1];return typeof h!="object"?!1:G in h}function U(r,g,h){let G=r;s["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(_){_=Xl(_),typeof G=="object"&&G[_]===void 0&&(G[_]={}),typeof G[_]!="object"||Array.isArray(G[_])?(Array.isArray(G[_])?G[_].push({}):G[_]=[G[_],{}],G=G[_][G[_].length-1]):G=G[_]});const d=Xl(g[g.length-1]),x=V(g.join("."),m.arrays),A=Array.isArray(h);let B=s["duplicate-arguments-array"];!B&&V(d,m.nargs)&&(B=!0,(!fe(G[d])&&m.nargs[d]===1||Array.isArray(G[d])&&G[d].length===m.nargs[d])&&(G[d]=void 0)),h===Ft()?G[d]=Ft(G[d]):Array.isArray(G[d])?B&&x&&A?G[d]=s["flatten-duplicate-arrays"]?G[d].concat(h):(Array.isArray(G[d][0])?G[d]:[G[d]]).concat([h]):!B&&!!x==!!A?G[d]=h:G[d]=G[d].concat([h]):G[d]===void 0&&x?G[d]=A?h:[h]:B&&!(G[d]===void 0||V(d,m.counts)||V(d,m.bools))?G[d]=[G[d],h]:G[d]=h}function q(...r){r.forEach(function(g){Object.keys(g||{}).forEach(function(h){m.aliases[h]||(m.aliases[h]=[].concat(o[h]||[]),m.aliases[h].concat(h).forEach(function(G){if(/-/.test(G)&&s["camel-case-expansion"]){const d=Te(G);d!==h&&m.aliases[h].indexOf(d)===-1&&(m.aliases[h].push(d),p[d]=!0)}}),m.aliases[h].concat(h).forEach(function(G){if(G.length>1&&/[A-Z]/.test(G)&&s["camel-case-expansion"]){const d=bn(G,"-");d!==h&&m.aliases[h].indexOf(d)===-1&&(m.aliases[h].push(d),p[d]=!0)}}),m.aliases[h].forEach(function(G){m.aliases[G]=[h].concat(m.aliases[h].filter(function(d){return G!==d}))}))})})}function V(r,g){const h=[].concat(m.aliases[r]||[],r),G=Object.keys(g),d=h.find(x=>G.includes(x));return d?g[d]:!1}function me(r){const g=Object.keys(m);return[].concat(g.map(G=>m[G])).some(function(G){return Array.isArray(G)?G.includes(r):G[r]})}function ce(r,...g){return[].concat(...g).some(function(G){const d=r.match(G);return d&&me(d[1])})}function Xe(r){if(r.match(K)||!r.match(/^-[^-]+/))return!1;let g=!0,h;const G=r.slice(1).split("");for(let d=0;dV(r,m.arrays)?(E=Error(L("Invalid configuration: %s, opts.count excludes opts.array.",r)),!0):V(r,m.nargs)?(E=Error(L("Invalid configuration: %s, opts.count excludes opts.narg.",r)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(ge,Q),configuration:s,defaulted:Object.assign({},Y),error:E,newAliases:Object.assign({},p)}}}function Rc(e){const l=[],t=Object.create(null);let n=!0;for(Object.keys(e).forEach(function(c){l.push([].concat(e[c],c))});n;){n=!1;for(let c=0;cAc,format:Sn.format,normalize:ae.normalize,resolve:ae.resolve,require:e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse(Dl.readFileSync(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),lt=function(l,t){return un.parse(l.slice(),t).argv};lt.detailed=function(e,l){return un.parse(e.slice(),l)};lt.camelCase=Te;lt.decamelize=bn;lt.looksLikeNumber=mn;const Yc={exportToOo:"导出为......",exportWithPrevious:"使用上一次设置导出",exportSuccessNotice:M`导出文件 ${0} 成功!`,exportCommandOutputMessage:M`命令:${0}`,exportErrorOutputMessage:M`命令 ${0},错误:${1}`,pleaseOpenFile:"请打开一个文件先。",preparing:M`正在生成 "${0}" ......`,exportDialog:{fileName:"文件名",type:"类型",exportTo:"导出到",title:M`导出为 ${0}`,export:"导出",selectExportFolder:"请选择导出文件夹",overwriteConfirmation:"覆盖提示"},messageBox:{yes:"是",no:"否",ok:"确认",cancel:"取消"},overwriteConfirmationDialog:{replace:"替换",title:M`"${0}" 已经存在。您要替换它吗?`,message:M`"${0}" 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。`},settingTab:{title:"导出设置",general:"通用",name:"名称",customLocation:"自定义",pandocVersion:M`版本: ${0}`,pandocVersionWithWarning:M`Version: ${0}, 请升级版本到 ${1}`,pandocNotFound:"找不到 Pandoc,请填写 Pandoc 文件路径,或者将其添加到系统环境变量中。",pandocPath:"Pandoc 路径",defaultFolderForExportedFile:"默认的导出文件夹",openExportedFileLocation:"打开导出文件所在目录",sameFolderWithCurrentFile:"与原文件同一目录下",openExportedFile:"打开导出文件",pandocPathPlaceholder:"(自动检测)",editCommandTemplate:"编辑命令模板",chooseCommandTemplate:"选择模板",afterExport:"导出后",command:"命令",arguments:"参数",auto:"自动",reset:"重置",add:"添加",remove:"移除",rename:"重命名",targetFileExtensions:"目标文件扩展名",targetFileExtensionsTip:"(用空格分开)",showCommandOutput:"显示命令行输出",runCommand:"运行自定义命令",extraArguments:"自定义参数",save:"保存",new:"新建",template:"模板",advanced:"高级",environmentVariables:"环境变量",environmentVariablesDesc:"定义导出的环境变量.",ShowExportProgressBar:"显示导出进度条"}},Jc={exportToOo:"Export to...",exportSuccessNotice:M`Export file ${0} success!`,exportCommandOutputMessage:M`Command: ${0}`,exportErrorOutputMessage:M`Command: ${0},Error:${1}`,exportWithPrevious:"Export with Previous",pleaseOpenFile:"Please open a file first.",preparing:M`generating "${0}"...`,exportDialog:{exportTo:"Export to",fileName:"File Name",title:M`Export to ${0}`,export:"Export",selectExportFolder:"Please select an export folder.",overwriteConfirmation:"Overwrite confirmation",type:"Type"},messageBox:{yes:"Yes",no:"No",ok:"Ok",cancel:"Cancel"},overwriteConfirmationDialog:{replace:"Replace",title:M`"${0}" already exists. Do you want to replace it?`,message:M`A file or folder with the same name already exists in the folder "${0}". Replacing it will overwrite its current contents.`},settingTab:{general:"General",name:"Name",title:"Export Settings",pandocVersion:M`Version: ${0}`,pandocVersionWithWarning:M`Version: ${0}, please upgrade version to ${1}`,pandocNotFound:"Pandoc not found, please fill in the Pandoc file path, or add it to the system environment variables.",defaultFolderForExportedFile:"Default Folder for Exported File",openExportedFileLocation:"Open exported file location",ShowExportProgressBar:"Show export progress bar",openExportedFile:"Open exported file",pandocPath:"Pandoc path",pandocPathPlaceholder:"(Auto Detect)",editCommandTemplate:"Edit Command Template",chooseCommandTemplate:"Choose template",customLocation:"Custom location",template:"Template",command:"Command",reset:"Reset",auto:"Auto",add:"Add",remove:"Remove",rename:"Rename",sameFolderWithCurrentFile:"Same folder with current file",afterExport:"After Export",targetFileExtensions:"Target file extensions",targetFileExtensionsTip:"(Separated by whitespace)",showCommandOutput:"Show command output",runCommand:"Run command",extraArguments:"Extra arguments",save:"Save",new:"New",arguments:"Arguments",advanced:"Advanced",environmentVariables:"Environment Variables",environmentVariablesDesc:"Define the Environment Variables for exporting."}},xc={exportToOo:"Export to...",exportSuccessNotice:M`Export der Datei ${0} erfolgreich!`,exportCommandOutputMessage:M`Command: ${0}`,exportErrorOutputMessage:M`Command: ${0},Fehler:${1}`,exportWithPrevious:"Exportiere mit Vorherigem",pleaseOpenFile:"Bitte öffne zunächst eine Datei.",preparing:M`generating "${0}"...`,exportDialog:{exportTo:"Exportiere nach",fileName:"Dateiname",title:M`Export to ${0}`,export:"Export",selectExportFolder:"Zielordner auswählen",overwriteConfirmation:"Überschreibe den Zielordner",type:"Typ"},messageBox:{yes:"Ja",no:"Nein",ok:"Ok",cancel:"Abbrechen"},overwriteConfirmationDialog:{replace:"Ersetze",title:M`"${0}" existiert bereits. Soll er ersetzt werden?`,message:M`Eine Datei oder ein Ordner mit dem gleichen Namen existiert bereits im Ordner "${0}". Das Ersetzen wird die jetzigen Inhalte überschreiben.`},settingTab:{general:"Allgemein",name:"Name",title:"Export-Einstellungen",pandocVersion:M`Version: ${0}`,pandocVersionWithWarning:M`Version: ${0}, please upgrade version to ${1}`,pandocNotFound:"Pandoc.exe wurde nicht gefunden. Bitte geben Sie den Pfad zur Pandoc.exe ein oder fügen Sie ihn den Window Systemumgebungsvariablen hinzu.",defaultFolderForExportedFile:"Standardordner für exportierte Dateien",openExportedFileLocation:"Speicherort der exportierten Datei öffnen",openExportedFile:"Exportierte Datei öffnen",pandocPath:"Pfad zur Datei Pandoc.exe",pandocPathPlaceholder:"(Automatische Erkennung)",editCommandTemplate:"‘Befehlsvorlage bearbeiten",chooseCommandTemplate:"Vorlage auswählen",customLocation:"Benutzerdefinierter Speicherort",template:"Vorlage",command:"Befehl",reset:"Zurücksetzen",auto:"Auto",add:"Hinzufügen",remove:"Entfernen",rename:"Umbenennen",sameFolderWithCurrentFile:"Der gleiche Ordner mit der aktuellen Datei",afterExport:"Nach dem Export",targetFileExtensions:"Dateinamenserweiterung der Zieldatei",targetFileExtensionsTip:"(Mit Leerzeichen getrennt)",showCommandOutput:"Zeige die Ausgabe des Befehls",runCommand:"Starte den Befehl",extraArguments:"Zusätzliche Parameter",save:"Speichern",new:"Neu",arguments:"Parameter",advanced:"Advanced",environmentVariables:"Environment Variables",environmentVariablesDesc:"Define the Environment Variables for exporting.",ShowExportProgressBar:"Show export progressBar"}},Gn={"de-DE":xc,"en-US":Jc,"zh-CN":Yc,get current(){const e=Object.keys(this),l=Ie.moment.locale().toLowerCase();let t=e.find(c=>c.toLowerCase()===l.toLowerCase());if(t)return this[t];const n=l.split("-")[0];return t=e.find(c=>c.toLowerCase().startsWith(n)),t?this[t]:this["en-US"]}};class Vl extends Ie.Modal{constructor(l,t,n){super(l),this.options=typeof t=="string"?{message:t,buttons:"Ok",title:n}:t,this.lang=Gn.current}onOpen(){const{titleEl:l,contentEl:t,lang:n,options:{message:c,title:i,buttons:o,callback:s,buttonsLabel:a,buttonsClass:Z}}=this;switch(i&&l.setText(i),t.createDiv({text:c}),o){case"Yes":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.yes)??n.messageBox.yes,cls:["mod-cta",Z==null?void 0:Z.yes],parent:u}).onclick=()=>this.call(s==null?void 0:s.yes)});break;case"YesNo":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.yes)??n.messageBox.yes,cls:["mod-cta",Z==null?void 0:Z.yes],parent:u}).onclick=()=>this.call(s==null?void 0:s.yes),u.createEl("button",{text:(a==null?void 0:a.no)??n.messageBox.no,cls:["mod-cta",Z==null?void 0:Z.no],parent:u}).onclick=()=>this.call(s==null?void 0:s.no)});break;case"Ok":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.ok)??n.messageBox.ok,cls:["mod-cta",Z==null?void 0:Z.no],parent:u}).onclick=()=>this.call(s==null?void 0:s.ok)});break;case"OkCancel":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.ok)??n.messageBox.ok,cls:["mod-cta",Z==null?void 0:Z.ok],parent:u}).onclick=()=>this.call(s==null?void 0:s.ok),u.createEl("button",{text:(a==null?void 0:a.cancel)??n.messageBox.cancel,cls:["mod-cta",Z==null?void 0:Z.cancel],parent:u}).onclick=()=>this.call(s==null?void 0:s.cancel)});break}}call(l){l&&l(),this.close()}onClose(){const{contentEl:l}=this;l.empty()}}var Bc=be('
');const yc=e=>(()=>{var l=Bc(),t=l.firstChild,n=e.ref;return typeof n=="function"?Rt(n,l):e.ref=l,ne(t,()=>e.message),l})(),Fc=e=>we(l=>{let t=!1;const n=()=>{t||(t=!0,l())};let c;return ne(document.body,()=>I(yc,{ref(i){var o=c;typeof o=="function"?o(i):c=i},message:e})),ze(()=>{c instanceof Node&&document.body.contains(c)&&document.body.removeChild(c)}),n}),Hc={show:Fc};function Nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $t={exports:{}};const vc="2.0.0",In=256,kc=Number.MAX_SAFE_INTEGER||9007199254740991,wc=16,Sc=In-6,Ec=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Vt={MAX_LENGTH:In,MAX_SAFE_COMPONENT_LENGTH:wc,MAX_SAFE_BUILD_LENGTH:Sc,MAX_SAFE_INTEGER:kc,RELEASE_TYPES:Ec,SEMVER_SPEC_VERSION:vc,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Kc=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var At=Kc;(function(e,l){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:c}=Vt,i=At;l=e.exports={};const o=l.re=[],s=l.safeRe=[],a=l.src=[],Z=l.t={};let u=0;const b="[a-zA-Z0-9-]",N=[["\\s",1],["\\d",c],[b,n]],p=L=>{for(const[m,K]of N)L=L.split(`${m}*`).join(`${m}{0,${K}}`).split(`${m}+`).join(`${m}{1,${K}}`);return L},Y=(L,m,K)=>{const S=p(m),E=u++;i(L,E,m),Z[L]=E,a[E]=m,o[E]=new RegExp(m,K?"g":void 0),s[E]=new RegExp(S,K?"g":void 0)};Y("NUMERICIDENTIFIER","0|[1-9]\\d*"),Y("NUMERICIDENTIFIERLOOSE","\\d+"),Y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${b}*`),Y("MAINVERSION",`(${a[Z.NUMERICIDENTIFIER]})\\.(${a[Z.NUMERICIDENTIFIER]})\\.(${a[Z.NUMERICIDENTIFIER]})`),Y("MAINVERSIONLOOSE",`(${a[Z.NUMERICIDENTIFIERLOOSE]})\\.(${a[Z.NUMERICIDENTIFIERLOOSE]})\\.(${a[Z.NUMERICIDENTIFIERLOOSE]})`),Y("PRERELEASEIDENTIFIER",`(?:${a[Z.NUMERICIDENTIFIER]}|${a[Z.NONNUMERICIDENTIFIER]})`),Y("PRERELEASEIDENTIFIERLOOSE",`(?:${a[Z.NUMERICIDENTIFIERLOOSE]}|${a[Z.NONNUMERICIDENTIFIER]})`),Y("PRERELEASE",`(?:-(${a[Z.PRERELEASEIDENTIFIER]}(?:\\.${a[Z.PRERELEASEIDENTIFIER]})*))`),Y("PRERELEASELOOSE",`(?:-?(${a[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[Z.PRERELEASEIDENTIFIERLOOSE]})*))`),Y("BUILDIDENTIFIER",`${b}+`),Y("BUILD",`(?:\\+(${a[Z.BUILDIDENTIFIER]}(?:\\.${a[Z.BUILDIDENTIFIER]})*))`),Y("FULLPLAIN",`v?${a[Z.MAINVERSION]}${a[Z.PRERELEASE]}?${a[Z.BUILD]}?`),Y("FULL",`^${a[Z.FULLPLAIN]}$`),Y("LOOSEPLAIN",`[v=\\s]*${a[Z.MAINVERSIONLOOSE]}${a[Z.PRERELEASELOOSE]}?${a[Z.BUILD]}?`),Y("LOOSE",`^${a[Z.LOOSEPLAIN]}$`),Y("GTLT","((?:<|>)?=?)"),Y("XRANGEIDENTIFIERLOOSE",`${a[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Y("XRANGEIDENTIFIER",`${a[Z.NUMERICIDENTIFIER]}|x|X|\\*`),Y("XRANGEPLAIN",`[v=\\s]*(${a[Z.XRANGEIDENTIFIER]})(?:\\.(${a[Z.XRANGEIDENTIFIER]})(?:\\.(${a[Z.XRANGEIDENTIFIER]})(?:${a[Z.PRERELEASE]})?${a[Z.BUILD]}?)?)?`),Y("XRANGEPLAINLOOSE",`[v=\\s]*(${a[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[Z.XRANGEIDENTIFIERLOOSE]})(?:${a[Z.PRERELEASELOOSE]})?${a[Z.BUILD]}?)?)?`),Y("XRANGE",`^${a[Z.GTLT]}\\s*${a[Z.XRANGEPLAIN]}$`),Y("XRANGELOOSE",`^${a[Z.GTLT]}\\s*${a[Z.XRANGEPLAINLOOSE]}$`),Y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),Y("COERCE",`${a[Z.COERCEPLAIN]}(?:$|[^\\d])`),Y("COERCEFULL",a[Z.COERCEPLAIN]+`(?:${a[Z.PRERELEASE]})?(?:${a[Z.BUILD]})?(?:$|[^\\d])`),Y("COERCERTL",a[Z.COERCE],!0),Y("COERCERTLFULL",a[Z.COERCEFULL],!0),Y("LONETILDE","(?:~>?)"),Y("TILDETRIM",`(\\s*)${a[Z.LONETILDE]}\\s+`,!0),l.tildeTrimReplace="$1~",Y("TILDE",`^${a[Z.LONETILDE]}${a[Z.XRANGEPLAIN]}$`),Y("TILDELOOSE",`^${a[Z.LONETILDE]}${a[Z.XRANGEPLAINLOOSE]}$`),Y("LONECARET","(?:\\^)"),Y("CARETTRIM",`(\\s*)${a[Z.LONECARET]}\\s+`,!0),l.caretTrimReplace="$1^",Y("CARET",`^${a[Z.LONECARET]}${a[Z.XRANGEPLAIN]}$`),Y("CARETLOOSE",`^${a[Z.LONECARET]}${a[Z.XRANGEPLAINLOOSE]}$`),Y("COMPARATORLOOSE",`^${a[Z.GTLT]}\\s*(${a[Z.LOOSEPLAIN]})$|^$`),Y("COMPARATOR",`^${a[Z.GTLT]}\\s*(${a[Z.FULLPLAIN]})$|^$`),Y("COMPARATORTRIM",`(\\s*)${a[Z.GTLT]}\\s*(${a[Z.LOOSEPLAIN]}|${a[Z.XRANGEPLAIN]})`,!0),l.comparatorTrimReplace="$1$2$3",Y("HYPHENRANGE",`^\\s*(${a[Z.XRANGEPLAIN]})\\s+-\\s+(${a[Z.XRANGEPLAIN]})\\s*$`),Y("HYPHENRANGELOOSE",`^\\s*(${a[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[Z.XRANGEPLAINLOOSE]})\\s*$`),Y("STAR","(<|>)?=?\\s*\\*"),Y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),Y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})($t,$t.exports);var nt=$t.exports;const Qc=Object.freeze({loose:!0}),zc=Object.freeze({}),Uc=e=>e?typeof e!="object"?Qc:e:zc;var ll=Uc;const Al=/^[0-9]+$/,Cn=(e,l)=>{const t=Al.test(e),n=Al.test(l);return t&&n&&(e=+e,l=+l),e===l?0:t&&!n?-1:n&&!t?1:eCn(l,e);var Wn={compareIdentifiers:Cn,rcompareIdentifiers:jc};const it=At,{MAX_LENGTH:Yl,MAX_SAFE_INTEGER:st}=Vt,{safeRe:Jl,t:xl}=nt,Lc=ll,{compareIdentifiers:ke}=Wn;let Mc=class he{constructor(l,t){if(t=Lc(t),l instanceof he){if(l.loose===!!t.loose&&l.includePrerelease===!!t.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>Yl)throw new TypeError(`version is longer than ${Yl} characters`);it("SemVer",l,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=l.trim().match(t.loose?Jl[xl.LOOSE]:Jl[xl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>st||this.major<0)throw new TypeError("Invalid major version");if(this.minor>st||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>st||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(c=>{if(/^[0-9]+$/.test(c)){const i=+c;if(i>=0&&i=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(c)}}if(t){let i=[t,c];n===!1&&(i=[t]),ke(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var se=Mc;const Bl=se,Tc=(e,l,t=!1)=>{if(e instanceof Bl)return e;try{return new Bl(e,l)}catch(n){if(!t)return null;throw n}};var je=Tc;const $c=je,Oc=(e,l)=>{const t=$c(e,l);return t?t.version:null};var Pc=Oc;const Dc=je,_c=(e,l)=>{const t=Dc(e.trim().replace(/^[=v]+/,""),l);return t?t.version:null};var qc=_c;const yl=se,ei=(e,l,t,n,c)=>{typeof t=="string"&&(c=n,n=t,t=void 0);try{return new yl(e instanceof yl?e.version:e,t).inc(l,n,c).version}catch{return null}};var ti=ei;const Fl=je,li=(e,l)=>{const t=Fl(e,null,!0),n=Fl(l,null,!0),c=t.compare(n);if(c===0)return null;const i=c>0,o=i?t:n,s=i?n:t,a=!!o.prerelease.length;if(!!s.prerelease.length&&!a)return!s.patch&&!s.minor?"major":o.patch?"patch":o.minor?"minor":"major";const u=a?"pre":"";return t.major!==n.major?u+"major":t.minor!==n.minor?u+"minor":t.patch!==n.patch?u+"patch":"prerelease"};var ni=li;const ci=se,ii=(e,l)=>new ci(e,l).major;var si=ii;const oi=se,ai=(e,l)=>new oi(e,l).minor;var ri=ai;const di=se,gi=(e,l)=>new di(e,l).patch;var Zi=gi;const bi=je,mi=(e,l)=>{const t=bi(e,l);return t&&t.prerelease.length?t.prerelease:null};var ui=mi;const Hl=se,Gi=(e,l,t)=>new Hl(e,t).compare(new Hl(l,t));var Ce=Gi;const Ii=Ce,Ci=(e,l,t)=>Ii(l,e,t);var Wi=Ci;const hi=Ce,pi=(e,l)=>hi(e,l,!0);var Xi=pi;const Nl=se,fi=(e,l,t)=>{const n=new Nl(e,t),c=new Nl(l,t);return n.compare(c)||n.compareBuild(c)};var nl=fi;const Ri=nl,Vi=(e,l)=>e.sort((t,n)=>Ri(t,n,l));var Ai=Vi;const Yi=nl,Ji=(e,l)=>e.sort((t,n)=>Yi(n,t,l));var xi=Ji;const Bi=Ce,yi=(e,l,t)=>Bi(e,l,t)>0;var Yt=yi;const Fi=Ce,Hi=(e,l,t)=>Fi(e,l,t)<0;var cl=Hi;const Ni=Ce,vi=(e,l,t)=>Ni(e,l,t)===0;var hn=vi;const ki=Ce,wi=(e,l,t)=>ki(e,l,t)!==0;var pn=wi;const Si=Ce,Ei=(e,l,t)=>Si(e,l,t)>=0;var il=Ei;const Ki=Ce,Qi=(e,l,t)=>Ki(e,l,t)<=0;var sl=Qi;const zi=hn,Ui=pn,ji=Yt,Li=il,Mi=cl,Ti=sl,$i=(e,l,t,n)=>{switch(l){case"===":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e===t;case"!==":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e!==t;case"":case"=":case"==":return zi(e,t,n);case"!=":return Ui(e,t,n);case">":return ji(e,t,n);case">=":return Li(e,t,n);case"<":return Mi(e,t,n);case"<=":return Ti(e,t,n);default:throw new TypeError(`Invalid operator: ${l}`)}};var Xn=$i;const Oi=se,Pi=je,{safeRe:ot,t:at}=nt,Di=(e,l)=>{if(e instanceof Oi)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;l=l||{};let t=null;if(!l.rtl)t=e.match(l.includePrerelease?ot[at.COERCEFULL]:ot[at.COERCE]);else{const a=l.includePrerelease?ot[at.COERCERTLFULL]:ot[at.COERCERTL];let Z;for(;(Z=a.exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||Z.index+Z[0].length!==t.index+t[0].length)&&(t=Z),a.lastIndex=Z.index+Z[1].length+Z[2].length;a.lastIndex=-1}if(t===null)return null;const n=t[2],c=t[3]||"0",i=t[4]||"0",o=l.includePrerelease&&t[5]?`-${t[5]}`:"",s=l.includePrerelease&&t[6]?`+${t[6]}`:"";return Pi(`${n}.${c}.${i}${o}${s}`,l)};var _i=Di;class qi{constructor(){this.max=1e3,this.map=new Map}get(l){const t=this.map.get(l);if(t!==void 0)return this.map.delete(l),this.map.set(l,t),t}delete(l){return this.map.delete(l)}set(l,t){if(!this.delete(l)&&t!==void 0){if(this.map.size>=this.max){const c=this.map.keys().next().value;this.delete(c)}this.map.set(l,t)}return this}}var es=qi,kt,vl;function We(){if(vl)return kt;vl=1;class e{constructor(C,H){if(H=n(H),C instanceof e)return C.loose===!!H.loose&&C.includePrerelease===!!H.includePrerelease?C:new e(C.raw,H);if(C instanceof c)return this.raw=C.value,this.set=[[C]],this.format(),this;if(this.options=H,this.loose=!!H.loose,this.includePrerelease=!!H.includePrerelease,this.raw=C.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(y=>this.parseRange(y.trim())).filter(y=>y.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const y=this.set[0];if(this.set=this.set.filter(F=>!Y(F[0])),this.set.length===0)this.set=[y];else if(this.set.length>1){for(const F of this.set)if(F.length===1&&L(F[0])){this.set=[F];break}}}this.format()}format(){return this.range=this.set.map(C=>C.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(C){const y=((this.options.includePrerelease&&N)|(this.options.loose&&p))+":"+C,F=t.get(y);if(F)return F;const J=this.options.loose,k=J?s[a.HYPHENRANGELOOSE]:s[a.HYPHENRANGE];C=C.replace(k,v(this.options.includePrerelease)),i("hyphen replace",C),C=C.replace(s[a.COMPARATORTRIM],Z),i("comparator trim",C),C=C.replace(s[a.TILDETRIM],u),i("tilde trim",C),C=C.replace(s[a.CARETTRIM],b),i("caret trim",C);let z=C.split(" ").map(V=>K(V,this.options)).join(" ").split(/\s+/).map(V=>R(V,this.options));J&&(z=z.filter(V=>(i("loose invalid filter",V,this.options),!!V.match(s[a.COMPARATORLOOSE])))),i("range list",z);const w=new Map,U=z.map(V=>new c(V,this.options));for(const V of U){if(Y(V))return[V];w.set(V.value,V)}w.size>1&&w.has("")&&w.delete("");const q=[...w.values()];return t.set(y,q),q}intersects(C,H){if(!(C instanceof e))throw new TypeError("a Range is required");return this.set.some(y=>m(y,H)&&C.set.some(F=>m(F,H)&&y.every(J=>F.every(k=>J.intersects(k,H)))))}test(C){if(!C)return!1;if(typeof C=="string")try{C=new o(C,this.options)}catch{return!1}for(let H=0;HW.value==="<0.0.0-0",L=W=>W.value==="",m=(W,C)=>{let H=!0;const y=W.slice();let F=y.pop();for(;H&&y.length;)H=y.every(J=>F.intersects(J,C)),F=y.pop();return H},K=(W,C)=>(i("comp",W,C),W=Q(W,C),i("caret",W),W=E(W,C),i("tildes",W),W=Ze(W,C),i("xrange",W),W=f(W,C),i("stars",W),W),S=W=>!W||W.toLowerCase()==="x"||W==="*",E=(W,C)=>W.trim().split(/\s+/).map(H=>T(H,C)).join(" "),T=(W,C)=>{const H=C.loose?s[a.TILDELOOSE]:s[a.TILDE];return W.replace(H,(y,F,J,k,z)=>{i("tilde",W,y,F,J,k,z);let w;return S(F)?w="":S(J)?w=`>=${F}.0.0 <${+F+1}.0.0-0`:S(k)?w=`>=${F}.${J}.0 <${F}.${+J+1}.0-0`:z?(i("replaceTilde pr",z),w=`>=${F}.${J}.${k}-${z} <${F}.${+J+1}.0-0`):w=`>=${F}.${J}.${k} <${F}.${+J+1}.0-0`,i("tilde return",w),w})},Q=(W,C)=>W.trim().split(/\s+/).map(H=>ge(H,C)).join(" "),ge=(W,C)=>{i("caret",W,C);const H=C.loose?s[a.CARETLOOSE]:s[a.CARET],y=C.includePrerelease?"-0":"";return W.replace(H,(F,J,k,z,w)=>{i("caret",W,F,J,k,z,w);let U;return S(J)?U="":S(k)?U=`>=${J}.0.0${y} <${+J+1}.0.0-0`:S(z)?J==="0"?U=`>=${J}.${k}.0${y} <${J}.${+k+1}.0-0`:U=`>=${J}.${k}.0${y} <${+J+1}.0.0-0`:w?(i("replaceCaret pr",w),J==="0"?k==="0"?U=`>=${J}.${k}.${z}-${w} <${J}.${k}.${+z+1}-0`:U=`>=${J}.${k}.${z}-${w} <${J}.${+k+1}.0-0`:U=`>=${J}.${k}.${z}-${w} <${+J+1}.0.0-0`):(i("no pr"),J==="0"?k==="0"?U=`>=${J}.${k}.${z}${y} <${J}.${k}.${+z+1}-0`:U=`>=${J}.${k}.${z}${y} <${J}.${+k+1}.0-0`:U=`>=${J}.${k}.${z} <${+J+1}.0.0-0`),i("caret return",U),U})},Ze=(W,C)=>(i("replaceXRanges",W,C),W.split(/\s+/).map(H=>X(H,C)).join(" ")),X=(W,C)=>{W=W.trim();const H=C.loose?s[a.XRANGELOOSE]:s[a.XRANGE];return W.replace(H,(y,F,J,k,z,w)=>{i("xRange",W,y,F,J,k,z,w);const U=S(J),q=U||S(k),V=q||S(z),me=V;return F==="="&&me&&(F=""),w=C.includePrerelease?"-0":"",U?F===">"||F==="<"?y="<0.0.0-0":y="*":F&&me?(q&&(k=0),z=0,F===">"?(F=">=",q?(J=+J+1,k=0,z=0):(k=+k+1,z=0)):F==="<="&&(F="<",q?J=+J+1:k=+k+1),F==="<"&&(w="-0"),y=`${F+J}.${k}.${z}${w}`):q?y=`>=${J}.0.0${w} <${+J+1}.0.0-0`:V&&(y=`>=${J}.${k}.0${w} <${J}.${+k+1}.0-0`),i("xRange return",y),y})},f=(W,C)=>(i("replaceStars",W,C),W.trim().replace(s[a.STAR],"")),R=(W,C)=>(i("replaceGTE0",W,C),W.trim().replace(s[C.includePrerelease?a.GTE0PRE:a.GTE0],"")),v=W=>(C,H,y,F,J,k,z,w,U,q,V,me)=>(S(y)?H="":S(F)?H=`>=${y}.0.0${W?"-0":""}`:S(J)?H=`>=${y}.${F}.0${W?"-0":""}`:k?H=`>=${H}`:H=`>=${H}${W?"-0":""}`,S(U)?w="":S(q)?w=`<${+U+1}.0.0-0`:S(V)?w=`<${U}.${+q+1}.0-0`:me?w=`<=${U}.${q}.${V}-${me}`:W?w=`<${U}.${q}.${+V+1}-0`:w=`<=${w}`,`${H} ${w}`.trim()),D=(W,C,H)=>{for(let y=0;y0){const F=W[y].semver;if(F.major===C.major&&F.minor===C.minor&&F.patch===C.patch)return!0}return!1}return!0};return kt}var wt,kl;function Jt(){if(kl)return wt;kl=1;const e=Symbol("SemVer ANY");class l{static get ANY(){return e}constructor(u,b){if(b=t(b),u instanceof l){if(u.loose===!!b.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,b),this.options=b,this.loose=!!b.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const b=this.options.loose?n[c.COMPARATORLOOSE]:n[c.COMPARATOR],N=u.match(b);if(!N)throw new TypeError(`Invalid comparator: ${u}`);this.operator=N[1]!==void 0?N[1]:"",this.operator==="="&&(this.operator=""),N[2]?this.semver=new s(N[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new s(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,b){if(!(u instanceof l))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(u.value,b).test(this.value):u.operator===""?u.value===""?!0:new a(this.value,b).test(u.semver):(b=t(b),b.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!b.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,b)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,b)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}wt=l;const t=ll,{safeRe:n,t:c}=nt,i=Xn,o=At,s=se,a=We();return wt}const ts=We(),ls=(e,l,t)=>{try{l=new ts(l,t)}catch{return!1}return l.test(e)};var xt=ls;const ns=We(),cs=(e,l)=>new ns(e,l).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));var is=cs;const ss=se,os=We(),as=(e,l,t)=>{let n=null,c=null,i=null;try{i=new os(l,t)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||c.compare(o)===-1)&&(n=o,c=new ss(n,t))}),n};var rs=as;const ds=se,gs=We(),Zs=(e,l,t)=>{let n=null,c=null,i=null;try{i=new gs(l,t)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||c.compare(o)===1)&&(n=o,c=new ds(n,t))}),n};var bs=Zs;const St=se,ms=We(),wl=Yt,us=(e,l)=>{e=new ms(e,l);let t=new St("0.0.0");if(e.test(t)||(t=new St("0.0.0-0"),e.test(t)))return t;t=null;for(let n=0;n{const s=new St(o.semver.version);switch(o.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!i||wl(s,i))&&(i=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!t||wl(t,i))&&(t=i)}return t&&e.test(t)?t:null};var Gs=us;const Is=We(),Cs=(e,l)=>{try{return new Is(e,l).range||"*"}catch{return null}};var Ws=Cs;const hs=se,fn=Jt(),{ANY:ps}=fn,Xs=We(),fs=xt,Sl=Yt,El=cl,Rs=sl,Vs=il,As=(e,l,t,n)=>{e=new hs(e,n),l=new Xs(l,n);let c,i,o,s,a;switch(t){case">":c=Sl,i=Rs,o=El,s=">",a=">=";break;case"<":c=El,i=Vs,o=Sl,s="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(fs(e,l,n))return!1;for(let Z=0;Z{p.semver===ps&&(p=new fn(">=0.0.0")),b=b||p,N=N||p,c(p.semver,b.semver,n)?b=p:o(p.semver,N.semver,n)&&(N=p)}),b.operator===s||b.operator===a||(!N.operator||N.operator===s)&&i(e,N.semver))return!1;if(N.operator===a&&o(e,N.semver))return!1}return!0};var ol=As;const Ys=ol,Js=(e,l,t)=>Ys(e,l,">",t);var xs=Js;const Bs=ol,ys=(e,l,t)=>Bs(e,l,"<",t);var Fs=ys;const Kl=We(),Hs=(e,l,t)=>(e=new Kl(e,t),l=new Kl(l,t),e.intersects(l,t));var Ns=Hs;const vs=xt,ks=Ce;var ws=(e,l,t)=>{const n=[];let c=null,i=null;const o=e.sort((u,b)=>ks(u,b,t));for(const u of o)vs(u,l,t)?(i=u,c||(c=u)):(i&&n.push([c,i]),i=null,c=null);c&&n.push([c,null]);const s=[];for(const[u,b]of n)u===b?s.push(u):!b&&u===o[0]?s.push("*"):b?u===o[0]?s.push(`<=${b}`):s.push(`${u} - ${b}`):s.push(`>=${u}`);const a=s.join(" || "),Z=typeof l.raw=="string"?l.raw:String(l);return a.length{if(e===l)return!0;e=new Ql(e,t),l=new Ql(l,t);let n=!1;e:for(const c of e.set){for(const i of l.set){const o=Ks(c,i,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Es=[new al(">=0.0.0-0")],zl=[new al(">=0.0.0")],Ks=(e,l,t)=>{if(e===l)return!0;if(e.length===1&&e[0].semver===Et){if(l.length===1&&l[0].semver===Et)return!0;t.includePrerelease?e=Es:e=zl}if(l.length===1&&l[0].semver===Et){if(t.includePrerelease)return!0;l=zl}const n=new Set;let c,i;for(const p of e)p.operator===">"||p.operator===">="?c=Ul(c,p,t):p.operator==="<"||p.operator==="<="?i=jl(i,p,t):n.add(p.semver);if(n.size>1)return null;let o;if(c&&i){if(o=rl(c.semver,i.semver,t),o>0)return null;if(o===0&&(c.operator!==">="||i.operator!=="<="))return null}for(const p of n){if(c&&!Me(p,String(c),t)||i&&!Me(p,String(i),t))return null;for(const Y of l)if(!Me(p,String(Y),t))return!1;return!0}let s,a,Z,u,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1,N=c&&!t.includePrerelease&&c.semver.prerelease.length?c.semver:!1;b&&b.prerelease.length===1&&i.operator==="<"&&b.prerelease[0]===0&&(b=!1);for(const p of l){if(u=u||p.operator===">"||p.operator===">=",Z=Z||p.operator==="<"||p.operator==="<=",c){if(N&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===N.major&&p.semver.minor===N.minor&&p.semver.patch===N.patch&&(N=!1),p.operator===">"||p.operator===">="){if(s=Ul(c,p,t),s===p&&s!==c)return!1}else if(c.operator===">="&&!Me(c.semver,String(p),t))return!1}if(i){if(b&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===b.major&&p.semver.minor===b.minor&&p.semver.patch===b.patch&&(b=!1),p.operator==="<"||p.operator==="<="){if(a=jl(i,p,t),a===p&&a!==i)return!1}else if(i.operator==="<="&&!Me(i.semver,String(p),t))return!1}if(!p.operator&&(i||c)&&o!==0)return!1}return!(c&&Z&&!i&&o!==0||i&&u&&!c&&o!==0||N||b)},Ul=(e,l,t)=>{if(!e)return l;const n=rl(e.semver,l.semver,t);return n>0?e:n<0||l.operator===">"&&e.operator===">="?l:e},jl=(e,l,t)=>{if(!e)return l;const n=rl(e.semver,l.semver,t);return n<0?e:n>0||l.operator==="<"&&e.operator==="<="?l:e};var Qs=Ss;const Kt=nt,Ll=Vt,zs=se,Ml=Wn,Us=je,js=Pc,Ls=qc,Ms=ti,Ts=ni,$s=si,Os=ri,Ps=Zi,Ds=ui,_s=Ce,qs=Wi,eo=Xi,to=nl,lo=Ai,no=xi,co=Yt,io=cl,so=hn,oo=pn,ao=il,ro=sl,go=Xn,Zo=_i,bo=Jt(),mo=We(),uo=xt,Go=is,Io=rs,Co=bs,Wo=Gs,ho=Ws,po=ol,Xo=xs,fo=Fs,Ro=Ns,Vo=ws,Ao=Qs;var Yo={parse:Us,valid:js,clean:Ls,inc:Ms,diff:Ts,major:$s,minor:Os,patch:Ps,prerelease:Ds,compare:_s,rcompare:qs,compareLoose:eo,compareBuild:to,sort:lo,rsort:no,gt:co,lt:io,eq:so,neq:oo,gte:ao,lte:ro,cmp:go,coerce:Zo,Comparator:bo,Range:mo,satisfies:uo,toComparators:Go,maxSatisfying:Io,minSatisfying:Co,minVersion:Wo,validRange:ho,outside:po,gtr:Xo,ltr:fo,intersects:Ro,simplifyRange:Vo,subset:Ao,SemVer:zs,re:Kt.re,src:Kt.src,tokens:Kt.t,SEMVER_SPEC_VERSION:Ll.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ll.RELEASE_TYPES,compareIdentifiers:Ml.compareIdentifiers,rcompareIdentifiers:Ml.rcompareIdentifiers},Jo=Yo;const xo=Nc(Jo),Rn=e=>e!=null&&e.includes(" ")?`"${e}"`:`${e??"pandoc"}`;async function Bo(e,l){e=Rn(e);let t=await zt(`${e} --version`,{env:l});t=t.substring(0,t.indexOf(` `)).replace("pandoc.exe","").replace("pandoc","").trim();let n=[...t].filter(c=>c===".").length;if(n===1)t=`${t}.0`;else for(;n>2;)t=t.substring(0,t.lastIndexOf(".")),n-=1;return xo.parse(t,!0)}const yo="3.1.7",bt={normalizePath:Rn,getVersion:Bo,requiredVersion:yo};async function Vn(e,l,t,n,c,i,o,s,a,Z){const{settings:u,lang:b,manifest:N,app:{vault:{adapter:p,config:Y},metadataCache:L}}=e;if(!n){const ce=_l(c);n=`${l.basename}${ce}`}i==null&&(i=u.showOverwriteConfirmation);const m=u.showExportProgressBar,K=p.getBasePath(),S=`${K}/${N.dir}`,E=`${S}/lua`,T=t,Q=`${T}/${n}`,ge=n.substring(0,n.lastIndexOf(".")),Ze=n,X=p.getFullPath(l.path),f=ae.dirname(X),R=l.basename,v=l.name;let D=Y.attachmentFolderPath??"/";D==="/"?D=K:D.startsWith(".")?D=ae.join(f,D.substring(1)):D=ae.join(K,D);let W=null;try{W=L.getCache(l.path).frontmatter}catch(ce){console.error(ce)}const C={pluginDir:S,luaDir:E,outputDir:T,outputPath:Q,outputFileName:ge,outputFileFullName:Ze,currentDir:f,currentPath:X,currentFileName:R,currentFileFullName:v,attachmentFolderPath:D,vaultDir:K,metadata:W,options:o,fromFormat:app.vault.config.useMarkdownLinks?"markdown":"markdown+wikilinks_title_after_pipe"},H=c.type==="custom"&&c.showCommandOutput,y=c.openExportedFileLocation??u.openExportedFileLocation,F=c.openExportedFile??u.openExportedFile;if(i&&Bt.existsSync(Q)){const ce=await ye.remote.dialog.showSaveDialog({title:b.overwriteConfirmationDialog.title(Ze),defaultPath:Q,properties:["showOverwriteConfirmation","createDirectory"]});if(ce.canceled)return;C.outputPath=ce.filePath,C.outputDir=ae.dirname(C.outputPath),C.outputFileFullName=ae.basename(C.outputPath),C.outputFileName=ae.basename(C.outputFileFullName,ae.extname(C.outputFileFullName))}let J;m&&(J=Hc.show(b.preparing(C.outputFileFullName)));const k=C.env=ql(de(u.env)??{},C);let z=bt.normalizePath(de(u.pandocPath));if(pt.platform==="win32"){z=z.replaceAll("\\","/");const ce=["pluginDir","luaDir","outputDir","outputPath","currentDir","currentPath","attachmentFolderPath","vaultDir"];for(const Xe of ce){const He=C[Xe];C[Xe]=He.replaceAll("\\","/")}}const w=c.type==="pandoc"?`${z} "\${currentPath}" ${c.arguments??""} ${c.customArguments??""}`:c.command,U=Ut(w,C),q=lt(U.match(/(?:[^\s"]+|"[^"]*")+/g),{alias:{output:["o"]}}),V=ae.normalize(Kn(q.output)),me=ae.dirname(V);Bt.existsSync(me)||Bt.mkdirSync(me);try{console.log(`[${e.manifest.name}]: export command and options:`,{cmd:U,options:{cwd:C.currentDir,env:k}}),await zt(U,{cwd:C.currentDir,env:k}),J==null||J();const ce=async()=>{if(y&&setTimeout(()=>{ye.remote.shell.showItemInFolder(V)},1e3),F&&await ye.remote.shell.openPath(V),c.type==="pandoc"&&c.runCommand===!0&&c.command){const Xe=Ut(c.command,C);await zt(Xe,{cwd:C.currentDir,env:k})}s&&s()};if(H){const Xe=new Vl(app,b.exportCommandOutputMessage(U));Xe.onClose=ce,Xe.open()}else new Ie.Notice(b.exportSuccessNotice(C.outputFileFullName),1500),await ce()}catch(ce){J==null||J(),new Vl(app,b.exportErrorOutputMessage(U,ce)).open(),a&&a()}}const Ot=e=>{const l=new Ie.Modal(e.app);let t=[],n=!1;return Ye(()=>{ne(l.titleEl,()=>e.title)}),Ye(()=>{ne(l.contentEl,()=>e.children)}),Ye(()=>{const c=Object.entries(e.classList??{}).filter(([,i])=>i).map(([i])=>i);t.length>0&&l.containerEl.removeClasses(t),c.length>0&&l.containerEl.addClasses(c),t=c}),Ye(()=>{l.containerEl.style.display=e.hidden?"None":""}),l.onClose=()=>{n||(n=!0,e.onClose())},ln(()=>l.open()),ze(()=>{n||l.close()}),document.createTextNode("")};var Fo=be("