uri-scheme 1.4.2 → 1.4.3

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.
Files changed (2) hide show
  1. package/build/index.js +1 -1
  2. package/package.json +4 -4
package/build/index.js CHANGED
@@ -27,4 +27,4 @@
27
27
  */function isSpecificValue(r){return r instanceof Buffer||r instanceof Date||r instanceof RegExp?true:false}function cloneSpecificValue(r){if(r instanceof Buffer){var i=Buffer.alloc?Buffer.alloc(r.length):new Buffer(r.length);r.copy(i);return i}else if(r instanceof Date){return new Date(r.getTime())}else if(r instanceof RegExp){return new RegExp(r)}else{throw new Error("Unexpected situation")}}function deepCloneArray(r){var o=[];r.forEach((function(r,a){if(typeof r==="object"&&r!==null){if(Array.isArray(r)){o[a]=deepCloneArray(r)}else if(isSpecificValue(r)){o[a]=cloneSpecificValue(r)}else{o[a]=i({},r)}}else{o[a]=r}}));return o}function safeGetProperty(r,i){return i==="__proto__"?undefined:r[i]}var i=r.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object"){return false}if(arguments.length<2){return arguments[0]}var r=arguments[0];var o=Array.prototype.slice.call(arguments,1);var a,l,c;o.forEach((function(o){if(typeof o!=="object"||o===null||Array.isArray(o)){return}Object.keys(o).forEach((function(c){l=safeGetProperty(r,c);a=safeGetProperty(o,c);if(a===r){return}else if(typeof a!=="object"||a===null){r[c]=a;return}else if(Array.isArray(a)){r[c]=deepCloneArray(a);return}else if(isSpecificValue(a)){r[c]=cloneSpecificValue(a);return}else if(typeof l!=="object"||l===null||Array.isArray(l)){r[c]=i({},a);return}else{r[c]=i(l,a);return}}))}));return r}},7945:(r,i,o)=>{const a=o(3837);const l=o(7310);let c=false;let u=true;function _value(r,i){const o=process.env[r];if(o===undefined){if(i===undefined&&!u){return o}if(i===undefined){throw new Error("GetEnv.Nonexistent: "+r+" does not exist "+"and no fallback value provided.")}if(c){throw new Error("GetEnv.DisabledFallbacks: "+r+" relying on fallback "+"when fallbacks have been disabled")}return""+i}return o}const h={string:function(r){return""+r},int:function(r){const i=r.match(/^-?\d+$/);if(!i){throw new Error("GetEnv.NoInteger: "+r+" is not an integer.")}return+r},float:function(r){const i=+r===Infinity||+r===-Infinity;if(i){throw new Error("GetEnv.Infinity: "+r+" is set to +/-Infinity.")}const o=!(isNaN(r)||r==="");if(!o){throw new Error("GetEnv.NoFloat: "+r+" is not a number.")}return+r},bool:function(r){const i=r==="true"||r==="false";if(!i){throw new Error("GetEnv.NoBoolean: "+r+" is not a boolean.")}return r==="true"},boolish:function(r){try{return h.bool(r)}catch(i){const o=r==="1"||r==="0";if(!o){throw new Error("GetEnv.NoBoolean: "+r+" is not a boolean.")}return r==="1"}},url:l.parse};function converter(r){return function(i,o){if(typeof i=="string"){const a=_value(i,o);return h[r](a)}else{return d.multi(i)}}}const d=converter("string");Object.keys(h).forEach((function(r){d[r]=converter(r)}));d.array=function array(r,i,o){i=i||"string";if(Object.keys(h).indexOf(i)===-1){throw new Error("GetEnv.ArrayUndefinedType: Unknown array type "+i)}const a=_value(r,o);return a.split(/\s*,\s*/).map(h[i])};d.multi=function multi(r){const i={};for(let o in r){const l=r[o];if(a.isArray(l)){switch(l.length){case 1:case 2:i[o]=d(l[0],l[1]);break;case 3:i[o]=d[l[2]](l[0],l[1]);break;default:throw"getenv.multi(): invalid spec";break}}else{i[o]=d(l)}}return i};d.disableFallbacks=function(){c=true};d.enableFallbacks=function(){c=false};d.disableErrors=function(){u=false};d.enableErrors=function(){u=true};r.exports=d},2297:(r,i,o)=>{var a=o(2058);r.exports=expandTop;var l="\0SLASH"+Math.random()+"\0";var c="\0OPEN"+Math.random()+"\0";var u="\0CLOSE"+Math.random()+"\0";var h="\0COMMA"+Math.random()+"\0";var d="\0PERIOD"+Math.random()+"\0";function numeric(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function escapeBraces(r){return r.split("\\\\").join(l).split("\\{").join(c).split("\\}").join(u).split("\\,").join(h).split("\\.").join(d)}function unescapeBraces(r){return r.split(l).join("\\").split(c).join("{").split(u).join("}").split(h).join(",").split(d).join(".")}function parseCommaParts(r){if(!r)return[""];var i=[];var o=a("{","}",r);if(!o)return r.split(",");var l=o.pre;var c=o.body;var u=o.post;var h=l.split(",");h[h.length-1]+="{"+c+"}";var d=parseCommaParts(u);if(u.length){h[h.length-1]+=d.shift();h.push.apply(h,d)}i.push.apply(i,h);return i}function expandTop(r){if(!r)return[];if(r.substr(0,2)==="{}"){r="\\{\\}"+r.substr(2)}return expand(escapeBraces(r),true).map(unescapeBraces)}function embrace(r){return"{"+r+"}"}function isPadded(r){return/^-?0\d/.test(r)}function lte(r,i){return r<=i}function gte(r,i){return r>=i}function expand(r,i){var o=[];var l=a("{","}",r);if(!l)return[r];var c=l.pre;var h=l.post.length?expand(l.post,false):[""];if(/\$$/.test(l.pre)){for(var d=0;d<h.length;d++){var p=c+"{"+l.body+"}"+h[d];o.push(p)}}else{var g=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body);var y=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body);var w=g||y;var b=l.body.indexOf(",")>=0;if(!w&&!b){if(l.post.match(/,.*\}/)){r=l.pre+"{"+l.body+u+l.post;return expand(r)}return[r]}var v;if(w){v=l.body.split(/\.\./)}else{v=parseCommaParts(l.body);if(v.length===1){v=expand(v[0],false).map(embrace);if(v.length===1){return h.map((function(r){return l.pre+v[0]+r}))}}}var E;if(w){var x=numeric(v[0]);var M=numeric(v[1]);var D=Math.max(v[0].length,v[1].length);var O=v.length==3?Math.abs(numeric(v[2])):1;var T=lte;var S=M<x;if(S){O*=-1;T=gte}var A=v.some(isPadded);E=[];for(var N=x;T(N,M);N+=O){var _;if(y){_=String.fromCharCode(N);if(_==="\\")_=""}else{_=String(N);if(A){var C=D-_.length;if(C>0){var L=new Array(C+1).join("0");if(N<0)_="-"+L+_.slice(1);else _=L+_}}}E.push(_)}}else{E=[];for(var P=0;P<v.length;P++){E.push.apply(E,expand(v[P],false))}}for(var P=0;P<E.length;P++){for(var d=0;d<h.length;d++){var p=c+E[P]+h[d];if(!i||w||p)o.push(p)}}}return o}},6738:r=>{"use strict";r.exports=(r,i=process.argv)=>{const o=r.startsWith("-")?"":r.length===1?"-":"--";const a=i.indexOf(o+r);const l=i.indexOf("--");return a!==-1&&(l===-1||a<l)}},1923:(r,i)=>{i.parse=i.decode=decode;i.stringify=i.encode=encode;i.safe=safe;i.unsafe=unsafe;var o=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(r,i){var a=[];var l="";if(typeof i==="string"){i={section:i,whitespace:false}}else{i=i||{};i.whitespace=i.whitespace===true}var c=i.whitespace?" = ":"=";Object.keys(r).forEach((function(i,u,h){var d=r[i];if(d&&Array.isArray(d)){d.forEach((function(r){l+=safe(i+"[]")+c+safe(r)+"\n"}))}else if(d&&typeof d==="object")a.push(i);else l+=safe(i)+c+safe(d)+o}));if(i.section&&l.length)l="["+safe(i.section)+"]"+o+l;a.forEach((function(a,c,u){var h=dotSplit(a).join("\\.");var d=(i.section?i.section+".":"")+h;var p=encode(r[a],{section:d,whitespace:i.whitespace});if(l.length&&p.length)l+=o;l+=p}));return l}function dotSplit(r){return r.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(r){return r.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(r){var i={};var o=i;var a=null;var l=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var c=r.split(/[\r\n]+/g);c.forEach((function(r,c,u){if(!r||r.match(/^\s*[;#]/))return;var h=r.match(l);if(!h)return;if(h[1]!==undefined){a=unsafe(h[1]);if(a==="__proto__"){o={};return}o=i[a]=i[a]||{};return}var d=unsafe(h[2]);if(d==="__proto__")return;var p=h[3]?unsafe(h[4]):true;switch(p){case"true":case"false":case"null":p=JSON.parse(p)}if(d.length>2&&d.slice(-2)==="[]"){d=d.substring(0,d.length-2);if(d==="__proto__")return;if(!o[d])o[d]=[];else if(!Array.isArray(o[d]))o[d]=[o[d]]}if(Array.isArray(o[d]))o[d].push(p);else o[d]=p}));Object.keys(i).filter((function(r,o,a){if(!i[r]||typeof i[r]!=="object"||Array.isArray(i[r]))return false;var l=dotSplit(r);var c=i;var u=l.pop();var h=u.replace(/\\\./g,".");l.forEach((function(r,i,o){if(r==="__proto__")return;if(!c[r]||typeof c[r]!=="object")c[r]={};c=c[r]}));if(c===i&&h===u)return false;c[h]=i[r];return true})).forEach((function(r,o,a){delete i[r]}));return i}function isQuoted(r){return r.charAt(0)==='"'&&r.slice(-1)==='"'||r.charAt(0)==="'"&&r.slice(-1)==="'"}function safe(r){return typeof r!=="string"||r.match(/[=\r\n]/)||r.match(/^\[/)||r.length>1&&isQuoted(r)||r!==r.trim()?JSON.stringify(r):r.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(r,i){r=(r||"").trim();if(isQuoted(r)){if(r.charAt(0)==="'")r=r.substr(1,r.length-2);try{r=JSON.parse(r)}catch(r){}}else{var o=false;var a="";for(var l=0,c=r.length;l<c;l++){var u=r.charAt(l);if(o){if("\\;#".indexOf(u)!==-1)a+=u;else a+="\\"+u;o=false}else if(";#".indexOf(u)!==-1)break;else if(u==="\\")o=true;else a+=u}if(o)a+="\\";return a.trim()}return r}},9439:r=>{"use strict";const{FORCE_COLOR:i,NODE_DISABLE_COLORS:o,TERM:a}=process.env;const l={enabled:!o&&a!=="dumb"&&i!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(r,i){let o=0,a,l="",c="";for(;o<r.length;o++){a=r[o];l+=a.open;c+=a.close;if(i.includes(a.close)){i=i.replace(a.rgx,a.close+a.open)}}return l+i+c}function chain(r,i){let o={has:r,keys:i};o.reset=l.reset.bind(o);o.bold=l.bold.bind(o);o.dim=l.dim.bind(o);o.italic=l.italic.bind(o);o.underline=l.underline.bind(o);o.inverse=l.inverse.bind(o);o.hidden=l.hidden.bind(o);o.strikethrough=l.strikethrough.bind(o);o.black=l.black.bind(o);o.red=l.red.bind(o);o.green=l.green.bind(o);o.yellow=l.yellow.bind(o);o.blue=l.blue.bind(o);o.magenta=l.magenta.bind(o);o.cyan=l.cyan.bind(o);o.white=l.white.bind(o);o.gray=l.gray.bind(o);o.grey=l.grey.bind(o);o.bgBlack=l.bgBlack.bind(o);o.bgRed=l.bgRed.bind(o);o.bgGreen=l.bgGreen.bind(o);o.bgYellow=l.bgYellow.bind(o);o.bgBlue=l.bgBlue.bind(o);o.bgMagenta=l.bgMagenta.bind(o);o.bgCyan=l.bgCyan.bind(o);o.bgWhite=l.bgWhite.bind(o);return o}function init(r,i){let o={open:`[${r}m`,close:`[${i}m`,rgx:new RegExp(`\\x1b\\[${i}m`,"g")};return function(i){if(this!==void 0&&this.has!==void 0){this.has.includes(r)||(this.has.push(r),this.keys.push(o));return i===void 0?this:l.enabled?run(this.keys,i+""):i+""}return i===void 0?chain([r],[o]):l.enabled?run([o],i+""):i+""}}r.exports=l},5912:r=>{"use strict";function hasKey(r,i){var o=r;i.slice(0,-1).forEach((function(r){o=o[r]||{}}));var a=i[i.length-1];return a in o}function isNumber(r){if(typeof r==="number"){return true}if(/^0x[0-9a-f]+$/i.test(r)){return true}return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function isConstructorOrProto(r,i){return i==="constructor"&&typeof r[i]==="function"||i==="__proto__"}r.exports=function(r,i){if(!i){i={}}var o={bools:{},strings:{},unknownFn:null};if(typeof i.unknown==="function"){o.unknownFn=i.unknown}if(typeof i.boolean==="boolean"&&i.boolean){o.allBools=true}else{[].concat(i.boolean).filter(Boolean).forEach((function(r){o.bools[r]=true}))}var a={};function aliasIsBoolean(r){return a[r].some((function(r){return o.bools[r]}))}Object.keys(i.alias||{}).forEach((function(r){a[r]=[].concat(i.alias[r]);a[r].forEach((function(i){a[i]=[r].concat(a[r].filter((function(r){return i!==r})))}))}));[].concat(i.string).filter(Boolean).forEach((function(r){o.strings[r]=true;if(a[r]){[].concat(a[r]).forEach((function(r){o.strings[r]=true}))}}));var l=i.default||{};var c={_:[]};function argDefined(r,i){return o.allBools&&/^--[^=]+$/.test(i)||o.strings[r]||o.bools[r]||a[r]}function setKey(r,i,a){var l=r;for(var c=0;c<i.length-1;c++){var u=i[c];if(isConstructorOrProto(l,u)){return}if(l[u]===undefined){l[u]={}}if(l[u]===Object.prototype||l[u]===Number.prototype||l[u]===String.prototype){l[u]={}}if(l[u]===Array.prototype){l[u]=[]}l=l[u]}var h=i[i.length-1];if(isConstructorOrProto(l,h)){return}if(l===Object.prototype||l===Number.prototype||l===String.prototype){l={}}if(l===Array.prototype){l=[]}if(l[h]===undefined||o.bools[h]||typeof l[h]==="boolean"){l[h]=a}else if(Array.isArray(l[h])){l[h].push(a)}else{l[h]=[l[h],a]}}function setArg(r,i,l){if(l&&o.unknownFn&&!argDefined(r,l)){if(o.unknownFn(l)===false){return}}var u=!o.strings[r]&&isNumber(i)?Number(i):i;setKey(c,r.split("."),u);(a[r]||[]).forEach((function(r){setKey(c,r.split("."),u)}))}Object.keys(o.bools).forEach((function(r){setArg(r,l[r]===undefined?false:l[r])}));var u=[];if(r.indexOf("--")!==-1){u=r.slice(r.indexOf("--")+1);r=r.slice(0,r.indexOf("--"))}for(var h=0;h<r.length;h++){var d=r[h];var p;var g;if(/^--.+=/.test(d)){var y=d.match(/^--([^=]+)=([\s\S]*)$/);p=y[1];var w=y[2];if(o.bools[p]){w=w!=="false"}setArg(p,w,d)}else if(/^--no-.+/.test(d)){p=d.match(/^--no-(.+)/)[1];setArg(p,false,d)}else if(/^--.+/.test(d)){p=d.match(/^--(.+)/)[1];g=r[h+1];if(g!==undefined&&!/^(-|--)[^-]/.test(g)&&!o.bools[p]&&!o.allBools&&(a[p]?!aliasIsBoolean(p):true)){setArg(p,g,d);h+=1}else if(/^(true|false)$/.test(g)){setArg(p,g==="true",d);h+=1}else{setArg(p,o.strings[p]?"":true,d)}}else if(/^-[^-]+/.test(d)){var b=d.slice(1,-1).split("");var v=false;for(var E=0;E<b.length;E++){g=d.slice(E+2);if(g==="-"){setArg(b[E],g,d);continue}if(/[A-Za-z]/.test(b[E])&&g[0]==="="){setArg(b[E],g.slice(1),d);v=true;break}if(/[A-Za-z]/.test(b[E])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(g)){setArg(b[E],g,d);v=true;break}if(b[E+1]&&b[E+1].match(/\W/)){setArg(b[E],d.slice(E+2),d);v=true;break}else{setArg(b[E],o.strings[b[E]]?"":true,d)}}p=d.slice(-1)[0];if(!v&&p!=="-"){if(r[h+1]&&!/^(-|--)[^-]/.test(r[h+1])&&!o.bools[p]&&(a[p]?!aliasIsBoolean(p):true)){setArg(p,r[h+1],d);h+=1}else if(r[h+1]&&/^(true|false)$/.test(r[h+1])){setArg(p,r[h+1]==="true",d);h+=1}else{setArg(p,o.strings[p]?"":true,d)}}}else{if(!o.unknownFn||o.unknownFn(d)!==false){c._.push(o.strings._||!isNumber(d)?d:Number(d))}if(i.stopEarly){c._.push.apply(c._,r.slice(h+1));break}}}Object.keys(l).forEach((function(r){if(!hasKey(c,r.split("."))){setKey(c,r.split("."),l[r]);(a[r]||[]).forEach((function(i){setKey(c,i.split("."),l[r])}))}}));if(i["--"]){c["--"]=u.slice()}else{u.forEach((function(r){c._.push(r)}))}return c}},2170:r=>{"use strict";const pathKey=(r={})=>{const i=r.env||process.env;const o=r.platform||process.platform;if(o!=="win32"){return"PATH"}return Object.keys(i).reverse().find((r=>r.toUpperCase()==="PATH"))||"Path"};r.exports=pathKey;r.exports["default"]=pathKey},399:r=>{"use strict";class DatePart{constructor({token:r,date:i,parts:o,locales:a}){this.token=r;this.date=i||new Date;this.parts=o||[this];this.locales=a||{}}up(){}down(){}next(){const r=this.parts.indexOf(this);return this.parts.find(((i,o)=>o>r&&i instanceof DatePart))}setTo(r){}prev(){let r=[].concat(this.parts).reverse();const i=r.indexOf(this);return r.find(((r,o)=>o>i&&r instanceof DatePart))}toString(){return String(this.date)}}r.exports=DatePart},7967:(r,i,o)=>{"use strict";const a=o(399);const pos=r=>{r=r%10;return r===1?"st":r===2?"nd":r===3?"rd":"th"};class Day extends a{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate();let i=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+pos(r):this.token==="d"?i+1:this.token==="ddd"?this.locales.weekdaysShort[i]:this.token==="dddd"?this.locales.weekdays[i]:r}}r.exports=Day},4102:(r,i,o)=>{"use strict";const a=o(399);class Hours extends a{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();if(/h/.test(this.token))r=r%12||12;return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Hours},7517:(r,i,o)=>{"use strict";r.exports={DatePart:o(399),Meridiem:o(5184),Day:o(7967),Hours:o(4102),Milliseconds:o(6945),Minutes:o(7829),Month:o(8608),Seconds:o(812),Year:o(5227)}},5184:(r,i,o)=>{"use strict";const a=o(399);class Meridiem extends a{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}r.exports=Meridiem},6945:(r,i,o)=>{"use strict";const a=o(399);class Milliseconds extends a{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}r.exports=Milliseconds},7829:(r,i,o)=>{"use strict";const a=o(399);class Minutes extends a{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Minutes},8608:(r,i,o)=>{"use strict";const a=o(399);class Month extends a{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1;this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth();let i=this.token.length;return i===2?String(r+1).padStart(2,"0"):i===3?this.locales.monthsShort[r]:i===4?this.locales.months[r]:String(r+1)}}r.exports=Month},812:(r,i,o)=>{"use strict";const a=o(399);class Seconds extends a{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Seconds},5227:(r,i,o)=>{"use strict";const a=o(399);class Year extends a{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}r.exports=Year},935:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,c,u){try{var h=r[c](u);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var c=r.apply(i,o);function _next(r){asyncGeneratorStep(c,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(c,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const c=o(332),u=c.erase,h=c.cursor;const d=o(7483),p=d.style,g=d.clear,y=d.figures,w=d.wrap,b=d.entriesToDisplay;const getVal=(r,i)=>r[i]&&(r[i].value||r[i].title||r[i]);const getTitle=(r,i)=>r[i]&&(r[i].title||r[i].value||r[i]);const getIndex=(r,i)=>{const o=r.findIndex((r=>r.value===i||r.title===i));return o>-1?o:undefined};class AutocompletePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.suggest=r.suggest;this.choices=r.choices;this.initial=typeof r.initial==="number"?r.initial:getIndex(r.choices,r.initial);this.select=this.initial||r.cursor||0;this.i18n={noMatches:r.noMatches||"no matches found"};this.fallback=r.fallback||this.initial;this.clearFirst=r.clearFirst||false;this.suggestions=[];this.input="";this.limit=r.limit||10;this.cursor=0;this.transform=p.render(r.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=g("",this.out.columns);this.complete(this.render);this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;if(typeof this._fb==="number")r=this.choices[this._fb];else if(typeof this._fb==="string")r={title:this._fb};return r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r;if(this.suggestions.length>0)this.value=getVal(this.suggestions,r);else this.value=this.fallback.value;this.fire()}complete(r){var i=this;return _asyncToGenerator((function*(){const o=i.completing=i.suggest(i.input,i.choices);const a=yield o;if(i.completing!==o)return;i.suggestions=a.map(((r,i,o)=>({title:getTitle(o,i),value:getVal(o,i),description:r.description})));i.completing=false;const l=Math.max(a.length-1,0);i.moveSelect(Math.min(l,i.select));r&&r()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){let o=this.input.slice(0,this.cursor);let a=this.input.slice(this.cursor);this.input=`${o}${r}${a}`;this.cursor=o.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1);let i=this.input.slice(this.cursor);this.input=`${r}${i}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor);let i=this.input.slice(this.cursor+1);this.input=`${r}${i}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(r,i,o,l){let c;let u=o?y.arrowUp:l?y.arrowDown:" ";let h=i?a.cyan().underline(r.title):r.title;u=(i?a.cyan(y.pointer)+" ":" ")+u;if(r.description){c=` - ${r.description}`;if(u.length+h.length+c.length>=this.out.columns||r.description.split(/\r?\n/).length>1){c="\n"+w(r.description,{margin:3,width:this.out.columns})}}return u+" "+h+a.gray(c||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(g(this.outputText,this.out.columns));super.render();let r=b(this.select,this.choices.length,this.limit),i=r.startIndex,o=r.endIndex;this.outputText=[p.symbol(this.done,this.aborted,this.exited),a.bold(this.msg),p.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const r=this.suggestions.slice(i,o).map(((r,a)=>this.renderOption(r,this.select===a+i,a===0&&i>0,a+i===o-1&&o<this.choices.length))).join("\n");this.outputText+=`\n`+(r||a.gray(this.fallback.title))}this.out.write(u.line+h.to(0)+this.outputText)}}r.exports=AutocompletePrompt},2040:(r,i,o)=>{"use strict";const a=o(9439);const l=o(332),c=l.cursor;const u=o(4047);const h=o(7483),d=h.clear,p=h.style,g=h.figures;class AutocompleteMultiselectPrompt extends u{constructor(r={}){r.overrideRender=true;super(r);this.inputValue="";this.clear=d("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((r=>{if(this.inputValue){if(typeof r.title==="string"){if(r.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof r.value==="string"){if(r.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const i=this.filteredOptions.findIndex((i=>i===r));this.cursor=i<0?0:i;this.render()}handleSpaceToggle(){const r=this.filteredOptions[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r;this.updateFilteredOptions()}_(r,i){if(r===" "){this.handleSpaceToggle()}else{this.handleInputChange(r)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${g.arrowUp}/${g.arrowDown}: Highlight option\n ${g.arrowLeft}/${g.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:a.gray("Enter something to filter")}\n`}renderOption(r,i,o){let l;if(i.disabled)l=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title);else l=r===o?a.cyan().underline(i.title):i.title;return(i.selected?a.green(g.radioOn):g.radioOff)+" "+l}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);super.render();let r=[p.symbol(this.done,this.aborted),a.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+r);this.clear=d(r,this.out.columns)}}r.exports=AutocompleteMultiselectPrompt},5680:(r,i,o)=>{"use strict";const a=o(9439);const l=o(5876);const c=o(7483),u=c.style,h=c.clear;const d=o(332),p=d.erase,g=d.cursor;class ConfirmPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=r.initial;this.initialValue=!!r.initial;this.yesMsg=r.yes||"yes";this.yesOption=r.yesOption||"(Y/n)";this.noMsg=r.no||"no";this.noOption=r.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){if(r.toLowerCase()==="y"){this.value=true;return this.submit()}if(r.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(g.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:a.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(p.line+g.to(0)+this.outputText)}}r.exports=ConfirmPrompt},3031:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,c,u){try{var h=r[c](u);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var c=r.apply(i,o);function _next(r){asyncGeneratorStep(c,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(c,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const c=o(7483),u=c.style,h=c.clear,d=c.figures;const p=o(332),g=p.erase,y=p.cursor;const w=o(7517),b=w.DatePart,v=w.Meridiem,E=w.Day,x=w.Hours,M=w.Milliseconds,D=w.Minutes,O=w.Month,T=w.Seconds,S=w.Year;const A=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const N={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new E(r),3:r=>new O(r),4:r=>new S(r),5:r=>new v(r),6:r=>new x(r),7:r=>new D(r),8:r=>new T(r),9:r=>new M(r)};const _={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.cursor=0;this.typed="";this.locales=Object.assign(_,r.locales);this._date=r.initial||new Date;this.errorMsg=r.error||"Please Enter A Valid Value";this.validator=r.validate||(()=>true);this.mask=r.mask||"YYYY-MM-DD HH:mm:ss";this.clear=h("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(r){if(r)this._date.setTime(r.getTime())}set mask(r){let i;this.parts=[];while(i=A.exec(r)){let r=i.shift();let o=i.findIndex((r=>r!=null));this.parts.push(o in N?N[o]({token:i[o]||r,date:this.date,parts:this.parts,locales:this.locales}):i[o]||r)}let o=this.parts.reduce(((r,i)=>{if(typeof i==="string"&&typeof r[r.length-1]==="string")r[r.length-1]+=i;else r.push(i);return r}),[]);this.parts.splice(0);this.parts.push(...o);this.reset()}moveCursor(r){this.typed="";this.cursor=r;this.fire()}reset(){this.moveCursor(this.parts.findIndex((r=>r instanceof b)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var r=this;return _asyncToGenerator((function*(){let i=yield r.validator(r.value);if(typeof i==="string"){r.errorMsg=i;i=false}r.error=!i}))()}submit(){var r=this;return _asyncToGenerator((function*(){yield r.validate();if(r.error){r.color="red";r.fire();r.render();return}r.done=true;r.aborted=false;r.fire();r.render();r.out.write("\n");r.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex((r=>r instanceof b)));this.render()}_(r){if(/\d/.test(r)){this.typed+=r;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(y.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(false),this.parts.reduce(((r,i,o)=>r.concat(o===this.cursor&&!this.done?a.cyan().underline(i.toString()):i)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((r,i,o)=>r+`\n${o?` `:d.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(g.line+y.to(0)+this.outputText)}}r.exports=DatePrompt},9956:(r,i,o)=>{"use strict";r.exports={TextPrompt:o(5430),SelectPrompt:o(8856),TogglePrompt:o(9692),DatePrompt:o(3031),NumberPrompt:o(8831),MultiselectPrompt:o(4047),AutocompletePrompt:o(935),AutocompleteMultiselectPrompt:o(2040),ConfirmPrompt:o(5680)}},4047:(r,i,o)=>{"use strict";const a=o(9439);const l=o(332),c=l.cursor;const u=o(5876);const h=o(7483),d=h.clear,p=h.figures,g=h.style,y=h.wrap,w=h.entriesToDisplay;class MultiselectPrompt extends u{constructor(r={}){super(r);this.msg=r.message;this.cursor=r.cursor||0;this.scrollIndex=r.cursor||0;this.hint=r.hint||"";this.warn=r.warn||"- This option is disabled -";this.minSelected=r.min;this.showMinError=false;this.maxChoices=r.max;this.instructions=r.instructions;this.optionsPerPage=r.optionsPerPage||10;this.value=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===undefined?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled}}));this.clear=d("",this.out.columns);if(!r.overrideRender){this.render()}}reset(){this.value.map((r=>!r.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((r=>r.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const r=this.value.filter((r=>r.selected));if(this.minSelected&&r.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const r=this.value[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const r=!this.value[this.cursor].selected;this.value.filter((r=>!r.disabled)).forEach((i=>i.selected=r));this.render()}_(r,i){if(r===" "){this.handleSpaceToggle()}else if(r==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${p.arrowUp}/${p.arrowDown}: Highlight option\n`+` ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(r,i,o,l){const c=(i.selected?a.green(p.radioOn):p.radioOff)+" "+l+" ";let u,h;if(i.disabled){u=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title)}else{u=r===o?a.cyan().underline(i.title):i.title;if(r===o&&i.description){h=` - ${i.description}`;if(c.length+u.length+h.length>=this.out.columns||i.description.split(/\r?\n/).length>1){h="\n"+y(i.description,{margin:c.length,width:this.out.columns})}}}return c+u+a.gray(h||"")}paginateOptions(r){if(r.length===0){return a.red("No matches for this query.")}let i=w(this.cursor,r.length,this.optionsPerPage),o=i.startIndex,l=i.endIndex;let c,u=[];for(let i=o;i<l;i++){if(i===o&&o>0){c=p.arrowUp}else if(i===l-1&&l<r.length){c=p.arrowDown}else{c=" "}u.push(this.renderOption(this.cursor,r[i],i,c))}return"\n"+u.join("\n")}renderOptions(r){if(!this.done){return this.paginateOptions(r)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);super.render();let r=[g.symbol(this.done,this.aborted),a.bold(this.msg),g.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.value);this.out.write(this.clear+r);this.clear=d(r,this.out.columns)}}r.exports=MultiselectPrompt},8831:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,c,u){try{var h=r[c](u);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var c=r.apply(i,o);function _next(r){asyncGeneratorStep(c,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(c,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const c=o(332),u=c.cursor,h=c.erase;const d=o(7483),p=d.style,g=d.figures,y=d.clear,w=d.lines;const b=/[0-9]/;const isDef=r=>r!==undefined;const round=(r,i)=>{let o=Math.pow(10,i);return Math.round(r*o)/o};class NumberPrompt extends l{constructor(r={}){super(r);this.transform=p.render(r.style);this.msg=r.message;this.initial=isDef(r.initial)?r.initial:"";this.float=!!r.float;this.round=r.round||2;this.inc=r.increment||1;this.min=isDef(r.min)?r.min:-Infinity;this.max=isDef(r.max)?r.max:Infinity;this.errorMsg=r.error||`Please Enter A Valid Value`;this.validator=r.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(r){if(!r&&r!==0){this.placeholder=true;this.rendered=a.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(r,this.round)}`);this._value=round(r,this.round)}this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r===`-`||r===`.`&&this.float||b.test(r)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==``?r:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var r=this;return _asyncToGenerator((function*(){let i=yield r.validator(r.value);if(typeof i===`string`){r.errorMsg=i;i=false}r.error=!i}))()}submit(){var r=this;return _asyncToGenerator((function*(){yield r.validate();if(r.error){r.color=`red`;r.fire();r.render();return}let i=r.value;r.value=i!==``?i:r.initial;r.done=true;r.aborted=false;r.error=false;r.fire();r.render();r.out.write(`\n`);r.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(r,i){if(!this.valid(r))return this.bell();const o=Date.now();if(o-this.lastHit>1e3)this.typed=``;this.typed+=r;this.lastHit=o;this.color=`cyan`;if(r===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(w(this.outputError,this.out.columns)-1)+y(this.outputError,this.out.columns));this.out.write(y(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[p.symbol(this.done,this.aborted),a.bold(this.msg),p.delimiter(this.done),!this.done||!this.done&&!this.placeholder?a[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?` `:g.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(h.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore)}}r.exports=NumberPrompt},5876:(r,i,o)=>{"use strict";const a=o(4521);const l=o(7483),c=l.action;const u=o(2361);const h=o(332),d=h.beep,p=h.cursor;const g=o(9439);class Prompt extends u{constructor(r={}){super();this.firstRender=true;this.in=r.stdin||process.stdin;this.out=r.stdout||process.stdout;this.onRender=(r.onRender||(()=>void 0)).bind(this);const i=a.createInterface({input:this.in,escapeCodeTimeout:50});a.emitKeypressEvents(this.in,i);if(this.in.isTTY)this.in.setRawMode(true);const o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(r,i)=>{let a=c(i,o);if(a===false){this._&&this._(r,i)}else if(typeof this[a]==="function"){this[a](i)}else{this.bell()}};this.close=()=>{this.out.write(p.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);i.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(d)}render(){this.onRender(g);if(this.firstRender)this.firstRender=false}}r.exports=Prompt},8856:(r,i,o)=>{"use strict";const a=o(9439);const l=o(5876);const c=o(7483),u=c.style,h=c.clear,d=c.figures,p=c.wrap,g=c.entriesToDisplay;const y=o(332),w=y.cursor;class SelectPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.hint=r.hint||"- Use arrow-keys. Return to submit.";this.warn=r.warn||"- This option is disabled";this.cursor=r.initial||0;this.choices=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),value:r&&(r.value===undefined?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled}}));this.optionsPerPage=r.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=h("",this.out.columns);this.render()}moveCursor(r){this.cursor=r;this.value=this.choices[r].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(r,i){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(w.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();let r=g(this.cursor,this.choices.length,this.optionsPerPage),i=r.startIndex,o=r.endIndex;this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(false),this.done?this.selection.title:this.selection.disabled?a.yellow(this.warn):a.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let r=i;r<o;r++){let l,c,u="",h=this.choices[r];if(r===i&&i>0){c=d.arrowUp}else if(r===o-1&&o<this.choices.length){c=d.arrowDown}else{c=" "}if(h.disabled){l=this.cursor===r?a.gray().underline(h.title):a.strikethrough().gray(h.title);c=(this.cursor===r?a.bold().gray(d.pointer)+" ":" ")+c}else{l=this.cursor===r?a.cyan().underline(h.title):h.title;c=(this.cursor===r?a.cyan(d.pointer)+" ":" ")+c;if(h.description&&this.cursor===r){u=` - ${h.description}`;if(c.length+l.length+u.length>=this.out.columns||h.description.split(/\r?\n/).length>1){u="\n"+p(h.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${c} ${l}${a.gray(u)}\n`}}this.out.write(this.outputText)}}r.exports=SelectPrompt},5430:(r,i,o)=>{"use strict";function asyncGeneratorStep(r,i,o,a,l,c,u){try{var h=r[c](u);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var c=r.apply(i,o);function _next(r){asyncGeneratorStep(c,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(c,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(9439);const l=o(5876);const c=o(332),u=c.erase,h=c.cursor;const d=o(7483),p=d.style,g=d.clear,y=d.lines,w=d.figures;class TextPrompt extends l{constructor(r={}){super(r);this.transform=p.render(r.style);this.scale=this.transform.scale;this.msg=r.message;this.initial=r.initial||``;this.validator=r.validate||(()=>true);this.value=``;this.errorMsg=r.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=g(``,this.out.columns);this.render()}set value(r){if(!r&&this.initial){this.placeholder=true;this.rendered=a.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(r)}this._value=r;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var r=this;return _asyncToGenerator((function*(){let i=yield r.validator(r.value);if(typeof i===`string`){r.errorMsg=i;i=false}r.error=!i}))()}submit(){var r=this;return _asyncToGenerator((function*(){r.value=r.value||r.initial;r.cursorOffset=0;r.cursor=r.rendered.length;yield r.validate();if(r.error){r.red=true;r.fire();r.render();return}r.done=true;r.aborted=false;r.fire();r.render();r.out.write("\n");r.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(r){if(this.placeholder)return;this.cursor=this.cursor+r;this.cursorOffset+=r}_(r,i){let o=this.value.slice(0,this.cursor);let a=this.value.slice(this.cursor);this.value=`${o}${r}${a}`;this.red=false;this.cursor=this.placeholder?0:o.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1);let i=this.value.slice(this.cursor);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor);let i=this.value.slice(this.cursor+1);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(h.down(y(this.outputError,this.out.columns)-1)+g(this.outputError,this.out.columns));this.out.write(g(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[p.symbol(this.done,this.aborted),a.bold(this.msg),p.delimiter(this.done),this.red?a.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?" ":w.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(u.line+h.to(0)+this.outputText+h.save+this.outputError+h.restore+h.move(this.cursorOffset,0))}}r.exports=TextPrompt},9692:(r,i,o)=>{"use strict";const a=o(9439);const l=o(5876);const c=o(7483),u=c.style,h=c.clear;const d=o(332),p=d.cursor,g=d.erase;class TogglePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=!!r.initial;this.active=r.active||"on";this.inactive=r.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(r,i){if(r===" "){this.value=!this.value}else if(r==="1"){this.value=true}else if(r==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(this.done),this.value?this.inactive:a.cyan().underline(this.inactive),a.gray("/"),this.value?a.cyan().underline(this.active):this.active].join(" ");this.out.write(g.line+p.to(0)+this.outputText)}}r.exports=TogglePrompt},6598:(r,i,o)=>{"use strict";function ownKeys(r,i){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);if(i){a=a.filter((function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))}o.push.apply(o,a)}return o}function _objectSpread(r){for(var i=1;i<arguments.length;i++){var o=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(o),true).forEach((function(i){_defineProperty(r,i,o[i])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(o))}else{ownKeys(Object(o)).forEach((function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(o,i))}))}}return r}function _defineProperty(r,i,o){if(i in r){Object.defineProperty(r,i,{value:o,enumerable:true,configurable:true,writable:true})}else{r[i]=o}return r}function _createForOfIteratorHelper(r,i){var o=typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!o){if(Array.isArray(r)||(o=_unsupportedIterableToArray(r))||i&&r&&typeof r.length==="number"){if(o)r=o;var a=0;var l=function F(){};return{s:l,n:function n(){if(a>=r.length)return{done:true};return{done:false,value:r[a++]}},e:function e(r){throw r},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=true,u=false,h;return{s:function s(){o=o.call(r)},n:function n(){var r=o.next();c=r.done;return r},e:function e(r){u=true;h=r},f:function f(){try{if(!c&&o.return!=null)o.return()}finally{if(u)throw h}}}}function _unsupportedIterableToArray(r,i){if(!r)return;if(typeof r==="string")return _arrayLikeToArray(r,i);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor)o=r.constructor.name;if(o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(r,i)}function _arrayLikeToArray(r,i){if(i==null||i>r.length)i=r.length;for(var o=0,a=new Array(i);o<i;o++)a[o]=r[o];return a}function asyncGeneratorStep(r,i,o,a,l,c,u){try{var h=r[c](u);var d=h.value}catch(r){o(r);return}if(h.done){i(d)}else{Promise.resolve(d).then(a,l)}}function _asyncToGenerator(r){return function(){var i=this,o=arguments;return new Promise((function(a,l){var c=r.apply(i,o);function _next(r){asyncGeneratorStep(c,a,l,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(c,a,l,_next,_throw,"throw",r)}_next(undefined)}))}}const a=o(4591);const l=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(r=[],{onSubmit:i=noop,onCancel:o=noop}={}){const c={};const u=prompt._override||{};r=[].concat(r);let h,d,p,g,y,w;const b=function(){var r=_asyncToGenerator((function*(r,i,o=false){if(!o&&r.validate&&r.validate(i)!==true){return}return r.format?yield r.format(i,c):i}));return function getFormattedAnswer(i,o){return r.apply(this,arguments)}}();var v=_createForOfIteratorHelper(r),E;try{for(v.s();!(E=v.n()).done;){d=E.value;var x=d;g=x.name;y=x.type;if(typeof y==="function"){y=yield y(h,_objectSpread({},c),d);d["type"]=y}if(!y)continue;for(let r in d){if(l.includes(r))continue;let i=d[r];d[r]=typeof i==="function"?yield i(h,_objectSpread({},c),w):i}w=d;if(typeof d.message!=="string"){throw new Error("prompt message is required")}var M=d;g=M.name;y=M.type;if(a[y]===void 0){throw new Error(`prompt type (${y}) is not defined`)}if(u[d.name]!==undefined){h=yield b(d,u[d.name]);if(h!==undefined){c[g]=h;continue}}try{h=prompt._injected?getInjectedAnswer(prompt._injected,d.initial):yield a[y](d);c[g]=h=yield b(d,h,true);p=yield i(d,h,c)}catch(r){p=!(yield o(d,c))}if(p)return c}}catch(r){v.e(r)}finally{v.f()}return c}));return _prompt.apply(this,arguments)}function getInjectedAnswer(r,i){const o=r.shift();if(o instanceof Error){throw o}return o===undefined?i:o}function inject(r){prompt._injected=(prompt._injected||[]).concat(r)}function override(r){prompt._override=Object.assign({},r)}r.exports=Object.assign(prompt,{prompt:prompt,prompts:a,inject:inject,override:override})},4591:(r,i,o)=>{"use strict";const a=i;const l=o(9956);const noop=r=>r;function toPrompt(r,i,o={}){return new Promise(((a,c)=>{const u=new l[r](i);const h=o.onAbort||noop;const d=o.onSubmit||noop;const p=o.onExit||noop;u.on("state",i.onState||noop);u.on("submit",(r=>a(d(r))));u.on("exit",(r=>a(p(r))));u.on("abort",(r=>c(h(r))))}))}a.text=r=>toPrompt("TextPrompt",r);a.password=r=>{r.style="password";return a.text(r)};a.invisible=r=>{r.style="invisible";return a.text(r)};a.number=r=>toPrompt("NumberPrompt",r);a.date=r=>toPrompt("DatePrompt",r);a.confirm=r=>toPrompt("ConfirmPrompt",r);a.list=r=>{const i=r.separator||",";return toPrompt("TextPrompt",r,{onSubmit:r=>r.split(i).map((r=>r.trim()))})};a.toggle=r=>toPrompt("TogglePrompt",r);a.select=r=>toPrompt("SelectPrompt",r);a.multiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("MultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};a.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("AutocompleteMultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(r,i)=>Promise.resolve(i.filter((i=>i.title.slice(0,r.length).toLowerCase()===r.toLowerCase())));a.autocomplete=r=>{r.suggest=r.suggest||byTitle;r.choices=[].concat(r.choices||[]);return toPrompt("AutocompletePrompt",r)}},8692:r=>{"use strict";r.exports=(r,i)=>{if(r.meta&&r.name!=="escape")return;if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c")return"abort";if(r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(i){if(r.name==="j")return"down";if(r.name==="k")return"up"}if(r.name==="return")return"submit";if(r.name==="enter")return"submit";if(r.name==="backspace")return"delete";if(r.name==="delete")return"deleteForward";if(r.name==="abort")return"abort";if(r.name==="escape")return"exit";if(r.name==="tab")return"next";if(r.name==="pagedown")return"nextPage";if(r.name==="pageup")return"prevPage";if(r.name==="home")return"home";if(r.name==="end")return"end";if(r.name==="up")return"up";if(r.name==="down")return"down";if(r.name==="right")return"right";if(r.name==="left")return"left";return false}},3513:(r,i,o)=>{"use strict";function _createForOfIteratorHelper(r,i){var o=typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!o){if(Array.isArray(r)||(o=_unsupportedIterableToArray(r))||i&&r&&typeof r.length==="number"){if(o)r=o;var a=0;var l=function F(){};return{s:l,n:function n(){if(a>=r.length)return{done:true};return{done:false,value:r[a++]}},e:function e(r){throw r},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=true,u=false,h;return{s:function s(){o=o.call(r)},n:function n(){var r=o.next();c=r.done;return r},e:function e(r){u=true;h=r},f:function f(){try{if(!c&&o.return!=null)o.return()}finally{if(u)throw h}}}}function _unsupportedIterableToArray(r,i){if(!r)return;if(typeof r==="string")return _arrayLikeToArray(r,i);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor)o=r.constructor.name;if(o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(r,i)}function _arrayLikeToArray(r,i){if(i==null||i>r.length)i=r.length;for(var o=0,a=new Array(i);o<i;o++)a[o]=r[o];return a}const a=o(8760);const l=o(332),c=l.erase,u=l.cursor;const width=r=>[...a(r)].length;r.exports=function(r,i){if(!i)return c.line+u.to(0);let o=0;const a=r.split(/\r?\n/);var l=_createForOfIteratorHelper(a),h;try{for(l.s();!(h=l.n()).done;){let r=h.value;o+=1+Math.floor(Math.max(width(r)-1,0)/i)}}catch(r){l.e(r)}finally{l.f()}return c.lines(o)}},393:r=>{"use strict";r.exports=(r,i,o)=>{o=o||i;let a=Math.min(i-o,r-Math.floor(o/2));if(a<0)a=0;let l=Math.min(a+o,i);return{startIndex:a,endIndex:l}}},6217:r=>{"use strict";const i={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const o={arrowUp:i.arrowUp,arrowDown:i.arrowDown,arrowLeft:i.arrowLeft,arrowRight:i.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const a=process.platform==="win32"?o:i;r.exports=a},7483:(r,i,o)=>{"use strict";r.exports={action:o(8692),clear:o(3513),style:o(5012),strip:o(8760),figures:o(6217),lines:o(1688),wrap:o(1705),entriesToDisplay:o(393)}},1688:(r,i,o)=>{"use strict";const a=o(8760);r.exports=function(r,i){let o=String(a(r)||"").split(/\r?\n/);if(!i)return o.length;return o.map((r=>Math.ceil(r.length/i))).reduce(((r,i)=>r+i))}},8760:r=>{"use strict";r.exports=r=>{const i=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const o=new RegExp(i,"g");return typeof r==="string"?r.replace(o,""):r}},5012:(r,i,o)=>{"use strict";const a=o(9439);const l=o(6217);const c=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"😃".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}});const render=r=>c[r]||c.default;const u=Object.freeze({aborted:a.red(l.cross),done:a.green(l.tick),exited:a.yellow(l.cross),default:a.cyan("?")});const symbol=(r,i,o)=>i?u.aborted:o?u.exited:r?u.done:u.default;const delimiter=r=>a.gray(r?l.ellipsis:l.pointerSmall);const item=(r,i)=>a.gray(r?i?l.pointerSmall:"+":l.line);r.exports={styles:c,render:render,symbols:u,symbol:symbol,delimiter:delimiter,item:item}},1705:r=>{"use strict";r.exports=(r,i={})=>{const o=Number.isSafeInteger(parseInt(i.margin))?new Array(parseInt(i.margin)).fill(" ").join(""):i.margin||"";const a=i.width;return(r||"").split(/\r?\n/g).map((r=>r.split(/\s+/g).reduce(((r,i)=>{if(i.length+o.length>=a||r[r.length-1].length+i.length+1<a)r[r.length-1]+=` ${i}`;else r.push(`${o}${i}`);return r}),[o]).join("\n"))).join("\n")}},1112:(r,i,o)=>{function isNodeLT(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let i=0,o=process.versions.node.split(".").map(Number);for(;i<r.length;i++){if(o[i]>r[i])return false;if(r[i]>o[i])return true}return false}r.exports=isNodeLT("8.6.0")?o(6598):o(9590)},8994:r=>{"use strict";class DatePart{constructor({token:r,date:i,parts:o,locales:a}){this.token=r;this.date=i||new Date;this.parts=o||[this];this.locales=a||{}}up(){}down(){}next(){const r=this.parts.indexOf(this);return this.parts.find(((i,o)=>o>r&&i instanceof DatePart))}setTo(r){}prev(){let r=[].concat(this.parts).reverse();const i=r.indexOf(this);return r.find(((r,o)=>o>i&&r instanceof DatePart))}toString(){return String(this.date)}}r.exports=DatePart},5513:(r,i,o)=>{"use strict";const a=o(8994);const pos=r=>{r=r%10;return r===1?"st":r===2?"nd":r===3?"rd":"th"};class Day extends a{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate();let i=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+pos(r):this.token==="d"?i+1:this.token==="ddd"?this.locales.weekdaysShort[i]:this.token==="dddd"?this.locales.weekdays[i]:r}}r.exports=Day},9270:(r,i,o)=>{"use strict";const a=o(8994);class Hours extends a{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();if(/h/.test(this.token))r=r%12||12;return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Hours},1190:(r,i,o)=>{"use strict";r.exports={DatePart:o(8994),Meridiem:o(8135),Day:o(5513),Hours:o(9270),Milliseconds:o(2397),Minutes:o(9246),Month:o(5763),Seconds:o(5579),Year:o(4191)}},8135:(r,i,o)=>{"use strict";const a=o(8994);class Meridiem extends a{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}r.exports=Meridiem},2397:(r,i,o)=>{"use strict";const a=o(8994);class Milliseconds extends a{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}r.exports=Milliseconds},9246:(r,i,o)=>{"use strict";const a=o(8994);class Minutes extends a{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Minutes},5763:(r,i,o)=>{"use strict";const a=o(8994);class Month extends a{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1;this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth();let i=this.token.length;return i===2?String(r+1).padStart(2,"0"):i===3?this.locales.monthsShort[r]:i===4?this.locales.months[r]:String(r+1)}}r.exports=Month},5579:(r,i,o)=>{"use strict";const a=o(8994);class Seconds extends a{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}r.exports=Seconds},4191:(r,i,o)=>{"use strict";const a=o(8994);class Year extends a{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}r.exports=Year},514:(r,i,o)=>{"use strict";const a=o(9439);const l=o(9126);const{erase:c,cursor:u}=o(332);const{style:h,clear:d,figures:p,wrap:g,entriesToDisplay:y}=o(9807);const getVal=(r,i)=>r[i]&&(r[i].value||r[i].title||r[i]);const getTitle=(r,i)=>r[i]&&(r[i].title||r[i].value||r[i]);const getIndex=(r,i)=>{const o=r.findIndex((r=>r.value===i||r.title===i));return o>-1?o:undefined};class AutocompletePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.suggest=r.suggest;this.choices=r.choices;this.initial=typeof r.initial==="number"?r.initial:getIndex(r.choices,r.initial);this.select=this.initial||r.cursor||0;this.i18n={noMatches:r.noMatches||"no matches found"};this.fallback=r.fallback||this.initial;this.clearFirst=r.clearFirst||false;this.suggestions=[];this.input="";this.limit=r.limit||10;this.cursor=0;this.transform=h.render(r.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=d("",this.out.columns);this.complete(this.render);this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;if(typeof this._fb==="number")r=this.choices[this._fb];else if(typeof this._fb==="string")r={title:this._fb};return r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r;if(this.suggestions.length>0)this.value=getVal(this.suggestions,r);else this.value=this.fallback.value;this.fire()}async complete(r){const i=this.completing=this.suggest(this.input,this.choices);const o=await i;if(this.completing!==i)return;this.suggestions=o.map(((r,i,o)=>({title:getTitle(o,i),value:getVal(o,i),description:r.description})));this.completing=false;const a=Math.max(o.length-1,0);this.moveSelect(Math.min(a,this.select));r&&r()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){let o=this.input.slice(0,this.cursor);let a=this.input.slice(this.cursor);this.input=`${o}${r}${a}`;this.cursor=o.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1);let i=this.input.slice(this.cursor);this.input=`${r}${i}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor);let i=this.input.slice(this.cursor+1);this.input=`${r}${i}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(r,i,o,l){let c;let u=o?p.arrowUp:l?p.arrowDown:" ";let h=i?a.cyan().underline(r.title):r.title;u=(i?a.cyan(p.pointer)+" ":" ")+u;if(r.description){c=` - ${r.description}`;if(u.length+h.length+c.length>=this.out.columns||r.description.split(/\r?\n/).length>1){c="\n"+g(r.description,{margin:3,width:this.out.columns})}}return u+" "+h+a.gray(c||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(d(this.outputText,this.out.columns));super.render();let{startIndex:r,endIndex:i}=y(this.select,this.choices.length,this.limit);this.outputText=[h.symbol(this.done,this.aborted,this.exited),a.bold(this.msg),h.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const o=this.suggestions.slice(r,i).map(((o,a)=>this.renderOption(o,this.select===a+r,a===0&&r>0,a+r===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(o||a.gray(this.fallback.title))}this.out.write(c.line+u.to(0)+this.outputText)}}r.exports=AutocompletePrompt},7685:(r,i,o)=>{"use strict";const a=o(9439);const{cursor:l}=o(332);const c=o(92);const{clear:u,style:h,figures:d}=o(9807);class AutocompleteMultiselectPrompt extends c{constructor(r={}){r.overrideRender=true;super(r);this.inputValue="";this.clear=u("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((r=>{if(this.inputValue){if(typeof r.title==="string"){if(r.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof r.value==="string"){if(r.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const i=this.filteredOptions.findIndex((i=>i===r));this.cursor=i<0?0:i;this.render()}handleSpaceToggle(){const r=this.filteredOptions[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r;this.updateFilteredOptions()}_(r,i){if(r===" "){this.handleSpaceToggle()}else{this.handleInputChange(r)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${d.arrowUp}/${d.arrowDown}: Highlight option\n ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:a.gray("Enter something to filter")}\n`}renderOption(r,i,o){let l;if(i.disabled)l=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title);else l=r===o?a.cyan().underline(i.title):i.title;return(i.selected?a.green(d.radioOn):d.radioOff)+" "+l}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let r=[h.symbol(this.done,this.aborted),a.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+r);this.clear=u(r,this.out.columns)}}r.exports=AutocompleteMultiselectPrompt},3037:(r,i,o)=>{const a=o(9439);const l=o(9126);const{style:c,clear:u}=o(9807);const{erase:h,cursor:d}=o(332);class ConfirmPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=r.initial;this.initialValue=!!r.initial;this.yesMsg=r.yes||"yes";this.yesOption=r.yesOption||"(Y/n)";this.noMsg=r.no||"no";this.noOption=r.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(r,i){if(r.toLowerCase()==="y"){this.value=true;return this.submit()}if(r.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:a.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(h.line+d.to(0)+this.outputText)}}r.exports=ConfirmPrompt},5048:(r,i,o)=>{"use strict";const a=o(9439);const l=o(9126);const{style:c,clear:u,figures:h}=o(9807);const{erase:d,cursor:p}=o(332);const{DatePart:g,Meridiem:y,Day:w,Hours:b,Milliseconds:v,Minutes:E,Month:x,Seconds:M,Year:D}=o(1190);const O=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const T={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new w(r),3:r=>new x(r),4:r=>new D(r),5:r=>new y(r),6:r=>new b(r),7:r=>new E(r),8:r=>new M(r),9:r=>new v(r)};const S={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.cursor=0;this.typed="";this.locales=Object.assign(S,r.locales);this._date=r.initial||new Date;this.errorMsg=r.error||"Please Enter A Valid Value";this.validator=r.validate||(()=>true);this.mask=r.mask||"YYYY-MM-DD HH:mm:ss";this.clear=u("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(r){if(r)this._date.setTime(r.getTime())}set mask(r){let i;this.parts=[];while(i=O.exec(r)){let r=i.shift();let o=i.findIndex((r=>r!=null));this.parts.push(o in T?T[o]({token:i[o]||r,date:this.date,parts:this.parts,locales:this.locales}):i[o]||r)}let o=this.parts.reduce(((r,i)=>{if(typeof i==="string"&&typeof r[r.length-1]==="string")r[r.length-1]+=i;else r.push(i);return r}),[]);this.parts.splice(0);this.parts.push(...o);this.reset()}moveCursor(r){this.typed="";this.cursor=r;this.fire()}reset(){this.moveCursor(this.parts.findIndex((r=>r instanceof g)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let r=await this.validator(this.value);if(typeof r==="string"){this.errorMsg=r;r=false}this.error=!r}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r));this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex((r=>r instanceof g)));this.render()}_(r){if(/\d/.test(r)){this.typed+=r;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(false),this.parts.reduce(((r,i,o)=>r.concat(o===this.cursor&&!this.done?a.cyan().underline(i.toString()):i)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((r,i,o)=>r+`\n${o?` `:h.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(d.line+p.to(0)+this.outputText)}}r.exports=DatePrompt},6529:(r,i,o)=>{"use strict";r.exports={TextPrompt:o(1551),SelectPrompt:o(6515),TogglePrompt:o(181),DatePrompt:o(5048),NumberPrompt:o(3686),MultiselectPrompt:o(92),AutocompletePrompt:o(514),AutocompleteMultiselectPrompt:o(7685),ConfirmPrompt:o(3037)}},92:(r,i,o)=>{"use strict";const a=o(9439);const{cursor:l}=o(332);const c=o(9126);const{clear:u,figures:h,style:d,wrap:p,entriesToDisplay:g}=o(9807);class MultiselectPrompt extends c{constructor(r={}){super(r);this.msg=r.message;this.cursor=r.cursor||0;this.scrollIndex=r.cursor||0;this.hint=r.hint||"";this.warn=r.warn||"- This option is disabled -";this.minSelected=r.min;this.showMinError=false;this.maxChoices=r.max;this.instructions=r.instructions;this.optionsPerPage=r.optionsPerPage||10;this.value=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===undefined?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled}}));this.clear=u("",this.out.columns);if(!r.overrideRender){this.render()}}reset(){this.value.map((r=>!r.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((r=>r.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const r=this.value.filter((r=>r.selected));if(this.minSelected&&r.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((r=>r.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const r=this.value[this.cursor];if(r.selected){r.selected=false;this.render()}else if(r.disabled||this.value.filter((r=>r.selected)).length>=this.maxChoices){return this.bell()}else{r.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const r=!this.value[this.cursor].selected;this.value.filter((r=>!r.disabled)).forEach((i=>i.selected=r));this.render()}_(r,i){if(r===" "){this.handleSpaceToggle()}else if(r==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${h.arrowUp}/${h.arrowDown}: Highlight option\n`+` ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(r,i,o,l){const c=(i.selected?a.green(h.radioOn):h.radioOff)+" "+l+" ";let u,d;if(i.disabled){u=r===o?a.gray().underline(i.title):a.strikethrough().gray(i.title)}else{u=r===o?a.cyan().underline(i.title):i.title;if(r===o&&i.description){d=` - ${i.description}`;if(c.length+u.length+d.length>=this.out.columns||i.description.split(/\r?\n/).length>1){d="\n"+p(i.description,{margin:c.length,width:this.out.columns})}}}return c+u+a.gray(d||"")}paginateOptions(r){if(r.length===0){return a.red("No matches for this query.")}let{startIndex:i,endIndex:o}=g(this.cursor,r.length,this.optionsPerPage);let l,c=[];for(let a=i;a<o;a++){if(a===i&&i>0){l=h.arrowUp}else if(a===o-1&&o<r.length){l=h.arrowDown}else{l=" "}c.push(this.renderOption(this.cursor,r[a],a,l))}return"\n"+c.join("\n")}renderOptions(r){if(!this.done){return this.paginateOptions(r)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((r=>r.selected)).map((r=>r.title)).join(", ")}const r=[a.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){r.push(a.yellow(this.warn))}return r.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let r=[d.symbol(this.done,this.aborted),a.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){r+=a.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}r+=this.renderOptions(this.value);this.out.write(this.clear+r);this.clear=u(r,this.out.columns)}}r.exports=MultiselectPrompt},3686:(r,i,o)=>{const a=o(9439);const l=o(9126);const{cursor:c,erase:u}=o(332);const{style:h,figures:d,clear:p,lines:g}=o(9807);const y=/[0-9]/;const isDef=r=>r!==undefined;const round=(r,i)=>{let o=Math.pow(10,i);return Math.round(r*o)/o};class NumberPrompt extends l{constructor(r={}){super(r);this.transform=h.render(r.style);this.msg=r.message;this.initial=isDef(r.initial)?r.initial:"";this.float=!!r.float;this.round=r.round||2;this.inc=r.increment||1;this.min=isDef(r.min)?r.min:-Infinity;this.max=isDef(r.max)?r.max:Infinity;this.errorMsg=r.error||`Please Enter A Valid Value`;this.validator=r.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(r){if(!r&&r!==0){this.placeholder=true;this.rendered=a.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(r,this.round)}`);this._value=round(r,this.round)}this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r===`-`||r===`.`&&this.float||y.test(r)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==``?r:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let r=await this.validator(this.value);if(typeof r===`string`){this.errorMsg=r;r=false}this.error=!r}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let r=this.value;this.value=r!==``?r:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(r,i){if(!this.valid(r))return this.bell();const o=Date.now();if(o-this.lastHit>1e3)this.typed=``;this.typed+=r;this.lastHit=o;this.color=`cyan`;if(r===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(g(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[h.symbol(this.done,this.aborted),a.bold(this.msg),h.delimiter(this.done),!this.done||!this.done&&!this.placeholder?a[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?` `:d.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(u.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore)}}r.exports=NumberPrompt},9126:(r,i,o)=>{"use strict";const a=o(4521);const{action:l}=o(9807);const c=o(2361);const{beep:u,cursor:h}=o(332);const d=o(9439);class Prompt extends c{constructor(r={}){super();this.firstRender=true;this.in=r.stdin||process.stdin;this.out=r.stdout||process.stdout;this.onRender=(r.onRender||(()=>void 0)).bind(this);const i=a.createInterface({input:this.in,escapeCodeTimeout:50});a.emitKeypressEvents(this.in,i);if(this.in.isTTY)this.in.setRawMode(true);const o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(r,i)=>{let a=l(i,o);if(a===false){this._&&this._(r,i)}else if(typeof this[a]==="function"){this[a](i)}else{this.bell()}};this.close=()=>{this.out.write(h.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);i.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(u)}render(){this.onRender(d);if(this.firstRender)this.firstRender=false}}r.exports=Prompt},6515:(r,i,o)=>{"use strict";const a=o(9439);const l=o(9126);const{style:c,clear:u,figures:h,wrap:d,entriesToDisplay:p}=o(9807);const{cursor:g}=o(332);class SelectPrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.hint=r.hint||"- Use arrow-keys. Return to submit.";this.warn=r.warn||"- This option is disabled";this.cursor=r.initial||0;this.choices=r.choices.map(((r,i)=>{if(typeof r==="string")r={title:r,value:i};return{title:r&&(r.title||r.value||r),value:r&&(r.value===undefined?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled}}));this.optionsPerPage=r.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=u("",this.out.columns);this.render()}moveCursor(r){this.cursor=r;this.value=this.choices[r].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(r,i){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(g.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();let{startIndex:r,endIndex:i}=p(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(false),this.done?this.selection.title:this.selection.disabled?a.yellow(this.warn):a.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let o=r;o<i;o++){let l,c,u="",p=this.choices[o];if(o===r&&r>0){c=h.arrowUp}else if(o===i-1&&i<this.choices.length){c=h.arrowDown}else{c=" "}if(p.disabled){l=this.cursor===o?a.gray().underline(p.title):a.strikethrough().gray(p.title);c=(this.cursor===o?a.bold().gray(h.pointer)+" ":" ")+c}else{l=this.cursor===o?a.cyan().underline(p.title):p.title;c=(this.cursor===o?a.cyan(h.pointer)+" ":" ")+c;if(p.description&&this.cursor===o){u=` - ${p.description}`;if(c.length+l.length+u.length>=this.out.columns||p.description.split(/\r?\n/).length>1){u="\n"+d(p.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${c} ${l}${a.gray(u)}\n`}}this.out.write(this.outputText)}}r.exports=SelectPrompt},1551:(r,i,o)=>{const a=o(9439);const l=o(9126);const{erase:c,cursor:u}=o(332);const{style:h,clear:d,lines:p,figures:g}=o(9807);class TextPrompt extends l{constructor(r={}){super(r);this.transform=h.render(r.style);this.scale=this.transform.scale;this.msg=r.message;this.initial=r.initial||``;this.validator=r.validate||(()=>true);this.value=``;this.errorMsg=r.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=d(``,this.out.columns);this.render()}set value(r){if(!r&&this.initial){this.placeholder=true;this.rendered=a.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(r)}this._value=r;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let r=await this.validator(this.value);if(typeof r===`string`){this.errorMsg=r;r=false}this.error=!r}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(r){if(this.placeholder)return;this.cursor=this.cursor+r;this.cursorOffset+=r}_(r,i){let o=this.value.slice(0,this.cursor);let a=this.value.slice(this.cursor);this.value=`${o}${r}${a}`;this.red=false;this.cursor=this.placeholder?0:o.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1);let i=this.value.slice(this.cursor);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor);let i=this.value.slice(this.cursor+1);this.value=`${r}${i}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[h.symbol(this.done,this.aborted),a.bold(this.msg),h.delimiter(this.done),this.red?a.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((r,i,o)=>r+`\n${o?" ":g.pointerSmall} ${a.red().italic(i)}`),``)}this.out.write(c.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore+u.move(this.cursorOffset,0))}}r.exports=TextPrompt},181:(r,i,o)=>{const a=o(9439);const l=o(9126);const{style:c,clear:u}=o(9807);const{cursor:h,erase:d}=o(332);class TogglePrompt extends l{constructor(r={}){super(r);this.msg=r.message;this.value=!!r.initial;this.active=r.active||"on";this.inactive=r.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(r,i){if(r===" "){this.value=!this.value}else if(r==="1"){this.value=true}else if(r==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),a.bold(this.msg),c.delimiter(this.done),this.value?this.inactive:a.cyan().underline(this.inactive),a.gray("/"),this.value?a.cyan().underline(this.active):this.active].join(" ");this.out.write(d.line+h.to(0)+this.outputText)}}r.exports=TogglePrompt},9590:(r,i,o)=>{"use strict";const a=o(4450);const l=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(r=[],{onSubmit:i=noop,onCancel:o=noop}={}){const c={};const u=prompt._override||{};r=[].concat(r);let h,d,p,g,y,w;const getFormattedAnswer=async(r,i,o=false)=>{if(!o&&r.validate&&r.validate(i)!==true){return}return r.format?await r.format(i,c):i};for(d of r){({name:g,type:y}=d);if(typeof y==="function"){y=await y(h,{...c},d);d["type"]=y}if(!y)continue;for(let r in d){if(l.includes(r))continue;let i=d[r];d[r]=typeof i==="function"?await i(h,{...c},w):i}w=d;if(typeof d.message!=="string"){throw new Error("prompt message is required")}({name:g,type:y}=d);if(a[y]===void 0){throw new Error(`prompt type (${y}) is not defined`)}if(u[d.name]!==undefined){h=await getFormattedAnswer(d,u[d.name]);if(h!==undefined){c[g]=h;continue}}try{h=prompt._injected?getInjectedAnswer(prompt._injected,d.initial):await a[y](d);c[g]=h=await getFormattedAnswer(d,h,true);p=await i(d,h,c)}catch(r){p=!await o(d,c)}if(p)return c}return c}function getInjectedAnswer(r,i){const o=r.shift();if(o instanceof Error){throw o}return o===undefined?i:o}function inject(r){prompt._injected=(prompt._injected||[]).concat(r)}function override(r){prompt._override=Object.assign({},r)}r.exports=Object.assign(prompt,{prompt:prompt,prompts:a,inject:inject,override:override})},4450:(r,i,o)=>{"use strict";const a=i;const l=o(6529);const noop=r=>r;function toPrompt(r,i,o={}){return new Promise(((a,c)=>{const u=new l[r](i);const h=o.onAbort||noop;const d=o.onSubmit||noop;const p=o.onExit||noop;u.on("state",i.onState||noop);u.on("submit",(r=>a(d(r))));u.on("exit",(r=>a(p(r))));u.on("abort",(r=>c(h(r))))}))}a.text=r=>toPrompt("TextPrompt",r);a.password=r=>{r.style="password";return a.text(r)};a.invisible=r=>{r.style="invisible";return a.text(r)};a.number=r=>toPrompt("NumberPrompt",r);a.date=r=>toPrompt("DatePrompt",r);a.confirm=r=>toPrompt("ConfirmPrompt",r);a.list=r=>{const i=r.separator||",";return toPrompt("TextPrompt",r,{onSubmit:r=>r.split(i).map((r=>r.trim()))})};a.toggle=r=>toPrompt("TogglePrompt",r);a.select=r=>toPrompt("SelectPrompt",r);a.multiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("MultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};a.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const toSelected=r=>r.filter((r=>r.selected)).map((r=>r.value));return toPrompt("AutocompleteMultiselectPrompt",r,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(r,i)=>Promise.resolve(i.filter((i=>i.title.slice(0,r.length).toLowerCase()===r.toLowerCase())));a.autocomplete=r=>{r.suggest=r.suggest||byTitle;r.choices=[].concat(r.choices||[]);return toPrompt("AutocompletePrompt",r)}},8573:r=>{"use strict";r.exports=(r,i)=>{if(r.meta&&r.name!=="escape")return;if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c")return"abort";if(r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(i){if(r.name==="j")return"down";if(r.name==="k")return"up"}if(r.name==="return")return"submit";if(r.name==="enter")return"submit";if(r.name==="backspace")return"delete";if(r.name==="delete")return"deleteForward";if(r.name==="abort")return"abort";if(r.name==="escape")return"exit";if(r.name==="tab")return"next";if(r.name==="pagedown")return"nextPage";if(r.name==="pageup")return"prevPage";if(r.name==="home")return"home";if(r.name==="end")return"end";if(r.name==="up")return"up";if(r.name==="down")return"down";if(r.name==="right")return"right";if(r.name==="left")return"left";return false}},6747:(r,i,o)=>{"use strict";const a=o(2714);const{erase:l,cursor:c}=o(332);const width=r=>[...a(r)].length;r.exports=function(r,i){if(!i)return l.line+c.to(0);let o=0;const a=r.split(/\r?\n/);for(let r of a){o+=1+Math.floor(Math.max(width(r)-1,0)/i)}return l.lines(o)}},3297:r=>{"use strict";r.exports=(r,i,o)=>{o=o||i;let a=Math.min(i-o,r-Math.floor(o/2));if(a<0)a=0;let l=Math.min(a+o,i);return{startIndex:a,endIndex:l}}},3034:r=>{"use strict";const i={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const o={arrowUp:i.arrowUp,arrowDown:i.arrowDown,arrowLeft:i.arrowLeft,arrowRight:i.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const a=process.platform==="win32"?o:i;r.exports=a},9807:(r,i,o)=>{"use strict";r.exports={action:o(8573),clear:o(6747),style:o(7357),strip:o(2714),figures:o(3034),lines:o(4413),wrap:o(2492),entriesToDisplay:o(3297)}},4413:(r,i,o)=>{"use strict";const a=o(2714);r.exports=function(r,i){let o=String(a(r)||"").split(/\r?\n/);if(!i)return o.length;return o.map((r=>Math.ceil(r.length/i))).reduce(((r,i)=>r+i))}},2714:r=>{"use strict";r.exports=r=>{const i=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const o=new RegExp(i,"g");return typeof r==="string"?r.replace(o,""):r}},7357:(r,i,o)=>{"use strict";const a=o(9439);const l=o(3034);const c=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"😃".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}});const render=r=>c[r]||c.default;const u=Object.freeze({aborted:a.red(l.cross),done:a.green(l.tick),exited:a.yellow(l.cross),default:a.cyan("?")});const symbol=(r,i,o)=>i?u.aborted:o?u.exited:r?u.done:u.default;const delimiter=r=>a.gray(r?l.ellipsis:l.pointerSmall);const item=(r,i)=>a.gray(r?i?l.pointerSmall:"+":l.line);r.exports={styles:c,render:render,symbols:u,symbol:symbol,delimiter:delimiter,item:item}},2492:r=>{"use strict";r.exports=(r,i={})=>{const o=Number.isSafeInteger(parseInt(i.margin))?new Array(parseInt(i.margin)).fill(" ").join(""):i.margin||"";const a=i.width;return(r||"").split(/\r?\n/g).map((r=>r.split(/\s+/g).reduce(((r,i)=>{if(i.length+o.length>=a||r[r.length-1].length+i.length+1<a)r[r.length-1]+=` ${i}`;else r.push(`${o}${i}`);return r}),[o]).join("\n"))).join("\n")}},8271:(r,i,o)=>{var a=o(7563);var l=o(1017).join;var c=o(5134);var u="/etc";var h=process.platform==="win32";var d=h?process.env.USERPROFILE:process.env.HOME;r.exports=function(r,i,p,g){if("string"!==typeof r)throw new Error("rc(name): name *must* be string");if(!p)p=o(5912)(process.argv.slice(2));i=("string"===typeof i?a.json(i):i)||{};g=g||a.parse;var y=a.env(r+"_");var w=[i];var b=[];function addConfigFile(r){if(b.indexOf(r)>=0)return;var i=a.file(r);if(i){w.push(g(i));b.push(r)}}if(!h)[l(u,r,"config"),l(u,r+"rc")].forEach(addConfigFile);if(d)[l(d,".config",r,"config"),l(d,".config",r),l(d,"."+r,"config"),l(d,"."+r+"rc")].forEach(addConfigFile);addConfigFile(a.find("."+r+"rc"));if(y.config)addConfigFile(y.config);if(p.config)addConfigFile(p.config);return c.apply(null,w.concat([y,p,b.length?{configs:b,config:b[b.length-1]}:undefined]))}},7563:(r,i,o)=>{"use strict";var a=o(7147);var l=o(1923);var c=o(1017);var u=o(6397);var h=i.parse=function(r){if(/^\s*{/.test(r))return JSON.parse(u(r));return l.parse(r)};var d=i.file=function(){var r=[].slice.call(arguments).filter((function(r){return r!=null}));for(var i in r)if("string"!==typeof r[i])return;var o=c.join.apply(null,r);var l;try{return a.readFileSync(o,"utf-8")}catch(r){return}};var p=i.json=function(){var r=d.apply(null,arguments);return r?h(r):null};var g=i.env=function(r,i){i=i||process.env;var o={};var a=r.length;for(var l in i){if(l.toLowerCase().indexOf(r.toLowerCase())===0){var c=l.substring(a).split("__");var u;while((u=c.indexOf(""))>-1){c.splice(u,1)}var h=o;c.forEach((function _buildSubObj(r,o){if(!r||typeof h!=="object")return;if(o===c.length-1)h[r]=i[l];if(h[r]===undefined)h[r]={};h=h[r]}))}}return o};var y=i.find=function(){var r=c.join.apply(null,[].slice.call(arguments));function find(r,i){var o=c.join(r,i);try{a.statSync(o);return o}catch(o){if(c.dirname(r)!==r)return find(c.dirname(r),i)}}return find(process.cwd(),r)}},6397:r=>{"use strict";var i=1;var o=2;function stripWithoutWhitespace(){return""}function stripWithWhitespace(r,i,o){return r.slice(i,o).replace(/\S/g," ")}r.exports=function(r,a){a=a||{};var l;var c;var u=false;var h=false;var d=0;var p="";var g=a.whitespace===false?stripWithoutWhitespace:stripWithWhitespace;for(var y=0;y<r.length;y++){l=r[y];c=r[y+1];if(!h&&l==='"'){var w=r[y-1]==="\\"&&r[y-2]!=="\\";if(!w){u=!u}}if(u){continue}if(!h&&l+c==="//"){p+=r.slice(d,y);d=y;h=i;y++}else if(h===i&&l+c==="\r\n"){y++;h=false;p+=g(r,d,y);d=y;continue}else if(h===i&&l==="\n"){h=false;p+=g(r,d,y);d=y}else if(!h&&l+c==="/*"){p+=r.slice(d,y);d=y;h=o;y++;continue}else if(h===o&&l+c==="*/"){y++;h=false;p+=g(r,d,y+1);d=y+1;continue}}return p+(h?g(r.substr(d)):r.substr(d))}},4955:(r,i,o)=>{const a=o(3118).Buffer;function decodeBase64(r){return a.from(r,"base64").toString("utf8")}function encodeBase64(r){return a.from(r,"utf8").toString("base64")}r.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},1384:(r,i,o)=>{var a=o(7310);var l=o(4955);var c=l.decodeBase64;var u=l.encodeBase64;var h=":_authToken";var d=":username";var p=":_password";r.exports=function(){var r;var i;if(arguments.length>=2){r=arguments[0];i=arguments[1]}else if(typeof arguments[0]==="string"){r=arguments[0]}else{i=arguments[0]}i=i||{};i.npmrc=i.npmrc||o(8271)("npm",{registry:"https://registry.npmjs.org/"});r=r||i.npmrc.registry;return getRegistryAuthInfo(r,i)||getLegacyAuthInfo(i.npmrc)};function getRegistryAuthInfo(r,i){var o=a.parse(r,false,true);var l;while(l!=="/"&&o.pathname!==l){l=o.pathname||"/";var c="//"+o.host+l.replace(/\/$/,"");var u=getAuthInfoForUrl(c,i.npmrc);if(u){return u}if(!i.recursive){return/\/$/.test(r)?undefined:getRegistryAuthInfo(a.resolve(r,"."),i)}o.pathname=a.resolve(normalizePath(l),"..")||"/"}return undefined}function getLegacyAuthInfo(r){if(r._auth){return{token:r._auth,type:"Basic"}}return undefined}function normalizePath(r){return r[r.length-1]==="/"?r:r+"/"}function getAuthInfoForUrl(r,i){var o=getBearerToken(i[r+h]||i[r+"/"+h]);if(o){return o}var a=i[r+d]||i[r+"/"+d];var l=i[r+p]||i[r+"/"+p];var c=getTokenForUsernameAndPassword(a,l);if(c){return c}return undefined}function getBearerToken(r){if(!r){return undefined}var i=r.replace(/^\$\{?([^}]*)\}?$/,(function(r,i){return process.env[i]}));return{token:i,type:"Bearer"}}function getTokenForUsernameAndPassword(r,i){if(!r||!i){return undefined}var o=c(i.replace(/^\$\{?([^}]*)\}?$/,(function(r,i){return process.env[i]})));var a=u(r+":"+o);return{token:a,type:"Basic",password:o,username:r}}},2447:(r,i,o)=>{"use strict";r.exports=function(r){var i=o(8271)("npm",{registry:"https://registry.npmjs.org/"});var a=i[r+":registry"]||i.registry;return a.slice(-1)==="/"?a:a+"/"}},3118:(r,i,o)=>{
28
28
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
29
29
  var a=o(4300);var l=a.Buffer;function copyProps(r,i){for(var o in r){i[o]=r[o]}}if(l.from&&l.alloc&&l.allocUnsafe&&l.allocUnsafeSlow){r.exports=a}else{copyProps(a,i);i.Buffer=SafeBuffer}function SafeBuffer(r,i,o){return l(r,i,o)}SafeBuffer.prototype=Object.create(l.prototype);copyProps(l,SafeBuffer);SafeBuffer.from=function(r,i,o){if(typeof r==="number"){throw new TypeError("Argument must not be a number")}return l(r,i,o)};SafeBuffer.alloc=function(r,i,o){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}var a=l(r);if(i!==undefined){if(typeof o==="string"){a.fill(i,o)}else{a.fill(i)}}else{a.fill(0)}return a};SafeBuffer.allocUnsafe=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return l(r)};SafeBuffer.allocUnsafeSlow=function(r){if(typeof r!=="number"){throw new TypeError("Argument must be a number")}return a.SlowBuffer(r)}},9746:(r,i,o)=>{(function(r){r.parser=function(r,i){return new SAXParser(r,i)};r.SAXParser=SAXParser;r.SAXStream=SAXStream;r.createStream=createStream;r.MAX_BUFFER_LENGTH=64*1024;var i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(i,o){if(!(this instanceof SAXParser)){return new SAXParser(i,o)}var a=this;clearBuffers(a);a.q=a.c="";a.bufferCheckPosition=r.MAX_BUFFER_LENGTH;a.opt=o||{};a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags;a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase";a.tags=[];a.closed=a.closedRoot=a.sawRoot=false;a.tag=a.error=null;a.strict=!!i;a.noscript=!!(i||a.opt.noscript);a.state=v.BEGIN;a.strictEntities=a.opt.strictEntities;a.ENTITIES=a.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES);a.attribList=[];if(a.opt.xmlns){a.ns=Object.create(p)}a.trackPosition=a.opt.position!==false;if(a.trackPosition){a.position=a.line=a.column=0}emit(a,"onready")}if(!Object.create){Object.create=function(r){function F(){}F.prototype=r;var i=new F;return i}}if(!Object.keys){Object.keys=function(r){var i=[];for(var o in r)if(r.hasOwnProperty(o))i.push(o);return i}}function checkBufferLength(o){var a=Math.max(r.MAX_BUFFER_LENGTH,10);var l=0;for(var c=0,u=i.length;c<u;c++){var h=o[i[c]].length;if(h>a){switch(i[c]){case"textNode":closeText(o);break;case"cdata":emitNode(o,"oncdata",o.cdata);o.cdata="";break;case"script":emitNode(o,"onscript",o.script);o.script="";break;default:error(o,"Max buffer length exceeded: "+i[c])}}l=Math.max(l,h)}var d=r.MAX_BUFFER_LENGTH-l;o.bufferCheckPosition=d+o.position}function clearBuffers(r){for(var o=0,a=i.length;o<a;o++){r[i[o]]=""}}function flushBuffers(r){closeText(r);if(r.cdata!==""){emitNode(r,"oncdata",r.cdata);r.cdata=""}if(r.script!==""){emitNode(r,"onscript",r.script);r.script=""}}SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}};var a;try{a=o(2781).Stream}catch(r){a=function(){}}var l=r.EVENTS.filter((function(r){return r!=="error"&&r!=="end"}));function createStream(r,i){return new SAXStream(r,i)}function SAXStream(r,i){if(!(this instanceof SAXStream)){return new SAXStream(r,i)}a.apply(this);this._parser=new SAXParser(r,i);this.writable=true;this.readable=true;var o=this;this._parser.onend=function(){o.emit("end")};this._parser.onerror=function(r){o.emit("error",r);o._parser.error=null};this._decoder=null;l.forEach((function(r){Object.defineProperty(o,"on"+r,{get:function(){return o._parser["on"+r]},set:function(i){if(!i){o.removeAllListeners(r);o._parser["on"+r]=i;return i}o.on(r,i)},enumerable:true,configurable:false})}))}SAXStream.prototype=Object.create(a.prototype,{constructor:{value:SAXStream}});SAXStream.prototype.write=function(r){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(r)){if(!this._decoder){var i=o(1576).StringDecoder;this._decoder=new i("utf8")}r=this._decoder.write(r)}this._parser.write(r.toString());this.emit("data",r);return true};SAXStream.prototype.end=function(r){if(r&&r.length){this.write(r)}this._parser.end();return true};SAXStream.prototype.on=function(r,i){var o=this;if(!o._parser["on"+r]&&l.indexOf(r)!==-1){o._parser["on"+r]=function(){var i=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);i.splice(0,0,r);o.emit.apply(o,i)}}return a.prototype.on.call(o,r,i)};var c="[CDATA[";var u="DOCTYPE";var h="http://www.w3.org/XML/1998/namespace";var d="http://www.w3.org/2000/xmlns/";var p={xml:h,xmlns:d};var g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;var w=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var b=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function isWhitespace(r){return r===" "||r==="\n"||r==="\r"||r==="\t"}function isQuote(r){return r==='"'||r==="'"}function isAttribEnd(r){return r===">"||isWhitespace(r)}function isMatch(r,i){return r.test(i)}function notMatch(r,i){return!isMatch(r,i)}var v=0;r.STATE={BEGIN:v++,BEGIN_WHITESPACE:v++,TEXT:v++,TEXT_ENTITY:v++,OPEN_WAKA:v++,SGML_DECL:v++,SGML_DECL_QUOTED:v++,DOCTYPE:v++,DOCTYPE_QUOTED:v++,DOCTYPE_DTD:v++,DOCTYPE_DTD_QUOTED:v++,COMMENT_STARTING:v++,COMMENT:v++,COMMENT_ENDING:v++,COMMENT_ENDED:v++,CDATA:v++,CDATA_ENDING:v++,CDATA_ENDING_2:v++,PROC_INST:v++,PROC_INST_BODY:v++,PROC_INST_ENDING:v++,OPEN_TAG:v++,OPEN_TAG_SLASH:v++,ATTRIB:v++,ATTRIB_NAME:v++,ATTRIB_NAME_SAW_WHITE:v++,ATTRIB_VALUE:v++,ATTRIB_VALUE_QUOTED:v++,ATTRIB_VALUE_CLOSED:v++,ATTRIB_VALUE_UNQUOTED:v++,ATTRIB_VALUE_ENTITY_Q:v++,ATTRIB_VALUE_ENTITY_U:v++,CLOSE_TAG:v++,CLOSE_TAG_SAW_WHITE:v++,SCRIPT:v++,SCRIPT_ENDING:v++};r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(r.ENTITIES).forEach((function(i){var o=r.ENTITIES[i];var a=typeof o==="number"?String.fromCharCode(o):o;r.ENTITIES[i]=a}));for(var E in r.STATE){r.STATE[r.STATE[E]]=E}v=r.STATE;function emit(r,i,o){r[i]&&r[i](o)}function emitNode(r,i,o){if(r.textNode)closeText(r);emit(r,i,o)}function closeText(r){r.textNode=textopts(r.opt,r.textNode);if(r.textNode)emit(r,"ontext",r.textNode);r.textNode=""}function textopts(r,i){if(r.trim)i=i.trim();if(r.normalize)i=i.replace(/\s+/g," ");return i}function error(r,i){closeText(r);if(r.trackPosition){i+="\nLine: "+r.line+"\nColumn: "+r.column+"\nChar: "+r.c}i=new Error(i);r.error=i;emit(r,"onerror",i);return r}function end(r){if(r.sawRoot&&!r.closedRoot)strictFail(r,"Unclosed root tag");if(r.state!==v.BEGIN&&r.state!==v.BEGIN_WHITESPACE&&r.state!==v.TEXT){error(r,"Unexpected end")}closeText(r);r.c="";r.closed=true;emit(r,"onend");SAXParser.call(r,r.strict,r.opt);return r}function strictFail(r,i){if(typeof r!=="object"||!(r instanceof SAXParser)){throw new Error("bad call to strictFail")}if(r.strict){error(r,i)}}function newTag(r){if(!r.strict)r.tagName=r.tagName[r.looseCase]();var i=r.tags[r.tags.length-1]||r;var o=r.tag={name:r.tagName,attributes:{}};if(r.opt.xmlns){o.ns=i.ns}r.attribList.length=0;emitNode(r,"onopentagstart",o)}function qname(r,i){var o=r.indexOf(":");var a=o<0?["",r]:r.split(":");var l=a[0];var c=a[1];if(i&&r==="xmlns"){l="xmlns";c=""}return{prefix:l,local:c}}function attrib(r){if(!r.strict){r.attribName=r.attribName[r.looseCase]()}if(r.attribList.indexOf(r.attribName)!==-1||r.tag.attributes.hasOwnProperty(r.attribName)){r.attribName=r.attribValue="";return}if(r.opt.xmlns){var i=qname(r.attribName,true);var o=i.prefix;var a=i.local;if(o==="xmlns"){if(a==="xml"&&r.attribValue!==h){strictFail(r,"xml: prefix must be bound to "+h+"\n"+"Actual: "+r.attribValue)}else if(a==="xmlns"&&r.attribValue!==d){strictFail(r,"xmlns: prefix must be bound to "+d+"\n"+"Actual: "+r.attribValue)}else{var l=r.tag;var c=r.tags[r.tags.length-1]||r;if(l.ns===c.ns){l.ns=Object.create(c.ns)}l.ns[a]=r.attribValue}}r.attribList.push([r.attribName,r.attribValue])}else{r.tag.attributes[r.attribName]=r.attribValue;emitNode(r,"onattribute",{name:r.attribName,value:r.attribValue})}r.attribName=r.attribValue=""}function openTag(r,i){if(r.opt.xmlns){var o=r.tag;var a=qname(r.tagName);o.prefix=a.prefix;o.local=a.local;o.uri=o.ns[a.prefix]||"";if(o.prefix&&!o.uri){strictFail(r,"Unbound namespace prefix: "+JSON.stringify(r.tagName));o.uri=a.prefix}var l=r.tags[r.tags.length-1]||r;if(o.ns&&l.ns!==o.ns){Object.keys(o.ns).forEach((function(i){emitNode(r,"onopennamespace",{prefix:i,uri:o.ns[i]})}))}for(var c=0,u=r.attribList.length;c<u;c++){var h=r.attribList[c];var d=h[0];var p=h[1];var g=qname(d,true);var y=g.prefix;var w=g.local;var b=y===""?"":o.ns[y]||"";var E={name:d,value:p,prefix:y,local:w,uri:b};if(y&&y!=="xmlns"&&!b){strictFail(r,"Unbound namespace prefix: "+JSON.stringify(y));E.uri=y}r.tag.attributes[d]=E;emitNode(r,"onattribute",E)}r.attribList.length=0}r.tag.isSelfClosing=!!i;r.sawRoot=true;r.tags.push(r.tag);emitNode(r,"onopentag",r.tag);if(!i){if(!r.noscript&&r.tagName.toLowerCase()==="script"){r.state=v.SCRIPT}else{r.state=v.TEXT}r.tag=null;r.tagName=""}r.attribName=r.attribValue="";r.attribList.length=0}function closeTag(r){if(!r.tagName){strictFail(r,"Weird empty close tag.");r.textNode+="</>";r.state=v.TEXT;return}if(r.script){if(r.tagName!=="script"){r.script+="</"+r.tagName+">";r.tagName="";r.state=v.SCRIPT;return}emitNode(r,"onscript",r.script);r.script=""}var i=r.tags.length;var o=r.tagName;if(!r.strict){o=o[r.looseCase]()}var a=o;while(i--){var l=r.tags[i];if(l.name!==a){strictFail(r,"Unexpected close tag")}else{break}}if(i<0){strictFail(r,"Unmatched closing tag: "+r.tagName);r.textNode+="</"+r.tagName+">";r.state=v.TEXT;return}r.tagName=o;var c=r.tags.length;while(c-- >i){var u=r.tag=r.tags.pop();r.tagName=r.tag.name;emitNode(r,"onclosetag",r.tagName);var h={};for(var d in u.ns){h[d]=u.ns[d]}var p=r.tags[r.tags.length-1]||r;if(r.opt.xmlns&&u.ns!==p.ns){Object.keys(u.ns).forEach((function(i){var o=u.ns[i];emitNode(r,"onclosenamespace",{prefix:i,uri:o})}))}}if(i===0)r.closedRoot=true;r.tagName=r.attribValue=r.attribName="";r.attribList.length=0;r.state=v.TEXT}function parseEntity(r){var i=r.entity;var o=i.toLowerCase();var a;var l="";if(r.ENTITIES[i]){return r.ENTITIES[i]}if(r.ENTITIES[o]){return r.ENTITIES[o]}i=o;if(i.charAt(0)==="#"){if(i.charAt(1)==="x"){i=i.slice(2);a=parseInt(i,16);l=a.toString(16)}else{i=i.slice(1);a=parseInt(i,10);l=a.toString(10)}}i=i.replace(/^0+/,"");if(isNaN(a)||l.toLowerCase()!==i){strictFail(r,"Invalid character entity");return"&"+r.entity+";"}return String.fromCodePoint(a)}function beginWhiteSpace(r,i){if(i==="<"){r.state=v.OPEN_WAKA;r.startTagPosition=r.position}else if(!isWhitespace(i)){strictFail(r,"Non-whitespace before first tag.");r.textNode=i;r.state=v.TEXT}}function charAt(r,i){var o="";if(i<r.length){o=r.charAt(i)}return o}function write(r){var i=this;if(this.error){throw this.error}if(i.closed){return error(i,"Cannot write after close. Assign an onready handler.")}if(r===null){return end(i)}if(typeof r==="object"){r=r.toString()}var o=0;var a="";while(true){a=charAt(r,o++);i.c=a;if(!a){break}if(i.trackPosition){i.position++;if(a==="\n"){i.line++;i.column=0}else{i.column++}}switch(i.state){case v.BEGIN:i.state=v.BEGIN_WHITESPACE;if(a==="\ufeff"){continue}beginWhiteSpace(i,a);continue;case v.BEGIN_WHITESPACE:beginWhiteSpace(i,a);continue;case v.TEXT:if(i.sawRoot&&!i.closedRoot){var l=o-1;while(a&&a!=="<"&&a!=="&"){a=charAt(r,o++);if(a&&i.trackPosition){i.position++;if(a==="\n"){i.line++;i.column=0}else{i.column++}}}i.textNode+=r.substring(l,o-1)}if(a==="<"&&!(i.sawRoot&&i.closedRoot&&!i.strict)){i.state=v.OPEN_WAKA;i.startTagPosition=i.position}else{if(!isWhitespace(a)&&(!i.sawRoot||i.closedRoot)){strictFail(i,"Text data outside of root node.")}if(a==="&"){i.state=v.TEXT_ENTITY}else{i.textNode+=a}}continue;case v.SCRIPT:if(a==="<"){i.state=v.SCRIPT_ENDING}else{i.script+=a}continue;case v.SCRIPT_ENDING:if(a==="/"){i.state=v.CLOSE_TAG}else{i.script+="<"+a;i.state=v.SCRIPT}continue;case v.OPEN_WAKA:if(a==="!"){i.state=v.SGML_DECL;i.sgmlDecl=""}else if(isWhitespace(a)){}else if(isMatch(g,a)){i.state=v.OPEN_TAG;i.tagName=a}else if(a==="/"){i.state=v.CLOSE_TAG;i.tagName=""}else if(a==="?"){i.state=v.PROC_INST;i.procInstName=i.procInstBody=""}else{strictFail(i,"Unencoded <");if(i.startTagPosition+1<i.position){var h=i.position-i.startTagPosition;a=new Array(h).join(" ")+a}i.textNode+="<"+a;i.state=v.TEXT}continue;case v.SGML_DECL:if((i.sgmlDecl+a).toUpperCase()===c){emitNode(i,"onopencdata");i.state=v.CDATA;i.sgmlDecl="";i.cdata=""}else if(i.sgmlDecl+a==="--"){i.state=v.COMMENT;i.comment="";i.sgmlDecl=""}else if((i.sgmlDecl+a).toUpperCase()===u){i.state=v.DOCTYPE;if(i.doctype||i.sawRoot){strictFail(i,"Inappropriately located doctype declaration")}i.doctype="";i.sgmlDecl=""}else if(a===">"){emitNode(i,"onsgmldeclaration",i.sgmlDecl);i.sgmlDecl="";i.state=v.TEXT}else if(isQuote(a)){i.state=v.SGML_DECL_QUOTED;i.sgmlDecl+=a}else{i.sgmlDecl+=a}continue;case v.SGML_DECL_QUOTED:if(a===i.q){i.state=v.SGML_DECL;i.q=""}i.sgmlDecl+=a;continue;case v.DOCTYPE:if(a===">"){i.state=v.TEXT;emitNode(i,"ondoctype",i.doctype);i.doctype=true}else{i.doctype+=a;if(a==="["){i.state=v.DOCTYPE_DTD}else if(isQuote(a)){i.state=v.DOCTYPE_QUOTED;i.q=a}}continue;case v.DOCTYPE_QUOTED:i.doctype+=a;if(a===i.q){i.q="";i.state=v.DOCTYPE}continue;case v.DOCTYPE_DTD:i.doctype+=a;if(a==="]"){i.state=v.DOCTYPE}else if(isQuote(a)){i.state=v.DOCTYPE_DTD_QUOTED;i.q=a}continue;case v.DOCTYPE_DTD_QUOTED:i.doctype+=a;if(a===i.q){i.state=v.DOCTYPE_DTD;i.q=""}continue;case v.COMMENT:if(a==="-"){i.state=v.COMMENT_ENDING}else{i.comment+=a}continue;case v.COMMENT_ENDING:if(a==="-"){i.state=v.COMMENT_ENDED;i.comment=textopts(i.opt,i.comment);if(i.comment){emitNode(i,"oncomment",i.comment)}i.comment=""}else{i.comment+="-"+a;i.state=v.COMMENT}continue;case v.COMMENT_ENDED:if(a!==">"){strictFail(i,"Malformed comment");i.comment+="--"+a;i.state=v.COMMENT}else{i.state=v.TEXT}continue;case v.CDATA:if(a==="]"){i.state=v.CDATA_ENDING}else{i.cdata+=a}continue;case v.CDATA_ENDING:if(a==="]"){i.state=v.CDATA_ENDING_2}else{i.cdata+="]"+a;i.state=v.CDATA}continue;case v.CDATA_ENDING_2:if(a===">"){if(i.cdata){emitNode(i,"oncdata",i.cdata)}emitNode(i,"onclosecdata");i.cdata="";i.state=v.TEXT}else if(a==="]"){i.cdata+="]"}else{i.cdata+="]]"+a;i.state=v.CDATA}continue;case v.PROC_INST:if(a==="?"){i.state=v.PROC_INST_ENDING}else if(isWhitespace(a)){i.state=v.PROC_INST_BODY}else{i.procInstName+=a}continue;case v.PROC_INST_BODY:if(!i.procInstBody&&isWhitespace(a)){continue}else if(a==="?"){i.state=v.PROC_INST_ENDING}else{i.procInstBody+=a}continue;case v.PROC_INST_ENDING:if(a===">"){emitNode(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody});i.procInstName=i.procInstBody="";i.state=v.TEXT}else{i.procInstBody+="?"+a;i.state=v.PROC_INST_BODY}continue;case v.OPEN_TAG:if(isMatch(y,a)){i.tagName+=a}else{newTag(i);if(a===">"){openTag(i)}else if(a==="/"){i.state=v.OPEN_TAG_SLASH}else{if(!isWhitespace(a)){strictFail(i,"Invalid character in tag name")}i.state=v.ATTRIB}}continue;case v.OPEN_TAG_SLASH:if(a===">"){openTag(i,true);closeTag(i)}else{strictFail(i,"Forward-slash in opening tag not followed by >");i.state=v.ATTRIB}continue;case v.ATTRIB:if(isWhitespace(a)){continue}else if(a===">"){openTag(i)}else if(a==="/"){i.state=v.OPEN_TAG_SLASH}else if(isMatch(g,a)){i.attribName=a;i.attribValue="";i.state=v.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case v.ATTRIB_NAME:if(a==="="){i.state=v.ATTRIB_VALUE}else if(a===">"){strictFail(i,"Attribute without value");i.attribValue=i.attribName;attrib(i);openTag(i)}else if(isWhitespace(a)){i.state=v.ATTRIB_NAME_SAW_WHITE}else if(isMatch(y,a)){i.attribName+=a}else{strictFail(i,"Invalid attribute name")}continue;case v.ATTRIB_NAME_SAW_WHITE:if(a==="="){i.state=v.ATTRIB_VALUE}else if(isWhitespace(a)){continue}else{strictFail(i,"Attribute without value");i.tag.attributes[i.attribName]="";i.attribValue="";emitNode(i,"onattribute",{name:i.attribName,value:""});i.attribName="";if(a===">"){openTag(i)}else if(isMatch(g,a)){i.attribName=a;i.state=v.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name");i.state=v.ATTRIB}}continue;case v.ATTRIB_VALUE:if(isWhitespace(a)){continue}else if(isQuote(a)){i.q=a;i.state=v.ATTRIB_VALUE_QUOTED}else{strictFail(i,"Unquoted attribute value");i.state=v.ATTRIB_VALUE_UNQUOTED;i.attribValue=a}continue;case v.ATTRIB_VALUE_QUOTED:if(a!==i.q){if(a==="&"){i.state=v.ATTRIB_VALUE_ENTITY_Q}else{i.attribValue+=a}continue}attrib(i);i.q="";i.state=v.ATTRIB_VALUE_CLOSED;continue;case v.ATTRIB_VALUE_CLOSED:if(isWhitespace(a)){i.state=v.ATTRIB}else if(a===">"){openTag(i)}else if(a==="/"){i.state=v.OPEN_TAG_SLASH}else if(isMatch(g,a)){strictFail(i,"No whitespace between attributes");i.attribName=a;i.attribValue="";i.state=v.ATTRIB_NAME}else{strictFail(i,"Invalid attribute name")}continue;case v.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(a)){if(a==="&"){i.state=v.ATTRIB_VALUE_ENTITY_U}else{i.attribValue+=a}continue}attrib(i);if(a===">"){openTag(i)}else{i.state=v.ATTRIB}continue;case v.CLOSE_TAG:if(!i.tagName){if(isWhitespace(a)){continue}else if(notMatch(g,a)){if(i.script){i.script+="</"+a;i.state=v.SCRIPT}else{strictFail(i,"Invalid tagname in closing tag.")}}else{i.tagName=a}}else if(a===">"){closeTag(i)}else if(isMatch(y,a)){i.tagName+=a}else if(i.script){i.script+="</"+i.tagName;i.tagName="";i.state=v.SCRIPT}else{if(!isWhitespace(a)){strictFail(i,"Invalid tagname in closing tag")}i.state=v.CLOSE_TAG_SAW_WHITE}continue;case v.CLOSE_TAG_SAW_WHITE:if(isWhitespace(a)){continue}if(a===">"){closeTag(i)}else{strictFail(i,"Invalid characters in closing tag")}continue;case v.TEXT_ENTITY:case v.ATTRIB_VALUE_ENTITY_Q:case v.ATTRIB_VALUE_ENTITY_U:var d;var p;switch(i.state){case v.TEXT_ENTITY:d=v.TEXT;p="textNode";break;case v.ATTRIB_VALUE_ENTITY_Q:d=v.ATTRIB_VALUE_QUOTED;p="attribValue";break;case v.ATTRIB_VALUE_ENTITY_U:d=v.ATTRIB_VALUE_UNQUOTED;p="attribValue";break}if(a===";"){i[p]+=parseEntity(i);i.entity="";i.state=d}else if(isMatch(i.entity.length?b:w,a)){i.entity+=a}else{strictFail(i,"Invalid character in entity name");i[p]+="&"+i.entity+a;i.entity="";i.state=d}continue;default:throw new Error(i,"Unknown state: "+i.state)}}if(i.position>=i.bufferCheckPosition){checkBufferLength(i)}return i}
30
- /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var o=16384;var a=[];var l;var c;var u=-1;var h=arguments.length;if(!h){return""}var d="";while(++u<h){var p=Number(arguments[u]);if(!isFinite(p)||p<0||p>1114111||i(p)!==p){throw RangeError("Invalid code point: "+p)}if(p<=65535){a.push(p)}else{p-=65536;l=(p>>10)+55296;c=p%1024+56320;a.push(l,c)}if(u+1===h||a.length>o){d+=r.apply(null,a);a.length=0}}return d};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},4970:(r,i,o)=>{"use strict";const a=o(1504);r.exports=(r="")=>{const i=r.match(a);if(!i){return null}const[o,l]=i[0].replace(/#! ?/,"").split(" ");const c=o.split("/").pop();if(c==="env"){return l}return l?`${c} ${l}`:c}},1504:r=>{"use strict";r.exports=/^#!(.*)/},332:r=>{"use strict";const i="";const o=`${i}[`;const a="";const l={to(r,i){if(!i)return`${o}${r+1}G`;return`${o}${i+1};${r+1}H`},move(r,i){let a="";if(r<0)a+=`${o}${-r}D`;else if(r>0)a+=`${o}${r}C`;if(i<0)a+=`${o}${-i}A`;else if(i>0)a+=`${o}${i}B`;return a},up:(r=1)=>`${o}${r}A`,down:(r=1)=>`${o}${r}B`,forward:(r=1)=>`${o}${r}C`,backward:(r=1)=>`${o}${r}D`,nextLine:(r=1)=>`${o}E`.repeat(r),prevLine:(r=1)=>`${o}F`.repeat(r),left:`${o}G`,hide:`${o}?25l`,show:`${o}?25h`,save:`${i}7`,restore:`${i}8`};const c={up:(r=1)=>`${o}S`.repeat(r),down:(r=1)=>`${o}T`.repeat(r)};const u={screen:`${o}2J`,up:(r=1)=>`${o}1J`.repeat(r),down:(r=1)=>`${o}J`.repeat(r),line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,lines(r){let i="";for(let o=0;o<r;o++)i+=this.line+(o<r-1?l.up():"");if(r)i+=l.left;return i}};r.exports={cursor:l,scroll:c,erase:u,beep:a}},395:(r,i,o)=>{"use strict";const a=o(2037);const l=o(6224);const c=o(6738);const{env:u}=process;let h;if(c("no-color")||c("no-colors")||c("color=false")||c("color=never")){h=0}else if(c("color")||c("colors")||c("color=true")||c("color=always")){h=1}if("FORCE_COLOR"in u){if(u.FORCE_COLOR==="true"){h=1}else if(u.FORCE_COLOR==="false"){h=0}else{h=u.FORCE_COLOR.length===0?1:Math.min(parseInt(u.FORCE_COLOR,10),3)}}function translateLevel(r){if(r===0){return false}return{level:r,hasBasic:true,has256:r>=2,has16m:r>=3}}function supportsColor(r,i){if(h===0){return 0}if(c("color=16m")||c("color=full")||c("color=truecolor")){return 3}if(c("color=256")){return 2}if(r&&!i&&h===undefined){return 0}const o=h||0;if(u.TERM==="dumb"){return o}if(process.platform==="win32"){const r=a.release().split(".");if(Number(r[0])>=10&&Number(r[2])>=10586){return Number(r[2])>=14931?3:2}return 1}if("CI"in u){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((r=>r in u))||u.CI_NAME==="codeship"){return 1}return o}if("TEAMCITY_VERSION"in u){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0}if(u.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in u){const r=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(u.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)){return 1}if("COLORTERM"in u){return 1}return o}function getSupportLevel(r){const i=supportsColor(r,r&&r.isTTY);return translateLevel(i)}r.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,l.isatty(1))),stderr:translateLevel(supportsColor(true,l.isatty(2)))}},5418:(r,i,o)=>{const{URL:a}=o(7310);const{join:l}=o(1017);const c=o(7147);const{promisify:u}=o(3837);const{tmpdir:h}=o(2037);const d=o(2447);const p=u(c.writeFile);const g=u(c.mkdir);const y=u(c.readFile);const compareVersions=(r,i)=>r.localeCompare(i,"en-US",{numeric:true});const encode=r=>encodeURIComponent(r).replace(/^%40/,"@");const getFile=async(r,i)=>{const o=h();const a=l(o,"update-check");if(!c.existsSync(a)){await g(a)}let u=`${r.name}-${i}.json`;if(r.scope){u=`${r.scope}-${u}`}return l(a,u)};const evaluateCache=async(r,i,o)=>{if(c.existsSync(r)){const a=await y(r,"utf8");const{lastUpdate:l,latest:c}=JSON.parse(a);const u=l+o;if(u>i){return{shouldCheck:false,latest:c}}}return{shouldCheck:true,latest:null}};const updateCache=async(r,i,o)=>{const a=JSON.stringify({latest:i,lastUpdate:o});await p(r,a,"utf8")};const loadPackage=(r,i)=>new Promise(((a,l)=>{const c={host:r.hostname,path:r.pathname,port:r.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(i){c.headers.authorization=`${i.type} ${i.token}`}const{get:u}=o(r.protocol==="https:"?5687:3685);u(c,(r=>{const{statusCode:i}=r;if(i!==200){const o=new Error(`Request failed with code ${i}`);o.code=i;l(o);r.resume();return}let o="";r.setEncoding("utf8");r.on("data",(r=>{o+=r}));r.on("end",(()=>{try{const r=JSON.parse(o);a(r)}catch(r){l(r)}}))})).on("error",l).on("timeout",l)}));const getMostRecent=async({full:r,scope:i},l)=>{const c=d(i);const u=new a(r,c);let h=null;try{h=await loadPackage(u)}catch(r){if(r.code&&String(r.code).startsWith(4)){const r=o(1384);const i=r(c,{recursive:true});h=await loadPackage(u,i)}else{throw r}}const p=h["dist-tags"][l];if(!p){throw new Error(`Distribution tag ${l} is not available`)}return p};const w={interval:36e5,distTag:"latest"};const getDetails=r=>{const i={full:encode(r)};if(r.includes("/")){const o=r.split("/");i.scope=o[0];i.name=o[1]}else{i.scope=null;i.name=r}return i};r.exports=async(r,i)=>{if(typeof r!=="object"){throw new Error("The first parameter should be your package.json file content")}const o=getDetails(r.name);const a=Date.now();const{distTag:l,interval:c}=Object.assign({},w,i);const u=await getFile(o,l);let h=null;let d=true;({shouldCheck:d,latest:h}=await evaluateCache(u,a,c));if(d){h=await getMostRecent(o,l);await updateCache(u,h,a)}const p=compareVersions(r.version,h);if(p===-1){return{latest:h,fromCache:!d}}return null}},4604:function(r,i){(function(){"use strict";i.stripBOM=function(r){if(r[0]==="\ufeff"){return r.substring(1)}else{return r}}}).call(this)},1002:function(r,i,o){(function(){"use strict";var r,a,l,c,u,h={}.hasOwnProperty;r=o(3131);a=o(9498).defaults;c=function(r){return typeof r==="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)};u=function(r){return"<![CDATA["+l(r)+"]]>"};l=function(r){return r.replace("]]>","]]]]><![CDATA[>")};i.Builder=function(){function Builder(r){var i,o,l;this.options={};o=a["0.2"];for(i in o){if(!h.call(o,i))continue;l=o[i];this.options[i]=l}for(i in r){if(!h.call(r,i))continue;l=r[i];this.options[i]=l}}Builder.prototype.buildObject=function(i){var o,l,d,p,g;o=this.options.attrkey;l=this.options.charkey;if(Object.keys(i).length===1&&this.options.rootName===a["0.2"].rootName){g=Object.keys(i)[0];i=i[g]}else{g=this.options.rootName}d=function(r){return function(i,a){var p,g,y,w,b,v;if(typeof a!=="object"){if(r.options.cdata&&c(a)){i.raw(u(a))}else{i.txt(a)}}else if(Array.isArray(a)){for(w in a){if(!h.call(a,w))continue;g=a[w];for(b in g){y=g[b];i=d(i.ele(b),y).up()}}}else{for(b in a){if(!h.call(a,b))continue;g=a[b];if(b===o){if(typeof g==="object"){for(p in g){v=g[p];i=i.att(p,v)}}}else if(b===l){if(r.options.cdata&&c(g)){i=i.raw(u(g))}else{i=i.txt(g)}}else if(Array.isArray(g)){for(w in g){if(!h.call(g,w))continue;y=g[w];if(typeof y==="string"){if(r.options.cdata&&c(y)){i=i.ele(b).raw(u(y)).up()}else{i=i.ele(b,y).up()}}else{i=d(i.ele(b),y).up()}}}else if(typeof g==="object"){i=d(i.ele(b),g).up()}else{if(typeof g==="string"&&r.options.cdata&&c(g)){i=i.ele(b).raw(u(g)).up()}else{if(g==null){g=""}i=i.ele(b,g.toString()).up()}}}}return i}}(this);p=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return d(p,i).end(this.options.renderOpts)};return Builder}()}).call(this)},9498:function(r,i){(function(){i.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},7426:function(r,i,o){(function(){"use strict";var r,a,l,c,u,h,d,p,g,bind=function(r,i){return function(){return r.apply(i,arguments)}},extend=function(r,i){for(var o in i){if(y.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},y={}.hasOwnProperty;p=o(9746);l=o(2361);r=o(4604);d=o(9068);g=o(9512).setImmediate;a=o(9498).defaults;c=function(r){return typeof r==="object"&&r!=null&&Object.keys(r).length===0};u=function(r){return r!=="__proto__"&&r!=="constructor"&&r!=="prototype"};h=function(r,i,o){var a,l,c;for(a=0,l=r.length;a<l;a++){c=r[a];i=c(i,o)}return i};i.Parser=function(o){extend(Parser,o);function Parser(r){this.parseStringPromise=bind(this.parseStringPromise,this);this.parseString=bind(this.parseString,this);this.reset=bind(this.reset,this);this.assignOrPush=bind(this.assignOrPush,this);this.processAsync=bind(this.processAsync,this);var o,l,c;if(!(this instanceof i.Parser)){return new i.Parser(r)}this.options={};l=a["0.2"];for(o in l){if(!y.call(l,o))continue;c=l[o];this.options[o]=c}for(o in r){if(!y.call(r,o))continue;c=r[o];this.options[o]=c}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(d.normalize)}this.reset()}Parser.prototype.processAsync=function(){var r,i;try{if(this.remaining.length<=this.options.chunkSize){r=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(r);return this.saxParser.close()}else{r=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(r);return g(this.processAsync)}}catch(r){i=r;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(i)}}};Parser.prototype.assignOrPush=function(r,i,o){if(!u(i)){return}if(!(i in r)){if(!this.options.explicitArray){return r[i]=o}else{return r[i]=[o]}}else{if(!(r[i]instanceof Array)){r[i]=[r[i]]}return r[i].push(o)}};Parser.prototype.reset=function(){var r,i,o,a;this.removeAllListeners();this.saxParser=p.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(r){return function(i){r.saxParser.resume();if(!r.saxParser.errThrown){r.saxParser.errThrown=true;return r.emit("error",i)}}}(this);this.saxParser.onend=function(r){return function(){if(!r.saxParser.ended){r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;a=[];r=this.options.attrkey;i=this.options.charkey;this.saxParser.onopentag=function(o){return function(l){var c,d,p,g,w;p={};p[i]="";if(!o.options.ignoreAttrs){w=l.attributes;for(c in w){if(!y.call(w,c))continue;if(!(r in p)&&!o.options.mergeAttrs){p[r]={}}d=o.options.attrValueProcessors?h(o.options.attrValueProcessors,l.attributes[c],c):l.attributes[c];g=o.options.attrNameProcessors?h(o.options.attrNameProcessors,c):c;if(u(g)){if(o.options.mergeAttrs){o.assignOrPush(p,g,d)}else{p[r][g]=d}}}}p["#name"]=o.options.tagNameProcessors?h(o.options.tagNameProcessors,l.name):l.name;if(o.options.xmlns){p[o.options.xmlnskey]={uri:l.uri,local:l.local}}return a.push(p)}}(this);this.saxParser.onclosetag=function(r){return function(){var o,l,d,p,g,w,b,v,E,x;w=a.pop();g=w["#name"];if(!r.options.explicitChildren||!r.options.preserveChildrenOrder){delete w["#name"]}if(w.cdata===true){o=w.cdata;delete w.cdata}E=a[a.length-1];if(w[i].match(/^\s*$/)&&!o){l=w[i];delete w[i]}else{if(r.options.trim){w[i]=w[i].trim()}if(r.options.normalize){w[i]=w[i].replace(/\s{2,}/g," ").trim()}w[i]=r.options.valueProcessors?h(r.options.valueProcessors,w[i],g):w[i];if(Object.keys(w).length===1&&i in w&&!r.EXPLICIT_CHARKEY){w=w[i]}}if(c(w)){if(typeof r.options.emptyTag==="function"){w=r.options.emptyTag()}else{w=r.options.emptyTag!==""?r.options.emptyTag:l}}if(r.options.validator!=null){x="/"+function(){var r,i,o;o=[];for(r=0,i=a.length;r<i;r++){p=a[r];o.push(p["#name"])}return o}().concat(g).join("/");(function(){var i;try{return w=r.options.validator(x,E&&E[g],w)}catch(o){i=o;return r.emit("error",i)}})()}if(r.options.explicitChildren&&!r.options.mergeAttrs&&typeof w==="object"){if(!r.options.preserveChildrenOrder){p={};if(r.options.attrkey in w){p[r.options.attrkey]=w[r.options.attrkey];delete w[r.options.attrkey]}if(!r.options.charsAsChildren&&r.options.charkey in w){p[r.options.charkey]=w[r.options.charkey];delete w[r.options.charkey]}if(Object.getOwnPropertyNames(w).length>0){p[r.options.childkey]=w}w=p}else if(E){E[r.options.childkey]=E[r.options.childkey]||[];b={};for(d in w){if(!y.call(w,d))continue;if(u(d)){b[d]=w[d]}}E[r.options.childkey].push(b);delete w["#name"];if(Object.keys(w).length===1&&i in w&&!r.EXPLICIT_CHARKEY){w=w[i]}}}if(a.length>0){return r.assignOrPush(E,g,w)}else{if(r.options.explicitRoot){v=w;w={};w[g]=v}r.resultObject=w;r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);o=function(r){return function(o){var l,c;c=a[a.length-1];if(c){c[i]+=o;if(r.options.explicitChildren&&r.options.preserveChildrenOrder&&r.options.charsAsChildren&&(r.options.includeWhiteChars||o.replace(/\\n/g,"").trim()!=="")){c[r.options.childkey]=c[r.options.childkey]||[];l={"#name":"__text__"};l[i]=o;if(r.options.normalize){l[i]=l[i].replace(/\s{2,}/g," ").trim()}c[r.options.childkey].push(l)}return c}}}(this);this.saxParser.ontext=o;return this.saxParser.oncdata=function(r){return function(r){var i;i=o(r);if(i){return i.cdata=true}}}(this)};Parser.prototype.parseString=function(i,o){var a;if(o!=null&&typeof o==="function"){this.on("end",(function(r){this.reset();return o(null,r)}));this.on("error",(function(r){this.reset();return o(r)}))}try{i=i.toString();if(i.trim()===""){this.emit("end",null);return true}i=r.stripBOM(i);if(this.options.async){this.remaining=i;g(this.processAsync);return this.saxParser}return this.saxParser.write(i).close()}catch(r){a=r;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",a);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw a}}};Parser.prototype.parseStringPromise=function(r){return new Promise(function(i){return function(o,a){return i.parseString(r,(function(r,i){if(r){return a(r)}else{return o(i)}}))}}(this))};return Parser}(l);i.parseString=function(r,o,a){var l,c,u;if(a!=null){if(typeof a==="function"){l=a}if(typeof o==="object"){c=o}}else{if(typeof o==="function"){l=o}c={}}u=new i.Parser(c);return u.parseString(r,l)};i.parseStringPromise=function(r,o){var a,l;if(typeof o==="object"){a=o}l=new i.Parser(a);return l.parseStringPromise(r)}}).call(this)},9068:function(r,i){(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/);i.normalize=function(r){return r.toLowerCase()};i.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)};i.stripPrefix=function(i){return i.replace(r,"")};i.parseNumbers=function(r){if(!isNaN(r)){r=r%1===0?parseInt(r,10):parseFloat(r)}return r};i.parseBooleans=function(r){if(/^(?:true|false)$/i.test(r)){r=r.toLowerCase()==="true"}return r}}).call(this)},7013:function(r,i,o){(function(){"use strict";var r,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;a=o(9498);r=o(1002);l=o(7426);c=o(9068);i.defaults=a.defaults;i.processors=c;i.ValidationError=function(r){extend(ValidationError,r);function ValidationError(r){this.message=r}return ValidationError}(Error);i.Builder=r.Builder;i.Parser=l.Parser;i.parseString=l.parseString;i.parseStringPromise=l.parseStringPromise}).call(this)},2346:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},4128:function(r){(function(){r.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},2629:function(r){(function(){var i,o,a,l,c,u,h,d=[].slice,p={}.hasOwnProperty;i=function(){var r,i,o,a,l,u;u=arguments[0],l=2<=arguments.length?d.call(arguments,1):[];if(c(Object.assign)){Object.assign.apply(null,arguments)}else{for(r=0,o=l.length;r<o;r++){a=l[r];if(a!=null){for(i in a){if(!p.call(a,i))continue;u[i]=a[i]}}}}return u};c=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};u=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(c(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!p.call(r,i))continue;return false}return true}};h=function(r){var i,o;return u(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(c(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=c;r.exports.isObject=u;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},8413:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},9525:function(r,i,o){(function(){var i,a,l;i=o(4128);l=o(8064);r.exports=a=function(){function XMLAttribute(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))};XMLAttribute.prototype.debugInfo=function(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},6789:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);l=o(3527);r.exports=a=function(r){extend(XMLCData,r);function XMLCData(r,o){XMLCData.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))};return XMLCData}(l)}).call(this)},3527:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8064);r.exports=i=function(r){extend(XMLCharacterData,r);function XMLCharacterData(r){XMLCharacterData.__super__.constructor.call(this,r);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(r){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.data!==this.data){return false}return true};return XMLCharacterData}(a)}).call(this)},4593:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLComment,r);function XMLComment(r,o){XMLComment.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))};return XMLComment}(a)}).call(this)},4196:function(r,i,o){(function(){var i,a,l;a=o(7850);l=o(5132);r.exports=i=function(){function XMLDOMConfiguration(){var r;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new a,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=r=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(r,i){return true};XMLDOMConfiguration.prototype.setParameter=function(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}};return XMLDOMConfiguration}()}).call(this)},7850:function(r){(function(){var i;r.exports=i=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(r){throw new Error(r)};return XMLDOMErrorHandler}()}).call(this)},9490:function(r){(function(){var i;r.exports=i=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(r,i){return true};XMLDOMImplementation.prototype.createDocumentType=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},5132:function(r){(function(){var i;r.exports=i=function(){function XMLDOMStringList(r){this.arr=r||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(r){return this.arr[r]||null};XMLDOMStringList.prototype.contains=function(r){return this.arr.indexOf(r)!==-1};return XMLDOMStringList}()}).call(this)},1066:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDAttList,r);function XMLDTDAttList(r,o,a,l,c,u){XMLDTDAttList.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!c){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(c.indexOf("#")!==0){c="#"+c}if(!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(u&&!c.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(u){this.defaultValue=this.stringify.dtdAttDefault(u)}this.defaultValueType=c}XMLDTDAttList.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))};return XMLDTDAttList}(l)}).call(this)},3584:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDElement,r);function XMLDTDElement(r,o,a){XMLDTDElement.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!a){a="(#PCDATA)"}if(Array.isArray(a)){a="("+a.join(",")+")"}this.name=this.stringify.name(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}XMLDTDElement.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))};return XMLDTDElement}(l)}).call(this)},9346:function(r,i,o){(function(){var i,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;c=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDEntity,r);function XMLDTDEntity(r,o,a,l){XMLDTDEntity.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!c(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))};return XMLDTDEntity}(l)}).call(this)},853:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDNotation,r);function XMLDTDNotation(r,o,a){XMLDTDNotation.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))};return XMLDTDNotation}(l)}).call(this)},4972:function(r,i,o){(function(){var i,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;c=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDeclaration,r);function XMLDeclaration(r,o,a,l){var u;XMLDeclaration.__super__.constructor.call(this,r);if(c(o)){u=o,o=u.version,a=u.encoding,l=u.standalone}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}XMLDeclaration.prototype.toString=function(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))};return XMLDeclaration}(l)}).call(this)},9025:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,extend=function(r,i){for(var o in i){if(y.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},y={}.hasOwnProperty;g=o(2629).isObject;p=o(8064);i=o(4128);a=o(1066);c=o(9346);l=o(3584);u=o(853);d=o(8339);r.exports=h=function(r){extend(XMLDocType,r);function XMLDocType(r,o,a){var l,c,u,h,d,p;XMLDocType.__super__.constructor.call(this,r);this.type=i.DocType;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(g(o)){d=o,o=d.pubID,a=d.sysID}if(a==null){p=[o,a],a=p[0],o=p[1]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(r,i){var o;o=new l(this,r,i);this.children.push(o);return this};XMLDocType.prototype.attList=function(r,i,o,l,c){var u;u=new a(this,r,i,o,l,c);this.children.push(u);return this};XMLDocType.prototype.entity=function(r,i){var o;o=new c(this,false,r,i);this.children.push(o);return this};XMLDocType.prototype.pEntity=function(r,i){var o;o=new c(this,true,r,i);this.children.push(o);return this};XMLDocType.prototype.notation=function(r,i){var o;o=new u(this,r,i);this.children.push(o);return this};XMLDocType.prototype.toString=function(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))};XMLDocType.prototype.ele=function(r,i){return this.element(r,i)};XMLDocType.prototype.att=function(r,i,o,a,l){return this.attList(r,i,o,a,l)};XMLDocType.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocType.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocType.prototype.not=function(r,i){return this.notation(r,i)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(r){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true};return XMLDocType}(p)}).call(this)},3315:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;p=o(2629).isPlainObject;l=o(9490);a=o(4196);u=o(8064);i=o(4128);d=o(916);h=o(6939);r.exports=c=function(r){extend(XMLDocument,r);function XMLDocument(r){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))};XMLDocument.prototype.toString=function(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))};XMLDocument.prototype.createElement=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(u)}).call(this)},1523:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S,A,N,_,C,L={}.hasOwnProperty;C=o(2629),N=C.isObject,A=C.isFunction,_=C.isPlainObject,S=C.getValue;i=o(4128);b=o(3315);E=o(7370);c=o(6789);u=o(4593);M=o(363);T=o(8854);x=o(3234);y=o(4972);w=o(9025);h=o(1066);p=o(9346);d=o(3584);g=o(853);l=o(9525);O=o(916);D=o(6939);a=o(8413);r.exports=v=function(){function XMLDocumentCB(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(_(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new O(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(r){var o,a,l,c,u,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!L.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(u=0,h=p.length;u<h;u++){c=p[u];this.createChildNode(c);if(c.type===i.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(r,i,o){var a;if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=S(r);if(i==null){i={}}i=S(i);if(!N(i)){a=[i,o],o=a[0],i=a[1]}this.currentNode=new E(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this};XMLDocumentCB.prototype.element=function(r,o,a){var l,c,u,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(r)||N(r)||A(r)){h=this.options.noValidation;this.options.noValidation=true;p=new b(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(c=0,u=d.length;c<u;c++){l=d[c];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this};XMLDocumentCB.prototype.attribute=function(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=S(r)}if(N(r)){for(o in r){if(!L.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(A(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this};XMLDocumentCB.prototype.text=function(r){var i;this.openCurrent();i=new T(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(r){var i;this.openCurrent();i=new M(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(r,i){var o,a,l,c,u;this.openCurrent();if(r!=null){r=S(r)}if(i!=null){i=S(i)}if(Array.isArray(r)){for(o=0,c=r.length;o<c;o++){a=r[o];this.instruction(a)}}else if(N(r)){for(a in r){if(!L.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(A(i)){i=i.apply()}u=new x(this,r,i);this.onData(this.writer.processingInstruction(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new y(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new w(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(r,i,o,a,l){var c;this.openCurrent();c=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(r,i){var o;this.openCurrent();o=new g(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(r){var o,l,c,u;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;u=r.attribs;for(c in u){if(!L.call(u,c))continue;o=u[c];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}};XMLDocumentCB.prototype.onData=function(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(r){if(r==null){return""}else{return"node: <"+r+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.txt=function(r){return this.text(r)};XMLDocumentCB.prototype.dat=function(r){return this.cdata(r)};XMLDocumentCB.prototype.com=function(r){return this.comment(r)};XMLDocumentCB.prototype.ins=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLDocumentCB.prototype.dtd=function(r,i,o){return this.doctype(r,i,o)};XMLDocumentCB.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLDocumentCB.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.t=function(r){return this.text(r)};XMLDocumentCB.prototype.d=function(r){return this.cdata(r)};XMLDocumentCB.prototype.c=function(r){return this.comment(r)};XMLDocumentCB.prototype.r=function(r){return this.raw(r)};XMLDocumentCB.prototype.i=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocumentCB.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocumentCB.prototype.not=function(r,i){return this.notation(r,i)};return XMLDocumentCB}()}).call(this)},3288:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDummy,r);function XMLDummy(r){XMLDummy.__super__.constructor.call(this,r);this.type=i.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(r){return""};return XMLDummy}(l)}).call(this)},7370:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,extend=function(r,i){for(var o in i){if(y.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},y={}.hasOwnProperty;g=o(2629),p=g.isObject,d=g.isFunction,h=g.getValue;u=o(8064);i=o(4128);a=o(9525);c=o(8339);r.exports=l=function(r){extend(XMLElement,r);function XMLElement(r,o,a){var l,c,u,h;XMLElement.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.DocType){l.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new c(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!y.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o};XMLElement.prototype.attribute=function(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!y.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this};XMLElement.prototype.removeAttribute=function(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this};XMLElement.prototype.toString=function(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))};XMLElement.prototype.att=function(r,i){return this.attribute(r,i)};XMLElement.prototype.a=function(r,i){return this.attribute(r,i)};XMLElement.prototype.getAttribute=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}};XMLElement.prototype.setAttribute=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}};XMLElement.prototype.setAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(r){return this.attribs.hasOwnProperty(r)};XMLElement.prototype.hasAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}};XMLElement.prototype.setIdAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(r){var i,o,a;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true};return XMLElement}(u)}).call(this)},8339:function(r){(function(){var i;r.exports=i=function(){function XMLNamedNodeMap(r){this.nodes=r}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(r){return this.nodes[r]};XMLNamedNodeMap.prototype.setNamedItem=function(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null};XMLNamedNodeMap.prototype.removeNamedItem=function(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null};XMLNamedNodeMap.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},8064:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S={}.hasOwnProperty;T=o(2629),O=T.isObject,D=T.isFunction,M=T.isEmpty,x=T.getValue;p=null;l=null;c=null;u=null;h=null;v=null;E=null;b=null;d=null;a=null;w=null;g=null;i=null;r.exports=y=function(){function XMLNode(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(7370);l=o(6789);c=o(4593);u=o(4972);h=o(9025);v=o(363);E=o(8854);b=o(3234);d=o(3288);a=o(4128);w=o(7209);g=o(8339);i=o(2346)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new w(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,c;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){c="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){c+=r.textContent}}return c}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(r){var i,o,a,l,c;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;c=[];for(o=0,a=l.length;o<a;o++){i=l[o];c.push(i.setParent(this))}return c};XMLNode.prototype.element=function(r,i,o){var a,l,c,u,h,d,p,g,y,w,b;d=null;if(i===null&&o==null){y=[{},null],i=y[0],o=y[1]}if(i==null){i={}}i=x(i);if(!O(i)){w=[i,o],o=w[0],i=w[1]}if(r!=null){r=x(r)}if(Array.isArray(r)){for(c=0,p=r.length;c<p;c++){l=r[c];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(O(r)){for(h in r){if(!S.call(r,h))continue;b=r[h];if(D(b)){b=b.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),b)}else if(!this.options.separateArrayItems&&Array.isArray(b)&&M(b)){d=this.dummy()}else if(O(b)&&M(b)){d=this.element(h)}else if(!this.options.keepNullNodes&&b==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(b)){for(u=0,g=b.length;u<g;u++){l=b[u];a={};a[h]=l;d=this.element(a)}}else if(O(b)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(b)}else{d=this.element(h);d.element(b)}}else{d=this.element(h,b)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d};XMLNode.prototype.insertBefore=function(r,i,o){var a,l,c,u,h;if(r!=null?r.type:void 0){c=r;u=i;c.setParent(this);if(u){l=children.indexOf(u);h=children.splice(l);children.push(c);Array.prototype.push.apply(children,h)}else{children.push(c)}return c}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}};XMLNode.prototype.insertAfter=function(r,i,o){var a,l,c;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);c=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,c);return a};XMLNode.prototype.remove=function(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent};XMLNode.prototype.node=function(r,i,o){var a,l;if(r!=null){r=x(r)}i||(i={});i=x(i);if(!O(i)){l=[i,o],o=l[0],i=l[1]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a};XMLNode.prototype.text=function(r){var i;if(O(r)){this.element(r)}i=new E(this,r);this.children.push(i);return this};XMLNode.prototype.cdata=function(r){var i;i=new l(this,r);this.children.push(i);return this};XMLNode.prototype.comment=function(r){var i;i=new c(this,r);this.children.push(i);return this};XMLNode.prototype.commentBefore=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.commentAfter=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.raw=function(r){var i;i=new v(this,r);this.children.push(i);return this};XMLNode.prototype.dummy=function(){var r;r=new d(this);return r};XMLNode.prototype.instruction=function(r,i){var o,a,l,c,u;if(r!=null){r=x(r)}if(i!=null){i=x(i)}if(Array.isArray(r)){for(c=0,u=r.length;c<u;c++){o=r[c];this.instruction(o)}}else if(O(r)){for(o in r){if(!S.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new b(this,r,i);this.children.push(l)}return this};XMLNode.prototype.instructionBefore=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.instructionAfter=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.declaration=function(r,i,o){var l,c;l=this.document();c=new u(l,r,i,o);if(l.children.length===0){l.children.unshift(c)}else if(l.children[0].type===a.Declaration){l.children[0]=c}else{l.children.unshift(c)}return l.root()||l};XMLNode.prototype.dtd=function(r,i){var o,l,c,u,d,p,g,y,w,b;l=this.document();c=new h(l,r,i);w=l.children;for(u=d=0,g=w.length;d<g;u=++d){o=w[u];if(o.type===a.DocType){l.children[u]=c;return c}}b=l.children;for(u=p=0,y=b.length;p<y;u=++p){o=b[u];if(o.isRoot){l.children.splice(u,0,c);return c}}l.children.push(c);return c};XMLNode.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLNode.prototype.root=function(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}};XMLNode.prototype.document=function(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}};XMLNode.prototype.end=function(r){return this.document().end(r)};XMLNode.prototype.prev=function(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]};XMLNode.prototype.next=function(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]};XMLNode.prototype.importDocument=function(r){var i;i=r.root().clone();i.parent=this;i.isRoot=false;this.children.push(i);return this};XMLNode.prototype.debugInfo=function(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.txt=function(r){return this.text(r)};XMLNode.prototype.dat=function(r){return this.cdata(r)};XMLNode.prototype.com=function(r){return this.comment(r)};XMLNode.prototype.ins=function(r,i){return this.instruction(r,i)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLNode.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.t=function(r){return this.text(r)};XMLNode.prototype.d=function(r){return this.cdata(r)};XMLNode.prototype.c=function(r){return this.comment(r)};XMLNode.prototype.r=function(r){return this.raw(r)};XMLNode.prototype.i=function(r,i){return this.instruction(r,i)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(r){return this.importDocument(r)};XMLNode.prototype.replaceChild=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(r,i){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}};XMLNode.prototype.isSameNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true};XMLNode.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(r){if(!r){return false}return r===this||this.isDescendant(r)};XMLNode.prototype.isDescendant=function(r){var i,o,a,l,c;c=this.children;for(a=0,l=c.length;a<l;a++){i=c[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false};XMLNode.prototype.isAncestor=function(r){return r.isDescendant(this)};XMLNode.prototype.isPreceding=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}};XMLNode.prototype.isFollowing=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}};XMLNode.prototype.treePosition=function(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}};XMLNode.prototype.foreachTreeNode=function(r,i){var o,a,l,c,u;r||(r=this.document());c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];if(u=i(o)){return u}else{u=this.foreachTreeNode(o,i);if(u){return u}}}};return XMLNode}()}).call(this)},7209:function(r){(function(){var i;r.exports=i=function(){function XMLNodeList(r){this.nodes=r}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(r){return this.nodes[r]||null};return XMLNodeList}()}).call(this)},3234:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLProcessingInstruction,r);function XMLProcessingInstruction(r,o,a){XMLProcessingInstruction.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))};XMLProcessingInstruction.prototype.isEqualNode=function(r){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.target!==this.target){return false}return true};return XMLProcessingInstruction}(a)}).call(this)},363:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(8064);r.exports=l=function(r){extend(XMLRaw,r);function XMLRaw(r,o){XMLRaw.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))};return XMLRaw}(a)}).call(this)},359:function(r,i,o){(function(){var i,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);c=o(8126);a=o(8413);r.exports=l=function(r){extend(XMLStreamWriter,r);function XMLStreamWriter(r,i){this.stream=r;XMLStreamWriter.__super__.constructor.call(this,i)}XMLStreamWriter.prototype.endline=function(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,r,i,o)}};XMLStreamWriter.prototype.document=function(r,i){var o,a,l,c,u,h,d,p,g;d=r.children;for(a=l=0,u=d.length;l<u;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;g=[];for(c=0,h=p.length;c<h;c++){o=p[c];g.push(this.writeChildNode(o,i,0))}return g};XMLStreamWriter.prototype.attribute=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,r,i,o))};XMLStreamWriter.prototype.cdata=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,r,i,o))};XMLStreamWriter.prototype.comment=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,r,i,o))};XMLStreamWriter.prototype.declaration=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,r,i,o))};XMLStreamWriter.prototype.docType=function(r,i,o){var l,c,u,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)};XMLStreamWriter.prototype.element=function(r,o,l){var c,h,d,p,g,y,w,b,v,E;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;this.stream.write(this.indent(r,o,l)+"<"+r.name);v=r.attribs;for(w in v){if(!u.call(v,w))continue;c=v[w];this.attribute(c,o,l)}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw)&&p.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;b=true;this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;b=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;E=r.children;for(g=0,y=E.length;g<y;g++){h=E[g];this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)};XMLStreamWriter.prototype.processingInstruction=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,r,i,o))};XMLStreamWriter.prototype.raw=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,r,i,o))};XMLStreamWriter.prototype.text=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.text.call(this,r,i,o))};XMLStreamWriter.prototype.dtdAttList=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,r,i,o))};XMLStreamWriter.prototype.dtdElement=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,r,i,o))};XMLStreamWriter.prototype.dtdEntity=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,r,i,o))};XMLStreamWriter.prototype.dtdNotation=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,r,i,o))};return XMLStreamWriter}(c)}).call(this)},6939:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8126);r.exports=i=function(r){extend(XMLStringWriter,r);function XMLStringWriter(r){XMLStringWriter.__super__.constructor.call(this,r)}XMLStringWriter.prototype.document=function(r,i){var o,a,l,c,u;i=this.filterOptions(i);c="";u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];c+=this.writeChildNode(o,i,0)}if(i.pretty&&c.slice(-i.newline.length)===i.newline){c=c.slice(0,-i.newline.length)}return c};return XMLStringWriter}(a)}).call(this)},916:function(r){(function(){var i,bind=function(r,i){return function(){return r.apply(i,arguments)}},o={}.hasOwnProperty;r.exports=i=function(){function XMLStringifier(r){this.assertLegalName=bind(this.assertLegalName,this);this.assertLegalChar=bind(this.assertLegalChar,this);var i,a,l;r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}XMLStringifier.prototype.name=function(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")};XMLStringifier.prototype.text=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))};XMLStringifier.prototype.cdata=function(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)};XMLStringifier.prototype.comment=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.raw=function(r){if(this.options.noValidation){return r}return""+r||""};XMLStringifier.prototype.attValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))};XMLStringifier.prototype.insTarget=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.insValue=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlVersion=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r};XMLStringifier.prototype.xmlEncoding=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlStandalone=function(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdSysID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdElementValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttType=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttDefault=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdEntityValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdNData=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(r){var i,o;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}return r};XMLStringifier.prototype.assertLegalName=function(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!r.match(i)){throw new Error("Invalid character in name")}return r};XMLStringifier.prototype.textEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};XMLStringifier.prototype.attEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return XMLStringifier}()}).call(this)},8854:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLText,r);function XMLText(r,o){XMLText.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))};XMLText.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(a)}).call(this)},8126:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O={}.hasOwnProperty;D=o(2629).assign;i=o(4128);g=o(4972);y=o(9025);l=o(6789);c=o(4593);b=o(7370);E=o(363);x=o(8854);v=o(3234);w=o(3288);u=o(1066);h=o(3584);d=o(9346);p=o(853);a=o(8413);r.exports=M=function(){function XMLWriterBase(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!O.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}XMLWriterBase.prototype.filterOptions=function(r){var i,o,l,c,u,h,d,p;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(c=r.offset)!=null?c:0;i.dontPrettyTextNodes=(u=(h=r.dontPrettyTextNodes)!=null?h:r.dontprettytextnodes)!=null?u:0;i.spaceBeforeSlash=(d=(p=r.spaceBeforeSlash)!=null?p:r.spacebeforeslash)!=null?d:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i};XMLWriterBase.prototype.indent=function(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""};XMLWriterBase.prototype.endline=function(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}};XMLWriterBase.prototype.attribute=function(r,i,o){var a;this.openAttribute(r,i,o);a=" "+r.name+'="'+r.value+'"';this.closeAttribute(r,i,o);return a};XMLWriterBase.prototype.cdata=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.comment=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.declaration=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.docType=function(r,i,o){var l,c,u,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(c=0,u=d.length;c<u;c++){l=d[c];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h};XMLWriterBase.prototype.element=function(r,o,l){var c,u,h,d,p,g,y,w,b,v,E,x,M,D;l||(l=0);v=false;E="";this.openNode(r,o,l);o.state=a.OpenTag;E+=this.indent(r,o,l)+"<"+r.name;x=r.attribs;for(b in x){if(!O.call(x,b))continue;c=x[b];E+=this.attribute(c,o,l)}h=r.children.length;d=h===0?null:r.children[0];if(h===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){E+=">";o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;E+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&h===1&&(d.type===i.Text||d.type===i.Raw)&&d.value!=null){E+=">";o.state=a.InsideTag;o.suppressPrettyCount++;v=true;E+=this.writeChildNode(d,o,l+1);o.suppressPrettyCount--;v=false;o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){M=r.children;for(p=0,y=M.length;p<y;p++){u=M[p];if((u.type===i.Text||u.type===i.Raw)&&u.value!=null){o.suppressPrettyCount++;v=true;break}}}E+=">"+this.endline(r,o,l);o.state=a.InsideTag;D=r.children;for(g=0,w=D.length;g<w;g++){u=D[g];E+=this.writeChildNode(u,o,l+1)}o.state=a.CloseTag;E+=this.indent(r,o,l)+"</"+r.name+">";if(v){o.suppressPrettyCount--}E+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return E};XMLWriterBase.prototype.writeChildNode=function(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.raw=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.text=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdAttList=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdElement=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdEntity=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdNotation=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.openNode=function(r,i,o){};XMLWriterBase.prototype.closeNode=function(r,i,o){};XMLWriterBase.prototype.openAttribute=function(r,i,o){};XMLWriterBase.prototype.closeAttribute=function(r,i,o){};return XMLWriterBase}()}).call(this)},3131:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y;y=o(2629),p=y.assign,g=y.isFunction;l=o(9490);c=o(3315);u=o(1523);d=o(6939);h=o(359);i=o(4128);a=o(8413);r.exports.create=function(r,i,o,a){var l,u;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new c(a);u=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return u};r.exports.begin=function(r,i,o){var a;if(g(r)){a=[r,i],i=a[0],o=a[1];r={}}if(i){return new u(r,i,o)}else{return new c(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},144:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},7762:function(r){(function(){r.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},983:function(r){(function(){var i,o,a,l,c,u,h,d={}.hasOwnProperty;i=function(r,...i){var o,a,l,u;if(c(Object.assign)){Object.assign.apply(null,arguments)}else{for(o=0,l=i.length;o<l;o++){u=i[o];if(u!=null){for(a in u){if(!d.call(u,a))continue;r[a]=u[a]}}}}return r};c=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};u=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(c(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!d.call(r,i))continue;return false}return true}};h=function(r){var i,o;return u(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(c(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=c;r.exports.isObject=u;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},140:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},1395:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(5089);r.exports=a=function(){class XMLAttribute{constructor(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))}debugInfo(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}}isEqualNode(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true}}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});return XMLAttribute}.call(this)}).call(this)},5261:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(4765);r.exports=a=class XMLCData extends l{constructor(r,o){super(r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))}}}).call(this)},4765:function(r,i,o){(function(){var i,a;a=o(5089);r.exports=i=function(){class XMLCharacterData extends a{constructor(r){super(r);this.value=""}clone(){return Object.create(this)}substringData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.data!==this.data){return false}return true}}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});return XMLCharacterData}.call(this)}).call(this)},360:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLComment extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))}}}).call(this)},5675:function(r,i,o){(function(){var i,a,l;a=o(121);l=o(8207);r.exports=i=function(){class XMLDOMConfiguration{constructor(){var r;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new a,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=r=Object.create(this.defaultParams)}getParameter(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}}canSetParameter(r,i){return true}setParameter(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}}}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});return XMLDOMConfiguration}.call(this)}).call(this)},121:function(r){(function(){var i;r.exports=i=class XMLDOMErrorHandler{constructor(){}handleError(r){throw new Error(r)}}}).call(this)},2692:function(r){(function(){var i;r.exports=i=class XMLDOMImplementation{hasFeature(r,i){return true}createDocumentType(r,i,o){throw new Error("This DOM method is not implemented.")}createDocument(r,i,o){throw new Error("This DOM method is not implemented.")}createHTMLDocument(r){throw new Error("This DOM method is not implemented.")}getFeature(r,i){throw new Error("This DOM method is not implemented.")}}}).call(this)},8207:function(r){(function(){var i;r.exports=i=function(){class XMLDOMStringList{constructor(r){this.arr=r||[]}item(r){return this.arr[r]||null}contains(r){return this.arr.indexOf(r)!==-1}}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});return XMLDOMStringList}.call(this)}).call(this)},2529:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDAttList extends l{constructor(r,o,a,l,c,u){super(r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!c){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(c.indexOf("#")!==0){c="#"+c}if(!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(u&&!c.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(u){this.defaultValue=this.stringify.dtdAttDefault(u)}this.defaultValueType=c}toString(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))}}}).call(this)},7486:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDElement extends l{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!a){a="(#PCDATA)"}if(Array.isArray(a)){a="("+a.join(",")+")"}this.name=this.stringify.name(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}toString(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))}}}).call(this)},9252:function(r,i,o){(function(){var i,a,l,c;({isObject:c}=o(983));l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDEntity extends l{constructor(r,o,a,l){super(r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!c(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}toString(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});return XMLDTDEntity}.call(this)}).call(this)},3353:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDNotation extends l{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}toString(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});return XMLDTDNotation}.call(this)}).call(this)},6645:function(r,i,o){(function(){var i,a,l,c;({isObject:c}=o(983));l=o(5089);i=o(7762);r.exports=a=class XMLDeclaration extends l{constructor(r,o,a,l){super(r);if(c(o)){({version:o,encoding:a,standalone:l}=o)}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}toString(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))}}}).call(this)},8873:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g;({isObject:g}=o(983));p=o(5089);i=o(7762);a=o(2529);c=o(9252);l=o(7486);u=o(3353);d=o(2076);r.exports=h=function(){class XMLDocType extends p{constructor(r,o,a){var l,c,u,h;super(r);this.type=i.DocType;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(g(o)){({pubID:o,sysID:a}=o)}if(a==null){[a,o]=[o,a]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}element(r,i){var o;o=new l(this,r,i);this.children.push(o);return this}attList(r,i,o,l,c){var u;u=new a(this,r,i,o,l,c);this.children.push(u);return this}entity(r,i){var o;o=new c(this,false,r,i);this.children.push(o);return this}pEntity(r,i){var o;o=new c(this,true,r,i);this.children.push(o);return this}notation(r,i){var o;o=new u(this,r,i);this.children.push(o);return this}toString(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))}ele(r,i){return this.element(r,i)}att(r,i,o,a,l){return this.attList(r,i,o,a,l)}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}up(){return this.root()||this.documentObject}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLDocType}.call(this)}).call(this)},1582:function(r,i,o){(function(){var i,a,l,c,u,h,d,p;({isPlainObject:p}=o(983));l=o(2692);a=o(5675);u=o(5089);i=o(7762);d=o(645);h=o(7834);r.exports=c=function(){class XMLDocument extends u{constructor(r){super(null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}end(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))}toString(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))}createElement(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createComment(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}importNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementById(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw new Error("This DOM method is not implemented."+this.debugInfo())}renameNode(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEvent(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});return XMLDocument}.call(this)}).call(this)},2871:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S,A,N,_,C={}.hasOwnProperty;({isObject:N,isFunction:A,isPlainObject:_,getValue:S}=o(983));i=o(7762);b=o(1582);E=o(6484);c=o(5261);u=o(360);M=o(8732);T=o(2275);x=o(8947);y=o(6645);w=o(8873);h=o(2529);p=o(9252);d=o(7486);g=o(3353);l=o(1395);O=o(645);D=o(7834);a=o(140);r.exports=v=class XMLDocumentCB{constructor(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(_(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new O(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}createChildNode(r){var o,a,l,c,u,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!C.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(u=0,h=p.length;u<h;u++){c=p[u];this.createChildNode(c);if(c.type===i.Element){this.up()}}return this}dummy(){return this}node(r,i,o){if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=S(r);if(i==null){i={}}i=S(i);if(!N(i)){[o,i]=[i,o]}this.currentNode=new E(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this}element(r,o,a){var l,c,u,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement(...arguments)}else{if(Array.isArray(r)||N(r)||A(r)){h=this.options.noValidation;this.options.noValidation=true;p=new b(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(c=0,u=d.length;c<u;c++){l=d[c];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this}attribute(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=S(r)}if(N(r)){for(o in r){if(!C.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(A(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this}text(r){var i;this.openCurrent();i=new T(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}cdata(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}comment(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}raw(r){var i;this.openCurrent();i=new M(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}instruction(r,i){var o,a,l,c,u;this.openCurrent();if(r!=null){r=S(r)}if(i!=null){i=S(i)}if(Array.isArray(r)){for(o=0,c=r.length;o<c;o++){a=r[o];this.instruction(a)}}else if(N(r)){for(a in r){if(!C.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(A(i)){i=i.apply()}u=new x(this,r,i);this.onData(this.writer.processingInstruction(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this}declaration(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new y(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}doctype(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new w(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this}dtdElement(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}attList(r,i,o,a,l){var c;this.openCurrent();c=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}entity(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}pEntity(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}notation(r,i){var o;this.openCurrent();o=new g(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}up(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this}end(){while(this.currentLevel>=0){this.up()}return this.onEnd()}openCurrent(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}}openNode(r){var o,l,c,u;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;u=r.attribs;for(c in u){if(!C.call(u,c))continue;o=u[c];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}}closeNode(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}}onData(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)}onEnd(){this.documentCompleted=true;return this.onEndCallback()}debugInfo(r){if(r==null){return""}else{return"node: <"+r+">"}}ele(){return this.element(...arguments)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}dec(r,i,o){return this.declaration(r,i,o)}dtd(r,i,o){return this.doctype(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}att(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}a(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}}}).call(this)},706:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDummy extends l{constructor(r){super(r);this.type=i.Dummy}clone(){return Object.create(this)}toString(r){return""}}}).call(this)},6484:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g={}.hasOwnProperty;({isObject:p,isFunction:d,getValue:h}=o(983));u=o(5089);i=o(7762);a=o(1395);c=o(2076);r.exports=l=function(){class XMLElement extends u{constructor(r,o,a){var l,c,u,h;super(r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.DocType){l.name=this.name;break}}}}}clone(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!g.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o}attribute(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!g.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this}removeAttribute(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this}toString(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}getAttribute(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}}setAttribute(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNode(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}}setAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNodeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNodeNS(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasAttribute(r){return this.attribs.hasOwnProperty(r)}hasAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttribute(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}}setIdAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttributeNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(!super.isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new c(this.attribs)}return this.attributeMap}});return XMLElement}.call(this)}).call(this)},2076:function(r){(function(){var i;r.exports=i=function(){class XMLNamedNodeMap{constructor(r){this.nodes=r}clone(){return this.nodes=null}getNamedItem(r){return this.nodes[r]}setNamedItem(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null}removeNamedItem(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null}item(r){return this.nodes[Object.keys(this.nodes)[r]]||null}getNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}setNamedItemNS(r){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});return XMLNamedNodeMap}.call(this)}).call(this)},5089:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T={}.hasOwnProperty,S=[].splice;({isObject:O,isFunction:D,isEmpty:M,getValue:x}=o(983));p=null;l=null;c=null;u=null;h=null;v=null;E=null;b=null;d=null;a=null;w=null;g=null;i=null;r.exports=y=function(){class XMLNode{constructor(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(6484);l=o(5261);c=o(360);u=o(6645);h=o(8873);v=o(8732);E=o(2275);b=o(8947);d=o(706);a=o(7762);w=o(9908);g=o(2076);i=o(144)}}setParent(r){var i,o,a,l,c;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;c=[];for(o=0,a=l.length;o<a;o++){i=l[o];c.push(i.setParent(this))}return c}element(r,i,o){var a,l,c,u,h,d,p,g,y;d=null;if(i===null&&o==null){[i,o]=[{},null]}if(i==null){i={}}i=x(i);if(!O(i)){[o,i]=[i,o]}if(r!=null){r=x(r)}if(Array.isArray(r)){for(c=0,p=r.length;c<p;c++){l=r[c];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(O(r)){for(h in r){if(!T.call(r,h))continue;y=r[h];if(D(y)){y=y.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),y)}else if(!this.options.separateArrayItems&&Array.isArray(y)&&M(y)){d=this.dummy()}else if(O(y)&&M(y)){d=this.element(h)}else if(!this.options.keepNullNodes&&y==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(y)){for(u=0,g=y.length;u<g;u++){l=y[u];a={};a[h]=l;d=this.element(a)}}else if(O(y)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(y)}else{d=this.element(h);d.element(y)}}else{d=this.element(h,y)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d}insertBefore(r,i,o){var a,l,c,u,h;if(r!=null?r.type:void 0){c=r;u=i;c.setParent(this);if(u){l=children.indexOf(u);h=children.splice(l);children.push(c);Array.prototype.push.apply(children,h)}else{children.push(c)}return c}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}}insertAfter(r,i,o){var a,l,c;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);c=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,c);return a}remove(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);S.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent}node(r,i,o){var a;if(r!=null){r=x(r)}i||(i={});i=x(i);if(!O(i)){[o,i]=[i,o]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a}text(r){var i;if(O(r)){this.element(r)}i=new E(this,r);this.children.push(i);return this}cdata(r){var i;i=new l(this,r);this.children.push(i);return this}comment(r){var i;i=new c(this,r);this.children.push(i);return this}commentBefore(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}commentAfter(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}raw(r){var i;i=new v(this,r);this.children.push(i);return this}dummy(){var r;r=new d(this);return r}instruction(r,i){var o,a,l,c,u;if(r!=null){r=x(r)}if(i!=null){i=x(i)}if(Array.isArray(r)){for(c=0,u=r.length;c<u;c++){o=r[c];this.instruction(o)}}else if(O(r)){for(o in r){if(!T.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new b(this,r,i);this.children.push(l)}return this}instructionBefore(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}instructionAfter(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}declaration(r,i,o){var l,c;l=this.document();c=new u(l,r,i,o);if(l.children.length===0){l.children.unshift(c)}else if(l.children[0].type===a.Declaration){l.children[0]=c}else{l.children.unshift(c)}return l.root()||l}dtd(r,i){var o,l,c,u,d,p,g,y,w,b;l=this.document();c=new h(l,r,i);w=l.children;for(u=d=0,g=w.length;d<g;u=++d){o=w[u];if(o.type===a.DocType){l.children[u]=c;return c}}b=l.children;for(u=p=0,y=b.length;p<y;u=++p){o=b[u];if(o.isRoot){l.children.splice(u,0,c);return c}}l.children.push(c);return c}up(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent}root(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}}document(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}}end(r){return this.document().end(r)}prev(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]}next(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]}importDocument(r){var i,o,l,c,u;o=r.root().clone();o.parent=this;o.isRoot=false;this.children.push(o);if(this.type===a.Document){o.isRoot=true;o.documentObject=this;this.rootObject=o;if(this.children){u=this.children;for(l=0,c=u.length;l<c;l++){i=u[l];if(i.type===a.DocType){i.name=o.name;break}}}}return this}debugInfo(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}}ele(r,i,o){return this.element(r,i,o)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}doc(){return this.document()}dec(r,i,o){return this.declaration(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}u(){return this.up()}importXMLBuilder(r){return this.importDocument(r)}attribute(r,i){throw new Error("attribute() applies to element nodes only.")}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}removeAttribute(r){throw new Error("attribute() applies to element nodes only.")}replaceChild(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(r,i){return true}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}}isSameNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true}getFeature(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(r){if(!r){return false}return r===this||this.isDescendant(r)}isDescendant(r){var i,o,a,l,c;c=this.children;for(a=0,l=c.length;a<l;a++){i=c[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false}isAncestor(r){return r.isDescendant(this)}isPreceding(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}}isFollowing(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}}treePosition(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}}foreachTreeNode(r,i){var o,a,l,c,u;r||(r=this.document());c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];if(u=i(o)){return u}else{u=this.foreachTreeNode(o,i);if(u){return u}}}}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new w(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,c;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){c="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){c+=r.textContent}}return c}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLNode}.call(this)}).call(this)},9908:function(r){(function(){var i;r.exports=i=function(){class XMLNodeList{constructor(r){this.nodes=r}clone(){return this.nodes=null}item(r){return this.nodes[r]||null}}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});return XMLNodeList}.call(this)}).call(this)},8947:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLProcessingInstruction extends a{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}clone(){return Object.create(this)}toString(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.target!==this.target){return false}return true}}}).call(this)},8732:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(5089);r.exports=l=class XMLRaw extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))}}}).call(this)},5922:function(r,i,o){(function(){var i,a,l,c,u={}.hasOwnProperty;i=o(7762);c=o(6670);a=o(140);r.exports=l=class XMLStreamWriter extends c{constructor(r,i){super(i);this.stream=r}endline(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return super.endline(r,i,o)}}document(r,i){var o,a,l,c,u,h,d,p,g;d=r.children;for(a=l=0,u=d.length;l<u;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;g=[];for(c=0,h=p.length;c<h;c++){o=p[c];g.push(this.writeChildNode(o,i,0))}return g}cdata(r,i,o){return this.stream.write(super.cdata(r,i,o))}comment(r,i,o){return this.stream.write(super.comment(r,i,o))}declaration(r,i,o){return this.stream.write(super.declaration(r,i,o))}docType(r,i,o){var l,c,u,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)}element(r,o,l){var c,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;x=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){w=x.length;D=r.attribs;for(v in D){if(!u.call(D,v))continue;c=D[v];M=this.attribute(c,o,l);h=M.length;if(w+h>o.width){S=this.indent(r,o,l+1)+M;x+=this.endline(r,o,l)+S;w=S.length}else{S=" "+M;x+=S;w+=S.length}}}else{O=r.attribs;for(v in O){if(!u.call(O,v))continue;c=O[v];x+=this.attribute(c,o,l)}}this.stream.write(x);p=r.children.length;g=p===0?null:r.children[0];if(p===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw||r.type===i.CData)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&p===1&&(g.type===i.Text||g.type===i.Raw||g.type===i.CData)&&g.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;E=true;this.writeChildNode(g,o,l+1);o.suppressPrettyCount--;E=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;T=r.children;for(y=0,b=T.length;y<b;y++){d=T[y];this.writeChildNode(d,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)}processingInstruction(r,i,o){return this.stream.write(super.processingInstruction(r,i,o))}raw(r,i,o){return this.stream.write(super.raw(r,i,o))}text(r,i,o){return this.stream.write(super.text(r,i,o))}dtdAttList(r,i,o){return this.stream.write(super.dtdAttList(r,i,o))}dtdElement(r,i,o){return this.stream.write(super.dtdElement(r,i,o))}dtdEntity(r,i,o){return this.stream.write(super.dtdEntity(r,i,o))}dtdNotation(r,i,o){return this.stream.write(super.dtdNotation(r,i,o))}}}).call(this)},7834:function(r,i,o){(function(){var i,a;a=o(6670);r.exports=i=class XMLStringWriter extends a{constructor(r){super(r)}document(r,i){var o,a,l,c,u;i=this.filterOptions(i);c="";u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];c+=this.writeChildNode(o,i,0)}if(i.pretty&&c.slice(-i.newline.length)===i.newline){c=c.slice(0,-i.newline.length)}return c}}}).call(this)},645:function(r){(function(){var i,o={}.hasOwnProperty;r.exports=i=function(){class XMLStringifier{constructor(r){var i,a,l;this.assertLegalChar=this.assertLegalChar.bind(this);this.assertLegalName=this.assertLegalName.bind(this);r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}name(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")}text(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))}cdata(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)}comment(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)}raw(r){if(this.options.noValidation){return r}return""+r||""}attValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))}insTarget(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}insValue(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)}xmlVersion(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r}xmlEncoding(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)}xmlStandalone(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}}dtdPubID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdSysID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdElementValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttType(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttDefault(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdEntityValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdNData(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}assertLegalChar(r){var i,o;if(this.options.noValidation){return r}if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;if(this.options.invalidCharReplacement!==void 0){r=r.replace(i,this.options.invalidCharReplacement)}else if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;if(this.options.invalidCharReplacement!==void 0){r=r.replace(i,this.options.invalidCharReplacement)}else if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}return r}assertLegalName(r){var i;if(this.options.noValidation){return r}r=this.assertLegalChar(r);i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!r.match(i)){throw new Error(`Invalid character in name: ${r}`)}return r}textEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")}attEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")}}XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";return XMLStringifier}.call(this)}).call(this)},2275:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=function(){class XMLText extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))}splitText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});return XMLText}.call(this)}).call(this)},6670:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O={}.hasOwnProperty;({assign:D}=o(983));i=o(7762);g=o(6645);y=o(8873);l=o(5261);c=o(360);b=o(6484);E=o(8732);x=o(2275);v=o(8947);w=o(706);u=o(2529);h=o(7486);d=o(9252);p=o(3353);a=o(140);r.exports=M=class XMLWriterBase{constructor(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!O.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}filterOptions(r){var i,o,l,c,u,h,d,p,g;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(c=r.offset)!=null?c:0;i.width=(u=r.width)!=null?u:0;i.dontPrettyTextNodes=(h=(d=r.dontPrettyTextNodes)!=null?d:r.dontprettytextnodes)!=null?h:0;i.spaceBeforeSlash=(p=(g=r.spaceBeforeSlash)!=null?g:r.spacebeforeslash)!=null?p:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i}indent(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""}endline(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}}attribute(r,i,o){var a;this.openAttribute(r,i,o);if(i.pretty&&i.width>0){a=r.name+'="'+r.value+'"'}else{a=" "+r.name+'="'+r.value+'"'}this.closeAttribute(r,i,o);return a}cdata(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}comment(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}declaration(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}docType(r,i,o){var l,c,u,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(c=0,u=d.length;c<u;c++){l=d[c];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h}element(r,o,l){var c,u,h,d,p,g,y,w,b,v,E,x,M,D,T,S,A,N,_;l||(l=0);x=false;this.openNode(r,o,l);o.state=a.OpenTag;M=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){w=M.length;T=r.attribs;for(E in T){if(!O.call(T,E))continue;c=T[E];D=this.attribute(c,o,l);u=D.length;if(w+u>o.width){_=this.indent(r,o,l+1)+D;M+=this.endline(r,o,l)+_;w=_.length}else{_=" "+D;M+=_;w+=_.length}}}else{S=r.attribs;for(E in S){if(!O.call(S,E))continue;c=S[E];M+=this.attribute(c,o,l)}}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw||r.type===i.CData)&&r.value===""}))){if(o.allowEmpty){M+=">";o.state=a.CloseTag;M+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;M+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw||p.type===i.CData)&&p.value!=null){M+=">";o.state=a.InsideTag;o.suppressPrettyCount++;x=true;M+=this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;x=false;o.state=a.CloseTag;M+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){A=r.children;for(g=0,b=A.length;g<b;g++){h=A[g];if((h.type===i.Text||h.type===i.Raw||h.type===i.CData)&&h.value!=null){o.suppressPrettyCount++;x=true;break}}}M+=">"+this.endline(r,o,l);o.state=a.InsideTag;N=r.children;for(y=0,v=N.length;y<v;y++){h=N[y];M+=this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;M+=this.indent(r,o,l)+"</"+r.name+">";if(x){o.suppressPrettyCount--}M+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return M}writeChildNode(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}}processingInstruction(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}raw(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}text(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdAttList(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdElement(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdEntity(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdNotation(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}openNode(r,i,o){}closeNode(r,i,o){}openAttribute(r,i,o){}closeAttribute(r,i,o){}}}).call(this)},5769:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g;({assign:p,isFunction:g}=o(983));l=o(2692);c=o(1582);u=o(2871);d=o(7834);h=o(5922);i=o(7762);a=o(140);r.exports.create=function(r,i,o,a){var l,u;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new c(a);u=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return u};r.exports.begin=function(r,i,o){if(g(r)){[i,o]=[r,i];r={}}if(i){return new u(r,i,o)}else{return new c(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},4513:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addMetaDataItemToMainApplication=addMetaDataItemToMainApplication;i.addUsesLibraryItemToMainApplication=addUsesLibraryItemToMainApplication;i.ensureToolsAvailable=ensureToolsAvailable;i.findMetaDataItem=findMetaDataItem;i.findUsesLibraryItem=findUsesLibraryItem;i.getMainActivity=getMainActivity;i.getMainActivityOrThrow=getMainActivityOrThrow;i.getMainApplication=getMainApplication;i.getMainApplicationMetaDataValue=getMainApplicationMetaDataValue;i.getMainApplicationOrThrow=getMainApplicationOrThrow;i.getRunnableActivity=getRunnableActivity;i.prefixAndroidKeys=prefixAndroidKeys;i.readAndroidManifestAsync=readAndroidManifestAsync;i.removeMetaDataItemFromMainApplication=removeMetaDataItemFromMainApplication;i.removeUsesLibraryItemFromMainApplication=removeUsesLibraryItemFromMainApplication;i.writeAndroidManifestAsync=writeAndroidManifestAsync;function _assert(){const r=_interopRequireDefault(o(9491));_assert=function(){return r};return r}function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function XML(){const r=_interopRequireWildcard(o(8853));XML=function(){return r};return r}function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var i=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function(r){return r?o:i})(r)}function _interopRequireWildcard(r,i){if(!i&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var o=_getRequireWildcardCache(i);if(o&&o.has(r))return o.get(r);var a={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in r)if("default"!==c&&{}.hasOwnProperty.call(r,c)){var u=l?Object.getOwnPropertyDescriptor(r,c):null;u&&(u.get||u.set)?Object.defineProperty(a,c,u):a[c]=r[c]}return a.default=r,o&&o.set(r,a),a}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeAndroidManifestAsync(r,i){const o=XML().format(i);await _fs().default.promises.mkdir(_path().default.dirname(r),{recursive:true});await _fs().default.promises.writeFile(r,o)}async function readAndroidManifestAsync(r){const i=await XML().readXMLAsync({path:r});if(!isManifest(i)){throw new Error("Invalid manifest found at: "+r)}return i}function isManifest(r){return!!r.manifest}function getMainApplication(r){return r?.manifest?.application?.filter((r=>r?.$?.["android:name"].endsWith(".MainApplication")))[0]??null}function getMainApplicationOrThrow(r){const i=getMainApplication(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainApplication element");return i}function getMainActivityOrThrow(r){const i=getMainActivity(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainActivity element");return i}function getRunnableActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:enabled"]!=="false"&&r.$["android:enabled"]!==false));if(!i){return null}for(const r of i){if(Array.isArray(r["intent-filter"])){for(const i of r["intent-filter"]){if(i.action?.find((r=>r.$["android:name"]==="android.intent.action.MAIN"))&&i.category?.find((r=>r.$["android:name"]==="android.intent.category.LAUNCHER"))){return r}}}}return null}function getMainActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:name"]===".MainActivity"));return i?.[0]??null}function addMetaDataItemToMainApplication(r,i,o,a="value"){let l;const c={$:prefixAndroidKeys({name:i,[a]:o})};if(r["meta-data"]){l=r["meta-data"].filter((r=>r.$["android:name"]===i));if(l.length){l[0].$[`android:${a}`]=o}else{r["meta-data"].push(c)}}else{r["meta-data"]=[c]}return r}function removeMetaDataItemFromMainApplication(r,i){const o=findMetaDataItem(r,i);if(r?.["meta-data"]&&o>-1){r["meta-data"].splice(o,1)}return r}function findApplicationSubItem(r,i,o){const a=r[i];if(Array.isArray(a)){const r=a.findIndex((r=>r.$["android:name"]===o));return r}return-1}function findMetaDataItem(r,i){return findApplicationSubItem(r,"meta-data",i)}function findUsesLibraryItem(r,i){return findApplicationSubItem(r,"uses-library",i)}function getMainApplicationMetaDataValue(r,i){const o=getMainApplication(r);if(o?.hasOwnProperty("meta-data")){const r=o?.["meta-data"]?.find((r=>r.$["android:name"]===i));return r?.$["android:value"]??null}return null}function addUsesLibraryItemToMainApplication(r,i){let o;const a={$:prefixAndroidKeys(i)};if(r["uses-library"]){o=r["uses-library"].filter((r=>r.$["android:name"]===i.name));if(o.length){o[0].$=a.$}else{r["uses-library"].push(a)}}else{r["uses-library"]=[a]}return r}function removeUsesLibraryItemFromMainApplication(r,i){const o=findUsesLibraryItem(r,i);if(r?.["uses-library"]&&o>-1){r["uses-library"].splice(o,1)}return r}function prefixAndroidKeys(r){return Object.entries(r).reduce(((r,[i,o])=>({...r,[`android:${i}`]:o})),{})}function ensureToolsAvailable(r){return ensureManifestHasNamespace(r,{namespace:"xmlns:tools",url:"http://schemas.android.com/tools"})}function ensureManifestHasNamespace(r,{namespace:i,url:o}){if(r?.manifest?.$?.[i]){return r}r.manifest.$[i]=o;return r}},365:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.ensureManifestHasValidIntentFilter=ensureManifestHasValidIntentFilter;i.getScheme=getScheme;i.getSchemesFromManifest=getSchemesFromManifest;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _androidPlugins(){const r=o(2636);_androidPlugins=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}const a=i.withScheme=(0,_androidPlugins().createAndroidManifestPlugin)(setScheme,"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.android??{})];if(r.android?.package){o.push(r.android.package)}if(o.length===0){return i}if(!ensureManifestHasValidIntentFilter(i)){(0,_warnings().addWarningAndroid)("scheme",`Cannot add schemes because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\``,"https://expo.fyi/setup-android-uri-scheme");return i}const a=getSchemesFromManifest(i);for(const r of a){const i=o.indexOf(r);if(i>-1)o.splice(i,1)}for(const r of o){i=appendScheme(r,i)}return i}function isValidRedirectIntentFilter({actions:r,categories:i}){return r.includes("android.intent.action.VIEW")&&!i.includes("android.intent.category.LAUNCHER")}function propertiesFromIntentFilter(r){const i=r?.action?.map((r=>r?.$?.["android:name"]))??[];const o=r?.category?.map((r=>r?.$?.["android:name"]))??[];const a=r?.data?.filter((r=>r?.$?.["android:scheme"]))?.map((r=>({scheme:r?.$?.["android:scheme"],host:r?.$?.["android:host"]})))??[];return{actions:i,categories:o,data:a}}function getSingleTaskIntentFilters(r){if(!Array.isArray(r.manifest.application))return[];let i=[];for(const o of r.manifest.application){const{activity:r}=o;const a=Array.isArray(r)?r:[r];const l=a.filter((r=>r?.$?.["android:launchMode"]==="singleTask"));for(const r of l){const o=r["intent-filter"];i=i.concat(o)}}return i}function getSchemesFromManifest(r,i=null){const o=[];const a=getSingleTaskIntentFilters(r);for(const r of a){const a=propertiesFromIntentFilter(r);if(isValidRedirectIntentFilter(a)&&a.data){for(const{scheme:r,host:l}of a.data){if(i===null||!l||l===i){o.push(r)}}}}return o}function ensureManifestHasValidIntentFilter(r){if(!Array.isArray(r.manifest.application)){return false}for(const i of r.manifest.application){for(const r of i.activity||[]){if(r?.$?.["android:launchMode"]==="singleTask"){for(const i of r["intent-filter"]||[]){const r=propertiesFromIntentFilter(i);if(isValidRedirectIntentFilter(r)){return true}}if(!r["intent-filter"]){r["intent-filter"]=[]}r["intent-filter"].push({action:[{$:{"android:name":"android.intent.action.VIEW"}}],category:[{$:{"android:name":"android.intent.category.DEFAULT"}},{$:{"android:name":"android.intent.category.BROWSABLE"}}]});return true}}}return false}function hasScheme(r,i){const o=getSchemesFromManifest(i);return o.includes(r)}function appendScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){if(!o.data)o.data=[];o.data.push({$:{"android:scheme":r}})}}break}}}return i}function removeScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){for(const i in o?.data||[]){const a=o.data?.[i];if(a?.$?.["android:scheme"]===r){delete o.data?.[i]}}}}break}}}return i}},7903:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.getScheme=getScheme;i.getSchemesFromPlist=getSchemesFromPlist;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _iosPlugins(){const r=o(4797);_iosPlugins=function(){return r};return r}const a=i.withScheme=(0,_iosPlugins().createInfoPlistPluginWithPropertyGuard)(setScheme,{infoPlistProperty:"CFBundleURLTypes",expoConfigProperty:"scheme"},"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.ios??{})];if(r.ios?.bundleIdentifier){o.push(r.ios.bundleIdentifier)}if(o.length===0){return i}return{...i,CFBundleURLTypes:[{CFBundleURLSchemes:o}]}}function appendScheme(r,i){if(!r){return i}const o=i.CFBundleURLTypes??[];if(o?.some((({CFBundleURLSchemes:i})=>i.includes(r)))){return i}return{...i,CFBundleURLTypes:[...o,{CFBundleURLSchemes:[r]}]}}function removeScheme(r,i){if(!r){return i}if(!i.CFBundleURLTypes){return i}i.CFBundleURLTypes=i.CFBundleURLTypes.map((i=>{const o=i.CFBundleURLSchemes.indexOf(r);if(o>-1){i.CFBundleURLSchemes.splice(o,1);if(i.CFBundleURLSchemes.length===0){return undefined}}return i})).filter(Boolean);return i}function hasScheme(r,i){const o=i.CFBundleURLTypes;if(!Array.isArray(o))return false;return o?.some((({CFBundleURLSchemes:i})=>Array.isArray(i)?i.includes(r):false))}function getSchemesFromPlist(r){if(Array.isArray(r.CFBundleURLTypes)){return r.CFBundleURLTypes.reduce(((r,{CFBundleURLSchemes:i})=>{if(Array.isArray(i)){return[...r,...i]}return r}),[])}return[]}},2636:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createAndroidManifestPlugin=createAndroidManifestPlugin;i.createStringsXmlPlugin=createStringsXmlPlugin;i.withStringsXml=i.withSettingsGradle=i.withProjectBuildGradle=i.withMainApplication=i.withMainActivity=i.withGradleProperties=i.withAppBuildGradle=i.withAndroidStyles=i.withAndroidManifest=i.withAndroidColorsNight=i.withAndroidColors=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function createAndroidManifestPlugin(r,i){const withUnknown=i=>withAndroidManifest(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createStringsXmlPlugin(r,i){const withUnknown=i=>withStringsXml(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAndroidManifest=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"manifest",action:i});i.withAndroidManifest=withAndroidManifest;const withStringsXml=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"strings",action:i});i.withStringsXml=withStringsXml;const withAndroidColors=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colors",action:i});i.withAndroidColors=withAndroidColors;const withAndroidColorsNight=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colorsNight",action:i});i.withAndroidColorsNight=withAndroidColorsNight;const withAndroidStyles=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"styles",action:i});i.withAndroidStyles=withAndroidStyles;const withMainActivity=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainActivity",action:i});i.withMainActivity=withMainActivity;const withMainApplication=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainApplication",action:i});i.withMainApplication=withMainApplication;const withProjectBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"projectBuildGradle",action:i});i.withProjectBuildGradle=withProjectBuildGradle;const withAppBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"appBuildGradle",action:i});i.withAppBuildGradle=withAppBuildGradle;const withSettingsGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"settingsGradle",action:i});i.withSettingsGradle=withSettingsGradle;const withGradleProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"gradleProperties",action:i});i.withGradleProperties=withGradleProperties},4797:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createEntitlementsPlugin=createEntitlementsPlugin;i.createInfoPlistPlugin=createInfoPlistPlugin;i.createInfoPlistPluginWithPropertyGuard=createInfoPlistPluginWithPropertyGuard;i.withXcodeProject=i.withPodfileProperties=i.withPodfile=i.withInfoPlist=i.withExpoPlist=i.withEntitlementsPlist=i.withAppDelegate=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function _obj(){const r=o(7324);_obj=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}function createInfoPlistPlugin(r,i){const withUnknown=i=>withInfoPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createInfoPlistPluginWithPropertyGuard(r,i,o){const withUnknown=o=>withInfoPlist(o,(async o=>{const a=i.expoPropertyGetter?i.expoPropertyGetter(o):(0,_obj().get)(o,i.expoConfigProperty);if(o.modRawConfig.ios?.infoPlist?.[i.infoPlistProperty]===undefined){o.modResults=await r(o,o.modResults)}else if(a!==undefined){(0,_warnings().addWarningIOS)(i.expoConfigProperty,`"ios.infoPlist.${i.infoPlistProperty}" is set in the config. Ignoring abstract property "${i.expoConfigProperty}": ${a}`)}return o}));if(o){Object.defineProperty(withUnknown,"name",{value:o})}return withUnknown}function createEntitlementsPlugin(r,i){const withUnknown=i=>withEntitlementsPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAppDelegate=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"appDelegate",action:i});i.withAppDelegate=withAppDelegate;const withInfoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"infoPlist",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.infoPlist=r.modResults;return r}});i.withInfoPlist=withInfoPlist;const withEntitlementsPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"entitlements",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.entitlements=r.modResults;return r}});i.withEntitlementsPlist=withEntitlementsPlist;const withExpoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"expoPlist",action:i});i.withExpoPlist=withExpoPlist;const withXcodeProject=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"xcodeproj",action:i});i.withXcodeProject=withXcodeProject;const withPodfile=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"podfile",action:i});i.withPodfile=withPodfile;const withPodfileProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"podfileProperties",action:i});i.withPodfileProperties=withPodfileProperties},2932:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.withBaseMod=withBaseMod;i.withMod=withMod;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _getenv(){const r=o(7945);_getenv=function(){return r};return r}function _errors(){const r=o(3857);_errors=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const a=(0,_getenv().boolish)("EXPO_DEBUG",false);function withBaseMod(r,{platform:i,mod:o,action:l,skipEmptyMod:c,isProvider:u,isIntrospective:h,saveToInternal:d}){if(!r.mods){r.mods={}}if(!r.mods[i]){r.mods[i]={}}let p=r.mods[i][o];if(!p){if(c){return r}const noopMod=r=>r;p=noopMod}let g="";const y=r._internal?.isDebug??a;if(y){const r=(new Error).stack;g=getDebugPluginStackFromStackTrace(r);const a=_chalk().default.bold(`${i}.${o}`);g=`${a}: ${g}`}if(p.isProvider){if(u){throw new(_errors().PluginError)(`Cannot set provider mod for "${i}.${o}" because another is already being used.`,"CONFLICTING_PROVIDER")}else{throw new(_errors().PluginError)(`Cannot add mod to "${i}.${o}" because the provider has already been added. Provider must be the last mod added.`,"INVALID_MOD_ORDER")}}async function interceptingMod({modRequest:r,...a}){if(y){console.log(g)}const c=await l({...a,modRequest:{...r,nextMod:p}});if(d){saveToInternalObject(c,i,o,c.modResults)}return c}interceptingMod.isProvider=u;if(h){interceptingMod.isIntrospective=h}r.mods[i][o]=interceptingMod;return r}function saveToInternalObject(r,i,o,a){if(!r._internal)r._internal={};if(!r._internal.modResults)r._internal.modResults={};if(!r._internal.modResults[i])r._internal.modResults[i]={};r._internal.modResults[i][o]=a}function getDebugPluginStackFromStackTrace(r){if(!r){return""}const i=[];for(const o of r.split("\n")){const[r,a]=o.trim().split(" ");if(r==="at"){i.push(a)}}const o=i.map((r=>r?.match(/^(\bwith[A-Z].*?\b)/)?.[1]?.trim()??r?.match(/\.(\bwith[A-Z].*?\b)/)?.[1]?.trim()??null)).filter(Boolean).filter((r=>!["withMod","withBaseMod","withExtendedMod"].includes(r)));const a=["withPlugins","withRunOnce","withStaticPlugin"];return o.reverse().map(((r,i)=>{if(r.includes("BaseMod")){r=_chalk().default.bold(r)}if(r.toLowerCase().includes("dangerous")){r=_chalk().default.red(r)}if(i===0){return _chalk().default.blue(r)}else if(a.includes(r)){return _chalk().default.dim(r)}return r})).join(" ➜ ")}function withMod(r,{platform:i,mod:o,action:a}){return withBaseMod(r,{platform:i,mod:o,isProvider:false,async action({modRequest:{nextMod:r,...i},modResults:o,...l}){const c=await a({modRequest:i,modResults:o,...l});return r(c)}})}},8853:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i._processAndroidXML=_processAndroidXML;i.escapeAndroidString=escapeAndroidString;i.format=format;i.parseXMLAsync=parseXMLAsync;i.readXMLAsync=readXMLAsync;i.unescapeAndroidString=unescapeAndroidString;i.writeXMLAsync=writeXMLAsync;function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _os(){const r=o(2037);_os=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function _xml2js(){const r=o(7013);_xml2js=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeXMLAsync(r){const i=format(r.xml);await _fs().default.promises.mkdir(_path().default.dirname(r.path),{recursive:true});await _fs().default.promises.writeFile(r.path,i)}async function readXMLAsync(r){let i="";try{i=await _fs().default.promises.readFile(r.path,{encoding:"utf8",flag:"r"})}catch{}const o=new(_xml2js().Parser);const a=await o.parseStringPromise(i||r.fallback||"");return _processAndroidXML(a)}function _processAndroidXML(r){if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}if(!("_"in i)){throw new Error(`Empty string resource not supported: ${JSON.stringify(i)}`)}i._=unescapeAndroidString(i._)}}return r}async function parseXMLAsync(r){const i=await(new(_xml2js().Parser)).parseStringPromise(r);return i}const stringTimesN=(r,i)=>Array(r+1).join(i);function format(r,{indentLevel:i=2,newline:o=_os().EOL}={}){let a;if(typeof r==="string"){a=r}else if(r.toString){const i=new(_xml2js().Builder)({headless:true});if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}i._=escapeAndroidString(i._)}}a=i.buildObject(r);return a}else{throw new Error(`Invalid XML value passed in: ${r}`)}const l=stringTimesN(i," ");let c="";const u=/(>)(<)(\/*)/g;const h=a.replace(u,`$1${o}$2$3`);let d=0;h.split(/\r?\n/).map((r=>r.trim())).forEach((r=>{let i=0;if(r.match(/.+<\/\w[^>]*>$/)){i=0}else if(r.match(/^<\/\w/)){if(d!==0){d-=1}}else if(r.match(/^<\w([^>]*[^/])?>.*$/)){i=1}else{i=0}const a=stringTimesN(d,l);c+=a+r+o;d+=i}));return c.trim()}function escapeAndroidString(r){r=r.replace(/[\n\r\t'"@]/g,(r=>{switch(r){case'"':case"'":case"@":return"\\"+r;case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:throw new Error(`Cannot escape unhandled XML character: ${r}`)}}));if(r.match(/(^\s|\s$)/)){r='"'+r+'"'}return r}function unescapeAndroidString(r){return r.replace(/\\(.)/g,"$1")}},3857:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.UnexpectedError=i.PluginError=void 0;class UnexpectedError extends Error{name="UnexpectedError";constructor(r){super(`${r}\nPlease report this as an issue on https://github.com/expo/expo/issues`)}}i.UnexpectedError=UnexpectedError;class PluginError extends Error{name="PluginError";isPluginError=true;constructor(r,i,o){super(o?`${r}\n└─ Cause: ${o.name}: ${o.message}`:r);this.code=i;this.cause=o}}i.PluginError=PluginError},7324:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.get=get;function get(r,i){const o=i.split(".");let a=r;let l;while(l=o.shift()){if(!(l in a)){return undefined}a=a[l]}return a}},128:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addWarningAndroid=addWarningAndroid;i.addWarningForPlatform=addWarningForPlatform;i.addWarningIOS=addWarningIOS;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function addWarningAndroid(r,i,o){console.warn(formatWarning("android",r,i,o))}function addWarningIOS(r,i,o){console.warn(formatWarning("ios",r,i,o))}function addWarningForPlatform(r,i,o,a){console.warn(formatWarning(r,i,o,a))}function formatWarning(r,i,o,a){return _chalk().default.yellow`${"» "+_chalk().default.bold(r)}: ${i}: ${o}${a?_chalk().default.gray(" "+a):""}`}},2395:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.build=build;const l=a(o(2991));const c=a(o(5769));function ISODateString(r){function pad(r){return r<10?"0"+r:r}return r.getUTCFullYear()+"-"+pad(r.getUTCMonth()+1)+"-"+pad(r.getUTCDate())+"T"+pad(r.getUTCHours())+":"+pad(r.getUTCMinutes())+":"+pad(r.getUTCSeconds())+"Z"}const u=Object.prototype.toString;function type(r){const i=u.call(r).match(/\[object (.*)\]/);return i?i[1]:i}function build(r,i){const o={version:"1.0",encoding:"UTF-8"};const a={pubid:"-//Apple//DTD PLIST 1.0//EN",sysid:"http://www.apple.com/DTDs/PropertyList-1.0.dtd"};const l=c.default.create("plist");l.dec(o.version,o.encoding,o.standalone);l.dtd(a.pubid,a.sysid);l.att("version","1.0");walk_obj(r,l);if(!i)i={};i.pretty=i.pretty!==false;return l.end(i)}function walk_obj(r,i){let o,a,c;const u=type(r);if(u==="Undefined"){}else if(Array.isArray(r)){i=i.ele("array");for(a=0;a<r.length;a++){walk_obj(r[a],i)}}else if(Buffer.isBuffer(r)){i.ele("data").raw(r.toString("base64"))}else if(u==="Object"){i=i.ele("dict");for(c in r){if(r.hasOwnProperty(c)&&r[c]!==undefined){i.ele("key").txt(c);walk_obj(r[c],i)}}}else if(u==="Number"){o=r%1===0?"integer":"real";i.ele(o).txt(r.toString())}else if(u==="Date"){i.ele("date").txt(ISODateString(new Date(r)))}else if(u==="Boolean"){i.ele(r?"true":"false")}else if(u==="String"){i.ele("string").txt(r)}else if(u==="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(r))}else if(r&&r.buffer&&type(r.buffer)==="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(new Uint8Array(r.buffer)))}}},3681:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=o(2395);const l=o(6859);i["default"]={parse:l.parse,build:a.build}},6859:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.parse=parse;const l=o(1328);const c=a(o(9491));const u=3;const h=4;const d=8;function shouldIgnoreNode(r){return r.nodeType===u||r.nodeType===d||r.nodeType===h}function isEmptyNode(r){return!r.childNodes||r.childNodes.length===0}function parse(r){const i=new l.DOMParser({errorHandler(){}}).parseFromString(r);(0,c.default)(i.documentElement.nodeName==="plist","malformed document. First element should be <plist>");let o=parsePlistXML(i.documentElement);if(o.length===1)o=o[0];return o}function parsePlistXML(r){let i,o,a,l,d,p;if(!r)return null;if(r.nodeName==="plist"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){l.push(parsePlistXML(r.childNodes[i]))}}return l}else if(r.nodeName==="dict"){o={};a=null;p=0;if(isEmptyNode(r)){return o}for(i=0;i<r.childNodes.length;i++){if(shouldIgnoreNode(r.childNodes[i]))continue;if(p%2===0){(0,c.default)(r.childNodes[i].nodeName==="key","Missing key while parsing <dict/>.");a=parsePlistXML(r.childNodes[i])}else{(0,c.default)(r.childNodes[i].nodeName!=="key",'Unexpected key "'+parsePlistXML(r.childNodes[i])+'" while parsing <dict/>.');o[a]=parsePlistXML(r.childNodes[i])}p+=1}if(p%2===1){throw new Error('Missing value for "'+a+'" while parsing <dict/>')}return o}else if(r.nodeName==="array"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){d=parsePlistXML(r.childNodes[i]);if(d!=null)l.push(d)}}return l}else if(r.nodeName==="#text"){}else if(r.nodeName==="key"){if(isEmptyNode(r)){return""}return r.childNodes[0].nodeValue}else if(r.nodeName==="string"){d="";if(isEmptyNode(r)){return d}for(i=0;i<r.childNodes.length;i++){const o=r.childNodes[i].nodeType;if(o===u||o===h){d+=r.childNodes[i].nodeValue}}return d}else if(r.nodeName==="integer"){(0,c.default)(!isEmptyNode(r),'Cannot parse "" as integer.');return parseInt(r.childNodes[0].nodeValue,10)}else if(r.nodeName==="real"){(0,c.default)(!isEmptyNode(r),'Cannot parse "" as real.');d="";for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===u){d+=r.childNodes[i].nodeValue}}return parseFloat(d)}else if(r.nodeName==="data"){d="";if(isEmptyNode(r)){return Buffer.from(d,"base64")}for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===u){d+=r.childNodes[i].nodeValue.replace(/\s+/g,"")}}return Buffer.from(d,"base64")}else if(r.nodeName==="date"){(0,c.default)(!isEmptyNode(r),'Cannot parse "" as Date.');return new Date(r.childNodes[0].nodeValue)}else if(r.nodeName==="true"){return true}else if(r.nodeName==="false"){return false}}},208:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.isAvailable=isAvailable;i.addAsync=addAsync;i.removeAsync=removeAsync;i.getAdbOutputAsync=getAdbOutputAsync;i.openAsync=openAsync;i.getAsync=getAsync;i.getProjectIdAsync=getProjectIdAsync;i.getConfigPath=getConfigPath;i.escapeUri=escapeUri;const h=o(4513);const d=c(o(365));const p=o(8853);const g=u(o(5642));const y=u(o(8746));const w=o(7147);const b=u(o(1017));const v=o(3329);const E="Activity not started, unable to resolve Intent";const x="error: ";function isAvailable(r){return(0,w.existsSync)(b.default.join(r,"android/app/src/main/AndroidManifest.xml"))||(0,w.existsSync)(b.default.join(r,"app/src/main/AndroidManifest.xml"))}async function addAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let c=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(c)){throw new v.CommandError(`Cannot add scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"add")}if(d.hasScheme(i,c)){console.log(y.default.yellow(`› Android: URI scheme "${i}" already exists in AndroidManifest.xml at: ${l}`));return false}c=d.appendScheme(i,c);if(r){console.log(y.default.magenta("Write manifest to: ",l));console.log((0,p.format)(c));return false}await writeConfigAsync(l,c);return true}async function removeAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let c=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(c)){throw new v.CommandError(`Cannot remove scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"remove")}if(!d.hasScheme(i,c)){console.log(y.default.yellow(`› Android: URI scheme "${i}" does not exist in AndroidManifest.xml at: ${l}`));return false}c=d.removeScheme(i,c);if(r){console.log(y.default.magenta("Write manifest to: ",l));console.log((0,p.format)(c));return false}await writeConfigAsync(l,c);return true}function whichADB(){if(process.env.ANDROID_HOME){return`${process.env.ANDROID_HOME}/platform-tools/adb`}return"adb"}async function getAdbOutputAsync(r){const i=whichADB();try{const o=await(0,g.default)(i,r);return o.stdout}catch(r){const i=r.stderr||r.stdout||"";let o=i.trim();if(o.startsWith(x)){o=o.substring(x.length)}throw new v.CommandError(o)}}async function openUrlAsync(...r){const i=await getAdbOutputAsync(["shell","am","start","-a","android.intent.action.VIEW","-d",...r.filter(Boolean)]);if(i.includes(E)){throw new v.CommandError(i.substring(i.indexOf("Error: ")))}return i}async function openAsync({uri:r,androidPackage:i}){return await openUrlAsync(r.replace(/&/g,String.raw`\&`),i??null)}async function getAsync({projectRoot:r,manifestPath:i}){const o=await readConfigAsync(i??getConfigPath(r));return await d.getSchemesFromManifest(o)}function getPackage(r){return r.manifest?.$?.package??null}async function getProjectIdAsync({projectRoot:r,manifestPath:i}){const o=i??getConfigPath(r);const a=await readConfigAsync(o);const l=getPackage(a);if(!l)throw new v.CommandError(`Android: Failed to resolve android package for Manifest at path: ${o}`);return l}function getConfigPath(r){const i=["android/app/src/main/AndroidManifest.xml","app/src/main/AndroidManifest.xml"].map((i=>b.default.join(r,i)));for(const r of i){if((0,w.existsSync)(r)){return r}}throw new Error(`Could not find AndroidManifest.xml, looked in: ${i.join(", ")}`)}async function readConfigAsync(r){return await(0,h.readAndroidManifestAsync)(r)}async function writeConfigAsync(r,i){await(0,h.writeAndroidManifestAsync)(r,i)}function escapeUri(r){const[i,o]=r.split("://",2);const[a,l]=o.split("?",2);const c=a.replace(/(^|[^\\])([$\-_.+!*'(),])/g,"$1\\$2");if(l?.length){const r=new URLSearchParams(l);for(const[i,o]of r.entries()){r.set(i,encodeURIComponent(decodeURIComponent(o)))}return`${i}://${c}?${r.toString()}`}return`${i}://${c}`}},5585:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.program=void 0;i.run=run;const h=u(o(8746));const d=o(1776);const p=o(1017);const g=c(o(208));const y=c(o(2194));const w=o(3329);const b=c(o(8522));const v=u(o(2586));const packageJson=()=>o(4147);i.program=new d.Command(packageJson().name).version(packageJson().version);function buildCommand(r,o=[]){return i.program.command(`${r} [uri-protocol]`).option("-a, --android","Apply action to Android").option("-i, --ios","Apply action to iOS ").on("--help",(()=>{if(!o.length)return;console.log();console.log("Examples:");console.log();for(const i of o){console.log(` $ uri-scheme ${r} ${i}`)}console.log()}))}buildCommand("add",["com.app","myapp"]).description("Add URI schemes to a native app").option("-n, --name <string>","Name to use on iOS.").option("-r, --role <string>","Role to use on iOS: Editor, Viewer").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await b.addAsync(o);await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));buildCommand("remove",["com.app","myapp"]).description("Remove URI schemes from a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await b.removeAsync(o);await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));buildCommand("open",["com.app://oauth","http://expo.dev"]).description("Open a URI scheme in a running simulator or emulator").option("--package <string>","The Android package name to use when opening in an emulator").option("--raw","Open the URL without escaping special characters in the search parameters").action((async(r,i)=>{try{if(!i.ios&&!i.android){throw new w.CommandError("Please provide a target platform with --ios or --android")}await b.openAsync({projectRoot:process.cwd(),...i,androidPackage:i["package"],uri:r,escapeUri:!i.raw});await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));buildCommand("list").description("List the existing URI scheme prefixes for a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await b.listAsync(o);await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));async function parseArgsAsync(r,i){const o=(0,p.resolve)(process.cwd());i.projectRoot=o;if(i.manifestPath)i.manifestPath=(0,p.resolve)(i.manifestPath);if(i.infoPath)i.infoPath=(0,p.resolve)(i.infoPath);const a=b.getAvailablePlatforms(i);let l=false;if(!i.android&&!i.ios){l=true;for(const r of a){i[r]=true}}else{if(i.android){if(!a.includes("android")){throw new w.CommandError(`Android project not found in directory "${o}".\nYou can manually select an AndroidManifest.xml with \`--manifest-path\``)}}if(i.ios){if(!a.includes("ios")){throw new w.CommandError(`iOS project not found in directory "${o}".\nYou can manually select an Info.plist with \`--info-path\``)}}}if(i.android&&!i.manifestPath){try{i.manifestPath=g.getConfigPath(o)}catch(r){if(l){delete i.android}else{throw r}}}if(i.ios&&!i.infoPath){try{i.infoPath=y.getConfigPath(o)}catch(r){if(l){delete i.ios}else{throw r}}}i.uri=r;return i}function run(){i.program.parse(process.argv)}async function commandDidThrowAsync(r){console.log();if(r.command){console.log(h.default.red(`› ${h.default.bold(`npx ${packageJson().name} ${r.command}`)} has failed.`));console.log()}if(r.origin==="uri-scheme"){console.log(h.default.black.bgRed(r.message))}else{console.log("Aborting run");console.log(h.default.black.bgRed`An unexpected error was encountered. Please report it as a bug:`);console.log(r)}console.log();await(0,v.default)();process.exit(1)}},2194:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.isAvailable=isAvailable;i.addAsync=addAsync;i.removeAsync=removeAsync;i.openAsync=openAsync;i.getAsync=getAsync;i.getConfigPath=getConfigPath;i.escapeUri=escapeUri;const h=c(o(7903));const d=u(o(3681));const p=u(o(5642));const g=u(o(8746));const y=u(o(7147));const w=o(8743);const b=c(o(1017));const v=o(3329);const E=["**/@(Carthage|Pods|vendor|node_modules)/**"];function isAvailable(r){const i=(0,w.globSync)("ios/*.xcodeproj",{ignore:E,absolute:true,cwd:r});const o=(0,w.globSync)("*.xcodeproj",{ignore:E,absolute:true,cwd:r});return!!o.length||!!i.length}async function addAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let c=readConfig(l);if(h.hasScheme(r,c)){console.log(g.default.yellow(`› iOS: URI scheme "${r}" already exists in Info.plist at: ${l}`));return false}c=h.appendScheme(r,c);if(a){console.log(g.default.magenta("Write plist to: ",l));console.log(formatConfig(c));return false}writeConfig(l,c);return true}async function removeAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let c=readConfig(l);if(!h.hasScheme(r,c)){console.log(g.default.yellow(`› iOS: URI scheme "${r}" does not exist in Info.plist at: ${l}`));return false}c=h.removeScheme(r,c);if(a){console.log(g.default.magenta("Write plist to: ",l));console.log(formatConfig(c));return false}writeConfig(l,c);return true}async function openAsync({uri:r}){await(0,p.default)("xcrun",["simctl","openurl","booted",r],{stdio:"inherit"})}async function getAsync({projectRoot:r,infoPath:i}){const o=i??getConfigPath(r);const a=y.default.readFileSync(o,"utf8");const l=d.default.parse(a);const c=h.getSchemesFromPlist(l);return c}function getInfoPlistsInDirectory(r){return(0,w.globSync)("*/Info.plist",{ignore:E,absolute:true,cwd:r}).sort(((r,i)=>r.length-i.length))}function getConfigPath(r){const i=getInfoPlistsInDirectory(b.join(r,"ios"));if(i.length){return i[0]}const o=getInfoPlistsInDirectory(r);if(!o.length){throw new v.CommandError(`iOS: No Info.plist found for project at root: ${r}`)}return o[0]}function readConfig(r){const i=y.default.readFileSync(r,"utf8");return{...d.default.parse(i)}}function formatConfig(r){const i={pretty:true,indent:`\t`};const o=d.default.build(r,i);return o}function writeConfig(r,i){y.default.writeFileSync(r,formatConfig(i))}function escapeUri(r){if(!r.includes("?"))return r;const[i,o]=r.split("?",2);const a=new URLSearchParams(o);for(const[r,i]of a.entries()){a.set(r,encodeURIComponent(decodeURIComponent(i)))}return`${i}?${a.toString()}`}},3329:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.CommandError=void 0;class CommandError extends Error{command;origin="uri-scheme";constructor(r,i){super(r);this.command=i}}i.CommandError=CommandError},8522:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getAvailablePlatforms=getAvailablePlatforms;i.addAsync=addAsync;i.removeAsync=removeAsync;i.openAsync=openAsync;i.listAsync=listAsync;const h=u(o(8746));const d=o(7147);const p=o(1017);const g=u(o(1112));const y=c(o(208));const w=c(o(2194));const b=o(3329);function fileExists(r){try{return(0,d.statSync)(r).isFile()}catch{return false}}function getAvailablePlatforms(r){const i=[];if(r.infoPath){if(!fileExists(r.infoPath)){throw new b.CommandError(`Custom Info.plist does not exist at path "${r.infoPath}"`)}i.push("ios")}else if(w.isAvailable(r.projectRoot)){i.push("ios")}if(r.manifestPath){if(!fileExists(r.manifestPath)){throw new b.CommandError(`Custom AndroidManifest.xml does not exist at path "${r.manifestPath}"`)}i.push("android")}else if(y.isAvailable(r.projectRoot)){i.push("android")}return i}function ensureUriString(r){if(!r){throw new b.CommandError("Please supply a URI protocol")}if(typeof r!=="string"){throw new b.CommandError(`URI protocol should be of type string. Instead got: ${typeof r}`)}return r.trim()}async function normalizeUriProtocolAsync(r){const i=ensureUriString(r);const[o]=i.split(":");const a=o.toLowerCase();if(a!==r){if(a){console.log(h.default.yellow(`› Supplied URI protocol "${i}" does not match normalized scheme "${a}".`));const{answer:r}=await(0,g.default)({type:"confirm",name:"answer",message:`Would you like to use "${a}" instead?`,initial:true});if(r)return a}else{throw new b.CommandError(`Supplied URI protocol "${i}" does not appear to be spec compliant: http://www.ietf.org/rfc/rfc2396.txt`)}}return i}async function addAsync(r){r.uri=await normalizeUriProtocolAsync(r.uri);const i=[];let o=false;if(r.ios){if(await w.addAsync(r)){o=true;logPlatformMessage("iOS",`Added URI protocol "${r.uri}" to project`);i.push("ios")}}if(r.android){if(await y.addAsync(r)){o=true;logPlatformMessage("Android",`Added URI protocol "${r.uri}" to project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be added. Please ensure there is a native project available."))}return i}async function removeAsync(r){r.uri=ensureUriString(r.uri);const i=[];let o=false;if(r.ios){if(await w.removeAsync(r)){o=true;logPlatformMessage("iOS",`Removed URI protocol "${r.uri}" from project`);i.push("ios")}}if(r.android){if(await y.removeAsync(r)){o=true;logPlatformMessage("Android",`Removed URI protocol "${r.uri}" from project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be removed. Please ensure there is a native project available."))}return i}async function openAsync(r){r.uri=ensureUriString(r.uri);if(r.ios){if(r.escapeUri)r.uri=w.escapeUri(r.uri);logPlatformMessage("iOS",`Opening URI "${r.uri}" in simulator`);await w.openAsync(r)}if(r.android){if(r.escapeUri)r.uri=y.escapeUri(r.uri);logPlatformMessage("Android",`Opening URI "${r.uri}" in emulator`);await y.openAsync(r)}}async function listAsync(r){let i=false;if(r.infoPath){i=true;const o=await w.getAsync(r);logPlatformMessage("iOS",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.infoPath)}`);logSchemes(o)}if(r.manifestPath){i=true;const o=await y.getAsync(r);logPlatformMessage("Android",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.manifestPath)}`);logSchemes(o)}if(!i){console.log(h.default.yellow("Could not find any native URI schemes to list."))}}function logPlatformMessage(r,i){console.log(h.default.magenta(`› ${h.default.bold(r)}: ${i}`))}function logSchemes(r){for(const i of r)console.log(`${h.default.dim("› ")}${i}${h.default.dim("://")}`);console.log("")}},2855:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();Object.defineProperty(i,"__esModule",{value:true});i.URIScheme=i.Android=i.Ios=i.program=void 0;const u=c(o(208));i.Android=u;const h=c(o(2194));i.Ios=h;const d=c(o(8522));i.URIScheme=d;var p=o(5585);Object.defineProperty(i,"program",{enumerable:true,get:function(){return p.program}})},2586:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i["default"]=shouldUpdate;const l=a(o(8746));const c=a(o(5418));async function shouldUpdate(){const packageJson=()=>o(4147);const r=(0,c.default)(packageJson()).catch((()=>null));try{const i=await r;if(i&&i.latest){const r=packageJson();console.log();console.log(l.default.yellow.bold(`A new version of \`${r.name}\` is available`));console.log("You can update by running: "+l.default.cyan(`npm i -g ${r.name}`));console.log()}}catch{}}},9491:r=>{"use strict";r.exports=require("assert")},4300:r=>{"use strict";r.exports=require("buffer")},2081:r=>{"use strict";r.exports=require("child_process")},2361:r=>{"use strict";r.exports=require("events")},7147:r=>{"use strict";r.exports=require("fs")},3685:r=>{"use strict";r.exports=require("http")},5687:r=>{"use strict";r.exports=require("https")},7718:r=>{"use strict";r.exports=require("node:child_process")},5673:r=>{"use strict";r.exports=require("node:events")},7561:r=>{"use strict";r.exports=require("node:fs")},3977:r=>{"use strict";r.exports=require("node:fs/promises")},9411:r=>{"use strict";r.exports=require("node:path")},7742:r=>{"use strict";r.exports=require("node:process")},4492:r=>{"use strict";r.exports=require("node:stream")},6915:r=>{"use strict";r.exports=require("node:string_decoder")},1041:r=>{"use strict";r.exports=require("node:url")},2037:r=>{"use strict";r.exports=require("os")},1017:r=>{"use strict";r.exports=require("path")},4521:r=>{"use strict";r.exports=require("readline")},2781:r=>{"use strict";r.exports=require("stream")},1576:r=>{"use strict";r.exports=require("string_decoder")},9512:r=>{"use strict";r.exports=require("timers")},6224:r=>{"use strict";r.exports=require("tty")},7310:r=>{"use strict";r.exports=require("url")},3837:r=>{"use strict";r.exports=require("util")},1776:(r,i,o)=>{const{Argument:a}=o(5e3);const{Command:l}=o(8966);const{CommanderError:c,InvalidArgumentError:u}=o(2315);const{Help:h}=o(9320);const{Option:d}=o(4790);i.program=new l;i.createCommand=r=>new l(r);i.createOption=(r,i)=>new d(r,i);i.createArgument=(r,i)=>new a(r,i);i.Command=l;i.Option=d;i.Argument=a;i.Help=h;i.CommanderError=c;i.InvalidArgumentError=u;i.InvalidOptionArgumentError=u},5e3:(r,i,o)=>{const{InvalidArgumentError:a}=o(2315);class Argument{constructor(r,i){this.description=i||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(r[0]){case"<":this.required=true;this._name=r.slice(1,-1);break;case"[":this.required=false;this._name=r.slice(1,-1);break;default:this.required=true;this._name=r;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(r,i){if(i===this.defaultValue||!Array.isArray(i)){return[r]}return i.concat(r)}default(r,i){this.defaultValue=r;this.defaultValueDescription=i;return this}argParser(r){this.parseArg=r;return this}choices(r){this.argChoices=r.slice();this.parseArg=(r,i)=>{if(!this.argChoices.includes(r)){throw new a(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(r,i)}return r};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(r){const i=r.name()+(r.variadic===true?"...":"");return r.required?"<"+i+">":"["+i+"]"}i.Argument=Argument;i.humanReadableArgName=humanReadableArgName},8966:(r,i,o)=>{const a=o(5673).EventEmitter;const l=o(7718);const c=o(9411);const u=o(7561);const h=o(7742);const{Argument:d,humanReadableArgName:p}=o(5e3);const{CommanderError:g}=o(2315);const{Help:y}=o(9320);const{Option:w,DualOptions:b}=o(4790);const{suggestSimilar:v}=o(1492);class Command extends a{constructor(r){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=r||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:r=>h.stdout.write(r),writeErr:r=>h.stderr.write(r),getOutHelpWidth:()=>h.stdout.isTTY?h.stdout.columns:undefined,getErrHelpWidth:()=>h.stderr.isTTY?h.stderr.columns:undefined,outputError:(r,i)=>i(r)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(r){this._outputConfiguration=r._outputConfiguration;this._helpOption=r._helpOption;this._helpCommand=r._helpCommand;this._helpConfiguration=r._helpConfiguration;this._exitCallback=r._exitCallback;this._storeOptionsAsProperties=r._storeOptionsAsProperties;this._combineFlagAndOptionalValue=r._combineFlagAndOptionalValue;this._allowExcessArguments=r._allowExcessArguments;this._enablePositionalOptions=r._enablePositionalOptions;this._showHelpAfterError=r._showHelpAfterError;this._showSuggestionAfterError=r._showSuggestionAfterError;return this}_getCommandAndAncestors(){const r=[];for(let i=this;i;i=i.parent){r.push(i)}return r}command(r,i,o){let a=i;let l=o;if(typeof a==="object"&&a!==null){l=a;a=null}l=l||{};const[,c,u]=r.match(/([^ ]+) *(.*)/);const h=this.createCommand(c);if(a){h.description(a);h._executableHandler=true}if(l.isDefault)this._defaultCommandName=h._name;h._hidden=!!(l.noHelp||l.hidden);h._executableFile=l.executableFile||null;if(u)h.arguments(u);this._registerCommand(h);h.parent=this;h.copyInheritedSettings(this);if(a)return this;return h}createCommand(r){return new Command(r)}createHelp(){return Object.assign(new y,this.configureHelp())}configureHelp(r){if(r===undefined)return this._helpConfiguration;this._helpConfiguration=r;return this}configureOutput(r){if(r===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,r);return this}showHelpAfterError(r=true){if(typeof r!=="string")r=!!r;this._showHelpAfterError=r;return this}showSuggestionAfterError(r=true){this._showSuggestionAfterError=!!r;return this}addCommand(r,i){if(!r._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}i=i||{};if(i.isDefault)this._defaultCommandName=r._name;if(i.noHelp||i.hidden)r._hidden=true;this._registerCommand(r);r.parent=this;r._checkForBrokenPassThrough();return this}createArgument(r,i){return new d(r,i)}argument(r,i,o,a){const l=this.createArgument(r,i);if(typeof o==="function"){l.default(a).argParser(o)}else{l.default(o)}this.addArgument(l);return this}arguments(r){r.trim().split(/ +/).forEach((r=>{this.argument(r)}));return this}addArgument(r){const i=this.registeredArguments.slice(-1)[0];if(i&&i.variadic){throw new Error(`only the last argument can be variadic '${i.name()}'`)}if(r.required&&r.defaultValue!==undefined&&r.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${r.name()}'`)}this.registeredArguments.push(r);return this}helpCommand(r,i){if(typeof r==="boolean"){this._addImplicitHelpCommand=r;return this}r=r??"help [command]";const[,o,a]=r.match(/([^ ]+) *(.*)/);const l=i??"display help for command";const c=this.createCommand(o);c.helpOption(false);if(a)c.arguments(a);if(l)c.description(l);this._addImplicitHelpCommand=true;this._helpCommand=c;return this}addHelpCommand(r,i){if(typeof r!=="object"){this.helpCommand(r,i);return this}this._addImplicitHelpCommand=true;this._helpCommand=r;return this}_getHelpCommand(){const r=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(r){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(r,i){const o=["preSubcommand","preAction","postAction"];if(!o.includes(r)){throw new Error(`Unexpected value for event passed to hook : '${r}'.\nExpecting one of '${o.join("', '")}'`)}if(this._lifeCycleHooks[r]){this._lifeCycleHooks[r].push(i)}else{this._lifeCycleHooks[r]=[i]}return this}exitOverride(r){if(r){this._exitCallback=r}else{this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync"){throw r}else{}}}return this}_exit(r,i,o){if(this._exitCallback){this._exitCallback(new g(r,i,o))}h.exit(r)}action(r){const listener=i=>{const o=this.registeredArguments.length;const a=i.slice(0,o);if(this._storeOptionsAsProperties){a[o]=this}else{a[o]=this.opts()}a.push(this);return r.apply(this,a)};this._actionHandler=listener;return this}createOption(r,i){return new w(r,i)}_callParseArg(r,i,o,a){try{return r.parseArg(i,o)}catch(r){if(r.code==="commander.invalidArgument"){const i=`${a} ${r.message}`;this.error(i,{exitCode:r.exitCode,code:r.code})}throw r}}_registerOption(r){const i=r.short&&this._findOption(r.short)||r.long&&this._findOption(r.long);if(i){const o=r.long&&this._findOption(r.long)?r.long:r.short;throw new Error(`Cannot add option '${r.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'\n- already used by option '${i.flags}'`)}this.options.push(r)}_registerCommand(r){const knownBy=r=>[r.name()].concat(r.aliases());const i=knownBy(r).find((r=>this._findCommand(r)));if(i){const o=knownBy(this._findCommand(i)).join("|");const a=knownBy(r).join("|");throw new Error(`cannot add command '${a}' as already have command '${o}'`)}this.commands.push(r)}addOption(r){this._registerOption(r);const i=r.name();const o=r.attributeName();if(r.negate){const i=r.long.replace(/^--no-/,"--");if(!this._findOption(i)){this.setOptionValueWithSource(o,r.defaultValue===undefined?true:r.defaultValue,"default")}}else if(r.defaultValue!==undefined){this.setOptionValueWithSource(o,r.defaultValue,"default")}const handleOptionValue=(i,a,l)=>{if(i==null&&r.presetArg!==undefined){i=r.presetArg}const c=this.getOptionValue(o);if(i!==null&&r.parseArg){i=this._callParseArg(r,i,c,a)}else if(i!==null&&r.variadic){i=r._concatValue(i,c)}if(i==null){if(r.negate){i=false}else if(r.isBoolean()||r.optional){i=true}else{i=""}}this.setOptionValueWithSource(o,i,l)};this.on("option:"+i,(i=>{const o=`error: option '${r.flags}' argument '${i}' is invalid.`;handleOptionValue(i,o,"cli")}));if(r.envVar){this.on("optionEnv:"+i,(i=>{const o=`error: option '${r.flags}' value '${i}' from env '${r.envVar}' is invalid.`;handleOptionValue(i,o,"env")}))}return this}_optionEx(r,i,o,a,l){if(typeof i==="object"&&i instanceof w){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const c=this.createOption(i,o);c.makeOptionMandatory(!!r.mandatory);if(typeof a==="function"){c.default(l).argParser(a)}else if(a instanceof RegExp){const r=a;a=(i,o)=>{const a=r.exec(i);return a?a[0]:o};c.default(l).argParser(a)}else{c.default(a)}return this.addOption(c)}option(r,i,o,a){return this._optionEx({},r,i,o,a)}requiredOption(r,i,o,a){return this._optionEx({mandatory:true},r,i,o,a)}combineFlagAndOptionalValue(r=true){this._combineFlagAndOptionalValue=!!r;return this}allowUnknownOption(r=true){this._allowUnknownOption=!!r;return this}allowExcessArguments(r=true){this._allowExcessArguments=!!r;return this}enablePositionalOptions(r=true){this._enablePositionalOptions=!!r;return this}passThroughOptions(r=true){this._passThroughOptions=!!r;this._checkForBrokenPassThrough();return this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions){throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}}storeOptionsAsProperties(r=true){if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}if(Object.keys(this._optionValues).length){throw new Error("call .storeOptionsAsProperties() before setting option values")}this._storeOptionsAsProperties=!!r;return this}getOptionValue(r){if(this._storeOptionsAsProperties){return this[r]}return this._optionValues[r]}setOptionValue(r,i){return this.setOptionValueWithSource(r,i,undefined)}setOptionValueWithSource(r,i,o){if(this._storeOptionsAsProperties){this[r]=i}else{this._optionValues[r]=i}this._optionValueSources[r]=o;return this}getOptionValueSource(r){return this._optionValueSources[r]}getOptionValueSourceWithGlobals(r){let i;this._getCommandAndAncestors().forEach((o=>{if(o.getOptionValueSource(r)!==undefined){i=o.getOptionValueSource(r)}}));return i}_prepareUserArgs(r,i){if(r!==undefined&&!Array.isArray(r)){throw new Error("first parameter to parse must be array or undefined")}i=i||{};if(r===undefined&&i.from===undefined){if(h.versions?.electron){i.from="electron"}const r=h.execArgv??[];if(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print")){i.from="eval"}}if(r===undefined){r=h.argv}this.rawArgs=r.slice();let o;switch(i.from){case undefined:case"node":this._scriptPath=r[1];o=r.slice(2);break;case"electron":if(h.defaultApp){this._scriptPath=r[1];o=r.slice(2)}else{o=r.slice(1)}break;case"user":o=r.slice(0);break;case"eval":o=r.slice(1);break;default:throw new Error(`unexpected parse option { from: '${i.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return o}parse(r,i){const o=this._prepareUserArgs(r,i);this._parseCommand([],o);return this}async parseAsync(r,i){const o=this._prepareUserArgs(r,i);await this._parseCommand([],o);return this}_executeSubCommand(r,i){i=i.slice();let o=false;const a=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(r,i){const o=c.resolve(r,i);if(u.existsSync(o))return o;if(a.includes(c.extname(i)))return undefined;const l=a.find((r=>u.existsSync(`${o}${r}`)));if(l)return`${o}${l}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let d=r._executableFile||`${this._name}-${r._name}`;let p=this._executableDir||"";if(this._scriptPath){let r;try{r=u.realpathSync(this._scriptPath)}catch(i){r=this._scriptPath}p=c.resolve(c.dirname(r),p)}if(p){let i=findFile(p,d);if(!i&&!r._executableFile&&this._scriptPath){const o=c.basename(this._scriptPath,c.extname(this._scriptPath));if(o!==this._name){i=findFile(p,`${o}-${r._name}`)}}d=i||d}o=a.includes(c.extname(d));let y;if(h.platform!=="win32"){if(o){i.unshift(d);i=incrementNodeInspectorPort(h.execArgv).concat(i);y=l.spawn(h.argv[0],i,{stdio:"inherit"})}else{y=l.spawn(d,i,{stdio:"inherit"})}}else{i.unshift(d);i=incrementNodeInspectorPort(h.execArgv).concat(i);y=l.spawn(h.execPath,i,{stdio:"inherit"})}if(!y.killed){const r=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];r.forEach((r=>{h.on(r,(()=>{if(y.killed===false&&y.exitCode===null){y.kill(r)}}))}))}const w=this._exitCallback;y.on("close",(r=>{r=r??1;if(!w){h.exit(r)}else{w(new g(r,"commander.executeSubCommandAsync","(close)"))}}));y.on("error",(i=>{if(i.code==="ENOENT"){const i=p?`searched for local subcommand relative to directory '${p}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const o=`'${d}' does not exist\n - if '${r._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${i}`;throw new Error(o)}else if(i.code==="EACCES"){throw new Error(`'${d}' not executable`)}if(!w){h.exit(1)}else{const r=new g(1,"commander.executeSubCommandAsync","(error)");r.nestedError=i;w(r)}}));this.runningCommand=y}_dispatchSubcommand(r,i,o){const a=this._findCommand(r);if(!a)this.help({error:true});let l;l=this._chainOrCallSubCommandHook(l,a,"preSubcommand");l=this._chainOrCall(l,(()=>{if(a._executableHandler){this._executeSubCommand(a,i.concat(o))}else{return a._parseCommand(i,o)}}));return l}_dispatchHelpCommand(r){if(!r){this.help()}const i=this._findCommand(r);if(i&&!i._executableHandler){i.help()}return this._dispatchSubcommand(r,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((r,i)=>{if(r.required&&this.args[i]==null){this.missingArgument(r.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(r,i,o)=>{let a=i;if(i!==null&&r.parseArg){const l=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;a=this._callParseArg(r,i,o,l)}return a};this._checkNumberOfArguments();const r=[];this.registeredArguments.forEach(((i,o)=>{let a=i.defaultValue;if(i.variadic){if(o<this.args.length){a=this.args.slice(o);if(i.parseArg){a=a.reduce(((r,o)=>myParseArg(i,o,r)),i.defaultValue)}}else if(a===undefined){a=[]}}else if(o<this.args.length){a=this.args[o];if(i.parseArg){a=myParseArg(i,a,i.defaultValue)}}r[o]=a}));this.processedArgs=r}_chainOrCall(r,i){if(r&&r.then&&typeof r.then==="function"){return r.then((()=>i()))}return i()}_chainOrCallHooks(r,i){let o=r;const a=[];this._getCommandAndAncestors().reverse().filter((r=>r._lifeCycleHooks[i]!==undefined)).forEach((r=>{r._lifeCycleHooks[i].forEach((i=>{a.push({hookedCommand:r,callback:i})}))}));if(i==="postAction"){a.reverse()}a.forEach((r=>{o=this._chainOrCall(o,(()=>r.callback(r.hookedCommand,this)))}));return o}_chainOrCallSubCommandHook(r,i,o){let a=r;if(this._lifeCycleHooks[o]!==undefined){this._lifeCycleHooks[o].forEach((r=>{a=this._chainOrCall(a,(()=>r(this,i)))}))}return a}_parseCommand(r,i){const o=this.parseOptions(i);this._parseOptionsEnv();this._parseOptionsImplied();r=r.concat(o.operands);i=o.unknown;this.args=r.concat(i);if(r&&this._findCommand(r[0])){return this._dispatchSubcommand(r[0],r.slice(1),i)}if(this._getHelpCommand()&&r[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(r[1])}if(this._defaultCommandName){this._outputHelpIfRequested(i);return this._dispatchSubcommand(this._defaultCommandName,r,i)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(o.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(o.unknown.length>0){this.unknownOption(o.unknown[0])}};const a=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let o;o=this._chainOrCallHooks(o,"preAction");o=this._chainOrCall(o,(()=>this._actionHandler(this.processedArgs)));if(this.parent){o=this._chainOrCall(o,(()=>{this.parent.emit(a,r,i)}))}o=this._chainOrCallHooks(o,"postAction");return o}if(this.parent&&this.parent.listenerCount(a)){checkForUnknownOptions();this._processArguments();this.parent.emit(a,r,i)}else if(r.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",r,i)}if(this.listenerCount("command:*")){this.emit("command:*",r,i)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(r){if(!r)return undefined;return this.commands.find((i=>i._name===r||i._aliases.includes(r)))}_findOption(r){return this.options.find((i=>i.is(r)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((r=>{r.options.forEach((i=>{if(i.mandatory&&r.getOptionValue(i.attributeName())===undefined){r.missingMandatoryOptionValue(i)}}))}))}_checkForConflictingLocalOptions(){const r=this.options.filter((r=>{const i=r.attributeName();if(this.getOptionValue(i)===undefined){return false}return this.getOptionValueSource(i)!=="default"}));const i=r.filter((r=>r.conflictsWith.length>0));i.forEach((i=>{const o=r.find((r=>i.conflictsWith.includes(r.attributeName())));if(o){this._conflictingOption(i,o)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((r=>{r._checkForConflictingLocalOptions()}))}parseOptions(r){const i=[];const o=[];let a=i;const l=r.slice();function maybeOption(r){return r.length>1&&r[0]==="-"}let c=null;while(l.length){const r=l.shift();if(r==="--"){if(a===o)a.push(r);a.push(...l);break}if(c&&!maybeOption(r)){this.emit(`option:${c.name()}`,r);continue}c=null;if(maybeOption(r)){const i=this._findOption(r);if(i){if(i.required){const r=l.shift();if(r===undefined)this.optionMissingArgument(i);this.emit(`option:${i.name()}`,r)}else if(i.optional){let r=null;if(l.length>0&&!maybeOption(l[0])){r=l.shift()}this.emit(`option:${i.name()}`,r)}else{this.emit(`option:${i.name()}`)}c=i.variadic?i:null;continue}}if(r.length>2&&r[0]==="-"&&r[1]!=="-"){const i=this._findOption(`-${r[1]}`);if(i){if(i.required||i.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${i.name()}`,r.slice(2))}else{this.emit(`option:${i.name()}`);l.unshift(`-${r.slice(2)}`)}continue}}if(/^--[^=]+=/.test(r)){const i=r.indexOf("=");const o=this._findOption(r.slice(0,i));if(o&&(o.required||o.optional)){this.emit(`option:${o.name()}`,r.slice(i+1));continue}}if(maybeOption(r)){a=o}if((this._enablePositionalOptions||this._passThroughOptions)&&i.length===0&&o.length===0){if(this._findCommand(r)){i.push(r);if(l.length>0)o.push(...l);break}else if(this._getHelpCommand()&&r===this._getHelpCommand().name()){i.push(r);if(l.length>0)i.push(...l);break}else if(this._defaultCommandName){o.push(r);if(l.length>0)o.push(...l);break}}if(this._passThroughOptions){a.push(r);if(l.length>0)a.push(...l);break}a.push(r)}return{operands:i,unknown:o}}opts(){if(this._storeOptionsAsProperties){const r={};const i=this.options.length;for(let o=0;o<i;o++){const i=this.options[o].attributeName();r[i]=i===this._versionOptionName?this._version:this[i]}return r}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((r,i)=>Object.assign(r,i.opts())),{})}error(r,i){this._outputConfiguration.outputError(`${r}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const o=i||{};const a=o.exitCode||1;const l=o.code||"commander.error";this._exit(a,l,r)}_parseOptionsEnv(){this.options.forEach((r=>{if(r.envVar&&r.envVar in h.env){const i=r.attributeName();if(this.getOptionValue(i)===undefined||["default","config","env"].includes(this.getOptionValueSource(i))){if(r.required||r.optional){this.emit(`optionEnv:${r.name()}`,h.env[r.envVar])}else{this.emit(`optionEnv:${r.name()}`)}}}}))}_parseOptionsImplied(){const r=new b(this.options);const hasCustomOptionValue=r=>this.getOptionValue(r)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter((i=>i.implied!==undefined&&hasCustomOptionValue(i.attributeName())&&r.valueFromOption(this.getOptionValue(i.attributeName()),i))).forEach((r=>{Object.keys(r.implied).filter((r=>!hasCustomOptionValue(r))).forEach((i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")}))}))}missingArgument(r){const i=`error: missing required argument '${r}'`;this.error(i,{code:"commander.missingArgument"})}optionMissingArgument(r){const i=`error: option '${r.flags}' argument missing`;this.error(i,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(r){const i=`error: required option '${r.flags}' not specified`;this.error(i,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(r,i){const findBestOptionFromValue=r=>{const i=r.attributeName();const o=this.getOptionValue(i);const a=this.options.find((r=>r.negate&&i===r.attributeName()));const l=this.options.find((r=>!r.negate&&i===r.attributeName()));if(a&&(a.presetArg===undefined&&o===false||a.presetArg!==undefined&&o===a.presetArg)){return a}return l||r};const getErrorMessage=r=>{const i=findBestOptionFromValue(r);const o=i.attributeName();const a=this.getOptionValueSource(o);if(a==="env"){return`environment variable '${i.envVar}'`}return`option '${i.flags}'`};const o=`error: ${getErrorMessage(r)} cannot be used with ${getErrorMessage(i)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(r){if(this._allowUnknownOption)return;let i="";if(r.startsWith("--")&&this._showSuggestionAfterError){let o=[];let a=this;do{const r=a.createHelp().visibleOptions(a).filter((r=>r.long)).map((r=>r.long));o=o.concat(r);a=a.parent}while(a&&!a._enablePositionalOptions);i=v(r,o)}const o=`error: unknown option '${r}'${i}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(r){if(this._allowExcessArguments)return;const i=this.registeredArguments.length;const o=i===1?"":"s";const a=this.parent?` for '${this.name()}'`:"";const l=`error: too many arguments${a}. Expected ${i} argument${o} but got ${r.length}.`;this.error(l,{code:"commander.excessArguments"})}unknownCommand(){const r=this.args[0];let i="";if(this._showSuggestionAfterError){const o=[];this.createHelp().visibleCommands(this).forEach((r=>{o.push(r.name());if(r.alias())o.push(r.alias())}));i=v(r,o)}const o=`error: unknown command '${r}'${i}`;this.error(o,{code:"commander.unknownCommand"})}version(r,i,o){if(r===undefined)return this._version;this._version=r;i=i||"-V, --version";o=o||"output the version number";const a=this.createOption(i,o);this._versionOptionName=a.attributeName();this._registerOption(a);this.on("option:"+a.name(),(()=>{this._outputConfiguration.writeOut(`${r}\n`);this._exit(0,"commander.version",r)}));return this}description(r,i){if(r===undefined&&i===undefined)return this._description;this._description=r;if(i){this._argsDescription=i}return this}summary(r){if(r===undefined)return this._summary;this._summary=r;return this}alias(r){if(r===undefined)return this._aliases[0];let i=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){i=this.commands[this.commands.length-1]}if(r===i._name)throw new Error("Command alias can't be the same as its name");const o=this.parent?._findCommand(r);if(o){const i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${r}' to command '${this.name()}' as already have command '${i}'`)}i._aliases.push(r);return this}aliases(r){if(r===undefined)return this._aliases;r.forEach((r=>this.alias(r)));return this}usage(r){if(r===undefined){if(this._usage)return this._usage;const r=this.registeredArguments.map((r=>p(r)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}this._usage=r;return this}name(r){if(r===undefined)return this._name;this._name=r;return this}nameFromFilename(r){this._name=c.basename(r,c.extname(r));return this}executableDir(r){if(r===undefined)return this._executableDir;this._executableDir=r;return this}helpInformation(r){const i=this.createHelp();if(i.helpWidth===undefined){i.helpWidth=r&&r.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return i.formatHelp(this,i)}_getHelpContext(r){r=r||{};const i={error:!!r.error};let o;if(i.error){o=r=>this._outputConfiguration.writeErr(r)}else{o=r=>this._outputConfiguration.writeOut(r)}i.write=r.write||o;i.command=this;return i}outputHelp(r){let i;if(typeof r==="function"){i=r;r=undefined}const o=this._getHelpContext(r);this._getCommandAndAncestors().reverse().forEach((r=>r.emit("beforeAllHelp",o)));this.emit("beforeHelp",o);let a=this.helpInformation(o);if(i){a=i(a);if(typeof a!=="string"&&!Buffer.isBuffer(a)){throw new Error("outputHelp callback must return a string or a Buffer")}}o.write(a);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",o);this._getCommandAndAncestors().forEach((r=>r.emit("afterAllHelp",o)))}helpOption(r,i){if(typeof r==="boolean"){if(r){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}r=r??"-h, --help";i=i??"display help for command";this._helpOption=this.createOption(r,i);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(r){this._helpOption=r;return this}help(r){this.outputHelp(r);let i=h.exitCode||0;if(i===0&&r&&typeof r!=="function"&&r.error){i=1}this._exit(i,"commander.help","(outputHelp)")}addHelpText(r,i){const o=["beforeAll","before","after","afterAll"];if(!o.includes(r)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${o.join("', '")}'`)}const a=`${r}Help`;this.on(a,(r=>{let o;if(typeof i==="function"){o=i({error:r.error,command:r.command})}else{o=i}if(o){r.write(`${o}\n`)}}));return this}_outputHelpIfRequested(r){const i=this._getHelpOption();const o=i&&r.find((r=>i.is(r)));if(o){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(r){return r.map((r=>{if(!r.startsWith("--inspect")){return r}let i;let o="127.0.0.1";let a="9229";let l;if((l=r.match(/^(--inspect(-brk)?)$/))!==null){i=l[1]}else if((l=r.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){i=l[1];if(/^\d+$/.test(l[3])){a=l[3]}else{o=l[3]}}else if((l=r.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){i=l[1];o=l[3];a=l[4]}if(i&&a!=="0"){return`${i}=${o}:${parseInt(a)+1}`}return r}))}i.Command=Command},2315:(r,i)=>{class CommanderError extends Error{constructor(r,i,o){super(o);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=i;this.exitCode=r;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(r){super(1,"commander.invalidArgument",r);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}i.CommanderError=CommanderError;i.InvalidArgumentError=InvalidArgumentError},9320:(r,i,o)=>{const{humanReadableArgName:a}=o(5e3);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(r){const i=r.commands.filter((r=>!r._hidden));const o=r._getHelpCommand();if(o&&!o._hidden){i.push(o)}if(this.sortSubcommands){i.sort(((r,i)=>r.name().localeCompare(i.name())))}return i}compareOptions(r,i){const getSortKey=r=>r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"");return getSortKey(r).localeCompare(getSortKey(i))}visibleOptions(r){const i=r.options.filter((r=>!r.hidden));const o=r._getHelpOption();if(o&&!o.hidden){const a=o.short&&r._findOption(o.short);const l=o.long&&r._findOption(o.long);if(!a&&!l){i.push(o)}else if(o.long&&!l){i.push(r.createOption(o.long,o.description))}else if(o.short&&!a){i.push(r.createOption(o.short,o.description))}}if(this.sortOptions){i.sort(this.compareOptions)}return i}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];const i=[];for(let o=r.parent;o;o=o.parent){const r=o.options.filter((r=>!r.hidden));i.push(...r)}if(this.sortOptions){i.sort(this.compareOptions)}return i}visibleArguments(r){if(r._argsDescription){r.registeredArguments.forEach((i=>{i.description=i.description||r._argsDescription[i.name()]||""}))}if(r.registeredArguments.find((r=>r.description))){return r.registeredArguments}return[]}subcommandTerm(r){const i=r.registeredArguments.map((r=>a(r))).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,i){return i.visibleCommands(r).reduce(((r,o)=>Math.max(r,i.subcommandTerm(o).length)),0)}longestOptionTermLength(r,i){return i.visibleOptions(r).reduce(((r,o)=>Math.max(r,i.optionTerm(o).length)),0)}longestGlobalOptionTermLength(r,i){return i.visibleGlobalOptions(r).reduce(((r,o)=>Math.max(r,i.optionTerm(o).length)),0)}longestArgumentTermLength(r,i){return i.visibleArguments(r).reduce(((r,o)=>Math.max(r,i.argumentTerm(o).length)),0)}commandUsage(r){let i=r._name;if(r._aliases[0]){i=i+"|"+r._aliases[0]}let o="";for(let i=r.parent;i;i=i.parent){o=i.name()+" "+o}return o+i+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){const i=[];if(r.argChoices){i.push(`choices: ${r.argChoices.map((r=>JSON.stringify(r))).join(", ")}`)}if(r.defaultValue!==undefined){const o=r.required||r.optional||r.isBoolean()&&typeof r.defaultValue==="boolean";if(o){i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`)}}if(r.presetArg!==undefined&&r.optional){i.push(`preset: ${JSON.stringify(r.presetArg)}`)}if(r.envVar!==undefined){i.push(`env: ${r.envVar}`)}if(i.length>0){return`${r.description} (${i.join(", ")})`}return r.description}argumentDescription(r){const i=[];if(r.argChoices){i.push(`choices: ${r.argChoices.map((r=>JSON.stringify(r))).join(", ")}`)}if(r.defaultValue!==undefined){i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`)}if(i.length>0){const o=`(${i.join(", ")})`;if(r.description){return`${r.description} ${o}`}return o}return r.description}formatHelp(r,i){const o=i.padWidth(r,i);const a=i.helpWidth||80;const l=2;const c=2;function formatItem(r,u){if(u){const h=`${r.padEnd(o+c)}${u}`;return i.wrap(h,a-l,o+c)}return r}function formatList(r){return r.join("\n").replace(/^/gm," ".repeat(l))}let u=[`Usage: ${i.commandUsage(r)}`,""];const h=i.commandDescription(r);if(h.length>0){u=u.concat([i.wrap(h,a,0),""])}const d=i.visibleArguments(r).map((r=>formatItem(i.argumentTerm(r),i.argumentDescription(r))));if(d.length>0){u=u.concat(["Arguments:",formatList(d),""])}const p=i.visibleOptions(r).map((r=>formatItem(i.optionTerm(r),i.optionDescription(r))));if(p.length>0){u=u.concat(["Options:",formatList(p),""])}if(this.showGlobalOptions){const o=i.visibleGlobalOptions(r).map((r=>formatItem(i.optionTerm(r),i.optionDescription(r))));if(o.length>0){u=u.concat(["Global Options:",formatList(o),""])}}const g=i.visibleCommands(r).map((r=>formatItem(i.subcommandTerm(r),i.subcommandDescription(r))));if(g.length>0){u=u.concat(["Commands:",formatList(g),""])}return u.join("\n")}padWidth(r,i){return Math.max(i.longestOptionTermLength(r,i),i.longestGlobalOptionTermLength(r,i),i.longestSubcommandTermLength(r,i),i.longestArgumentTermLength(r,i))}wrap(r,i,o,a=40){const l=" \\f\\t\\v   -    \ufeff";const c=new RegExp(`[\\n][${l}]+`);if(r.match(c))return r;const u=i-o;if(u<a)return r;const h=r.slice(0,o);const d=r.slice(o).replace("\r\n","\n");const p=" ".repeat(o);const g="​";const y=`\\s${g}`;const w=new RegExp(`\n|.{1,${u-1}}([${y}]|$)|[^${y}]+?([${y}]|$)`,"g");const b=d.match(w)||[];return h+b.map(((r,i)=>{if(r==="\n")return"";return(i>0?p:"")+r.trimEnd()})).join("\n")}}i.Help=Help},4790:(r,i,o)=>{const{InvalidArgumentError:a}=o(2315);class Option{constructor(r,i){this.flags=r;this.description=i||"";this.required=r.includes("<");this.optional=r.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(r);this.mandatory=false;const o=splitOptionFlags(r);this.short=o.shortFlag;this.long=o.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(r,i){this.defaultValue=r;this.defaultValueDescription=i;return this}preset(r){this.presetArg=r;return this}conflicts(r){this.conflictsWith=this.conflictsWith.concat(r);return this}implies(r){let i=r;if(typeof r==="string"){i={[r]:true}}this.implied=Object.assign(this.implied||{},i);return this}env(r){this.envVar=r;return this}argParser(r){this.parseArg=r;return this}makeOptionMandatory(r=true){this.mandatory=!!r;return this}hideHelp(r=true){this.hidden=!!r;return this}_concatValue(r,i){if(i===this.defaultValue||!Array.isArray(i)){return[r]}return i.concat(r)}choices(r){this.argChoices=r.slice();this.parseArg=(r,i)=>{if(!this.argChoices.includes(r)){throw new a(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(r,i)}return r};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(r){return this.short===r||this.long===r}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(r){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;r.forEach((r=>{if(r.negate){this.negativeOptions.set(r.attributeName(),r)}else{this.positiveOptions.set(r.attributeName(),r)}}));this.negativeOptions.forEach(((r,i)=>{if(this.positiveOptions.has(i)){this.dualOptions.add(i)}}))}valueFromOption(r,i){const o=i.attributeName();if(!this.dualOptions.has(o))return true;const a=this.negativeOptions.get(o).presetArg;const l=a!==undefined?a:false;return i.negate===(l===r)}}function camelcase(r){return r.split("-").reduce(((r,i)=>r+i[0].toUpperCase()+i.slice(1)))}function splitOptionFlags(r){let i;let o;const a=r.split(/[ |,]+/);if(a.length>1&&!/^[[<]/.test(a[1]))i=a.shift();o=a.shift();if(!i&&/^-[^-]$/.test(o)){i=o;o=undefined}return{shortFlag:i,longFlag:o}}i.Option=Option;i.DualOptions=DualOptions},1492:(r,i)=>{const o=3;function editDistance(r,i){if(Math.abs(r.length-i.length)>o)return Math.max(r.length,i.length);const a=[];for(let i=0;i<=r.length;i++){a[i]=[i]}for(let r=0;r<=i.length;r++){a[0][r]=r}for(let o=1;o<=i.length;o++){for(let l=1;l<=r.length;l++){let c=1;if(r[l-1]===i[o-1]){c=0}else{c=1}a[l][o]=Math.min(a[l-1][o]+1,a[l][o-1]+1,a[l-1][o-1]+c);if(l>1&&o>1&&r[l-1]===i[o-2]&&r[l-2]===i[o-1]){a[l][o]=Math.min(a[l][o],a[l-2][o-2]+1)}}}return a[r.length][i.length]}function suggestSimilar(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const a=r.startsWith("--");if(a){r=r.slice(2);i=i.map((r=>r.slice(2)))}let l=[];let c=o;const u=.4;i.forEach((i=>{if(i.length<=1)return;const o=editDistance(r,i);const a=Math.max(r.length,i.length);const h=(a-o)/a;if(h>u){if(o<c){c=o;l=[i]}else if(o===c){l.push(i)}}}));l.sort(((r,i)=>r.localeCompare(i)));if(a){l=l.map((r=>`--${r}`))}if(l.length>1){return`\n(Did you mean one of ${l.join(", ")}?)`}if(l.length===1){return`\n(Did you mean ${l[0]}?)`}return""}i.suggestSimilar=suggestSimilar},5014:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Glob=void 0;const a=o(542);const l=o(1041);const c=o(5715);const u=o(2499);const h=o(9660);const d=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(r,i){if(!i)throw new TypeError("glob options required");this.withFileTypes=!!i.withFileTypes;this.signal=i.signal;this.follow=!!i.follow;this.dot=!!i.dot;this.dotRelative=!!i.dotRelative;this.nodir=!!i.nodir;this.mark=!!i.mark;if(!i.cwd){this.cwd=""}else if(i.cwd instanceof URL||i.cwd.startsWith("file://")){i.cwd=(0,l.fileURLToPath)(i.cwd)}this.cwd=i.cwd||"";this.root=i.root;this.magicalBraces=!!i.magicalBraces;this.nobrace=!!i.nobrace;this.noext=!!i.noext;this.realpath=!!i.realpath;this.absolute=i.absolute;this.includeChildMatches=i.includeChildMatches!==false;this.noglobstar=!!i.noglobstar;this.matchBase=!!i.matchBase;this.maxDepth=typeof i.maxDepth==="number"?i.maxDepth:Infinity;this.stat=!!i.stat;this.ignore=i.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof r==="string"){r=[r]}this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){r=r.map((r=>r.replace(/\\/g,"/")))}if(this.matchBase){if(i.noglobstar){throw new TypeError("base matching requires globstar")}r=r.map((r=>r.includes("/")?r:`./**/${r}`))}this.pattern=r;this.platform=i.platform||d;this.opts={...i,platform:this.platform};if(i.scurry){this.scurry=i.scurry;if(i.nocase!==undefined&&i.nocase!==i.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const r=i.platform==="win32"?c.PathScurryWin32:i.platform==="darwin"?c.PathScurryDarwin:i.platform?c.PathScurryPosix:c.PathScurry;this.scurry=new r(this.cwd,{nocase:i.nocase,fs:i.fs})}this.nocase=this.scurry.nocase;const o=this.platform==="darwin"||this.platform==="win32";const h={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:o,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const p=this.pattern.map((r=>new a.Minimatch(r,h)));const[g,y]=p.reduce(((r,i)=>{r[0].push(...i.set);r[1].push(...i.globParts);return r}),[[],[]]);this.patterns=g.map(((r,i)=>{const o=y[i];if(!o)throw new Error("invalid pattern object");return new u.Pattern(r,o,0,this.platform)}))}async walk(){return[...await new h.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new h.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new h.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new h.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}i.Glob=Glob},859:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.hasMagic=void 0;const a=o(542);const hasMagic=(r,i={})=>{if(!Array.isArray(r)){r=[r]}for(const o of r){if(new a.Minimatch(o,i).hasMagic())return true}return false};i.hasMagic=hasMagic},1975:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Ignore=void 0;const a=o(542);const l=o(2499);const c=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(r,{nobrace:i,nocase:o,noext:a,noglobstar:l,platform:u=c}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=u;this.mmopts={dot:true,nobrace:i,nocase:o,noext:a,noglobstar:l,optimizationLevel:2,platform:u,nocomment:true,nonegate:true};for(const i of r)this.add(i)}add(r){const i=new a.Minimatch(r,this.mmopts);for(let r=0;r<i.set.length;r++){const o=i.set[r];const c=i.globParts[r];if(!o||!c){throw new Error("invalid pattern object")}while(o[0]==="."&&c[0]==="."){o.shift();c.shift()}const u=new l.Pattern(o,c,0,this.platform);const h=new a.Minimatch(u.globString(),this.mmopts);const d=c[c.length-1]==="**";const p=u.isAbsolute();if(p)this.absolute.push(h);else this.relative.push(h);if(d){if(p)this.absoluteChildren.push(h);else this.relativeChildren.push(h)}}}ignored(r){const i=r.fullpath();const o=`${i}/`;const a=r.relative()||".";const l=`${a}/`;for(const r of this.relative){if(r.match(a)||r.match(l))return true}for(const r of this.absolute){if(r.match(i)||r.match(o))return true}return false}childrenIgnored(r){const i=r.fullpath()+"/";const o=(r.relative()||".")+"/";for(const r of this.relativeChildren){if(r.match(o))return true}for(const r of this.absoluteChildren){if(r.match(i))return true}return false}}i.Ignore=Ignore},8743:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.glob=i.sync=i.iterate=i.iterateSync=i.stream=i.streamSync=i.Ignore=i.hasMagic=i.Glob=i.unescape=i.escape=void 0;i.globStreamSync=globStreamSync;i.globStream=globStream;i.globSync=globSync;i.globIterateSync=globIterateSync;i.globIterate=globIterate;const a=o(542);const l=o(5014);const c=o(859);var u=o(542);Object.defineProperty(i,"escape",{enumerable:true,get:function(){return u.escape}});Object.defineProperty(i,"unescape",{enumerable:true,get:function(){return u.unescape}});var h=o(5014);Object.defineProperty(i,"Glob",{enumerable:true,get:function(){return h.Glob}});var d=o(859);Object.defineProperty(i,"hasMagic",{enumerable:true,get:function(){return d.hasMagic}});var p=o(1975);Object.defineProperty(i,"Ignore",{enumerable:true,get:function(){return p.Ignore}});function globStreamSync(r,i={}){return new l.Glob(r,i).streamSync()}function globStream(r,i={}){return new l.Glob(r,i).stream()}function globSync(r,i={}){return new l.Glob(r,i).walkSync()}async function glob_(r,i={}){return new l.Glob(r,i).walk()}function globIterateSync(r,i={}){return new l.Glob(r,i).iterateSync()}function globIterate(r,i={}){return new l.Glob(r,i).iterate()}i.streamSync=globStreamSync;i.stream=Object.assign(globStream,{sync:globStreamSync});i.iterateSync=globIterateSync;i.iterate=Object.assign(globIterate,{sync:globIterateSync});i.sync=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});i.glob=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:i.sync,globStream:globStream,stream:i.stream,globStreamSync:globStreamSync,streamSync:i.streamSync,globIterate:globIterate,iterate:i.iterate,globIterateSync:globIterateSync,iterateSync:i.iterateSync,Glob:l.Glob,hasMagic:c.hasMagic,escape:a.escape,unescape:a.unescape});i.glob.glob=i.glob},2499:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Pattern=void 0;const a=o(542);const isPatternList=r=>r.length>=1;const isGlobList=r=>r.length>=1;class Pattern{#t;#e;#r;length;#i;#n;#s;#o;#a;#l;#c=true;constructor(r,i,o,a){if(!isPatternList(r)){throw new TypeError("empty pattern list")}if(!isGlobList(i)){throw new TypeError("empty glob list")}if(i.length!==r.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=r.length;if(o<0||o>=this.length){throw new TypeError("index out of range")}this.#t=r;this.#e=i;this.#r=o;this.#i=a;if(this.#r===0){if(this.isUNC()){const[r,i,o,a,...l]=this.#t;const[c,u,h,d,...p]=this.#e;if(l[0]===""){l.shift();p.shift()}const g=[r,i,o,a,""].join("/");const y=[c,u,h,d,""].join("/");this.#t=[g,...l];this.#e=[y,...p];this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){const[r,...i]=this.#t;const[o,...a]=this.#e;if(i[0]===""){i.shift();a.shift()}const l=r+"/";const c=o+"/";this.#t=[l,...i];this.#e=[c,...a];this.length=this.#t.length}}}pattern(){return this.#t[this.#r]}isString(){return typeof this.#t[this.#r]==="string"}isGlobstar(){return this.#t[this.#r]===a.GLOBSTAR}isRegExp(){return this.#t[this.#r]instanceof RegExp}globString(){return this.#s=this.#s||(this.#r===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){if(this.#n!==undefined)return this.#n;if(!this.hasMore())return this.#n=null;this.#n=new Pattern(this.#t,this.#e,this.#r+1,this.#i);this.#n.#l=this.#l;this.#n.#a=this.#a;this.#n.#o=this.#o;return this.#n}isUNC(){const r=this.#t;return this.#a!==undefined?this.#a:this.#a=this.#i==="win32"&&this.#r===0&&r[0]===""&&r[1]===""&&typeof r[2]==="string"&&!!r[2]&&typeof r[3]==="string"&&!!r[3]}isDrive(){const r=this.#t;return this.#o!==undefined?this.#o:this.#o=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof r[0]==="string"&&/^[a-z]:$/i.test(r[0])}isAbsolute(){const r=this.#t;return this.#l!==undefined?this.#l:this.#l=r[0]===""&&r.length>1||this.isDrive()||this.isUNC()}root(){const r=this.#t[0];return typeof r==="string"&&this.isAbsolute()&&this.#r===0?r:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){if(this.#r===0||!this.isGlobstar()||!this.#c)return false;this.#c=false;return true}}i.Pattern=Pattern},605:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Processor=i.SubWalks=i.MatchRecord=i.HasWalkedCache=void 0;const a=o(542);class HasWalkedCache{store;constructor(r=new Map){this.store=r}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(r,i){return this.store.get(r.fullpath())?.has(i.globString())}storeWalked(r,i){const o=r.fullpath();const a=this.store.get(o);if(a)a.add(i.globString());else this.store.set(o,new Set([i.globString()]))}}i.HasWalkedCache=HasWalkedCache;class MatchRecord{store=new Map;add(r,i,o){const a=(i?2:0)|(o?1:0);const l=this.store.get(r);this.store.set(r,l===undefined?a:a&l)}entries(){return[...this.store.entries()].map((([r,i])=>[r,!!(i&2),!!(i&1)]))}}i.MatchRecord=MatchRecord;class SubWalks{store=new Map;add(r,i){if(!r.canReaddir()){return}const o=this.store.get(r);if(o){if(!o.find((r=>r.globString()===i.globString()))){o.push(i)}}else this.store.set(r,[i])}get(r){const i=this.store.get(r);if(!i){throw new Error("attempting to walk unknown path")}return i}entries(){return this.keys().map((r=>[r,this.store.get(r)]))}keys(){return[...this.store.keys()].filter((r=>r.canReaddir()))}}i.SubWalks=SubWalks;class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(r,i){this.opts=r;this.follow=!!r.follow;this.dot=!!r.dot;this.hasWalkedCache=i?i.copy():new HasWalkedCache}processPatterns(r,i){this.patterns=i;const o=i.map((i=>[r,i]));for(let[r,i]of o){this.hasWalkedCache.storeWalked(r,i);const o=i.root();const l=i.isAbsolute()&&this.opts.absolute!==false;if(o){r=r.resolve(o==="/"&&this.opts.root!==undefined?this.opts.root:o);const a=i.rest();if(!a){this.matches.add(r,true,false);continue}else{i=a}}if(r.isENOENT())continue;let c;let u;let h=false;while(typeof(c=i.pattern())==="string"&&(u=i.rest())){const o=r.resolve(c);r=o;i=u;h=true}c=i.pattern();u=i.rest();if(h){if(this.hasWalkedCache.hasWalked(r,i))continue;this.hasWalkedCache.storeWalked(r,i)}if(typeof c==="string"){const i=c===".."||c===""||c===".";this.matches.add(r.resolve(c),l,i);continue}else if(c===a.GLOBSTAR){if(!r.isSymbolicLink()||this.follow||i.checkFollowGlobstar()){this.subwalks.add(r,i)}const o=u?.pattern();const a=u?.rest();if(!u||(o===""||o===".")&&!a){this.matches.add(r,l,o===""||o===".")}else{if(o===".."){const i=r.parent||r;if(!a)this.matches.add(i,l,true);else if(!this.hasWalkedCache.hasWalked(i,a)){this.subwalks.add(i,a)}}}}else if(c instanceof RegExp){this.subwalks.add(r,i)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(r,i){const o=this.subwalks.get(r);const l=this.child();for(const r of i){for(const i of o){const o=i.isAbsolute();const c=i.pattern();const u=i.rest();if(c===a.GLOBSTAR){l.testGlobstar(r,i,u,o)}else if(c instanceof RegExp){l.testRegExp(r,c,u,o)}else{l.testString(r,c,u,o)}}}return l}testGlobstar(r,i,o,a){if(this.dot||!r.name.startsWith(".")){if(!i.hasMore()){this.matches.add(r,a,false)}if(r.canReaddir()){if(this.follow||!r.isSymbolicLink()){this.subwalks.add(r,i)}else if(r.isSymbolicLink()){if(o&&i.checkFollowGlobstar()){this.subwalks.add(r,o)}else if(i.markFollowGlobstar()){this.subwalks.add(r,i)}}}}if(o){const i=o.pattern();if(typeof i==="string"&&i!==".."&&i!==""&&i!=="."){this.testString(r,i,o.rest(),a)}else if(i===".."){const i=r.parent||r;this.subwalks.add(i,o)}else if(i instanceof RegExp){this.testRegExp(r,i,o.rest(),a)}}}testRegExp(r,i,o,a){if(!i.test(r.name))return;if(!o){this.matches.add(r,a,false)}else{this.subwalks.add(r,o)}}testString(r,i,o,a){if(!r.isNamed(i))return;if(!o){this.matches.add(r,a,false)}else{this.subwalks.add(r,o)}}}i.Processor=Processor},9660:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.GlobStream=i.GlobWalker=i.GlobUtil=void 0;const a=o(6014);const l=o(1975);const c=o(605);const makeIgnore=(r,i)=>typeof r==="string"?new l.Ignore([r],i):Array.isArray(r)?new l.Ignore(r,i):r;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#u=[];#h;#d;signal;maxDepth;includeChildMatches;constructor(r,i,o){this.patterns=r;this.path=i;this.opts=o;this.#d=!o.posix&&o.platform==="win32"?"\\":"/";this.includeChildMatches=o.includeChildMatches!==false;if(o.ignore||!this.includeChildMatches){this.#h=makeIgnore(o.ignore??[],o);if(!this.includeChildMatches&&typeof this.#h.add!=="function"){const r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}}this.maxDepth=o.maxDepth||Infinity;if(o.signal){this.signal=o.signal;this.signal.addEventListener("abort",(()=>{this.#u.length=0}))}}#f(r){return this.seen.has(r)||!!this.#h?.ignored?.(r)}#p(r){return!!this.#h?.childrenIgnored?.(r)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let r=undefined;while(!this.paused&&(r=this.#u.shift())){r()}}onResume(r){if(this.signal?.aborted)return;if(!this.paused){r()}else{this.#u.push(r)}}async matchCheck(r,i){if(i&&this.opts.nodir)return undefined;let o;if(this.opts.realpath){o=r.realpathCached()||await r.realpath();if(!o)return undefined;r=o}const a=r.isUnknown()||this.opts.stat;const l=a?await r.lstat():r;if(this.opts.follow&&this.opts.nodir&&l?.isSymbolicLink()){const r=await l.realpath();if(r&&(r.isUnknown()||this.opts.stat)){await r.lstat()}}return this.matchCheckTest(l,i)}matchCheckTest(r,i){return r&&(this.maxDepth===Infinity||r.depth()<=this.maxDepth)&&(!i||r.canReaddir())&&(!this.opts.nodir||!r.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!r.isSymbolicLink()||!r.realpathCached()?.isDirectory())&&!this.#f(r)?r:undefined}matchCheckSync(r,i){if(i&&this.opts.nodir)return undefined;let o;if(this.opts.realpath){o=r.realpathCached()||r.realpathSync();if(!o)return undefined;r=o}const a=r.isUnknown()||this.opts.stat;const l=a?r.lstatSync():r;if(this.opts.follow&&this.opts.nodir&&l?.isSymbolicLink()){const r=l.realpathSync();if(r&&(r?.isUnknown()||this.opts.stat)){r.lstatSync()}}return this.matchCheckTest(l,i)}matchFinish(r,i){if(this.#f(r))return;if(!this.includeChildMatches&&this.#h?.add){const i=`${r.relativePosix()}/**`;this.#h.add(i)}const o=this.opts.absolute===undefined?i:this.opts.absolute;this.seen.add(r);const a=this.opts.mark&&r.isDirectory()?this.#d:"";if(this.opts.withFileTypes){this.matchEmit(r)}else if(o){const i=this.opts.posix?r.fullpathPosix():r.fullpath();this.matchEmit(i+a)}else{const i=this.opts.posix?r.relativePosix():r.relative();const o=this.opts.dotRelative&&!i.startsWith(".."+this.#d)?"."+this.#d:"";this.matchEmit(!i?"."+a:o+i+a)}}async match(r,i,o){const a=await this.matchCheck(r,o);if(a)this.matchFinish(a,i)}matchSync(r,i,o){const a=this.matchCheckSync(r,o);if(a)this.matchFinish(a,i)}walkCB(r,i,o){if(this.signal?.aborted)o();this.walkCB2(r,i,new c.Processor(this.opts),o)}walkCB2(r,i,o,a){if(this.#p(r))return a();if(this.signal?.aborted)a();if(this.paused){this.onResume((()=>this.walkCB2(r,i,o,a)));return}o.processPatterns(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;l++;this.match(r,i,a).then((()=>next()))}for(const r of o.subwalkTargets()){if(this.maxDepth!==Infinity&&r.depth()>=this.maxDepth){continue}l++;const i=r.readdirCached();if(r.calledReaddir())this.walkCB3(r,i,o,next);else{r.readdirCB(((i,a)=>this.walkCB3(r,a,o,next)),true)}}next()}walkCB3(r,i,o,a){o=o.filterEntries(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;l++;this.match(r,i,a).then((()=>next()))}for(const[r,i]of o.subwalks.entries()){l++;this.walkCB2(r,i,o.child(),next)}next()}walkCBSync(r,i,o){if(this.signal?.aborted)o();this.walkCB2Sync(r,i,new c.Processor(this.opts),o)}walkCB2Sync(r,i,o,a){if(this.#p(r))return a();if(this.signal?.aborted)a();if(this.paused){this.onResume((()=>this.walkCB2Sync(r,i,o,a)));return}o.processPatterns(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;this.matchSync(r,i,a)}for(const r of o.subwalkTargets()){if(this.maxDepth!==Infinity&&r.depth()>=this.maxDepth){continue}l++;const i=r.readdirSync();this.walkCB3Sync(r,i,o,next)}next()}walkCB3Sync(r,i,o,a){o=o.filterEntries(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;this.matchSync(r,i,a)}for(const[r,i]of o.subwalks.entries()){l++;this.walkCB2Sync(r,i,o.child(),next)}next()}}i.GlobUtil=GlobUtil;class GlobWalker extends GlobUtil{matches=new Set;constructor(r,i,o){super(r,i,o)}matchEmit(r){this.matches.add(r)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((r,i)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){i(this.signal.reason)}else{r(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}i.GlobWalker=GlobWalker;class GlobStream extends GlobUtil{results;constructor(r,i,o){super(r,i,o);this.results=new a.Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(r){this.results.write(r);if(!this.results.flowing)this.pause()}stream(){const r=this.path;if(r.isUnknown()){r.lstat().then((()=>{this.walkCB(r,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(r,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}i.GlobStream=GlobStream},4004:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.assertValidPattern=void 0;const o=1024*64;const assertValidPattern=r=>{if(typeof r!=="string"){throw new TypeError("invalid pattern")}if(r.length>o){throw new TypeError("pattern is too long")}};i.assertValidPattern=assertValidPattern},8543:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.AST=void 0;const a=o(9646);const l=o(5640);const c=new Set(["!","?","+","*","@"]);const isExtglobType=r=>c.has(r);const u="(?!(?:^|/)\\.\\.?(?:$|/))";const h="(?!\\.)";const d=new Set(["[","."]);const p=new Set(["..","."]);const g=new Set("().*{}+?[]^$\\!");const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const y="[^/]";const w=y+"*?";const b=y+"+?";class AST{type;#m;#g;#y=false;#w=[];#b;#v;#E;#x=false;#M;#D;#O=false;constructor(r,i,o={}){this.type=r;if(r)this.#g=true;this.#b=i;this.#m=this.#b?this.#b.#m:this;this.#M=this.#m===this?o:this.#m.#M;this.#E=this.#m===this?[]:this.#m.#E;if(r==="!"&&!this.#m.#x)this.#E.push(this);this.#v=this.#b?this.#b.#w.length:0}get hasMagic(){if(this.#g!==undefined)return this.#g;for(const r of this.#w){if(typeof r==="string")continue;if(r.type||r.hasMagic)return this.#g=true}return this.#g}toString(){if(this.#D!==undefined)return this.#D;if(!this.type){return this.#D=this.#w.map((r=>String(r))).join("")}else{return this.#D=this.type+"("+this.#w.map((r=>String(r))).join("|")+")"}}#T(){if(this!==this.#m)throw new Error("should only call on root");if(this.#x)return this;this.toString();this.#x=true;let r;while(r=this.#E.pop()){if(r.type!=="!")continue;let i=r;let o=i.#b;while(o){for(let a=i.#v+1;!o.type&&a<o.#w.length;a++){for(const i of r.#w){if(typeof i==="string"){throw new Error("string part in extglob AST??")}i.copyIn(o.#w[a])}}i=o;o=i.#b}}return this}push(...r){for(const i of r){if(i==="")continue;if(typeof i!=="string"&&!(i instanceof AST&&i.#b===this)){throw new Error("invalid part: "+i)}this.#w.push(i)}}toJSON(){const r=this.type===null?this.#w.slice().map((r=>typeof r==="string"?r:r.toJSON())):[this.type,...this.#w.map((r=>r.toJSON()))];if(this.isStart()&&!this.type)r.unshift([]);if(this.isEnd()&&(this===this.#m||this.#m.#x&&this.#b?.type==="!")){r.push({})}return r}isStart(){if(this.#m===this)return true;if(!this.#b?.isStart())return false;if(this.#v===0)return true;const r=this.#b;for(let i=0;i<this.#v;i++){const o=r.#w[i];if(!(o instanceof AST&&o.type==="!")){return false}}return true}isEnd(){if(this.#m===this)return true;if(this.#b?.type==="!")return true;if(!this.#b?.isEnd())return false;if(!this.type)return this.#b?.isEnd();const r=this.#b?this.#b.#w.length:0;return this.#v===r-1}copyIn(r){if(typeof r==="string")this.push(r);else this.push(r.clone(this))}clone(r){const i=new AST(this.type,r);for(const r of this.#w){i.copyIn(r)}return i}static#S(r,i,o,a){let l=false;let c=false;let u=-1;let h=false;if(i.type===null){let d=o;let p="";while(d<r.length){const o=r.charAt(d++);if(l||o==="\\"){l=!l;p+=o;continue}if(c){if(d===u+1){if(o==="^"||o==="!"){h=true}}else if(o==="]"&&!(d===u+2&&h)){c=false}p+=o;continue}else if(o==="["){c=true;u=d;h=false;p+=o;continue}if(!a.noext&&isExtglobType(o)&&r.charAt(d)==="("){i.push(p);p="";const l=new AST(o,i);d=AST.#S(r,l,d,a);i.push(l);continue}p+=o}i.push(p);return d}let d=o+1;let p=new AST(null,i);const g=[];let y="";while(d<r.length){const o=r.charAt(d++);if(l||o==="\\"){l=!l;y+=o;continue}if(c){if(d===u+1){if(o==="^"||o==="!"){h=true}}else if(o==="]"&&!(d===u+2&&h)){c=false}y+=o;continue}else if(o==="["){c=true;u=d;h=false;y+=o;continue}if(isExtglobType(o)&&r.charAt(d)==="("){p.push(y);y="";const i=new AST(o,p);p.push(i);d=AST.#S(r,i,d,a);continue}if(o==="|"){p.push(y);y="";g.push(p);p=new AST(null,i);continue}if(o===")"){if(y===""&&i.#w.length===0){i.#O=true}p.push(y);y="";i.push(...g,p);return d}y+=o}i.type=null;i.#g=undefined;i.#w=[r.substring(o-1)];return d}static fromGlob(r,i={}){const o=new AST(null,undefined,i);AST.#S(r,o,0,i);return o}toMMPattern(){if(this!==this.#m)return this.#m.toMMPattern();const r=this.toString();const[i,o,a,l]=this.toRegExpSource();const c=a||this.#g||this.#M.nocase&&!this.#M.nocaseMagicOnly&&r.toUpperCase()!==r.toLowerCase();if(!c){return o}const u=(this.#M.nocase?"i":"")+(l?"u":"");return Object.assign(new RegExp(`^${i}$`,u),{_src:i,_glob:r})}get options(){return this.#M}toRegExpSource(r){const i=r??!!this.#M.dot;if(this.#m===this)this.#T();if(!this.type){const o=this.isStart()&&this.isEnd();const a=this.#w.map((i=>{const[a,l,c,u]=typeof i==="string"?AST.#A(i,this.#g,o):i.toRegExpSource(r);this.#g=this.#g||c;this.#y=this.#y||u;return a})).join("");let c="";if(this.isStart()){if(typeof this.#w[0]==="string"){const o=this.#w.length===1&&p.has(this.#w[0]);if(!o){const o=d;const l=i&&o.has(a.charAt(0))||a.startsWith("\\.")&&o.has(a.charAt(2))||a.startsWith("\\.\\.")&&o.has(a.charAt(4));const p=!i&&!r&&o.has(a.charAt(0));c=l?u:p?h:""}}}let g="";if(this.isEnd()&&this.#m.#x&&this.#b?.type==="!"){g="(?:$|\\/)"}const y=c+a+g;return[y,(0,l.unescape)(a),this.#g=!!this.#g,this.#y]}const o=this.type==="*"||this.type==="+";const a=this.type==="!"?"(?:(?!(?:":"(?:";let c=this.#N(i);if(this.isStart()&&this.isEnd()&&!c&&this.type!=="!"){const r=this.toString();this.#w=[r];this.type=null;this.#g=undefined;return[r,(0,l.unescape)(this.toString()),false,false]}let g=!o||r||i||!h?"":this.#N(true);if(g===c){g=""}if(g){c=`(?:${c})(?:${g})*?`}let y="";if(this.type==="!"&&this.#O){y=(this.isStart()&&!i?h:"")+b}else{const o=this.type==="!"?"))"+(this.isStart()&&!i&&!r?h:"")+w+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&g?")":this.type==="*"&&g?`)?`:`)${this.type}`;y=a+c+o}return[y,(0,l.unescape)(c),this.#g=!!this.#g,this.#y]}#N(r){return this.#w.map((i=>{if(typeof i==="string"){throw new Error("string type in extglob ast??")}const[o,a,l,c]=i.toRegExpSource(r);this.#y=this.#y||c;return o})).filter((r=>!(this.isStart()&&this.isEnd())||!!r)).join("|")}static#A(r,i,o=false){let c=false;let u="";let h=false;for(let l=0;l<r.length;l++){const d=r.charAt(l);if(c){c=false;u+=(g.has(d)?"\\":"")+d;continue}if(d==="\\"){if(l===r.length-1){u+="\\\\"}else{c=true}continue}if(d==="["){const[o,c,d,p]=(0,a.parseClass)(r,l);if(d){u+=o;h=h||c;l+=d-1;i=i||p;continue}}if(d==="*"){if(o&&r==="*")u+=b;else u+=w;i=true;continue}if(d==="?"){u+=y;i=true;continue}u+=regExpEscape(d)}return[u,(0,l.unescape)(r),!!i,h]}}i.AST=AST},9646:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.parseClass=void 0;const o={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=r=>r.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=r=>r.join("");const parseClass=(r,i)=>{const a=i;if(r.charAt(a)!=="["){throw new Error("not in a brace expression")}const l=[];const c=[];let u=a+1;let h=false;let d=false;let p=false;let g=false;let y=a;let w="";t:while(u<r.length){const i=r.charAt(u);if((i==="!"||i==="^")&&u===a+1){g=true;u++;continue}if(i==="]"&&h&&!p){y=u+1;break}h=true;if(i==="\\"){if(!p){p=true;u++;continue}}if(i==="["&&!p){for(const[i,[h,p,g]]of Object.entries(o)){if(r.startsWith(i,u)){if(w){return["$.",false,r.length-a,true]}u+=i.length;if(g)c.push(h);else l.push(h);d=d||p;continue t}}}p=false;if(w){if(i>w){l.push(braceEscape(w)+"-"+braceEscape(i))}else if(i===w){l.push(braceEscape(i))}w="";u++;continue}if(r.startsWith("-]",u+1)){l.push(braceEscape(i+"-"));u+=2;continue}if(r.startsWith("-",u+1)){w=i;u+=2;continue}l.push(braceEscape(i));u++}if(y<u){return["",false,0,false]}if(!l.length&&!c.length){return["$.",false,r.length-a,true]}if(c.length===0&&l.length===1&&/^\\?.$/.test(l[0])&&!g){const r=l[0].length===2?l[0].slice(-1):l[0];return[regexpEscape(r),false,y-a,false]}const b="["+(g?"^":"")+rangesToString(l)+"]";const v="["+(g?"":"^")+rangesToString(c)+"]";const E=l.length&&c.length?"("+b+"|"+v+")":l.length?b:v;return[E,d,y-a,true]};i.parseClass=parseClass},7504:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.escape=void 0;const escape=(r,{windowsPathsNoEscape:i=false}={})=>i?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");i.escape=escape},542:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.unescape=i.escape=i.AST=i.Minimatch=i.match=i.makeRe=i.braceExpand=i.defaults=i.filter=i.GLOBSTAR=i.sep=i.minimatch=void 0;const l=a(o(2297));const c=o(4004);const u=o(8543);const h=o(7504);const d=o(5640);const minimatch=(r,i,o={})=>{(0,c.assertValidPattern)(i);if(!o.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,o).match(r)};i.minimatch=minimatch;const p=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=r=>i=>!i.startsWith(".")&&i.endsWith(r);const starDotExtTestDot=r=>i=>i.endsWith(r);const starDotExtTestNocase=r=>{r=r.toLowerCase();return i=>!i.startsWith(".")&&i.toLowerCase().endsWith(r)};const starDotExtTestNocaseDot=r=>{r=r.toLowerCase();return i=>i.toLowerCase().endsWith(r)};const g=/^\*+\.\*+$/;const starDotStarTest=r=>!r.startsWith(".")&&r.includes(".");const starDotStarTestDot=r=>r!=="."&&r!==".."&&r.includes(".");const y=/^\.\*+$/;const dotStarTest=r=>r!=="."&&r!==".."&&r.startsWith(".");const w=/^\*+$/;const starTest=r=>r.length!==0&&!r.startsWith(".");const starTestDot=r=>r.length!==0&&r!=="."&&r!=="..";const b=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([r,i=""])=>{const o=qmarksTestNoExt([r]);if(!i)return o;i=i.toLowerCase();return r=>o(r)&&r.toLowerCase().endsWith(i)};const qmarksTestNocaseDot=([r,i=""])=>{const o=qmarksTestNoExtDot([r]);if(!i)return o;i=i.toLowerCase();return r=>o(r)&&r.toLowerCase().endsWith(i)};const qmarksTestDot=([r,i=""])=>{const o=qmarksTestNoExtDot([r]);return!i?o:r=>o(r)&&r.endsWith(i)};const qmarksTest=([r,i=""])=>{const o=qmarksTestNoExt([r]);return!i?o:r=>o(r)&&r.endsWith(i)};const qmarksTestNoExt=([r])=>{const i=r.length;return r=>r.length===i&&!r.startsWith(".")};const qmarksTestNoExtDot=([r])=>{const i=r.length;return r=>r.length===i&&r!=="."&&r!==".."};const v=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const E={win32:{sep:"\\"},posix:{sep:"/"}};i.sep=v==="win32"?E.win32.sep:E.posix.sep;i.minimatch.sep=i.sep;i.GLOBSTAR=Symbol("globstar **");i.minimatch.GLOBSTAR=i.GLOBSTAR;const x="[^/]";const M=x+"*?";const D="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const O="(?:(?!(?:\\/|^)\\.).)*?";const filter=(r,o={})=>a=>(0,i.minimatch)(a,r,o);i.filter=filter;i.minimatch.filter=i.filter;const ext=(r,i={})=>Object.assign({},r,i);const defaults=r=>{if(!r||typeof r!=="object"||!Object.keys(r).length){return i.minimatch}const o=i.minimatch;const m=(i,a,l={})=>o(i,a,ext(r,l));return Object.assign(m,{Minimatch:class Minimatch extends o.Minimatch{constructor(i,o={}){super(i,ext(r,o))}static defaults(i){return o.defaults(ext(r,i)).Minimatch}},AST:class AST extends o.AST{constructor(i,o,a={}){super(i,o,ext(r,a))}static fromGlob(i,a={}){return o.AST.fromGlob(i,ext(r,a))}},unescape:(i,a={})=>o.unescape(i,ext(r,a)),escape:(i,a={})=>o.escape(i,ext(r,a)),filter:(i,a={})=>o.filter(i,ext(r,a)),defaults:i=>o.defaults(ext(r,i)),makeRe:(i,a={})=>o.makeRe(i,ext(r,a)),braceExpand:(i,a={})=>o.braceExpand(i,ext(r,a)),match:(i,a,l={})=>o.match(i,a,ext(r,l)),sep:o.sep,GLOBSTAR:i.GLOBSTAR})};i.defaults=defaults;i.minimatch.defaults=i.defaults;const braceExpand=(r,i={})=>{(0,c.assertValidPattern)(r);if(i.nobrace||!/\{(?:(?!\{).)*\}/.test(r)){return[r]}return(0,l.default)(r)};i.braceExpand=braceExpand;i.minimatch.braceExpand=i.braceExpand;const makeRe=(r,i={})=>new Minimatch(r,i).makeRe();i.makeRe=makeRe;i.minimatch.makeRe=i.makeRe;const match=(r,i,o={})=>{const a=new Minimatch(i,o);r=r.filter((r=>a.match(r)));if(a.options.nonull&&!r.length){r.push(i)}return r};i.match=match;i.minimatch.match=i.match;const T=/[?*]|[+@!]\(.*?\)|\[|\]/;const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(r,i={}){(0,c.assertValidPattern)(r);i=i||{};this.options=i;this.pattern=r;this.platform=i.platform||v;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!i.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!i.nonegate;this.comment=false;this.empty=false;this.partial=!!i.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=i.windowsNoMagicRoot!==undefined?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const r of this.set){for(const i of r){if(typeof i!=="string")return true}}return false}debug(...r){}make(){const r=this.pattern;const i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(i.debug){this.debug=(...r)=>console.error(...r)}this.debug(this.pattern,this.globSet);const o=this.globSet.map((r=>this.slashSplit(r)));this.globParts=this.preprocess(o);this.debug(this.pattern,this.globParts);let a=this.globParts.map(((r,i,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){const i=r[0]===""&&r[1]===""&&(r[2]==="?"||!T.test(r[2]))&&!T.test(r[3]);const o=/^[a-z]:/i.test(r[0]);if(i){return[...r.slice(0,4),...r.slice(4).map((r=>this.parse(r)))]}else if(o){return[r[0],...r.slice(1).map((r=>this.parse(r)))]}}return r.map((r=>this.parse(r)))}));this.debug(this.pattern,a);this.set=a.filter((r=>r.indexOf(false)===-1));if(this.isWindows){for(let r=0;r<this.set.length;r++){const i=this.set[r];if(i[0]===""&&i[1]===""&&this.globParts[r][2]==="?"&&typeof i[3]==="string"&&/^[a-z]:$/i.test(i[3])){i[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(r){if(this.options.noglobstar){for(let i=0;i<r.length;i++){for(let o=0;o<r[i].length;o++){if(r[i][o]==="**"){r[i][o]="*"}}}}const{optimizationLevel:i=1}=this.options;if(i>=2){r=this.firstPhasePreProcess(r);r=this.secondPhasePreProcess(r)}else if(i>=1){r=this.levelOneOptimize(r)}else{r=this.adjascentGlobstarOptimize(r)}return r}adjascentGlobstarOptimize(r){return r.map((r=>{let i=-1;while(-1!==(i=r.indexOf("**",i+1))){let o=i;while(r[o+1]==="**"){o++}if(o!==i){r.splice(i,o-i)}}return r}))}levelOneOptimize(r){return r.map((r=>{r=r.reduce(((r,i)=>{const o=r[r.length-1];if(i==="**"&&o==="**"){return r}if(i===".."){if(o&&o!==".."&&o!=="."&&o!=="**"){r.pop();return r}}r.push(i);return r}),[]);return r.length===0?[""]:r}))}levelTwoFileOptimize(r){if(!Array.isArray(r)){r=this.slashSplit(r)}let i=false;do{i=false;if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){const a=r[o];if(o===1&&a===""&&r[0]==="")continue;if(a==="."||a===""){i=true;r.splice(o,1);o--}}if(r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")){i=true;r.pop()}}let o=0;while(-1!==(o=r.indexOf("..",o+1))){const a=r[o-1];if(a&&a!=="."&&a!==".."&&a!=="**"){i=true;r.splice(o-1,2);o-=2}}}while(i);return r.length===0?[""]:r}firstPhasePreProcess(r){let i=false;do{i=false;for(let o of r){let a=-1;while(-1!==(a=o.indexOf("**",a+1))){let l=a;while(o[l+1]==="**"){l++}if(l>a){o.splice(a+1,l-a)}let c=o[a+1];const u=o[a+2];const h=o[a+3];if(c!=="..")continue;if(!u||u==="."||u===".."||!h||h==="."||h===".."){continue}i=true;o.splice(a,1);const d=o.slice(0);d[a]="**";r.push(d);a--}if(!this.preserveMultipleSlashes){for(let r=1;r<o.length-1;r++){const a=o[r];if(r===1&&a===""&&o[0]==="")continue;if(a==="."||a===""){i=true;o.splice(r,1);r--}}if(o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")){i=true;o.pop()}}let l=0;while(-1!==(l=o.indexOf("..",l+1))){const r=o[l-1];if(r&&r!=="."&&r!==".."&&r!=="**"){i=true;const r=l===1&&o[l+1]==="**";const a=r?["."]:[];o.splice(l-1,2,...a);if(o.length===0)o.push("");l-=2}}}}while(i);return r}secondPhasePreProcess(r){for(let i=0;i<r.length-1;i++){for(let o=i+1;o<r.length;o++){const a=this.partsMatch(r[i],r[o],!this.preserveMultipleSlashes);if(a){r[i]=[];r[o]=a;break}}}return r.filter((r=>r.length))}partsMatch(r,i,o=false){let a=0;let l=0;let c=[];let u="";while(a<r.length&&l<i.length){if(r[a]===i[l]){c.push(u==="b"?i[l]:r[a]);a++;l++}else if(o&&r[a]==="**"&&i[l]===r[a+1]){c.push(r[a]);a++}else if(o&&i[l]==="**"&&r[a]===i[l+1]){c.push(i[l]);l++}else if(r[a]==="*"&&i[l]&&(this.options.dot||!i[l].startsWith("."))&&i[l]!=="**"){if(u==="b")return false;u="a";c.push(r[a]);a++;l++}else if(i[l]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(u==="a")return false;u="b";c.push(i[l]);a++;l++}else{return false}}return r.length===i.length&&c}parseNegate(){if(this.nonegate)return;const r=this.pattern;let i=false;let o=0;for(let a=0;a<r.length&&r.charAt(a)==="!";a++){i=!i;o++}if(o)this.pattern=r.slice(o);this.negate=i}matchOne(r,o,a=false){const l=this.options;if(this.isWindows){const i=typeof r[0]==="string"&&/^[a-z]:$/i.test(r[0]);const a=!i&&r[0]===""&&r[1]===""&&r[2]==="?"&&/^[a-z]:$/i.test(r[3]);const l=typeof o[0]==="string"&&/^[a-z]:$/i.test(o[0]);const c=!l&&o[0]===""&&o[1]===""&&o[2]==="?"&&typeof o[3]==="string"&&/^[a-z]:$/i.test(o[3]);const u=a?3:i?0:undefined;const h=c?3:l?0:undefined;if(typeof u==="number"&&typeof h==="number"){const[i,a]=[r[u],o[h]];if(i.toLowerCase()===a.toLowerCase()){o[h]=i;if(h>u){o=o.slice(h)}else if(u>h){r=r.slice(u)}}}}const{optimizationLevel:c=1}=this.options;if(c>=2){r=this.levelTwoFileOptimize(r)}this.debug("matchOne",this,{file:r,pattern:o});this.debug("matchOne",r.length,o.length);for(var u=0,h=0,d=r.length,p=o.length;u<d&&h<p;u++,h++){this.debug("matchOne loop");var g=o[h];var y=r[u];this.debug(o,g,y);if(g===false){return false}if(g===i.GLOBSTAR){this.debug("GLOBSTAR",[o,g,y]);var w=u;var b=h+1;if(b===p){this.debug("** at the end");for(;u<d;u++){if(r[u]==="."||r[u]===".."||!l.dot&&r[u].charAt(0)===".")return false}return true}while(w<d){var v=r[w];this.debug("\nglobstar while",r,w,o,b,v);if(this.matchOne(r.slice(w),o.slice(b),a)){this.debug("globstar found match!",w,d,v);return true}else{if(v==="."||v===".."||!l.dot&&v.charAt(0)==="."){this.debug("dot detected!",r,w,o,b);break}this.debug("globstar swallow a segment, and continue");w++}}if(a){this.debug("\n>>> no match, partial?",r,w,o,b);if(w===d){return true}}return false}let c;if(typeof g==="string"){c=y===g;this.debug("string match",g,y,c)}else{c=g.test(y);this.debug("pattern match",g,y,c)}if(!c)return false}if(u===d&&h===p){return true}else if(u===d){return a}else if(h===p){return u===d-1&&r[u]===""}else{throw new Error("wtf?")}}braceExpand(){return(0,i.braceExpand)(this.pattern,this.options)}parse(r){(0,c.assertValidPattern)(r);const o=this.options;if(r==="**")return i.GLOBSTAR;if(r==="")return"";let a;let l=null;if(a=r.match(w)){l=o.dot?starTestDot:starTest}else if(a=r.match(p)){l=(o.nocase?o.dot?starDotExtTestNocaseDot:starDotExtTestNocase:o.dot?starDotExtTestDot:starDotExtTest)(a[1])}else if(a=r.match(b)){l=(o.nocase?o.dot?qmarksTestNocaseDot:qmarksTestNocase:o.dot?qmarksTestDot:qmarksTest)(a)}else if(a=r.match(g)){l=o.dot?starDotStarTestDot:starDotStarTest}else if(a=r.match(y)){l=dotStarTest}const h=u.AST.fromGlob(r,this.options).toMMPattern();if(l&&typeof h==="object"){Reflect.defineProperty(h,"test",{value:l})}return h}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const r=this.set;if(!r.length){this.regexp=false;return this.regexp}const o=this.options;const a=o.noglobstar?M:o.dot?D:O;const l=new Set(o.nocase?["i"]:[]);let c=r.map((r=>{const o=r.map((r=>{if(r instanceof RegExp){for(const i of r.flags.split(""))l.add(i)}return typeof r==="string"?regExpEscape(r):r===i.GLOBSTAR?i.GLOBSTAR:r._src}));o.forEach(((r,l)=>{const c=o[l+1];const u=o[l-1];if(r!==i.GLOBSTAR||u===i.GLOBSTAR){return}if(u===undefined){if(c!==undefined&&c!==i.GLOBSTAR){o[l+1]="(?:\\/|"+a+"\\/)?"+c}else{o[l]=a}}else if(c===undefined){o[l-1]=u+"(?:\\/|"+a+")?"}else if(c!==i.GLOBSTAR){o[l-1]=u+"(?:\\/|\\/"+a+"\\/)"+c;o[l+1]=i.GLOBSTAR}}));return o.filter((r=>r!==i.GLOBSTAR)).join("/")})).join("|");const[u,h]=r.length>1?["(?:",")"]:["",""];c="^"+u+c+h+"$";if(this.negate)c="^(?!"+c+").+$";try{this.regexp=new RegExp(c,[...l].join(""))}catch(r){this.regexp=false}return this.regexp}slashSplit(r){if(this.preserveMultipleSlashes){return r.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(r)){return["",...r.split(/\/+/)]}else{return r.split(/\/+/)}}match(r,i=this.partial){this.debug("match",r,this.pattern);if(this.comment){return false}if(this.empty){return r===""}if(r==="/"&&i){return true}const o=this.options;if(this.isWindows){r=r.split("\\").join("/")}const a=this.slashSplit(r);this.debug(this.pattern,"split",a);const l=this.set;this.debug(this.pattern,"set",l);let c=a[a.length-1];if(!c){for(let r=a.length-2;!c&&r>=0;r--){c=a[r]}}for(let r=0;r<l.length;r++){const u=l[r];let h=a;if(o.matchBase&&u.length===1){h=[c]}const d=this.matchOne(h,u,i);if(d){if(o.flipNegate){return true}return!this.negate}}if(o.flipNegate){return false}return this.negate}static defaults(r){return i.minimatch.defaults(r).Minimatch}}i.Minimatch=Minimatch;var S=o(8543);Object.defineProperty(i,"AST",{enumerable:true,get:function(){return S.AST}});var A=o(7504);Object.defineProperty(i,"escape",{enumerable:true,get:function(){return A.escape}});var N=o(5640);Object.defineProperty(i,"unescape",{enumerable:true,get:function(){return N.unescape}});i.minimatch.AST=u.AST;i.minimatch.Minimatch=Minimatch;i.minimatch.escape=h.escape;i.minimatch.unescape=d.unescape},5640:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.unescape=void 0;const unescape=(r,{windowsPathsNoEscape:i=false}={})=>i?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");i.unescape=unescape},3576:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.LRUCache=void 0;const o=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const a=new Set;const l=typeof process==="object"&&!!process?process:{};const emitWarning=(r,i,o,a)=>{typeof l.emitWarning==="function"?l.emitWarning(r,i,o,a):console.error(`[${o}] ${i}: ${r}`)};let c=globalThis.AbortController;let u=globalThis.AbortSignal;if(typeof c==="undefined"){u=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(r,i){this._onabort.push(i)}};c=class AbortController{constructor(){warnACPolyfill()}signal=new u;abort(r){if(this.signal.aborted)return;this.signal.reason=r;this.signal.aborted=true;for(const i of this.signal._onabort){i(r)}this.signal.onabort?.(r)}};let r=l.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!r)return;r=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=r=>!a.has(r);const h=Symbol("type");const isPosInt=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r);const getUintArray=r=>!isPosInt(r)?null:r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(r){super(r);this.fill(0)}}class Stack{heap;length;static#_=false;static create(r){const i=getUintArray(r);if(!i)return[];Stack.#_=true;const o=new Stack(r,i);Stack.#_=false;return o}constructor(r,i){if(!Stack.#_){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new i(r);this.length=0}push(r){this.heap[this.length++]=r}pop(){return this.heap[--this.length]}}class LRUCache{#C;#L;#P;#I;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#R;#F;#j;#X;#B;#$;#U;#V;#q;#W;#G;#H;#z;#Y;#K;#Z;#J;static unsafeExposeInternals(r){return{starts:r.#z,ttls:r.#Y,sizes:r.#H,keyMap:r.#j,keyList:r.#X,valList:r.#B,next:r.#$,prev:r.#U,get head(){return r.#V},get tail(){return r.#q},free:r.#W,isBackgroundFetch:i=>r.#Q(i),backgroundFetch:(i,o,a,l)=>r.#tt(i,o,a,l),moveToTail:i=>r.#et(i),indexes:i=>r.#rt(i),rindexes:i=>r.#it(i),isStale:i=>r.#nt(i)}}get max(){return this.#C}get maxSize(){return this.#L}get calculatedSize(){return this.#F}get size(){return this.#R}get fetchMethod(){return this.#k}get dispose(){return this.#P}get disposeAfter(){return this.#I}constructor(r){const{max:i=0,ttl:o,ttlResolution:l=1,ttlAutopurge:c,updateAgeOnGet:u,updateAgeOnHas:h,allowStale:d,dispose:p,disposeAfter:g,noDisposeOnSet:y,noUpdateTTL:w,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:E,fetchMethod:x,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:T,ignoreFetchAbort:S}=r;if(i!==0&&!isPosInt(i)){throw new TypeError("max option must be a nonnegative integer")}const A=i?getUintArray(i):Array;if(!A){throw new Error("invalid max value: "+i)}this.#C=i;this.#L=b;this.maxEntrySize=v||this.#L;this.sizeCalculation=E;if(this.sizeCalculation){if(!this.#L&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(x!==undefined&&typeof x!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#k=x;this.#Z=!!x;this.#j=new Map;this.#X=new Array(i).fill(undefined);this.#B=new Array(i).fill(undefined);this.#$=new A(i);this.#U=new A(i);this.#V=0;this.#q=0;this.#W=Stack.create(i);this.#R=0;this.#F=0;if(typeof p==="function"){this.#P=p}if(typeof g==="function"){this.#I=g;this.#G=[]}else{this.#I=undefined;this.#G=undefined}this.#K=!!this.#P;this.#J=!!this.#I;this.noDisposeOnSet=!!y;this.noUpdateTTL=!!w;this.noDeleteOnFetchRejection=!!M;this.allowStaleOnFetchRejection=!!O;this.allowStaleOnFetchAbort=!!T;this.ignoreFetchAbort=!!S;if(this.maxEntrySize!==0){if(this.#L!==0){if(!isPosInt(this.#L)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#st()}this.allowStale=!!d;this.noDeleteOnStaleGet=!!D;this.updateAgeOnGet=!!u;this.updateAgeOnHas=!!h;this.ttlResolution=isPosInt(l)||l===0?l:1;this.ttlAutopurge=!!c;this.ttl=o||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#ot()}if(this.#C===0&&this.ttl===0&&this.#L===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#C&&!this.#L){const r="LRU_CACHE_UNBOUNDED";if(shouldWarn(r)){a.add(r);const i="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(i,"UnboundedCacheWarning",r,LRUCache)}}}getRemainingTTL(r){return this.#j.has(r)?Infinity:0}#ot(){const r=new ZeroArray(this.#C);const i=new ZeroArray(this.#C);this.#Y=r;this.#z=i;this.#at=(a,l,c=o.now())=>{i[a]=l!==0?c:0;r[a]=l;if(l!==0&&this.ttlAutopurge){const r=setTimeout((()=>{if(this.#nt(a)){this.delete(this.#X[a])}}),l+1);if(r.unref){r.unref()}}};this.#lt=a=>{i[a]=r[a]!==0?o.now():0};this.#ct=(o,l)=>{if(r[l]){const c=r[l];const u=i[l];if(!c||!u)return;o.ttl=c;o.start=u;o.now=a||getNow();const h=o.now-u;o.remainingTTL=c-h}};let a=0;const getNow=()=>{const r=o.now();if(this.ttlResolution>0){a=r;const i=setTimeout((()=>a=0),this.ttlResolution);if(i.unref){i.unref()}}return r};this.getRemainingTTL=o=>{const l=this.#j.get(o);if(l===undefined){return 0}const c=r[l];const u=i[l];if(!c||!u){return Infinity}const h=(a||getNow())-u;return c-h};this.#nt=o=>{const l=i[o];const c=r[o];return!!c&&!!l&&(a||getNow())-l>c}}#lt=()=>{};#ct=()=>{};#at=()=>{};#nt=()=>false;#st(){const r=new ZeroArray(this.#C);this.#F=0;this.#H=r;this.#ut=i=>{this.#F-=r[i];r[i]=0};this.#ht=(r,i,o,a)=>{if(this.#Q(i)){return 0}if(!isPosInt(o)){if(a){if(typeof a!=="function"){throw new TypeError("sizeCalculation must be a function")}o=a(i,r);if(!isPosInt(o)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return o};this.#dt=(i,o,a)=>{r[i]=o;if(this.#L){const o=this.#L-r[i];while(this.#F>o){this.#ft(true)}}this.#F+=r[i];if(a){a.entrySize=o;a.totalCalculatedSize=this.#F}}}#ut=r=>{};#dt=(r,i,o)=>{};#ht=(r,i,o,a)=>{if(o||a){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#rt({allowStale:r=this.allowStale}={}){if(this.#R){for(let i=this.#q;true;){if(!this.#pt(i)){break}if(r||!this.#nt(i)){yield i}if(i===this.#V){break}else{i=this.#U[i]}}}}*#it({allowStale:r=this.allowStale}={}){if(this.#R){for(let i=this.#V;true;){if(!this.#pt(i)){break}if(r||!this.#nt(i)){yield i}if(i===this.#q){break}else{i=this.#$[i]}}}}#pt(r){return r!==undefined&&this.#j.get(this.#X[r])===r}*entries(){for(const r of this.#rt()){if(this.#B[r]!==undefined&&this.#X[r]!==undefined&&!this.#Q(this.#B[r])){yield[this.#X[r],this.#B[r]]}}}*rentries(){for(const r of this.#it()){if(this.#B[r]!==undefined&&this.#X[r]!==undefined&&!this.#Q(this.#B[r])){yield[this.#X[r],this.#B[r]]}}}*keys(){for(const r of this.#rt()){const i=this.#X[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield i}}}*rkeys(){for(const r of this.#it()){const i=this.#X[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield i}}}*values(){for(const r of this.#rt()){const i=this.#B[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield this.#B[r]}}}*rvalues(){for(const r of this.#it()){const i=this.#B[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield this.#B[r]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(r,i={}){for(const o of this.#rt()){const a=this.#B[o];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)continue;if(r(l,this.#X[o],this)){return this.get(this.#X[o],i)}}}forEach(r,i=this){for(const o of this.#rt()){const a=this.#B[o];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)continue;r.call(i,l,this.#X[o],this)}}rforEach(r,i=this){for(const o of this.#it()){const a=this.#B[o];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)continue;r.call(i,l,this.#X[o],this)}}purgeStale(){let r=false;for(const i of this.#it({allowStale:true})){if(this.#nt(i)){this.delete(this.#X[i]);r=true}}return r}info(r){const i=this.#j.get(r);if(i===undefined)return undefined;const a=this.#B[i];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)return undefined;const c={value:l};if(this.#Y&&this.#z){const r=this.#Y[i];const a=this.#z[i];if(r&&a){const i=r-(o.now()-a);c.ttl=i;c.start=Date.now()}}if(this.#H){c.size=this.#H[i]}return c}dump(){const r=[];for(const i of this.#rt({allowStale:true})){const a=this.#X[i];const l=this.#B[i];const c=this.#Q(l)?l.__staleWhileFetching:l;if(c===undefined||a===undefined)continue;const u={value:c};if(this.#Y&&this.#z){u.ttl=this.#Y[i];const r=o.now()-this.#z[i];u.start=Math.floor(Date.now()-r)}if(this.#H){u.size=this.#H[i]}r.unshift([a,u])}return r}load(r){this.clear();for(const[i,a]of r){if(a.start){const r=Date.now()-a.start;a.start=o.now()-r}this.set(i,a.value,a)}}set(r,i,o={}){if(i===undefined){this.delete(r);return this}const{ttl:a=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:h}=o;let{noUpdateTTL:d=this.noUpdateTTL}=o;const p=this.#ht(r,i,o.size||0,u);if(this.maxEntrySize&&p>this.maxEntrySize){if(h){h.set="miss";h.maxEntrySizeExceeded=true}this.delete(r);return this}let g=this.#R===0?undefined:this.#j.get(r);if(g===undefined){g=this.#R===0?this.#q:this.#W.length!==0?this.#W.pop():this.#R===this.#C?this.#ft(false):this.#R;this.#X[g]=r;this.#B[g]=i;this.#j.set(r,g);this.#$[this.#q]=g;this.#U[g]=this.#q;this.#q=g;this.#R++;this.#dt(g,p,h);if(h)h.set="add";d=false}else{this.#et(g);const o=this.#B[g];if(i!==o){if(this.#Z&&this.#Q(o)){o.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:i}=o;if(i!==undefined&&!c){if(this.#K){this.#P?.(i,r,"set")}if(this.#J){this.#G?.push([i,r,"set"])}}}else if(!c){if(this.#K){this.#P?.(o,r,"set")}if(this.#J){this.#G?.push([o,r,"set"])}}this.#ut(g);this.#dt(g,p,h);this.#B[g]=i;if(h){h.set="replace";const r=o&&this.#Q(o)?o.__staleWhileFetching:o;if(r!==undefined)h.oldValue=r}}else if(h){h.set="update"}}if(a!==0&&!this.#Y){this.#ot()}if(this.#Y){if(!d){this.#at(g,a,l)}if(h)this.#ct(h,g)}if(!c&&this.#J&&this.#G){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}return this}pop(){try{while(this.#R){const r=this.#B[this.#V];this.#ft(true);if(this.#Q(r)){if(r.__staleWhileFetching){return r.__staleWhileFetching}}else if(r!==undefined){return r}}}finally{if(this.#J&&this.#G){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}}}#ft(r){const i=this.#V;const o=this.#X[i];const a=this.#B[i];if(this.#Z&&this.#Q(a)){a.__abortController.abort(new Error("evicted"))}else if(this.#K||this.#J){if(this.#K){this.#P?.(a,o,"evict")}if(this.#J){this.#G?.push([a,o,"evict"])}}this.#ut(i);if(r){this.#X[i]=undefined;this.#B[i]=undefined;this.#W.push(i)}if(this.#R===1){this.#V=this.#q=0;this.#W.length=0}else{this.#V=this.#$[i]}this.#j.delete(o);this.#R--;return i}has(r,i={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:a}=i;const l=this.#j.get(r);if(l!==undefined){const r=this.#B[l];if(this.#Q(r)&&r.__staleWhileFetching===undefined){return false}if(!this.#nt(l)){if(o){this.#lt(l)}if(a){a.has="hit";this.#ct(a,l)}return true}else if(a){a.has="stale";this.#ct(a,l)}}else if(a){a.has="miss"}return false}peek(r,i={}){const{allowStale:o=this.allowStale}=i;const a=this.#j.get(r);if(a===undefined||!o&&this.#nt(a)){return}const l=this.#B[a];return this.#Q(l)?l.__staleWhileFetching:l}#tt(r,i,o,a){const l=i===undefined?undefined:this.#B[i];if(this.#Q(l)){return l}const u=new c;const{signal:h}=o;h?.addEventListener("abort",(()=>u.abort(h.reason)),{signal:u.signal});const d={signal:u.signal,options:o,context:a};const cb=(a,l=false)=>{const{aborted:c}=u.signal;const h=o.ignoreFetchAbort&&a!==undefined;if(o.status){if(c&&!l){o.status.fetchAborted=true;o.status.fetchError=u.signal.reason;if(h)o.status.fetchAbortIgnored=true}else{o.status.fetchResolved=true}}if(c&&!h&&!l){return fetchFail(u.signal.reason)}const g=p;if(this.#B[i]===p){if(a===undefined){if(g.__staleWhileFetching){this.#B[i]=g.__staleWhileFetching}else{this.delete(r)}}else{if(o.status)o.status.fetchUpdated=true;this.set(r,a,d.options)}}return a};const eb=r=>{if(o.status){o.status.fetchRejected=true;o.status.fetchError=r}return fetchFail(r)};const fetchFail=a=>{const{aborted:l}=u.signal;const c=l&&o.allowStaleOnFetchAbort;const h=c||o.allowStaleOnFetchRejection;const d=h||o.noDeleteOnFetchRejection;const g=p;if(this.#B[i]===p){const o=!d||g.__staleWhileFetching===undefined;if(o){this.delete(r)}else if(!c){this.#B[i]=g.__staleWhileFetching}}if(h){if(o.status&&g.__staleWhileFetching!==undefined){o.status.returnedStale=true}return g.__staleWhileFetching}else if(g.__returned===g){throw a}};const pcall=(i,a)=>{const c=this.#k?.(r,l,d);if(c&&c instanceof Promise){c.then((r=>i(r===undefined?undefined:r)),a)}u.signal.addEventListener("abort",(()=>{if(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort){i(undefined);if(o.allowStaleOnFetchAbort){i=r=>cb(r,true)}}}))};if(o.status)o.status.fetchDispatched=true;const p=new Promise(pcall).then(cb,eb);const g=Object.assign(p,{__abortController:u,__staleWhileFetching:l,__returned:undefined});if(i===undefined){this.set(r,g,{...d.options,status:undefined});i=this.#j.get(r)}else{this.#B[i]=g}return g}#Q(r){if(!this.#Z)return false;const i=r;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof c}async fetch(r,i={}){const{allowStale:o=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:h=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:p=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:v,forceRefresh:E=false,status:x,signal:M}=i;if(!this.#Z){if(x)x.fetch="get";return this.get(r,{allowStale:o,updateAgeOnGet:a,noDeleteOnStaleGet:l,status:x})}const D={allowStale:o,updateAgeOnGet:a,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:h,sizeCalculation:d,noUpdateTTL:p,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:b,ignoreFetchAbort:w,status:x,signal:M};let O=this.#j.get(r);if(O===undefined){if(x)x.fetch="miss";const i=this.#tt(r,O,D,v);return i.__returned=i}else{const i=this.#B[O];if(this.#Q(i)){const r=o&&i.__staleWhileFetching!==undefined;if(x){x.fetch="inflight";if(r)x.returnedStale=true}return r?i.__staleWhileFetching:i.__returned=i}const l=this.#nt(O);if(!E&&!l){if(x)x.fetch="hit";this.#et(O);if(a){this.#lt(O)}if(x)this.#ct(x,O);return i}const c=this.#tt(r,O,D,v);const u=c.__staleWhileFetching!==undefined;const h=u&&o;if(x){x.fetch=l?"stale":"refresh";if(h&&l)x.returnedStale=true}return h?c.__staleWhileFetching:c.__returned=c}}get(r,i={}){const{allowStale:o=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=i;const u=this.#j.get(r);if(u!==undefined){const i=this.#B[u];const h=this.#Q(i);if(c)this.#ct(c,u);if(this.#nt(u)){if(c)c.get="stale";if(!h){if(!l){this.delete(r)}if(c&&o)c.returnedStale=true;return o?i:undefined}else{if(c&&o&&i.__staleWhileFetching!==undefined){c.returnedStale=true}return o?i.__staleWhileFetching:undefined}}else{if(c)c.get="hit";if(h){return i.__staleWhileFetching}this.#et(u);if(a){this.#lt(u)}return i}}else if(c){c.get="miss"}}#mt(r,i){this.#U[i]=r;this.#$[r]=i}#et(r){if(r!==this.#q){if(r===this.#V){this.#V=this.#$[r]}else{this.#mt(this.#U[r],this.#$[r])}this.#mt(this.#q,r);this.#q=r}}delete(r){let i=false;if(this.#R!==0){const o=this.#j.get(r);if(o!==undefined){i=true;if(this.#R===1){this.clear()}else{this.#ut(o);const i=this.#B[o];if(this.#Q(i)){i.__abortController.abort(new Error("deleted"))}else if(this.#K||this.#J){if(this.#K){this.#P?.(i,r,"delete")}if(this.#J){this.#G?.push([i,r,"delete"])}}this.#j.delete(r);this.#X[o]=undefined;this.#B[o]=undefined;if(o===this.#q){this.#q=this.#U[o]}else if(o===this.#V){this.#V=this.#$[o]}else{const r=this.#U[o];this.#$[r]=this.#$[o];const i=this.#$[o];this.#U[i]=this.#U[o]}this.#R--;this.#W.push(o)}}}if(this.#J&&this.#G?.length){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}return i}clear(){for(const r of this.#it({allowStale:true})){const i=this.#B[r];if(this.#Q(i)){i.__abortController.abort(new Error("deleted"))}else{const o=this.#X[r];if(this.#K){this.#P?.(i,o,"delete")}if(this.#J){this.#G?.push([i,o,"delete"])}}}this.#j.clear();this.#B.fill(undefined);this.#X.fill(undefined);if(this.#Y&&this.#z){this.#Y.fill(0);this.#z.fill(0)}if(this.#H){this.#H.fill(0)}this.#V=0;this.#q=0;this.#W.length=0;this.#F=0;this.#R=0;if(this.#J&&this.#G){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}}}i.LRUCache=LRUCache},6014:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Minipass=i.isWritable=i.isReadable=i.isStream=void 0;const l=typeof process==="object"&&process?process:{stdout:null,stderr:null};const c=o(5673);const u=a(o(4492));const h=o(6915);const isStream=r=>!!r&&typeof r==="object"&&(r instanceof Minipass||r instanceof u.default||(0,i.isReadable)(r)||(0,i.isWritable)(r));i.isStream=isStream;const isReadable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.pipe==="function"&&r.pipe!==u.default.Writable.prototype.pipe;i.isReadable=isReadable;const isWritable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.write==="function"&&typeof r.end==="function";i.isWritable=isWritable;const d=Symbol("EOF");const p=Symbol("maybeEmitEnd");const g=Symbol("emittedEnd");const y=Symbol("emittingEnd");const w=Symbol("emittedError");const b=Symbol("closed");const v=Symbol("read");const E=Symbol("flush");const x=Symbol("flushChunk");const M=Symbol("encoding");const D=Symbol("decoder");const O=Symbol("flowing");const T=Symbol("paused");const S=Symbol("resume");const A=Symbol("buffer");const N=Symbol("pipes");const _=Symbol("bufferLength");const C=Symbol("bufferPush");const L=Symbol("bufferShift");const P=Symbol("objectMode");const I=Symbol("destroyed");const k=Symbol("error");const R=Symbol("emitData");const j=Symbol("emitEnd");const X=Symbol("emitEnd2");const B=Symbol("async");const $=Symbol("abort");const U=Symbol("aborted");const V=Symbol("signal");const q=Symbol("dataListeners");const W=Symbol("discarded");const defer=r=>Promise.resolve().then(r);const nodefer=r=>r();const isEndish=r=>r==="end"||r==="finish"||r==="prefinish";const isArrayBufferLike=r=>r instanceof ArrayBuffer||!!r&&typeof r==="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0;const isArrayBufferView=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r);class Pipe{src;dest;opts;ondrain;constructor(r,i,o){this.src=r;this.dest=i;this.opts=o;this.ondrain=()=>r[S]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(r){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(r,i,o){super(r,i,o);this.proxyErrors=r=>i.emit("error",r);r.on("error",this.proxyErrors)}}const isObjectModeOptions=r=>!!r.objectMode;const isEncodingOptions=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer";class Minipass extends c.EventEmitter{[O]=false;[T]=false;[N]=[];[A]=[];[P];[M];[B];[D];[d]=false;[g]=false;[y]=false;[b]=false;[w]=null;[_]=0;[I]=false;[V];[U]=false;[q]=0;[W]=false;writable=true;readable=true;constructor(...r){const i=r[0]||{};super();if(i.objectMode&&typeof i.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(i)){this[P]=true;this[M]=null}else if(isEncodingOptions(i)){this[M]=i.encoding;this[P]=false}else{this[P]=false;this[M]=null}this[B]=!!i.async;this[D]=this[M]?new h.StringDecoder(this[M]):null;if(i&&i.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[A]})}if(i&&i.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[N]})}const{signal:o}=i;if(o){this[V]=o;if(o.aborted){this[$]()}else{o.addEventListener("abort",(()=>this[$]()))}}}get bufferLength(){return this[_]}get encoding(){return this[M]}set encoding(r){throw new Error("Encoding must be set at instantiation time")}setEncoding(r){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[P]}set objectMode(r){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[B]}set["async"](r){this[B]=this[B]||!!r}[$](){this[U]=true;this.emit("abort",this[V]?.reason);this.destroy(this[V]?.reason)}get aborted(){return this[U]}set aborted(r){}write(r,i,o){if(this[U])return false;if(this[d])throw new Error("write after end");if(this[I]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof i==="function"){o=i;i="utf8"}if(!i)i="utf8";const a=this[B]?defer:nodefer;if(!this[P]&&!Buffer.isBuffer(r)){if(isArrayBufferView(r)){r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}else if(isArrayBufferLike(r)){r=Buffer.from(r)}else if(typeof r!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[P]){if(this[O]&&this[_]!==0)this[E](true);if(this[O])this.emit("data",r);else this[C](r);if(this[_]!==0)this.emit("readable");if(o)a(o);return this[O]}if(!r.length){if(this[_]!==0)this.emit("readable");if(o)a(o);return this[O]}if(typeof r==="string"&&!(i===this[M]&&!this[D]?.lastNeed)){r=Buffer.from(r,i)}if(Buffer.isBuffer(r)&&this[M]){r=this[D].write(r)}if(this[O]&&this[_]!==0)this[E](true);if(this[O])this.emit("data",r);else this[C](r);if(this[_]!==0)this.emit("readable");if(o)a(o);return this[O]}read(r){if(this[I])return null;this[W]=false;if(this[_]===0||r===0||r&&r>this[_]){this[p]();return null}if(this[P])r=null;if(this[A].length>1&&!this[P]){this[A]=[this[M]?this[A].join(""):Buffer.concat(this[A],this[_])]}const i=this[v](r||null,this[A][0]);this[p]();return i}[v](r,i){if(this[P])this[L]();else{const o=i;if(r===o.length||r===null)this[L]();else if(typeof o==="string"){this[A][0]=o.slice(r);i=o.slice(0,r);this[_]-=r}else{this[A][0]=o.subarray(r);i=o.subarray(0,r);this[_]-=r}}this.emit("data",i);if(!this[A].length&&!this[d])this.emit("drain");return i}end(r,i,o){if(typeof r==="function"){o=r;r=undefined}if(typeof i==="function"){o=i;i="utf8"}if(r!==undefined)this.write(r,i);if(o)this.once("end",o);this[d]=true;this.writable=false;if(this[O]||!this[T])this[p]();return this}[S](){if(this[I])return;if(!this[q]&&!this[N].length){this[W]=true}this[T]=false;this[O]=true;this.emit("resume");if(this[A].length)this[E]();else if(this[d])this[p]();else this.emit("drain")}resume(){return this[S]()}pause(){this[O]=false;this[T]=true;this[W]=false}get destroyed(){return this[I]}get flowing(){return this[O]}get paused(){return this[T]}[C](r){if(this[P])this[_]+=1;else this[_]+=r.length;this[A].push(r)}[L](){if(this[P])this[_]-=1;else this[_]-=this[A][0].length;return this[A].shift()}[E](r=false){do{}while(this[x](this[L]())&&this[A].length);if(!r&&!this[A].length&&!this[d])this.emit("drain")}[x](r){this.emit("data",r);return this[O]}pipe(r,i){if(this[I])return r;this[W]=false;const o=this[g];i=i||{};if(r===l.stdout||r===l.stderr)i.end=false;else i.end=i.end!==false;i.proxyErrors=!!i.proxyErrors;if(o){if(i.end)r.end()}else{this[N].push(!i.proxyErrors?new Pipe(this,r,i):new PipeProxyErrors(this,r,i));if(this[B])defer((()=>this[S]()));else this[S]()}return r}unpipe(r){const i=this[N].find((i=>i.dest===r));if(i){if(this[N].length===1){if(this[O]&&this[q]===0){this[O]=false}this[N]=[]}else this[N].splice(this[N].indexOf(i),1);i.unpipe()}}addListener(r,i){return this.on(r,i)}on(r,i){const o=super.on(r,i);if(r==="data"){this[W]=false;this[q]++;if(!this[N].length&&!this[O]){this[S]()}}else if(r==="readable"&&this[_]!==0){super.emit("readable")}else if(isEndish(r)&&this[g]){super.emit(r);this.removeAllListeners(r)}else if(r==="error"&&this[w]){const r=i;if(this[B])defer((()=>r.call(this,this[w])));else r.call(this,this[w])}return o}removeListener(r,i){return this.off(r,i)}off(r,i){const o=super.off(r,i);if(r==="data"){this[q]=this.listeners("data").length;if(this[q]===0&&!this[W]&&!this[N].length){this[O]=false}}return o}removeAllListeners(r){const i=super.removeAllListeners(r);if(r==="data"||r===undefined){this[q]=0;if(!this[W]&&!this[N].length){this[O]=false}}return i}get emittedEnd(){return this[g]}[p](){if(!this[y]&&!this[g]&&!this[I]&&this[A].length===0&&this[d]){this[y]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[b])this.emit("close");this[y]=false}}emit(r,...i){const o=i[0];if(r!=="error"&&r!=="close"&&r!==I&&this[I]){return false}else if(r==="data"){return!this[P]&&!o?false:this[B]?(defer((()=>this[R](o))),true):this[R](o)}else if(r==="end"){return this[j]()}else if(r==="close"){this[b]=true;if(!this[g]&&!this[I])return false;const r=super.emit("close");this.removeAllListeners("close");return r}else if(r==="error"){this[w]=o;super.emit(k,o);const r=!this[V]||this.listeners("error").length?super.emit("error",o):false;this[p]();return r}else if(r==="resume"){const r=super.emit("resume");this[p]();return r}else if(r==="finish"||r==="prefinish"){const i=super.emit(r);this.removeAllListeners(r);return i}const a=super.emit(r,...i);this[p]();return a}[R](r){for(const i of this[N]){if(i.dest.write(r)===false)this.pause()}const i=this[W]?false:super.emit("data",r);this[p]();return i}[j](){if(this[g])return false;this[g]=true;this.readable=false;return this[B]?(defer((()=>this[X]())),true):this[X]()}[X](){if(this[D]){const r=this[D].end();if(r){for(const i of this[N]){i.dest.write(r)}if(!this[W])super.emit("data",r)}}for(const r of this[N]){r.end()}const r=super.emit("end");this.removeAllListeners("end");return r}async collect(){const r=Object.assign([],{dataLength:0});if(!this[P])r.dataLength=0;const i=this.promise();this.on("data",(i=>{r.push(i);if(!this[P])r.dataLength+=i.length}));await i;return r}async concat(){if(this[P]){throw new Error("cannot concat in objectMode")}const r=await this.collect();return this[M]?r.join(""):Buffer.concat(r,r.dataLength)}async promise(){return new Promise(((r,i)=>{this.on(I,(()=>i(new Error("stream destroyed"))));this.on("error",(r=>i(r)));this.on("end",(()=>r()))}))}[Symbol.asyncIterator](){this[W]=false;let r=false;const stop=async()=>{this.pause();r=true;return{value:undefined,done:true}};const next=()=>{if(r)return stop();const i=this.read();if(i!==null)return Promise.resolve({done:false,value:i});if(this[d])return stop();let o;let a;const onerr=r=>{this.off("data",ondata);this.off("end",onend);this.off(I,ondestroy);stop();a(r)};const ondata=r=>{this.off("error",onerr);this.off("end",onend);this.off(I,ondestroy);this.pause();o({value:r,done:!!this[d]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(I,ondestroy);stop();o({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((r,i)=>{a=i;o=r;this.once(I,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[W]=false;let r=false;const stop=()=>{this.pause();this.off(k,stop);this.off(I,stop);this.off("end",stop);r=true;return{done:true,value:undefined}};const next=()=>{if(r)return stop();const i=this.read();return i===null?stop():{done:false,value:i}};this.once("end",stop);this.once(k,stop);this.once(I,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(r){if(this[I]){if(r)this.emit("error",r);else this.emit(I);return this}this[I]=true;this[W]=true;this[A].length=0;this[_]=0;const i=this;if(typeof i.close==="function"&&!this[b])i.close();if(r)this.emit("error",r);else this.emit(I);return this}static get isStream(){return i.isStream}}i.Minipass=Minipass},5715:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.PathScurry=i.Path=i.PathScurryDarwin=i.PathScurryPosix=i.PathScurryWin32=i.PathScurryBase=i.PathPosix=i.PathWin32=i.PathBase=i.ChildrenCache=i.ResolveCache=void 0;const u=o(3576);const h=o(9411);const d=o(1041);const p=o(7147);const g=c(o(7561));const y=p.realpathSync.native;const w=o(3977);const b=o(6014);const v={lstatSync:p.lstatSync,readdir:p.readdir,readdirSync:p.readdirSync,readlinkSync:p.readlinkSync,realpathSync:y,promises:{lstat:w.lstat,readdir:w.readdir,readlink:w.readlink,realpath:w.realpath}};const fsFromOption=r=>!r||r===v||r===g?v:{...v,...r,promises:{...v.promises,...r.promises||{}}};const E=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=r=>r.replace(/\//g,"\\").replace(E,"$1\\");const x=/[\\\/]/;const M=0;const D=1;const O=2;const T=4;const S=6;const A=8;const N=10;const _=12;const C=15;const L=~C;const P=16;const I=32;const k=64;const R=128;const j=256;const X=512;const B=k|R|X;const $=1023;const entToType=r=>r.isFile()?A:r.isDirectory()?T:r.isSymbolicLink()?N:r.isCharacterDevice()?O:r.isBlockDevice()?S:r.isSocket()?_:r.isFIFO()?D:M;const U=new Map;const normalize=r=>{const i=U.get(r);if(i)return i;const o=r.normalize("NFKD");U.set(r,o);return o};const V=new Map;const normalizeNocase=r=>{const i=V.get(r);if(i)return i;const o=normalize(r.toLowerCase());V.set(r,o);return o};class ResolveCache extends u.LRUCache{constructor(){super({max:256})}}i.ResolveCache=ResolveCache;class ChildrenCache extends u.LRUCache{constructor(r=16*1024){super({maxSize:r,sizeCalculation:r=>r.length+1})}}i.ChildrenCache=ChildrenCache;const q=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#gt;#yt;get dev(){return this.#yt}#wt;get mode(){return this.#wt}#bt;get nlink(){return this.#bt}#vt;get uid(){return this.#vt}#Et;get gid(){return this.#Et}#xt;get rdev(){return this.#xt}#Mt;get blksize(){return this.#Mt}#Dt;get ino(){return this.#Dt}#R;get size(){return this.#R}#Ot;get blocks(){return this.#Ot}#Tt;get atimeMs(){return this.#Tt}#St;get mtimeMs(){return this.#St}#At;get ctimeMs(){return this.#At}#Nt;get birthtimeMs(){return this.#Nt}#_t;get atime(){return this.#_t}#Ct;get mtime(){return this.#Ct}#Lt;get ctime(){return this.#Lt}#Pt;get birthtime(){return this.#Pt}#It;#kt;#Rt;#Ft;#jt;#Xt;#Bt;#$t;#Ut;#Vt;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(r,i=M,o,a,l,c,u){this.name=r;this.#It=l?normalizeNocase(r):normalize(r);this.#Bt=i&$;this.nocase=l;this.roots=a;this.root=o||this;this.#$t=c;this.#Rt=u.fullpath;this.#jt=u.relative;this.#Xt=u.relativePosix;this.parent=u.parent;if(this.parent){this.#gt=this.parent.#gt}else{this.#gt=fsFromOption(u.fs)}}depth(){if(this.#kt!==undefined)return this.#kt;if(!this.parent)return this.#kt=0;return this.#kt=this.parent.depth()+1}childrenCache(){return this.#$t}resolve(r){if(!r){return this}const i=this.getRootString(r);const o=r.substring(i.length);const a=o.split(this.splitSep);const l=i?this.getRoot(i).#qt(a):this.#qt(a);return l}#qt(r){let i=this;for(const o of r){i=i.child(o)}return i}children(){const r=this.#$t.get(this);if(r){return r}const i=Object.assign([],{provisional:0});this.#$t.set(this,i);this.#Bt&=~P;return i}child(r,i){if(r===""||r==="."){return this}if(r===".."){return this.parent||this}const o=this.children();const a=this.nocase?normalizeNocase(r):normalize(r);for(const r of o){if(r.#It===a){return r}}const l=this.parent?this.sep:"";const c=this.#Rt?this.#Rt+l+r:undefined;const u=this.newChild(r,M,{...i,parent:this,fullpath:c});if(!this.canReaddir()){u.#Bt|=R}o.push(u);return u}relative(){if(this.isCWD)return"";if(this.#jt!==undefined){return this.#jt}const r=this.name;const i=this.parent;if(!i){return this.#jt=this.name}const o=i.relative();return o+(!o||!i.parent?"":this.sep)+r}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#Xt!==undefined)return this.#Xt;const r=this.name;const i=this.parent;if(!i){return this.#Xt=this.fullpathPosix()}const o=i.relativePosix();return o+(!o||!i.parent?"":"/")+r}fullpath(){if(this.#Rt!==undefined){return this.#Rt}const r=this.name;const i=this.parent;if(!i){return this.#Rt=this.name}const o=i.fullpath();const a=o+(!i.parent?"":this.sep)+r;return this.#Rt=a}fullpathPosix(){if(this.#Ft!==undefined)return this.#Ft;if(this.sep==="/")return this.#Ft=this.fullpath();if(!this.parent){const r=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(r)){return this.#Ft=`//?/${r}`}else{return this.#Ft=r}}const r=this.parent;const i=r.fullpathPosix();const o=i+(!i||!r.parent?"":"/")+this.name;return this.#Ft=o}isUnknown(){return(this.#Bt&C)===M}isType(r){return this[`is${r}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Bt&C)===A}isDirectory(){return(this.#Bt&C)===T}isCharacterDevice(){return(this.#Bt&C)===O}isBlockDevice(){return(this.#Bt&C)===S}isFIFO(){return(this.#Bt&C)===D}isSocket(){return(this.#Bt&C)===_}isSymbolicLink(){return(this.#Bt&N)===N}lstatCached(){return this.#Bt&I?this:undefined}readlinkCached(){return this.#Ut}realpathCached(){return this.#Vt}readdirCached(){const r=this.children();return r.slice(0,r.provisional)}canReadlink(){if(this.#Ut)return true;if(!this.parent)return false;const r=this.#Bt&C;return!(r!==M&&r!==N||this.#Bt&j||this.#Bt&R)}calledReaddir(){return!!(this.#Bt&P)}isENOENT(){return!!(this.#Bt&R)}isNamed(r){return!this.nocase?this.#It===normalize(r):this.#It===normalizeNocase(r)}async readlink(){const r=this.#Ut;if(r){return r}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const r=await this.#gt.promises.readlink(this.fullpath());const i=(await this.parent.realpath())?.resolve(r);if(i){return this.#Ut=i}}catch(r){this.#Wt(r.code);return undefined}}readlinkSync(){const r=this.#Ut;if(r){return r}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const r=this.#gt.readlinkSync(this.fullpath());const i=this.parent.realpathSync()?.resolve(r);if(i){return this.#Ut=i}}catch(r){this.#Wt(r.code);return undefined}}#Gt(r){this.#Bt|=P;for(let i=r.provisional;i<r.length;i++){const o=r[i];if(o)o.#Ht()}}#Ht(){if(this.#Bt&R)return;this.#Bt=(this.#Bt|R)&L;this.#zt()}#zt(){const r=this.children();r.provisional=0;for(const i of r){i.#Ht()}}#Yt(){this.#Bt|=X;this.#Kt()}#Kt(){if(this.#Bt&k)return;let r=this.#Bt;if((r&C)===T)r&=L;this.#Bt=r|k;this.#zt()}#Zt(r=""){if(r==="ENOTDIR"||r==="EPERM"){this.#Kt()}else if(r==="ENOENT"){this.#Ht()}else{this.children().provisional=0}}#Jt(r=""){if(r==="ENOTDIR"){const r=this.parent;r.#Kt()}else if(r==="ENOENT"){this.#Ht()}}#Wt(r=""){let i=this.#Bt;i|=j;if(r==="ENOENT")i|=R;if(r==="EINVAL"||r==="UNKNOWN"){i&=L}this.#Bt=i;if(r==="ENOTDIR"&&this.parent){this.parent.#Kt()}}#Qt(r,i){return this.#te(r,i)||this.#ee(r,i)}#ee(r,i){const o=entToType(r);const a=this.newChild(r.name,o,{parent:this});const l=a.#Bt&C;if(l!==T&&l!==N&&l!==M){a.#Bt|=k}i.unshift(a);i.provisional++;return a}#te(r,i){for(let o=i.provisional;o<i.length;o++){const a=i[o];const l=this.nocase?normalizeNocase(r.name):normalize(r.name);if(l!==a.#It){continue}return this.#re(r,a,o,i)}}#re(r,i,o,a){const l=i.name;i.#Bt=i.#Bt&L|entToType(r);if(l!==r.name)i.name=r.name;if(o!==a.provisional){if(o===a.length-1)a.pop();else a.splice(o,1);a.unshift(i)}a.provisional++;return i}async lstat(){if((this.#Bt&R)===0){try{this.#ie(await this.#gt.promises.lstat(this.fullpath()));return this}catch(r){this.#Jt(r.code)}}}lstatSync(){if((this.#Bt&R)===0){try{this.#ie(this.#gt.lstatSync(this.fullpath()));return this}catch(r){this.#Jt(r.code)}}}#ie(r){const{atime:i,atimeMs:o,birthtime:a,birthtimeMs:l,blksize:c,blocks:u,ctime:h,ctimeMs:d,dev:p,gid:g,ino:y,mode:w,mtime:b,mtimeMs:v,nlink:E,rdev:x,size:D,uid:O}=r;this.#_t=i;this.#Tt=o;this.#Pt=a;this.#Nt=l;this.#Mt=c;this.#Ot=u;this.#Lt=h;this.#At=d;this.#yt=p;this.#Et=g;this.#Dt=y;this.#wt=w;this.#Ct=b;this.#St=v;this.#bt=E;this.#xt=x;this.#R=D;this.#vt=O;const S=entToType(r);this.#Bt=this.#Bt&L|S|I;if(S!==M&&S!==T&&S!==N){this.#Bt|=k}}#ne=[];#se=false;#oe(r){this.#se=false;const i=this.#ne.slice();this.#ne.length=0;i.forEach((i=>i(null,r)))}readdirCB(r,i=false){if(!this.canReaddir()){if(i)r(null,[]);else queueMicrotask((()=>r(null,[])));return}const o=this.children();if(this.calledReaddir()){const a=o.slice(0,o.provisional);if(i)r(null,a);else queueMicrotask((()=>r(null,a)));return}this.#ne.push(r);if(this.#se){return}this.#se=true;const a=this.fullpath();this.#gt.readdir(a,{withFileTypes:true},((r,i)=>{if(r){this.#Zt(r.code);o.provisional=0}else{for(const r of i){this.#Qt(r,o)}this.#Gt(o)}this.#oe(o.slice(0,o.provisional));return}))}#ae;async readdir(){if(!this.canReaddir()){return[]}const r=this.children();if(this.calledReaddir()){return r.slice(0,r.provisional)}const i=this.fullpath();if(this.#ae){await this.#ae}else{let resolve=()=>{};this.#ae=new Promise((r=>resolve=r));try{for(const o of await this.#gt.promises.readdir(i,{withFileTypes:true})){this.#Qt(o,r)}this.#Gt(r)}catch(i){this.#Zt(i.code);r.provisional=0}this.#ae=undefined;resolve()}return r.slice(0,r.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const r=this.children();if(this.calledReaddir()){return r.slice(0,r.provisional)}const i=this.fullpath();try{for(const o of this.#gt.readdirSync(i,{withFileTypes:true})){this.#Qt(o,r)}this.#Gt(r)}catch(i){this.#Zt(i.code);r.provisional=0}return r.slice(0,r.provisional)}canReaddir(){if(this.#Bt&B)return false;const r=C&this.#Bt;if(!(r===M||r===T||r===N)){return false}return true}shouldWalk(r,i){return(this.#Bt&T)===T&&!(this.#Bt&B)&&!r.has(this)&&(!i||i(this))}async realpath(){if(this.#Vt)return this.#Vt;if((X|j|R)&this.#Bt)return undefined;try{const r=await this.#gt.promises.realpath(this.fullpath());return this.#Vt=this.resolve(r)}catch(r){this.#Yt()}}realpathSync(){if(this.#Vt)return this.#Vt;if((X|j|R)&this.#Bt)return undefined;try{const r=this.#gt.realpathSync(this.fullpath());return this.#Vt=this.resolve(r)}catch(r){this.#Yt()}}[q](r){if(r===this)return;r.isCWD=false;this.isCWD=true;const i=new Set([]);let o=[];let a=this;while(a&&a.parent){i.add(a);a.#jt=o.join(this.sep);a.#Xt=o.join("/");a=a.parent;o.push("..")}a=r;while(a&&a.parent&&!i.has(a)){a.#jt=undefined;a.#Xt=undefined;a=a.parent}}}i.PathBase=PathBase;class PathWin32 extends PathBase{sep="\\";splitSep=x;constructor(r,i=M,o,a,l,c,u){super(r,i,o,a,l,c,u)}newChild(r,i=M,o={}){return new PathWin32(r,i,this.root,this.roots,this.nocase,this.childrenCache(),o)}getRootString(r){return h.win32.parse(r).root}getRoot(r){r=uncToDrive(r.toUpperCase());if(r===this.root.name){return this.root}for(const[i,o]of Object.entries(this.roots)){if(this.sameRoot(r,i)){return this.roots[r]=o}}return this.roots[r]=new PathScurryWin32(r,this).root}sameRoot(r,i=this.root.name){r=r.toUpperCase().replace(/\//g,"\\").replace(E,"$1\\");return r===i}}i.PathWin32=PathWin32;class PathPosix extends PathBase{splitSep="/";sep="/";constructor(r,i=M,o,a,l,c,u){super(r,i,o,a,l,c,u)}getRootString(r){return r.startsWith("/")?"/":""}getRoot(r){return this.root}newChild(r,i=M,o={}){return new PathPosix(r,i,this.root,this.roots,this.nocase,this.childrenCache(),o)}}i.PathPosix=PathPosix;class PathScurryBase{root;rootPath;roots;cwd;#le;#ce;#$t;nocase;#gt;constructor(r=process.cwd(),i,o,{nocase:a,childrenCacheSize:l=16*1024,fs:c=v}={}){this.#gt=fsFromOption(c);if(r instanceof URL||r.startsWith("file://")){r=(0,d.fileURLToPath)(r)}const u=i.resolve(r);this.roots=Object.create(null);this.rootPath=this.parseRootPath(u);this.#le=new ResolveCache;this.#ce=new ResolveCache;this.#$t=new ChildrenCache(l);const h=u.substring(this.rootPath.length).split(o);if(h.length===1&&!h[0]){h.pop()}if(a===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=a;this.root=this.newRoot(this.#gt);this.roots[this.rootPath]=this.root;let p=this.root;let g=h.length-1;const y=i.sep;let w=this.rootPath;let b=false;for(const r of h){const i=g--;p=p.child(r,{relative:new Array(i).fill("..").join(y),relativePosix:new Array(i).fill("..").join("/"),fullpath:w+=(b?"":y)+r});b=true}this.cwd=p}depth(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.depth()}childrenCache(){return this.#$t}resolve(...r){let i="";for(let o=r.length-1;o>=0;o--){const a=r[o];if(!a||a===".")continue;i=i?`${a}/${i}`:a;if(this.isAbsolute(a)){break}}const o=this.#le.get(i);if(o!==undefined){return o}const a=this.cwd.resolve(i).fullpath();this.#le.set(i,a);return a}resolvePosix(...r){let i="";for(let o=r.length-1;o>=0;o--){const a=r[o];if(!a||a===".")continue;i=i?`${a}/${i}`:a;if(this.isAbsolute(a)){break}}const o=this.#ce.get(i);if(o!==undefined){return o}const a=this.cwd.resolve(i).fullpathPosix();this.#ce.set(i,a);return a}relative(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.relative()}relativePosix(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.relativePosix()}basename(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.name}dirname(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return(r.parent||r).fullpath()}async readdir(r=this.cwd,i={withFileTypes:true}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o}=i;if(!r.canReaddir()){return[]}else{const i=await r.readdir();return o?i:i.map((r=>r.name))}}readdirSync(r=this.cwd,i={withFileTypes:true}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true}=i;if(!r.canReaddir()){return[]}else if(o){return r.readdirSync()}else{return r.readdirSync().map((r=>r.name))}}async lstat(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.lstat()}lstatSync(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.lstatSync()}async readlink(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=await r.readlink();return i?o:o?.fullpath()}readlinkSync(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=r.readlinkSync();return i?o:o?.fullpath()}async realpath(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=await r.realpath();return i?o:o?.fullpath()}realpathSync(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=r.realpathSync();return i?o:o?.fullpath()}async walk(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=[];if(!l||l(r)){u.push(o?r:r.fullpath())}const h=new Set;const walk=(r,i)=>{h.add(r);r.readdirCB(((r,d)=>{if(r){return i(r)}let p=d.length;if(!p)return i();const next=()=>{if(--p===0){i()}};for(const r of d){if(!l||l(r)){u.push(o?r:r.fullpath())}if(a&&r.isSymbolicLink()){r.realpath().then((r=>r?.isUnknown()?r.lstat():r)).then((r=>r?.shouldWalk(h,c)?walk(r,next):next()))}else{if(r.shouldWalk(h,c)){walk(r,next)}else{next()}}}}),true)};const d=r;return new Promise(((r,i)=>{walk(d,(o=>{if(o)return i(o);r(u)}))}))}walkSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=[];if(!l||l(r)){u.push(o?r:r.fullpath())}const h=new Set([r]);for(const r of h){const i=r.readdirSync();for(const r of i){if(!l||l(r)){u.push(o?r:r.fullpath())}let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(h,c)){h.add(i)}}}return u}[Symbol.asyncIterator](){return this.iterate()}iterate(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}return this.stream(r,i)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;if(!l||l(r)){yield o?r:r.fullpath()}const u=new Set([r]);for(const r of u){const i=r.readdirSync();for(const r of i){if(!l||l(r)){yield o?r:r.fullpath()}let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(u,c)){u.add(i)}}}}stream(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=new b.Minipass({objectMode:true});if(!l||l(r)){u.write(o?r:r.fullpath())}const h=new Set;const d=[r];let p=0;const process=()=>{let r=false;while(!r){const i=d.shift();if(!i){if(p===0)u.end();return}p++;h.add(i);const onReaddir=(i,y,w=false)=>{if(i)return u.emit("error",i);if(a&&!w){const r=[];for(const i of y){if(i.isSymbolicLink()){r.push(i.realpath().then((r=>r?.isUnknown()?r.lstat():r)))}}if(r.length){Promise.all(r).then((()=>onReaddir(null,y,true)));return}}for(const i of y){if(i&&(!l||l(i))){if(!u.write(o?i:i.fullpath())){r=true}}}p--;for(const r of y){const i=r.realpathCached()||r;if(i.shouldWalk(h,c)){d.push(i)}}if(r&&!u.flowing){u.once("drain",process)}else if(!g){process()}};let g=true;i.readdirCB(onReaddir,true);g=false}};process();return u}streamSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=new b.Minipass({objectMode:true});const h=new Set;if(!l||l(r)){u.write(o?r:r.fullpath())}const d=[r];let p=0;const process=()=>{let r=false;while(!r){const i=d.shift();if(!i){if(p===0)u.end();return}p++;h.add(i);const g=i.readdirSync();for(const i of g){if(!l||l(i)){if(!u.write(o?i:i.fullpath())){r=true}}}p--;for(const r of g){let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(h,c)){d.push(i)}}}if(r&&!u.flowing)u.once("drain",process)};process();return u}chdir(r=this.cwd){const i=this.cwd;this.cwd=typeof r==="string"?this.cwd.resolve(r):r;this.cwd[q](i)}}i.PathScurryBase=PathScurryBase;class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(r=process.cwd(),i={}){const{nocase:o=true}=i;super(r,h.win32,"\\",{...i,nocase:o});this.nocase=o;for(let r=this.cwd;r;r=r.parent){r.nocase=this.nocase}}parseRootPath(r){return h.win32.parse(r).root.toUpperCase()}newRoot(r){return new PathWin32(this.rootPath,T,undefined,this.roots,this.nocase,this.childrenCache(),{fs:r})}isAbsolute(r){return r.startsWith("/")||r.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(r)}}i.PathScurryWin32=PathScurryWin32;class PathScurryPosix extends PathScurryBase{sep="/";constructor(r=process.cwd(),i={}){const{nocase:o=false}=i;super(r,h.posix,"/",{...i,nocase:o});this.nocase=o}parseRootPath(r){return"/"}newRoot(r){return new PathPosix(this.rootPath,T,undefined,this.roots,this.nocase,this.childrenCache(),{fs:r})}isAbsolute(r){return r.startsWith("/")}}i.PathScurryPosix=PathScurryPosix;class PathScurryDarwin extends PathScurryPosix{constructor(r=process.cwd(),i={}){const{nocase:o=true}=i;super(r,{...i,nocase:o})}}i.PathScurryDarwin=PathScurryDarwin;i.Path=process.platform==="win32"?PathWin32:PathPosix;i.PathScurry=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix},4147:r=>{"use strict";r.exports=JSON.parse('{"name":"uri-scheme","version":"1.4.2","description":"Interact with native URI schemes","main":"build/index.js","keywords":["expo","ios","uri-scheme","android"],"repository":{"type":"git","url":"https://github.com/expo/expo.git","directory":"packages/uri-scheme"},"author":"Expo <support@expo.dev>","license":"MIT","bugs":{"url":"https://github.com/expo/expo/issues"},"homepage":"https://github.com/expo/expo/tree/main/packages/uri-scheme#readme","bin":"cli.js","files":["build","cli.js"],"scripts":{"build":"ncc build ./src/index.ts -o build/","build:prod":"ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register","clean":"expo-module clean","lint":"expo-module lint","prepare":"yarn run clean && yarn run build:prod","test":"expo-module test","typecheck":"expo-module typecheck","watch":"yarn run build --watch","prepublishOnly":"expo-module prepublishOnly"},"devDependencies":{"@expo/config-plugins":"~9.1.2","@expo/plist":"^0.3.1","@expo/spawn-async":"^1.7.2","@types/prompts":"^2.0.6","chalk":"^4.0.0","commander":"^12.1.0","expo-module-scripts":"^4.1.1","glob":"^10.4.2","prompts":"^2.3.2","update-check":"^1.5.4"},"gitHead":"c81263062bf24ad09e51e019f1d7dc29fa651c55"}')}};var i={};function __nccwpck_require__(o){var a=i[o];if(a!==undefined){return a.exports}var l=i[o]={id:o,loaded:false,exports:{}};var c=true;try{r[o].call(l.exports,l,l.exports,__nccwpck_require__);c=false}finally{if(c)delete i[o]}l.loaded=true;return l.exports}(()=>{__nccwpck_require__.nmd=r=>{r.paths=[];if(!r.children)r.children=[];return r}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var o=__nccwpck_require__(2855);module.exports=o})();
30
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var o=16384;var a=[];var l;var c;var u=-1;var h=arguments.length;if(!h){return""}var d="";while(++u<h){var p=Number(arguments[u]);if(!isFinite(p)||p<0||p>1114111||i(p)!==p){throw RangeError("Invalid code point: "+p)}if(p<=65535){a.push(p)}else{p-=65536;l=(p>>10)+55296;c=p%1024+56320;a.push(l,c)}if(u+1===h||a.length>o){d+=r.apply(null,a);a.length=0}}return d};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},4970:(r,i,o)=>{"use strict";const a=o(1504);r.exports=(r="")=>{const i=r.match(a);if(!i){return null}const[o,l]=i[0].replace(/#! ?/,"").split(" ");const c=o.split("/").pop();if(c==="env"){return l}return l?`${c} ${l}`:c}},1504:r=>{"use strict";r.exports=/^#!(.*)/},332:r=>{"use strict";const i="";const o=`${i}[`;const a="";const l={to(r,i){if(!i)return`${o}${r+1}G`;return`${o}${i+1};${r+1}H`},move(r,i){let a="";if(r<0)a+=`${o}${-r}D`;else if(r>0)a+=`${o}${r}C`;if(i<0)a+=`${o}${-i}A`;else if(i>0)a+=`${o}${i}B`;return a},up:(r=1)=>`${o}${r}A`,down:(r=1)=>`${o}${r}B`,forward:(r=1)=>`${o}${r}C`,backward:(r=1)=>`${o}${r}D`,nextLine:(r=1)=>`${o}E`.repeat(r),prevLine:(r=1)=>`${o}F`.repeat(r),left:`${o}G`,hide:`${o}?25l`,show:`${o}?25h`,save:`${i}7`,restore:`${i}8`};const c={up:(r=1)=>`${o}S`.repeat(r),down:(r=1)=>`${o}T`.repeat(r)};const u={screen:`${o}2J`,up:(r=1)=>`${o}1J`.repeat(r),down:(r=1)=>`${o}J`.repeat(r),line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,lines(r){let i="";for(let o=0;o<r;o++)i+=this.line+(o<r-1?l.up():"");if(r)i+=l.left;return i}};r.exports={cursor:l,scroll:c,erase:u,beep:a}},395:(r,i,o)=>{"use strict";const a=o(2037);const l=o(6224);const c=o(6738);const{env:u}=process;let h;if(c("no-color")||c("no-colors")||c("color=false")||c("color=never")){h=0}else if(c("color")||c("colors")||c("color=true")||c("color=always")){h=1}if("FORCE_COLOR"in u){if(u.FORCE_COLOR==="true"){h=1}else if(u.FORCE_COLOR==="false"){h=0}else{h=u.FORCE_COLOR.length===0?1:Math.min(parseInt(u.FORCE_COLOR,10),3)}}function translateLevel(r){if(r===0){return false}return{level:r,hasBasic:true,has256:r>=2,has16m:r>=3}}function supportsColor(r,i){if(h===0){return 0}if(c("color=16m")||c("color=full")||c("color=truecolor")){return 3}if(c("color=256")){return 2}if(r&&!i&&h===undefined){return 0}const o=h||0;if(u.TERM==="dumb"){return o}if(process.platform==="win32"){const r=a.release().split(".");if(Number(r[0])>=10&&Number(r[2])>=10586){return Number(r[2])>=14931?3:2}return 1}if("CI"in u){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((r=>r in u))||u.CI_NAME==="codeship"){return 1}return o}if("TEAMCITY_VERSION"in u){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0}if(u.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in u){const r=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(u.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)){return 1}if("COLORTERM"in u){return 1}return o}function getSupportLevel(r){const i=supportsColor(r,r&&r.isTTY);return translateLevel(i)}r.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,l.isatty(1))),stderr:translateLevel(supportsColor(true,l.isatty(2)))}},5418:(r,i,o)=>{const{URL:a}=o(7310);const{join:l}=o(1017);const c=o(7147);const{promisify:u}=o(3837);const{tmpdir:h}=o(2037);const d=o(2447);const p=u(c.writeFile);const g=u(c.mkdir);const y=u(c.readFile);const compareVersions=(r,i)=>r.localeCompare(i,"en-US",{numeric:true});const encode=r=>encodeURIComponent(r).replace(/^%40/,"@");const getFile=async(r,i)=>{const o=h();const a=l(o,"update-check");if(!c.existsSync(a)){await g(a)}let u=`${r.name}-${i}.json`;if(r.scope){u=`${r.scope}-${u}`}return l(a,u)};const evaluateCache=async(r,i,o)=>{if(c.existsSync(r)){const a=await y(r,"utf8");const{lastUpdate:l,latest:c}=JSON.parse(a);const u=l+o;if(u>i){return{shouldCheck:false,latest:c}}}return{shouldCheck:true,latest:null}};const updateCache=async(r,i,o)=>{const a=JSON.stringify({latest:i,lastUpdate:o});await p(r,a,"utf8")};const loadPackage=(r,i)=>new Promise(((a,l)=>{const c={host:r.hostname,path:r.pathname,port:r.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(i){c.headers.authorization=`${i.type} ${i.token}`}const{get:u}=o(r.protocol==="https:"?5687:3685);u(c,(r=>{const{statusCode:i}=r;if(i!==200){const o=new Error(`Request failed with code ${i}`);o.code=i;l(o);r.resume();return}let o="";r.setEncoding("utf8");r.on("data",(r=>{o+=r}));r.on("end",(()=>{try{const r=JSON.parse(o);a(r)}catch(r){l(r)}}))})).on("error",l).on("timeout",l)}));const getMostRecent=async({full:r,scope:i},l)=>{const c=d(i);const u=new a(r,c);let h=null;try{h=await loadPackage(u)}catch(r){if(r.code&&String(r.code).startsWith(4)){const r=o(1384);const i=r(c,{recursive:true});h=await loadPackage(u,i)}else{throw r}}const p=h["dist-tags"][l];if(!p){throw new Error(`Distribution tag ${l} is not available`)}return p};const w={interval:36e5,distTag:"latest"};const getDetails=r=>{const i={full:encode(r)};if(r.includes("/")){const o=r.split("/");i.scope=o[0];i.name=o[1]}else{i.scope=null;i.name=r}return i};r.exports=async(r,i)=>{if(typeof r!=="object"){throw new Error("The first parameter should be your package.json file content")}const o=getDetails(r.name);const a=Date.now();const{distTag:l,interval:c}=Object.assign({},w,i);const u=await getFile(o,l);let h=null;let d=true;({shouldCheck:d,latest:h}=await evaluateCache(u,a,c));if(d){h=await getMostRecent(o,l);await updateCache(u,h,a)}const p=compareVersions(r.version,h);if(p===-1){return{latest:h,fromCache:!d}}return null}},4604:function(r,i){(function(){"use strict";i.stripBOM=function(r){if(r[0]==="\ufeff"){return r.substring(1)}else{return r}}}).call(this)},1002:function(r,i,o){(function(){"use strict";var r,a,l,c,u,h={}.hasOwnProperty;r=o(3131);a=o(9498).defaults;c=function(r){return typeof r==="string"&&(r.indexOf("&")>=0||r.indexOf(">")>=0||r.indexOf("<")>=0)};u=function(r){return"<![CDATA["+l(r)+"]]>"};l=function(r){return r.replace("]]>","]]]]><![CDATA[>")};i.Builder=function(){function Builder(r){var i,o,l;this.options={};o=a["0.2"];for(i in o){if(!h.call(o,i))continue;l=o[i];this.options[i]=l}for(i in r){if(!h.call(r,i))continue;l=r[i];this.options[i]=l}}Builder.prototype.buildObject=function(i){var o,l,d,p,g;o=this.options.attrkey;l=this.options.charkey;if(Object.keys(i).length===1&&this.options.rootName===a["0.2"].rootName){g=Object.keys(i)[0];i=i[g]}else{g=this.options.rootName}d=function(r){return function(i,a){var p,g,y,w,b,v;if(typeof a!=="object"){if(r.options.cdata&&c(a)){i.raw(u(a))}else{i.txt(a)}}else if(Array.isArray(a)){for(w in a){if(!h.call(a,w))continue;g=a[w];for(b in g){y=g[b];i=d(i.ele(b),y).up()}}}else{for(b in a){if(!h.call(a,b))continue;g=a[b];if(b===o){if(typeof g==="object"){for(p in g){v=g[p];i=i.att(p,v)}}}else if(b===l){if(r.options.cdata&&c(g)){i=i.raw(u(g))}else{i=i.txt(g)}}else if(Array.isArray(g)){for(w in g){if(!h.call(g,w))continue;y=g[w];if(typeof y==="string"){if(r.options.cdata&&c(y)){i=i.ele(b).raw(u(y)).up()}else{i=i.ele(b,y).up()}}else{i=d(i.ele(b),y).up()}}}else if(typeof g==="object"){i=d(i.ele(b),g).up()}else{if(typeof g==="string"&&r.options.cdata&&c(g)){i=i.ele(b).raw(u(g)).up()}else{if(g==null){g=""}i=i.ele(b,g.toString()).up()}}}}return i}}(this);p=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return d(p,i).end(this.options.renderOpts)};return Builder}()}).call(this)},9498:function(r,i){(function(){i.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},7426:function(r,i,o){(function(){"use strict";var r,a,l,c,u,h,d,p,g,bind=function(r,i){return function(){return r.apply(i,arguments)}},extend=function(r,i){for(var o in i){if(y.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},y={}.hasOwnProperty;p=o(9746);l=o(2361);r=o(4604);d=o(9068);g=o(9512).setImmediate;a=o(9498).defaults;c=function(r){return typeof r==="object"&&r!=null&&Object.keys(r).length===0};u=function(r){return r!=="__proto__"&&r!=="constructor"&&r!=="prototype"};h=function(r,i,o){var a,l,c;for(a=0,l=r.length;a<l;a++){c=r[a];i=c(i,o)}return i};i.Parser=function(o){extend(Parser,o);function Parser(r){this.parseStringPromise=bind(this.parseStringPromise,this);this.parseString=bind(this.parseString,this);this.reset=bind(this.reset,this);this.assignOrPush=bind(this.assignOrPush,this);this.processAsync=bind(this.processAsync,this);var o,l,c;if(!(this instanceof i.Parser)){return new i.Parser(r)}this.options={};l=a["0.2"];for(o in l){if(!y.call(l,o))continue;c=l[o];this.options[o]=c}for(o in r){if(!y.call(r,o))continue;c=r[o];this.options[o]=c}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(d.normalize)}this.reset()}Parser.prototype.processAsync=function(){var r,i;try{if(this.remaining.length<=this.options.chunkSize){r=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(r);return this.saxParser.close()}else{r=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(r);return g(this.processAsync)}}catch(r){i=r;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(i)}}};Parser.prototype.assignOrPush=function(r,i,o){if(!u(i)){return}if(!(i in r)){if(!this.options.explicitArray){return r[i]=o}else{return r[i]=[o]}}else{if(!(r[i]instanceof Array)){r[i]=[r[i]]}return r[i].push(o)}};Parser.prototype.reset=function(){var r,i,o,a;this.removeAllListeners();this.saxParser=p.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(r){return function(i){r.saxParser.resume();if(!r.saxParser.errThrown){r.saxParser.errThrown=true;return r.emit("error",i)}}}(this);this.saxParser.onend=function(r){return function(){if(!r.saxParser.ended){r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;a=[];r=this.options.attrkey;i=this.options.charkey;this.saxParser.onopentag=function(o){return function(l){var c,d,p,g,w;p={};p[i]="";if(!o.options.ignoreAttrs){w=l.attributes;for(c in w){if(!y.call(w,c))continue;if(!(r in p)&&!o.options.mergeAttrs){p[r]={}}d=o.options.attrValueProcessors?h(o.options.attrValueProcessors,l.attributes[c],c):l.attributes[c];g=o.options.attrNameProcessors?h(o.options.attrNameProcessors,c):c;if(u(g)){if(o.options.mergeAttrs){o.assignOrPush(p,g,d)}else{p[r][g]=d}}}}p["#name"]=o.options.tagNameProcessors?h(o.options.tagNameProcessors,l.name):l.name;if(o.options.xmlns){p[o.options.xmlnskey]={uri:l.uri,local:l.local}}return a.push(p)}}(this);this.saxParser.onclosetag=function(r){return function(){var o,l,d,p,g,w,b,v,E,x;w=a.pop();g=w["#name"];if(!r.options.explicitChildren||!r.options.preserveChildrenOrder){delete w["#name"]}if(w.cdata===true){o=w.cdata;delete w.cdata}E=a[a.length-1];if(w[i].match(/^\s*$/)&&!o){l=w[i];delete w[i]}else{if(r.options.trim){w[i]=w[i].trim()}if(r.options.normalize){w[i]=w[i].replace(/\s{2,}/g," ").trim()}w[i]=r.options.valueProcessors?h(r.options.valueProcessors,w[i],g):w[i];if(Object.keys(w).length===1&&i in w&&!r.EXPLICIT_CHARKEY){w=w[i]}}if(c(w)){if(typeof r.options.emptyTag==="function"){w=r.options.emptyTag()}else{w=r.options.emptyTag!==""?r.options.emptyTag:l}}if(r.options.validator!=null){x="/"+function(){var r,i,o;o=[];for(r=0,i=a.length;r<i;r++){p=a[r];o.push(p["#name"])}return o}().concat(g).join("/");(function(){var i;try{return w=r.options.validator(x,E&&E[g],w)}catch(o){i=o;return r.emit("error",i)}})()}if(r.options.explicitChildren&&!r.options.mergeAttrs&&typeof w==="object"){if(!r.options.preserveChildrenOrder){p={};if(r.options.attrkey in w){p[r.options.attrkey]=w[r.options.attrkey];delete w[r.options.attrkey]}if(!r.options.charsAsChildren&&r.options.charkey in w){p[r.options.charkey]=w[r.options.charkey];delete w[r.options.charkey]}if(Object.getOwnPropertyNames(w).length>0){p[r.options.childkey]=w}w=p}else if(E){E[r.options.childkey]=E[r.options.childkey]||[];b={};for(d in w){if(!y.call(w,d))continue;if(u(d)){b[d]=w[d]}}E[r.options.childkey].push(b);delete w["#name"];if(Object.keys(w).length===1&&i in w&&!r.EXPLICIT_CHARKEY){w=w[i]}}}if(a.length>0){return r.assignOrPush(E,g,w)}else{if(r.options.explicitRoot){v=w;w={};w[g]=v}r.resultObject=w;r.saxParser.ended=true;return r.emit("end",r.resultObject)}}}(this);o=function(r){return function(o){var l,c;c=a[a.length-1];if(c){c[i]+=o;if(r.options.explicitChildren&&r.options.preserveChildrenOrder&&r.options.charsAsChildren&&(r.options.includeWhiteChars||o.replace(/\\n/g,"").trim()!=="")){c[r.options.childkey]=c[r.options.childkey]||[];l={"#name":"__text__"};l[i]=o;if(r.options.normalize){l[i]=l[i].replace(/\s{2,}/g," ").trim()}c[r.options.childkey].push(l)}return c}}}(this);this.saxParser.ontext=o;return this.saxParser.oncdata=function(r){return function(r){var i;i=o(r);if(i){return i.cdata=true}}}(this)};Parser.prototype.parseString=function(i,o){var a;if(o!=null&&typeof o==="function"){this.on("end",(function(r){this.reset();return o(null,r)}));this.on("error",(function(r){this.reset();return o(r)}))}try{i=i.toString();if(i.trim()===""){this.emit("end",null);return true}i=r.stripBOM(i);if(this.options.async){this.remaining=i;g(this.processAsync);return this.saxParser}return this.saxParser.write(i).close()}catch(r){a=r;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",a);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw a}}};Parser.prototype.parseStringPromise=function(r){return new Promise(function(i){return function(o,a){return i.parseString(r,(function(r,i){if(r){return a(r)}else{return o(i)}}))}}(this))};return Parser}(l);i.parseString=function(r,o,a){var l,c,u;if(a!=null){if(typeof a==="function"){l=a}if(typeof o==="object"){c=o}}else{if(typeof o==="function"){l=o}c={}}u=new i.Parser(c);return u.parseString(r,l)};i.parseStringPromise=function(r,o){var a,l;if(typeof o==="object"){a=o}l=new i.Parser(a);return l.parseStringPromise(r)}}).call(this)},9068:function(r,i){(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/);i.normalize=function(r){return r.toLowerCase()};i.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)};i.stripPrefix=function(i){return i.replace(r,"")};i.parseNumbers=function(r){if(!isNaN(r)){r=r%1===0?parseInt(r,10):parseFloat(r)}return r};i.parseBooleans=function(r){if(/^(?:true|false)$/i.test(r)){r=r.toLowerCase()==="true"}return r}}).call(this)},7013:function(r,i,o){(function(){"use strict";var r,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;a=o(9498);r=o(1002);l=o(7426);c=o(9068);i.defaults=a.defaults;i.processors=c;i.ValidationError=function(r){extend(ValidationError,r);function ValidationError(r){this.message=r}return ValidationError}(Error);i.Builder=r.Builder;i.Parser=l.Parser;i.parseString=l.parseString;i.parseStringPromise=l.parseStringPromise}).call(this)},2346:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},4128:function(r){(function(){r.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},2629:function(r){(function(){var i,o,a,l,c,u,h,d=[].slice,p={}.hasOwnProperty;i=function(){var r,i,o,a,l,u;u=arguments[0],l=2<=arguments.length?d.call(arguments,1):[];if(c(Object.assign)){Object.assign.apply(null,arguments)}else{for(r=0,o=l.length;r<o;r++){a=l[r];if(a!=null){for(i in a){if(!p.call(a,i))continue;u[i]=a[i]}}}}return u};c=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};u=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(c(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!p.call(r,i))continue;return false}return true}};h=function(r){var i,o;return u(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(c(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=c;r.exports.isObject=u;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},8413:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},9525:function(r,i,o){(function(){var i,a,l;i=o(4128);l=o(8064);r.exports=a=function(){function XMLAttribute(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))};XMLAttribute.prototype.debugInfo=function(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},6789:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);l=o(3527);r.exports=a=function(r){extend(XMLCData,r);function XMLCData(r,o){XMLCData.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))};return XMLCData}(l)}).call(this)},3527:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8064);r.exports=i=function(r){extend(XMLCharacterData,r);function XMLCharacterData(r){XMLCharacterData.__super__.constructor.call(this,r);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(r){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.data!==this.data){return false}return true};return XMLCharacterData}(a)}).call(this)},4593:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLComment,r);function XMLComment(r,o){XMLComment.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))};return XMLComment}(a)}).call(this)},4196:function(r,i,o){(function(){var i,a,l;a=o(7850);l=o(5132);r.exports=i=function(){function XMLDOMConfiguration(){var r;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new a,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=r=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(r,i){return true};XMLDOMConfiguration.prototype.setParameter=function(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}};return XMLDOMConfiguration}()}).call(this)},7850:function(r){(function(){var i;r.exports=i=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(r){throw new Error(r)};return XMLDOMErrorHandler}()}).call(this)},9490:function(r){(function(){var i;r.exports=i=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(r,i){return true};XMLDOMImplementation.prototype.createDocumentType=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(r,i,o){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},5132:function(r){(function(){var i;r.exports=i=function(){function XMLDOMStringList(r){this.arr=r||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(r){return this.arr[r]||null};XMLDOMStringList.prototype.contains=function(r){return this.arr.indexOf(r)!==-1};return XMLDOMStringList}()}).call(this)},1066:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDAttList,r);function XMLDTDAttList(r,o,a,l,c,u){XMLDTDAttList.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!c){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(c.indexOf("#")!==0){c="#"+c}if(!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(u&&!c.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(u){this.defaultValue=this.stringify.dtdAttDefault(u)}this.defaultValueType=c}XMLDTDAttList.prototype.toString=function(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))};return XMLDTDAttList}(l)}).call(this)},3584:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDElement,r);function XMLDTDElement(r,o,a){XMLDTDElement.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!a){a="(#PCDATA)"}if(Array.isArray(a)){a="("+a.join(",")+")"}this.name=this.stringify.name(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}XMLDTDElement.prototype.toString=function(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))};return XMLDTDElement}(l)}).call(this)},9346:function(r,i,o){(function(){var i,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;c=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDEntity,r);function XMLDTDEntity(r,o,a,l){XMLDTDEntity.__super__.constructor.call(this,r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!c(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))};return XMLDTDEntity}(l)}).call(this)},853:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDTDNotation,r);function XMLDTDNotation(r,o,a){XMLDTDNotation.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))};return XMLDTDNotation}(l)}).call(this)},4972:function(r,i,o){(function(){var i,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;c=o(2629).isObject;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDeclaration,r);function XMLDeclaration(r,o,a,l){var u;XMLDeclaration.__super__.constructor.call(this,r);if(c(o)){u=o,o=u.version,a=u.encoding,l=u.standalone}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}XMLDeclaration.prototype.toString=function(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))};return XMLDeclaration}(l)}).call(this)},9025:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,extend=function(r,i){for(var o in i){if(y.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},y={}.hasOwnProperty;g=o(2629).isObject;p=o(8064);i=o(4128);a=o(1066);c=o(9346);l=o(3584);u=o(853);d=o(8339);r.exports=h=function(r){extend(XMLDocType,r);function XMLDocType(r,o,a){var l,c,u,h,d,p;XMLDocType.__super__.constructor.call(this,r);this.type=i.DocType;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(g(o)){d=o,o=d.pubID,a=d.sysID}if(a==null){p=[o,a],a=p[0],o=p[1]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(r,i){var o;o=new l(this,r,i);this.children.push(o);return this};XMLDocType.prototype.attList=function(r,i,o,l,c){var u;u=new a(this,r,i,o,l,c);this.children.push(u);return this};XMLDocType.prototype.entity=function(r,i){var o;o=new c(this,false,r,i);this.children.push(o);return this};XMLDocType.prototype.pEntity=function(r,i){var o;o=new c(this,true,r,i);this.children.push(o);return this};XMLDocType.prototype.notation=function(r,i){var o;o=new u(this,r,i);this.children.push(o);return this};XMLDocType.prototype.toString=function(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))};XMLDocType.prototype.ele=function(r,i){return this.element(r,i)};XMLDocType.prototype.att=function(r,i,o,a,l){return this.attList(r,i,o,a,l)};XMLDocType.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocType.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocType.prototype.not=function(r,i){return this.notation(r,i)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(r){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true};return XMLDocType}(p)}).call(this)},3315:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,extend=function(r,i){for(var o in i){if(g.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},g={}.hasOwnProperty;p=o(2629).isPlainObject;l=o(9490);a=o(4196);u=o(8064);i=o(4128);d=o(916);h=o(6939);r.exports=c=function(r){extend(XMLDocument,r);function XMLDocument(r){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))};XMLDocument.prototype.toString=function(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))};XMLDocument.prototype.createElement=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(u)}).call(this)},1523:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S,A,N,_,C,L={}.hasOwnProperty;C=o(2629),N=C.isObject,A=C.isFunction,_=C.isPlainObject,S=C.getValue;i=o(4128);b=o(3315);E=o(7370);c=o(6789);u=o(4593);M=o(363);T=o(8854);x=o(3234);y=o(4972);w=o(9025);h=o(1066);p=o(9346);d=o(3584);g=o(853);l=o(9525);O=o(916);D=o(6939);a=o(8413);r.exports=v=function(){function XMLDocumentCB(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(_(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new O(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(r){var o,a,l,c,u,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!L.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(u=0,h=p.length;u<h;u++){c=p[u];this.createChildNode(c);if(c.type===i.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(r,i,o){var a;if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=S(r);if(i==null){i={}}i=S(i);if(!N(i)){a=[i,o],o=a[0],i=a[1]}this.currentNode=new E(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this};XMLDocumentCB.prototype.element=function(r,o,a){var l,c,u,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(r)||N(r)||A(r)){h=this.options.noValidation;this.options.noValidation=true;p=new b(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(c=0,u=d.length;c<u;c++){l=d[c];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this};XMLDocumentCB.prototype.attribute=function(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=S(r)}if(N(r)){for(o in r){if(!L.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(A(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this};XMLDocumentCB.prototype.text=function(r){var i;this.openCurrent();i=new T(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(r){var i;this.openCurrent();i=new M(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(r,i){var o,a,l,c,u;this.openCurrent();if(r!=null){r=S(r)}if(i!=null){i=S(i)}if(Array.isArray(r)){for(o=0,c=r.length;o<c;o++){a=r[o];this.instruction(a)}}else if(N(r)){for(a in r){if(!L.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(A(i)){i=i.apply()}u=new x(this,r,i);this.onData(this.writer.processingInstruction(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new y(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new w(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(r,i,o,a,l){var c;this.openCurrent();c=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(r,i){var o;this.openCurrent();o=new g(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(r){var o,l,c,u;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;u=r.attribs;for(c in u){if(!L.call(u,c))continue;o=u[c];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}};XMLDocumentCB.prototype.onData=function(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(r){if(r==null){return""}else{return"node: <"+r+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.txt=function(r){return this.text(r)};XMLDocumentCB.prototype.dat=function(r){return this.cdata(r)};XMLDocumentCB.prototype.com=function(r){return this.comment(r)};XMLDocumentCB.prototype.ins=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLDocumentCB.prototype.dtd=function(r,i,o){return this.doctype(r,i,o)};XMLDocumentCB.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLDocumentCB.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLDocumentCB.prototype.t=function(r){return this.text(r)};XMLDocumentCB.prototype.d=function(r){return this.cdata(r)};XMLDocumentCB.prototype.c=function(r){return this.comment(r)};XMLDocumentCB.prototype.r=function(r){return this.raw(r)};XMLDocumentCB.prototype.i=function(r,i){return this.instruction(r,i)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(r,i){return this.entity(r,i)};XMLDocumentCB.prototype.pent=function(r,i){return this.pEntity(r,i)};XMLDocumentCB.prototype.not=function(r,i){return this.notation(r,i)};return XMLDocumentCB}()}).call(this)},3288:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;l=o(8064);i=o(4128);r.exports=a=function(r){extend(XMLDummy,r);function XMLDummy(r){XMLDummy.__super__.constructor.call(this,r);this.type=i.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(r){return""};return XMLDummy}(l)}).call(this)},7370:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,extend=function(r,i){for(var o in i){if(y.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},y={}.hasOwnProperty;g=o(2629),p=g.isObject,d=g.isFunction,h=g.getValue;u=o(8064);i=o(4128);a=o(9525);c=o(8339);r.exports=l=function(r){extend(XMLElement,r);function XMLElement(r,o,a){var l,c,u,h;XMLElement.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.DocType){l.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new c(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!y.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o};XMLElement.prototype.attribute=function(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!y.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this};XMLElement.prototype.removeAttribute=function(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this};XMLElement.prototype.toString=function(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))};XMLElement.prototype.att=function(r,i){return this.attribute(r,i)};XMLElement.prototype.a=function(r,i){return this.attribute(r,i)};XMLElement.prototype.getAttribute=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}};XMLElement.prototype.setAttribute=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}};XMLElement.prototype.setAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(r){return this.attribs.hasOwnProperty(r)};XMLElement.prototype.hasAttributeNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}};XMLElement.prototype.setIdAttributeNS=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(r){var i,o,a;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true};return XMLElement}(u)}).call(this)},8339:function(r){(function(){var i;r.exports=i=function(){function XMLNamedNodeMap(r){this.nodes=r}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(r){return this.nodes[r]};XMLNamedNodeMap.prototype.setNamedItem=function(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null};XMLNamedNodeMap.prototype.removeNamedItem=function(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null};XMLNamedNodeMap.prototype.item=function(r){return this.nodes[Object.keys(this.nodes)[r]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(r){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(r,i){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},8064:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S={}.hasOwnProperty;T=o(2629),O=T.isObject,D=T.isFunction,M=T.isEmpty,x=T.getValue;p=null;l=null;c=null;u=null;h=null;v=null;E=null;b=null;d=null;a=null;w=null;g=null;i=null;r.exports=y=function(){function XMLNode(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(7370);l=o(6789);c=o(4593);u=o(4972);h=o(9025);v=o(363);E=o(8854);b=o(3234);d=o(3288);a=o(4128);w=o(7209);g=o(8339);i=o(2346)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new w(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,c;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){c="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){c+=r.textContent}}return c}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(r){var i,o,a,l,c;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;c=[];for(o=0,a=l.length;o<a;o++){i=l[o];c.push(i.setParent(this))}return c};XMLNode.prototype.element=function(r,i,o){var a,l,c,u,h,d,p,g,y,w,b;d=null;if(i===null&&o==null){y=[{},null],i=y[0],o=y[1]}if(i==null){i={}}i=x(i);if(!O(i)){w=[i,o],o=w[0],i=w[1]}if(r!=null){r=x(r)}if(Array.isArray(r)){for(c=0,p=r.length;c<p;c++){l=r[c];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(O(r)){for(h in r){if(!S.call(r,h))continue;b=r[h];if(D(b)){b=b.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),b)}else if(!this.options.separateArrayItems&&Array.isArray(b)&&M(b)){d=this.dummy()}else if(O(b)&&M(b)){d=this.element(h)}else if(!this.options.keepNullNodes&&b==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(b)){for(u=0,g=b.length;u<g;u++){l=b[u];a={};a[h]=l;d=this.element(a)}}else if(O(b)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(b)}else{d=this.element(h);d.element(b)}}else{d=this.element(h,b)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d};XMLNode.prototype.insertBefore=function(r,i,o){var a,l,c,u,h;if(r!=null?r.type:void 0){c=r;u=i;c.setParent(this);if(u){l=children.indexOf(u);h=children.splice(l);children.push(c);Array.prototype.push.apply(children,h)}else{children.push(c)}return c}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}};XMLNode.prototype.insertAfter=function(r,i,o){var a,l,c;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);c=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,c);return a};XMLNode.prototype.remove=function(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent};XMLNode.prototype.node=function(r,i,o){var a,l;if(r!=null){r=x(r)}i||(i={});i=x(i);if(!O(i)){l=[i,o],o=l[0],i=l[1]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a};XMLNode.prototype.text=function(r){var i;if(O(r)){this.element(r)}i=new E(this,r);this.children.push(i);return this};XMLNode.prototype.cdata=function(r){var i;i=new l(this,r);this.children.push(i);return this};XMLNode.prototype.comment=function(r){var i;i=new c(this,r);this.children.push(i);return this};XMLNode.prototype.commentBefore=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.commentAfter=function(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this};XMLNode.prototype.raw=function(r){var i;i=new v(this,r);this.children.push(i);return this};XMLNode.prototype.dummy=function(){var r;r=new d(this);return r};XMLNode.prototype.instruction=function(r,i){var o,a,l,c,u;if(r!=null){r=x(r)}if(i!=null){i=x(i)}if(Array.isArray(r)){for(c=0,u=r.length;c<u;c++){o=r[c];this.instruction(o)}}else if(O(r)){for(o in r){if(!S.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new b(this,r,i);this.children.push(l)}return this};XMLNode.prototype.instructionBefore=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.instructionAfter=function(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this};XMLNode.prototype.declaration=function(r,i,o){var l,c;l=this.document();c=new u(l,r,i,o);if(l.children.length===0){l.children.unshift(c)}else if(l.children[0].type===a.Declaration){l.children[0]=c}else{l.children.unshift(c)}return l.root()||l};XMLNode.prototype.dtd=function(r,i){var o,l,c,u,d,p,g,y,w,b;l=this.document();c=new h(l,r,i);w=l.children;for(u=d=0,g=w.length;d<g;u=++d){o=w[u];if(o.type===a.DocType){l.children[u]=c;return c}}b=l.children;for(u=p=0,y=b.length;p<y;u=++p){o=b[u];if(o.isRoot){l.children.splice(u,0,c);return c}}l.children.push(c);return c};XMLNode.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLNode.prototype.root=function(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}};XMLNode.prototype.document=function(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}};XMLNode.prototype.end=function(r){return this.document().end(r)};XMLNode.prototype.prev=function(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]};XMLNode.prototype.next=function(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]};XMLNode.prototype.importDocument=function(r){var i;i=r.root().clone();i.parent=this;i.isRoot=false;this.children.push(i);return this};XMLNode.prototype.debugInfo=function(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.nod=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.txt=function(r){return this.text(r)};XMLNode.prototype.dat=function(r){return this.cdata(r)};XMLNode.prototype.com=function(r){return this.comment(r)};XMLNode.prototype.ins=function(r,i){return this.instruction(r,i)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(r,i,o){return this.declaration(r,i,o)};XMLNode.prototype.e=function(r,i,o){return this.element(r,i,o)};XMLNode.prototype.n=function(r,i,o){return this.node(r,i,o)};XMLNode.prototype.t=function(r){return this.text(r)};XMLNode.prototype.d=function(r){return this.cdata(r)};XMLNode.prototype.c=function(r){return this.comment(r)};XMLNode.prototype.r=function(r){return this.raw(r)};XMLNode.prototype.i=function(r,i){return this.instruction(r,i)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(r){return this.importDocument(r)};XMLNode.prototype.replaceChild=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(r,i){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}};XMLNode.prototype.isSameNode=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true};XMLNode.prototype.getFeature=function(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(r){if(!r){return false}return r===this||this.isDescendant(r)};XMLNode.prototype.isDescendant=function(r){var i,o,a,l,c;c=this.children;for(a=0,l=c.length;a<l;a++){i=c[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false};XMLNode.prototype.isAncestor=function(r){return r.isDescendant(this)};XMLNode.prototype.isPreceding=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}};XMLNode.prototype.isFollowing=function(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}};XMLNode.prototype.treePosition=function(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}};XMLNode.prototype.foreachTreeNode=function(r,i){var o,a,l,c,u;r||(r=this.document());c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];if(u=i(o)){return u}else{u=this.foreachTreeNode(o,i);if(u){return u}}}};return XMLNode}()}).call(this)},7209:function(r){(function(){var i;r.exports=i=function(){function XMLNodeList(r){this.nodes=r}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(r){return this.nodes[r]||null};return XMLNodeList}()}).call(this)},3234:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLProcessingInstruction,r);function XMLProcessingInstruction(r,o,a){XMLProcessingInstruction.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))};XMLProcessingInstruction.prototype.isEqualNode=function(r){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(r)){return false}if(r.target!==this.target){return false}return true};return XMLProcessingInstruction}(a)}).call(this)},363:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(8064);r.exports=l=function(r){extend(XMLRaw,r);function XMLRaw(r,o){XMLRaw.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))};return XMLRaw}(a)}).call(this)},359:function(r,i,o){(function(){var i,a,l,c,extend=function(r,i){for(var o in i){if(u.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},u={}.hasOwnProperty;i=o(4128);c=o(8126);a=o(8413);r.exports=l=function(r){extend(XMLStreamWriter,r);function XMLStreamWriter(r,i){this.stream=r;XMLStreamWriter.__super__.constructor.call(this,i)}XMLStreamWriter.prototype.endline=function(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,r,i,o)}};XMLStreamWriter.prototype.document=function(r,i){var o,a,l,c,u,h,d,p,g;d=r.children;for(a=l=0,u=d.length;l<u;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;g=[];for(c=0,h=p.length;c<h;c++){o=p[c];g.push(this.writeChildNode(o,i,0))}return g};XMLStreamWriter.prototype.attribute=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,r,i,o))};XMLStreamWriter.prototype.cdata=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,r,i,o))};XMLStreamWriter.prototype.comment=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,r,i,o))};XMLStreamWriter.prototype.declaration=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,r,i,o))};XMLStreamWriter.prototype.docType=function(r,i,o){var l,c,u,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)};XMLStreamWriter.prototype.element=function(r,o,l){var c,h,d,p,g,y,w,b,v,E;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;this.stream.write(this.indent(r,o,l)+"<"+r.name);v=r.attribs;for(w in v){if(!u.call(v,w))continue;c=v[w];this.attribute(c,o,l)}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw)&&p.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;b=true;this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;b=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;E=r.children;for(g=0,y=E.length;g<y;g++){h=E[g];this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)};XMLStreamWriter.prototype.processingInstruction=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,r,i,o))};XMLStreamWriter.prototype.raw=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,r,i,o))};XMLStreamWriter.prototype.text=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.text.call(this,r,i,o))};XMLStreamWriter.prototype.dtdAttList=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,r,i,o))};XMLStreamWriter.prototype.dtdElement=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,r,i,o))};XMLStreamWriter.prototype.dtdEntity=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,r,i,o))};XMLStreamWriter.prototype.dtdNotation=function(r,i,o){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,r,i,o))};return XMLStreamWriter}(c)}).call(this)},6939:function(r,i,o){(function(){var i,a,extend=function(r,i){for(var o in i){if(l.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},l={}.hasOwnProperty;a=o(8126);r.exports=i=function(r){extend(XMLStringWriter,r);function XMLStringWriter(r){XMLStringWriter.__super__.constructor.call(this,r)}XMLStringWriter.prototype.document=function(r,i){var o,a,l,c,u;i=this.filterOptions(i);c="";u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];c+=this.writeChildNode(o,i,0)}if(i.pretty&&c.slice(-i.newline.length)===i.newline){c=c.slice(0,-i.newline.length)}return c};return XMLStringWriter}(a)}).call(this)},916:function(r){(function(){var i,bind=function(r,i){return function(){return r.apply(i,arguments)}},o={}.hasOwnProperty;r.exports=i=function(){function XMLStringifier(r){this.assertLegalName=bind(this.assertLegalName,this);this.assertLegalChar=bind(this.assertLegalChar,this);var i,a,l;r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}XMLStringifier.prototype.name=function(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")};XMLStringifier.prototype.text=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))};XMLStringifier.prototype.cdata=function(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)};XMLStringifier.prototype.comment=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.raw=function(r){if(this.options.noValidation){return r}return""+r||""};XMLStringifier.prototype.attValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))};XMLStringifier.prototype.insTarget=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.insValue=function(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlVersion=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r};XMLStringifier.prototype.xmlEncoding=function(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)};XMLStringifier.prototype.xmlStandalone=function(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdSysID=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdElementValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttType=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdAttDefault=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdEntityValue=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.dtdNData=function(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(r){var i,o;if(this.options.noValidation){return r}i="";if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(o=r.match(i)){throw new Error("Invalid character in string: "+r+" at index "+o.index)}}return r};XMLStringifier.prototype.assertLegalName=function(r){var i;if(this.options.noValidation){return r}this.assertLegalChar(r);i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!r.match(i)){throw new Error("Invalid character in name")}return r};XMLStringifier.prototype.textEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};XMLStringifier.prototype.attEscape=function(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return XMLStringifier}()}).call(this)},8854:function(r,i,o){(function(){var i,a,l,extend=function(r,i){for(var o in i){if(c.call(i,o))r[o]=i[o]}function ctor(){this.constructor=r}ctor.prototype=i.prototype;r.prototype=new ctor;r.__super__=i.prototype;return r},c={}.hasOwnProperty;i=o(4128);a=o(3527);r.exports=l=function(r){extend(XMLText,r);function XMLText(r,o){XMLText.__super__.constructor.call(this,r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))};XMLText.prototype.splitText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(a)}).call(this)},8126:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O={}.hasOwnProperty;D=o(2629).assign;i=o(4128);g=o(4972);y=o(9025);l=o(6789);c=o(4593);b=o(7370);E=o(363);x=o(8854);v=o(3234);w=o(3288);u=o(1066);h=o(3584);d=o(9346);p=o(853);a=o(8413);r.exports=M=function(){function XMLWriterBase(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!O.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}XMLWriterBase.prototype.filterOptions=function(r){var i,o,l,c,u,h,d,p;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(c=r.offset)!=null?c:0;i.dontPrettyTextNodes=(u=(h=r.dontPrettyTextNodes)!=null?h:r.dontprettytextnodes)!=null?u:0;i.spaceBeforeSlash=(d=(p=r.spaceBeforeSlash)!=null?p:r.spacebeforeslash)!=null?d:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i};XMLWriterBase.prototype.indent=function(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""};XMLWriterBase.prototype.endline=function(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}};XMLWriterBase.prototype.attribute=function(r,i,o){var a;this.openAttribute(r,i,o);a=" "+r.name+'="'+r.value+'"';this.closeAttribute(r,i,o);return a};XMLWriterBase.prototype.cdata=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.comment=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.declaration=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.docType=function(r,i,o){var l,c,u,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(c=0,u=d.length;c<u;c++){l=d[c];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h};XMLWriterBase.prototype.element=function(r,o,l){var c,u,h,d,p,g,y,w,b,v,E,x,M,D;l||(l=0);v=false;E="";this.openNode(r,o,l);o.state=a.OpenTag;E+=this.indent(r,o,l)+"<"+r.name;x=r.attribs;for(b in x){if(!O.call(x,b))continue;c=x[b];E+=this.attribute(c,o,l)}h=r.children.length;d=h===0?null:r.children[0];if(h===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw)&&r.value===""}))){if(o.allowEmpty){E+=">";o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;E+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&h===1&&(d.type===i.Text||d.type===i.Raw)&&d.value!=null){E+=">";o.state=a.InsideTag;o.suppressPrettyCount++;v=true;E+=this.writeChildNode(d,o,l+1);o.suppressPrettyCount--;v=false;o.state=a.CloseTag;E+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){M=r.children;for(p=0,y=M.length;p<y;p++){u=M[p];if((u.type===i.Text||u.type===i.Raw)&&u.value!=null){o.suppressPrettyCount++;v=true;break}}}E+=">"+this.endline(r,o,l);o.state=a.InsideTag;D=r.children;for(g=0,w=D.length;g<w;g++){u=D[g];E+=this.writeChildNode(u,o,l+1)}o.state=a.CloseTag;E+=this.indent(r,o,l)+"</"+r.name+">";if(v){o.suppressPrettyCount--}E+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return E};XMLWriterBase.prototype.writeChildNode=function(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.raw=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.text=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdAttList=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdElement=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdEntity=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.dtdNotation=function(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l};XMLWriterBase.prototype.openNode=function(r,i,o){};XMLWriterBase.prototype.closeNode=function(r,i,o){};XMLWriterBase.prototype.openAttribute=function(r,i,o){};XMLWriterBase.prototype.closeAttribute=function(r,i,o){};return XMLWriterBase}()}).call(this)},3131:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y;y=o(2629),p=y.assign,g=y.isFunction;l=o(9490);c=o(3315);u=o(1523);d=o(6939);h=o(359);i=o(4128);a=o(8413);r.exports.create=function(r,i,o,a){var l,u;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new c(a);u=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return u};r.exports.begin=function(r,i,o){var a;if(g(r)){a=[r,i],i=a[0],o=a[1];r={}}if(i){return new u(r,i,o)}else{return new c(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},144:function(r){(function(){r.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},7762:function(r){(function(){r.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},983:function(r){(function(){var i,o,a,l,c,u,h,d={}.hasOwnProperty;i=function(r,...i){var o,a,l,u;if(c(Object.assign)){Object.assign.apply(null,arguments)}else{for(o=0,l=i.length;o<l;o++){u=i[o];if(u!=null){for(a in u){if(!d.call(u,a))continue;r[a]=u[a]}}}}return r};c=function(r){return!!r&&Object.prototype.toString.call(r)==="[object Function]"};u=function(r){var i;return!!r&&((i=typeof r)==="function"||i==="object")};a=function(r){if(c(Array.isArray)){return Array.isArray(r)}else{return Object.prototype.toString.call(r)==="[object Array]"}};l=function(r){var i;if(a(r)){return!r.length}else{for(i in r){if(!d.call(r,i))continue;return false}return true}};h=function(r){var i,o;return u(r)&&(o=Object.getPrototypeOf(r))&&(i=o.constructor)&&typeof i==="function"&&i instanceof i&&Function.prototype.toString.call(i)===Function.prototype.toString.call(Object)};o=function(r){if(c(r.valueOf)){return r.valueOf()}else{return r}};r.exports.assign=i;r.exports.isFunction=c;r.exports.isObject=u;r.exports.isArray=a;r.exports.isEmpty=l;r.exports.isPlainObject=h;r.exports.getValue=o}).call(this)},140:function(r){(function(){r.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},1395:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(5089);r.exports=a=function(){class XMLAttribute{constructor(r,o,a){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(o==null){throw new Error("Missing attribute name. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.value=this.stringify.attValue(a);this.type=i.Attribute;this.isId=false;this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(r){return this.options.writer.attribute(this,this.options.writer.filterOptions(r))}debugInfo(r){r=r||this.name;if(r==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+r+"}, parent: <"+this.parent.name+">"}}isEqualNode(r){if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.value!==this.value){return false}return true}}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});return XMLAttribute}.call(this)}).call(this)},5261:function(r,i,o){(function(){var i,a,l;i=o(7762);l=o(4765);r.exports=a=class XMLCData extends l{constructor(r,o){super(r);if(o==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=i.CData;this.value=this.stringify.cdata(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.cdata(this,this.options.writer.filterOptions(r))}}}).call(this)},4765:function(r,i,o){(function(){var i,a;a=o(5089);r.exports=i=function(){class XMLCharacterData extends a{constructor(r){super(r);this.value=""}clone(){return Object.create(this)}substringData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}insertData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}deleteData(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.data!==this.data){return false}return true}}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(r){return this.value=r||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(r){return this.value=r||""}});return XMLCharacterData}.call(this)}).call(this)},360:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLComment extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=i.Comment;this.value=this.stringify.comment(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.comment(this,this.options.writer.filterOptions(r))}}}).call(this)},5675:function(r,i,o){(function(){var i,a,l;a=o(121);l=o(8207);r.exports=i=function(){class XMLDOMConfiguration{constructor(){var r;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new a,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=r=Object.create(this.defaultParams)}getParameter(r){if(this.params.hasOwnProperty(r)){return this.params[r]}else{return null}}canSetParameter(r,i){return true}setParameter(r,i){if(i!=null){return this.params[r]=i}else{return delete this.params[r]}}}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new l(Object.keys(this.defaultParams))}});return XMLDOMConfiguration}.call(this)}).call(this)},121:function(r){(function(){var i;r.exports=i=class XMLDOMErrorHandler{constructor(){}handleError(r){throw new Error(r)}}}).call(this)},2692:function(r){(function(){var i;r.exports=i=class XMLDOMImplementation{hasFeature(r,i){return true}createDocumentType(r,i,o){throw new Error("This DOM method is not implemented.")}createDocument(r,i,o){throw new Error("This DOM method is not implemented.")}createHTMLDocument(r){throw new Error("This DOM method is not implemented.")}getFeature(r,i){throw new Error("This DOM method is not implemented.")}}}).call(this)},8207:function(r){(function(){var i;r.exports=i=function(){class XMLDOMStringList{constructor(r){this.arr=r||[]}item(r){return this.arr[r]||null}contains(r){return this.arr.indexOf(r)!==-1}}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});return XMLDOMStringList}.call(this)}).call(this)},2529:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDAttList extends l{constructor(r,o,a,l,c,u){super(r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(a==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(o))}if(!l){throw new Error("Missing DTD attribute type. "+this.debugInfo(o))}if(!c){throw new Error("Missing DTD attribute default. "+this.debugInfo(o))}if(c.indexOf("#")!==0){c="#"+c}if(!c.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(o))}if(u&&!c.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(o))}this.elementName=this.stringify.name(o);this.type=i.AttributeDeclaration;this.attributeName=this.stringify.name(a);this.attributeType=this.stringify.dtdAttType(l);if(u){this.defaultValue=this.stringify.dtdAttDefault(u)}this.defaultValueType=c}toString(r){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(r))}}}).call(this)},7486:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDTDElement extends l{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!a){a="(#PCDATA)"}if(Array.isArray(a)){a="("+a.join(",")+")"}this.name=this.stringify.name(o);this.type=i.ElementDeclaration;this.value=this.stringify.dtdElementValue(a)}toString(r){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(r))}}}).call(this)},9252:function(r,i,o){(function(){var i,a,l,c;({isObject:c}=o(983));l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDEntity extends l{constructor(r,o,a,l){super(r);if(a==null){throw new Error("Missing DTD entity name. "+this.debugInfo(a))}if(l==null){throw new Error("Missing DTD entity value. "+this.debugInfo(a))}this.pe=!!o;this.name=this.stringify.name(a);this.type=i.EntityDeclaration;if(!c(l)){this.value=this.stringify.dtdEntityValue(l);this.internal=true}else{if(!l.pubID&&!l.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a))}if(l.pubID&&!l.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a))}this.internal=false;if(l.pubID!=null){this.pubID=this.stringify.dtdPubID(l.pubID)}if(l.sysID!=null){this.sysID=this.stringify.dtdSysID(l.sysID)}if(l.nData!=null){this.nData=this.stringify.dtdNData(l.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}}}toString(r){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(r))}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});return XMLDTDEntity}.call(this)}).call(this)},3353:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=function(){class XMLDTDNotation extends l{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing DTD notation name. "+this.debugInfo(o))}if(!a.pubID&&!a.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(o))}this.name=this.stringify.name(o);this.type=i.NotationDeclaration;if(a.pubID!=null){this.pubID=this.stringify.dtdPubID(a.pubID)}if(a.sysID!=null){this.sysID=this.stringify.dtdSysID(a.sysID)}}toString(r){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(r))}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});return XMLDTDNotation}.call(this)}).call(this)},6645:function(r,i,o){(function(){var i,a,l,c;({isObject:c}=o(983));l=o(5089);i=o(7762);r.exports=a=class XMLDeclaration extends l{constructor(r,o,a,l){super(r);if(c(o)){({version:o,encoding:a,standalone:l}=o)}if(!o){o="1.0"}this.type=i.Declaration;this.version=this.stringify.xmlVersion(o);if(a!=null){this.encoding=this.stringify.xmlEncoding(a)}if(l!=null){this.standalone=this.stringify.xmlStandalone(l)}}toString(r){return this.options.writer.declaration(this,this.options.writer.filterOptions(r))}}}).call(this)},8873:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g;({isObject:g}=o(983));p=o(5089);i=o(7762);a=o(2529);c=o(9252);l=o(7486);u=o(3353);d=o(2076);r.exports=h=function(){class XMLDocType extends p{constructor(r,o,a){var l,c,u,h;super(r);this.type=i.DocType;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.Element){this.name=l.name;break}}}this.documentObject=r;if(g(o)){({pubID:o,sysID:a}=o)}if(a==null){[a,o]=[o,a]}if(o!=null){this.pubID=this.stringify.dtdPubID(o)}if(a!=null){this.sysID=this.stringify.dtdSysID(a)}}element(r,i){var o;o=new l(this,r,i);this.children.push(o);return this}attList(r,i,o,l,c){var u;u=new a(this,r,i,o,l,c);this.children.push(u);return this}entity(r,i){var o;o=new c(this,false,r,i);this.children.push(o);return this}pEntity(r,i){var o;o=new c(this,true,r,i);this.children.push(o);return this}notation(r,i){var o;o=new u(this,r,i);this.children.push(o);return this}toString(r){return this.options.writer.docType(this,this.options.writer.filterOptions(r))}ele(r,i){return this.element(r,i)}att(r,i,o,a,l){return this.attList(r,i,o,a,l)}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}up(){return this.root()||this.documentObject}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.name!==this.name){return false}if(r.publicId!==this.publicId){return false}if(r.systemId!==this.systemId){return false}return true}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.EntityDeclaration&&!r.pe){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var r,o,a,l,c;l={};c=this.children;for(o=0,a=c.length;o<a;o++){r=c[o];if(r.type===i.NotationDeclaration){l[r.name]=r}}return new d(l)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLDocType}.call(this)}).call(this)},1582:function(r,i,o){(function(){var i,a,l,c,u,h,d,p;({isPlainObject:p}=o(983));l=o(2692);a=o(5675);u=o(5089);i=o(7762);d=o(645);h=o(7834);r.exports=c=function(){class XMLDocument extends u{constructor(r){super(null);this.name="#document";this.type=i.Document;this.documentURI=null;this.domConfig=new a;r||(r={});if(!r.writer){r.writer=new h}this.options=r;this.stringify=new d(r)}end(r){var i;i={};if(!r){r=this.options.writer}else if(p(r)){i=r;r=this.options.writer}return r.document(this,r.filterOptions(i))}toString(r){return this.options.writer.document(this,this.options.writer.filterOptions(r))}createElement(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createComment(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}importNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementById(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw new Error("This DOM method is not implemented."+this.debugInfo())}renameNode(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createEvent(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw new Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new l});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var r,o,a,l;l=this.children;for(o=0,a=l.length;o<a;o++){r=l[o];if(r.type===i.DocType){return r}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===i.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});return XMLDocument}.call(this)}).call(this)},2871:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S,A,N,_,C={}.hasOwnProperty;({isObject:N,isFunction:A,isPlainObject:_,getValue:S}=o(983));i=o(7762);b=o(1582);E=o(6484);c=o(5261);u=o(360);M=o(8732);T=o(2275);x=o(8947);y=o(6645);w=o(8873);h=o(2529);p=o(9252);d=o(7486);g=o(3353);l=o(1395);O=o(645);D=o(7834);a=o(140);r.exports=v=class XMLDocumentCB{constructor(r,o,a){var l;this.name="?xml";this.type=i.Document;r||(r={});l={};if(!r.writer){r.writer=new D}else if(_(r.writer)){l=r.writer;r.writer=new D}this.options=r;this.writer=r.writer;this.writerOptions=this.writer.filterOptions(l);this.stringify=new O(r);this.onDataCallback=o||function(){};this.onEndCallback=a||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}createChildNode(r){var o,a,l,c,u,h,d,p;switch(r.type){case i.CData:this.cdata(r.value);break;case i.Comment:this.comment(r.value);break;case i.Element:l={};d=r.attribs;for(a in d){if(!C.call(d,a))continue;o=d[a];l[a]=o.value}this.node(r.name,l);break;case i.Dummy:this.dummy();break;case i.Raw:this.raw(r.value);break;case i.Text:this.text(r.value);break;case i.ProcessingInstruction:this.instruction(r.target,r.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+r.constructor.name)}p=r.children;for(u=0,h=p.length;u<h;u++){c=p[u];this.createChildNode(c);if(c.type===i.Element){this.up()}}return this}dummy(){return this}node(r,i,o){if(r==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(r))}this.openCurrent();r=S(r);if(i==null){i={}}i=S(i);if(!N(i)){[o,i]=[i,o]}this.currentNode=new E(this,r,i);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(o!=null){this.text(o)}return this}element(r,o,a){var l,c,u,h,d,p;if(this.currentNode&&this.currentNode.type===i.DocType){this.dtdElement(...arguments)}else{if(Array.isArray(r)||N(r)||A(r)){h=this.options.noValidation;this.options.noValidation=true;p=new b(this.options).element("TEMP_ROOT");p.element(r);this.options.noValidation=h;d=p.children;for(c=0,u=d.length;c<u;c++){l=d[c];this.createChildNode(l);if(l.type===i.Element){this.up()}}}else{this.node(r,o,a)}}return this}attribute(r,i){var o,a;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(r))}if(r!=null){r=S(r)}if(N(r)){for(o in r){if(!C.call(r,o))continue;a=r[o];this.attribute(o,a)}}else{if(A(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.currentNode.attribs[r]=new l(this,r,"")}else if(i!=null){this.currentNode.attribs[r]=new l(this,r,i)}}return this}text(r){var i;this.openCurrent();i=new T(this,r);this.onData(this.writer.text(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}cdata(r){var i;this.openCurrent();i=new c(this,r);this.onData(this.writer.cdata(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}comment(r){var i;this.openCurrent();i=new u(this,r);this.onData(this.writer.comment(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}raw(r){var i;this.openCurrent();i=new M(this,r);this.onData(this.writer.raw(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}instruction(r,i){var o,a,l,c,u;this.openCurrent();if(r!=null){r=S(r)}if(i!=null){i=S(i)}if(Array.isArray(r)){for(o=0,c=r.length;o<c;o++){a=r[o];this.instruction(a)}}else if(N(r)){for(a in r){if(!C.call(r,a))continue;l=r[a];this.instruction(a,l)}}else{if(A(i)){i=i.apply()}u=new x(this,r,i);this.onData(this.writer.processingInstruction(u,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this}declaration(r,i,o){var a;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}a=new y(this,r,i,o);this.onData(this.writer.declaration(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}doctype(r,i,o){this.openCurrent();if(r==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new w(this,i,o);this.currentNode.rootNodeName=r;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this}dtdElement(r,i){var o;this.openCurrent();o=new d(this,r,i);this.onData(this.writer.dtdElement(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}attList(r,i,o,a,l){var c;this.openCurrent();c=new h(this,r,i,o,a,l);this.onData(this.writer.dtdAttList(c,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}entity(r,i){var o;this.openCurrent();o=new p(this,false,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}pEntity(r,i){var o;this.openCurrent();o=new p(this,true,r,i);this.onData(this.writer.dtdEntity(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}notation(r,i){var o;this.openCurrent();o=new g(this,r,i);this.onData(this.writer.dtdNotation(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this}up(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this}end(){while(this.currentLevel>=0){this.up()}return this.onEnd()}openCurrent(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}}openNode(r){var o,l,c,u;if(!r.isOpen){if(!this.root&&this.currentLevel===0&&r.type===i.Element){this.root=r}l="";if(r.type===i.Element){this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<"+r.name;u=r.attribs;for(c in u){if(!C.call(u,c))continue;o=u[c];l+=this.writer.attribute(o,this.writerOptions,this.currentLevel)}l+=(r.children?">":"/>")+this.writer.endline(r,this.writerOptions,this.currentLevel);this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.OpenTag;l=this.writer.indent(r,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+r.rootNodeName;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.children){l+=" [";this.writerOptions.state=a.InsideTag}else{this.writerOptions.state=a.CloseTag;l+=">"}l+=this.writer.endline(r,this.writerOptions,this.currentLevel)}this.onData(l,this.currentLevel);return r.isOpen=true}}closeNode(r){var o;if(!r.isClosed){o="";this.writerOptions.state=a.CloseTag;if(r.type===i.Element){o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"</"+r.name+">"+this.writer.endline(r,this.writerOptions,this.currentLevel)}else{o=this.writer.indent(r,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(r,this.writerOptions,this.currentLevel)}this.writerOptions.state=a.None;this.onData(o,this.currentLevel);return r.isClosed=true}}onData(r,i){this.documentStarted=true;return this.onDataCallback(r,i+1)}onEnd(){this.documentCompleted=true;return this.onEndCallback()}debugInfo(r){if(r==null){return""}else{return"node: <"+r+">"}}ele(){return this.element(...arguments)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}dec(r,i,o){return this.declaration(r,i,o)}dtd(r,i,o){return this.doctype(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}att(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}a(){if(this.currentNode&&this.currentNode.type===i.DocType){return this.attList(...arguments)}else{return this.attribute(...arguments)}}ent(r,i){return this.entity(r,i)}pent(r,i){return this.pEntity(r,i)}not(r,i){return this.notation(r,i)}}}).call(this)},706:function(r,i,o){(function(){var i,a,l;l=o(5089);i=o(7762);r.exports=a=class XMLDummy extends l{constructor(r){super(r);this.type=i.Dummy}clone(){return Object.create(this)}toString(r){return""}}}).call(this)},6484:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g={}.hasOwnProperty;({isObject:p,isFunction:d,getValue:h}=o(983));u=o(5089);i=o(7762);a=o(1395);c=o(2076);r.exports=l=function(){class XMLElement extends u{constructor(r,o,a){var l,c,u,h;super(r);if(o==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(o);this.type=i.Element;this.attribs={};this.schemaTypeInfo=null;if(a!=null){this.attribute(a)}if(r.type===i.Document){this.isRoot=true;this.documentObject=r;r.rootObject=this;if(r.children){h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];if(l.type===i.DocType){l.name=this.name;break}}}}}clone(){var r,i,o,a;o=Object.create(this);if(o.isRoot){o.documentObject=null}o.attribs={};a=this.attribs;for(i in a){if(!g.call(a,i))continue;r=a[i];o.attribs[i]=r.clone()}o.children=[];this.children.forEach((function(r){var i;i=r.clone();i.parent=o;return o.children.push(i)}));return o}attribute(r,i){var o,l;if(r!=null){r=h(r)}if(p(r)){for(o in r){if(!g.call(r,o))continue;l=r[o];this.attribute(o,l)}}else{if(d(i)){i=i.apply()}if(this.options.keepNullAttributes&&i==null){this.attribs[r]=new a(this,r,"")}else if(i!=null){this.attribs[r]=new a(this,r,i)}}return this}removeAttribute(r){var i,o,a;if(r==null){throw new Error("Missing attribute name. "+this.debugInfo())}r=h(r);if(Array.isArray(r)){for(o=0,a=r.length;o<a;o++){i=r[o];delete this.attribs[i]}}else{delete this.attribs[r]}return this}toString(r){return this.options.writer.element(this,this.options.writer.filterOptions(r))}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}getAttribute(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].value}else{return null}}setAttribute(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNode(r){if(this.attribs.hasOwnProperty(r)){return this.attribs[r]}else{return null}}setAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNodeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNodeNS(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasAttribute(r){return this.attribs.hasOwnProperty(r)}hasAttributeNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttribute(r,i){if(this.attribs.hasOwnProperty(r)){return this.attribs[r].isId}else{return i}}setIdAttributeNS(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}setIdAttributeNode(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(!super.isEqualNode(r)){return false}if(r.namespaceURI!==this.namespaceURI){return false}if(r.prefix!==this.prefix){return false}if(r.localName!==this.localName){return false}if(r.attribs.length!==this.attribs.length){return false}for(i=o=0,a=this.attribs.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.attribs[i].isEqualNode(r.attribs[i])){return false}}return true}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new c(this.attribs)}return this.attributeMap}});return XMLElement}.call(this)}).call(this)},2076:function(r){(function(){var i;r.exports=i=function(){class XMLNamedNodeMap{constructor(r){this.nodes=r}clone(){return this.nodes=null}getNamedItem(r){return this.nodes[r]}setNamedItem(r){var i;i=this.nodes[r.nodeName];this.nodes[r.nodeName]=r;return i||null}removeNamedItem(r){var i;i=this.nodes[r];delete this.nodes[r];return i||null}item(r){return this.nodes[Object.keys(this.nodes)[r]]||null}getNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}setNamedItemNS(r){throw new Error("This DOM method is not implemented.")}removeNamedItemNS(r,i){throw new Error("This DOM method is not implemented.")}}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});return XMLNamedNodeMap}.call(this)}).call(this)},5089:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O,T={}.hasOwnProperty,S=[].splice;({isObject:O,isFunction:D,isEmpty:M,getValue:x}=o(983));p=null;l=null;c=null;u=null;h=null;v=null;E=null;b=null;d=null;a=null;w=null;g=null;i=null;r.exports=y=function(){class XMLNode{constructor(r){this.parent=r;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!p){p=o(6484);l=o(5261);c=o(360);u=o(6645);h=o(8873);v=o(8732);E=o(2275);b=o(8947);d=o(706);a=o(7762);w=o(9908);g=o(2076);i=o(144)}}setParent(r){var i,o,a,l,c;this.parent=r;if(r){this.options=r.options;this.stringify=r.stringify}l=this.children;c=[];for(o=0,a=l.length;o<a;o++){i=l[o];c.push(i.setParent(this))}return c}element(r,i,o){var a,l,c,u,h,d,p,g,y;d=null;if(i===null&&o==null){[i,o]=[{},null]}if(i==null){i={}}i=x(i);if(!O(i)){[o,i]=[i,o]}if(r!=null){r=x(r)}if(Array.isArray(r)){for(c=0,p=r.length;c<p;c++){l=r[c];d=this.element(l)}}else if(D(r)){d=this.element(r.apply())}else if(O(r)){for(h in r){if(!T.call(r,h))continue;y=r[h];if(D(y)){y=y.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&h.indexOf(this.stringify.convertAttKey)===0){d=this.attribute(h.substr(this.stringify.convertAttKey.length),y)}else if(!this.options.separateArrayItems&&Array.isArray(y)&&M(y)){d=this.dummy()}else if(O(y)&&M(y)){d=this.element(h)}else if(!this.options.keepNullNodes&&y==null){d=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(y)){for(u=0,g=y.length;u<g;u++){l=y[u];a={};a[h]=l;d=this.element(a)}}else if(O(y)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&h.indexOf(this.stringify.convertTextKey)===0){d=this.element(y)}else{d=this.element(h);d.element(y)}}else{d=this.element(h,y)}}}else if(!this.options.keepNullNodes&&o===null){d=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&r.indexOf(this.stringify.convertTextKey)===0){d=this.text(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&r.indexOf(this.stringify.convertCDataKey)===0){d=this.cdata(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&r.indexOf(this.stringify.convertCommentKey)===0){d=this.comment(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&r.indexOf(this.stringify.convertRawKey)===0){d=this.raw(o)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&r.indexOf(this.stringify.convertPIKey)===0){d=this.instruction(r.substr(this.stringify.convertPIKey.length),o)}else{d=this.node(r,i,o)}}if(d==null){throw new Error("Could not create any elements with: "+r+". "+this.debugInfo())}return d}insertBefore(r,i,o){var a,l,c,u,h;if(r!=null?r.type:void 0){c=r;u=i;c.setParent(this);if(u){l=children.indexOf(u);h=children.splice(l);children.push(c);Array.prototype.push.apply(children,h)}else{children.push(c)}return c}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);h=this.parent.children.splice(l);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,h);return a}}insertAfter(r,i,o){var a,l,c;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(r))}l=this.parent.children.indexOf(this);c=this.parent.children.splice(l+1);a=this.parent.element(r,i,o);Array.prototype.push.apply(this.parent.children,c);return a}remove(){var r,i;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}r=this.parent.children.indexOf(this);S.apply(this.parent.children,[r,r-r+1].concat(i=[])),i;return this.parent}node(r,i,o){var a;if(r!=null){r=x(r)}i||(i={});i=x(i);if(!O(i)){[o,i]=[i,o]}a=new p(this,r,i);if(o!=null){a.text(o)}this.children.push(a);return a}text(r){var i;if(O(r)){this.element(r)}i=new E(this,r);this.children.push(i);return this}cdata(r){var i;i=new l(this,r);this.children.push(i);return this}comment(r){var i;i=new c(this,r);this.children.push(i);return this}commentBefore(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}commentAfter(r){var i,o,a;o=this.parent.children.indexOf(this);a=this.parent.children.splice(o+1);i=this.parent.comment(r);Array.prototype.push.apply(this.parent.children,a);return this}raw(r){var i;i=new v(this,r);this.children.push(i);return this}dummy(){var r;r=new d(this);return r}instruction(r,i){var o,a,l,c,u;if(r!=null){r=x(r)}if(i!=null){i=x(i)}if(Array.isArray(r)){for(c=0,u=r.length;c<u;c++){o=r[c];this.instruction(o)}}else if(O(r)){for(o in r){if(!T.call(r,o))continue;a=r[o];this.instruction(o,a)}}else{if(D(i)){i=i.apply()}l=new b(this,r,i);this.children.push(l)}return this}instructionBefore(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}instructionAfter(r,i){var o,a,l;a=this.parent.children.indexOf(this);l=this.parent.children.splice(a+1);o=this.parent.instruction(r,i);Array.prototype.push.apply(this.parent.children,l);return this}declaration(r,i,o){var l,c;l=this.document();c=new u(l,r,i,o);if(l.children.length===0){l.children.unshift(c)}else if(l.children[0].type===a.Declaration){l.children[0]=c}else{l.children.unshift(c)}return l.root()||l}dtd(r,i){var o,l,c,u,d,p,g,y,w,b;l=this.document();c=new h(l,r,i);w=l.children;for(u=d=0,g=w.length;d<g;u=++d){o=w[u];if(o.type===a.DocType){l.children[u]=c;return c}}b=l.children;for(u=p=0,y=b.length;p<y;u=++p){o=b[u];if(o.isRoot){l.children.splice(u,0,c);return c}}l.children.push(c);return c}up(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent}root(){var r;r=this;while(r){if(r.type===a.Document){return r.rootObject}else if(r.isRoot){return r}else{r=r.parent}}}document(){var r;r=this;while(r){if(r.type===a.Document){return r}else{r=r.parent}}}end(r){return this.document().end(r)}prev(){var r;r=this.parent.children.indexOf(this);if(r<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[r-1]}next(){var r;r=this.parent.children.indexOf(this);if(r===-1||r===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[r+1]}importDocument(r){var i,o,l,c,u;o=r.root().clone();o.parent=this;o.isRoot=false;this.children.push(o);if(this.type===a.Document){o.isRoot=true;o.documentObject=this;this.rootObject=o;if(this.children){u=this.children;for(l=0,c=u.length;l<c;l++){i=u[l];if(i.type===a.DocType){i.name=o.name;break}}}}return this}debugInfo(r){var i,o;r=r||this.name;if(r==null&&!((i=this.parent)!=null?i.name:void 0)){return""}else if(r==null){return"parent: <"+this.parent.name+">"}else if(!((o=this.parent)!=null?o.name:void 0)){return"node: <"+r+">"}else{return"node: <"+r+">, parent: <"+this.parent.name+">"}}ele(r,i,o){return this.element(r,i,o)}nod(r,i,o){return this.node(r,i,o)}txt(r){return this.text(r)}dat(r){return this.cdata(r)}com(r){return this.comment(r)}ins(r,i){return this.instruction(r,i)}doc(){return this.document()}dec(r,i,o){return this.declaration(r,i,o)}e(r,i,o){return this.element(r,i,o)}n(r,i,o){return this.node(r,i,o)}t(r){return this.text(r)}d(r){return this.cdata(r)}c(r){return this.comment(r)}r(r){return this.raw(r)}i(r,i){return this.instruction(r,i)}u(){return this.up()}importXMLBuilder(r){return this.importDocument(r)}attribute(r,i){throw new Error("attribute() applies to element nodes only.")}att(r,i){return this.attribute(r,i)}a(r,i){return this.attribute(r,i)}removeAttribute(r){throw new Error("attribute() applies to element nodes only.")}replaceChild(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}removeChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}appendChild(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw new Error("This DOM method is not implemented."+this.debugInfo())}isSupported(r,i){return true}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(r){var o,a;o=this;if(o===r){return 0}else if(this.document()!==r.document()){a=i.Disconnected|i.ImplementationSpecific;if(Math.random()<.5){a|=i.Preceding}else{a|=i.Following}return a}else if(o.isAncestor(r)){return i.Contains|i.Preceding}else if(o.isDescendant(r)){return i.Contains|i.Following}else if(o.isPreceding(r)){return i.Preceding}else{return i.Following}}isSameNode(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(r){var i,o,a;if(r.nodeType!==this.nodeType){return false}if(r.children.length!==this.children.length){return false}for(i=o=0,a=this.children.length-1;0<=a?o<=a:o>=a;i=0<=a?++o:--o){if(!this.children[i].isEqualNode(r.children[i])){return false}}return true}getFeature(r,i){throw new Error("This DOM method is not implemented."+this.debugInfo())}setUserData(r,i,o){throw new Error("This DOM method is not implemented."+this.debugInfo())}getUserData(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}contains(r){if(!r){return false}return r===this||this.isDescendant(r)}isDescendant(r){var i,o,a,l,c;c=this.children;for(a=0,l=c.length;a<l;a++){i=c[a];if(r===i){return true}o=i.isDescendant(r);if(o){return true}}return false}isAncestor(r){return r.isDescendant(this)}isPreceding(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i<o}}isFollowing(r){var i,o;i=this.treePosition(r);o=this.treePosition(this);if(i===-1||o===-1){return false}else{return i>o}}treePosition(r){var i,o;o=0;i=false;this.foreachTreeNode(this.document(),(function(a){o++;if(!i&&a===r){return i=true}}));if(i){return o}else{return-1}}foreachTreeNode(r,i){var o,a,l,c,u;r||(r=this.document());c=r.children;for(a=0,l=c.length;a<l;a++){o=c[a];if(u=i(o)){return u}else{u=this.foreachTreeNode(o,i);if(u){return u}}}}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new w(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var r;r=this.parent.children.indexOf(this);return this.parent.children[r+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var r,i,o,l,c;if(this.nodeType===a.Element||this.nodeType===a.DocumentFragment){c="";l=this.children;for(i=0,o=l.length;i<o;i++){r=l[i];if(r.textContent){c+=r.textContent}}return c}else{return null}},set:function(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}});return XMLNode}.call(this)}).call(this)},9908:function(r){(function(){var i;r.exports=i=function(){class XMLNodeList{constructor(r){this.nodes=r}clone(){return this.nodes=null}item(r){return this.nodes[r]||null}}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});return XMLNodeList}.call(this)}).call(this)},8947:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=class XMLProcessingInstruction extends a{constructor(r,o,a){super(r);if(o==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=i.ProcessingInstruction;this.target=this.stringify.insTarget(o);this.name=this.target;if(a){this.value=this.stringify.insValue(a)}}clone(){return Object.create(this)}toString(r){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(r))}isEqualNode(r){if(!super.isEqualNode(r)){return false}if(r.target!==this.target){return false}return true}}}).call(this)},8732:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(5089);r.exports=l=class XMLRaw extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=i.Raw;this.value=this.stringify.raw(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.raw(this,this.options.writer.filterOptions(r))}}}).call(this)},5922:function(r,i,o){(function(){var i,a,l,c,u={}.hasOwnProperty;i=o(7762);c=o(6670);a=o(140);r.exports=l=class XMLStreamWriter extends c{constructor(r,i){super(i);this.stream=r}endline(r,i,o){if(r.isLastRootNode&&i.state===a.CloseTag){return""}else{return super.endline(r,i,o)}}document(r,i){var o,a,l,c,u,h,d,p,g;d=r.children;for(a=l=0,u=d.length;l<u;a=++l){o=d[a];o.isLastRootNode=a===r.children.length-1}i=this.filterOptions(i);p=r.children;g=[];for(c=0,h=p.length;c<h;c++){o=p[c];g.push(this.writeChildNode(o,i,0))}return g}cdata(r,i,o){return this.stream.write(super.cdata(r,i,o))}comment(r,i,o){return this.stream.write(super.comment(r,i,o))}declaration(r,i,o){return this.stream.write(super.declaration(r,i,o))}docType(r,i,o){var l,c,u,h;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;this.stream.write(this.indent(r,i,o));this.stream.write("<!DOCTYPE "+r.root().name);if(r.pubID&&r.sysID){this.stream.write(' PUBLIC "'+r.pubID+'" "'+r.sysID+'"')}else if(r.sysID){this.stream.write(' SYSTEM "'+r.sysID+'"')}if(r.children.length>0){this.stream.write(" [");this.stream.write(this.endline(r,i,o));i.state=a.InsideTag;h=r.children;for(c=0,u=h.length;c<u;c++){l=h[c];this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;this.stream.write("]")}i.state=a.CloseTag;this.stream.write(i.spaceBeforeSlash+">");this.stream.write(this.endline(r,i,o));i.state=a.None;return this.closeNode(r,i,o)}element(r,o,l){var c,h,d,p,g,y,w,b,v,E,x,M,D,O,T,S;l||(l=0);this.openNode(r,o,l);o.state=a.OpenTag;x=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){w=x.length;D=r.attribs;for(v in D){if(!u.call(D,v))continue;c=D[v];M=this.attribute(c,o,l);h=M.length;if(w+h>o.width){S=this.indent(r,o,l+1)+M;x+=this.endline(r,o,l)+S;w=S.length}else{S=" "+M;x+=S;w+=S.length}}}else{O=r.attribs;for(v in O){if(!u.call(O,v))continue;c=O[v];x+=this.attribute(c,o,l)}}this.stream.write(x);p=r.children.length;g=p===0?null:r.children[0];if(p===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw||r.type===i.CData)&&r.value===""}))){if(o.allowEmpty){this.stream.write(">");o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{o.state=a.CloseTag;this.stream.write(o.spaceBeforeSlash+"/>")}}else if(o.pretty&&p===1&&(g.type===i.Text||g.type===i.Raw||g.type===i.CData)&&g.value!=null){this.stream.write(">");o.state=a.InsideTag;o.suppressPrettyCount++;E=true;this.writeChildNode(g,o,l+1);o.suppressPrettyCount--;E=false;o.state=a.CloseTag;this.stream.write("</"+r.name+">")}else{this.stream.write(">"+this.endline(r,o,l));o.state=a.InsideTag;T=r.children;for(y=0,b=T.length;y<b;y++){d=T[y];this.writeChildNode(d,o,l+1)}o.state=a.CloseTag;this.stream.write(this.indent(r,o,l)+"</"+r.name+">")}this.stream.write(this.endline(r,o,l));o.state=a.None;return this.closeNode(r,o,l)}processingInstruction(r,i,o){return this.stream.write(super.processingInstruction(r,i,o))}raw(r,i,o){return this.stream.write(super.raw(r,i,o))}text(r,i,o){return this.stream.write(super.text(r,i,o))}dtdAttList(r,i,o){return this.stream.write(super.dtdAttList(r,i,o))}dtdElement(r,i,o){return this.stream.write(super.dtdElement(r,i,o))}dtdEntity(r,i,o){return this.stream.write(super.dtdEntity(r,i,o))}dtdNotation(r,i,o){return this.stream.write(super.dtdNotation(r,i,o))}}}).call(this)},7834:function(r,i,o){(function(){var i,a;a=o(6670);r.exports=i=class XMLStringWriter extends a{constructor(r){super(r)}document(r,i){var o,a,l,c,u;i=this.filterOptions(i);c="";u=r.children;for(a=0,l=u.length;a<l;a++){o=u[a];c+=this.writeChildNode(o,i,0)}if(i.pretty&&c.slice(-i.newline.length)===i.newline){c=c.slice(0,-i.newline.length)}return c}}}).call(this)},645:function(r){(function(){var i,o={}.hasOwnProperty;r.exports=i=function(){class XMLStringifier{constructor(r){var i,a,l;this.assertLegalChar=this.assertLegalChar.bind(this);this.assertLegalName=this.assertLegalName.bind(this);r||(r={});this.options=r;if(!this.options.version){this.options.version="1.0"}a=r.stringify||{};for(i in a){if(!o.call(a,i))continue;l=a[i];this[i]=l}}name(r){if(this.options.noValidation){return r}return this.assertLegalName(""+r||"")}text(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.textEscape(""+r||""))}cdata(r){if(this.options.noValidation){return r}r=""+r||"";r=r.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(r)}comment(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+r)}return this.assertLegalChar(r)}raw(r){if(this.options.noValidation){return r}return""+r||""}attValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(this.attEscape(r=""+r||""))}insTarget(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}insValue(r){if(this.options.noValidation){return r}r=""+r||"";if(r.match(/\?>/)){throw new Error("Invalid processing instruction value: "+r)}return this.assertLegalChar(r)}xmlVersion(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+r)}return r}xmlEncoding(r){if(this.options.noValidation){return r}r=""+r||"";if(!r.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+r)}return this.assertLegalChar(r)}xmlStandalone(r){if(this.options.noValidation){return r}if(r){return"yes"}else{return"no"}}dtdPubID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdSysID(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdElementValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttType(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdAttDefault(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdEntityValue(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}dtdNData(r){if(this.options.noValidation){return r}return this.assertLegalChar(""+r||"")}assertLegalChar(r){var i,o;if(this.options.noValidation){return r}if(this.options.version==="1.0"){i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;if(this.options.invalidCharReplacement!==void 0){r=r.replace(i,this.options.invalidCharReplacement)}else if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}else if(this.options.version==="1.1"){i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;if(this.options.invalidCharReplacement!==void 0){r=r.replace(i,this.options.invalidCharReplacement)}else if(o=r.match(i)){throw new Error(`Invalid character in string: ${r} at index ${o.index}`)}}return r}assertLegalName(r){var i;if(this.options.noValidation){return r}r=this.assertLegalChar(r);i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!r.match(i)){throw new Error(`Invalid character in name: ${r}`)}return r}textEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")}attEscape(r){var i;if(this.options.noValidation){return r}i=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g;return r.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")}}XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";return XMLStringifier}.call(this)}).call(this)},2275:function(r,i,o){(function(){var i,a,l;i=o(7762);a=o(4765);r.exports=l=function(){class XMLText extends a{constructor(r,o){super(r);if(o==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=i.Text;this.value=this.stringify.text(o)}clone(){return Object.create(this)}toString(r){return this.options.writer.text(this,this.options.writer.filterOptions(r))}splitText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(r){throw new Error("This DOM method is not implemented."+this.debugInfo())}}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var r,i,o;o="";i=this.previousSibling;while(i){o=i.data+o;i=i.previousSibling}o+=this.data;r=this.nextSibling;while(r){o=o+r.data;r=r.nextSibling}return o}});return XMLText}.call(this)}).call(this)},6670:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g,y,w,b,v,E,x,M,D,O={}.hasOwnProperty;({assign:D}=o(983));i=o(7762);g=o(6645);y=o(8873);l=o(5261);c=o(360);b=o(6484);E=o(8732);x=o(2275);v=o(8947);w=o(706);u=o(2529);h=o(7486);d=o(9252);p=o(3353);a=o(140);r.exports=M=class XMLWriterBase{constructor(r){var i,o,a;r||(r={});this.options=r;o=r.writer||{};for(i in o){if(!O.call(o,i))continue;a=o[i];this["_"+i]=this[i];this[i]=a}}filterOptions(r){var i,o,l,c,u,h,d,p,g;r||(r={});r=D({},this.options,r);i={writer:this};i.pretty=r.pretty||false;i.allowEmpty=r.allowEmpty||false;i.indent=(o=r.indent)!=null?o:" ";i.newline=(l=r.newline)!=null?l:"\n";i.offset=(c=r.offset)!=null?c:0;i.width=(u=r.width)!=null?u:0;i.dontPrettyTextNodes=(h=(d=r.dontPrettyTextNodes)!=null?d:r.dontprettytextnodes)!=null?h:0;i.spaceBeforeSlash=(p=(g=r.spaceBeforeSlash)!=null?g:r.spacebeforeslash)!=null?p:"";if(i.spaceBeforeSlash===true){i.spaceBeforeSlash=" "}i.suppressPrettyCount=0;i.user={};i.state=a.None;return i}indent(r,i,o){var a;if(!i.pretty||i.suppressPrettyCount){return""}else if(i.pretty){a=(o||0)+i.offset+1;if(a>0){return new Array(a).join(i.indent)}}return""}endline(r,i,o){if(!i.pretty||i.suppressPrettyCount){return""}else{return i.newline}}attribute(r,i,o){var a;this.openAttribute(r,i,o);if(i.pretty&&i.width>0){a=r.name+'="'+r.value+'"'}else{a=" "+r.name+'="'+r.value+'"'}this.closeAttribute(r,i,o);return a}cdata(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<![CDATA[";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+="]]>"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}comment(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"\x3c!-- ";i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=" --\x3e"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}declaration(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?xml";i.state=a.InsideTag;l+=' version="'+r.version+'"';if(r.encoding!=null){l+=' encoding="'+r.encoding+'"'}if(r.standalone!=null){l+=' standalone="'+r.standalone+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}docType(r,i,o){var l,c,u,h,d;o||(o=0);this.openNode(r,i,o);i.state=a.OpenTag;h=this.indent(r,i,o);h+="<!DOCTYPE "+r.root().name;if(r.pubID&&r.sysID){h+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){h+=' SYSTEM "'+r.sysID+'"'}if(r.children.length>0){h+=" [";h+=this.endline(r,i,o);i.state=a.InsideTag;d=r.children;for(c=0,u=d.length;c<u;c++){l=d[c];h+=this.writeChildNode(l,i,o+1)}i.state=a.CloseTag;h+="]"}i.state=a.CloseTag;h+=i.spaceBeforeSlash+">";h+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return h}element(r,o,l){var c,u,h,d,p,g,y,w,b,v,E,x,M,D,T,S,A,N,_;l||(l=0);x=false;this.openNode(r,o,l);o.state=a.OpenTag;M=this.indent(r,o,l)+"<"+r.name;if(o.pretty&&o.width>0){w=M.length;T=r.attribs;for(E in T){if(!O.call(T,E))continue;c=T[E];D=this.attribute(c,o,l);u=D.length;if(w+u>o.width){_=this.indent(r,o,l+1)+D;M+=this.endline(r,o,l)+_;w=_.length}else{_=" "+D;M+=_;w+=_.length}}}else{S=r.attribs;for(E in S){if(!O.call(S,E))continue;c=S[E];M+=this.attribute(c,o,l)}}d=r.children.length;p=d===0?null:r.children[0];if(d===0||r.children.every((function(r){return(r.type===i.Text||r.type===i.Raw||r.type===i.CData)&&r.value===""}))){if(o.allowEmpty){M+=">";o.state=a.CloseTag;M+="</"+r.name+">"+this.endline(r,o,l)}else{o.state=a.CloseTag;M+=o.spaceBeforeSlash+"/>"+this.endline(r,o,l)}}else if(o.pretty&&d===1&&(p.type===i.Text||p.type===i.Raw||p.type===i.CData)&&p.value!=null){M+=">";o.state=a.InsideTag;o.suppressPrettyCount++;x=true;M+=this.writeChildNode(p,o,l+1);o.suppressPrettyCount--;x=false;o.state=a.CloseTag;M+="</"+r.name+">"+this.endline(r,o,l)}else{if(o.dontPrettyTextNodes){A=r.children;for(g=0,b=A.length;g<b;g++){h=A[g];if((h.type===i.Text||h.type===i.Raw||h.type===i.CData)&&h.value!=null){o.suppressPrettyCount++;x=true;break}}}M+=">"+this.endline(r,o,l);o.state=a.InsideTag;N=r.children;for(y=0,v=N.length;y<v;y++){h=N[y];M+=this.writeChildNode(h,o,l+1)}o.state=a.CloseTag;M+=this.indent(r,o,l)+"</"+r.name+">";if(x){o.suppressPrettyCount--}M+=this.endline(r,o,l);o.state=a.None}this.closeNode(r,o,l);return M}writeChildNode(r,o,a){switch(r.type){case i.CData:return this.cdata(r,o,a);case i.Comment:return this.comment(r,o,a);case i.Element:return this.element(r,o,a);case i.Raw:return this.raw(r,o,a);case i.Text:return this.text(r,o,a);case i.ProcessingInstruction:return this.processingInstruction(r,o,a);case i.Dummy:return"";case i.Declaration:return this.declaration(r,o,a);case i.DocType:return this.docType(r,o,a);case i.AttributeDeclaration:return this.dtdAttList(r,o,a);case i.ElementDeclaration:return this.dtdElement(r,o,a);case i.EntityDeclaration:return this.dtdEntity(r,o,a);case i.NotationDeclaration:return this.dtdNotation(r,o,a);default:throw new Error("Unknown XML node type: "+r.constructor.name)}}processingInstruction(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<?";i.state=a.InsideTag;l+=r.target;if(r.value){l+=" "+r.value}i.state=a.CloseTag;l+=i.spaceBeforeSlash+"?>";l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}raw(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}text(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o);i.state=a.InsideTag;l+=r.value;i.state=a.CloseTag;l+=this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdAttList(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ATTLIST";i.state=a.InsideTag;l+=" "+r.elementName+" "+r.attributeName+" "+r.attributeType;if(r.defaultValueType!=="#DEFAULT"){l+=" "+r.defaultValueType}if(r.defaultValue){l+=' "'+r.defaultValue+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdElement(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ELEMENT";i.state=a.InsideTag;l+=" "+r.name+" "+r.value;i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdEntity(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!ENTITY";i.state=a.InsideTag;if(r.pe){l+=" %"}l+=" "+r.name;if(r.value){l+=' "'+r.value+'"'}else{if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}if(r.nData){l+=" NDATA "+r.nData}}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}dtdNotation(r,i,o){var l;this.openNode(r,i,o);i.state=a.OpenTag;l=this.indent(r,i,o)+"<!NOTATION";i.state=a.InsideTag;l+=" "+r.name;if(r.pubID&&r.sysID){l+=' PUBLIC "'+r.pubID+'" "'+r.sysID+'"'}else if(r.pubID){l+=' PUBLIC "'+r.pubID+'"'}else if(r.sysID){l+=' SYSTEM "'+r.sysID+'"'}i.state=a.CloseTag;l+=i.spaceBeforeSlash+">"+this.endline(r,i,o);i.state=a.None;this.closeNode(r,i,o);return l}openNode(r,i,o){}closeNode(r,i,o){}openAttribute(r,i,o){}closeAttribute(r,i,o){}}}).call(this)},5769:function(r,i,o){(function(){var i,a,l,c,u,h,d,p,g;({assign:p,isFunction:g}=o(983));l=o(2692);c=o(1582);u=o(2871);d=o(7834);h=o(5922);i=o(7762);a=o(140);r.exports.create=function(r,i,o,a){var l,u;if(r==null){throw new Error("Root element needs a name.")}a=p({},i,o,a);l=new c(a);u=l.element(r);if(!a.headless){l.declaration(a);if(a.pubID!=null||a.sysID!=null){l.dtd(a)}}return u};r.exports.begin=function(r,i,o){if(g(r)){[i,o]=[r,i];r={}}if(i){return new u(r,i,o)}else{return new c(r)}};r.exports.stringWriter=function(r){return new d(r)};r.exports.streamWriter=function(r,i){return new h(r,i)};r.exports.implementation=new l;r.exports.nodeType=i;r.exports.writerState=a}).call(this)},4513:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addMetaDataItemToMainApplication=addMetaDataItemToMainApplication;i.addUsesLibraryItemToMainApplication=addUsesLibraryItemToMainApplication;i.ensureToolsAvailable=ensureToolsAvailable;i.findMetaDataItem=findMetaDataItem;i.findUsesLibraryItem=findUsesLibraryItem;i.getMainActivity=getMainActivity;i.getMainActivityOrThrow=getMainActivityOrThrow;i.getMainApplication=getMainApplication;i.getMainApplicationMetaDataValue=getMainApplicationMetaDataValue;i.getMainApplicationOrThrow=getMainApplicationOrThrow;i.getRunnableActivity=getRunnableActivity;i.prefixAndroidKeys=prefixAndroidKeys;i.readAndroidManifestAsync=readAndroidManifestAsync;i.removeMetaDataItemFromMainApplication=removeMetaDataItemFromMainApplication;i.removeUsesLibraryItemFromMainApplication=removeUsesLibraryItemFromMainApplication;i.writeAndroidManifestAsync=writeAndroidManifestAsync;function _assert(){const r=_interopRequireDefault(o(9491));_assert=function(){return r};return r}function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function XML(){const r=_interopRequireWildcard(o(8853));XML=function(){return r};return r}function _getRequireWildcardCache(r){if("function"!=typeof WeakMap)return null;var i=new WeakMap,o=new WeakMap;return(_getRequireWildcardCache=function(r){return r?o:i})(r)}function _interopRequireWildcard(r,i){if(!i&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var o=_getRequireWildcardCache(i);if(o&&o.has(r))return o.get(r);var a={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in r)if("default"!==c&&{}.hasOwnProperty.call(r,c)){var u=l?Object.getOwnPropertyDescriptor(r,c):null;u&&(u.get||u.set)?Object.defineProperty(a,c,u):a[c]=r[c]}return a.default=r,o&&o.set(r,a),a}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeAndroidManifestAsync(r,i){const o=XML().format(i);await _fs().default.promises.mkdir(_path().default.dirname(r),{recursive:true});await _fs().default.promises.writeFile(r,o)}async function readAndroidManifestAsync(r){const i=await XML().readXMLAsync({path:r});if(!isManifest(i)){throw new Error("Invalid manifest found at: "+r)}return i}function isManifest(r){return!!r.manifest}function getMainApplication(r){return r?.manifest?.application?.filter((r=>r?.$?.["android:name"].endsWith(".MainApplication")))[0]??null}function getMainApplicationOrThrow(r){const i=getMainApplication(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainApplication element");return i}function getMainActivityOrThrow(r){const i=getMainActivity(r);(0,_assert().default)(i,"AndroidManifest.xml is missing the required MainActivity element");return i}function getRunnableActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:enabled"]!=="false"&&r.$["android:enabled"]!==false));if(!i){return null}for(const r of i){if(Array.isArray(r["intent-filter"])){for(const i of r["intent-filter"]){if(i.action?.find((r=>r.$["android:name"]==="android.intent.action.MAIN"))&&i.category?.find((r=>r.$["android:name"]==="android.intent.category.LAUNCHER"))){return r}}}}return null}function getMainActivity(r){const i=r?.manifest?.application?.[0]?.activity?.filter?.((r=>r.$["android:name"]===".MainActivity"));return i?.[0]??null}function addMetaDataItemToMainApplication(r,i,o,a="value"){let l;const c={$:prefixAndroidKeys({name:i,[a]:o})};if(r["meta-data"]){l=r["meta-data"].filter((r=>r.$["android:name"]===i));if(l.length){l[0].$[`android:${a}`]=o}else{r["meta-data"].push(c)}}else{r["meta-data"]=[c]}return r}function removeMetaDataItemFromMainApplication(r,i){const o=findMetaDataItem(r,i);if(r?.["meta-data"]&&o>-1){r["meta-data"].splice(o,1)}return r}function findApplicationSubItem(r,i,o){const a=r[i];if(Array.isArray(a)){const r=a.findIndex((r=>r.$["android:name"]===o));return r}return-1}function findMetaDataItem(r,i){return findApplicationSubItem(r,"meta-data",i)}function findUsesLibraryItem(r,i){return findApplicationSubItem(r,"uses-library",i)}function getMainApplicationMetaDataValue(r,i){const o=getMainApplication(r);if(o?.hasOwnProperty("meta-data")){const r=o?.["meta-data"]?.find((r=>r.$["android:name"]===i));return r?.$["android:value"]??null}return null}function addUsesLibraryItemToMainApplication(r,i){let o;const a={$:prefixAndroidKeys(i)};if(r["uses-library"]){o=r["uses-library"].filter((r=>r.$["android:name"]===i.name));if(o.length){o[0].$=a.$}else{r["uses-library"].push(a)}}else{r["uses-library"]=[a]}return r}function removeUsesLibraryItemFromMainApplication(r,i){const o=findUsesLibraryItem(r,i);if(r?.["uses-library"]&&o>-1){r["uses-library"].splice(o,1)}return r}function prefixAndroidKeys(r){return Object.entries(r).reduce(((r,[i,o])=>({...r,[`android:${i}`]:o})),{})}function ensureToolsAvailable(r){return ensureManifestHasNamespace(r,{namespace:"xmlns:tools",url:"http://schemas.android.com/tools"})}function ensureManifestHasNamespace(r,{namespace:i,url:o}){if(r?.manifest?.$?.[i]){return r}r.manifest.$[i]=o;return r}},365:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.ensureManifestHasValidIntentFilter=ensureManifestHasValidIntentFilter;i.getScheme=getScheme;i.getSchemesFromManifest=getSchemesFromManifest;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _androidPlugins(){const r=o(2636);_androidPlugins=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}const a=i.withScheme=(0,_androidPlugins().createAndroidManifestPlugin)(setScheme,"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.android??{})];if(r.android?.package){o.push(r.android.package)}if(o.length===0){return i}if(!ensureManifestHasValidIntentFilter(i)){(0,_warnings().addWarningAndroid)("scheme",`Cannot add schemes because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\``,"https://expo.fyi/setup-android-uri-scheme");return i}const a=getSchemesFromManifest(i);for(const r of a){const i=o.indexOf(r);if(i>-1)o.splice(i,1)}for(const r of o){i=appendScheme(r,i)}return i}function isValidRedirectIntentFilter({actions:r,categories:i}){return r.includes("android.intent.action.VIEW")&&!i.includes("android.intent.category.LAUNCHER")}function propertiesFromIntentFilter(r){const i=r?.action?.map((r=>r?.$?.["android:name"]))??[];const o=r?.category?.map((r=>r?.$?.["android:name"]))??[];const a=r?.data?.filter((r=>r?.$?.["android:scheme"]))?.map((r=>({scheme:r?.$?.["android:scheme"],host:r?.$?.["android:host"]})))??[];return{actions:i,categories:o,data:a}}function getSingleTaskIntentFilters(r){if(!Array.isArray(r.manifest.application))return[];let i=[];for(const o of r.manifest.application){const{activity:r}=o;const a=Array.isArray(r)?r:[r];const l=a.filter((r=>r?.$?.["android:launchMode"]==="singleTask"));for(const r of l){const o=r["intent-filter"];i=i.concat(o)}}return i}function getSchemesFromManifest(r,i=null){const o=[];const a=getSingleTaskIntentFilters(r);for(const r of a){const a=propertiesFromIntentFilter(r);if(isValidRedirectIntentFilter(a)&&a.data){for(const{scheme:r,host:l}of a.data){if(i===null||!l||l===i){o.push(r)}}}}return o}function ensureManifestHasValidIntentFilter(r){if(!Array.isArray(r.manifest.application)){return false}for(const i of r.manifest.application){for(const r of i.activity||[]){if(r?.$?.["android:launchMode"]==="singleTask"){for(const i of r["intent-filter"]||[]){const r=propertiesFromIntentFilter(i);if(isValidRedirectIntentFilter(r)){return true}}if(!r["intent-filter"]){r["intent-filter"]=[]}r["intent-filter"].push({action:[{$:{"android:name":"android.intent.action.VIEW"}}],category:[{$:{"android:name":"android.intent.category.DEFAULT"}},{$:{"android:name":"android.intent.category.BROWSABLE"}}]});return true}}}return false}function hasScheme(r,i){const o=getSchemesFromManifest(i);return o.includes(r)}function appendScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){if(!o.data)o.data=[];o.data.push({$:{"android:scheme":r}})}}break}}}return i}function removeScheme(r,i){if(!Array.isArray(i.manifest.application)){return i}for(const o of i.manifest.application){for(const i of o.activity||[]){if(i?.$?.["android:launchMode"]==="singleTask"){for(const o of i["intent-filter"]||[]){const i=propertiesFromIntentFilter(o);if(isValidRedirectIntentFilter(i)){for(const i in o?.data||[]){const a=o.data?.[i];if(a?.$?.["android:scheme"]===r){delete o.data?.[i]}}}}break}}}return i}},7903:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.appendScheme=appendScheme;i.getScheme=getScheme;i.getSchemesFromPlist=getSchemesFromPlist;i.hasScheme=hasScheme;i.removeScheme=removeScheme;i.setScheme=setScheme;i.withScheme=void 0;function _iosPlugins(){const r=o(4797);_iosPlugins=function(){return r};return r}const a=i.withScheme=(0,_iosPlugins().createInfoPlistPluginWithPropertyGuard)(setScheme,{infoPlistProperty:"CFBundleURLTypes",expoConfigProperty:"scheme"},"withScheme");function getScheme(r){if(Array.isArray(r.scheme)){const validate=r=>typeof r==="string";return r.scheme.filter(validate)}else if(typeof r.scheme==="string"){return[r.scheme]}return[]}function setScheme(r,i){const o=[...getScheme(r),...getScheme(r.ios??{})];if(r.ios?.bundleIdentifier){o.push(r.ios.bundleIdentifier)}if(o.length===0){return i}return{...i,CFBundleURLTypes:[{CFBundleURLSchemes:o}]}}function appendScheme(r,i){if(!r){return i}const o=i.CFBundleURLTypes??[];if(o?.some((({CFBundleURLSchemes:i})=>i.includes(r)))){return i}return{...i,CFBundleURLTypes:[...o,{CFBundleURLSchemes:[r]}]}}function removeScheme(r,i){if(!r){return i}if(!i.CFBundleURLTypes){return i}i.CFBundleURLTypes=i.CFBundleURLTypes.map((i=>{const o=i.CFBundleURLSchemes.indexOf(r);if(o>-1){i.CFBundleURLSchemes.splice(o,1);if(i.CFBundleURLSchemes.length===0){return undefined}}return i})).filter(Boolean);return i}function hasScheme(r,i){const o=i.CFBundleURLTypes;if(!Array.isArray(o))return false;return o?.some((({CFBundleURLSchemes:i})=>Array.isArray(i)?i.includes(r):false))}function getSchemesFromPlist(r){if(Array.isArray(r.CFBundleURLTypes)){return r.CFBundleURLTypes.reduce(((r,{CFBundleURLSchemes:i})=>{if(Array.isArray(i)){return[...r,...i]}return r}),[])}return[]}},2636:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createAndroidManifestPlugin=createAndroidManifestPlugin;i.createStringsXmlPlugin=createStringsXmlPlugin;i.withStringsXml=i.withSettingsGradle=i.withProjectBuildGradle=i.withMainApplication=i.withMainActivity=i.withGradleProperties=i.withAppBuildGradle=i.withAndroidStyles=i.withAndroidManifest=i.withAndroidColorsNight=i.withAndroidColors=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function createAndroidManifestPlugin(r,i){const withUnknown=i=>withAndroidManifest(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createStringsXmlPlugin(r,i){const withUnknown=i=>withStringsXml(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAndroidManifest=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"manifest",action:i});i.withAndroidManifest=withAndroidManifest;const withStringsXml=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"strings",action:i});i.withStringsXml=withStringsXml;const withAndroidColors=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colors",action:i});i.withAndroidColors=withAndroidColors;const withAndroidColorsNight=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"colorsNight",action:i});i.withAndroidColorsNight=withAndroidColorsNight;const withAndroidStyles=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"styles",action:i});i.withAndroidStyles=withAndroidStyles;const withMainActivity=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainActivity",action:i});i.withMainActivity=withMainActivity;const withMainApplication=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"mainApplication",action:i});i.withMainApplication=withMainApplication;const withProjectBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"projectBuildGradle",action:i});i.withProjectBuildGradle=withProjectBuildGradle;const withAppBuildGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"appBuildGradle",action:i});i.withAppBuildGradle=withAppBuildGradle;const withSettingsGradle=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"settingsGradle",action:i});i.withSettingsGradle=withSettingsGradle;const withGradleProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"android",mod:"gradleProperties",action:i});i.withGradleProperties=withGradleProperties},4797:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.createEntitlementsPlugin=createEntitlementsPlugin;i.createInfoPlistPlugin=createInfoPlistPlugin;i.createInfoPlistPluginWithPropertyGuard=createInfoPlistPluginWithPropertyGuard;i.withXcodeProject=i.withPodfileProperties=i.withPodfile=i.withInfoPlist=i.withExpoPlist=i.withEntitlementsPlist=i.withAppDelegate=void 0;function _withMod(){const r=o(2932);_withMod=function(){return r};return r}function _obj(){const r=o(7324);_obj=function(){return r};return r}function _warnings(){const r=o(128);_warnings=function(){return r};return r}function createInfoPlistPlugin(r,i){const withUnknown=i=>withInfoPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}function createInfoPlistPluginWithPropertyGuard(r,i,o){const withUnknown=o=>withInfoPlist(o,(async o=>{const a=i.expoPropertyGetter?i.expoPropertyGetter(o):(0,_obj().get)(o,i.expoConfigProperty);if(o.modRawConfig.ios?.infoPlist?.[i.infoPlistProperty]===undefined){o.modResults=await r(o,o.modResults)}else if(a!==undefined){(0,_warnings().addWarningIOS)(i.expoConfigProperty,`"ios.infoPlist.${i.infoPlistProperty}" is set in the config. Ignoring abstract property "${i.expoConfigProperty}": ${a}`)}return o}));if(o){Object.defineProperty(withUnknown,"name",{value:o})}return withUnknown}function createEntitlementsPlugin(r,i){const withUnknown=i=>withEntitlementsPlist(i,(async i=>{i.modResults=await r(i,i.modResults);return i}));if(i){Object.defineProperty(withUnknown,"name",{value:i})}return withUnknown}const withAppDelegate=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"appDelegate",action:i});i.withAppDelegate=withAppDelegate;const withInfoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"infoPlist",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.infoPlist=r.modResults;return r}});i.withInfoPlist=withInfoPlist;const withEntitlementsPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"entitlements",async action(r){r=await i(r);if(!r.ios){r.ios={}}r.ios.entitlements=r.modResults;return r}});i.withEntitlementsPlist=withEntitlementsPlist;const withExpoPlist=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"expoPlist",action:i});i.withExpoPlist=withExpoPlist;const withXcodeProject=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"xcodeproj",action:i});i.withXcodeProject=withXcodeProject;const withPodfile=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"podfile",action:i});i.withPodfile=withPodfile;const withPodfileProperties=(r,i)=>(0,_withMod().withMod)(r,{platform:"ios",mod:"podfileProperties",action:i});i.withPodfileProperties=withPodfileProperties},2932:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.withBaseMod=withBaseMod;i.withMod=withMod;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _getenv(){const r=o(7945);_getenv=function(){return r};return r}function _errors(){const r=o(3857);_errors=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}const a=(0,_getenv().boolish)("EXPO_DEBUG",false);function withBaseMod(r,{platform:i,mod:o,action:l,skipEmptyMod:c,isProvider:u,isIntrospective:h,saveToInternal:d}){if(!r.mods){r.mods={}}if(!r.mods[i]){r.mods[i]={}}let p=r.mods[i][o];if(!p){if(c){return r}const noopMod=r=>r;p=noopMod}let g="";const y=r._internal?.isDebug??a;if(y){const r=(new Error).stack;g=getDebugPluginStackFromStackTrace(r);const a=_chalk().default.bold(`${i}.${o}`);g=`${a}: ${g}`}if(p.isProvider){if(u){throw new(_errors().PluginError)(`Cannot set provider mod for "${i}.${o}" because another is already being used.`,"CONFLICTING_PROVIDER")}else{throw new(_errors().PluginError)(`Cannot add mod to "${i}.${o}" because the provider has already been added. Provider must be the last mod added.`,"INVALID_MOD_ORDER")}}async function interceptingMod({modRequest:r,...a}){if(y){console.log(g)}const c=await l({...a,modRequest:{...r,nextMod:p}});if(d){saveToInternalObject(c,i,o,c.modResults)}return c}interceptingMod.isProvider=u;if(h){interceptingMod.isIntrospective=h}r.mods[i][o]=interceptingMod;return r}function saveToInternalObject(r,i,o,a){if(!r._internal)r._internal={};if(!r._internal.modResults)r._internal.modResults={};if(!r._internal.modResults[i])r._internal.modResults[i]={};r._internal.modResults[i][o]=a}function getDebugPluginStackFromStackTrace(r){if(!r){return""}const i=[];for(const o of r.split("\n")){const[r,a]=o.trim().split(" ");if(r==="at"){i.push(a)}}const o=i.map((r=>r?.match(/^(\bwith[A-Z].*?\b)/)?.[1]?.trim()??r?.match(/\.(\bwith[A-Z].*?\b)/)?.[1]?.trim()??null)).filter(Boolean).filter((r=>!["withMod","withBaseMod","withExtendedMod"].includes(r)));const a=["withPlugins","withRunOnce","withStaticPlugin"];return o.reverse().map(((r,i)=>{if(r.includes("BaseMod")){r=_chalk().default.bold(r)}if(r.toLowerCase().includes("dangerous")){r=_chalk().default.red(r)}if(i===0){return _chalk().default.blue(r)}else if(a.includes(r)){return _chalk().default.dim(r)}return r})).join(" ➜ ")}function withMod(r,{platform:i,mod:o,action:a}){return withBaseMod(r,{platform:i,mod:o,isProvider:false,async action({modRequest:{nextMod:r,...i},modResults:o,...l}){const c=await a({modRequest:i,modResults:o,...l});return r(c)}})}},8853:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i._processAndroidXML=_processAndroidXML;i.escapeAndroidString=escapeAndroidString;i.format=format;i.parseXMLAsync=parseXMLAsync;i.readXMLAsync=readXMLAsync;i.unescapeAndroidString=unescapeAndroidString;i.writeXMLAsync=writeXMLAsync;function _fs(){const r=_interopRequireDefault(o(7147));_fs=function(){return r};return r}function _os(){const r=o(2037);_os=function(){return r};return r}function _path(){const r=_interopRequireDefault(o(1017));_path=function(){return r};return r}function _xml2js(){const r=o(7013);_xml2js=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}async function writeXMLAsync(r){const i=format(r.xml);await _fs().default.promises.mkdir(_path().default.dirname(r.path),{recursive:true});await _fs().default.promises.writeFile(r.path,i)}async function readXMLAsync(r){let i="";try{i=await _fs().default.promises.readFile(r.path,{encoding:"utf8",flag:"r"})}catch{}const o=new(_xml2js().Parser);const a=await o.parseStringPromise(i||r.fallback||"");return _processAndroidXML(a)}function _processAndroidXML(r){if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}if(!("_"in i)){throw new Error(`Empty string resource not supported: ${JSON.stringify(i)}`)}i._=unescapeAndroidString(i._)}}return r}async function parseXMLAsync(r){const i=await(new(_xml2js().Parser)).parseStringPromise(r);return i}const stringTimesN=(r,i)=>Array(r+1).join(i);function format(r,{indentLevel:i=2,newline:o=_os().EOL}={}){let a;if(typeof r==="string"){a=r}else if(r.toString){const i=new(_xml2js().Builder)({headless:true});if(Array.isArray(r?.resources?.string)){for(const i of r?.resources?.string){if(i.$.translatable==="false"||i.$.translatable===false){continue}i._=escapeAndroidString(i._)}}a=i.buildObject(r);return a}else{throw new Error(`Invalid XML value passed in: ${r}`)}const l=stringTimesN(i," ");let c="";const u=/(>)(<)(\/*)/g;const h=a.replace(u,`$1${o}$2$3`);let d=0;h.split(/\r?\n/).map((r=>r.trim())).forEach((r=>{let i=0;if(r.match(/.+<\/\w[^>]*>$/)){i=0}else if(r.match(/^<\/\w/)){if(d!==0){d-=1}}else if(r.match(/^<\w([^>]*[^/])?>.*$/)){i=1}else{i=0}const a=stringTimesN(d,l);c+=a+r+o;d+=i}));return c.trim()}function escapeAndroidString(r){r=r.replace(/[\n\r\t'"@]/g,(r=>{switch(r){case'"':case"'":case"@":return"\\"+r;case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:throw new Error(`Cannot escape unhandled XML character: ${r}`)}}));if(r.match(/(^\s|\s$)/)){r='"'+r+'"'}return r}function unescapeAndroidString(r){return r.replace(/\\(.)/g,"$1")}},3857:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.UnexpectedError=i.PluginError=void 0;class UnexpectedError extends Error{name="UnexpectedError";constructor(r){super(`${r}\nPlease report this as an issue on https://github.com/expo/expo/issues`)}}i.UnexpectedError=UnexpectedError;class PluginError extends Error{name="PluginError";isPluginError=true;constructor(r,i,o){super(o?`${r}\n└─ Cause: ${o.name}: ${o.message}`:r);this.code=i;this.cause=o}}i.PluginError=PluginError},7324:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.get=get;function get(r,i){const o=i.split(".");let a=r;let l;while(l=o.shift()){if(!(l in a)){return undefined}a=a[l]}return a}},128:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.addWarningAndroid=addWarningAndroid;i.addWarningForPlatform=addWarningForPlatform;i.addWarningIOS=addWarningIOS;function _chalk(){const r=_interopRequireDefault(o(8746));_chalk=function(){return r};return r}function _interopRequireDefault(r){return r&&r.__esModule?r:{default:r}}function addWarningAndroid(r,i,o){console.warn(formatWarning("android",r,i,o))}function addWarningIOS(r,i,o){console.warn(formatWarning("ios",r,i,o))}function addWarningForPlatform(r,i,o,a){console.warn(formatWarning(r,i,o,a))}function formatWarning(r,i,o,a){return _chalk().default.yellow`${"» "+_chalk().default.bold(r)}: ${i}: ${o}${a?_chalk().default.gray(" "+a):""}`}},2395:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.build=build;const l=a(o(2991));const c=a(o(5769));function ISODateString(r){function pad(r){return r<10?"0"+r:r}return r.getUTCFullYear()+"-"+pad(r.getUTCMonth()+1)+"-"+pad(r.getUTCDate())+"T"+pad(r.getUTCHours())+":"+pad(r.getUTCMinutes())+":"+pad(r.getUTCSeconds())+"Z"}const u=Object.prototype.toString;function type(r){const i=u.call(r).match(/\[object (.*)\]/);return i?i[1]:i}function build(r,i){const o={version:"1.0",encoding:"UTF-8"};const a={pubid:"-//Apple//DTD PLIST 1.0//EN",sysid:"http://www.apple.com/DTDs/PropertyList-1.0.dtd"};const l=c.default.create("plist");l.dec(o.version,o.encoding,o.standalone);l.dtd(a.pubid,a.sysid);l.att("version","1.0");walk_obj(r,l);if(!i)i={};i.pretty=i.pretty!==false;return l.end(i)}function walk_obj(r,i){let o,a,c;const u=type(r);if(u==="Undefined"){}else if(Array.isArray(r)){i=i.ele("array");for(a=0;a<r.length;a++){walk_obj(r[a],i)}}else if(Buffer.isBuffer(r)){i.ele("data").raw(r.toString("base64"))}else if(u==="Object"){i=i.ele("dict");for(c in r){if(r.hasOwnProperty(c)&&r[c]!==undefined){i.ele("key").txt(c);walk_obj(r[c],i)}}}else if(u==="Number"){o=r%1===0?"integer":"real";i.ele(o).txt(r.toString())}else if(u==="Date"){i.ele("date").txt(ISODateString(new Date(r)))}else if(u==="Boolean"){i.ele(r?"true":"false")}else if(u==="String"){i.ele("string").txt(r)}else if(u==="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(r))}else if(r&&r.buffer&&type(r.buffer)==="ArrayBuffer"){i.ele("data").raw(l.default.fromByteArray(new Uint8Array(r.buffer)))}}},3681:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});const a=o(2395);const l=o(6859);i["default"]={parse:l.parse,build:a.build}},6859:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.parse=parse;const l=o(1328);const c=a(o(9491));const u=3;const h=4;const d=8;function shouldIgnoreNode(r){return r.nodeType===u||r.nodeType===d||r.nodeType===h}function isEmptyNode(r){return!r.childNodes||r.childNodes.length===0}function parse(r){const i=new l.DOMParser({errorHandler(){}}).parseFromString(r);(0,c.default)(i.documentElement.nodeName==="plist","malformed document. First element should be <plist>");let o=parsePlistXML(i.documentElement);if(o.length===1)o=o[0];return o}function parsePlistXML(r){let i,o,a,l,d,p;if(!r)return null;if(r.nodeName==="plist"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){l.push(parsePlistXML(r.childNodes[i]))}}return l}else if(r.nodeName==="dict"){o={};a=null;p=0;if(isEmptyNode(r)){return o}for(i=0;i<r.childNodes.length;i++){if(shouldIgnoreNode(r.childNodes[i]))continue;if(p%2===0){(0,c.default)(r.childNodes[i].nodeName==="key","Missing key while parsing <dict/>.");a=parsePlistXML(r.childNodes[i])}else{(0,c.default)(r.childNodes[i].nodeName!=="key",'Unexpected key "'+parsePlistXML(r.childNodes[i])+'" while parsing <dict/>.');o[a]=parsePlistXML(r.childNodes[i])}p+=1}if(p%2===1){throw new Error('Missing value for "'+a+'" while parsing <dict/>')}return o}else if(r.nodeName==="array"){l=[];if(isEmptyNode(r)){return l}for(i=0;i<r.childNodes.length;i++){if(!shouldIgnoreNode(r.childNodes[i])){d=parsePlistXML(r.childNodes[i]);if(d!=null)l.push(d)}}return l}else if(r.nodeName==="#text"){}else if(r.nodeName==="key"){if(isEmptyNode(r)){return""}return r.childNodes[0].nodeValue}else if(r.nodeName==="string"){d="";if(isEmptyNode(r)){return d}for(i=0;i<r.childNodes.length;i++){const o=r.childNodes[i].nodeType;if(o===u||o===h){d+=r.childNodes[i].nodeValue}}return d}else if(r.nodeName==="integer"){(0,c.default)(!isEmptyNode(r),'Cannot parse "" as integer.');return parseInt(r.childNodes[0].nodeValue,10)}else if(r.nodeName==="real"){(0,c.default)(!isEmptyNode(r),'Cannot parse "" as real.');d="";for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===u){d+=r.childNodes[i].nodeValue}}return parseFloat(d)}else if(r.nodeName==="data"){d="";if(isEmptyNode(r)){return Buffer.from(d,"base64")}for(i=0;i<r.childNodes.length;i++){if(r.childNodes[i].nodeType===u){d+=r.childNodes[i].nodeValue.replace(/\s+/g,"")}}return Buffer.from(d,"base64")}else if(r.nodeName==="date"){(0,c.default)(!isEmptyNode(r),'Cannot parse "" as Date.');return new Date(r.childNodes[0].nodeValue)}else if(r.nodeName==="true"){return true}else if(r.nodeName==="false"){return false}}},208:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.isAvailable=isAvailable;i.addAsync=addAsync;i.removeAsync=removeAsync;i.getAdbOutputAsync=getAdbOutputAsync;i.openAsync=openAsync;i.getAsync=getAsync;i.getProjectIdAsync=getProjectIdAsync;i.getConfigPath=getConfigPath;i.escapeUri=escapeUri;const h=o(4513);const d=c(o(365));const p=o(8853);const g=u(o(5642));const y=u(o(8746));const w=o(7147);const b=u(o(1017));const v=o(3329);const E="Activity not started, unable to resolve Intent";const x="error: ";function isAvailable(r){return(0,w.existsSync)(b.default.join(r,"android/app/src/main/AndroidManifest.xml"))||(0,w.existsSync)(b.default.join(r,"app/src/main/AndroidManifest.xml"))}async function addAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let c=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(c)){throw new v.CommandError(`Cannot add scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"add")}if(d.hasScheme(i,c)){console.log(y.default.yellow(`› Android: URI scheme "${i}" already exists in AndroidManifest.xml at: ${l}`));return false}c=d.appendScheme(i,c);if(r){console.log(y.default.magenta("Write manifest to: ",l));console.log((0,p.format)(c));return false}await writeConfigAsync(l,c);return true}async function removeAsync({dryRun:r,uri:i,manifestPath:o,projectRoot:a}){const l=o??getConfigPath(a);let c=await readConfigAsync(l);if(!d.ensureManifestHasValidIntentFilter(c)){throw new v.CommandError(`Cannot remove scheme "${i}" because the provided manifest does not have a valid Activity with \`android:launchMode="singleTask"\`.\nThis guide can help you get setup properly https://expo.fyi/setup-android-uri-scheme`,"remove")}if(!d.hasScheme(i,c)){console.log(y.default.yellow(`› Android: URI scheme "${i}" does not exist in AndroidManifest.xml at: ${l}`));return false}c=d.removeScheme(i,c);if(r){console.log(y.default.magenta("Write manifest to: ",l));console.log((0,p.format)(c));return false}await writeConfigAsync(l,c);return true}function whichADB(){if(process.env.ANDROID_HOME){return`${process.env.ANDROID_HOME}/platform-tools/adb`}return"adb"}async function getAdbOutputAsync(r){const i=whichADB();try{const o=await(0,g.default)(i,r);return o.stdout}catch(r){const i=r.stderr||r.stdout||"";let o=i.trim();if(o.startsWith(x)){o=o.substring(x.length)}throw new v.CommandError(o)}}async function openUrlAsync(...r){const i=await getAdbOutputAsync(["shell","am","start","-a","android.intent.action.VIEW","-d",...r.filter(Boolean)]);if(i.includes(E)){throw new v.CommandError(i.substring(i.indexOf("Error: ")))}return i}async function openAsync({uri:r,androidPackage:i}){return await openUrlAsync(r.replace(/&/g,String.raw`\&`),i??null)}async function getAsync({projectRoot:r,manifestPath:i}){const o=await readConfigAsync(i??getConfigPath(r));return await d.getSchemesFromManifest(o)}function getPackage(r){return r.manifest?.$?.package??null}async function getProjectIdAsync({projectRoot:r,manifestPath:i}){const o=i??getConfigPath(r);const a=await readConfigAsync(o);const l=getPackage(a);if(!l)throw new v.CommandError(`Android: Failed to resolve android package for Manifest at path: ${o}`);return l}function getConfigPath(r){const i=["android/app/src/main/AndroidManifest.xml","app/src/main/AndroidManifest.xml"].map((i=>b.default.join(r,i)));for(const r of i){if((0,w.existsSync)(r)){return r}}throw new Error(`Could not find AndroidManifest.xml, looked in: ${i.join(", ")}`)}async function readConfigAsync(r){return await(0,h.readAndroidManifestAsync)(r)}async function writeConfigAsync(r,i){await(0,h.writeAndroidManifestAsync)(r,i)}function escapeUri(r){const[i,o]=r.split("://",2);const[a,l]=o.split("?",2);const c=a.replace(/(^|[^\\])([$\-_.+!*'(),])/g,"$1\\$2");if(l?.length){const r=new URLSearchParams(l);for(const[i,o]of r.entries()){r.set(i,encodeURIComponent(decodeURIComponent(o)))}return`${i}://${c}?${r.toString()}`}return`${i}://${c}`}},5585:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.program=void 0;i.run=run;const h=u(o(8746));const d=o(1776);const p=o(1017);const g=c(o(208));const y=c(o(2194));const w=o(3329);const b=c(o(8522));const v=u(o(2586));const packageJson=()=>o(4147);i.program=new d.Command(packageJson().name).version(packageJson().version);function buildCommand(r,o=[]){return i.program.command(`${r} [uri-protocol]`).option("-a, --android","Apply action to Android").option("-i, --ios","Apply action to iOS ").on("--help",(()=>{if(!o.length)return;console.log();console.log("Examples:");console.log();for(const i of o){console.log(` $ uri-scheme ${r} ${i}`)}console.log()}))}buildCommand("add",["com.app","myapp"]).description("Add URI schemes to a native app").option("-n, --name <string>","Name to use on iOS.").option("-r, --role <string>","Role to use on iOS: Editor, Viewer").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await b.addAsync(o);await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));buildCommand("remove",["com.app","myapp"]).description("Remove URI schemes from a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").option("--dry-run","View the proposed change").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await b.removeAsync(o);await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));buildCommand("open",["com.app://oauth","http://expo.dev"]).description("Open a URI scheme in a running simulator or emulator").option("--package <string>","The Android package name to use when opening in an emulator").option("--raw","Open the URL without escaping special characters in the search parameters").action((async(r,i)=>{try{if(!i.ios&&!i.android){throw new w.CommandError("Please provide a target platform with --ios or --android")}await b.openAsync({projectRoot:process.cwd(),...i,androidPackage:i["package"],uri:r,escapeUri:!i.raw});await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));buildCommand("list").description("List the existing URI scheme prefixes for a native app").option("--manifest-path <string>","Custom path to use for an Android project's AndroidManifest.xml").option("--info-path <string>","Custom path to use for an iOS project's Info.plist").action((async(r,i)=>{try{const o=await parseArgsAsync(r,i);await b.listAsync(o);await(0,v.default)()}catch(r){await commandDidThrowAsync(r)}}));async function parseArgsAsync(r,i){const o=(0,p.resolve)(process.cwd());i.projectRoot=o;if(i.manifestPath)i.manifestPath=(0,p.resolve)(i.manifestPath);if(i.infoPath)i.infoPath=(0,p.resolve)(i.infoPath);const a=b.getAvailablePlatforms(i);let l=false;if(!i.android&&!i.ios){l=true;for(const r of a){i[r]=true}}else{if(i.android){if(!a.includes("android")){throw new w.CommandError(`Android project not found in directory "${o}".\nYou can manually select an AndroidManifest.xml with \`--manifest-path\``)}}if(i.ios){if(!a.includes("ios")){throw new w.CommandError(`iOS project not found in directory "${o}".\nYou can manually select an Info.plist with \`--info-path\``)}}}if(i.android&&!i.manifestPath){try{i.manifestPath=g.getConfigPath(o)}catch(r){if(l){delete i.android}else{throw r}}}if(i.ios&&!i.infoPath){try{i.infoPath=y.getConfigPath(o)}catch(r){if(l){delete i.ios}else{throw r}}}i.uri=r;return i}function run(){i.program.parse(process.argv)}async function commandDidThrowAsync(r){console.log();if(r.command){console.log(h.default.red(`› ${h.default.bold(`npx ${packageJson().name} ${r.command}`)} has failed.`));console.log()}if(r.origin==="uri-scheme"){console.log(h.default.black.bgRed(r.message))}else{console.log("Aborting run");console.log(h.default.black.bgRed`An unexpected error was encountered. Please report it as a bug:`);console.log(r)}console.log();await(0,v.default)();process.exit(1)}},2194:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.isAvailable=isAvailable;i.addAsync=addAsync;i.removeAsync=removeAsync;i.openAsync=openAsync;i.getAsync=getAsync;i.getConfigPath=getConfigPath;i.escapeUri=escapeUri;const h=c(o(7903));const d=u(o(3681));const p=u(o(5642));const g=u(o(8746));const y=u(o(7147));const w=o(8743);const b=c(o(1017));const v=o(3329);const E=["**/@(Carthage|Pods|vendor|node_modules)/**"];function isAvailable(r){const i=(0,w.globSync)("ios/*.xcodeproj",{ignore:E,absolute:true,cwd:r});const o=(0,w.globSync)("*.xcodeproj",{ignore:E,absolute:true,cwd:r});return!!o.length||!!i.length}async function addAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let c=readConfig(l);if(h.hasScheme(r,c)){console.log(g.default.yellow(`› iOS: URI scheme "${r}" already exists in Info.plist at: ${l}`));return false}c=h.appendScheme(r,c);if(a){console.log(g.default.magenta("Write plist to: ",l));console.log(formatConfig(c));return false}writeConfig(l,c);return true}async function removeAsync({uri:r,infoPath:i,projectRoot:o,dryRun:a}){const l=i??getConfigPath(o);let c=readConfig(l);if(!h.hasScheme(r,c)){console.log(g.default.yellow(`› iOS: URI scheme "${r}" does not exist in Info.plist at: ${l}`));return false}c=h.removeScheme(r,c);if(a){console.log(g.default.magenta("Write plist to: ",l));console.log(formatConfig(c));return false}writeConfig(l,c);return true}async function openAsync({uri:r}){await(0,p.default)("xcrun",["simctl","openurl","booted",r],{stdio:"inherit"})}async function getAsync({projectRoot:r,infoPath:i}){const o=i??getConfigPath(r);const a=y.default.readFileSync(o,"utf8");const l=d.default.parse(a);const c=h.getSchemesFromPlist(l);return c}function getInfoPlistsInDirectory(r){return(0,w.globSync)("*/Info.plist",{ignore:E,absolute:true,cwd:r}).sort(((r,i)=>r.length-i.length))}function getConfigPath(r){const i=getInfoPlistsInDirectory(b.join(r,"ios"));if(i.length){return i[0]}const o=getInfoPlistsInDirectory(r);if(!o.length){throw new v.CommandError(`iOS: No Info.plist found for project at root: ${r}`)}return o[0]}function readConfig(r){const i=y.default.readFileSync(r,"utf8");return{...d.default.parse(i)}}function formatConfig(r){const i={pretty:true,indent:`\t`};const o=d.default.build(r,i);return o}function writeConfig(r,i){y.default.writeFileSync(r,formatConfig(i))}function escapeUri(r){if(!r.includes("?"))return r;const[i,o]=r.split("?",2);const a=new URLSearchParams(o);for(const[r,i]of a.entries()){a.set(r,encodeURIComponent(decodeURIComponent(i)))}return`${i}?${a.toString()}`}},3329:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.CommandError=void 0;class CommandError extends Error{command;origin="uri-scheme";constructor(r,i){super(r);this.command=i}}i.CommandError=CommandError},8522:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();var u=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.getAvailablePlatforms=getAvailablePlatforms;i.addAsync=addAsync;i.removeAsync=removeAsync;i.openAsync=openAsync;i.listAsync=listAsync;const h=u(o(8746));const d=o(7147);const p=o(1017);const g=u(o(1112));const y=c(o(208));const w=c(o(2194));const b=o(3329);function fileExists(r){try{return(0,d.statSync)(r).isFile()}catch{return false}}function getAvailablePlatforms(r){const i=[];if(r.infoPath){if(!fileExists(r.infoPath)){throw new b.CommandError(`Custom Info.plist does not exist at path "${r.infoPath}"`)}i.push("ios")}else if(w.isAvailable(r.projectRoot)){i.push("ios")}if(r.manifestPath){if(!fileExists(r.manifestPath)){throw new b.CommandError(`Custom AndroidManifest.xml does not exist at path "${r.manifestPath}"`)}i.push("android")}else if(y.isAvailable(r.projectRoot)){i.push("android")}return i}function ensureUriString(r){if(!r){throw new b.CommandError("Please supply a URI protocol")}if(typeof r!=="string"){throw new b.CommandError(`URI protocol should be of type string. Instead got: ${typeof r}`)}return r.trim()}async function normalizeUriProtocolAsync(r){const i=ensureUriString(r);const[o]=i.split(":");const a=o.toLowerCase();if(a!==r){if(a){console.log(h.default.yellow(`› Supplied URI protocol "${i}" does not match normalized scheme "${a}".`));const{answer:r}=await(0,g.default)({type:"confirm",name:"answer",message:`Would you like to use "${a}" instead?`,initial:true});if(r)return a}else{throw new b.CommandError(`Supplied URI protocol "${i}" does not appear to be spec compliant: http://www.ietf.org/rfc/rfc2396.txt`)}}return i}async function addAsync(r){r.uri=await normalizeUriProtocolAsync(r.uri);const i=[];let o=false;if(r.ios){if(await w.addAsync(r)){o=true;logPlatformMessage("iOS",`Added URI protocol "${r.uri}" to project`);i.push("ios")}}if(r.android){if(await y.addAsync(r)){o=true;logPlatformMessage("Android",`Added URI protocol "${r.uri}" to project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be added. Please ensure there is a native project available."))}return i}async function removeAsync(r){r.uri=ensureUriString(r.uri);const i=[];let o=false;if(r.ios){if(await w.removeAsync(r)){o=true;logPlatformMessage("iOS",`Removed URI protocol "${r.uri}" from project`);i.push("ios")}}if(r.android){if(await y.removeAsync(r)){o=true;logPlatformMessage("Android",`Removed URI protocol "${r.uri}" from project`);i.push("android")}}if(!o){console.log(h.default.yellow("No URI schemes could be removed. Please ensure there is a native project available."))}return i}async function openAsync(r){r.uri=ensureUriString(r.uri);if(r.ios){if(r.escapeUri)r.uri=w.escapeUri(r.uri);logPlatformMessage("iOS",`Opening URI "${r.uri}" in simulator`);await w.openAsync(r)}if(r.android){if(r.escapeUri)r.uri=y.escapeUri(r.uri);logPlatformMessage("Android",`Opening URI "${r.uri}" in emulator`);await y.openAsync(r)}}async function listAsync(r){let i=false;if(r.infoPath){i=true;const o=await w.getAsync(r);logPlatformMessage("iOS",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.infoPath)}`);logSchemes(o)}if(r.manifestPath){i=true;const o=await y.getAsync(r);logPlatformMessage("Android",`Schemes for config: ./${(0,p.relative)(r.projectRoot,r.manifestPath)}`);logSchemes(o)}if(!i){console.log(h.default.yellow("Could not find any native URI schemes to list."))}}function logPlatformMessage(r,i){console.log(h.default.magenta(`› ${h.default.bold(r)}: ${i}`))}function logSchemes(r){for(const i of r)console.log(`${h.default.dim("› ")}${i}${h.default.dim("://")}`);console.log("")}},2855:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(){var ownKeys=function(r){ownKeys=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))i[i.length]=o;return i};return ownKeys(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o=ownKeys(r),c=0;c<o.length;c++)if(o[c]!=="default")a(i,r,o[c]);l(i,r);return i}}();Object.defineProperty(i,"__esModule",{value:true});i.URIScheme=i.Android=i.Ios=i.program=void 0;const u=c(o(208));i.Android=u;const h=c(o(2194));i.Ios=h;const d=c(o(8522));i.URIScheme=d;var p=o(5585);Object.defineProperty(i,"program",{enumerable:true,get:function(){return p.program}})},2586:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i["default"]=shouldUpdate;const l=a(o(8746));const c=a(o(5418));async function shouldUpdate(){const packageJson=()=>o(4147);const r=(0,c.default)(packageJson()).catch((()=>null));try{const i=await r;if(i&&i.latest){const r=packageJson();console.log();console.log(l.default.yellow.bold(`A new version of \`${r.name}\` is available`));console.log("You can update by running: "+l.default.cyan(`npm i -g ${r.name}`));console.log()}}catch{}}},9491:r=>{"use strict";r.exports=require("assert")},4300:r=>{"use strict";r.exports=require("buffer")},2081:r=>{"use strict";r.exports=require("child_process")},2361:r=>{"use strict";r.exports=require("events")},7147:r=>{"use strict";r.exports=require("fs")},3685:r=>{"use strict";r.exports=require("http")},5687:r=>{"use strict";r.exports=require("https")},7718:r=>{"use strict";r.exports=require("node:child_process")},5673:r=>{"use strict";r.exports=require("node:events")},7561:r=>{"use strict";r.exports=require("node:fs")},3977:r=>{"use strict";r.exports=require("node:fs/promises")},9411:r=>{"use strict";r.exports=require("node:path")},7742:r=>{"use strict";r.exports=require("node:process")},4492:r=>{"use strict";r.exports=require("node:stream")},6915:r=>{"use strict";r.exports=require("node:string_decoder")},1041:r=>{"use strict";r.exports=require("node:url")},2037:r=>{"use strict";r.exports=require("os")},1017:r=>{"use strict";r.exports=require("path")},4521:r=>{"use strict";r.exports=require("readline")},2781:r=>{"use strict";r.exports=require("stream")},1576:r=>{"use strict";r.exports=require("string_decoder")},9512:r=>{"use strict";r.exports=require("timers")},6224:r=>{"use strict";r.exports=require("tty")},7310:r=>{"use strict";r.exports=require("url")},3837:r=>{"use strict";r.exports=require("util")},1776:(r,i,o)=>{const{Argument:a}=o(5e3);const{Command:l}=o(8966);const{CommanderError:c,InvalidArgumentError:u}=o(2315);const{Help:h}=o(9320);const{Option:d}=o(4790);i.program=new l;i.createCommand=r=>new l(r);i.createOption=(r,i)=>new d(r,i);i.createArgument=(r,i)=>new a(r,i);i.Command=l;i.Option=d;i.Argument=a;i.Help=h;i.CommanderError=c;i.InvalidArgumentError=u;i.InvalidOptionArgumentError=u},5e3:(r,i,o)=>{const{InvalidArgumentError:a}=o(2315);class Argument{constructor(r,i){this.description=i||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(r[0]){case"<":this.required=true;this._name=r.slice(1,-1);break;case"[":this.required=false;this._name=r.slice(1,-1);break;default:this.required=true;this._name=r;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(r,i){if(i===this.defaultValue||!Array.isArray(i)){return[r]}return i.concat(r)}default(r,i){this.defaultValue=r;this.defaultValueDescription=i;return this}argParser(r){this.parseArg=r;return this}choices(r){this.argChoices=r.slice();this.parseArg=(r,i)=>{if(!this.argChoices.includes(r)){throw new a(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(r,i)}return r};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(r){const i=r.name()+(r.variadic===true?"...":"");return r.required?"<"+i+">":"["+i+"]"}i.Argument=Argument;i.humanReadableArgName=humanReadableArgName},8966:(r,i,o)=>{const a=o(5673).EventEmitter;const l=o(7718);const c=o(9411);const u=o(7561);const h=o(7742);const{Argument:d,humanReadableArgName:p}=o(5e3);const{CommanderError:g}=o(2315);const{Help:y}=o(9320);const{Option:w,DualOptions:b}=o(4790);const{suggestSimilar:v}=o(1492);class Command extends a{constructor(r){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=r||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:r=>h.stdout.write(r),writeErr:r=>h.stderr.write(r),getOutHelpWidth:()=>h.stdout.isTTY?h.stdout.columns:undefined,getErrHelpWidth:()=>h.stderr.isTTY?h.stderr.columns:undefined,outputError:(r,i)=>i(r)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(r){this._outputConfiguration=r._outputConfiguration;this._helpOption=r._helpOption;this._helpCommand=r._helpCommand;this._helpConfiguration=r._helpConfiguration;this._exitCallback=r._exitCallback;this._storeOptionsAsProperties=r._storeOptionsAsProperties;this._combineFlagAndOptionalValue=r._combineFlagAndOptionalValue;this._allowExcessArguments=r._allowExcessArguments;this._enablePositionalOptions=r._enablePositionalOptions;this._showHelpAfterError=r._showHelpAfterError;this._showSuggestionAfterError=r._showSuggestionAfterError;return this}_getCommandAndAncestors(){const r=[];for(let i=this;i;i=i.parent){r.push(i)}return r}command(r,i,o){let a=i;let l=o;if(typeof a==="object"&&a!==null){l=a;a=null}l=l||{};const[,c,u]=r.match(/([^ ]+) *(.*)/);const h=this.createCommand(c);if(a){h.description(a);h._executableHandler=true}if(l.isDefault)this._defaultCommandName=h._name;h._hidden=!!(l.noHelp||l.hidden);h._executableFile=l.executableFile||null;if(u)h.arguments(u);this._registerCommand(h);h.parent=this;h.copyInheritedSettings(this);if(a)return this;return h}createCommand(r){return new Command(r)}createHelp(){return Object.assign(new y,this.configureHelp())}configureHelp(r){if(r===undefined)return this._helpConfiguration;this._helpConfiguration=r;return this}configureOutput(r){if(r===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,r);return this}showHelpAfterError(r=true){if(typeof r!=="string")r=!!r;this._showHelpAfterError=r;return this}showSuggestionAfterError(r=true){this._showSuggestionAfterError=!!r;return this}addCommand(r,i){if(!r._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}i=i||{};if(i.isDefault)this._defaultCommandName=r._name;if(i.noHelp||i.hidden)r._hidden=true;this._registerCommand(r);r.parent=this;r._checkForBrokenPassThrough();return this}createArgument(r,i){return new d(r,i)}argument(r,i,o,a){const l=this.createArgument(r,i);if(typeof o==="function"){l.default(a).argParser(o)}else{l.default(o)}this.addArgument(l);return this}arguments(r){r.trim().split(/ +/).forEach((r=>{this.argument(r)}));return this}addArgument(r){const i=this.registeredArguments.slice(-1)[0];if(i&&i.variadic){throw new Error(`only the last argument can be variadic '${i.name()}'`)}if(r.required&&r.defaultValue!==undefined&&r.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${r.name()}'`)}this.registeredArguments.push(r);return this}helpCommand(r,i){if(typeof r==="boolean"){this._addImplicitHelpCommand=r;return this}r=r??"help [command]";const[,o,a]=r.match(/([^ ]+) *(.*)/);const l=i??"display help for command";const c=this.createCommand(o);c.helpOption(false);if(a)c.arguments(a);if(l)c.description(l);this._addImplicitHelpCommand=true;this._helpCommand=c;return this}addHelpCommand(r,i){if(typeof r!=="object"){this.helpCommand(r,i);return this}this._addImplicitHelpCommand=true;this._helpCommand=r;return this}_getHelpCommand(){const r=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(r){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(r,i){const o=["preSubcommand","preAction","postAction"];if(!o.includes(r)){throw new Error(`Unexpected value for event passed to hook : '${r}'.\nExpecting one of '${o.join("', '")}'`)}if(this._lifeCycleHooks[r]){this._lifeCycleHooks[r].push(i)}else{this._lifeCycleHooks[r]=[i]}return this}exitOverride(r){if(r){this._exitCallback=r}else{this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync"){throw r}else{}}}return this}_exit(r,i,o){if(this._exitCallback){this._exitCallback(new g(r,i,o))}h.exit(r)}action(r){const listener=i=>{const o=this.registeredArguments.length;const a=i.slice(0,o);if(this._storeOptionsAsProperties){a[o]=this}else{a[o]=this.opts()}a.push(this);return r.apply(this,a)};this._actionHandler=listener;return this}createOption(r,i){return new w(r,i)}_callParseArg(r,i,o,a){try{return r.parseArg(i,o)}catch(r){if(r.code==="commander.invalidArgument"){const i=`${a} ${r.message}`;this.error(i,{exitCode:r.exitCode,code:r.code})}throw r}}_registerOption(r){const i=r.short&&this._findOption(r.short)||r.long&&this._findOption(r.long);if(i){const o=r.long&&this._findOption(r.long)?r.long:r.short;throw new Error(`Cannot add option '${r.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'\n- already used by option '${i.flags}'`)}this.options.push(r)}_registerCommand(r){const knownBy=r=>[r.name()].concat(r.aliases());const i=knownBy(r).find((r=>this._findCommand(r)));if(i){const o=knownBy(this._findCommand(i)).join("|");const a=knownBy(r).join("|");throw new Error(`cannot add command '${a}' as already have command '${o}'`)}this.commands.push(r)}addOption(r){this._registerOption(r);const i=r.name();const o=r.attributeName();if(r.negate){const i=r.long.replace(/^--no-/,"--");if(!this._findOption(i)){this.setOptionValueWithSource(o,r.defaultValue===undefined?true:r.defaultValue,"default")}}else if(r.defaultValue!==undefined){this.setOptionValueWithSource(o,r.defaultValue,"default")}const handleOptionValue=(i,a,l)=>{if(i==null&&r.presetArg!==undefined){i=r.presetArg}const c=this.getOptionValue(o);if(i!==null&&r.parseArg){i=this._callParseArg(r,i,c,a)}else if(i!==null&&r.variadic){i=r._concatValue(i,c)}if(i==null){if(r.negate){i=false}else if(r.isBoolean()||r.optional){i=true}else{i=""}}this.setOptionValueWithSource(o,i,l)};this.on("option:"+i,(i=>{const o=`error: option '${r.flags}' argument '${i}' is invalid.`;handleOptionValue(i,o,"cli")}));if(r.envVar){this.on("optionEnv:"+i,(i=>{const o=`error: option '${r.flags}' value '${i}' from env '${r.envVar}' is invalid.`;handleOptionValue(i,o,"env")}))}return this}_optionEx(r,i,o,a,l){if(typeof i==="object"&&i instanceof w){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const c=this.createOption(i,o);c.makeOptionMandatory(!!r.mandatory);if(typeof a==="function"){c.default(l).argParser(a)}else if(a instanceof RegExp){const r=a;a=(i,o)=>{const a=r.exec(i);return a?a[0]:o};c.default(l).argParser(a)}else{c.default(a)}return this.addOption(c)}option(r,i,o,a){return this._optionEx({},r,i,o,a)}requiredOption(r,i,o,a){return this._optionEx({mandatory:true},r,i,o,a)}combineFlagAndOptionalValue(r=true){this._combineFlagAndOptionalValue=!!r;return this}allowUnknownOption(r=true){this._allowUnknownOption=!!r;return this}allowExcessArguments(r=true){this._allowExcessArguments=!!r;return this}enablePositionalOptions(r=true){this._enablePositionalOptions=!!r;return this}passThroughOptions(r=true){this._passThroughOptions=!!r;this._checkForBrokenPassThrough();return this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions){throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}}storeOptionsAsProperties(r=true){if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}if(Object.keys(this._optionValues).length){throw new Error("call .storeOptionsAsProperties() before setting option values")}this._storeOptionsAsProperties=!!r;return this}getOptionValue(r){if(this._storeOptionsAsProperties){return this[r]}return this._optionValues[r]}setOptionValue(r,i){return this.setOptionValueWithSource(r,i,undefined)}setOptionValueWithSource(r,i,o){if(this._storeOptionsAsProperties){this[r]=i}else{this._optionValues[r]=i}this._optionValueSources[r]=o;return this}getOptionValueSource(r){return this._optionValueSources[r]}getOptionValueSourceWithGlobals(r){let i;this._getCommandAndAncestors().forEach((o=>{if(o.getOptionValueSource(r)!==undefined){i=o.getOptionValueSource(r)}}));return i}_prepareUserArgs(r,i){if(r!==undefined&&!Array.isArray(r)){throw new Error("first parameter to parse must be array or undefined")}i=i||{};if(r===undefined&&i.from===undefined){if(h.versions?.electron){i.from="electron"}const r=h.execArgv??[];if(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print")){i.from="eval"}}if(r===undefined){r=h.argv}this.rawArgs=r.slice();let o;switch(i.from){case undefined:case"node":this._scriptPath=r[1];o=r.slice(2);break;case"electron":if(h.defaultApp){this._scriptPath=r[1];o=r.slice(2)}else{o=r.slice(1)}break;case"user":o=r.slice(0);break;case"eval":o=r.slice(1);break;default:throw new Error(`unexpected parse option { from: '${i.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return o}parse(r,i){const o=this._prepareUserArgs(r,i);this._parseCommand([],o);return this}async parseAsync(r,i){const o=this._prepareUserArgs(r,i);await this._parseCommand([],o);return this}_executeSubCommand(r,i){i=i.slice();let o=false;const a=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(r,i){const o=c.resolve(r,i);if(u.existsSync(o))return o;if(a.includes(c.extname(i)))return undefined;const l=a.find((r=>u.existsSync(`${o}${r}`)));if(l)return`${o}${l}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let d=r._executableFile||`${this._name}-${r._name}`;let p=this._executableDir||"";if(this._scriptPath){let r;try{r=u.realpathSync(this._scriptPath)}catch(i){r=this._scriptPath}p=c.resolve(c.dirname(r),p)}if(p){let i=findFile(p,d);if(!i&&!r._executableFile&&this._scriptPath){const o=c.basename(this._scriptPath,c.extname(this._scriptPath));if(o!==this._name){i=findFile(p,`${o}-${r._name}`)}}d=i||d}o=a.includes(c.extname(d));let y;if(h.platform!=="win32"){if(o){i.unshift(d);i=incrementNodeInspectorPort(h.execArgv).concat(i);y=l.spawn(h.argv[0],i,{stdio:"inherit"})}else{y=l.spawn(d,i,{stdio:"inherit"})}}else{i.unshift(d);i=incrementNodeInspectorPort(h.execArgv).concat(i);y=l.spawn(h.execPath,i,{stdio:"inherit"})}if(!y.killed){const r=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];r.forEach((r=>{h.on(r,(()=>{if(y.killed===false&&y.exitCode===null){y.kill(r)}}))}))}const w=this._exitCallback;y.on("close",(r=>{r=r??1;if(!w){h.exit(r)}else{w(new g(r,"commander.executeSubCommandAsync","(close)"))}}));y.on("error",(i=>{if(i.code==="ENOENT"){const i=p?`searched for local subcommand relative to directory '${p}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const o=`'${d}' does not exist\n - if '${r._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${i}`;throw new Error(o)}else if(i.code==="EACCES"){throw new Error(`'${d}' not executable`)}if(!w){h.exit(1)}else{const r=new g(1,"commander.executeSubCommandAsync","(error)");r.nestedError=i;w(r)}}));this.runningCommand=y}_dispatchSubcommand(r,i,o){const a=this._findCommand(r);if(!a)this.help({error:true});let l;l=this._chainOrCallSubCommandHook(l,a,"preSubcommand");l=this._chainOrCall(l,(()=>{if(a._executableHandler){this._executeSubCommand(a,i.concat(o))}else{return a._parseCommand(i,o)}}));return l}_dispatchHelpCommand(r){if(!r){this.help()}const i=this._findCommand(r);if(i&&!i._executableHandler){i.help()}return this._dispatchSubcommand(r,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((r,i)=>{if(r.required&&this.args[i]==null){this.missingArgument(r.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(r,i,o)=>{let a=i;if(i!==null&&r.parseArg){const l=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;a=this._callParseArg(r,i,o,l)}return a};this._checkNumberOfArguments();const r=[];this.registeredArguments.forEach(((i,o)=>{let a=i.defaultValue;if(i.variadic){if(o<this.args.length){a=this.args.slice(o);if(i.parseArg){a=a.reduce(((r,o)=>myParseArg(i,o,r)),i.defaultValue)}}else if(a===undefined){a=[]}}else if(o<this.args.length){a=this.args[o];if(i.parseArg){a=myParseArg(i,a,i.defaultValue)}}r[o]=a}));this.processedArgs=r}_chainOrCall(r,i){if(r&&r.then&&typeof r.then==="function"){return r.then((()=>i()))}return i()}_chainOrCallHooks(r,i){let o=r;const a=[];this._getCommandAndAncestors().reverse().filter((r=>r._lifeCycleHooks[i]!==undefined)).forEach((r=>{r._lifeCycleHooks[i].forEach((i=>{a.push({hookedCommand:r,callback:i})}))}));if(i==="postAction"){a.reverse()}a.forEach((r=>{o=this._chainOrCall(o,(()=>r.callback(r.hookedCommand,this)))}));return o}_chainOrCallSubCommandHook(r,i,o){let a=r;if(this._lifeCycleHooks[o]!==undefined){this._lifeCycleHooks[o].forEach((r=>{a=this._chainOrCall(a,(()=>r(this,i)))}))}return a}_parseCommand(r,i){const o=this.parseOptions(i);this._parseOptionsEnv();this._parseOptionsImplied();r=r.concat(o.operands);i=o.unknown;this.args=r.concat(i);if(r&&this._findCommand(r[0])){return this._dispatchSubcommand(r[0],r.slice(1),i)}if(this._getHelpCommand()&&r[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(r[1])}if(this._defaultCommandName){this._outputHelpIfRequested(i);return this._dispatchSubcommand(this._defaultCommandName,r,i)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(o.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(o.unknown.length>0){this.unknownOption(o.unknown[0])}};const a=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let o;o=this._chainOrCallHooks(o,"preAction");o=this._chainOrCall(o,(()=>this._actionHandler(this.processedArgs)));if(this.parent){o=this._chainOrCall(o,(()=>{this.parent.emit(a,r,i)}))}o=this._chainOrCallHooks(o,"postAction");return o}if(this.parent&&this.parent.listenerCount(a)){checkForUnknownOptions();this._processArguments();this.parent.emit(a,r,i)}else if(r.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",r,i)}if(this.listenerCount("command:*")){this.emit("command:*",r,i)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(r){if(!r)return undefined;return this.commands.find((i=>i._name===r||i._aliases.includes(r)))}_findOption(r){return this.options.find((i=>i.is(r)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((r=>{r.options.forEach((i=>{if(i.mandatory&&r.getOptionValue(i.attributeName())===undefined){r.missingMandatoryOptionValue(i)}}))}))}_checkForConflictingLocalOptions(){const r=this.options.filter((r=>{const i=r.attributeName();if(this.getOptionValue(i)===undefined){return false}return this.getOptionValueSource(i)!=="default"}));const i=r.filter((r=>r.conflictsWith.length>0));i.forEach((i=>{const o=r.find((r=>i.conflictsWith.includes(r.attributeName())));if(o){this._conflictingOption(i,o)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((r=>{r._checkForConflictingLocalOptions()}))}parseOptions(r){const i=[];const o=[];let a=i;const l=r.slice();function maybeOption(r){return r.length>1&&r[0]==="-"}let c=null;while(l.length){const r=l.shift();if(r==="--"){if(a===o)a.push(r);a.push(...l);break}if(c&&!maybeOption(r)){this.emit(`option:${c.name()}`,r);continue}c=null;if(maybeOption(r)){const i=this._findOption(r);if(i){if(i.required){const r=l.shift();if(r===undefined)this.optionMissingArgument(i);this.emit(`option:${i.name()}`,r)}else if(i.optional){let r=null;if(l.length>0&&!maybeOption(l[0])){r=l.shift()}this.emit(`option:${i.name()}`,r)}else{this.emit(`option:${i.name()}`)}c=i.variadic?i:null;continue}}if(r.length>2&&r[0]==="-"&&r[1]!=="-"){const i=this._findOption(`-${r[1]}`);if(i){if(i.required||i.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${i.name()}`,r.slice(2))}else{this.emit(`option:${i.name()}`);l.unshift(`-${r.slice(2)}`)}continue}}if(/^--[^=]+=/.test(r)){const i=r.indexOf("=");const o=this._findOption(r.slice(0,i));if(o&&(o.required||o.optional)){this.emit(`option:${o.name()}`,r.slice(i+1));continue}}if(maybeOption(r)){a=o}if((this._enablePositionalOptions||this._passThroughOptions)&&i.length===0&&o.length===0){if(this._findCommand(r)){i.push(r);if(l.length>0)o.push(...l);break}else if(this._getHelpCommand()&&r===this._getHelpCommand().name()){i.push(r);if(l.length>0)i.push(...l);break}else if(this._defaultCommandName){o.push(r);if(l.length>0)o.push(...l);break}}if(this._passThroughOptions){a.push(r);if(l.length>0)a.push(...l);break}a.push(r)}return{operands:i,unknown:o}}opts(){if(this._storeOptionsAsProperties){const r={};const i=this.options.length;for(let o=0;o<i;o++){const i=this.options[o].attributeName();r[i]=i===this._versionOptionName?this._version:this[i]}return r}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((r,i)=>Object.assign(r,i.opts())),{})}error(r,i){this._outputConfiguration.outputError(`${r}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const o=i||{};const a=o.exitCode||1;const l=o.code||"commander.error";this._exit(a,l,r)}_parseOptionsEnv(){this.options.forEach((r=>{if(r.envVar&&r.envVar in h.env){const i=r.attributeName();if(this.getOptionValue(i)===undefined||["default","config","env"].includes(this.getOptionValueSource(i))){if(r.required||r.optional){this.emit(`optionEnv:${r.name()}`,h.env[r.envVar])}else{this.emit(`optionEnv:${r.name()}`)}}}}))}_parseOptionsImplied(){const r=new b(this.options);const hasCustomOptionValue=r=>this.getOptionValue(r)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter((i=>i.implied!==undefined&&hasCustomOptionValue(i.attributeName())&&r.valueFromOption(this.getOptionValue(i.attributeName()),i))).forEach((r=>{Object.keys(r.implied).filter((r=>!hasCustomOptionValue(r))).forEach((i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")}))}))}missingArgument(r){const i=`error: missing required argument '${r}'`;this.error(i,{code:"commander.missingArgument"})}optionMissingArgument(r){const i=`error: option '${r.flags}' argument missing`;this.error(i,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(r){const i=`error: required option '${r.flags}' not specified`;this.error(i,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(r,i){const findBestOptionFromValue=r=>{const i=r.attributeName();const o=this.getOptionValue(i);const a=this.options.find((r=>r.negate&&i===r.attributeName()));const l=this.options.find((r=>!r.negate&&i===r.attributeName()));if(a&&(a.presetArg===undefined&&o===false||a.presetArg!==undefined&&o===a.presetArg)){return a}return l||r};const getErrorMessage=r=>{const i=findBestOptionFromValue(r);const o=i.attributeName();const a=this.getOptionValueSource(o);if(a==="env"){return`environment variable '${i.envVar}'`}return`option '${i.flags}'`};const o=`error: ${getErrorMessage(r)} cannot be used with ${getErrorMessage(i)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(r){if(this._allowUnknownOption)return;let i="";if(r.startsWith("--")&&this._showSuggestionAfterError){let o=[];let a=this;do{const r=a.createHelp().visibleOptions(a).filter((r=>r.long)).map((r=>r.long));o=o.concat(r);a=a.parent}while(a&&!a._enablePositionalOptions);i=v(r,o)}const o=`error: unknown option '${r}'${i}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(r){if(this._allowExcessArguments)return;const i=this.registeredArguments.length;const o=i===1?"":"s";const a=this.parent?` for '${this.name()}'`:"";const l=`error: too many arguments${a}. Expected ${i} argument${o} but got ${r.length}.`;this.error(l,{code:"commander.excessArguments"})}unknownCommand(){const r=this.args[0];let i="";if(this._showSuggestionAfterError){const o=[];this.createHelp().visibleCommands(this).forEach((r=>{o.push(r.name());if(r.alias())o.push(r.alias())}));i=v(r,o)}const o=`error: unknown command '${r}'${i}`;this.error(o,{code:"commander.unknownCommand"})}version(r,i,o){if(r===undefined)return this._version;this._version=r;i=i||"-V, --version";o=o||"output the version number";const a=this.createOption(i,o);this._versionOptionName=a.attributeName();this._registerOption(a);this.on("option:"+a.name(),(()=>{this._outputConfiguration.writeOut(`${r}\n`);this._exit(0,"commander.version",r)}));return this}description(r,i){if(r===undefined&&i===undefined)return this._description;this._description=r;if(i){this._argsDescription=i}return this}summary(r){if(r===undefined)return this._summary;this._summary=r;return this}alias(r){if(r===undefined)return this._aliases[0];let i=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){i=this.commands[this.commands.length-1]}if(r===i._name)throw new Error("Command alias can't be the same as its name");const o=this.parent?._findCommand(r);if(o){const i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${r}' to command '${this.name()}' as already have command '${i}'`)}i._aliases.push(r);return this}aliases(r){if(r===undefined)return this._aliases;r.forEach((r=>this.alias(r)));return this}usage(r){if(r===undefined){if(this._usage)return this._usage;const r=this.registeredArguments.map((r=>p(r)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}this._usage=r;return this}name(r){if(r===undefined)return this._name;this._name=r;return this}nameFromFilename(r){this._name=c.basename(r,c.extname(r));return this}executableDir(r){if(r===undefined)return this._executableDir;this._executableDir=r;return this}helpInformation(r){const i=this.createHelp();if(i.helpWidth===undefined){i.helpWidth=r&&r.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return i.formatHelp(this,i)}_getHelpContext(r){r=r||{};const i={error:!!r.error};let o;if(i.error){o=r=>this._outputConfiguration.writeErr(r)}else{o=r=>this._outputConfiguration.writeOut(r)}i.write=r.write||o;i.command=this;return i}outputHelp(r){let i;if(typeof r==="function"){i=r;r=undefined}const o=this._getHelpContext(r);this._getCommandAndAncestors().reverse().forEach((r=>r.emit("beforeAllHelp",o)));this.emit("beforeHelp",o);let a=this.helpInformation(o);if(i){a=i(a);if(typeof a!=="string"&&!Buffer.isBuffer(a)){throw new Error("outputHelp callback must return a string or a Buffer")}}o.write(a);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",o);this._getCommandAndAncestors().forEach((r=>r.emit("afterAllHelp",o)))}helpOption(r,i){if(typeof r==="boolean"){if(r){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}r=r??"-h, --help";i=i??"display help for command";this._helpOption=this.createOption(r,i);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(r){this._helpOption=r;return this}help(r){this.outputHelp(r);let i=h.exitCode||0;if(i===0&&r&&typeof r!=="function"&&r.error){i=1}this._exit(i,"commander.help","(outputHelp)")}addHelpText(r,i){const o=["beforeAll","before","after","afterAll"];if(!o.includes(r)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${o.join("', '")}'`)}const a=`${r}Help`;this.on(a,(r=>{let o;if(typeof i==="function"){o=i({error:r.error,command:r.command})}else{o=i}if(o){r.write(`${o}\n`)}}));return this}_outputHelpIfRequested(r){const i=this._getHelpOption();const o=i&&r.find((r=>i.is(r)));if(o){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(r){return r.map((r=>{if(!r.startsWith("--inspect")){return r}let i;let o="127.0.0.1";let a="9229";let l;if((l=r.match(/^(--inspect(-brk)?)$/))!==null){i=l[1]}else if((l=r.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){i=l[1];if(/^\d+$/.test(l[3])){a=l[3]}else{o=l[3]}}else if((l=r.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){i=l[1];o=l[3];a=l[4]}if(i&&a!=="0"){return`${i}=${o}:${parseInt(a)+1}`}return r}))}i.Command=Command},2315:(r,i)=>{class CommanderError extends Error{constructor(r,i,o){super(o);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=i;this.exitCode=r;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(r){super(1,"commander.invalidArgument",r);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}i.CommanderError=CommanderError;i.InvalidArgumentError=InvalidArgumentError},9320:(r,i,o)=>{const{humanReadableArgName:a}=o(5e3);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(r){const i=r.commands.filter((r=>!r._hidden));const o=r._getHelpCommand();if(o&&!o._hidden){i.push(o)}if(this.sortSubcommands){i.sort(((r,i)=>r.name().localeCompare(i.name())))}return i}compareOptions(r,i){const getSortKey=r=>r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"");return getSortKey(r).localeCompare(getSortKey(i))}visibleOptions(r){const i=r.options.filter((r=>!r.hidden));const o=r._getHelpOption();if(o&&!o.hidden){const a=o.short&&r._findOption(o.short);const l=o.long&&r._findOption(o.long);if(!a&&!l){i.push(o)}else if(o.long&&!l){i.push(r.createOption(o.long,o.description))}else if(o.short&&!a){i.push(r.createOption(o.short,o.description))}}if(this.sortOptions){i.sort(this.compareOptions)}return i}visibleGlobalOptions(r){if(!this.showGlobalOptions)return[];const i=[];for(let o=r.parent;o;o=o.parent){const r=o.options.filter((r=>!r.hidden));i.push(...r)}if(this.sortOptions){i.sort(this.compareOptions)}return i}visibleArguments(r){if(r._argsDescription){r.registeredArguments.forEach((i=>{i.description=i.description||r._argsDescription[i.name()]||""}))}if(r.registeredArguments.find((r=>r.description))){return r.registeredArguments}return[]}subcommandTerm(r){const i=r.registeredArguments.map((r=>a(r))).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,i){return i.visibleCommands(r).reduce(((r,o)=>Math.max(r,i.subcommandTerm(o).length)),0)}longestOptionTermLength(r,i){return i.visibleOptions(r).reduce(((r,o)=>Math.max(r,i.optionTerm(o).length)),0)}longestGlobalOptionTermLength(r,i){return i.visibleGlobalOptions(r).reduce(((r,o)=>Math.max(r,i.optionTerm(o).length)),0)}longestArgumentTermLength(r,i){return i.visibleArguments(r).reduce(((r,o)=>Math.max(r,i.argumentTerm(o).length)),0)}commandUsage(r){let i=r._name;if(r._aliases[0]){i=i+"|"+r._aliases[0]}let o="";for(let i=r.parent;i;i=i.parent){o=i.name()+" "+o}return o+i+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){const i=[];if(r.argChoices){i.push(`choices: ${r.argChoices.map((r=>JSON.stringify(r))).join(", ")}`)}if(r.defaultValue!==undefined){const o=r.required||r.optional||r.isBoolean()&&typeof r.defaultValue==="boolean";if(o){i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`)}}if(r.presetArg!==undefined&&r.optional){i.push(`preset: ${JSON.stringify(r.presetArg)}`)}if(r.envVar!==undefined){i.push(`env: ${r.envVar}`)}if(i.length>0){return`${r.description} (${i.join(", ")})`}return r.description}argumentDescription(r){const i=[];if(r.argChoices){i.push(`choices: ${r.argChoices.map((r=>JSON.stringify(r))).join(", ")}`)}if(r.defaultValue!==undefined){i.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`)}if(i.length>0){const o=`(${i.join(", ")})`;if(r.description){return`${r.description} ${o}`}return o}return r.description}formatHelp(r,i){const o=i.padWidth(r,i);const a=i.helpWidth||80;const l=2;const c=2;function formatItem(r,u){if(u){const h=`${r.padEnd(o+c)}${u}`;return i.wrap(h,a-l,o+c)}return r}function formatList(r){return r.join("\n").replace(/^/gm," ".repeat(l))}let u=[`Usage: ${i.commandUsage(r)}`,""];const h=i.commandDescription(r);if(h.length>0){u=u.concat([i.wrap(h,a,0),""])}const d=i.visibleArguments(r).map((r=>formatItem(i.argumentTerm(r),i.argumentDescription(r))));if(d.length>0){u=u.concat(["Arguments:",formatList(d),""])}const p=i.visibleOptions(r).map((r=>formatItem(i.optionTerm(r),i.optionDescription(r))));if(p.length>0){u=u.concat(["Options:",formatList(p),""])}if(this.showGlobalOptions){const o=i.visibleGlobalOptions(r).map((r=>formatItem(i.optionTerm(r),i.optionDescription(r))));if(o.length>0){u=u.concat(["Global Options:",formatList(o),""])}}const g=i.visibleCommands(r).map((r=>formatItem(i.subcommandTerm(r),i.subcommandDescription(r))));if(g.length>0){u=u.concat(["Commands:",formatList(g),""])}return u.join("\n")}padWidth(r,i){return Math.max(i.longestOptionTermLength(r,i),i.longestGlobalOptionTermLength(r,i),i.longestSubcommandTermLength(r,i),i.longestArgumentTermLength(r,i))}wrap(r,i,o,a=40){const l=" \\f\\t\\v   -    \ufeff";const c=new RegExp(`[\\n][${l}]+`);if(r.match(c))return r;const u=i-o;if(u<a)return r;const h=r.slice(0,o);const d=r.slice(o).replace("\r\n","\n");const p=" ".repeat(o);const g="​";const y=`\\s${g}`;const w=new RegExp(`\n|.{1,${u-1}}([${y}]|$)|[^${y}]+?([${y}]|$)`,"g");const b=d.match(w)||[];return h+b.map(((r,i)=>{if(r==="\n")return"";return(i>0?p:"")+r.trimEnd()})).join("\n")}}i.Help=Help},4790:(r,i,o)=>{const{InvalidArgumentError:a}=o(2315);class Option{constructor(r,i){this.flags=r;this.description=i||"";this.required=r.includes("<");this.optional=r.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(r);this.mandatory=false;const o=splitOptionFlags(r);this.short=o.shortFlag;this.long=o.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(r,i){this.defaultValue=r;this.defaultValueDescription=i;return this}preset(r){this.presetArg=r;return this}conflicts(r){this.conflictsWith=this.conflictsWith.concat(r);return this}implies(r){let i=r;if(typeof r==="string"){i={[r]:true}}this.implied=Object.assign(this.implied||{},i);return this}env(r){this.envVar=r;return this}argParser(r){this.parseArg=r;return this}makeOptionMandatory(r=true){this.mandatory=!!r;return this}hideHelp(r=true){this.hidden=!!r;return this}_concatValue(r,i){if(i===this.defaultValue||!Array.isArray(i)){return[r]}return i.concat(r)}choices(r){this.argChoices=r.slice();this.parseArg=(r,i)=>{if(!this.argChoices.includes(r)){throw new a(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(r,i)}return r};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(r){return this.short===r||this.long===r}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(r){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;r.forEach((r=>{if(r.negate){this.negativeOptions.set(r.attributeName(),r)}else{this.positiveOptions.set(r.attributeName(),r)}}));this.negativeOptions.forEach(((r,i)=>{if(this.positiveOptions.has(i)){this.dualOptions.add(i)}}))}valueFromOption(r,i){const o=i.attributeName();if(!this.dualOptions.has(o))return true;const a=this.negativeOptions.get(o).presetArg;const l=a!==undefined?a:false;return i.negate===(l===r)}}function camelcase(r){return r.split("-").reduce(((r,i)=>r+i[0].toUpperCase()+i.slice(1)))}function splitOptionFlags(r){let i;let o;const a=r.split(/[ |,]+/);if(a.length>1&&!/^[[<]/.test(a[1]))i=a.shift();o=a.shift();if(!i&&/^-[^-]$/.test(o)){i=o;o=undefined}return{shortFlag:i,longFlag:o}}i.Option=Option;i.DualOptions=DualOptions},1492:(r,i)=>{const o=3;function editDistance(r,i){if(Math.abs(r.length-i.length)>o)return Math.max(r.length,i.length);const a=[];for(let i=0;i<=r.length;i++){a[i]=[i]}for(let r=0;r<=i.length;r++){a[0][r]=r}for(let o=1;o<=i.length;o++){for(let l=1;l<=r.length;l++){let c=1;if(r[l-1]===i[o-1]){c=0}else{c=1}a[l][o]=Math.min(a[l-1][o]+1,a[l][o-1]+1,a[l-1][o-1]+c);if(l>1&&o>1&&r[l-1]===i[o-2]&&r[l-2]===i[o-1]){a[l][o]=Math.min(a[l][o],a[l-2][o-2]+1)}}}return a[r.length][i.length]}function suggestSimilar(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const a=r.startsWith("--");if(a){r=r.slice(2);i=i.map((r=>r.slice(2)))}let l=[];let c=o;const u=.4;i.forEach((i=>{if(i.length<=1)return;const o=editDistance(r,i);const a=Math.max(r.length,i.length);const h=(a-o)/a;if(h>u){if(o<c){c=o;l=[i]}else if(o===c){l.push(i)}}}));l.sort(((r,i)=>r.localeCompare(i)));if(a){l=l.map((r=>`--${r}`))}if(l.length>1){return`\n(Did you mean one of ${l.join(", ")}?)`}if(l.length===1){return`\n(Did you mean ${l[0]}?)`}return""}i.suggestSimilar=suggestSimilar},5014:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Glob=void 0;const a=o(542);const l=o(1041);const c=o(5715);const u=o(2499);const h=o(9660);const d=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(r,i){if(!i)throw new TypeError("glob options required");this.withFileTypes=!!i.withFileTypes;this.signal=i.signal;this.follow=!!i.follow;this.dot=!!i.dot;this.dotRelative=!!i.dotRelative;this.nodir=!!i.nodir;this.mark=!!i.mark;if(!i.cwd){this.cwd=""}else if(i.cwd instanceof URL||i.cwd.startsWith("file://")){i.cwd=(0,l.fileURLToPath)(i.cwd)}this.cwd=i.cwd||"";this.root=i.root;this.magicalBraces=!!i.magicalBraces;this.nobrace=!!i.nobrace;this.noext=!!i.noext;this.realpath=!!i.realpath;this.absolute=i.absolute;this.includeChildMatches=i.includeChildMatches!==false;this.noglobstar=!!i.noglobstar;this.matchBase=!!i.matchBase;this.maxDepth=typeof i.maxDepth==="number"?i.maxDepth:Infinity;this.stat=!!i.stat;this.ignore=i.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof r==="string"){r=[r]}this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){r=r.map((r=>r.replace(/\\/g,"/")))}if(this.matchBase){if(i.noglobstar){throw new TypeError("base matching requires globstar")}r=r.map((r=>r.includes("/")?r:`./**/${r}`))}this.pattern=r;this.platform=i.platform||d;this.opts={...i,platform:this.platform};if(i.scurry){this.scurry=i.scurry;if(i.nocase!==undefined&&i.nocase!==i.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const r=i.platform==="win32"?c.PathScurryWin32:i.platform==="darwin"?c.PathScurryDarwin:i.platform?c.PathScurryPosix:c.PathScurry;this.scurry=new r(this.cwd,{nocase:i.nocase,fs:i.fs})}this.nocase=this.scurry.nocase;const o=this.platform==="darwin"||this.platform==="win32";const h={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:o,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const p=this.pattern.map((r=>new a.Minimatch(r,h)));const[g,y]=p.reduce(((r,i)=>{r[0].push(...i.set);r[1].push(...i.globParts);return r}),[[],[]]);this.patterns=g.map(((r,i)=>{const o=y[i];if(!o)throw new Error("invalid pattern object");return new u.Pattern(r,o,0,this.platform)}))}async walk(){return[...await new h.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new h.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new h.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new h.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}i.Glob=Glob},859:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.hasMagic=void 0;const a=o(542);const hasMagic=(r,i={})=>{if(!Array.isArray(r)){r=[r]}for(const o of r){if(new a.Minimatch(o,i).hasMagic())return true}return false};i.hasMagic=hasMagic},1975:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Ignore=void 0;const a=o(542);const l=o(2499);const c=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(r,{nobrace:i,nocase:o,noext:a,noglobstar:l,platform:u=c}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=u;this.mmopts={dot:true,nobrace:i,nocase:o,noext:a,noglobstar:l,optimizationLevel:2,platform:u,nocomment:true,nonegate:true};for(const i of r)this.add(i)}add(r){const i=new a.Minimatch(r,this.mmopts);for(let r=0;r<i.set.length;r++){const o=i.set[r];const c=i.globParts[r];if(!o||!c){throw new Error("invalid pattern object")}while(o[0]==="."&&c[0]==="."){o.shift();c.shift()}const u=new l.Pattern(o,c,0,this.platform);const h=new a.Minimatch(u.globString(),this.mmopts);const d=c[c.length-1]==="**";const p=u.isAbsolute();if(p)this.absolute.push(h);else this.relative.push(h);if(d){if(p)this.absoluteChildren.push(h);else this.relativeChildren.push(h)}}}ignored(r){const i=r.fullpath();const o=`${i}/`;const a=r.relative()||".";const l=`${a}/`;for(const r of this.relative){if(r.match(a)||r.match(l))return true}for(const r of this.absolute){if(r.match(i)||r.match(o))return true}return false}childrenIgnored(r){const i=r.fullpath()+"/";const o=(r.relative()||".")+"/";for(const r of this.relativeChildren){if(r.match(o))return true}for(const r of this.absoluteChildren){if(r.match(i))return true}return false}}i.Ignore=Ignore},8743:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.glob=i.sync=i.iterate=i.iterateSync=i.stream=i.streamSync=i.Ignore=i.hasMagic=i.Glob=i.unescape=i.escape=void 0;i.globStreamSync=globStreamSync;i.globStream=globStream;i.globSync=globSync;i.globIterateSync=globIterateSync;i.globIterate=globIterate;const a=o(542);const l=o(5014);const c=o(859);var u=o(542);Object.defineProperty(i,"escape",{enumerable:true,get:function(){return u.escape}});Object.defineProperty(i,"unescape",{enumerable:true,get:function(){return u.unescape}});var h=o(5014);Object.defineProperty(i,"Glob",{enumerable:true,get:function(){return h.Glob}});var d=o(859);Object.defineProperty(i,"hasMagic",{enumerable:true,get:function(){return d.hasMagic}});var p=o(1975);Object.defineProperty(i,"Ignore",{enumerable:true,get:function(){return p.Ignore}});function globStreamSync(r,i={}){return new l.Glob(r,i).streamSync()}function globStream(r,i={}){return new l.Glob(r,i).stream()}function globSync(r,i={}){return new l.Glob(r,i).walkSync()}async function glob_(r,i={}){return new l.Glob(r,i).walk()}function globIterateSync(r,i={}){return new l.Glob(r,i).iterateSync()}function globIterate(r,i={}){return new l.Glob(r,i).iterate()}i.streamSync=globStreamSync;i.stream=Object.assign(globStream,{sync:globStreamSync});i.iterateSync=globIterateSync;i.iterate=Object.assign(globIterate,{sync:globIterateSync});i.sync=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});i.glob=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:i.sync,globStream:globStream,stream:i.stream,globStreamSync:globStreamSync,streamSync:i.streamSync,globIterate:globIterate,iterate:i.iterate,globIterateSync:globIterateSync,iterateSync:i.iterateSync,Glob:l.Glob,hasMagic:c.hasMagic,escape:a.escape,unescape:a.unescape});i.glob.glob=i.glob},2499:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Pattern=void 0;const a=o(542);const isPatternList=r=>r.length>=1;const isGlobList=r=>r.length>=1;class Pattern{#t;#e;#r;length;#i;#n;#s;#o;#a;#l;#c=true;constructor(r,i,o,a){if(!isPatternList(r)){throw new TypeError("empty pattern list")}if(!isGlobList(i)){throw new TypeError("empty glob list")}if(i.length!==r.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=r.length;if(o<0||o>=this.length){throw new TypeError("index out of range")}this.#t=r;this.#e=i;this.#r=o;this.#i=a;if(this.#r===0){if(this.isUNC()){const[r,i,o,a,...l]=this.#t;const[c,u,h,d,...p]=this.#e;if(l[0]===""){l.shift();p.shift()}const g=[r,i,o,a,""].join("/");const y=[c,u,h,d,""].join("/");this.#t=[g,...l];this.#e=[y,...p];this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){const[r,...i]=this.#t;const[o,...a]=this.#e;if(i[0]===""){i.shift();a.shift()}const l=r+"/";const c=o+"/";this.#t=[l,...i];this.#e=[c,...a];this.length=this.#t.length}}}pattern(){return this.#t[this.#r]}isString(){return typeof this.#t[this.#r]==="string"}isGlobstar(){return this.#t[this.#r]===a.GLOBSTAR}isRegExp(){return this.#t[this.#r]instanceof RegExp}globString(){return this.#s=this.#s||(this.#r===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){if(this.#n!==undefined)return this.#n;if(!this.hasMore())return this.#n=null;this.#n=new Pattern(this.#t,this.#e,this.#r+1,this.#i);this.#n.#l=this.#l;this.#n.#a=this.#a;this.#n.#o=this.#o;return this.#n}isUNC(){const r=this.#t;return this.#a!==undefined?this.#a:this.#a=this.#i==="win32"&&this.#r===0&&r[0]===""&&r[1]===""&&typeof r[2]==="string"&&!!r[2]&&typeof r[3]==="string"&&!!r[3]}isDrive(){const r=this.#t;return this.#o!==undefined?this.#o:this.#o=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof r[0]==="string"&&/^[a-z]:$/i.test(r[0])}isAbsolute(){const r=this.#t;return this.#l!==undefined?this.#l:this.#l=r[0]===""&&r.length>1||this.isDrive()||this.isUNC()}root(){const r=this.#t[0];return typeof r==="string"&&this.isAbsolute()&&this.#r===0?r:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){if(this.#r===0||!this.isGlobstar()||!this.#c)return false;this.#c=false;return true}}i.Pattern=Pattern},605:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.Processor=i.SubWalks=i.MatchRecord=i.HasWalkedCache=void 0;const a=o(542);class HasWalkedCache{store;constructor(r=new Map){this.store=r}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(r,i){return this.store.get(r.fullpath())?.has(i.globString())}storeWalked(r,i){const o=r.fullpath();const a=this.store.get(o);if(a)a.add(i.globString());else this.store.set(o,new Set([i.globString()]))}}i.HasWalkedCache=HasWalkedCache;class MatchRecord{store=new Map;add(r,i,o){const a=(i?2:0)|(o?1:0);const l=this.store.get(r);this.store.set(r,l===undefined?a:a&l)}entries(){return[...this.store.entries()].map((([r,i])=>[r,!!(i&2),!!(i&1)]))}}i.MatchRecord=MatchRecord;class SubWalks{store=new Map;add(r,i){if(!r.canReaddir()){return}const o=this.store.get(r);if(o){if(!o.find((r=>r.globString()===i.globString()))){o.push(i)}}else this.store.set(r,[i])}get(r){const i=this.store.get(r);if(!i){throw new Error("attempting to walk unknown path")}return i}entries(){return this.keys().map((r=>[r,this.store.get(r)]))}keys(){return[...this.store.keys()].filter((r=>r.canReaddir()))}}i.SubWalks=SubWalks;class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(r,i){this.opts=r;this.follow=!!r.follow;this.dot=!!r.dot;this.hasWalkedCache=i?i.copy():new HasWalkedCache}processPatterns(r,i){this.patterns=i;const o=i.map((i=>[r,i]));for(let[r,i]of o){this.hasWalkedCache.storeWalked(r,i);const o=i.root();const l=i.isAbsolute()&&this.opts.absolute!==false;if(o){r=r.resolve(o==="/"&&this.opts.root!==undefined?this.opts.root:o);const a=i.rest();if(!a){this.matches.add(r,true,false);continue}else{i=a}}if(r.isENOENT())continue;let c;let u;let h=false;while(typeof(c=i.pattern())==="string"&&(u=i.rest())){const o=r.resolve(c);r=o;i=u;h=true}c=i.pattern();u=i.rest();if(h){if(this.hasWalkedCache.hasWalked(r,i))continue;this.hasWalkedCache.storeWalked(r,i)}if(typeof c==="string"){const i=c===".."||c===""||c===".";this.matches.add(r.resolve(c),l,i);continue}else if(c===a.GLOBSTAR){if(!r.isSymbolicLink()||this.follow||i.checkFollowGlobstar()){this.subwalks.add(r,i)}const o=u?.pattern();const a=u?.rest();if(!u||(o===""||o===".")&&!a){this.matches.add(r,l,o===""||o===".")}else{if(o===".."){const i=r.parent||r;if(!a)this.matches.add(i,l,true);else if(!this.hasWalkedCache.hasWalked(i,a)){this.subwalks.add(i,a)}}}}else if(c instanceof RegExp){this.subwalks.add(r,i)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(r,i){const o=this.subwalks.get(r);const l=this.child();for(const r of i){for(const i of o){const o=i.isAbsolute();const c=i.pattern();const u=i.rest();if(c===a.GLOBSTAR){l.testGlobstar(r,i,u,o)}else if(c instanceof RegExp){l.testRegExp(r,c,u,o)}else{l.testString(r,c,u,o)}}}return l}testGlobstar(r,i,o,a){if(this.dot||!r.name.startsWith(".")){if(!i.hasMore()){this.matches.add(r,a,false)}if(r.canReaddir()){if(this.follow||!r.isSymbolicLink()){this.subwalks.add(r,i)}else if(r.isSymbolicLink()){if(o&&i.checkFollowGlobstar()){this.subwalks.add(r,o)}else if(i.markFollowGlobstar()){this.subwalks.add(r,i)}}}}if(o){const i=o.pattern();if(typeof i==="string"&&i!==".."&&i!==""&&i!=="."){this.testString(r,i,o.rest(),a)}else if(i===".."){const i=r.parent||r;this.subwalks.add(i,o)}else if(i instanceof RegExp){this.testRegExp(r,i,o.rest(),a)}}}testRegExp(r,i,o,a){if(!i.test(r.name))return;if(!o){this.matches.add(r,a,false)}else{this.subwalks.add(r,o)}}testString(r,i,o,a){if(!r.isNamed(i))return;if(!o){this.matches.add(r,a,false)}else{this.subwalks.add(r,o)}}}i.Processor=Processor},9660:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.GlobStream=i.GlobWalker=i.GlobUtil=void 0;const a=o(6014);const l=o(1975);const c=o(605);const makeIgnore=(r,i)=>typeof r==="string"?new l.Ignore([r],i):Array.isArray(r)?new l.Ignore(r,i):r;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#u=[];#h;#d;signal;maxDepth;includeChildMatches;constructor(r,i,o){this.patterns=r;this.path=i;this.opts=o;this.#d=!o.posix&&o.platform==="win32"?"\\":"/";this.includeChildMatches=o.includeChildMatches!==false;if(o.ignore||!this.includeChildMatches){this.#h=makeIgnore(o.ignore??[],o);if(!this.includeChildMatches&&typeof this.#h.add!=="function"){const r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}}this.maxDepth=o.maxDepth||Infinity;if(o.signal){this.signal=o.signal;this.signal.addEventListener("abort",(()=>{this.#u.length=0}))}}#f(r){return this.seen.has(r)||!!this.#h?.ignored?.(r)}#p(r){return!!this.#h?.childrenIgnored?.(r)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let r=undefined;while(!this.paused&&(r=this.#u.shift())){r()}}onResume(r){if(this.signal?.aborted)return;if(!this.paused){r()}else{this.#u.push(r)}}async matchCheck(r,i){if(i&&this.opts.nodir)return undefined;let o;if(this.opts.realpath){o=r.realpathCached()||await r.realpath();if(!o)return undefined;r=o}const a=r.isUnknown()||this.opts.stat;const l=a?await r.lstat():r;if(this.opts.follow&&this.opts.nodir&&l?.isSymbolicLink()){const r=await l.realpath();if(r&&(r.isUnknown()||this.opts.stat)){await r.lstat()}}return this.matchCheckTest(l,i)}matchCheckTest(r,i){return r&&(this.maxDepth===Infinity||r.depth()<=this.maxDepth)&&(!i||r.canReaddir())&&(!this.opts.nodir||!r.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!r.isSymbolicLink()||!r.realpathCached()?.isDirectory())&&!this.#f(r)?r:undefined}matchCheckSync(r,i){if(i&&this.opts.nodir)return undefined;let o;if(this.opts.realpath){o=r.realpathCached()||r.realpathSync();if(!o)return undefined;r=o}const a=r.isUnknown()||this.opts.stat;const l=a?r.lstatSync():r;if(this.opts.follow&&this.opts.nodir&&l?.isSymbolicLink()){const r=l.realpathSync();if(r&&(r?.isUnknown()||this.opts.stat)){r.lstatSync()}}return this.matchCheckTest(l,i)}matchFinish(r,i){if(this.#f(r))return;if(!this.includeChildMatches&&this.#h?.add){const i=`${r.relativePosix()}/**`;this.#h.add(i)}const o=this.opts.absolute===undefined?i:this.opts.absolute;this.seen.add(r);const a=this.opts.mark&&r.isDirectory()?this.#d:"";if(this.opts.withFileTypes){this.matchEmit(r)}else if(o){const i=this.opts.posix?r.fullpathPosix():r.fullpath();this.matchEmit(i+a)}else{const i=this.opts.posix?r.relativePosix():r.relative();const o=this.opts.dotRelative&&!i.startsWith(".."+this.#d)?"."+this.#d:"";this.matchEmit(!i?"."+a:o+i+a)}}async match(r,i,o){const a=await this.matchCheck(r,o);if(a)this.matchFinish(a,i)}matchSync(r,i,o){const a=this.matchCheckSync(r,o);if(a)this.matchFinish(a,i)}walkCB(r,i,o){if(this.signal?.aborted)o();this.walkCB2(r,i,new c.Processor(this.opts),o)}walkCB2(r,i,o,a){if(this.#p(r))return a();if(this.signal?.aborted)a();if(this.paused){this.onResume((()=>this.walkCB2(r,i,o,a)));return}o.processPatterns(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;l++;this.match(r,i,a).then((()=>next()))}for(const r of o.subwalkTargets()){if(this.maxDepth!==Infinity&&r.depth()>=this.maxDepth){continue}l++;const i=r.readdirCached();if(r.calledReaddir())this.walkCB3(r,i,o,next);else{r.readdirCB(((i,a)=>this.walkCB3(r,a,o,next)),true)}}next()}walkCB3(r,i,o,a){o=o.filterEntries(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;l++;this.match(r,i,a).then((()=>next()))}for(const[r,i]of o.subwalks.entries()){l++;this.walkCB2(r,i,o.child(),next)}next()}walkCBSync(r,i,o){if(this.signal?.aborted)o();this.walkCB2Sync(r,i,new c.Processor(this.opts),o)}walkCB2Sync(r,i,o,a){if(this.#p(r))return a();if(this.signal?.aborted)a();if(this.paused){this.onResume((()=>this.walkCB2Sync(r,i,o,a)));return}o.processPatterns(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;this.matchSync(r,i,a)}for(const r of o.subwalkTargets()){if(this.maxDepth!==Infinity&&r.depth()>=this.maxDepth){continue}l++;const i=r.readdirSync();this.walkCB3Sync(r,i,o,next)}next()}walkCB3Sync(r,i,o,a){o=o.filterEntries(r,i);let l=1;const next=()=>{if(--l===0)a()};for(const[r,i,a]of o.matches.entries()){if(this.#f(r))continue;this.matchSync(r,i,a)}for(const[r,i]of o.subwalks.entries()){l++;this.walkCB2Sync(r,i,o.child(),next)}next()}}i.GlobUtil=GlobUtil;class GlobWalker extends GlobUtil{matches=new Set;constructor(r,i,o){super(r,i,o)}matchEmit(r){this.matches.add(r)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((r,i)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){i(this.signal.reason)}else{r(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}i.GlobWalker=GlobWalker;class GlobStream extends GlobUtil{results;constructor(r,i,o){super(r,i,o);this.results=new a.Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(r){this.results.write(r);if(!this.results.flowing)this.pause()}stream(){const r=this.path;if(r.isUnknown()){r.lstat().then((()=>{this.walkCB(r,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(r,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}i.GlobStream=GlobStream},4004:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.assertValidPattern=void 0;const o=1024*64;const assertValidPattern=r=>{if(typeof r!=="string"){throw new TypeError("invalid pattern")}if(r.length>o){throw new TypeError("pattern is too long")}};i.assertValidPattern=assertValidPattern},8543:(r,i,o)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.AST=void 0;const a=o(9646);const l=o(5640);const c=new Set(["!","?","+","*","@"]);const isExtglobType=r=>c.has(r);const u="(?!(?:^|/)\\.\\.?(?:$|/))";const h="(?!\\.)";const d=new Set(["[","."]);const p=new Set(["..","."]);const g=new Set("().*{}+?[]^$\\!");const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const y="[^/]";const w=y+"*?";const b=y+"+?";class AST{type;#m;#g;#y=false;#w=[];#b;#v;#E;#x=false;#M;#D;#O=false;constructor(r,i,o={}){this.type=r;if(r)this.#g=true;this.#b=i;this.#m=this.#b?this.#b.#m:this;this.#M=this.#m===this?o:this.#m.#M;this.#E=this.#m===this?[]:this.#m.#E;if(r==="!"&&!this.#m.#x)this.#E.push(this);this.#v=this.#b?this.#b.#w.length:0}get hasMagic(){if(this.#g!==undefined)return this.#g;for(const r of this.#w){if(typeof r==="string")continue;if(r.type||r.hasMagic)return this.#g=true}return this.#g}toString(){if(this.#D!==undefined)return this.#D;if(!this.type){return this.#D=this.#w.map((r=>String(r))).join("")}else{return this.#D=this.type+"("+this.#w.map((r=>String(r))).join("|")+")"}}#T(){if(this!==this.#m)throw new Error("should only call on root");if(this.#x)return this;this.toString();this.#x=true;let r;while(r=this.#E.pop()){if(r.type!=="!")continue;let i=r;let o=i.#b;while(o){for(let a=i.#v+1;!o.type&&a<o.#w.length;a++){for(const i of r.#w){if(typeof i==="string"){throw new Error("string part in extglob AST??")}i.copyIn(o.#w[a])}}i=o;o=i.#b}}return this}push(...r){for(const i of r){if(i==="")continue;if(typeof i!=="string"&&!(i instanceof AST&&i.#b===this)){throw new Error("invalid part: "+i)}this.#w.push(i)}}toJSON(){const r=this.type===null?this.#w.slice().map((r=>typeof r==="string"?r:r.toJSON())):[this.type,...this.#w.map((r=>r.toJSON()))];if(this.isStart()&&!this.type)r.unshift([]);if(this.isEnd()&&(this===this.#m||this.#m.#x&&this.#b?.type==="!")){r.push({})}return r}isStart(){if(this.#m===this)return true;if(!this.#b?.isStart())return false;if(this.#v===0)return true;const r=this.#b;for(let i=0;i<this.#v;i++){const o=r.#w[i];if(!(o instanceof AST&&o.type==="!")){return false}}return true}isEnd(){if(this.#m===this)return true;if(this.#b?.type==="!")return true;if(!this.#b?.isEnd())return false;if(!this.type)return this.#b?.isEnd();const r=this.#b?this.#b.#w.length:0;return this.#v===r-1}copyIn(r){if(typeof r==="string")this.push(r);else this.push(r.clone(this))}clone(r){const i=new AST(this.type,r);for(const r of this.#w){i.copyIn(r)}return i}static#S(r,i,o,a){let l=false;let c=false;let u=-1;let h=false;if(i.type===null){let d=o;let p="";while(d<r.length){const o=r.charAt(d++);if(l||o==="\\"){l=!l;p+=o;continue}if(c){if(d===u+1){if(o==="^"||o==="!"){h=true}}else if(o==="]"&&!(d===u+2&&h)){c=false}p+=o;continue}else if(o==="["){c=true;u=d;h=false;p+=o;continue}if(!a.noext&&isExtglobType(o)&&r.charAt(d)==="("){i.push(p);p="";const l=new AST(o,i);d=AST.#S(r,l,d,a);i.push(l);continue}p+=o}i.push(p);return d}let d=o+1;let p=new AST(null,i);const g=[];let y="";while(d<r.length){const o=r.charAt(d++);if(l||o==="\\"){l=!l;y+=o;continue}if(c){if(d===u+1){if(o==="^"||o==="!"){h=true}}else if(o==="]"&&!(d===u+2&&h)){c=false}y+=o;continue}else if(o==="["){c=true;u=d;h=false;y+=o;continue}if(isExtglobType(o)&&r.charAt(d)==="("){p.push(y);y="";const i=new AST(o,p);p.push(i);d=AST.#S(r,i,d,a);continue}if(o==="|"){p.push(y);y="";g.push(p);p=new AST(null,i);continue}if(o===")"){if(y===""&&i.#w.length===0){i.#O=true}p.push(y);y="";i.push(...g,p);return d}y+=o}i.type=null;i.#g=undefined;i.#w=[r.substring(o-1)];return d}static fromGlob(r,i={}){const o=new AST(null,undefined,i);AST.#S(r,o,0,i);return o}toMMPattern(){if(this!==this.#m)return this.#m.toMMPattern();const r=this.toString();const[i,o,a,l]=this.toRegExpSource();const c=a||this.#g||this.#M.nocase&&!this.#M.nocaseMagicOnly&&r.toUpperCase()!==r.toLowerCase();if(!c){return o}const u=(this.#M.nocase?"i":"")+(l?"u":"");return Object.assign(new RegExp(`^${i}$`,u),{_src:i,_glob:r})}get options(){return this.#M}toRegExpSource(r){const i=r??!!this.#M.dot;if(this.#m===this)this.#T();if(!this.type){const o=this.isStart()&&this.isEnd();const a=this.#w.map((i=>{const[a,l,c,u]=typeof i==="string"?AST.#A(i,this.#g,o):i.toRegExpSource(r);this.#g=this.#g||c;this.#y=this.#y||u;return a})).join("");let c="";if(this.isStart()){if(typeof this.#w[0]==="string"){const o=this.#w.length===1&&p.has(this.#w[0]);if(!o){const o=d;const l=i&&o.has(a.charAt(0))||a.startsWith("\\.")&&o.has(a.charAt(2))||a.startsWith("\\.\\.")&&o.has(a.charAt(4));const p=!i&&!r&&o.has(a.charAt(0));c=l?u:p?h:""}}}let g="";if(this.isEnd()&&this.#m.#x&&this.#b?.type==="!"){g="(?:$|\\/)"}const y=c+a+g;return[y,(0,l.unescape)(a),this.#g=!!this.#g,this.#y]}const o=this.type==="*"||this.type==="+";const a=this.type==="!"?"(?:(?!(?:":"(?:";let c=this.#N(i);if(this.isStart()&&this.isEnd()&&!c&&this.type!=="!"){const r=this.toString();this.#w=[r];this.type=null;this.#g=undefined;return[r,(0,l.unescape)(this.toString()),false,false]}let g=!o||r||i||!h?"":this.#N(true);if(g===c){g=""}if(g){c=`(?:${c})(?:${g})*?`}let y="";if(this.type==="!"&&this.#O){y=(this.isStart()&&!i?h:"")+b}else{const o=this.type==="!"?"))"+(this.isStart()&&!i&&!r?h:"")+w+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&g?")":this.type==="*"&&g?`)?`:`)${this.type}`;y=a+c+o}return[y,(0,l.unescape)(c),this.#g=!!this.#g,this.#y]}#N(r){return this.#w.map((i=>{if(typeof i==="string"){throw new Error("string type in extglob ast??")}const[o,a,l,c]=i.toRegExpSource(r);this.#y=this.#y||c;return o})).filter((r=>!(this.isStart()&&this.isEnd())||!!r)).join("|")}static#A(r,i,o=false){let c=false;let u="";let h=false;for(let l=0;l<r.length;l++){const d=r.charAt(l);if(c){c=false;u+=(g.has(d)?"\\":"")+d;continue}if(d==="\\"){if(l===r.length-1){u+="\\\\"}else{c=true}continue}if(d==="["){const[o,c,d,p]=(0,a.parseClass)(r,l);if(d){u+=o;h=h||c;l+=d-1;i=i||p;continue}}if(d==="*"){if(o&&r==="*")u+=b;else u+=w;i=true;continue}if(d==="?"){u+=y;i=true;continue}u+=regExpEscape(d)}return[u,(0,l.unescape)(r),!!i,h]}}i.AST=AST},9646:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.parseClass=void 0;const o={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=r=>r.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=r=>r.join("");const parseClass=(r,i)=>{const a=i;if(r.charAt(a)!=="["){throw new Error("not in a brace expression")}const l=[];const c=[];let u=a+1;let h=false;let d=false;let p=false;let g=false;let y=a;let w="";t:while(u<r.length){const i=r.charAt(u);if((i==="!"||i==="^")&&u===a+1){g=true;u++;continue}if(i==="]"&&h&&!p){y=u+1;break}h=true;if(i==="\\"){if(!p){p=true;u++;continue}}if(i==="["&&!p){for(const[i,[h,p,g]]of Object.entries(o)){if(r.startsWith(i,u)){if(w){return["$.",false,r.length-a,true]}u+=i.length;if(g)c.push(h);else l.push(h);d=d||p;continue t}}}p=false;if(w){if(i>w){l.push(braceEscape(w)+"-"+braceEscape(i))}else if(i===w){l.push(braceEscape(i))}w="";u++;continue}if(r.startsWith("-]",u+1)){l.push(braceEscape(i+"-"));u+=2;continue}if(r.startsWith("-",u+1)){w=i;u+=2;continue}l.push(braceEscape(i));u++}if(y<u){return["",false,0,false]}if(!l.length&&!c.length){return["$.",false,r.length-a,true]}if(c.length===0&&l.length===1&&/^\\?.$/.test(l[0])&&!g){const r=l[0].length===2?l[0].slice(-1):l[0];return[regexpEscape(r),false,y-a,false]}const b="["+(g?"^":"")+rangesToString(l)+"]";const v="["+(g?"":"^")+rangesToString(c)+"]";const E=l.length&&c.length?"("+b+"|"+v+")":l.length?b:v;return[E,d,y-a,true]};i.parseClass=parseClass},7504:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.escape=void 0;const escape=(r,{windowsPathsNoEscape:i=false}={})=>i?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");i.escape=escape},542:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.unescape=i.escape=i.AST=i.Minimatch=i.match=i.makeRe=i.braceExpand=i.defaults=i.filter=i.GLOBSTAR=i.sep=i.minimatch=void 0;const l=a(o(2297));const c=o(4004);const u=o(8543);const h=o(7504);const d=o(5640);const minimatch=(r,i,o={})=>{(0,c.assertValidPattern)(i);if(!o.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,o).match(r)};i.minimatch=minimatch;const p=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=r=>i=>!i.startsWith(".")&&i.endsWith(r);const starDotExtTestDot=r=>i=>i.endsWith(r);const starDotExtTestNocase=r=>{r=r.toLowerCase();return i=>!i.startsWith(".")&&i.toLowerCase().endsWith(r)};const starDotExtTestNocaseDot=r=>{r=r.toLowerCase();return i=>i.toLowerCase().endsWith(r)};const g=/^\*+\.\*+$/;const starDotStarTest=r=>!r.startsWith(".")&&r.includes(".");const starDotStarTestDot=r=>r!=="."&&r!==".."&&r.includes(".");const y=/^\.\*+$/;const dotStarTest=r=>r!=="."&&r!==".."&&r.startsWith(".");const w=/^\*+$/;const starTest=r=>r.length!==0&&!r.startsWith(".");const starTestDot=r=>r.length!==0&&r!=="."&&r!=="..";const b=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([r,i=""])=>{const o=qmarksTestNoExt([r]);if(!i)return o;i=i.toLowerCase();return r=>o(r)&&r.toLowerCase().endsWith(i)};const qmarksTestNocaseDot=([r,i=""])=>{const o=qmarksTestNoExtDot([r]);if(!i)return o;i=i.toLowerCase();return r=>o(r)&&r.toLowerCase().endsWith(i)};const qmarksTestDot=([r,i=""])=>{const o=qmarksTestNoExtDot([r]);return!i?o:r=>o(r)&&r.endsWith(i)};const qmarksTest=([r,i=""])=>{const o=qmarksTestNoExt([r]);return!i?o:r=>o(r)&&r.endsWith(i)};const qmarksTestNoExt=([r])=>{const i=r.length;return r=>r.length===i&&!r.startsWith(".")};const qmarksTestNoExtDot=([r])=>{const i=r.length;return r=>r.length===i&&r!=="."&&r!==".."};const v=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const E={win32:{sep:"\\"},posix:{sep:"/"}};i.sep=v==="win32"?E.win32.sep:E.posix.sep;i.minimatch.sep=i.sep;i.GLOBSTAR=Symbol("globstar **");i.minimatch.GLOBSTAR=i.GLOBSTAR;const x="[^/]";const M=x+"*?";const D="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const O="(?:(?!(?:\\/|^)\\.).)*?";const filter=(r,o={})=>a=>(0,i.minimatch)(a,r,o);i.filter=filter;i.minimatch.filter=i.filter;const ext=(r,i={})=>Object.assign({},r,i);const defaults=r=>{if(!r||typeof r!=="object"||!Object.keys(r).length){return i.minimatch}const o=i.minimatch;const m=(i,a,l={})=>o(i,a,ext(r,l));return Object.assign(m,{Minimatch:class Minimatch extends o.Minimatch{constructor(i,o={}){super(i,ext(r,o))}static defaults(i){return o.defaults(ext(r,i)).Minimatch}},AST:class AST extends o.AST{constructor(i,o,a={}){super(i,o,ext(r,a))}static fromGlob(i,a={}){return o.AST.fromGlob(i,ext(r,a))}},unescape:(i,a={})=>o.unescape(i,ext(r,a)),escape:(i,a={})=>o.escape(i,ext(r,a)),filter:(i,a={})=>o.filter(i,ext(r,a)),defaults:i=>o.defaults(ext(r,i)),makeRe:(i,a={})=>o.makeRe(i,ext(r,a)),braceExpand:(i,a={})=>o.braceExpand(i,ext(r,a)),match:(i,a,l={})=>o.match(i,a,ext(r,l)),sep:o.sep,GLOBSTAR:i.GLOBSTAR})};i.defaults=defaults;i.minimatch.defaults=i.defaults;const braceExpand=(r,i={})=>{(0,c.assertValidPattern)(r);if(i.nobrace||!/\{(?:(?!\{).)*\}/.test(r)){return[r]}return(0,l.default)(r)};i.braceExpand=braceExpand;i.minimatch.braceExpand=i.braceExpand;const makeRe=(r,i={})=>new Minimatch(r,i).makeRe();i.makeRe=makeRe;i.minimatch.makeRe=i.makeRe;const match=(r,i,o={})=>{const a=new Minimatch(i,o);r=r.filter((r=>a.match(r)));if(a.options.nonull&&!r.length){r.push(i)}return r};i.match=match;i.minimatch.match=i.match;const T=/[?*]|[+@!]\(.*?\)|\[|\]/;const regExpEscape=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(r,i={}){(0,c.assertValidPattern)(r);i=i||{};this.options=i;this.pattern=r;this.platform=i.platform||v;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!i.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!i.nonegate;this.comment=false;this.empty=false;this.partial=!!i.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=i.windowsNoMagicRoot!==undefined?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const r of this.set){for(const i of r){if(typeof i!=="string")return true}}return false}debug(...r){}make(){const r=this.pattern;const i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(i.debug){this.debug=(...r)=>console.error(...r)}this.debug(this.pattern,this.globSet);const o=this.globSet.map((r=>this.slashSplit(r)));this.globParts=this.preprocess(o);this.debug(this.pattern,this.globParts);let a=this.globParts.map(((r,i,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){const i=r[0]===""&&r[1]===""&&(r[2]==="?"||!T.test(r[2]))&&!T.test(r[3]);const o=/^[a-z]:/i.test(r[0]);if(i){return[...r.slice(0,4),...r.slice(4).map((r=>this.parse(r)))]}else if(o){return[r[0],...r.slice(1).map((r=>this.parse(r)))]}}return r.map((r=>this.parse(r)))}));this.debug(this.pattern,a);this.set=a.filter((r=>r.indexOf(false)===-1));if(this.isWindows){for(let r=0;r<this.set.length;r++){const i=this.set[r];if(i[0]===""&&i[1]===""&&this.globParts[r][2]==="?"&&typeof i[3]==="string"&&/^[a-z]:$/i.test(i[3])){i[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(r){if(this.options.noglobstar){for(let i=0;i<r.length;i++){for(let o=0;o<r[i].length;o++){if(r[i][o]==="**"){r[i][o]="*"}}}}const{optimizationLevel:i=1}=this.options;if(i>=2){r=this.firstPhasePreProcess(r);r=this.secondPhasePreProcess(r)}else if(i>=1){r=this.levelOneOptimize(r)}else{r=this.adjascentGlobstarOptimize(r)}return r}adjascentGlobstarOptimize(r){return r.map((r=>{let i=-1;while(-1!==(i=r.indexOf("**",i+1))){let o=i;while(r[o+1]==="**"){o++}if(o!==i){r.splice(i,o-i)}}return r}))}levelOneOptimize(r){return r.map((r=>{r=r.reduce(((r,i)=>{const o=r[r.length-1];if(i==="**"&&o==="**"){return r}if(i===".."){if(o&&o!==".."&&o!=="."&&o!=="**"){r.pop();return r}}r.push(i);return r}),[]);return r.length===0?[""]:r}))}levelTwoFileOptimize(r){if(!Array.isArray(r)){r=this.slashSplit(r)}let i=false;do{i=false;if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){const a=r[o];if(o===1&&a===""&&r[0]==="")continue;if(a==="."||a===""){i=true;r.splice(o,1);o--}}if(r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")){i=true;r.pop()}}let o=0;while(-1!==(o=r.indexOf("..",o+1))){const a=r[o-1];if(a&&a!=="."&&a!==".."&&a!=="**"){i=true;r.splice(o-1,2);o-=2}}}while(i);return r.length===0?[""]:r}firstPhasePreProcess(r){let i=false;do{i=false;for(let o of r){let a=-1;while(-1!==(a=o.indexOf("**",a+1))){let l=a;while(o[l+1]==="**"){l++}if(l>a){o.splice(a+1,l-a)}let c=o[a+1];const u=o[a+2];const h=o[a+3];if(c!=="..")continue;if(!u||u==="."||u===".."||!h||h==="."||h===".."){continue}i=true;o.splice(a,1);const d=o.slice(0);d[a]="**";r.push(d);a--}if(!this.preserveMultipleSlashes){for(let r=1;r<o.length-1;r++){const a=o[r];if(r===1&&a===""&&o[0]==="")continue;if(a==="."||a===""){i=true;o.splice(r,1);r--}}if(o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")){i=true;o.pop()}}let l=0;while(-1!==(l=o.indexOf("..",l+1))){const r=o[l-1];if(r&&r!=="."&&r!==".."&&r!=="**"){i=true;const r=l===1&&o[l+1]==="**";const a=r?["."]:[];o.splice(l-1,2,...a);if(o.length===0)o.push("");l-=2}}}}while(i);return r}secondPhasePreProcess(r){for(let i=0;i<r.length-1;i++){for(let o=i+1;o<r.length;o++){const a=this.partsMatch(r[i],r[o],!this.preserveMultipleSlashes);if(a){r[i]=[];r[o]=a;break}}}return r.filter((r=>r.length))}partsMatch(r,i,o=false){let a=0;let l=0;let c=[];let u="";while(a<r.length&&l<i.length){if(r[a]===i[l]){c.push(u==="b"?i[l]:r[a]);a++;l++}else if(o&&r[a]==="**"&&i[l]===r[a+1]){c.push(r[a]);a++}else if(o&&i[l]==="**"&&r[a]===i[l+1]){c.push(i[l]);l++}else if(r[a]==="*"&&i[l]&&(this.options.dot||!i[l].startsWith("."))&&i[l]!=="**"){if(u==="b")return false;u="a";c.push(r[a]);a++;l++}else if(i[l]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(u==="a")return false;u="b";c.push(i[l]);a++;l++}else{return false}}return r.length===i.length&&c}parseNegate(){if(this.nonegate)return;const r=this.pattern;let i=false;let o=0;for(let a=0;a<r.length&&r.charAt(a)==="!";a++){i=!i;o++}if(o)this.pattern=r.slice(o);this.negate=i}matchOne(r,o,a=false){const l=this.options;if(this.isWindows){const i=typeof r[0]==="string"&&/^[a-z]:$/i.test(r[0]);const a=!i&&r[0]===""&&r[1]===""&&r[2]==="?"&&/^[a-z]:$/i.test(r[3]);const l=typeof o[0]==="string"&&/^[a-z]:$/i.test(o[0]);const c=!l&&o[0]===""&&o[1]===""&&o[2]==="?"&&typeof o[3]==="string"&&/^[a-z]:$/i.test(o[3]);const u=a?3:i?0:undefined;const h=c?3:l?0:undefined;if(typeof u==="number"&&typeof h==="number"){const[i,a]=[r[u],o[h]];if(i.toLowerCase()===a.toLowerCase()){o[h]=i;if(h>u){o=o.slice(h)}else if(u>h){r=r.slice(u)}}}}const{optimizationLevel:c=1}=this.options;if(c>=2){r=this.levelTwoFileOptimize(r)}this.debug("matchOne",this,{file:r,pattern:o});this.debug("matchOne",r.length,o.length);for(var u=0,h=0,d=r.length,p=o.length;u<d&&h<p;u++,h++){this.debug("matchOne loop");var g=o[h];var y=r[u];this.debug(o,g,y);if(g===false){return false}if(g===i.GLOBSTAR){this.debug("GLOBSTAR",[o,g,y]);var w=u;var b=h+1;if(b===p){this.debug("** at the end");for(;u<d;u++){if(r[u]==="."||r[u]===".."||!l.dot&&r[u].charAt(0)===".")return false}return true}while(w<d){var v=r[w];this.debug("\nglobstar while",r,w,o,b,v);if(this.matchOne(r.slice(w),o.slice(b),a)){this.debug("globstar found match!",w,d,v);return true}else{if(v==="."||v===".."||!l.dot&&v.charAt(0)==="."){this.debug("dot detected!",r,w,o,b);break}this.debug("globstar swallow a segment, and continue");w++}}if(a){this.debug("\n>>> no match, partial?",r,w,o,b);if(w===d){return true}}return false}let c;if(typeof g==="string"){c=y===g;this.debug("string match",g,y,c)}else{c=g.test(y);this.debug("pattern match",g,y,c)}if(!c)return false}if(u===d&&h===p){return true}else if(u===d){return a}else if(h===p){return u===d-1&&r[u]===""}else{throw new Error("wtf?")}}braceExpand(){return(0,i.braceExpand)(this.pattern,this.options)}parse(r){(0,c.assertValidPattern)(r);const o=this.options;if(r==="**")return i.GLOBSTAR;if(r==="")return"";let a;let l=null;if(a=r.match(w)){l=o.dot?starTestDot:starTest}else if(a=r.match(p)){l=(o.nocase?o.dot?starDotExtTestNocaseDot:starDotExtTestNocase:o.dot?starDotExtTestDot:starDotExtTest)(a[1])}else if(a=r.match(b)){l=(o.nocase?o.dot?qmarksTestNocaseDot:qmarksTestNocase:o.dot?qmarksTestDot:qmarksTest)(a)}else if(a=r.match(g)){l=o.dot?starDotStarTestDot:starDotStarTest}else if(a=r.match(y)){l=dotStarTest}const h=u.AST.fromGlob(r,this.options).toMMPattern();if(l&&typeof h==="object"){Reflect.defineProperty(h,"test",{value:l})}return h}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const r=this.set;if(!r.length){this.regexp=false;return this.regexp}const o=this.options;const a=o.noglobstar?M:o.dot?D:O;const l=new Set(o.nocase?["i"]:[]);let c=r.map((r=>{const o=r.map((r=>{if(r instanceof RegExp){for(const i of r.flags.split(""))l.add(i)}return typeof r==="string"?regExpEscape(r):r===i.GLOBSTAR?i.GLOBSTAR:r._src}));o.forEach(((r,l)=>{const c=o[l+1];const u=o[l-1];if(r!==i.GLOBSTAR||u===i.GLOBSTAR){return}if(u===undefined){if(c!==undefined&&c!==i.GLOBSTAR){o[l+1]="(?:\\/|"+a+"\\/)?"+c}else{o[l]=a}}else if(c===undefined){o[l-1]=u+"(?:\\/|"+a+")?"}else if(c!==i.GLOBSTAR){o[l-1]=u+"(?:\\/|\\/"+a+"\\/)"+c;o[l+1]=i.GLOBSTAR}}));return o.filter((r=>r!==i.GLOBSTAR)).join("/")})).join("|");const[u,h]=r.length>1?["(?:",")"]:["",""];c="^"+u+c+h+"$";if(this.negate)c="^(?!"+c+").+$";try{this.regexp=new RegExp(c,[...l].join(""))}catch(r){this.regexp=false}return this.regexp}slashSplit(r){if(this.preserveMultipleSlashes){return r.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(r)){return["",...r.split(/\/+/)]}else{return r.split(/\/+/)}}match(r,i=this.partial){this.debug("match",r,this.pattern);if(this.comment){return false}if(this.empty){return r===""}if(r==="/"&&i){return true}const o=this.options;if(this.isWindows){r=r.split("\\").join("/")}const a=this.slashSplit(r);this.debug(this.pattern,"split",a);const l=this.set;this.debug(this.pattern,"set",l);let c=a[a.length-1];if(!c){for(let r=a.length-2;!c&&r>=0;r--){c=a[r]}}for(let r=0;r<l.length;r++){const u=l[r];let h=a;if(o.matchBase&&u.length===1){h=[c]}const d=this.matchOne(h,u,i);if(d){if(o.flipNegate){return true}return!this.negate}}if(o.flipNegate){return false}return this.negate}static defaults(r){return i.minimatch.defaults(r).Minimatch}}i.Minimatch=Minimatch;var S=o(8543);Object.defineProperty(i,"AST",{enumerable:true,get:function(){return S.AST}});var A=o(7504);Object.defineProperty(i,"escape",{enumerable:true,get:function(){return A.escape}});var N=o(5640);Object.defineProperty(i,"unescape",{enumerable:true,get:function(){return N.unescape}});i.minimatch.AST=u.AST;i.minimatch.Minimatch=Minimatch;i.minimatch.escape=h.escape;i.minimatch.unescape=d.unescape},5640:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.unescape=void 0;const unescape=(r,{windowsPathsNoEscape:i=false}={})=>i?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");i.unescape=unescape},3576:(r,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:true});i.LRUCache=void 0;const o=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const a=new Set;const l=typeof process==="object"&&!!process?process:{};const emitWarning=(r,i,o,a)=>{typeof l.emitWarning==="function"?l.emitWarning(r,i,o,a):console.error(`[${o}] ${i}: ${r}`)};let c=globalThis.AbortController;let u=globalThis.AbortSignal;if(typeof c==="undefined"){u=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(r,i){this._onabort.push(i)}};c=class AbortController{constructor(){warnACPolyfill()}signal=new u;abort(r){if(this.signal.aborted)return;this.signal.reason=r;this.signal.aborted=true;for(const i of this.signal._onabort){i(r)}this.signal.onabort?.(r)}};let r=l.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!r)return;r=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=r=>!a.has(r);const h=Symbol("type");const isPosInt=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r);const getUintArray=r=>!isPosInt(r)?null:r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(r){super(r);this.fill(0)}}class Stack{heap;length;static#_=false;static create(r){const i=getUintArray(r);if(!i)return[];Stack.#_=true;const o=new Stack(r,i);Stack.#_=false;return o}constructor(r,i){if(!Stack.#_){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new i(r);this.length=0}push(r){this.heap[this.length++]=r}pop(){return this.heap[--this.length]}}class LRUCache{#C;#L;#P;#I;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#R;#F;#j;#X;#B;#$;#U;#V;#q;#W;#G;#H;#z;#Y;#K;#Z;#J;static unsafeExposeInternals(r){return{starts:r.#z,ttls:r.#Y,sizes:r.#H,keyMap:r.#j,keyList:r.#X,valList:r.#B,next:r.#$,prev:r.#U,get head(){return r.#V},get tail(){return r.#q},free:r.#W,isBackgroundFetch:i=>r.#Q(i),backgroundFetch:(i,o,a,l)=>r.#tt(i,o,a,l),moveToTail:i=>r.#et(i),indexes:i=>r.#rt(i),rindexes:i=>r.#it(i),isStale:i=>r.#nt(i)}}get max(){return this.#C}get maxSize(){return this.#L}get calculatedSize(){return this.#F}get size(){return this.#R}get fetchMethod(){return this.#k}get dispose(){return this.#P}get disposeAfter(){return this.#I}constructor(r){const{max:i=0,ttl:o,ttlResolution:l=1,ttlAutopurge:c,updateAgeOnGet:u,updateAgeOnHas:h,allowStale:d,dispose:p,disposeAfter:g,noDisposeOnSet:y,noUpdateTTL:w,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:E,fetchMethod:x,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:T,ignoreFetchAbort:S}=r;if(i!==0&&!isPosInt(i)){throw new TypeError("max option must be a nonnegative integer")}const A=i?getUintArray(i):Array;if(!A){throw new Error("invalid max value: "+i)}this.#C=i;this.#L=b;this.maxEntrySize=v||this.#L;this.sizeCalculation=E;if(this.sizeCalculation){if(!this.#L&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(x!==undefined&&typeof x!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#k=x;this.#Z=!!x;this.#j=new Map;this.#X=new Array(i).fill(undefined);this.#B=new Array(i).fill(undefined);this.#$=new A(i);this.#U=new A(i);this.#V=0;this.#q=0;this.#W=Stack.create(i);this.#R=0;this.#F=0;if(typeof p==="function"){this.#P=p}if(typeof g==="function"){this.#I=g;this.#G=[]}else{this.#I=undefined;this.#G=undefined}this.#K=!!this.#P;this.#J=!!this.#I;this.noDisposeOnSet=!!y;this.noUpdateTTL=!!w;this.noDeleteOnFetchRejection=!!M;this.allowStaleOnFetchRejection=!!O;this.allowStaleOnFetchAbort=!!T;this.ignoreFetchAbort=!!S;if(this.maxEntrySize!==0){if(this.#L!==0){if(!isPosInt(this.#L)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#st()}this.allowStale=!!d;this.noDeleteOnStaleGet=!!D;this.updateAgeOnGet=!!u;this.updateAgeOnHas=!!h;this.ttlResolution=isPosInt(l)||l===0?l:1;this.ttlAutopurge=!!c;this.ttl=o||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#ot()}if(this.#C===0&&this.ttl===0&&this.#L===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#C&&!this.#L){const r="LRU_CACHE_UNBOUNDED";if(shouldWarn(r)){a.add(r);const i="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(i,"UnboundedCacheWarning",r,LRUCache)}}}getRemainingTTL(r){return this.#j.has(r)?Infinity:0}#ot(){const r=new ZeroArray(this.#C);const i=new ZeroArray(this.#C);this.#Y=r;this.#z=i;this.#at=(a,l,c=o.now())=>{i[a]=l!==0?c:0;r[a]=l;if(l!==0&&this.ttlAutopurge){const r=setTimeout((()=>{if(this.#nt(a)){this.delete(this.#X[a])}}),l+1);if(r.unref){r.unref()}}};this.#lt=a=>{i[a]=r[a]!==0?o.now():0};this.#ct=(o,l)=>{if(r[l]){const c=r[l];const u=i[l];if(!c||!u)return;o.ttl=c;o.start=u;o.now=a||getNow();const h=o.now-u;o.remainingTTL=c-h}};let a=0;const getNow=()=>{const r=o.now();if(this.ttlResolution>0){a=r;const i=setTimeout((()=>a=0),this.ttlResolution);if(i.unref){i.unref()}}return r};this.getRemainingTTL=o=>{const l=this.#j.get(o);if(l===undefined){return 0}const c=r[l];const u=i[l];if(!c||!u){return Infinity}const h=(a||getNow())-u;return c-h};this.#nt=o=>{const l=i[o];const c=r[o];return!!c&&!!l&&(a||getNow())-l>c}}#lt=()=>{};#ct=()=>{};#at=()=>{};#nt=()=>false;#st(){const r=new ZeroArray(this.#C);this.#F=0;this.#H=r;this.#ut=i=>{this.#F-=r[i];r[i]=0};this.#ht=(r,i,o,a)=>{if(this.#Q(i)){return 0}if(!isPosInt(o)){if(a){if(typeof a!=="function"){throw new TypeError("sizeCalculation must be a function")}o=a(i,r);if(!isPosInt(o)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return o};this.#dt=(i,o,a)=>{r[i]=o;if(this.#L){const o=this.#L-r[i];while(this.#F>o){this.#ft(true)}}this.#F+=r[i];if(a){a.entrySize=o;a.totalCalculatedSize=this.#F}}}#ut=r=>{};#dt=(r,i,o)=>{};#ht=(r,i,o,a)=>{if(o||a){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#rt({allowStale:r=this.allowStale}={}){if(this.#R){for(let i=this.#q;true;){if(!this.#pt(i)){break}if(r||!this.#nt(i)){yield i}if(i===this.#V){break}else{i=this.#U[i]}}}}*#it({allowStale:r=this.allowStale}={}){if(this.#R){for(let i=this.#V;true;){if(!this.#pt(i)){break}if(r||!this.#nt(i)){yield i}if(i===this.#q){break}else{i=this.#$[i]}}}}#pt(r){return r!==undefined&&this.#j.get(this.#X[r])===r}*entries(){for(const r of this.#rt()){if(this.#B[r]!==undefined&&this.#X[r]!==undefined&&!this.#Q(this.#B[r])){yield[this.#X[r],this.#B[r]]}}}*rentries(){for(const r of this.#it()){if(this.#B[r]!==undefined&&this.#X[r]!==undefined&&!this.#Q(this.#B[r])){yield[this.#X[r],this.#B[r]]}}}*keys(){for(const r of this.#rt()){const i=this.#X[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield i}}}*rkeys(){for(const r of this.#it()){const i=this.#X[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield i}}}*values(){for(const r of this.#rt()){const i=this.#B[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield this.#B[r]}}}*rvalues(){for(const r of this.#it()){const i=this.#B[r];if(i!==undefined&&!this.#Q(this.#B[r])){yield this.#B[r]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(r,i={}){for(const o of this.#rt()){const a=this.#B[o];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)continue;if(r(l,this.#X[o],this)){return this.get(this.#X[o],i)}}}forEach(r,i=this){for(const o of this.#rt()){const a=this.#B[o];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)continue;r.call(i,l,this.#X[o],this)}}rforEach(r,i=this){for(const o of this.#it()){const a=this.#B[o];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)continue;r.call(i,l,this.#X[o],this)}}purgeStale(){let r=false;for(const i of this.#it({allowStale:true})){if(this.#nt(i)){this.delete(this.#X[i]);r=true}}return r}info(r){const i=this.#j.get(r);if(i===undefined)return undefined;const a=this.#B[i];const l=this.#Q(a)?a.__staleWhileFetching:a;if(l===undefined)return undefined;const c={value:l};if(this.#Y&&this.#z){const r=this.#Y[i];const a=this.#z[i];if(r&&a){const i=r-(o.now()-a);c.ttl=i;c.start=Date.now()}}if(this.#H){c.size=this.#H[i]}return c}dump(){const r=[];for(const i of this.#rt({allowStale:true})){const a=this.#X[i];const l=this.#B[i];const c=this.#Q(l)?l.__staleWhileFetching:l;if(c===undefined||a===undefined)continue;const u={value:c};if(this.#Y&&this.#z){u.ttl=this.#Y[i];const r=o.now()-this.#z[i];u.start=Math.floor(Date.now()-r)}if(this.#H){u.size=this.#H[i]}r.unshift([a,u])}return r}load(r){this.clear();for(const[i,a]of r){if(a.start){const r=Date.now()-a.start;a.start=o.now()-r}this.set(i,a.value,a)}}set(r,i,o={}){if(i===undefined){this.delete(r);return this}const{ttl:a=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:h}=o;let{noUpdateTTL:d=this.noUpdateTTL}=o;const p=this.#ht(r,i,o.size||0,u);if(this.maxEntrySize&&p>this.maxEntrySize){if(h){h.set="miss";h.maxEntrySizeExceeded=true}this.delete(r);return this}let g=this.#R===0?undefined:this.#j.get(r);if(g===undefined){g=this.#R===0?this.#q:this.#W.length!==0?this.#W.pop():this.#R===this.#C?this.#ft(false):this.#R;this.#X[g]=r;this.#B[g]=i;this.#j.set(r,g);this.#$[this.#q]=g;this.#U[g]=this.#q;this.#q=g;this.#R++;this.#dt(g,p,h);if(h)h.set="add";d=false}else{this.#et(g);const o=this.#B[g];if(i!==o){if(this.#Z&&this.#Q(o)){o.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:i}=o;if(i!==undefined&&!c){if(this.#K){this.#P?.(i,r,"set")}if(this.#J){this.#G?.push([i,r,"set"])}}}else if(!c){if(this.#K){this.#P?.(o,r,"set")}if(this.#J){this.#G?.push([o,r,"set"])}}this.#ut(g);this.#dt(g,p,h);this.#B[g]=i;if(h){h.set="replace";const r=o&&this.#Q(o)?o.__staleWhileFetching:o;if(r!==undefined)h.oldValue=r}}else if(h){h.set="update"}}if(a!==0&&!this.#Y){this.#ot()}if(this.#Y){if(!d){this.#at(g,a,l)}if(h)this.#ct(h,g)}if(!c&&this.#J&&this.#G){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}return this}pop(){try{while(this.#R){const r=this.#B[this.#V];this.#ft(true);if(this.#Q(r)){if(r.__staleWhileFetching){return r.__staleWhileFetching}}else if(r!==undefined){return r}}}finally{if(this.#J&&this.#G){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}}}#ft(r){const i=this.#V;const o=this.#X[i];const a=this.#B[i];if(this.#Z&&this.#Q(a)){a.__abortController.abort(new Error("evicted"))}else if(this.#K||this.#J){if(this.#K){this.#P?.(a,o,"evict")}if(this.#J){this.#G?.push([a,o,"evict"])}}this.#ut(i);if(r){this.#X[i]=undefined;this.#B[i]=undefined;this.#W.push(i)}if(this.#R===1){this.#V=this.#q=0;this.#W.length=0}else{this.#V=this.#$[i]}this.#j.delete(o);this.#R--;return i}has(r,i={}){const{updateAgeOnHas:o=this.updateAgeOnHas,status:a}=i;const l=this.#j.get(r);if(l!==undefined){const r=this.#B[l];if(this.#Q(r)&&r.__staleWhileFetching===undefined){return false}if(!this.#nt(l)){if(o){this.#lt(l)}if(a){a.has="hit";this.#ct(a,l)}return true}else if(a){a.has="stale";this.#ct(a,l)}}else if(a){a.has="miss"}return false}peek(r,i={}){const{allowStale:o=this.allowStale}=i;const a=this.#j.get(r);if(a===undefined||!o&&this.#nt(a)){return}const l=this.#B[a];return this.#Q(l)?l.__staleWhileFetching:l}#tt(r,i,o,a){const l=i===undefined?undefined:this.#B[i];if(this.#Q(l)){return l}const u=new c;const{signal:h}=o;h?.addEventListener("abort",(()=>u.abort(h.reason)),{signal:u.signal});const d={signal:u.signal,options:o,context:a};const cb=(a,l=false)=>{const{aborted:c}=u.signal;const h=o.ignoreFetchAbort&&a!==undefined;if(o.status){if(c&&!l){o.status.fetchAborted=true;o.status.fetchError=u.signal.reason;if(h)o.status.fetchAbortIgnored=true}else{o.status.fetchResolved=true}}if(c&&!h&&!l){return fetchFail(u.signal.reason)}const g=p;if(this.#B[i]===p){if(a===undefined){if(g.__staleWhileFetching){this.#B[i]=g.__staleWhileFetching}else{this.delete(r)}}else{if(o.status)o.status.fetchUpdated=true;this.set(r,a,d.options)}}return a};const eb=r=>{if(o.status){o.status.fetchRejected=true;o.status.fetchError=r}return fetchFail(r)};const fetchFail=a=>{const{aborted:l}=u.signal;const c=l&&o.allowStaleOnFetchAbort;const h=c||o.allowStaleOnFetchRejection;const d=h||o.noDeleteOnFetchRejection;const g=p;if(this.#B[i]===p){const o=!d||g.__staleWhileFetching===undefined;if(o){this.delete(r)}else if(!c){this.#B[i]=g.__staleWhileFetching}}if(h){if(o.status&&g.__staleWhileFetching!==undefined){o.status.returnedStale=true}return g.__staleWhileFetching}else if(g.__returned===g){throw a}};const pcall=(i,a)=>{const c=this.#k?.(r,l,d);if(c&&c instanceof Promise){c.then((r=>i(r===undefined?undefined:r)),a)}u.signal.addEventListener("abort",(()=>{if(!o.ignoreFetchAbort||o.allowStaleOnFetchAbort){i(undefined);if(o.allowStaleOnFetchAbort){i=r=>cb(r,true)}}}))};if(o.status)o.status.fetchDispatched=true;const p=new Promise(pcall).then(cb,eb);const g=Object.assign(p,{__abortController:u,__staleWhileFetching:l,__returned:undefined});if(i===undefined){this.set(r,g,{...d.options,status:undefined});i=this.#j.get(r)}else{this.#B[i]=g}return g}#Q(r){if(!this.#Z)return false;const i=r;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof c}async fetch(r,i={}){const{allowStale:o=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:h=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:p=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:v,forceRefresh:E=false,status:x,signal:M}=i;if(!this.#Z){if(x)x.fetch="get";return this.get(r,{allowStale:o,updateAgeOnGet:a,noDeleteOnStaleGet:l,status:x})}const D={allowStale:o,updateAgeOnGet:a,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:u,size:h,sizeCalculation:d,noUpdateTTL:p,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:b,ignoreFetchAbort:w,status:x,signal:M};let O=this.#j.get(r);if(O===undefined){if(x)x.fetch="miss";const i=this.#tt(r,O,D,v);return i.__returned=i}else{const i=this.#B[O];if(this.#Q(i)){const r=o&&i.__staleWhileFetching!==undefined;if(x){x.fetch="inflight";if(r)x.returnedStale=true}return r?i.__staleWhileFetching:i.__returned=i}const l=this.#nt(O);if(!E&&!l){if(x)x.fetch="hit";this.#et(O);if(a){this.#lt(O)}if(x)this.#ct(x,O);return i}const c=this.#tt(r,O,D,v);const u=c.__staleWhileFetching!==undefined;const h=u&&o;if(x){x.fetch=l?"stale":"refresh";if(h&&l)x.returnedStale=true}return h?c.__staleWhileFetching:c.__returned=c}}get(r,i={}){const{allowStale:o=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=i;const u=this.#j.get(r);if(u!==undefined){const i=this.#B[u];const h=this.#Q(i);if(c)this.#ct(c,u);if(this.#nt(u)){if(c)c.get="stale";if(!h){if(!l){this.delete(r)}if(c&&o)c.returnedStale=true;return o?i:undefined}else{if(c&&o&&i.__staleWhileFetching!==undefined){c.returnedStale=true}return o?i.__staleWhileFetching:undefined}}else{if(c)c.get="hit";if(h){return i.__staleWhileFetching}this.#et(u);if(a){this.#lt(u)}return i}}else if(c){c.get="miss"}}#mt(r,i){this.#U[i]=r;this.#$[r]=i}#et(r){if(r!==this.#q){if(r===this.#V){this.#V=this.#$[r]}else{this.#mt(this.#U[r],this.#$[r])}this.#mt(this.#q,r);this.#q=r}}delete(r){let i=false;if(this.#R!==0){const o=this.#j.get(r);if(o!==undefined){i=true;if(this.#R===1){this.clear()}else{this.#ut(o);const i=this.#B[o];if(this.#Q(i)){i.__abortController.abort(new Error("deleted"))}else if(this.#K||this.#J){if(this.#K){this.#P?.(i,r,"delete")}if(this.#J){this.#G?.push([i,r,"delete"])}}this.#j.delete(r);this.#X[o]=undefined;this.#B[o]=undefined;if(o===this.#q){this.#q=this.#U[o]}else if(o===this.#V){this.#V=this.#$[o]}else{const r=this.#U[o];this.#$[r]=this.#$[o];const i=this.#$[o];this.#U[i]=this.#U[o]}this.#R--;this.#W.push(o)}}}if(this.#J&&this.#G?.length){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}return i}clear(){for(const r of this.#it({allowStale:true})){const i=this.#B[r];if(this.#Q(i)){i.__abortController.abort(new Error("deleted"))}else{const o=this.#X[r];if(this.#K){this.#P?.(i,o,"delete")}if(this.#J){this.#G?.push([i,o,"delete"])}}}this.#j.clear();this.#B.fill(undefined);this.#X.fill(undefined);if(this.#Y&&this.#z){this.#Y.fill(0);this.#z.fill(0)}if(this.#H){this.#H.fill(0)}this.#V=0;this.#q=0;this.#W.length=0;this.#F=0;this.#R=0;if(this.#J&&this.#G){const r=this.#G;let i;while(i=r?.shift()){this.#I?.(...i)}}}}i.LRUCache=LRUCache},6014:function(r,i,o){"use strict";var a=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:true});i.Minipass=i.isWritable=i.isReadable=i.isStream=void 0;const l=typeof process==="object"&&process?process:{stdout:null,stderr:null};const c=o(5673);const u=a(o(4492));const h=o(6915);const isStream=r=>!!r&&typeof r==="object"&&(r instanceof Minipass||r instanceof u.default||(0,i.isReadable)(r)||(0,i.isWritable)(r));i.isStream=isStream;const isReadable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.pipe==="function"&&r.pipe!==u.default.Writable.prototype.pipe;i.isReadable=isReadable;const isWritable=r=>!!r&&typeof r==="object"&&r instanceof c.EventEmitter&&typeof r.write==="function"&&typeof r.end==="function";i.isWritable=isWritable;const d=Symbol("EOF");const p=Symbol("maybeEmitEnd");const g=Symbol("emittedEnd");const y=Symbol("emittingEnd");const w=Symbol("emittedError");const b=Symbol("closed");const v=Symbol("read");const E=Symbol("flush");const x=Symbol("flushChunk");const M=Symbol("encoding");const D=Symbol("decoder");const O=Symbol("flowing");const T=Symbol("paused");const S=Symbol("resume");const A=Symbol("buffer");const N=Symbol("pipes");const _=Symbol("bufferLength");const C=Symbol("bufferPush");const L=Symbol("bufferShift");const P=Symbol("objectMode");const I=Symbol("destroyed");const k=Symbol("error");const R=Symbol("emitData");const j=Symbol("emitEnd");const X=Symbol("emitEnd2");const B=Symbol("async");const $=Symbol("abort");const U=Symbol("aborted");const V=Symbol("signal");const q=Symbol("dataListeners");const W=Symbol("discarded");const defer=r=>Promise.resolve().then(r);const nodefer=r=>r();const isEndish=r=>r==="end"||r==="finish"||r==="prefinish";const isArrayBufferLike=r=>r instanceof ArrayBuffer||!!r&&typeof r==="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0;const isArrayBufferView=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r);class Pipe{src;dest;opts;ondrain;constructor(r,i,o){this.src=r;this.dest=i;this.opts=o;this.ondrain=()=>r[S]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(r){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(r,i,o){super(r,i,o);this.proxyErrors=r=>i.emit("error",r);r.on("error",this.proxyErrors)}}const isObjectModeOptions=r=>!!r.objectMode;const isEncodingOptions=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer";class Minipass extends c.EventEmitter{[O]=false;[T]=false;[N]=[];[A]=[];[P];[M];[B];[D];[d]=false;[g]=false;[y]=false;[b]=false;[w]=null;[_]=0;[I]=false;[V];[U]=false;[q]=0;[W]=false;writable=true;readable=true;constructor(...r){const i=r[0]||{};super();if(i.objectMode&&typeof i.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(i)){this[P]=true;this[M]=null}else if(isEncodingOptions(i)){this[M]=i.encoding;this[P]=false}else{this[P]=false;this[M]=null}this[B]=!!i.async;this[D]=this[M]?new h.StringDecoder(this[M]):null;if(i&&i.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[A]})}if(i&&i.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[N]})}const{signal:o}=i;if(o){this[V]=o;if(o.aborted){this[$]()}else{o.addEventListener("abort",(()=>this[$]()))}}}get bufferLength(){return this[_]}get encoding(){return this[M]}set encoding(r){throw new Error("Encoding must be set at instantiation time")}setEncoding(r){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[P]}set objectMode(r){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[B]}set["async"](r){this[B]=this[B]||!!r}[$](){this[U]=true;this.emit("abort",this[V]?.reason);this.destroy(this[V]?.reason)}get aborted(){return this[U]}set aborted(r){}write(r,i,o){if(this[U])return false;if(this[d])throw new Error("write after end");if(this[I]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof i==="function"){o=i;i="utf8"}if(!i)i="utf8";const a=this[B]?defer:nodefer;if(!this[P]&&!Buffer.isBuffer(r)){if(isArrayBufferView(r)){r=Buffer.from(r.buffer,r.byteOffset,r.byteLength)}else if(isArrayBufferLike(r)){r=Buffer.from(r)}else if(typeof r!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[P]){if(this[O]&&this[_]!==0)this[E](true);if(this[O])this.emit("data",r);else this[C](r);if(this[_]!==0)this.emit("readable");if(o)a(o);return this[O]}if(!r.length){if(this[_]!==0)this.emit("readable");if(o)a(o);return this[O]}if(typeof r==="string"&&!(i===this[M]&&!this[D]?.lastNeed)){r=Buffer.from(r,i)}if(Buffer.isBuffer(r)&&this[M]){r=this[D].write(r)}if(this[O]&&this[_]!==0)this[E](true);if(this[O])this.emit("data",r);else this[C](r);if(this[_]!==0)this.emit("readable");if(o)a(o);return this[O]}read(r){if(this[I])return null;this[W]=false;if(this[_]===0||r===0||r&&r>this[_]){this[p]();return null}if(this[P])r=null;if(this[A].length>1&&!this[P]){this[A]=[this[M]?this[A].join(""):Buffer.concat(this[A],this[_])]}const i=this[v](r||null,this[A][0]);this[p]();return i}[v](r,i){if(this[P])this[L]();else{const o=i;if(r===o.length||r===null)this[L]();else if(typeof o==="string"){this[A][0]=o.slice(r);i=o.slice(0,r);this[_]-=r}else{this[A][0]=o.subarray(r);i=o.subarray(0,r);this[_]-=r}}this.emit("data",i);if(!this[A].length&&!this[d])this.emit("drain");return i}end(r,i,o){if(typeof r==="function"){o=r;r=undefined}if(typeof i==="function"){o=i;i="utf8"}if(r!==undefined)this.write(r,i);if(o)this.once("end",o);this[d]=true;this.writable=false;if(this[O]||!this[T])this[p]();return this}[S](){if(this[I])return;if(!this[q]&&!this[N].length){this[W]=true}this[T]=false;this[O]=true;this.emit("resume");if(this[A].length)this[E]();else if(this[d])this[p]();else this.emit("drain")}resume(){return this[S]()}pause(){this[O]=false;this[T]=true;this[W]=false}get destroyed(){return this[I]}get flowing(){return this[O]}get paused(){return this[T]}[C](r){if(this[P])this[_]+=1;else this[_]+=r.length;this[A].push(r)}[L](){if(this[P])this[_]-=1;else this[_]-=this[A][0].length;return this[A].shift()}[E](r=false){do{}while(this[x](this[L]())&&this[A].length);if(!r&&!this[A].length&&!this[d])this.emit("drain")}[x](r){this.emit("data",r);return this[O]}pipe(r,i){if(this[I])return r;this[W]=false;const o=this[g];i=i||{};if(r===l.stdout||r===l.stderr)i.end=false;else i.end=i.end!==false;i.proxyErrors=!!i.proxyErrors;if(o){if(i.end)r.end()}else{this[N].push(!i.proxyErrors?new Pipe(this,r,i):new PipeProxyErrors(this,r,i));if(this[B])defer((()=>this[S]()));else this[S]()}return r}unpipe(r){const i=this[N].find((i=>i.dest===r));if(i){if(this[N].length===1){if(this[O]&&this[q]===0){this[O]=false}this[N]=[]}else this[N].splice(this[N].indexOf(i),1);i.unpipe()}}addListener(r,i){return this.on(r,i)}on(r,i){const o=super.on(r,i);if(r==="data"){this[W]=false;this[q]++;if(!this[N].length&&!this[O]){this[S]()}}else if(r==="readable"&&this[_]!==0){super.emit("readable")}else if(isEndish(r)&&this[g]){super.emit(r);this.removeAllListeners(r)}else if(r==="error"&&this[w]){const r=i;if(this[B])defer((()=>r.call(this,this[w])));else r.call(this,this[w])}return o}removeListener(r,i){return this.off(r,i)}off(r,i){const o=super.off(r,i);if(r==="data"){this[q]=this.listeners("data").length;if(this[q]===0&&!this[W]&&!this[N].length){this[O]=false}}return o}removeAllListeners(r){const i=super.removeAllListeners(r);if(r==="data"||r===undefined){this[q]=0;if(!this[W]&&!this[N].length){this[O]=false}}return i}get emittedEnd(){return this[g]}[p](){if(!this[y]&&!this[g]&&!this[I]&&this[A].length===0&&this[d]){this[y]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[b])this.emit("close");this[y]=false}}emit(r,...i){const o=i[0];if(r!=="error"&&r!=="close"&&r!==I&&this[I]){return false}else if(r==="data"){return!this[P]&&!o?false:this[B]?(defer((()=>this[R](o))),true):this[R](o)}else if(r==="end"){return this[j]()}else if(r==="close"){this[b]=true;if(!this[g]&&!this[I])return false;const r=super.emit("close");this.removeAllListeners("close");return r}else if(r==="error"){this[w]=o;super.emit(k,o);const r=!this[V]||this.listeners("error").length?super.emit("error",o):false;this[p]();return r}else if(r==="resume"){const r=super.emit("resume");this[p]();return r}else if(r==="finish"||r==="prefinish"){const i=super.emit(r);this.removeAllListeners(r);return i}const a=super.emit(r,...i);this[p]();return a}[R](r){for(const i of this[N]){if(i.dest.write(r)===false)this.pause()}const i=this[W]?false:super.emit("data",r);this[p]();return i}[j](){if(this[g])return false;this[g]=true;this.readable=false;return this[B]?(defer((()=>this[X]())),true):this[X]()}[X](){if(this[D]){const r=this[D].end();if(r){for(const i of this[N]){i.dest.write(r)}if(!this[W])super.emit("data",r)}}for(const r of this[N]){r.end()}const r=super.emit("end");this.removeAllListeners("end");return r}async collect(){const r=Object.assign([],{dataLength:0});if(!this[P])r.dataLength=0;const i=this.promise();this.on("data",(i=>{r.push(i);if(!this[P])r.dataLength+=i.length}));await i;return r}async concat(){if(this[P]){throw new Error("cannot concat in objectMode")}const r=await this.collect();return this[M]?r.join(""):Buffer.concat(r,r.dataLength)}async promise(){return new Promise(((r,i)=>{this.on(I,(()=>i(new Error("stream destroyed"))));this.on("error",(r=>i(r)));this.on("end",(()=>r()))}))}[Symbol.asyncIterator](){this[W]=false;let r=false;const stop=async()=>{this.pause();r=true;return{value:undefined,done:true}};const next=()=>{if(r)return stop();const i=this.read();if(i!==null)return Promise.resolve({done:false,value:i});if(this[d])return stop();let o;let a;const onerr=r=>{this.off("data",ondata);this.off("end",onend);this.off(I,ondestroy);stop();a(r)};const ondata=r=>{this.off("error",onerr);this.off("end",onend);this.off(I,ondestroy);this.pause();o({value:r,done:!!this[d]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(I,ondestroy);stop();o({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((r,i)=>{a=i;o=r;this.once(I,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[W]=false;let r=false;const stop=()=>{this.pause();this.off(k,stop);this.off(I,stop);this.off("end",stop);r=true;return{done:true,value:undefined}};const next=()=>{if(r)return stop();const i=this.read();return i===null?stop():{done:false,value:i}};this.once("end",stop);this.once(k,stop);this.once(I,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(r){if(this[I]){if(r)this.emit("error",r);else this.emit(I);return this}this[I]=true;this[W]=true;this[A].length=0;this[_]=0;const i=this;if(typeof i.close==="function"&&!this[b])i.close();if(r)this.emit("error",r);else this.emit(I);return this}static get isStream(){return i.isStream}}i.Minipass=Minipass},5715:function(r,i,o){"use strict";var a=this&&this.__createBinding||(Object.create?function(r,i,o,a){if(a===undefined)a=o;var l=Object.getOwnPropertyDescriptor(i,o);if(!l||("get"in l?!i.__esModule:l.writable||l.configurable)){l={enumerable:true,get:function(){return i[o]}}}Object.defineProperty(r,a,l)}:function(r,i,o,a){if(a===undefined)a=o;r[a]=i[o]});var l=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var c=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var o in r)if(o!=="default"&&Object.prototype.hasOwnProperty.call(r,o))a(i,r,o);l(i,r);return i};Object.defineProperty(i,"__esModule",{value:true});i.PathScurry=i.Path=i.PathScurryDarwin=i.PathScurryPosix=i.PathScurryWin32=i.PathScurryBase=i.PathPosix=i.PathWin32=i.PathBase=i.ChildrenCache=i.ResolveCache=void 0;const u=o(3576);const h=o(9411);const d=o(1041);const p=o(7147);const g=c(o(7561));const y=p.realpathSync.native;const w=o(3977);const b=o(6014);const v={lstatSync:p.lstatSync,readdir:p.readdir,readdirSync:p.readdirSync,readlinkSync:p.readlinkSync,realpathSync:y,promises:{lstat:w.lstat,readdir:w.readdir,readlink:w.readlink,realpath:w.realpath}};const fsFromOption=r=>!r||r===v||r===g?v:{...v,...r,promises:{...v.promises,...r.promises||{}}};const E=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=r=>r.replace(/\//g,"\\").replace(E,"$1\\");const x=/[\\\/]/;const M=0;const D=1;const O=2;const T=4;const S=6;const A=8;const N=10;const _=12;const C=15;const L=~C;const P=16;const I=32;const k=64;const R=128;const j=256;const X=512;const B=k|R|X;const $=1023;const entToType=r=>r.isFile()?A:r.isDirectory()?T:r.isSymbolicLink()?N:r.isCharacterDevice()?O:r.isBlockDevice()?S:r.isSocket()?_:r.isFIFO()?D:M;const U=new Map;const normalize=r=>{const i=U.get(r);if(i)return i;const o=r.normalize("NFKD");U.set(r,o);return o};const V=new Map;const normalizeNocase=r=>{const i=V.get(r);if(i)return i;const o=normalize(r.toLowerCase());V.set(r,o);return o};class ResolveCache extends u.LRUCache{constructor(){super({max:256})}}i.ResolveCache=ResolveCache;class ChildrenCache extends u.LRUCache{constructor(r=16*1024){super({maxSize:r,sizeCalculation:r=>r.length+1})}}i.ChildrenCache=ChildrenCache;const q=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#gt;#yt;get dev(){return this.#yt}#wt;get mode(){return this.#wt}#bt;get nlink(){return this.#bt}#vt;get uid(){return this.#vt}#Et;get gid(){return this.#Et}#xt;get rdev(){return this.#xt}#Mt;get blksize(){return this.#Mt}#Dt;get ino(){return this.#Dt}#R;get size(){return this.#R}#Ot;get blocks(){return this.#Ot}#Tt;get atimeMs(){return this.#Tt}#St;get mtimeMs(){return this.#St}#At;get ctimeMs(){return this.#At}#Nt;get birthtimeMs(){return this.#Nt}#_t;get atime(){return this.#_t}#Ct;get mtime(){return this.#Ct}#Lt;get ctime(){return this.#Lt}#Pt;get birthtime(){return this.#Pt}#It;#kt;#Rt;#Ft;#jt;#Xt;#Bt;#$t;#Ut;#Vt;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(r,i=M,o,a,l,c,u){this.name=r;this.#It=l?normalizeNocase(r):normalize(r);this.#Bt=i&$;this.nocase=l;this.roots=a;this.root=o||this;this.#$t=c;this.#Rt=u.fullpath;this.#jt=u.relative;this.#Xt=u.relativePosix;this.parent=u.parent;if(this.parent){this.#gt=this.parent.#gt}else{this.#gt=fsFromOption(u.fs)}}depth(){if(this.#kt!==undefined)return this.#kt;if(!this.parent)return this.#kt=0;return this.#kt=this.parent.depth()+1}childrenCache(){return this.#$t}resolve(r){if(!r){return this}const i=this.getRootString(r);const o=r.substring(i.length);const a=o.split(this.splitSep);const l=i?this.getRoot(i).#qt(a):this.#qt(a);return l}#qt(r){let i=this;for(const o of r){i=i.child(o)}return i}children(){const r=this.#$t.get(this);if(r){return r}const i=Object.assign([],{provisional:0});this.#$t.set(this,i);this.#Bt&=~P;return i}child(r,i){if(r===""||r==="."){return this}if(r===".."){return this.parent||this}const o=this.children();const a=this.nocase?normalizeNocase(r):normalize(r);for(const r of o){if(r.#It===a){return r}}const l=this.parent?this.sep:"";const c=this.#Rt?this.#Rt+l+r:undefined;const u=this.newChild(r,M,{...i,parent:this,fullpath:c});if(!this.canReaddir()){u.#Bt|=R}o.push(u);return u}relative(){if(this.isCWD)return"";if(this.#jt!==undefined){return this.#jt}const r=this.name;const i=this.parent;if(!i){return this.#jt=this.name}const o=i.relative();return o+(!o||!i.parent?"":this.sep)+r}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#Xt!==undefined)return this.#Xt;const r=this.name;const i=this.parent;if(!i){return this.#Xt=this.fullpathPosix()}const o=i.relativePosix();return o+(!o||!i.parent?"":"/")+r}fullpath(){if(this.#Rt!==undefined){return this.#Rt}const r=this.name;const i=this.parent;if(!i){return this.#Rt=this.name}const o=i.fullpath();const a=o+(!i.parent?"":this.sep)+r;return this.#Rt=a}fullpathPosix(){if(this.#Ft!==undefined)return this.#Ft;if(this.sep==="/")return this.#Ft=this.fullpath();if(!this.parent){const r=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(r)){return this.#Ft=`//?/${r}`}else{return this.#Ft=r}}const r=this.parent;const i=r.fullpathPosix();const o=i+(!i||!r.parent?"":"/")+this.name;return this.#Ft=o}isUnknown(){return(this.#Bt&C)===M}isType(r){return this[`is${r}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Bt&C)===A}isDirectory(){return(this.#Bt&C)===T}isCharacterDevice(){return(this.#Bt&C)===O}isBlockDevice(){return(this.#Bt&C)===S}isFIFO(){return(this.#Bt&C)===D}isSocket(){return(this.#Bt&C)===_}isSymbolicLink(){return(this.#Bt&N)===N}lstatCached(){return this.#Bt&I?this:undefined}readlinkCached(){return this.#Ut}realpathCached(){return this.#Vt}readdirCached(){const r=this.children();return r.slice(0,r.provisional)}canReadlink(){if(this.#Ut)return true;if(!this.parent)return false;const r=this.#Bt&C;return!(r!==M&&r!==N||this.#Bt&j||this.#Bt&R)}calledReaddir(){return!!(this.#Bt&P)}isENOENT(){return!!(this.#Bt&R)}isNamed(r){return!this.nocase?this.#It===normalize(r):this.#It===normalizeNocase(r)}async readlink(){const r=this.#Ut;if(r){return r}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const r=await this.#gt.promises.readlink(this.fullpath());const i=(await this.parent.realpath())?.resolve(r);if(i){return this.#Ut=i}}catch(r){this.#Wt(r.code);return undefined}}readlinkSync(){const r=this.#Ut;if(r){return r}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const r=this.#gt.readlinkSync(this.fullpath());const i=this.parent.realpathSync()?.resolve(r);if(i){return this.#Ut=i}}catch(r){this.#Wt(r.code);return undefined}}#Gt(r){this.#Bt|=P;for(let i=r.provisional;i<r.length;i++){const o=r[i];if(o)o.#Ht()}}#Ht(){if(this.#Bt&R)return;this.#Bt=(this.#Bt|R)&L;this.#zt()}#zt(){const r=this.children();r.provisional=0;for(const i of r){i.#Ht()}}#Yt(){this.#Bt|=X;this.#Kt()}#Kt(){if(this.#Bt&k)return;let r=this.#Bt;if((r&C)===T)r&=L;this.#Bt=r|k;this.#zt()}#Zt(r=""){if(r==="ENOTDIR"||r==="EPERM"){this.#Kt()}else if(r==="ENOENT"){this.#Ht()}else{this.children().provisional=0}}#Jt(r=""){if(r==="ENOTDIR"){const r=this.parent;r.#Kt()}else if(r==="ENOENT"){this.#Ht()}}#Wt(r=""){let i=this.#Bt;i|=j;if(r==="ENOENT")i|=R;if(r==="EINVAL"||r==="UNKNOWN"){i&=L}this.#Bt=i;if(r==="ENOTDIR"&&this.parent){this.parent.#Kt()}}#Qt(r,i){return this.#te(r,i)||this.#ee(r,i)}#ee(r,i){const o=entToType(r);const a=this.newChild(r.name,o,{parent:this});const l=a.#Bt&C;if(l!==T&&l!==N&&l!==M){a.#Bt|=k}i.unshift(a);i.provisional++;return a}#te(r,i){for(let o=i.provisional;o<i.length;o++){const a=i[o];const l=this.nocase?normalizeNocase(r.name):normalize(r.name);if(l!==a.#It){continue}return this.#re(r,a,o,i)}}#re(r,i,o,a){const l=i.name;i.#Bt=i.#Bt&L|entToType(r);if(l!==r.name)i.name=r.name;if(o!==a.provisional){if(o===a.length-1)a.pop();else a.splice(o,1);a.unshift(i)}a.provisional++;return i}async lstat(){if((this.#Bt&R)===0){try{this.#ie(await this.#gt.promises.lstat(this.fullpath()));return this}catch(r){this.#Jt(r.code)}}}lstatSync(){if((this.#Bt&R)===0){try{this.#ie(this.#gt.lstatSync(this.fullpath()));return this}catch(r){this.#Jt(r.code)}}}#ie(r){const{atime:i,atimeMs:o,birthtime:a,birthtimeMs:l,blksize:c,blocks:u,ctime:h,ctimeMs:d,dev:p,gid:g,ino:y,mode:w,mtime:b,mtimeMs:v,nlink:E,rdev:x,size:D,uid:O}=r;this.#_t=i;this.#Tt=o;this.#Pt=a;this.#Nt=l;this.#Mt=c;this.#Ot=u;this.#Lt=h;this.#At=d;this.#yt=p;this.#Et=g;this.#Dt=y;this.#wt=w;this.#Ct=b;this.#St=v;this.#bt=E;this.#xt=x;this.#R=D;this.#vt=O;const S=entToType(r);this.#Bt=this.#Bt&L|S|I;if(S!==M&&S!==T&&S!==N){this.#Bt|=k}}#ne=[];#se=false;#oe(r){this.#se=false;const i=this.#ne.slice();this.#ne.length=0;i.forEach((i=>i(null,r)))}readdirCB(r,i=false){if(!this.canReaddir()){if(i)r(null,[]);else queueMicrotask((()=>r(null,[])));return}const o=this.children();if(this.calledReaddir()){const a=o.slice(0,o.provisional);if(i)r(null,a);else queueMicrotask((()=>r(null,a)));return}this.#ne.push(r);if(this.#se){return}this.#se=true;const a=this.fullpath();this.#gt.readdir(a,{withFileTypes:true},((r,i)=>{if(r){this.#Zt(r.code);o.provisional=0}else{for(const r of i){this.#Qt(r,o)}this.#Gt(o)}this.#oe(o.slice(0,o.provisional));return}))}#ae;async readdir(){if(!this.canReaddir()){return[]}const r=this.children();if(this.calledReaddir()){return r.slice(0,r.provisional)}const i=this.fullpath();if(this.#ae){await this.#ae}else{let resolve=()=>{};this.#ae=new Promise((r=>resolve=r));try{for(const o of await this.#gt.promises.readdir(i,{withFileTypes:true})){this.#Qt(o,r)}this.#Gt(r)}catch(i){this.#Zt(i.code);r.provisional=0}this.#ae=undefined;resolve()}return r.slice(0,r.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const r=this.children();if(this.calledReaddir()){return r.slice(0,r.provisional)}const i=this.fullpath();try{for(const o of this.#gt.readdirSync(i,{withFileTypes:true})){this.#Qt(o,r)}this.#Gt(r)}catch(i){this.#Zt(i.code);r.provisional=0}return r.slice(0,r.provisional)}canReaddir(){if(this.#Bt&B)return false;const r=C&this.#Bt;if(!(r===M||r===T||r===N)){return false}return true}shouldWalk(r,i){return(this.#Bt&T)===T&&!(this.#Bt&B)&&!r.has(this)&&(!i||i(this))}async realpath(){if(this.#Vt)return this.#Vt;if((X|j|R)&this.#Bt)return undefined;try{const r=await this.#gt.promises.realpath(this.fullpath());return this.#Vt=this.resolve(r)}catch(r){this.#Yt()}}realpathSync(){if(this.#Vt)return this.#Vt;if((X|j|R)&this.#Bt)return undefined;try{const r=this.#gt.realpathSync(this.fullpath());return this.#Vt=this.resolve(r)}catch(r){this.#Yt()}}[q](r){if(r===this)return;r.isCWD=false;this.isCWD=true;const i=new Set([]);let o=[];let a=this;while(a&&a.parent){i.add(a);a.#jt=o.join(this.sep);a.#Xt=o.join("/");a=a.parent;o.push("..")}a=r;while(a&&a.parent&&!i.has(a)){a.#jt=undefined;a.#Xt=undefined;a=a.parent}}}i.PathBase=PathBase;class PathWin32 extends PathBase{sep="\\";splitSep=x;constructor(r,i=M,o,a,l,c,u){super(r,i,o,a,l,c,u)}newChild(r,i=M,o={}){return new PathWin32(r,i,this.root,this.roots,this.nocase,this.childrenCache(),o)}getRootString(r){return h.win32.parse(r).root}getRoot(r){r=uncToDrive(r.toUpperCase());if(r===this.root.name){return this.root}for(const[i,o]of Object.entries(this.roots)){if(this.sameRoot(r,i)){return this.roots[r]=o}}return this.roots[r]=new PathScurryWin32(r,this).root}sameRoot(r,i=this.root.name){r=r.toUpperCase().replace(/\//g,"\\").replace(E,"$1\\");return r===i}}i.PathWin32=PathWin32;class PathPosix extends PathBase{splitSep="/";sep="/";constructor(r,i=M,o,a,l,c,u){super(r,i,o,a,l,c,u)}getRootString(r){return r.startsWith("/")?"/":""}getRoot(r){return this.root}newChild(r,i=M,o={}){return new PathPosix(r,i,this.root,this.roots,this.nocase,this.childrenCache(),o)}}i.PathPosix=PathPosix;class PathScurryBase{root;rootPath;roots;cwd;#le;#ce;#$t;nocase;#gt;constructor(r=process.cwd(),i,o,{nocase:a,childrenCacheSize:l=16*1024,fs:c=v}={}){this.#gt=fsFromOption(c);if(r instanceof URL||r.startsWith("file://")){r=(0,d.fileURLToPath)(r)}const u=i.resolve(r);this.roots=Object.create(null);this.rootPath=this.parseRootPath(u);this.#le=new ResolveCache;this.#ce=new ResolveCache;this.#$t=new ChildrenCache(l);const h=u.substring(this.rootPath.length).split(o);if(h.length===1&&!h[0]){h.pop()}if(a===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=a;this.root=this.newRoot(this.#gt);this.roots[this.rootPath]=this.root;let p=this.root;let g=h.length-1;const y=i.sep;let w=this.rootPath;let b=false;for(const r of h){const i=g--;p=p.child(r,{relative:new Array(i).fill("..").join(y),relativePosix:new Array(i).fill("..").join("/"),fullpath:w+=(b?"":y)+r});b=true}this.cwd=p}depth(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.depth()}childrenCache(){return this.#$t}resolve(...r){let i="";for(let o=r.length-1;o>=0;o--){const a=r[o];if(!a||a===".")continue;i=i?`${a}/${i}`:a;if(this.isAbsolute(a)){break}}const o=this.#le.get(i);if(o!==undefined){return o}const a=this.cwd.resolve(i).fullpath();this.#le.set(i,a);return a}resolvePosix(...r){let i="";for(let o=r.length-1;o>=0;o--){const a=r[o];if(!a||a===".")continue;i=i?`${a}/${i}`:a;if(this.isAbsolute(a)){break}}const o=this.#ce.get(i);if(o!==undefined){return o}const a=this.cwd.resolve(i).fullpathPosix();this.#ce.set(i,a);return a}relative(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.relative()}relativePosix(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.relativePosix()}basename(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.name}dirname(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return(r.parent||r).fullpath()}async readdir(r=this.cwd,i={withFileTypes:true}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o}=i;if(!r.canReaddir()){return[]}else{const i=await r.readdir();return o?i:i.map((r=>r.name))}}readdirSync(r=this.cwd,i={withFileTypes:true}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true}=i;if(!r.canReaddir()){return[]}else if(o){return r.readdirSync()}else{return r.readdirSync().map((r=>r.name))}}async lstat(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.lstat()}lstatSync(r=this.cwd){if(typeof r==="string"){r=this.cwd.resolve(r)}return r.lstatSync()}async readlink(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=await r.readlink();return i?o:o?.fullpath()}readlinkSync(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=r.readlinkSync();return i?o:o?.fullpath()}async realpath(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=await r.realpath();return i?o:o?.fullpath()}realpathSync(r=this.cwd,{withFileTypes:i}={withFileTypes:false}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r.withFileTypes;r=this.cwd}const o=r.realpathSync();return i?o:o?.fullpath()}async walk(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=[];if(!l||l(r)){u.push(o?r:r.fullpath())}const h=new Set;const walk=(r,i)=>{h.add(r);r.readdirCB(((r,d)=>{if(r){return i(r)}let p=d.length;if(!p)return i();const next=()=>{if(--p===0){i()}};for(const r of d){if(!l||l(r)){u.push(o?r:r.fullpath())}if(a&&r.isSymbolicLink()){r.realpath().then((r=>r?.isUnknown()?r.lstat():r)).then((r=>r?.shouldWalk(h,c)?walk(r,next):next()))}else{if(r.shouldWalk(h,c)){walk(r,next)}else{next()}}}}),true)};const d=r;return new Promise(((r,i)=>{walk(d,(o=>{if(o)return i(o);r(u)}))}))}walkSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=[];if(!l||l(r)){u.push(o?r:r.fullpath())}const h=new Set([r]);for(const r of h){const i=r.readdirSync();for(const r of i){if(!l||l(r)){u.push(o?r:r.fullpath())}let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(h,c)){h.add(i)}}}return u}[Symbol.asyncIterator](){return this.iterate()}iterate(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}return this.stream(r,i)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;if(!l||l(r)){yield o?r:r.fullpath()}const u=new Set([r]);for(const r of u){const i=r.readdirSync();for(const r of i){if(!l||l(r)){yield o?r:r.fullpath()}let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(u,c)){u.add(i)}}}}stream(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=new b.Minipass({objectMode:true});if(!l||l(r)){u.write(o?r:r.fullpath())}const h=new Set;const d=[r];let p=0;const process=()=>{let r=false;while(!r){const i=d.shift();if(!i){if(p===0)u.end();return}p++;h.add(i);const onReaddir=(i,y,w=false)=>{if(i)return u.emit("error",i);if(a&&!w){const r=[];for(const i of y){if(i.isSymbolicLink()){r.push(i.realpath().then((r=>r?.isUnknown()?r.lstat():r)))}}if(r.length){Promise.all(r).then((()=>onReaddir(null,y,true)));return}}for(const i of y){if(i&&(!l||l(i))){if(!u.write(o?i:i.fullpath())){r=true}}}p--;for(const r of y){const i=r.realpathCached()||r;if(i.shouldWalk(h,c)){d.push(i)}}if(r&&!u.flowing){u.once("drain",process)}else if(!g){process()}};let g=true;i.readdirCB(onReaddir,true);g=false}};process();return u}streamSync(r=this.cwd,i={}){if(typeof r==="string"){r=this.cwd.resolve(r)}else if(!(r instanceof PathBase)){i=r;r=this.cwd}const{withFileTypes:o=true,follow:a=false,filter:l,walkFilter:c}=i;const u=new b.Minipass({objectMode:true});const h=new Set;if(!l||l(r)){u.write(o?r:r.fullpath())}const d=[r];let p=0;const process=()=>{let r=false;while(!r){const i=d.shift();if(!i){if(p===0)u.end();return}p++;h.add(i);const g=i.readdirSync();for(const i of g){if(!l||l(i)){if(!u.write(o?i:i.fullpath())){r=true}}}p--;for(const r of g){let i=r;if(r.isSymbolicLink()){if(!(a&&(i=r.realpathSync())))continue;if(i.isUnknown())i.lstatSync()}if(i.shouldWalk(h,c)){d.push(i)}}}if(r&&!u.flowing)u.once("drain",process)};process();return u}chdir(r=this.cwd){const i=this.cwd;this.cwd=typeof r==="string"?this.cwd.resolve(r):r;this.cwd[q](i)}}i.PathScurryBase=PathScurryBase;class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(r=process.cwd(),i={}){const{nocase:o=true}=i;super(r,h.win32,"\\",{...i,nocase:o});this.nocase=o;for(let r=this.cwd;r;r=r.parent){r.nocase=this.nocase}}parseRootPath(r){return h.win32.parse(r).root.toUpperCase()}newRoot(r){return new PathWin32(this.rootPath,T,undefined,this.roots,this.nocase,this.childrenCache(),{fs:r})}isAbsolute(r){return r.startsWith("/")||r.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(r)}}i.PathScurryWin32=PathScurryWin32;class PathScurryPosix extends PathScurryBase{sep="/";constructor(r=process.cwd(),i={}){const{nocase:o=false}=i;super(r,h.posix,"/",{...i,nocase:o});this.nocase=o}parseRootPath(r){return"/"}newRoot(r){return new PathPosix(this.rootPath,T,undefined,this.roots,this.nocase,this.childrenCache(),{fs:r})}isAbsolute(r){return r.startsWith("/")}}i.PathScurryPosix=PathScurryPosix;class PathScurryDarwin extends PathScurryPosix{constructor(r=process.cwd(),i={}){const{nocase:o=true}=i;super(r,{...i,nocase:o})}}i.PathScurryDarwin=PathScurryDarwin;i.Path=process.platform==="win32"?PathWin32:PathPosix;i.PathScurry=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix},4147:r=>{"use strict";r.exports=JSON.parse('{"name":"uri-scheme","version":"1.4.3","description":"Interact with native URI schemes","main":"build/index.js","keywords":["expo","ios","uri-scheme","android"],"repository":{"type":"git","url":"https://github.com/expo/expo.git","directory":"packages/uri-scheme"},"author":"Expo <support@expo.dev>","license":"MIT","bugs":{"url":"https://github.com/expo/expo/issues"},"homepage":"https://github.com/expo/expo/tree/main/packages/uri-scheme#readme","bin":"cli.js","files":["build","cli.js"],"scripts":{"build":"ncc build ./src/index.ts -o build/","build:prod":"ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register","clean":"expo-module clean","lint":"expo-module lint","prepare":"yarn run clean && yarn run build:prod","test":"expo-module test","typecheck":"expo-module typecheck","watch":"yarn run build --watch","prepublishOnly":"expo-module prepublishOnly"},"devDependencies":{"@expo/config-plugins":"~9.1.3","@expo/plist":"^0.3.1","@expo/spawn-async":"^1.7.2","@types/prompts":"^2.0.6","chalk":"^4.0.0","commander":"^12.1.0","expo-module-scripts":"^4.1.2","glob":"^10.4.2","prompts":"^2.3.2","update-check":"^1.5.4"},"gitHead":"335e9312f5caf634097354a230f0d4bbbfb9b0ba"}')}};var i={};function __nccwpck_require__(o){var a=i[o];if(a!==undefined){return a.exports}var l=i[o]={id:o,loaded:false,exports:{}};var c=true;try{r[o].call(l.exports,l,l.exports,__nccwpck_require__);c=false}finally{if(c)delete i[o]}l.loaded=true;return l.exports}(()=>{__nccwpck_require__.nmd=r=>{r.paths=[];if(!r.children)r.children=[];return r}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var o=__nccwpck_require__(2855);module.exports=o})();