@tachybase/module-file 1.3.24 → 1.4.0

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.
@@ -4,7 +4,7 @@
4
4
  || ${s} === "boolean" || ${i} === null`).assign(c,n._`[${i}]`)}}}function assignParentData({gen:e,parentData:t,parentDataProperty:a},r){e.if(n._`${t} !== undefined`,(()=>e.assign(n._`${t}[${a}]`,r)))}function checkDataType(e,t,a,r=c.Correct){const i=r===c.Correct?n.operators.EQ:n.operators.NEQ;let o;switch(e){case"null":return n._`${t} ${i} null`;case"array":o=n._`Array.isArray(${t})`;break;case"object":o=n._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=numCond(n._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=numCond();break;default:return n._`typeof ${t} ${i} ${e}`}return r===c.Correct?o:n.not(o);function numCond(e=n.nil){return n.and(n._`typeof ${t} == "number"`,e,a?n._`isFinite(${t})`:n.nil)}}t.checkDataType=checkDataType;function checkDataTypes(e,t,a,r){if(e.length===1){return checkDataType(e[0],t,a,r)}let i;const o=s.toHash(e);if(o.array&&o.object){const e=n._`typeof ${t} != "object"`;i=o.null?e:n._`!${t} || ${e}`;delete o.null;delete o.array;delete o.object}else{i=n.nil}if(o.number)delete o.integer;for(const e in o)i=n.and(i,checkDataType(e,t,a,r));return i}t.checkDataTypes=checkDataTypes;const l={message:({schema:e})=>n.str`should be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?n._`{type: ${e}}`:n._`{type: ${t}}`};function reportTypeError(e){const t=getTypeErrorContext(e);o.reportError(t,l)}t.reportTypeError=reportTypeError;function getTypeErrorContext(e){const{gen:t,data:a,schema:r}=e;const i=s.schemaRefOrVal(e,r,"type");return{gen:t,keyword:"type",data:a,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}},3065:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.assignDefaults=void 0;const r=a(9722);const i=a(5327);function assignDefaults(e,t){const{properties:a,items:r}=e.schema;if(t==="object"&&a){for(const t in a){assignDefault(e,t,a[t].default)}}else if(t==="array"&&Array.isArray(r)){r.forEach(((t,a)=>assignDefault(e,a,t.default)))}}t.assignDefaults=assignDefaults;function assignDefault(e,t,a){const{gen:o,compositeRule:n,data:s,opts:c}=e;if(a===undefined)return;const u=r._`${s}${r.getProperty(t)}`;if(n){i.checkStrictMode(e,`default is ignored for: ${u}`);return}let l=r._`${u} === undefined`;if(c.useDefaults==="empty"){l=r._`${l} || ${u} === null || ${u} === ""`}o.if(l,r._`${u} = ${r.stringify(a)}`)}},5327:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.checkStrictMode=t.schemaCxtHasRules=t.subschemaCode=t.validateFunctionCode=void 0;const r=a(4156);const i=a(9499);const o=a(2265);const n=a(9722);const s=a(3068);const c=a(6808);const u=a(1882);function validateFunctionCode(e){if(isSchemaObj(e)){checkKeywords(e);if(schemaCxtHasRules(e)){topSchemaObjCode(e);return}}validateFunction(e,(()=>r.topBoolOrEmptySchema(e)))}t.validateFunctionCode=validateFunctionCode;function validateFunction({gen:e,validateName:t,schema:a,schemaEnv:r,opts:i},o){if(i.code.es5){e.func(t,n._`${s.default.data}, ${s.default.valCxt}`,r.$async,(()=>{e.code(n._`"use strict"; ${funcSourceUrl(a,i)}`);destructureValCxtES5(e,i);e.code(o)}))}else{e.func(t,n._`${s.default.data}, ${destructureValCxt(i)}`,r.$async,(()=>e.code(funcSourceUrl(a,i)).code(o)))}}function destructureValCxt(e){return n._`{${s.default.dataPath}="", ${s.default.parentData}, ${s.default.parentDataProperty}, ${s.default.rootData}=${s.default.data}${e.dynamicRef?n._`, ${s.default.dynamicAnchors}={}`:n.nil}}={}`}function destructureValCxtES5(e,t){e.if(s.default.valCxt,(()=>{e.var(s.default.dataPath,n._`${s.default.valCxt}.${s.default.dataPath}`);e.var(s.default.parentData,n._`${s.default.valCxt}.${s.default.parentData}`);e.var(s.default.parentDataProperty,n._`${s.default.valCxt}.${s.default.parentDataProperty}`);e.var(s.default.rootData,n._`${s.default.valCxt}.${s.default.rootData}`);if(t.dynamicRef)e.var(s.default.dynamicAnchors,n._`${s.default.valCxt}.${s.default.dynamicAnchors}`)}),(()=>{e.var(s.default.dataPath,n._`""`);e.var(s.default.parentData,n._`undefined`);e.var(s.default.parentDataProperty,n._`undefined`);e.var(s.default.rootData,s.default.data);if(t.dynamicRef)e.var(s.default.dynamicAnchors,n._`{}`)}))}function topSchemaObjCode(e){const{schema:t,opts:a,gen:r}=e;validateFunction(e,(()=>{if(a.$comment&&t.$comment)commentKeyword(e);checkNoDefault(e);r.let(s.default.vErrors,null);r.let(s.default.errors,0);if(a.unevaluated)resetEvaluated(e);typeAndKeywords(e);returnResults(e)}));return}function resetEvaluated(e){const{gen:t,validateName:a}=e;e.evaluated=t.const("evaluated",n._`${a}.evaluated`);t.if(n._`${e.evaluated}.dynamicProps`,(()=>t.assign(n._`${e.evaluated}.props`,n._`undefined`)));t.if(n._`${e.evaluated}.dynamicItems`,(()=>t.assign(n._`${e.evaluated}.items`,n._`undefined`)))}function funcSourceUrl(e,t){return typeof e=="object"&&e.$id&&(t.code.source||t.code.process)?n._`/*# sourceURL=${e.$id} */`:n.nil}function subschemaCode(e,t){if(isSchemaObj(e)){checkKeywords(e);if(schemaCxtHasRules(e)){subSchemaObjCode(e,t);return}}r.boolOrEmptySchema(e,t)}t.subschemaCode=subschemaCode;function schemaCxtHasRules({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const a in e)if(t.RULES.all[a])return true;return false}t.schemaCxtHasRules=schemaCxtHasRules;function isSchemaObj(e){return typeof e.schema!="boolean"}function subSchemaObjCode(e,t){const{schema:a,gen:r,opts:i}=e;if(i.$comment&&a.$comment)commentKeyword(e);updateContext(e);checkAsync(e);const o=r.const("_errs",s.default.errors);typeAndKeywords(e,o);r.var(t,n._`${o} === ${s.default.errors}`)}function checkKeywords(e){u.checkUnknownRules(e);checkRefsAndKeywords(e)}function typeAndKeywords(e,t){if(e.opts.jtd)return o.schemaKeywords(e,[],false,t);const a=i.getSchemaTypes(e.schema);const r=i.coerceAndCheckDataType(e,a);o.schemaKeywords(e,a,!r,t)}function checkRefsAndKeywords(e){const{schema:t,errSchemaPath:a,opts:r,self:i}=e;if(t.$ref&&r.ignoreKeywordsWithRef&&u.schemaHasRulesButRef(t,i.RULES)){i.logger.warn(`$ref: keywords ignored in schema at path "${a}"`)}}function checkNoDefault(e){const{schema:t,opts:a}=e;if(t.default!==undefined&&a.useDefaults&&a.strict){checkStrictMode(e,"default is ignored in the schema root")}}function updateContext(e){if(e.schema.$id)e.baseId=c.resolveUrl(e.baseId,e.schema.$id)}function checkAsync(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function commentKeyword({gen:e,schemaEnv:t,schema:a,errSchemaPath:r,opts:i}){const o=a.$comment;if(i.$comment===true){e.code(n._`${s.default.self}.logger.log(${o})`)}else if(typeof i.$comment=="function"){const a=n.str`${r}/$comment`;const i=e.scopeValue("root",{ref:t.root});e.code(n._`${s.default.self}.opts.$comment(${o}, ${a}, ${i}.schema)`)}}function returnResults(e){const{gen:t,schemaEnv:a,validateName:r,ValidationError:i,opts:o}=e;if(a.$async){t.if(n._`${s.default.errors} === 0`,(()=>t.return(s.default.data)),(()=>t.throw(n._`new ${i}(${s.default.vErrors})`)))}else{t.assign(n._`${r}.errors`,s.default.vErrors);if(o.unevaluated)assignEvaluated(e);t.return(n._`${s.default.errors} === 0`)}}function assignEvaluated({gen:e,evaluated:t,props:a,items:r}){if(a instanceof n.Name)e.assign(n._`${t}.props`,a);if(r instanceof n.Name)e.assign(n._`${t}.items`,r)}function checkStrictMode(e,t,a=e.opts.strict){if(!a)return;t=`strict mode: ${t}`;if(a===true)throw new Error(t);e.self.logger.warn(t)}t.checkStrictMode=checkStrictMode},2265:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.schemaKeywords=void 0;const r=a(2886);const i=a(9499);const o=a(3065);const n=a(7604);const s=a(1882);const c=a(5327);const u=a(9722);const l=a(3068);function schemaKeywords(e,t,a,o){const{gen:c,schema:p,data:f,allErrors:m,opts:h,self:g}=e;const{RULES:y}=g;if(p.$ref&&(h.ignoreKeywordsWithRef||!s.schemaHasRulesButRef(p,y))){c.block((()=>n.keywordCode(e,"$ref",y.all.$ref.definition)));return}if(!h.jtd)checkStrictTypes(e,t);c.block((()=>{for(const e of y.rules)groupKeywords(e);groupKeywords(y.post)}));function groupKeywords(n){if(!r.shouldUseGroup(p,n))return;if(n.type){c.if(i.checkDataType(n.type,f,h.strict));iterateKeywords(e,n);if(t.length===1&&t[0]===n.type&&a){c.else();i.reportTypeError(e)}c.endIf()}else{iterateKeywords(e,n)}if(!m)c.if(u._`${l.default.errors} === ${o||0}`)}}t.schemaKeywords=schemaKeywords;function iterateKeywords(e,t){const{gen:a,schema:i,opts:{useDefaults:s}}=e;if(s)o.assignDefaults(e,t.type);a.block((()=>{for(const a of t.rules){if(r.shouldUseRule(i,a)){n.keywordCode(e,a.keyword,a.definition,t.type)}}}))}function checkStrictTypes(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;checkContextTypes(e,t);if(!e.opts.allowUnionTypes)checkMultipleTypes(e,t);checkKeywordTypes(e,e.dataTypes)}function checkContextTypes(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((t=>{if(!includesType(e.dataTypes,t)){strictTypesError(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}}));e.dataTypes=e.dataTypes.filter((e=>includesType(t,e)))}function checkMultipleTypes(e,t){if(t.length>1&&!(t.length===2&&t.includes("null"))){strictTypesError(e,"use allowUnionTypes to allow union type keyword")}}function checkKeywordTypes(e,t){const a=e.self.RULES.all;for(const i in a){const o=a[i];if(typeof o=="object"&&r.shouldUseRule(e.schema,o)){const{type:a}=o.definition;if(a.length&&!a.some((e=>hasApplicableType(t,e)))){strictTypesError(e,`missing type "${a.join(",")}" for keyword "${i}"`)}}}}function hasApplicableType(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function includesType(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function strictTypesError(e,t){const a=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${a}" (strictTypes)`;c.checkStrictMode(e,t,e.opts.strictTypes)}},7604:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.keywordCode=void 0;const r=a(4323);const i=a(7841);const o=a(1154);const n=a(9722);const s=a(3068);function keywordCode(e,t,a,i){const o=new r.default(e,a,t);if("code"in a){a.code(o,i)}else if(o.$data&&a.validate){funcKeywordCode(o,a)}else if("macro"in a){macroKeywordCode(o,a)}else if(a.compile||a.validate){funcKeywordCode(o,a)}}t.keywordCode=keywordCode;function macroKeywordCode(e,t){const{gen:a,keyword:r,schema:i,parentSchema:o,it:s}=e;const c=t.macro.call(s.self,i,o,s);const u=useKeyword(a,r,c);if(s.opts.validateSchema!==false)s.self.validateSchema(c,true);const l=a.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${s.errSchemaPath}/${r}`,topSchemaRef:u,compositeRule:true},l);e.pass(l,(()=>e.error(true)))}function funcKeywordCode(e,t){var a;const{gen:r,keyword:i,schema:c,parentSchema:u,$data:l,it:p}=e;checkAsync(p,t);const f=!l&&t.compile?t.compile.call(p.self,c,u,p):t.validate;const m=useKeyword(r,i,f);const h=r.let("valid");e.block$data(h,validateKeyword);e.ok((a=t.valid)!==null&&a!==void 0?a:h);function validateKeyword(){if(t.errors===false){assignValid();if(t.modifying)modifyData(e);reportErrs((()=>e.error()))}else{const a=t.async?validateAsync():validateSync();if(t.modifying)modifyData(e);reportErrs((()=>addErrs(e,a)))}}function validateAsync(){const e=r.let("ruleErrs",null);r.try((()=>assignValid(n._`await `)),(t=>r.assign(h,false).if(n._`${t} instanceof ${p.ValidationError}`,(()=>r.assign(e,n._`${t}.errors`)),(()=>r.throw(t)))));return e}function validateSync(){const e=n._`${m}.errors`;r.assign(e,null);assignValid(n.nil);return e}function assignValid(a=(t.async?n._`await `:n.nil)){const i=p.opts.passContext?s.default.this:s.default.self;const c=!("compile"in t&&!l||t.schema===false);r.assign(h,n._`${a}${o.callValidateCode(e,m,i,c)}`,t.modifying)}function reportErrs(e){var a;r.if(n.not((a=t.valid)!==null&&a!==void 0?a:h),e)}}function modifyData(e){const{gen:t,data:a,it:r}=e;t.if(r.parentData,(()=>t.assign(a,n._`${r.parentData}[${r.parentDataProperty}]`)))}function addErrs(e,t){const{gen:a}=e;a.if(n._`Array.isArray(${t})`,(()=>{a.assign(s.default.vErrors,n._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,n._`${s.default.vErrors}.length`);i.extendErrors(e)}),(()=>e.error()))}function checkAsync({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function useKeyword(e,t,a){if(a===undefined)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof a=="function"?{ref:a}:{ref:a,code:n.stringify(a)})}},7111:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=a(4323);t.KeywordCxt=r.default;var i=a(9722);Object.defineProperty(t,"_",{enumerable:true,get:function(){return i._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return i.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return i.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return i.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return i.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return i.CodeGen}});const o=a(7661);const n=a(3727);const s=a(6016);const c=a(9722);const u=a(6808);const l=a(9499);const p=a(1882);const f=a(6435);const m=["removeAdditional","useDefaults","coerceTypes"];const h=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]);const g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",schemaId:"JSON Schema draft-04 is not supported in Ajv v7.",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",strictNumbers:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key."};const y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function requiredOptions(e){var t,a,r,i,o,n,s,c,u,l,p,f;const m=(t=e.strict)!==null&&t!==void 0?t:true;const h=m?"log":false;const g=(a=e.code)===null||a===void 0?void 0:a.optimize;const y=g===true||g===undefined?1:g||0;return{strict:m,strictTypes:(r=e.strictTypes)!==null&&r!==void 0?r:h,strictTuples:(i=e.strictTuples)!==null&&i!==void 0?i:h,code:e.code?{...e.code,optimize:y}:{optimize:y},loopRequired:(o=e.loopRequired)!==null&&o!==void 0?o:Infinity,loopEnum:(n=e.loopEnum)!==null&&n!==void 0?n:Infinity,meta:(s=e.meta)!==null&&s!==void 0?s:true,messages:(c=e.messages)!==null&&c!==void 0?c:true,inlineRefs:(u=e.inlineRefs)!==null&&u!==void 0?u:true,addUsedSchema:(l=e.addUsedSchema)!==null&&l!==void 0?l:true,validateSchema:(p=e.validateSchema)!==null&&p!==void 0?p:true,validateFormats:(f=e.validateFormats)!==null&&f!==void 0?f:true}}class Ajv{constructor(e={}){this.schemas={};this.refs={};this.formats={};this._compilations=new Set;this._loading={};this._cache=new Map;e=this.opts={...e,...requiredOptions(e)};const{es5:t,lines:a}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:h,es5:t,lines:a});this.logger=getLogger(e.logger);const r=e.validateFormats;e.validateFormats=false;this.RULES=n.getRules();checkOptions.call(this,g,e,"NOT SUPPORTED");checkOptions.call(this,y,e,"DEPRECATED","warn");this._metaOpts=getMetaSchemaOptions.call(this);if(e.formats)addInitialFormats.call(this);this._addVocabularies();this._addDefaultMetaSchema();if(e.keywords)addInitialKeywords.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);addInitialSchemas.call(this);e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t}=this.opts;if(t&&e)this.addMetaSchema(f,f.$id,false)}defaultMeta(){const{meta:e}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e.$id||e:undefined}validate(e,t){let a;if(typeof e=="string"){a=this.getSchema(e);if(!a)throw new Error(`no schema with key or ref "${e}"`)}else{a=this.compile(e)}const r=a(t);if(!("$async"in a))this.errors=a.errors;return r}compile(e,t){const a=this._addSchema(e,t);return a.validate||this._compileSchemaEnv(a)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function"){throw new Error("options.loadSchema should be a function")}const{loadSchema:a}=this.opts;return runCompileAsync.call(this,e,t);async function runCompileAsync(e,t){await loadMetaSchema.call(this,e.$schema);const a=this._addSchema(e,t);return a.validate||_compileAsync.call(this,a)}async function loadMetaSchema(e){if(e&&!this.getSchema(e)){await runCompileAsync.call(this,{$ref:e},true)}}async function _compileAsync(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.MissingRefError))throw t;checkLoaded.call(this,t);await loadMissingSchema.call(this,t.missingSchema);return _compileAsync.call(this,e)}}function checkLoaded({missingSchema:e,missingRef:t}){if(this.refs[e]){throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}}async function loadMissingSchema(e){const a=await _loadSchema.call(this,e);if(!this.refs[e])await loadMetaSchema.call(this,a.$schema);if(!this.refs[e])this.addSchema(a,e,t)}async function _loadSchema(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=a(e))}finally{delete this._loading[e]}}}addSchema(e,t,a,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,undefined,a,r);return this}let i;if(typeof e==="object"){i=e.$id;if(i!==undefined&&typeof i!="string")throw new Error("schema id must be string")}t=u.normalizeId(t||i);this._checkUnique(t);this.schemas[t]=this._addSchema(e,a,r,true);return this}addMetaSchema(e,t,a=this.opts.validateSchema){this.addSchema(e,t,true,a);return this}validateSchema(e,t){if(typeof e=="boolean")return true;let a;a=e.$schema;if(a!==undefined&&typeof a!="string"){throw new Error("$schema must be a string")}a=a||this.opts.defaultMeta||this.defaultMeta();if(!a){this.logger.warn("meta-schema not available");this.errors=null;return true}const r=this.validate(a,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(e);else throw new Error(e)}return r}getSchema(e){let t;while(typeof(t=getSchEnv.call(this,e))=="string")e=t;if(t===undefined){const a=new s.SchemaEnv({schema:{}});t=s.resolveSchema.call(this,a,e);if(!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp){this._removeAllSchemas(this.schemas,e);this._removeAllSchemas(this.refs,e);return this}switch(typeof e){case"undefined":this._removeAllSchemas(this.schemas);this._removeAllSchemas(this.refs);this._cache.clear();return this;case"string":{const t=getSchEnv.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);delete this.schemas[e];delete this.refs[e];return this}case"object":{const t=e;this._cache.delete(t);let a=e.$id;if(a){a=u.normalizeId(a);delete this.schemas[a];delete this.refs[a]}return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let a;if(typeof e=="string"){a=e;if(typeof t=="object"){this.logger.warn("these parameters are deprecated, see docs for addKeyword");t.keyword=a}}else if(typeof e=="object"&&t===undefined){t=e;a=t.keyword;if(Array.isArray(a)&&!a.length){throw new Error("addKeywords: keyword must be string or non-empty array")}}else{throw new Error("invalid addKeywords parameters")}checkKeyword.call(this,a,t);if(!t){p.eachItem(a,(e=>addRule.call(this,e)));return this}keywordMetaschema.call(this,t);const r={...t,type:l.getJSONTypes(t.type),schemaType:l.getJSONTypes(t.schemaType)};p.eachItem(a,r.type.length===0?e=>addRule.call(this,e,r):e=>r.type.forEach((t=>addRule.call(this,e,r,t))));return this}getKeyword(e){const t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e];delete t.all[e];for(const a of t.rules){const t=a.rules.findIndex((t=>t.keyword===e));if(t>=0)a.rules.splice(t,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);this.formats[e]=t;return this}errorsText(e=this.errors,{separator:t=", ",dataVar:a="data"}={}){if(!e||e.length===0)return"No errors";return e.map((e=>`${a}${e.dataPath} ${e.message}`)).reduce(((e,a)=>e+t+a))}$dataMetaSchema(e,t){const a=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in a){const t=a[e];if(typeof t!="object")continue;const{$data:r}=t.definition;const o=i[e];if(r&&o)i[e]=schemaOrData(o)}}return e}_removeAllSchemas(e,t){for(const a in e){const r=e[a];if(!t||t.test(a)){if(typeof r=="string"){delete e[a]}else if(r&&!r.meta){this._cache.delete(r.schema);delete e[a]}}}}_addSchema(e,t,a=this.opts.validateSchema,r=this.opts.addUsedSchema){if(typeof e!="object"){if(this.opts.jtd)throw new Error("schema must be object");else if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(i!==undefined)return i;const o=u.getSchemaRefs.call(this,e);i=new s.SchemaEnv({schema:e,meta:t,localRefs:o});this._cache.set(i.schema,i);const n=i.baseId;if(r&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=i}if(a)this.validateSchema(e,true);return i}_checkUnique(e){if(this.schemas[e]||this.refs[e]){throw new Error(`schema with key or id "${e}" already exists`)}}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else s.compileSchema.call(this,e);if(!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}}t["default"]=Ajv;Ajv.ValidationError=o.ValidationError;Ajv.MissingRefError=o.MissingRefError;function checkOptions(e,t,a,r="error"){for(const i in e){const o=i;if(o in t)this.logger[r](`${a}: option ${i}. ${e[o]}`)}}function getSchEnv(e){e=u.normalizeId(e);return this.schemas[e]||this.refs[e]}function addInitialSchemas(){const e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function addInitialFormats(){for(const e in this.opts.formats){const t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function addInitialKeywords(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const a=e[t];if(!a.keyword)a.keyword=t;this.addKeyword(a)}}function getMetaSchemaOptions(){const e={...this.opts};for(const t of m)delete e[t];return e}const b={log(){},warn(){},error(){}};function getLogger(e){if(e===false)return b;if(e===undefined)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}const k=/^[a-z_$][a-z0-9_$:-]*$/i;function checkKeyword(e,t){const{RULES:a}=this;p.eachItem(e,(e=>{if(a.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)}));if(!t)return;if(t.$data&&!("code"in t||"validate"in t)){throw new Error('$data keyword must have "code" or "validate" function')}}function addRule(e,t,a){var r;const i=t===null||t===void 0?void 0:t.post;if(a&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let n=i?o.post:o.rules.find((({type:e})=>e===a));if(!n){n={type:a,rules:[]};o.rules.push(n)}o.keywords[e]=true;if(!t)return;const s={keyword:e,definition:{...t,type:l.getJSONTypes(t.type),schemaType:l.getJSONTypes(t.schemaType)}};if(t.before)addBeforeRule.call(this,n,s,t.before);else n.rules.push(s);o.all[e]=s;(r=t.implements)===null||r===void 0?void 0:r.forEach((e=>this.addKeyword(e)))}function addBeforeRule(e,t,a){const r=e.rules.findIndex((e=>e.keyword===a));if(r>=0){e.rules.splice(r,0,t)}else{e.rules.push(t);this.logger.warn(`rule ${a} is not defined`)}}function keywordMetaschema(e){let{metaSchema:t}=e;if(t===undefined)return;if(e.$data&&this.opts.$data)t=schemaOrData(t);e.validateSchema=this.compile(t,true)}const w={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function schemaOrData(e){return{anyOf:[e,w]}}},6658:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(9329);const o=a(1882);const n=a(5327);const s={message:({params:{len:e}})=>r.str`should NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`};const c={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:s,code(e){const{gen:t,schema:a,parentSchema:s,data:c,it:u}=e;const{items:l}=s;if(!Array.isArray(l)){n.checkStrictMode(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}u.items=true;const p=t.const("len",r._`${c}.length`);if(a===false){e.setParams({len:l.length});e.pass(r._`${p} <= ${l.length}`)}else if(typeof a=="object"&&!o.alwaysValidSchema(u,a)){const a=t.var("valid",r._`${p} <= ${l.length}`);t.if(r.not(a),(()=>validateItems(a)));e.ok(a)}function validateItems(a){t.forRange("i",l.length,p,(o=>{e.subschema({keyword:"additionalItems",dataProp:o,dataPropType:i.Type.Num},a);if(!u.allErrors)t.if(r.not(a),(()=>t.break()))}))}}};t["default"]=c},3801:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i=a(9722);const o=a(3068);const n=a(9329);const s=a(1882);const c={message:"should NOT have additional properties",params:({params:e})=>i._`{additionalProperty: ${e.additionalProperty}}`};const u={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:true,trackErrors:true,error:c,code(e){const{gen:t,schema:a,parentSchema:c,data:u,errsCount:l,it:p}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:f,opts:m}=p;p.props=true;if(m.removeAdditional!=="all"&&s.alwaysValidSchema(p,a))return;const h=r.allSchemaProperties(c.properties);const g=r.allSchemaProperties(c.patternProperties);checkAdditionalProperties();e.ok(i._`${l} === ${o.default.errors}`);function checkAdditionalProperties(){t.forIn("key",u,(e=>{if(!h.length&&!g.length)additionalPropertyCode(e);else t.if(isAdditional(e),(()=>additionalPropertyCode(e)))}))}function isAdditional(e){let a;if(h.length>8){const i=s.schemaRefOrVal(p,c.properties,"properties");a=r.isOwnProperty(t,i,e)}else if(h.length){a=i.or(...h.map((t=>i._`${e} === ${t}`)))}else{a=i.nil}if(g.length){a=i.or(a,...g.map((a=>i._`${r.usePattern(t,a)}.test(${e})`)))}return i.not(a)}function deleteAdditional(e){t.code(i._`delete ${u}[${e}]`)}function additionalPropertyCode(r){if(m.removeAdditional==="all"||m.removeAdditional&&a===false){deleteAdditional(r);return}if(a===false){e.setParams({additionalProperty:r});e.error();if(!f)t.break();return}if(typeof a=="object"&&!s.alwaysValidSchema(p,a)){const a=t.name("valid");if(m.removeAdditional==="failing"){applyAdditionalSchema(r,a,false);t.if(i.not(a),(()=>{e.reset();deleteAdditional(r)}))}else{applyAdditionalSchema(r,a);if(!f)t.if(i.not(a),(()=>t.break()))}}}function applyAdditionalSchema(t,a,r){const i={keyword:"additionalProperties",dataProp:t,dataPropType:n.Type.Str};if(r===false){Object.assign(i,{compositeRule:true,createErrors:false,allErrors:false})}e.subschema(i,a)}}};t["default"]=u},9467:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1882);const i={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:a,it:i}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");const o=t.name("valid");a.forEach(((t,a)=>{if(r.alwaysValidSchema(i,t))return;const n=e.subschema({keyword:"allOf",schemaProp:a},o);e.ok(o);e.mergeEvaluated(n)}))}};t["default"]=i},70:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i={keyword:"anyOf",schemaType:"array",trackErrors:true,code:r.validateUnion,error:{message:"should match some schema in anyOf"}};t["default"]=i},8732:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(9329);const o=a(1882);const n=a(5327);const s={message:({params:{min:e,max:t}})=>t===undefined?r.str`should contain at least ${e} valid item(s)`:r.str`should contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===undefined?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`};const c={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:s,code(e){const{gen:t,schema:a,parentSchema:s,data:c,it:u}=e;let l;let p;const{minContains:f,maxContains:m}=s;if(u.opts.next){l=f===undefined?1:f;p=m}else{l=1}const h=t.const("len",r._`${c}.length`);e.setParams({min:l,max:p});if(p===undefined&&l===0){n.checkStrictMode(u,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(p!==undefined&&l>p){n.checkStrictMode(u,`"minContains" > "maxContains" is always invalid`);e.fail();return}if(o.alwaysValidSchema(u,a)){let t=r._`${h} >= ${l}`;if(p!==undefined)t=r._`${t} && ${h} <= ${p}`;e.pass(t);return}u.items=true;const g=t.name("valid");if(p===undefined&&l===1){validateItems(g,(()=>t.if(g,(()=>t.break()))))}else{t.let(g,false);const e=t.name("_valid");const a=t.let("count",0);validateItems(e,(()=>t.if(e,(()=>checkLimits(a)))))}e.result(g,(()=>e.reset()));function validateItems(a,r){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:i.Type.Num,compositeRule:true},a);r()}))}function checkLimits(e){t.code(r._`${e}++`);if(p===undefined){t.if(r._`${e} >= ${l}`,(()=>t.assign(g,true).break()))}else{t.if(r._`${e} > ${p}`,(()=>t.assign(g,false).break()));if(l===1)t.assign(g,true);else t.if(r._`${e} >= ${l}`,(()=>t.assign(g,true)))}}}};t["default"]=c},812:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=a(9722);const i=a(1882);const o=a(1154);t.error={message:({params:{property:e,depsCount:t,deps:a}})=>{const i=t===1?"property":"properties";return r.str`should have ${i} ${a} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:a,missingProperty:i}})=>r._`{property: ${e},
5
5
  missingProperty: ${i},
6
6
  depsCount: ${t},
7
- deps: ${a}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,a]=splitDependencies(e);validatePropertyDeps(e,t);validateSchemaDeps(e,a)}};function splitDependencies({schema:e}){const t={};const a={};for(const r in e){if(r==="__proto__")continue;const i=Array.isArray(e[r])?t:a;i[r]=e[r]}return[t,a]}function validatePropertyDeps(e,t=e.schema){const{gen:a,data:i,it:n}=e;if(Object.keys(t).length===0)return;const s=a.let("missing");for(const c in t){const u=t[c];if(u.length===0)continue;const l=o.propertyInData(a,i,c,n.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")});if(n.allErrors){a.if(l,(()=>{for(const t of u){o.checkReportMissingProp(e,t)}}))}else{a.if(r._`${l} && (${o.checkMissingProp(e,u,s)})`);o.reportMissingProp(e,s);a.else()}}}t.validatePropertyDeps=validatePropertyDeps;function validateSchemaDeps(e,t=e.schema){const{gen:a,data:r,keyword:n,it:s}=e;const c=a.name("valid");for(const u in t){if(i.alwaysValidSchema(s,t[u]))continue;a.if(o.propertyInData(a,r,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:n,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>a.var(c,true)));e.ok(c)}}t.validateSchemaDeps=validateSchemaDeps;t["default"]=n},6206:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o=a(5327);const n={message:({params:e})=>r.str`should match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`};const s={keyword:"if",schemaType:["object","boolean"],trackErrors:true,error:n,code(e){const{gen:t,parentSchema:a,it:i}=e;if(a.then===undefined&&a.else===undefined){o.checkStrictMode(i,'"if" without "then" and "else" is ignored')}const n=hasSchema(i,"then");const s=hasSchema(i,"else");if(!n&&!s)return;const c=t.let("valid",true);const u=t.name("_valid");validateIf();e.reset();if(n&&s){const a=t.let("ifClause");e.setParams({ifClause:a});t.if(u,validateClause("then",a),validateClause("else",a))}else if(n){t.if(u,validateClause("then"))}else{t.if(r.not(u),validateClause("else"))}e.pass(c,(()=>e.error(true)));function validateIf(){const t=e.subschema({keyword:"if",compositeRule:true,createErrors:false,allErrors:false},u);e.mergeEvaluated(t)}function validateClause(a,i){return()=>{const o=e.subschema({keyword:a},u);t.assign(c,u);e.mergeValidEvaluated(o,c);if(i)t.assign(i,r._`${a}`);else e.setParams({ifClause:a})}}}};function hasSchema(e,t){const a=e.schema[t];return a!==undefined&&!i.alwaysValidSchema(e,a)}t["default"]=s},8321:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(6658);const i=a(6281);const o=a(8732);const n=a(812);const s=a(4414);const c=a(3801);const u=a(4764);const l=a(6438);const p=a(620);const f=a(70);const m=a(32);const h=a(9467);const g=a(6206);const y=a(8359);const b=[p.default,f.default,m.default,h.default,g.default,y.default,r.default,i.default,o.default,s.default,c.default,n.default,u.default,l.default];t["default"]=b},6281:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o=a(5327);const n=a(1154);const s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{gen:t,schema:a,it:s}=e;if(Array.isArray(a)){if(s.opts.unevaluated&&a.length&&s.items!==true){s.items=i.mergeEvaluated.items(t,a.length,s.items)}validateTuple(a)}else{s.items=true;if(i.alwaysValidSchema(s,a))return;e.ok(n.validateArray(e))}function validateTuple(a){const{parentSchema:n,data:c}=e;if(s.opts.strictTuples&&!fullTupleSchema(a.length,n)){const e=`"items" is ${a.length}-tuple, but minItems or maxItems/additionalItems are not specified or different`;o.checkStrictMode(s,e,s.opts.strictTuples)}const u=t.name("valid");const l=t.const("len",r._`${c}.length`);a.forEach(((a,o)=>{if(i.alwaysValidSchema(s,a))return;t.if(r._`${l} > ${o}`,(()=>e.subschema({keyword:"items",schemaProp:o,dataProp:o},u)));e.ok(u)}))}}};function fullTupleSchema(e,t){return e===t.minItems&&(e===t.maxItems||t.additionalItems===false)}t["default"]=s},620:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1882);const i={keyword:"not",schemaType:["object","boolean"],trackErrors:true,code(e){const{gen:t,schema:a,it:i}=e;if(r.alwaysValidSchema(i,a)){e.fail();return}const o=t.name("valid");e.subschema({keyword:"not",compositeRule:true,createErrors:false,allErrors:false},o);e.result(o,(()=>e.error()),(()=>e.reset()))},error:{message:"should NOT be valid"}};t["default"]=i},32:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o={message:"should match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`};const n={keyword:"oneOf",schemaType:"array",trackErrors:true,error:o,code(e){const{gen:t,schema:a,it:o}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");const n=a;const s=t.let("valid",false);const c=t.let("passing",null);const u=t.name("_valid");e.setParams({passing:c});t.block(validateOneOf);e.result(s,(()=>e.reset()),(()=>e.error(true)));function validateOneOf(){n.forEach(((a,n)=>{let l;if(i.alwaysValidSchema(o,a)){t.var(u,true)}else{l=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:true},u)}if(n>0){t.if(r._`${u} && ${s}`).assign(s,false).assign(c,r._`[${c}, ${n}]`).else()}t.if(u,(()=>{t.assign(s,true);t.assign(c,n);if(l)e.mergeEvaluated(l,r.Name)}))}))}}};t["default"]=n},6438:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i=a(9722);const o=a(9329);const n=a(5327);const s=a(1882);const c={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:a,data:c,parentSchema:u,it:l}=e;const{opts:p}=l;const f=r.schemaProperties(l,a);if(f.length===0)return;const m=p.strict&&!p.allowMatchingProperties&&u.properties;const h=t.name("valid");if(l.props!==true&&!(l.props instanceof i.Name)){l.props=s.evaluatedPropsToName(t,l.props)}const{props:g}=l;validatePatternProperties();function validatePatternProperties(){for(const e of f){if(m)checkMatchingProperties(e);if(l.allErrors){validateProperties(e)}else{t.var(h,true);validateProperties(e);t.if(h)}}}function checkMatchingProperties(e){for(const t in m){if(new RegExp(e).test(t)){n.checkStrictMode(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}}}function validateProperties(a){t.forIn("key",c,(n=>{t.if(i._`${r.usePattern(t,a)}.test(${n})`,(()=>{e.subschema({keyword:"patternProperties",schemaProp:a,dataProp:n,dataPropType:o.Type.Str},h);if(l.opts.unevaluated&&g!==true){t.assign(i._`${g}[${n}]`,true)}else if(!l.allErrors){t.if(i.not(h),(()=>t.break()))}}))}))}}};t["default"]=c},4764:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(4323);const i=a(1154);const o=a(1882);const n=a(3801);const s={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:a,parentSchema:s,data:c,it:u}=e;if(u.opts.removeAdditional==="all"&&s.additionalProperties===undefined){n.default.code(new r.default(u,n.default,"additionalProperties"))}const l=i.allSchemaProperties(a);for(const e of l){u.definedProperties.add(e)}if(u.opts.unevaluated&&l.length&&u.props!==true){u.props=o.mergeEvaluated.props(t,o.toHash(l),u.props)}const p=l.filter((e=>!o.alwaysValidSchema(u,a[e])));if(p.length===0)return;const f=t.name("valid");for(const a of p){if(hasDefault(a)){applyPropertySchema(a)}else{t.if(i.propertyInData(t,c,a,u.opts.ownProperties));applyPropertySchema(a);if(!u.allErrors)t.else().var(f,true);t.endIf()}e.it.definedProperties.add(a);e.ok(f)}function hasDefault(e){return u.opts.useDefaults&&!u.compositeRule&&a[e].default!==undefined}function applyPropertySchema(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},f)}}};t["default"]=s},4414:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o={message:({params:e})=>r.str`property name '${e.propertyName}' is invalid`,params:({params:e})=>r._`{propertyName: ${e.propertyName}}`};const n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:o,code(e){const{gen:t,schema:a,data:o,it:n}=e;if(i.alwaysValidSchema(n,a))return;const s=t.name("valid");t.forIn("key",o,(a=>{e.setParams({propertyName:a});e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:true},s);t.if(r.not(s),(()=>{e.error(true);if(!n.allErrors)t.break()}))}));e.ok(s)}};t["default"]=n},8359:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(5327);const i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:a}){if(t.if===undefined)r.checkStrictMode(a,`"${e}" without "if" is ignored`)}};t["default"]=i},1154:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=a(9722);const i=a(1882);const o=a(9329);const n=a(3068);function checkReportMissingProp(e,t){const{gen:a,data:i,it:o}=e;a.if(noPropertyInData(a,i,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},true);e.error()}))}t.checkReportMissingProp=checkReportMissingProp;function checkMissingProp({gen:e,data:t,it:{opts:a}},i,o){return r.or(...i.map((i=>r.and(noPropertyInData(e,t,i,a.ownProperties),r._`${o} = ${i}`))))}t.checkMissingProp=checkMissingProp;function reportMissingProp(e,t){e.setParams({missingProperty:t},true);e.error()}t.reportMissingProp=reportMissingProp;function hasPropFunc(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}t.hasPropFunc=hasPropFunc;function isOwnProperty(e,t,a){return r._`${hasPropFunc(e)}.call(${t}, ${a})`}t.isOwnProperty=isOwnProperty;function propertyInData(e,t,a,i){const o=r._`${t}${r.getProperty(a)} !== undefined`;return i?r._`${o} && ${isOwnProperty(e,t,a)}`:o}t.propertyInData=propertyInData;function noPropertyInData(e,t,a,i){const o=r._`${t}${r.getProperty(a)} === undefined`;return i?r.or(o,r.not(isOwnProperty(e,t,a))):o}t.noPropertyInData=noPropertyInData;function allSchemaProperties(e){return e?Object.keys(e).filter((e=>e!=="__proto__")):[]}t.allSchemaProperties=allSchemaProperties;function schemaProperties(e,t){return allSchemaProperties(t).filter((a=>!i.alwaysValidSchema(e,t[a])))}t.schemaProperties=schemaProperties;function callValidateCode({schemaCode:e,data:t,it:{gen:a,topSchemaRef:i,schemaPath:o,errorPath:s},it:c},u,l,p){const f=p?r._`${e}, ${t}, ${i}${o}`:t;const m=[[n.default.dataPath,r.strConcat(n.default.dataPath,s)],[n.default.parentData,c.parentData],[n.default.parentDataProperty,c.parentDataProperty],[n.default.rootData,n.default.rootData]];if(c.opts.dynamicRef)m.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const h=r._`${f}, ${a.object(...m)}`;return l!==r.nil?r._`${u}.call(${l}, ${h})`:r._`${u}(${h})`}t.callValidateCode=callValidateCode;function usePattern(e,t){return e.scopeValue("pattern",{key:t,ref:new RegExp(t,"u"),code:r._`new RegExp(${t}, "u")`})}t.usePattern=usePattern;function validateArray(e){const{gen:t,data:a,keyword:i,it:n}=e;const s=t.name("valid");if(n.allErrors){const e=t.let("valid",true);validateItems((()=>t.assign(e,false)));return e}t.var(s,true);validateItems((()=>t.break()));return s;function validateItems(n){const c=t.const("len",r._`${a}.length`);t.forRange("i",0,c,(a=>{e.subschema({keyword:i,dataProp:a,dataPropType:o.Type.Num},s);t.if(r.not(s),n)}))}}t.validateArray=validateArray;function validateUnion(e){const{gen:t,schema:a,keyword:o,it:n}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");const s=a.some((e=>i.alwaysValidSchema(n,e)));if(s&&!n.opts.unevaluated)return;const c=t.let("valid",false);const u=t.name("_valid");t.block((()=>a.forEach(((a,i)=>{const n=e.subschema({keyword:o,schemaProp:i,compositeRule:true},u);t.assign(c,r._`${c} || ${u}`);const s=e.mergeValidEvaluated(n,u);if(!s)t.if(r.not(c))}))));e.result(c,(()=>e.reset()),(()=>e.error(true)))}t.validateUnion=validateUnion},7722:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t["default"]=a},4831:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(7722);const i=a(2938);const o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,i.default];t["default"]=o},2938:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.callRef=t.getValidate=void 0;const r=a(7661);const i=a(1154);const o=a(9722);const n=a(3068);const s=a(6016);const c=a(1882);const u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:a,it:i}=e;const{baseId:n,schemaEnv:c,validateName:u,opts:l,self:p}=i;if(a==="#"||a==="#/")return callRootRef();const f=s.resolveRef.call(p,c.root,n,a);if(f===undefined)throw new r.MissingRefError(n,a);if(f instanceof s.SchemaEnv)return callValidate(f);return inlineRefSchema(f);function callRootRef(){if(c===c.root)return callRef(e,u,c,c.$async);const a=t.scopeValue("root",{ref:c.root});return callRef(e,o._`${a}.validate`,c.root,c.root.$async)}function callValidate(t){const a=getValidate(e,t);callRef(e,a,t,t.$async)}function inlineRefSchema(r){const i=t.scopeValue("schema",l.code.source===true?{ref:r,code:o.stringify(r)}:{ref:r});const n=t.name("valid");const s=e.subschema({schema:r,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:a},n);e.mergeEvaluated(s);e.ok(n)}}};function getValidate(e,t){const{gen:a}=e;return t.validate?a.scopeValue("validate",{ref:t.validate}):o._`${a.scopeValue("wrapper",{ref:t})}.validate`}t.getValidate=getValidate;function callRef(e,t,a,r){const{gen:s,it:u}=e;const{allErrors:l,schemaEnv:p,opts:f}=u;const m=f.passContext?n.default.this:o.nil;if(r)callAsyncRef();else callSyncRef();function callAsyncRef(){if(!p.$async)throw new Error("async schema referenced by sync schema");const a=s.let("valid");s.try((()=>{s.code(o._`await ${i.callValidateCode(e,t,m)}`);addEvaluatedFrom(t);if(!l)s.assign(a,true)}),(e=>{s.if(o._`!(${e} instanceof ${u.ValidationError})`,(()=>s.throw(e)));addErrorsFrom(e);if(!l)s.assign(a,false)}));e.ok(a)}function callSyncRef(){e.result(i.callValidateCode(e,t,m),(()=>addEvaluatedFrom(t)),(()=>addErrorsFrom(t)))}function addErrorsFrom(e){const t=o._`${e}.errors`;s.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`);s.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function addEvaluatedFrom(e){var t;if(!u.opts.unevaluated)return;const r=(t=a===null||a===void 0?void 0:a.validate)===null||t===void 0?void 0:t.evaluated;if(u.props!==true){if(r&&!r.dynamicProps){if(r.props!==undefined){u.props=c.mergeEvaluated.props(s,r.props,u.props)}}else{const t=s.var("props",o._`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(s,t,u.props,o.Name)}}if(u.items!==true){if(r&&!r.dynamicItems){if(r.items!==undefined){u.items=c.mergeEvaluated.items(s,r.items,u.items)}}else{const t=s.var("items",o._`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(s,t,u.items,o.Name)}}}}t.callRef=callRef;t["default"]=u},3295:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(4831);const i=a(7608);const o=a(8321);const n=a(4779);const s=a(3330);const c=[r.default,i.default,o.default,n.default,s.metadataVocabulary,s.contentVocabulary];t["default"]=c},4976:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message:({schemaCode:e})=>r.str`should match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`};const o={keyword:"format",type:["number","string"],schemaType:"string",$data:true,error:i,code(e,t){const{gen:a,data:i,$data:o,schema:n,schemaCode:s,it:c}=e;const{opts:u,errSchemaPath:l,schemaEnv:p,self:f}=c;if(!u.validateFormats)return;if(o)validate$DataFormat();else validateFormat();function validate$DataFormat(){const o=a.scopeValue("formats",{ref:f.formats,code:u.code.formats});const n=a.const("fDef",r._`${o}[${s}]`);const c=a.let("fType");const l=a.let("format");a.if(r._`typeof ${n} == "object" && !(${n} instanceof RegExp)`,(()=>a.assign(c,r._`${n}.type || "string"`).assign(l,r._`${n}.validate`)),(()=>a.assign(c,r._`"string"`).assign(l,n)));e.fail$data(r.or(unknownFmt(),invalidFmt()));function unknownFmt(){if(u.strict===false)return r.nil;return r._`${s} && !${l}`}function invalidFmt(){const e=p.$async?r._`(${n}.async ? await ${l}(${i}) : ${l}(${i}))`:r._`${l}(${i})`;const a=r._`(typeof ${l} == "function" ? ${e} : ${l}.test(${i}))`;return r._`${l} && ${l} !== true && ${c} === ${t} && !${a}`}}function validateFormat(){const o=f.formats[n];if(!o){unknownFormat();return}if(o===true)return;const[s,c,m]=getFormat(o);if(s===t)e.pass(validCondition());function unknownFormat(){if(u.strict===false){f.logger.warn(unknownMsg());return}throw new Error(unknownMsg());function unknownMsg(){return`unknown format "${n}" ignored in schema at path "${l}"`}}function getFormat(e){const t=a.scopeValue("formats",{key:n,ref:e,code:u.code.formats?r._`${u.code.formats}${r.getProperty(n)}`:undefined});if(typeof e=="object"&&!(e instanceof RegExp)){return[e.type||"string",e.validate,r._`${t}.validate`]}return["string",e,t]}function validCondition(){if(typeof o=="object"&&!(o instanceof RegExp)&&o.async){if(!p.$async)throw new Error("async format in sync schema");return r._`await ${m}(${i})`}return typeof c=="function"?r._`${m}(${i})`:r._`${m}.test(${i})`}}}};t["default"]=o},4779:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(4976);const i=[r.default];t["default"]=i},3330:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.contentVocabulary=t.metadataVocabulary=void 0;t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},8912:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(4711);const o={message:"should be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`};const n={keyword:"const",$data:true,error:o,code(e){const t=e.gen.scopeValue("func",{ref:i,code:r._`require("ajv/dist/compile/equal")`});e.fail$data(r._`!${t}(${e.data}, ${e.schemaCode})`)}};t["default"]=n},4870:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(4711);const o={message:"should be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`};const n={keyword:"enum",schemaType:"array",$data:true,error:o,code(e){const{gen:t,data:a,$data:o,schema:n,schemaCode:s,it:c}=e;if(!o&&n.length===0)throw new Error("enum must have non-empty array");const u=n.length>=c.opts.loopEnum;const l=e.gen.scopeValue("func",{ref:i,code:r._`require("ajv/dist/compile/equal")`});let p;if(u||o){p=t.let("valid");e.block$data(p,loopEnum)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");const e=t.const("vSchema",s);p=r.or(...n.map(((t,a)=>equalCode(e,a))))}e.pass(p);function loopEnum(){t.assign(p,false);t.forOf("v",s,(e=>t.if(r._`${l}(${a}, ${e})`,(()=>t.assign(p,true).break()))))}function equalCode(e,t){const i=n[t];return i&&typeof i==="object"?r._`${l}(${a}, ${e}[${t}])`:r._`${a} === ${i}`}}};t["default"]=n},7608:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(3501);const i=a(4206);const o=a(544);const n=a(3133);const s=a(8197);const c=a(8490);const u=a(4590);const l=a(9402);const p=a(8912);const f=a(4870);const m=[r.default,i.default,o.default,n.default,s.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},p.default,f.default];t["default"]=m},4590:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message({keyword:e,schemaCode:t}){const a=e==="maxItems"?"more":"fewer";return r.str`should NOT have ${a} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`};const o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:i,code(e){const{keyword:t,data:a,schemaCode:i}=e;const o=t==="maxItems"?r.operators.GT:r.operators.LT;e.fail$data(r._`${a}.length ${o} ${i}`)}};t["default"]=o},544:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(7879);const o={message({keyword:e,schemaCode:t}){const a=e==="maxLength"?"more":"fewer";return r.str`should NOT have ${a} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`};const n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:o,code(e){const{keyword:t,data:a,schemaCode:o,it:n}=e;const s=t==="maxLength"?r.operators.GT:r.operators.LT;let c;if(n.opts.unicode===false){c=r._`${a}.length`}else{const t=e.gen.scopeValue("func",{ref:i.default,code:r._`require("ajv/dist/compile/ucs2length").default`});c=r._`${t}(${a})`}e.fail$data(r._`${c} ${s} ${o}`)}};t["default"]=n},3501:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=r.operators;const o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}};const n={message:({keyword:e,schemaCode:t})=>r.str`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${o[e].okStr}, limit: ${t}}`};const s={keyword:Object.keys(o),type:"number",schemaType:"number",$data:true,error:n,code(e){const{keyword:t,data:a,schemaCode:i}=e;e.fail$data(r._`${a} ${o[t].fail} ${i} || isNaN(${a})`)}};t["default"]=s},8197:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message({keyword:e,schemaCode:t}){const a=e==="maxProperties"?"more":"fewer";return r.str`should NOT have ${a} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`};const o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:i,code(e){const{keyword:t,data:a,schemaCode:i}=e;const o=t==="maxProperties"?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${a}).length ${o} ${i}`)}};t["default"]=o},4206:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message:({schemaCode:e})=>r.str`should be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`};const o={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:i,code(e){const{gen:t,data:a,schemaCode:i,it:o}=e;const n=o.opts.multipleOfPrecision;const s=t.let("res");const c=n?r._`Math.abs(Math.round(${s}) - ${s}) > 1e-${n}`:r._`${s} !== parseInt(${s})`;e.fail$data(r._`(${i} === 0 || (${s} = ${a}/${i}, ${c}))`)}};t["default"]=o},3133:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i=a(9722);const o={message:({schemaCode:e})=>i.str`should match pattern "${e}"`,params:({schemaCode:e})=>i._`{pattern: ${e}}`};const n={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:o,code(e){const{gen:t,data:a,$data:o,schema:n,schemaCode:s}=e;const c=o?i._`(new RegExp(${s}, "u"))`:r.usePattern(t,n);e.fail$data(i._`!${c}.test(${a})`)}};t["default"]=n},8490:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i=a(9722);const o=a(5327);const n={message:({params:{missingProperty:e}})=>i.str`should have required property '${e}'`,params:({params:{missingProperty:e}})=>i._`{missingProperty: ${e}}`};const s={keyword:"required",type:"object",schemaType:"array",$data:true,error:n,code(e){const{gen:t,schema:a,schemaCode:n,data:s,$data:c,it:u}=e;const{opts:l}=u;if(!c&&a.length===0)return;const p=a.length>=l.loopRequired;if(u.allErrors)allErrorsMode();else exitOnErrorMode();if(l.strictRequired){const t=e.parentSchema.properties;const{definedProperties:r}=e.it;for(const e of a){if((t===null||t===void 0?void 0:t[e])===undefined&&!r.has(e)){const t=u.schemaEnv.baseId+u.errSchemaPath;const a=`required property "${e}" is not defined at "${t}" (strictRequired)`;o.checkStrictMode(u,a,u.opts.strictRequired)}}}function allErrorsMode(){if(p||c){e.block$data(i.nil,loopAllRequired)}else{for(const t of a){r.checkReportMissingProp(e,t)}}}function exitOnErrorMode(){const i=t.let("missing");if(p||c){const a=t.let("valid",true);e.block$data(a,(()=>loopUntilMissing(i,a)));e.ok(a)}else{t.if(r.checkMissingProp(e,a,i));r.reportMissingProp(e,i);t.else()}}function loopAllRequired(){t.forOf("prop",n,(a=>{e.setParams({missingProperty:a});t.if(r.noPropertyInData(t,s,a,l.ownProperties),(()=>e.error()))}))}function loopUntilMissing(a,o){e.setParams({missingProperty:a});t.forOf(a,n,(()=>{t.assign(o,r.propertyInData(t,s,a,l.ownProperties));t.if(i.not(o),(()=>{e.error();t.break()}))}),i.nil)}}};t["default"]=s},9402:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9499);const i=a(9722);const o=a(4711);const n={message:({params:{i:e,j:t}})=>i.str`should NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>i._`{i: ${e}, j: ${t}}`};const s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:n,code(e){const{gen:t,data:a,$data:n,schema:s,parentSchema:c,schemaCode:u,it:l}=e;if(!n&&!s)return;const p=t.let("valid");const f=c.items?r.getSchemaTypes(c.items):[];e.block$data(p,validateUniqueItems,i._`${u} === false`);e.ok(p);function validateUniqueItems(){const r=t.let("i",i._`${a}.length`);const o=t.let("j");e.setParams({i:r,j:o});t.assign(p,true);t.if(i._`${r} > 1`,(()=>(canOptimize()?loopN:loopN2)(r,o)))}function canOptimize(){return f.length>0&&!f.some((e=>e==="object"||e==="array"))}function loopN(o,n){const s=t.name("item");const c=r.checkDataTypes(f,s,l.opts.strict,r.DataType.Wrong);const u=t.const("indices",i._`{}`);t.for(i._`;${o}--;`,(()=>{t.let(s,i._`${a}[${o}]`);t.if(c,i._`continue`);if(f.length>1)t.if(i._`typeof ${s} == "string"`,i._`${s} += "_"`);t.if(i._`typeof ${u}[${s}] == "number"`,(()=>{t.assign(n,i._`${u}[${s}]`);e.error();t.assign(p,false).break()})).code(i._`${u}[${s}] = ${o}`)}))}function loopN2(r,n){const s=e.gen.scopeValue("func",{ref:o,code:i._`require("ajv/dist/compile/equal")`});const c=t.name("outer");t.label(c).for(i._`;${r}--;`,(()=>t.for(i._`${n} = ${r}; ${n}--;`,(()=>t.if(i._`${s}(${a}[${r}], ${a}[${n}])`,(()=>{e.error();t.assign(p,false).break(c)}))))))}}};t["default"]=s},5089:function(e){e.exports={newInvalidAsn1Error:function(e){var t=new Error;t.name="InvalidAsn1Error";t.message=e||"";return t}}},9376:function(e,t,a){var r=a(5089);var i=a(8245);var o=a(5081);var n=a(6229);e.exports={Reader:o,Writer:n};for(var s in i){if(i.hasOwnProperty(s))e.exports[s]=i[s]}for(var c in r){if(r.hasOwnProperty(c))e.exports[c]=r[c]}},5081:function(e,t,a){var r=a(2613);var i=a(9392).Buffer;var o=a(8245);var n=a(5089);var s=n.newInvalidAsn1Error;function Reader(e){if(!e||!i.isBuffer(e))throw new TypeError("data must be a node Buffer");this._buf=e;this._size=e.length;this._len=0;this._offset=0}Object.defineProperty(Reader.prototype,"length",{enumerable:true,get:function(){return this._len}});Object.defineProperty(Reader.prototype,"offset",{enumerable:true,get:function(){return this._offset}});Object.defineProperty(Reader.prototype,"remain",{get:function(){return this._size-this._offset}});Object.defineProperty(Reader.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}});Reader.prototype.readByte=function(e){if(this._size-this._offset<1)return null;var t=this._buf[this._offset]&255;if(!e)this._offset+=1;return t};Reader.prototype.peek=function(){return this.readByte(true)};Reader.prototype.readLength=function(e){if(e===undefined)e=this._offset;if(e>=this._size)return null;var t=this._buf[e++]&255;if(t===null)return null;if((t&128)===128){t&=127;if(t===0)throw s("Indefinite length not supported");if(t>4)throw s("encoding too long");if(this._size-e<t)return null;this._len=0;for(var a=0;a<t;a++)this._len=(this._len<<8)+(this._buf[e++]&255)}else{this._len=t}return e};Reader.prototype.readSequence=function(e){var t=this.peek();if(t===null)return null;if(e!==undefined&&e!==t)throw s("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var a=this.readLength(this._offset+1);if(a===null)return null;this._offset=a;return t};Reader.prototype.readInt=function(){return this._readTag(o.Integer)};Reader.prototype.readBoolean=function(){return this._readTag(o.Boolean)===0?false:true};Reader.prototype.readEnumeration=function(){return this._readTag(o.Enumeration)};Reader.prototype.readString=function(e,t){if(!e)e=o.OctetString;var a=this.peek();if(a===null)return null;if(a!==e)throw s("Expected 0x"+e.toString(16)+": got 0x"+a.toString(16));var r=this.readLength(this._offset+1);if(r===null)return null;if(this.length>this._size-r)return null;this._offset=r;if(this.length===0)return t?i.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);this._offset+=this.length;return t?n:n.toString("utf8")};Reader.prototype.readOID=function(e){if(!e)e=o.OID;var t=this.readString(e,true);if(t===null)return null;var a=[];var r=0;for(var i=0;i<t.length;i++){var n=t[i]&255;r<<=7;r+=n&127;if((n&128)===0){a.push(r);r=0}}r=a.shift();a.unshift(r%40);a.unshift(r/40>>0);return a.join(".")};Reader.prototype._readTag=function(e){r.ok(e!==undefined);var t=this.peek();if(t===null)return null;if(t!==e)throw s("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var a=this.readLength(this._offset+1);if(a===null)return null;if(this.length>4)throw s("Integer too long: "+this.length);if(this.length>this._size-a)return null;this._offset=a;var i=this._buf[this._offset];var o=0;for(var n=0;n<this.length;n++){o<<=8;o|=this._buf[this._offset++]&255}if((i&128)===128&&n!==4)o-=1<<n*8;return o>>0};e.exports=Reader},8245:function(e){e.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},6229:function(e,t,a){var r=a(2613);var i=a(9392).Buffer;var o=a(8245);var n=a(5089);var s=n.newInvalidAsn1Error;var c={size:1024,growthFactor:8};function merge(e,t){r.ok(e);r.equal(typeof e,"object");r.ok(t);r.equal(typeof t,"object");var a=Object.getOwnPropertyNames(e);a.forEach((function(a){if(t[a])return;var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r)}));return t}function Writer(e){e=merge(c,e||{});this._buf=i.alloc(e.size||1024);this._size=this._buf.length;this._offset=0;this._options=e;this._seq=[]}Object.defineProperty(Writer.prototype,"buffer",{get:function(){if(this._seq.length)throw s(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}});Writer.prototype.writeByte=function(e){if(typeof e!=="number")throw new TypeError("argument must be a Number");this._ensure(1);this._buf[this._offset++]=e};Writer.prototype.writeInt=function(e,t){if(typeof e!=="number")throw new TypeError("argument must be a Number");if(typeof t!=="number")t=o.Integer;var a=4;while(((e&4286578688)===0||(e&4286578688)===4286578688>>0)&&a>1){a--;e<<=8}if(a>4)throw s("BER ints cannot be > 0xffffffff");this._ensure(2+a);this._buf[this._offset++]=t;this._buf[this._offset++]=a;while(a-- >0){this._buf[this._offset++]=(e&4278190080)>>>24;e<<=8}};Writer.prototype.writeNull=function(){this.writeByte(o.Null);this.writeByte(0)};Writer.prototype.writeEnumeration=function(e,t){if(typeof e!=="number")throw new TypeError("argument must be a Number");if(typeof t!=="number")t=o.Enumeration;return this.writeInt(e,t)};Writer.prototype.writeBoolean=function(e,t){if(typeof e!=="boolean")throw new TypeError("argument must be a Boolean");if(typeof t!=="number")t=o.Boolean;this._ensure(3);this._buf[this._offset++]=t;this._buf[this._offset++]=1;this._buf[this._offset++]=e?255:0};Writer.prototype.writeString=function(e,t){if(typeof e!=="string")throw new TypeError("argument must be a string (was: "+typeof e+")");if(typeof t!=="number")t=o.OctetString;var a=i.byteLength(e);this.writeByte(t);this.writeLength(a);if(a){this._ensure(a);this._buf.write(e,this._offset);this._offset+=a}};Writer.prototype.writeBuffer=function(e,t){if(typeof t!=="number")throw new TypeError("tag must be a number");if(!i.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t);this.writeLength(e.length);this._ensure(e.length);e.copy(this._buf,this._offset,0,e.length);this._offset+=e.length};Writer.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach((function(e){t.writeString(e)}))};Writer.prototype.writeOID=function(e,t){if(typeof e!=="string")throw new TypeError("argument must be a string");if(typeof t!=="number")t=o.OID;if(!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");function encodeOctet(e,t){if(t<128){e.push(t)}else if(t<16384){e.push(t>>>7|128);e.push(t&127)}else if(t<2097152){e.push(t>>>14|128);e.push((t>>>7|128)&255);e.push(t&127)}else if(t<268435456){e.push(t>>>21|128);e.push((t>>>14|128)&255);e.push((t>>>7|128)&255);e.push(t&127)}else{e.push((t>>>28|128)&255);e.push((t>>>21|128)&255);e.push((t>>>14|128)&255);e.push((t>>>7|128)&255);e.push(t&127)}}var a=e.split(".");var r=[];r.push(parseInt(a[0],10)*40+parseInt(a[1],10));a.slice(2).forEach((function(e){encodeOctet(r,parseInt(e,10))}));var i=this;this._ensure(2+r.length);this.writeByte(t);this.writeLength(r.length);r.forEach((function(e){i.writeByte(e)}))};Writer.prototype.writeLength=function(e){if(typeof e!=="number")throw new TypeError("argument must be a Number");this._ensure(4);if(e<=127){this._buf[this._offset++]=e}else if(e<=255){this._buf[this._offset++]=129;this._buf[this._offset++]=e}else if(e<=65535){this._buf[this._offset++]=130;this._buf[this._offset++]=e>>8;this._buf[this._offset++]=e}else if(e<=16777215){this._buf[this._offset++]=131;this._buf[this._offset++]=e>>16;this._buf[this._offset++]=e>>8;this._buf[this._offset++]=e}else{throw s("Length too long (> 4 bytes)")}};Writer.prototype.startSequence=function(e){if(typeof e!=="number")e=o.Sequence|o.Constructor;this.writeByte(e);this._seq.push(this._offset);this._ensure(3);this._offset+=3};Writer.prototype.endSequence=function(){var e=this._seq.pop();var t=e+3;var a=this._offset-t;if(a<=127){this._shift(t,a,-2);this._buf[e]=a}else if(a<=255){this._shift(t,a,-1);this._buf[e]=129;this._buf[e+1]=a}else if(a<=65535){this._buf[e]=130;this._buf[e+1]=a>>8;this._buf[e+2]=a}else if(a<=16777215){this._shift(t,a,1);this._buf[e]=131;this._buf[e+1]=a>>16;this._buf[e+2]=a>>8;this._buf[e+3]=a}else{throw s("Sequence too long")}};Writer.prototype._shift=function(e,t,a){r.ok(e!==undefined);r.ok(t!==undefined);r.ok(a);this._buf.copy(this._buf,e+a,e,e+t);this._offset+=a};Writer.prototype._ensure=function(e){r.ok(e);if(this._size-this._offset<e){var t=this._size*this._options.growthFactor;if(t-this._offset<e)t+=e;var a=i.alloc(t);this._buf.copy(a,0,0,this._offset);this._buf=a;this._size=t}};e.exports=Writer},1594:function(e,t,a){var r=a(9376);e.exports={Ber:r,BerReader:r.Reader,BerWriter:r.Writer}},7179:function(e,t,a){var r=a(2613);var i=a(2203).Stream;var o=a(9023);var n=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;function _capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function _toss(e,t,a,i,n){throw new r.AssertionError({message:o.format("%s (%s) is required",e,t),actual:n===undefined?typeof i:n(i),expected:t,operator:a||"===",stackStartFunction:_toss.caller})}function _getClass(e){return Object.prototype.toString.call(e).slice(8,-1)}function noop(){}var s={bool:{check:function(e){return typeof e==="boolean"}},func:{check:function(e){return typeof e==="function"}},string:{check:function(e){return typeof e==="string"}},object:{check:function(e){return typeof e==="object"&&e!==null}},number:{check:function(e){return typeof e==="number"&&!isNaN(e)}},finite:{check:function(e){return typeof e==="number"&&!isNaN(e)&&isFinite(e)}},buffer:{check:function(e){return Buffer.isBuffer(e)},operator:"Buffer.isBuffer"},array:{check:function(e){return Array.isArray(e)},operator:"Array.isArray"},stream:{check:function(e){return e instanceof i},operator:"instanceof",actual:_getClass},date:{check:function(e){return e instanceof Date},operator:"instanceof",actual:_getClass},regexp:{check:function(e){return e instanceof RegExp},operator:"instanceof",actual:_getClass},uuid:{check:function(e){return typeof e==="string"&&n.test(e)},operator:"isUUID"}};function _setExports(e){var t=Object.keys(s);var a;if(process.env.NODE_NDEBUG){a=noop}else{a=function(e,t){if(!e){_toss(t,"true",e)}}}t.forEach((function(t){if(e){a[t]=noop;return}var r=s[t];a[t]=function(e,a){if(!r.check(e)){_toss(a,t,r.operator,e,r.actual)}}}));t.forEach((function(t){var r="optional"+_capitalize(t);if(e){a[r]=noop;return}var i=s[t];a[r]=function(e,a){if(e===undefined||e===null){return}if(!i.check(e)){_toss(a,t,i.operator,e,i.actual)}}}));t.forEach((function(t){var r="arrayOf"+_capitalize(t);if(e){a[r]=noop;return}var i=s[t];var o="["+t+"]";a[r]=function(e,t){if(!Array.isArray(e)){_toss(t,o,i.operator,e,i.actual)}var a;for(a=0;a<e.length;a++){if(!i.check(e[a])){_toss(t,o,i.operator,e,i.actual)}}}}));t.forEach((function(t){var r="optionalArrayOf"+_capitalize(t);if(e){a[r]=noop;return}var i=s[t];var o="["+t+"]";a[r]=function(e,t){if(e===undefined||e===null){return}if(!Array.isArray(e)){_toss(t,o,i.operator,e,i.actual)}var a;for(a=0;a<e.length;a++){if(!i.check(e[a])){_toss(t,o,i.operator,e,i.actual)}}}}));Object.keys(r).forEach((function(t){if(t==="AssertionError"){a[t]=r[t];return}if(e){a[t]=noop;return}a[t]=r[t]}));a._setExports=_setExports;return a}e.exports=_setExports(process.env.NODE_NDEBUG)},5094:function(e,t,a){e.exports={parallel:a(3047),serial:a(2312),serialOrdered:a(3587)}},6524:function(e){e.exports=abort;function abort(e){Object.keys(e.jobs).forEach(clean.bind(e));e.jobs={}}function clean(e){if(typeof this.jobs[e]=="function"){this.jobs[e]()}}},3134:function(e,t,a){var r=a(8374);e.exports=async;function async(e){var t=false;r((function(){t=true}));return function async_callback(a,i){if(t){e(a,i)}else{r((function nextTick_callback(){e(a,i)}))}}}},8374:function(e){e.exports=defer;function defer(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t){t(e)}else{setTimeout(e,0)}}},8056:function(e,t,a){var r=a(3134),i=a(6524);e.exports=iterate;function iterate(e,t,a,r){var o=a["keyedList"]?a["keyedList"][a.index]:a.index;a.jobs[o]=runJob(t,o,e[o],(function(e,t){if(!(o in a.jobs)){return}delete a.jobs[o];if(e){i(a)}else{a.results[o]=t}r(e,a.results)}))}function runJob(e,t,a,i){var o;if(e.length==2){o=e(a,r(i))}else{o=e(a,t,r(i))}return o}},1987:function(e){e.exports=state;function state(e,t){var a=!Array.isArray(e),r={index:0,keyedList:a||t?Object.keys(e):null,jobs:{},results:a?{}:[],size:a?Object.keys(e).length:e.length};if(t){r.keyedList.sort(a?t:function(a,r){return t(e[a],e[r])})}return r}},1393:function(e,t,a){var r=a(6524),i=a(3134);e.exports=terminator;function terminator(e){if(!Object.keys(this.jobs).length){return}this.index=this.size;r(this);i(e)(null,this.results)}},3047:function(e,t,a){var r=a(8056),i=a(1987),o=a(1393);e.exports=parallel;function parallel(e,t,a){var n=i(e);while(n.index<(n["keyedList"]||e).length){r(e,t,n,(function(e,t){if(e){a(e,t);return}if(Object.keys(n.jobs).length===0){a(null,n.results);return}}));n.index++}return o.bind(n,a)}},2312:function(e,t,a){var r=a(3587);e.exports=serial;function serial(e,t,a){return r(e,t,null,a)}},3587:function(e,t,a){var r=a(8056),i=a(1987),o=a(1393);e.exports=serialOrdered;e.exports.ascending=ascending;e.exports.descending=descending;function serialOrdered(e,t,a,n){var s=i(e,a);r(e,t,s,(function iteratorHandler(a,i){if(a){n(a,i);return}s.index++;if(s.index<(s["keyedList"]||e).length){r(e,t,s,iteratorHandler);return}n(null,s.results)}));return o.bind(s,n)}function ascending(e,t){return e<t?-1:e>t?1:0}function descending(e,t){return-1*ascending(e,t)}},2169:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NOOP=t.LIMIT_FILES_DESCRIPTORS=t.LIMIT_BASENAME_LENGTH=t.IS_USER_ROOT=t.IS_POSIX=t.DEFAULT_TIMEOUT_SYNC=t.DEFAULT_TIMEOUT_ASYNC=t.DEFAULT_WRITE_OPTIONS=t.DEFAULT_READ_OPTIONS=t.DEFAULT_FOLDER_MODE=t.DEFAULT_FILE_MODE=t.DEFAULT_ENCODING=void 0;const a="utf8";t.DEFAULT_ENCODING=a;const r=438;t.DEFAULT_FILE_MODE=r;const i=511;t.DEFAULT_FOLDER_MODE=i;const o={};t.DEFAULT_READ_OPTIONS=o;const n={};t.DEFAULT_WRITE_OPTIONS=n;const s=5e3;t.DEFAULT_TIMEOUT_ASYNC=s;const c=100;t.DEFAULT_TIMEOUT_SYNC=c;const u=!!process.getuid;t.IS_POSIX=u;const l=process.getuid?!process.getuid():false;t.IS_USER_ROOT=l;const p=128;t.LIMIT_BASENAME_LENGTH=p;const f=1e4;t.LIMIT_FILES_DESCRIPTORS=f;const NOOP=()=>{};t.NOOP=NOOP},6265:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeFileSync=t.writeFile=t.readFileSync=t.readFile=void 0;const r=a(6928);const i=a(2169);const o=a(8568);const n=a(9907);const s=a(1014);const c=a(1425);function readFile(e,t=i.DEFAULT_READ_OPTIONS){var a;if(n.default.isString(t))return readFile(e,{encoding:t});const r=Date.now()+((a=t.timeout)!==null&&a!==void 0?a:i.DEFAULT_TIMEOUT_ASYNC);return o.default.readFileRetry(r)(e,t)}t.readFile=readFile;function readFileSync(e,t=i.DEFAULT_READ_OPTIONS){var a;if(n.default.isString(t))return readFileSync(e,{encoding:t});const r=Date.now()+((a=t.timeout)!==null&&a!==void 0?a:i.DEFAULT_TIMEOUT_SYNC);return o.default.readFileSyncRetry(r)(e,t)}t.readFileSync=readFileSync;const writeFile=(e,t,a,r)=>{if(n.default.isFunction(a))return writeFile(e,t,i.DEFAULT_WRITE_OPTIONS,a);const o=writeFileAsync(e,t,a);if(r)o.then(r,r);return o};t.writeFile=writeFile;const writeFileAsync=async(e,t,a=i.DEFAULT_WRITE_OPTIONS)=>{var u;if(n.default.isString(a))return writeFileAsync(e,t,{encoding:a});const l=Date.now()+((u=a.timeout)!==null&&u!==void 0?u:i.DEFAULT_TIMEOUT_ASYNC);let p=null,f=null,m=null,h=null,g=null;try{if(a.schedule)p=await a.schedule(e);f=await s.default.schedule(e);e=await o.default.realpathAttempt(e)||e;[h,m]=c.default.get(e,a.tmpCreate||c.default.create,!(a.tmpPurge===false));const u=i.IS_POSIX&&n.default.isUndefined(a.chown),y=n.default.isUndefined(a.mode);if(u||y){const t=await o.default.statAttempt(e);if(t){a={...a};if(u)a.chown={uid:t.uid,gid:t.gid};if(y)a.mode=t.mode}}const b=r.dirname(e);await o.default.mkdirAttempt(b,{mode:i.DEFAULT_FOLDER_MODE,recursive:true});g=await o.default.openRetry(l)(h,"w",a.mode||i.DEFAULT_FILE_MODE);if(a.tmpCreated)a.tmpCreated(h);if(n.default.isString(t)){await o.default.writeRetry(l)(g,t,0,a.encoding||i.DEFAULT_ENCODING)}else if(!n.default.isUndefined(t)){await o.default.writeRetry(l)(g,t,0,t.length,0)}if(a.fsync!==false){if(a.fsyncWait!==false){await o.default.fsyncRetry(l)(g)}else{o.default.fsyncAttempt(g)}}await o.default.closeRetry(l)(g);g=null;if(a.chown)await o.default.chownAttempt(h,a.chown.uid,a.chown.gid);if(a.mode)await o.default.chmodAttempt(h,a.mode);try{await o.default.renameRetry(l)(h,e)}catch(t){if(t.code!=="ENAMETOOLONG")throw t;await o.default.renameRetry(l)(h,c.default.truncate(e))}m();h=null}finally{if(g)await o.default.closeAttempt(g);if(h)c.default.purge(h);if(p)p();if(f)f()}};const writeFileSync=(e,t,a=i.DEFAULT_WRITE_OPTIONS)=>{var s;if(n.default.isString(a))return writeFileSync(e,t,{encoding:a});const u=Date.now()+((s=a.timeout)!==null&&s!==void 0?s:i.DEFAULT_TIMEOUT_SYNC);let l=null,p=null,f=null;try{e=o.default.realpathSyncAttempt(e)||e;[p,l]=c.default.get(e,a.tmpCreate||c.default.create,!(a.tmpPurge===false));const s=i.IS_POSIX&&n.default.isUndefined(a.chown),m=n.default.isUndefined(a.mode);if(s||m){const t=o.default.statSyncAttempt(e);if(t){a={...a};if(s)a.chown={uid:t.uid,gid:t.gid};if(m)a.mode=t.mode}}const h=r.dirname(e);o.default.mkdirSyncAttempt(h,{mode:i.DEFAULT_FOLDER_MODE,recursive:true});f=o.default.openSyncRetry(u)(p,"w",a.mode||i.DEFAULT_FILE_MODE);if(a.tmpCreated)a.tmpCreated(p);if(n.default.isString(t)){o.default.writeSyncRetry(u)(f,t,0,a.encoding||i.DEFAULT_ENCODING)}else if(!n.default.isUndefined(t)){o.default.writeSyncRetry(u)(f,t,0,t.length,0)}if(a.fsync!==false){if(a.fsyncWait!==false){o.default.fsyncSyncRetry(u)(f)}else{o.default.fsyncAttempt(f)}}o.default.closeSyncRetry(u)(f);f=null;if(a.chown)o.default.chownSyncAttempt(p,a.chown.uid,a.chown.gid);if(a.mode)o.default.chmodSyncAttempt(p,a.mode);try{o.default.renameSyncRetry(u)(p,e)}catch(t){if(t.code!=="ENAMETOOLONG")throw t;o.default.renameSyncRetry(u)(p,c.default.truncate(e))}l();p=null}finally{if(f)o.default.closeSyncAttempt(f);if(p)c.default.purge(p)}};t.writeFileSync=writeFileSync},7250:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.attemptifySync=t.attemptifyAsync=void 0;const r=a(2169);const attemptifyAsync=(e,t=r.NOOP)=>function(){return e.apply(undefined,arguments).catch(t)};t.attemptifyAsync=attemptifyAsync;const attemptifySync=(e,t=r.NOOP)=>function(){try{return e.apply(undefined,arguments)}catch(e){return t(e)}};t.attemptifySync=attemptifySync},8568:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9896);const i=a(9023);const o=a(7250);const n=a(1674);const s=a(3547);const c={chmodAttempt:o.attemptifyAsync(i.promisify(r.chmod),n.default.onChangeError),chownAttempt:o.attemptifyAsync(i.promisify(r.chown),n.default.onChangeError),closeAttempt:o.attemptifyAsync(i.promisify(r.close)),fsyncAttempt:o.attemptifyAsync(i.promisify(r.fsync)),mkdirAttempt:o.attemptifyAsync(i.promisify(r.mkdir)),realpathAttempt:o.attemptifyAsync(i.promisify(r.realpath)),statAttempt:o.attemptifyAsync(i.promisify(r.stat)),unlinkAttempt:o.attemptifyAsync(i.promisify(r.unlink)),closeRetry:s.retryifyAsync(i.promisify(r.close),n.default.isRetriableError),fsyncRetry:s.retryifyAsync(i.promisify(r.fsync),n.default.isRetriableError),openRetry:s.retryifyAsync(i.promisify(r.open),n.default.isRetriableError),readFileRetry:s.retryifyAsync(i.promisify(r.readFile),n.default.isRetriableError),renameRetry:s.retryifyAsync(i.promisify(r.rename),n.default.isRetriableError),statRetry:s.retryifyAsync(i.promisify(r.stat),n.default.isRetriableError),writeRetry:s.retryifyAsync(i.promisify(r.write),n.default.isRetriableError),chmodSyncAttempt:o.attemptifySync(r.chmodSync,n.default.onChangeError),chownSyncAttempt:o.attemptifySync(r.chownSync,n.default.onChangeError),closeSyncAttempt:o.attemptifySync(r.closeSync),mkdirSyncAttempt:o.attemptifySync(r.mkdirSync),realpathSyncAttempt:o.attemptifySync(r.realpathSync),statSyncAttempt:o.attemptifySync(r.statSync),unlinkSyncAttempt:o.attemptifySync(r.unlinkSync),closeSyncRetry:s.retryifySync(r.closeSync,n.default.isRetriableError),fsyncSyncRetry:s.retryifySync(r.fsyncSync,n.default.isRetriableError),openSyncRetry:s.retryifySync(r.openSync,n.default.isRetriableError),readFileSyncRetry:s.retryifySync(r.readFileSync,n.default.isRetriableError),renameSyncRetry:s.retryifySync(r.renameSync,n.default.isRetriableError),statSyncRetry:s.retryifySync(r.statSync,n.default.isRetriableError),writeSyncRetry:s.retryifySync(r.writeSync,n.default.isRetriableError)};t["default"]=c},1674:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(2169);const i={isChangeErrorOk:e=>{const{code:t}=e;if(t==="ENOSYS")return true;if(!r.IS_USER_ROOT&&(t==="EINVAL"||t==="EPERM"))return true;return false},isRetriableError:e=>{const{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCS"||t==="EPERM")return true;return false},onChangeError:e=>{if(i.isChangeErrorOk(e))return;throw e}};t["default"]=i},9907:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={isFunction:e=>typeof e==="function",isString:e=>typeof e==="string",isUndefined:e=>typeof e==="undefined"};t["default"]=a},3547:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.retryifySync=t.retryifyAsync=void 0;const r=a(5144);const retryifyAsync=(e,t)=>function(a){return function attempt(){return r.default.schedule().then((r=>e.apply(undefined,arguments).then((e=>{r();return e}),(e=>{r();if(Date.now()>=a)throw e;if(t(e)){const e=Math.round(100+400*Math.random()),t=new Promise((t=>setTimeout(t,e)));return t.then((()=>attempt.apply(undefined,arguments)))}throw e}))))}};t.retryifyAsync=retryifyAsync;const retryifySync=(e,t)=>function(a){return function attempt(){try{return e.apply(undefined,arguments)}catch(e){if(Date.now()>a)throw e;if(t(e))return attempt.apply(undefined,arguments);throw e}}};t.retryifySync=retryifySync},5144:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(2169);const i={interval:25,intervalId:undefined,limit:r.LIMIT_FILES_DESCRIPTORS,queueActive:new Set,queueWaiting:new Set,init:()=>{if(i.intervalId)return;i.intervalId=setInterval(i.tick,i.interval)},reset:()=>{if(!i.intervalId)return;clearInterval(i.intervalId);delete i.intervalId},add:e=>{i.queueWaiting.add(e);if(i.queueActive.size<i.limit/2){i.tick()}else{i.init()}},remove:e=>{i.queueWaiting.delete(e);i.queueActive.delete(e)},schedule:()=>new Promise((e=>{const cleanup=()=>i.remove(resolver);const resolver=()=>e(cleanup);i.add(resolver)})),tick:()=>{if(i.queueActive.size>=i.limit)return;if(!i.queueWaiting.size)return i.reset();for(const e of i.queueWaiting){if(i.queueActive.size>=i.limit)break;i.queueWaiting.delete(e);i.queueActive.add(e);e()}}};t["default"]=i},1014:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={};const r={next:e=>{const t=a[e];if(!t)return;t.shift();const i=t[0];if(i){i((()=>r.next(e)))}else{delete a[e]}},schedule:e=>new Promise((t=>{let i=a[e];if(!i)i=a[e]=[];i.push(t);if(i.length>1)return;t((()=>r.next(e)))}))};t["default"]=r},1425:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(6928);const i=a(2169);const o=a(8568);const n={store:{},create:e=>{const t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),a=Date.now().toString().slice(-10),r="tmp-",i=`.${r}${a}${t}`,o=`${e}${i}`;return o},get:(e,t,a=true)=>{const r=n.truncate(t(e));if(r in n.store)return n.get(e,t,a);n.store[r]=a;const disposer=()=>delete n.store[r];return[r,disposer]},purge:e=>{if(!n.store[e])return;delete n.store[e];o.default.unlinkAttempt(e)},purgeSync:e=>{if(!n.store[e])return;delete n.store[e];o.default.unlinkSyncAttempt(e)},purgeSyncAll:()=>{for(const e in n.store){n.purgeSync(e)}},truncate:e=>{const t=r.basename(e);if(t.length<=i.LIMIT_BASENAME_LENGTH)return e;const a=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!a)return e;const o=t.length-i.LIMIT_BASENAME_LENGTH;return`${e.slice(0,-t.length)}${a[1]}${a[2].slice(0,-o)}${a[3]}`}};process.on("exit",n.purgeSyncAll);t["default"]=n},791:function(e,t,a){
7
+ deps: ${a}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,a]=splitDependencies(e);validatePropertyDeps(e,t);validateSchemaDeps(e,a)}};function splitDependencies({schema:e}){const t={};const a={};for(const r in e){if(r==="__proto__")continue;const i=Array.isArray(e[r])?t:a;i[r]=e[r]}return[t,a]}function validatePropertyDeps(e,t=e.schema){const{gen:a,data:i,it:n}=e;if(Object.keys(t).length===0)return;const s=a.let("missing");for(const c in t){const u=t[c];if(u.length===0)continue;const l=o.propertyInData(a,i,c,n.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")});if(n.allErrors){a.if(l,(()=>{for(const t of u){o.checkReportMissingProp(e,t)}}))}else{a.if(r._`${l} && (${o.checkMissingProp(e,u,s)})`);o.reportMissingProp(e,s);a.else()}}}t.validatePropertyDeps=validatePropertyDeps;function validateSchemaDeps(e,t=e.schema){const{gen:a,data:r,keyword:n,it:s}=e;const c=a.name("valid");for(const u in t){if(i.alwaysValidSchema(s,t[u]))continue;a.if(o.propertyInData(a,r,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:n,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>a.var(c,true)));e.ok(c)}}t.validateSchemaDeps=validateSchemaDeps;t["default"]=n},6206:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o=a(5327);const n={message:({params:e})=>r.str`should match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`};const s={keyword:"if",schemaType:["object","boolean"],trackErrors:true,error:n,code(e){const{gen:t,parentSchema:a,it:i}=e;if(a.then===undefined&&a.else===undefined){o.checkStrictMode(i,'"if" without "then" and "else" is ignored')}const n=hasSchema(i,"then");const s=hasSchema(i,"else");if(!n&&!s)return;const c=t.let("valid",true);const u=t.name("_valid");validateIf();e.reset();if(n&&s){const a=t.let("ifClause");e.setParams({ifClause:a});t.if(u,validateClause("then",a),validateClause("else",a))}else if(n){t.if(u,validateClause("then"))}else{t.if(r.not(u),validateClause("else"))}e.pass(c,(()=>e.error(true)));function validateIf(){const t=e.subschema({keyword:"if",compositeRule:true,createErrors:false,allErrors:false},u);e.mergeEvaluated(t)}function validateClause(a,i){return()=>{const o=e.subschema({keyword:a},u);t.assign(c,u);e.mergeValidEvaluated(o,c);if(i)t.assign(i,r._`${a}`);else e.setParams({ifClause:a})}}}};function hasSchema(e,t){const a=e.schema[t];return a!==undefined&&!i.alwaysValidSchema(e,a)}t["default"]=s},8321:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(6658);const i=a(6281);const o=a(8732);const n=a(812);const s=a(4414);const c=a(3801);const u=a(4764);const l=a(6438);const p=a(620);const f=a(70);const m=a(32);const h=a(9467);const g=a(6206);const y=a(8359);const b=[p.default,f.default,m.default,h.default,g.default,y.default,r.default,i.default,o.default,s.default,c.default,n.default,u.default,l.default];t["default"]=b},6281:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o=a(5327);const n=a(1154);const s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{gen:t,schema:a,it:s}=e;if(Array.isArray(a)){if(s.opts.unevaluated&&a.length&&s.items!==true){s.items=i.mergeEvaluated.items(t,a.length,s.items)}validateTuple(a)}else{s.items=true;if(i.alwaysValidSchema(s,a))return;e.ok(n.validateArray(e))}function validateTuple(a){const{parentSchema:n,data:c}=e;if(s.opts.strictTuples&&!fullTupleSchema(a.length,n)){const e=`"items" is ${a.length}-tuple, but minItems or maxItems/additionalItems are not specified or different`;o.checkStrictMode(s,e,s.opts.strictTuples)}const u=t.name("valid");const l=t.const("len",r._`${c}.length`);a.forEach(((a,o)=>{if(i.alwaysValidSchema(s,a))return;t.if(r._`${l} > ${o}`,(()=>e.subschema({keyword:"items",schemaProp:o,dataProp:o},u)));e.ok(u)}))}}};function fullTupleSchema(e,t){return e===t.minItems&&(e===t.maxItems||t.additionalItems===false)}t["default"]=s},620:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1882);const i={keyword:"not",schemaType:["object","boolean"],trackErrors:true,code(e){const{gen:t,schema:a,it:i}=e;if(r.alwaysValidSchema(i,a)){e.fail();return}const o=t.name("valid");e.subschema({keyword:"not",compositeRule:true,createErrors:false,allErrors:false},o);e.result(o,(()=>e.error()),(()=>e.reset()))},error:{message:"should NOT be valid"}};t["default"]=i},32:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o={message:"should match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`};const n={keyword:"oneOf",schemaType:"array",trackErrors:true,error:o,code(e){const{gen:t,schema:a,it:o}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");const n=a;const s=t.let("valid",false);const c=t.let("passing",null);const u=t.name("_valid");e.setParams({passing:c});t.block(validateOneOf);e.result(s,(()=>e.reset()),(()=>e.error(true)));function validateOneOf(){n.forEach(((a,n)=>{let l;if(i.alwaysValidSchema(o,a)){t.var(u,true)}else{l=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:true},u)}if(n>0){t.if(r._`${u} && ${s}`).assign(s,false).assign(c,r._`[${c}, ${n}]`).else()}t.if(u,(()=>{t.assign(s,true);t.assign(c,n);if(l)e.mergeEvaluated(l,r.Name)}))}))}}};t["default"]=n},6438:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i=a(9722);const o=a(9329);const n=a(5327);const s=a(1882);const c={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:a,data:c,parentSchema:u,it:l}=e;const{opts:p}=l;const f=r.schemaProperties(l,a);if(f.length===0)return;const m=p.strict&&!p.allowMatchingProperties&&u.properties;const h=t.name("valid");if(l.props!==true&&!(l.props instanceof i.Name)){l.props=s.evaluatedPropsToName(t,l.props)}const{props:g}=l;validatePatternProperties();function validatePatternProperties(){for(const e of f){if(m)checkMatchingProperties(e);if(l.allErrors){validateProperties(e)}else{t.var(h,true);validateProperties(e);t.if(h)}}}function checkMatchingProperties(e){for(const t in m){if(new RegExp(e).test(t)){n.checkStrictMode(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}}}function validateProperties(a){t.forIn("key",c,(n=>{t.if(i._`${r.usePattern(t,a)}.test(${n})`,(()=>{e.subschema({keyword:"patternProperties",schemaProp:a,dataProp:n,dataPropType:o.Type.Str},h);if(l.opts.unevaluated&&g!==true){t.assign(i._`${g}[${n}]`,true)}else if(!l.allErrors){t.if(i.not(h),(()=>t.break()))}}))}))}}};t["default"]=c},4764:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(4323);const i=a(1154);const o=a(1882);const n=a(3801);const s={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:a,parentSchema:s,data:c,it:u}=e;if(u.opts.removeAdditional==="all"&&s.additionalProperties===undefined){n.default.code(new r.default(u,n.default,"additionalProperties"))}const l=i.allSchemaProperties(a);for(const e of l){u.definedProperties.add(e)}if(u.opts.unevaluated&&l.length&&u.props!==true){u.props=o.mergeEvaluated.props(t,o.toHash(l),u.props)}const p=l.filter((e=>!o.alwaysValidSchema(u,a[e])));if(p.length===0)return;const f=t.name("valid");for(const a of p){if(hasDefault(a)){applyPropertySchema(a)}else{t.if(i.propertyInData(t,c,a,u.opts.ownProperties));applyPropertySchema(a);if(!u.allErrors)t.else().var(f,true);t.endIf()}e.it.definedProperties.add(a);e.ok(f)}function hasDefault(e){return u.opts.useDefaults&&!u.compositeRule&&a[e].default!==undefined}function applyPropertySchema(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},f)}}};t["default"]=s},4414:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(1882);const o={message:({params:e})=>r.str`property name '${e.propertyName}' is invalid`,params:({params:e})=>r._`{propertyName: ${e.propertyName}}`};const n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:o,code(e){const{gen:t,schema:a,data:o,it:n}=e;if(i.alwaysValidSchema(n,a))return;const s=t.name("valid");t.forIn("key",o,(a=>{e.setParams({propertyName:a});e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:true},s);t.if(r.not(s),(()=>{e.error(true);if(!n.allErrors)t.break()}))}));e.ok(s)}};t["default"]=n},8359:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(5327);const i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:a}){if(t.if===undefined)r.checkStrictMode(a,`"${e}" without "if" is ignored`)}};t["default"]=i},1154:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=a(9722);const i=a(1882);const o=a(9329);const n=a(3068);function checkReportMissingProp(e,t){const{gen:a,data:i,it:o}=e;a.if(noPropertyInData(a,i,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},true);e.error()}))}t.checkReportMissingProp=checkReportMissingProp;function checkMissingProp({gen:e,data:t,it:{opts:a}},i,o){return r.or(...i.map((i=>r.and(noPropertyInData(e,t,i,a.ownProperties),r._`${o} = ${i}`))))}t.checkMissingProp=checkMissingProp;function reportMissingProp(e,t){e.setParams({missingProperty:t},true);e.error()}t.reportMissingProp=reportMissingProp;function hasPropFunc(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}t.hasPropFunc=hasPropFunc;function isOwnProperty(e,t,a){return r._`${hasPropFunc(e)}.call(${t}, ${a})`}t.isOwnProperty=isOwnProperty;function propertyInData(e,t,a,i){const o=r._`${t}${r.getProperty(a)} !== undefined`;return i?r._`${o} && ${isOwnProperty(e,t,a)}`:o}t.propertyInData=propertyInData;function noPropertyInData(e,t,a,i){const o=r._`${t}${r.getProperty(a)} === undefined`;return i?r.or(o,r.not(isOwnProperty(e,t,a))):o}t.noPropertyInData=noPropertyInData;function allSchemaProperties(e){return e?Object.keys(e).filter((e=>e!=="__proto__")):[]}t.allSchemaProperties=allSchemaProperties;function schemaProperties(e,t){return allSchemaProperties(t).filter((a=>!i.alwaysValidSchema(e,t[a])))}t.schemaProperties=schemaProperties;function callValidateCode({schemaCode:e,data:t,it:{gen:a,topSchemaRef:i,schemaPath:o,errorPath:s},it:c},u,l,p){const f=p?r._`${e}, ${t}, ${i}${o}`:t;const m=[[n.default.dataPath,r.strConcat(n.default.dataPath,s)],[n.default.parentData,c.parentData],[n.default.parentDataProperty,c.parentDataProperty],[n.default.rootData,n.default.rootData]];if(c.opts.dynamicRef)m.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const h=r._`${f}, ${a.object(...m)}`;return l!==r.nil?r._`${u}.call(${l}, ${h})`:r._`${u}(${h})`}t.callValidateCode=callValidateCode;function usePattern(e,t){return e.scopeValue("pattern",{key:t,ref:new RegExp(t,"u"),code:r._`new RegExp(${t}, "u")`})}t.usePattern=usePattern;function validateArray(e){const{gen:t,data:a,keyword:i,it:n}=e;const s=t.name("valid");if(n.allErrors){const e=t.let("valid",true);validateItems((()=>t.assign(e,false)));return e}t.var(s,true);validateItems((()=>t.break()));return s;function validateItems(n){const c=t.const("len",r._`${a}.length`);t.forRange("i",0,c,(a=>{e.subschema({keyword:i,dataProp:a,dataPropType:o.Type.Num},s);t.if(r.not(s),n)}))}}t.validateArray=validateArray;function validateUnion(e){const{gen:t,schema:a,keyword:o,it:n}=e;if(!Array.isArray(a))throw new Error("ajv implementation error");const s=a.some((e=>i.alwaysValidSchema(n,e)));if(s&&!n.opts.unevaluated)return;const c=t.let("valid",false);const u=t.name("_valid");t.block((()=>a.forEach(((a,i)=>{const n=e.subschema({keyword:o,schemaProp:i,compositeRule:true},u);t.assign(c,r._`${c} || ${u}`);const s=e.mergeValidEvaluated(n,u);if(!s)t.if(r.not(c))}))));e.result(c,(()=>e.reset()),(()=>e.error(true)))}t.validateUnion=validateUnion},7722:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t["default"]=a},4831:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(7722);const i=a(2938);const o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,i.default];t["default"]=o},2938:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.callRef=t.getValidate=void 0;const r=a(7661);const i=a(1154);const o=a(9722);const n=a(3068);const s=a(6016);const c=a(1882);const u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:a,it:i}=e;const{baseId:n,schemaEnv:c,validateName:u,opts:l,self:p}=i;if(a==="#"||a==="#/")return callRootRef();const f=s.resolveRef.call(p,c.root,n,a);if(f===undefined)throw new r.MissingRefError(n,a);if(f instanceof s.SchemaEnv)return callValidate(f);return inlineRefSchema(f);function callRootRef(){if(c===c.root)return callRef(e,u,c,c.$async);const a=t.scopeValue("root",{ref:c.root});return callRef(e,o._`${a}.validate`,c.root,c.root.$async)}function callValidate(t){const a=getValidate(e,t);callRef(e,a,t,t.$async)}function inlineRefSchema(r){const i=t.scopeValue("schema",l.code.source===true?{ref:r,code:o.stringify(r)}:{ref:r});const n=t.name("valid");const s=e.subschema({schema:r,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:a},n);e.mergeEvaluated(s);e.ok(n)}}};function getValidate(e,t){const{gen:a}=e;return t.validate?a.scopeValue("validate",{ref:t.validate}):o._`${a.scopeValue("wrapper",{ref:t})}.validate`}t.getValidate=getValidate;function callRef(e,t,a,r){const{gen:s,it:u}=e;const{allErrors:l,schemaEnv:p,opts:f}=u;const m=f.passContext?n.default.this:o.nil;if(r)callAsyncRef();else callSyncRef();function callAsyncRef(){if(!p.$async)throw new Error("async schema referenced by sync schema");const a=s.let("valid");s.try((()=>{s.code(o._`await ${i.callValidateCode(e,t,m)}`);addEvaluatedFrom(t);if(!l)s.assign(a,true)}),(e=>{s.if(o._`!(${e} instanceof ${u.ValidationError})`,(()=>s.throw(e)));addErrorsFrom(e);if(!l)s.assign(a,false)}));e.ok(a)}function callSyncRef(){e.result(i.callValidateCode(e,t,m),(()=>addEvaluatedFrom(t)),(()=>addErrorsFrom(t)))}function addErrorsFrom(e){const t=o._`${e}.errors`;s.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`);s.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function addEvaluatedFrom(e){var t;if(!u.opts.unevaluated)return;const r=(t=a===null||a===void 0?void 0:a.validate)===null||t===void 0?void 0:t.evaluated;if(u.props!==true){if(r&&!r.dynamicProps){if(r.props!==undefined){u.props=c.mergeEvaluated.props(s,r.props,u.props)}}else{const t=s.var("props",o._`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(s,t,u.props,o.Name)}}if(u.items!==true){if(r&&!r.dynamicItems){if(r.items!==undefined){u.items=c.mergeEvaluated.items(s,r.items,u.items)}}else{const t=s.var("items",o._`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(s,t,u.items,o.Name)}}}}t.callRef=callRef;t["default"]=u},3295:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(4831);const i=a(7608);const o=a(8321);const n=a(4779);const s=a(3330);const c=[r.default,i.default,o.default,n.default,s.metadataVocabulary,s.contentVocabulary];t["default"]=c},4976:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message:({schemaCode:e})=>r.str`should match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`};const o={keyword:"format",type:["number","string"],schemaType:"string",$data:true,error:i,code(e,t){const{gen:a,data:i,$data:o,schema:n,schemaCode:s,it:c}=e;const{opts:u,errSchemaPath:l,schemaEnv:p,self:f}=c;if(!u.validateFormats)return;if(o)validate$DataFormat();else validateFormat();function validate$DataFormat(){const o=a.scopeValue("formats",{ref:f.formats,code:u.code.formats});const n=a.const("fDef",r._`${o}[${s}]`);const c=a.let("fType");const l=a.let("format");a.if(r._`typeof ${n} == "object" && !(${n} instanceof RegExp)`,(()=>a.assign(c,r._`${n}.type || "string"`).assign(l,r._`${n}.validate`)),(()=>a.assign(c,r._`"string"`).assign(l,n)));e.fail$data(r.or(unknownFmt(),invalidFmt()));function unknownFmt(){if(u.strict===false)return r.nil;return r._`${s} && !${l}`}function invalidFmt(){const e=p.$async?r._`(${n}.async ? await ${l}(${i}) : ${l}(${i}))`:r._`${l}(${i})`;const a=r._`(typeof ${l} == "function" ? ${e} : ${l}.test(${i}))`;return r._`${l} && ${l} !== true && ${c} === ${t} && !${a}`}}function validateFormat(){const o=f.formats[n];if(!o){unknownFormat();return}if(o===true)return;const[s,c,m]=getFormat(o);if(s===t)e.pass(validCondition());function unknownFormat(){if(u.strict===false){f.logger.warn(unknownMsg());return}throw new Error(unknownMsg());function unknownMsg(){return`unknown format "${n}" ignored in schema at path "${l}"`}}function getFormat(e){const t=a.scopeValue("formats",{key:n,ref:e,code:u.code.formats?r._`${u.code.formats}${r.getProperty(n)}`:undefined});if(typeof e=="object"&&!(e instanceof RegExp)){return[e.type||"string",e.validate,r._`${t}.validate`]}return["string",e,t]}function validCondition(){if(typeof o=="object"&&!(o instanceof RegExp)&&o.async){if(!p.$async)throw new Error("async format in sync schema");return r._`await ${m}(${i})`}return typeof c=="function"?r._`${m}(${i})`:r._`${m}.test(${i})`}}}};t["default"]=o},4779:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(4976);const i=[r.default];t["default"]=i},3330:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.contentVocabulary=t.metadataVocabulary=void 0;t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},8912:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(4711);const o={message:"should be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`};const n={keyword:"const",$data:true,error:o,code(e){const t=e.gen.scopeValue("func",{ref:i,code:r._`require("ajv/dist/compile/equal")`});e.fail$data(r._`!${t}(${e.data}, ${e.schemaCode})`)}};t["default"]=n},4870:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(4711);const o={message:"should be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`};const n={keyword:"enum",schemaType:"array",$data:true,error:o,code(e){const{gen:t,data:a,$data:o,schema:n,schemaCode:s,it:c}=e;if(!o&&n.length===0)throw new Error("enum must have non-empty array");const u=n.length>=c.opts.loopEnum;const l=e.gen.scopeValue("func",{ref:i,code:r._`require("ajv/dist/compile/equal")`});let p;if(u||o){p=t.let("valid");e.block$data(p,loopEnum)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");const e=t.const("vSchema",s);p=r.or(...n.map(((t,a)=>equalCode(e,a))))}e.pass(p);function loopEnum(){t.assign(p,false);t.forOf("v",s,(e=>t.if(r._`${l}(${a}, ${e})`,(()=>t.assign(p,true).break()))))}function equalCode(e,t){const i=n[t];return i&&typeof i==="object"?r._`${l}(${a}, ${e}[${t}])`:r._`${a} === ${i}`}}};t["default"]=n},7608:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(3501);const i=a(4206);const o=a(544);const n=a(3133);const s=a(8197);const c=a(8490);const u=a(4590);const l=a(9402);const p=a(8912);const f=a(4870);const m=[r.default,i.default,o.default,n.default,s.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},p.default,f.default];t["default"]=m},4590:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message({keyword:e,schemaCode:t}){const a=e==="maxItems"?"more":"fewer";return r.str`should NOT have ${a} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`};const o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:i,code(e){const{keyword:t,data:a,schemaCode:i}=e;const o=t==="maxItems"?r.operators.GT:r.operators.LT;e.fail$data(r._`${a}.length ${o} ${i}`)}};t["default"]=o},544:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=a(7879);const o={message({keyword:e,schemaCode:t}){const a=e==="maxLength"?"more":"fewer";return r.str`should NOT have ${a} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`};const n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:o,code(e){const{keyword:t,data:a,schemaCode:o,it:n}=e;const s=t==="maxLength"?r.operators.GT:r.operators.LT;let c;if(n.opts.unicode===false){c=r._`${a}.length`}else{const t=e.gen.scopeValue("func",{ref:i.default,code:r._`require("ajv/dist/compile/ucs2length").default`});c=r._`${t}(${a})`}e.fail$data(r._`${c} ${s} ${o}`)}};t["default"]=n},3501:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i=r.operators;const o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}};const n={message:({keyword:e,schemaCode:t})=>r.str`should be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${o[e].okStr}, limit: ${t}}`};const s={keyword:Object.keys(o),type:"number",schemaType:"number",$data:true,error:n,code(e){const{keyword:t,data:a,schemaCode:i}=e;e.fail$data(r._`${a} ${o[t].fail} ${i} || isNaN(${a})`)}};t["default"]=s},8197:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message({keyword:e,schemaCode:t}){const a=e==="maxProperties"?"more":"fewer";return r.str`should NOT have ${a} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`};const o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:i,code(e){const{keyword:t,data:a,schemaCode:i}=e;const o=t==="maxProperties"?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${a}).length ${o} ${i}`)}};t["default"]=o},4206:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9722);const i={message:({schemaCode:e})=>r.str`should be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`};const o={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:i,code(e){const{gen:t,data:a,schemaCode:i,it:o}=e;const n=o.opts.multipleOfPrecision;const s=t.let("res");const c=n?r._`Math.abs(Math.round(${s}) - ${s}) > 1e-${n}`:r._`${s} !== parseInt(${s})`;e.fail$data(r._`(${i} === 0 || (${s} = ${a}/${i}, ${c}))`)}};t["default"]=o},3133:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i=a(9722);const o={message:({schemaCode:e})=>i.str`should match pattern "${e}"`,params:({schemaCode:e})=>i._`{pattern: ${e}}`};const n={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:o,code(e){const{gen:t,data:a,$data:o,schema:n,schemaCode:s}=e;const c=o?i._`(new RegExp(${s}, "u"))`:r.usePattern(t,n);e.fail$data(i._`!${c}.test(${a})`)}};t["default"]=n},8490:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(1154);const i=a(9722);const o=a(5327);const n={message:({params:{missingProperty:e}})=>i.str`should have required property '${e}'`,params:({params:{missingProperty:e}})=>i._`{missingProperty: ${e}}`};const s={keyword:"required",type:"object",schemaType:"array",$data:true,error:n,code(e){const{gen:t,schema:a,schemaCode:n,data:s,$data:c,it:u}=e;const{opts:l}=u;if(!c&&a.length===0)return;const p=a.length>=l.loopRequired;if(u.allErrors)allErrorsMode();else exitOnErrorMode();if(l.strictRequired){const t=e.parentSchema.properties;const{definedProperties:r}=e.it;for(const e of a){if((t===null||t===void 0?void 0:t[e])===undefined&&!r.has(e)){const t=u.schemaEnv.baseId+u.errSchemaPath;const a=`required property "${e}" is not defined at "${t}" (strictRequired)`;o.checkStrictMode(u,a,u.opts.strictRequired)}}}function allErrorsMode(){if(p||c){e.block$data(i.nil,loopAllRequired)}else{for(const t of a){r.checkReportMissingProp(e,t)}}}function exitOnErrorMode(){const i=t.let("missing");if(p||c){const a=t.let("valid",true);e.block$data(a,(()=>loopUntilMissing(i,a)));e.ok(a)}else{t.if(r.checkMissingProp(e,a,i));r.reportMissingProp(e,i);t.else()}}function loopAllRequired(){t.forOf("prop",n,(a=>{e.setParams({missingProperty:a});t.if(r.noPropertyInData(t,s,a,l.ownProperties),(()=>e.error()))}))}function loopUntilMissing(a,o){e.setParams({missingProperty:a});t.forOf(a,n,(()=>{t.assign(o,r.propertyInData(t,s,a,l.ownProperties));t.if(i.not(o),(()=>{e.error();t.break()}))}),i.nil)}}};t["default"]=s},9402:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9499);const i=a(9722);const o=a(4711);const n={message:({params:{i:e,j:t}})=>i.str`should NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>i._`{i: ${e}, j: ${t}}`};const s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:n,code(e){const{gen:t,data:a,$data:n,schema:s,parentSchema:c,schemaCode:u,it:l}=e;if(!n&&!s)return;const p=t.let("valid");const f=c.items?r.getSchemaTypes(c.items):[];e.block$data(p,validateUniqueItems,i._`${u} === false`);e.ok(p);function validateUniqueItems(){const r=t.let("i",i._`${a}.length`);const o=t.let("j");e.setParams({i:r,j:o});t.assign(p,true);t.if(i._`${r} > 1`,(()=>(canOptimize()?loopN:loopN2)(r,o)))}function canOptimize(){return f.length>0&&!f.some((e=>e==="object"||e==="array"))}function loopN(o,n){const s=t.name("item");const c=r.checkDataTypes(f,s,l.opts.strict,r.DataType.Wrong);const u=t.const("indices",i._`{}`);t.for(i._`;${o}--;`,(()=>{t.let(s,i._`${a}[${o}]`);t.if(c,i._`continue`);if(f.length>1)t.if(i._`typeof ${s} == "string"`,i._`${s} += "_"`);t.if(i._`typeof ${u}[${s}] == "number"`,(()=>{t.assign(n,i._`${u}[${s}]`);e.error();t.assign(p,false).break()})).code(i._`${u}[${s}] = ${o}`)}))}function loopN2(r,n){const s=e.gen.scopeValue("func",{ref:o,code:i._`require("ajv/dist/compile/equal")`});const c=t.name("outer");t.label(c).for(i._`;${r}--;`,(()=>t.for(i._`${n} = ${r}; ${n}--;`,(()=>t.if(i._`${s}(${a}[${r}], ${a}[${n}])`,(()=>{e.error();t.assign(p,false).break(c)}))))))}}};t["default"]=s},5089:function(e){e.exports={newInvalidAsn1Error:function(e){var t=new Error;t.name="InvalidAsn1Error";t.message=e||"";return t}}},9376:function(e,t,a){var r=a(5089);var i=a(8245);var o=a(5081);var n=a(6229);e.exports={Reader:o,Writer:n};for(var s in i){if(i.hasOwnProperty(s))e.exports[s]=i[s]}for(var c in r){if(r.hasOwnProperty(c))e.exports[c]=r[c]}},5081:function(e,t,a){var r=a(2613);var i=a(9392).Buffer;var o=a(8245);var n=a(5089);var s=n.newInvalidAsn1Error;function Reader(e){if(!e||!i.isBuffer(e))throw new TypeError("data must be a node Buffer");this._buf=e;this._size=e.length;this._len=0;this._offset=0}Object.defineProperty(Reader.prototype,"length",{enumerable:true,get:function(){return this._len}});Object.defineProperty(Reader.prototype,"offset",{enumerable:true,get:function(){return this._offset}});Object.defineProperty(Reader.prototype,"remain",{get:function(){return this._size-this._offset}});Object.defineProperty(Reader.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}});Reader.prototype.readByte=function(e){if(this._size-this._offset<1)return null;var t=this._buf[this._offset]&255;if(!e)this._offset+=1;return t};Reader.prototype.peek=function(){return this.readByte(true)};Reader.prototype.readLength=function(e){if(e===undefined)e=this._offset;if(e>=this._size)return null;var t=this._buf[e++]&255;if(t===null)return null;if((t&128)===128){t&=127;if(t===0)throw s("Indefinite length not supported");if(t>4)throw s("encoding too long");if(this._size-e<t)return null;this._len=0;for(var a=0;a<t;a++)this._len=(this._len<<8)+(this._buf[e++]&255)}else{this._len=t}return e};Reader.prototype.readSequence=function(e){var t=this.peek();if(t===null)return null;if(e!==undefined&&e!==t)throw s("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var a=this.readLength(this._offset+1);if(a===null)return null;this._offset=a;return t};Reader.prototype.readInt=function(){return this._readTag(o.Integer)};Reader.prototype.readBoolean=function(){return this._readTag(o.Boolean)===0?false:true};Reader.prototype.readEnumeration=function(){return this._readTag(o.Enumeration)};Reader.prototype.readString=function(e,t){if(!e)e=o.OctetString;var a=this.peek();if(a===null)return null;if(a!==e)throw s("Expected 0x"+e.toString(16)+": got 0x"+a.toString(16));var r=this.readLength(this._offset+1);if(r===null)return null;if(this.length>this._size-r)return null;this._offset=r;if(this.length===0)return t?i.alloc(0):"";var n=this._buf.slice(this._offset,this._offset+this.length);this._offset+=this.length;return t?n:n.toString("utf8")};Reader.prototype.readOID=function(e){if(!e)e=o.OID;var t=this.readString(e,true);if(t===null)return null;var a=[];var r=0;for(var i=0;i<t.length;i++){var n=t[i]&255;r<<=7;r+=n&127;if((n&128)===0){a.push(r);r=0}}r=a.shift();a.unshift(r%40);a.unshift(r/40>>0);return a.join(".")};Reader.prototype._readTag=function(e){r.ok(e!==undefined);var t=this.peek();if(t===null)return null;if(t!==e)throw s("Expected 0x"+e.toString(16)+": got 0x"+t.toString(16));var a=this.readLength(this._offset+1);if(a===null)return null;if(this.length>4)throw s("Integer too long: "+this.length);if(this.length>this._size-a)return null;this._offset=a;var i=this._buf[this._offset];var o=0;for(var n=0;n<this.length;n++){o<<=8;o|=this._buf[this._offset++]&255}if((i&128)===128&&n!==4)o-=1<<n*8;return o>>0};e.exports=Reader},8245:function(e){e.exports={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}},6229:function(e,t,a){var r=a(2613);var i=a(9392).Buffer;var o=a(8245);var n=a(5089);var s=n.newInvalidAsn1Error;var c={size:1024,growthFactor:8};function merge(e,t){r.ok(e);r.equal(typeof e,"object");r.ok(t);r.equal(typeof t,"object");var a=Object.getOwnPropertyNames(e);a.forEach((function(a){if(t[a])return;var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r)}));return t}function Writer(e){e=merge(c,e||{});this._buf=i.alloc(e.size||1024);this._size=this._buf.length;this._offset=0;this._options=e;this._seq=[]}Object.defineProperty(Writer.prototype,"buffer",{get:function(){if(this._seq.length)throw s(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}});Writer.prototype.writeByte=function(e){if(typeof e!=="number")throw new TypeError("argument must be a Number");this._ensure(1);this._buf[this._offset++]=e};Writer.prototype.writeInt=function(e,t){if(typeof e!=="number")throw new TypeError("argument must be a Number");if(typeof t!=="number")t=o.Integer;var a=4;while(((e&4286578688)===0||(e&4286578688)===4286578688>>0)&&a>1){a--;e<<=8}if(a>4)throw s("BER ints cannot be > 0xffffffff");this._ensure(2+a);this._buf[this._offset++]=t;this._buf[this._offset++]=a;while(a-- >0){this._buf[this._offset++]=(e&4278190080)>>>24;e<<=8}};Writer.prototype.writeNull=function(){this.writeByte(o.Null);this.writeByte(0)};Writer.prototype.writeEnumeration=function(e,t){if(typeof e!=="number")throw new TypeError("argument must be a Number");if(typeof t!=="number")t=o.Enumeration;return this.writeInt(e,t)};Writer.prototype.writeBoolean=function(e,t){if(typeof e!=="boolean")throw new TypeError("argument must be a Boolean");if(typeof t!=="number")t=o.Boolean;this._ensure(3);this._buf[this._offset++]=t;this._buf[this._offset++]=1;this._buf[this._offset++]=e?255:0};Writer.prototype.writeString=function(e,t){if(typeof e!=="string")throw new TypeError("argument must be a string (was: "+typeof e+")");if(typeof t!=="number")t=o.OctetString;var a=i.byteLength(e);this.writeByte(t);this.writeLength(a);if(a){this._ensure(a);this._buf.write(e,this._offset);this._offset+=a}};Writer.prototype.writeBuffer=function(e,t){if(typeof t!=="number")throw new TypeError("tag must be a number");if(!i.isBuffer(e))throw new TypeError("argument must be a buffer");this.writeByte(t);this.writeLength(e.length);this._ensure(e.length);e.copy(this._buf,this._offset,0,e.length);this._offset+=e.length};Writer.prototype.writeStringArray=function(e){if(!e instanceof Array)throw new TypeError("argument must be an Array[String]");var t=this;e.forEach((function(e){t.writeString(e)}))};Writer.prototype.writeOID=function(e,t){if(typeof e!=="string")throw new TypeError("argument must be a string");if(typeof t!=="number")t=o.OID;if(!/^([0-9]+\.){3,}[0-9]+$/.test(e))throw new Error("argument is not a valid OID string");function encodeOctet(e,t){if(t<128){e.push(t)}else if(t<16384){e.push(t>>>7|128);e.push(t&127)}else if(t<2097152){e.push(t>>>14|128);e.push((t>>>7|128)&255);e.push(t&127)}else if(t<268435456){e.push(t>>>21|128);e.push((t>>>14|128)&255);e.push((t>>>7|128)&255);e.push(t&127)}else{e.push((t>>>28|128)&255);e.push((t>>>21|128)&255);e.push((t>>>14|128)&255);e.push((t>>>7|128)&255);e.push(t&127)}}var a=e.split(".");var r=[];r.push(parseInt(a[0],10)*40+parseInt(a[1],10));a.slice(2).forEach((function(e){encodeOctet(r,parseInt(e,10))}));var i=this;this._ensure(2+r.length);this.writeByte(t);this.writeLength(r.length);r.forEach((function(e){i.writeByte(e)}))};Writer.prototype.writeLength=function(e){if(typeof e!=="number")throw new TypeError("argument must be a Number");this._ensure(4);if(e<=127){this._buf[this._offset++]=e}else if(e<=255){this._buf[this._offset++]=129;this._buf[this._offset++]=e}else if(e<=65535){this._buf[this._offset++]=130;this._buf[this._offset++]=e>>8;this._buf[this._offset++]=e}else if(e<=16777215){this._buf[this._offset++]=131;this._buf[this._offset++]=e>>16;this._buf[this._offset++]=e>>8;this._buf[this._offset++]=e}else{throw s("Length too long (> 4 bytes)")}};Writer.prototype.startSequence=function(e){if(typeof e!=="number")e=o.Sequence|o.Constructor;this.writeByte(e);this._seq.push(this._offset);this._ensure(3);this._offset+=3};Writer.prototype.endSequence=function(){var e=this._seq.pop();var t=e+3;var a=this._offset-t;if(a<=127){this._shift(t,a,-2);this._buf[e]=a}else if(a<=255){this._shift(t,a,-1);this._buf[e]=129;this._buf[e+1]=a}else if(a<=65535){this._buf[e]=130;this._buf[e+1]=a>>8;this._buf[e+2]=a}else if(a<=16777215){this._shift(t,a,1);this._buf[e]=131;this._buf[e+1]=a>>16;this._buf[e+2]=a>>8;this._buf[e+3]=a}else{throw s("Sequence too long")}};Writer.prototype._shift=function(e,t,a){r.ok(e!==undefined);r.ok(t!==undefined);r.ok(a);this._buf.copy(this._buf,e+a,e,e+t);this._offset+=a};Writer.prototype._ensure=function(e){r.ok(e);if(this._size-this._offset<e){var t=this._size*this._options.growthFactor;if(t-this._offset<e)t+=e;var a=i.alloc(t);this._buf.copy(a,0,0,this._offset);this._buf=a;this._size=t}};e.exports=Writer},1594:function(e,t,a){var r=a(9376);e.exports={Ber:r,BerReader:r.Reader,BerWriter:r.Writer}},7179:function(e,t,a){var r=a(2613);var i=a(2203).Stream;var o=a(9023);var n=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;function _capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function _toss(e,t,a,i,n){throw new r.AssertionError({message:o.format("%s (%s) is required",e,t),actual:n===undefined?typeof i:n(i),expected:t,operator:a||"===",stackStartFunction:_toss.caller})}function _getClass(e){return Object.prototype.toString.call(e).slice(8,-1)}function noop(){}var s={bool:{check:function(e){return typeof e==="boolean"}},func:{check:function(e){return typeof e==="function"}},string:{check:function(e){return typeof e==="string"}},object:{check:function(e){return typeof e==="object"&&e!==null}},number:{check:function(e){return typeof e==="number"&&!isNaN(e)}},finite:{check:function(e){return typeof e==="number"&&!isNaN(e)&&isFinite(e)}},buffer:{check:function(e){return Buffer.isBuffer(e)},operator:"Buffer.isBuffer"},array:{check:function(e){return Array.isArray(e)},operator:"Array.isArray"},stream:{check:function(e){return e instanceof i},operator:"instanceof",actual:_getClass},date:{check:function(e){return e instanceof Date},operator:"instanceof",actual:_getClass},regexp:{check:function(e){return e instanceof RegExp},operator:"instanceof",actual:_getClass},uuid:{check:function(e){return typeof e==="string"&&n.test(e)},operator:"isUUID"}};function _setExports(e){var t=Object.keys(s);var a;if(process.env.NODE_NDEBUG){a=noop}else{a=function(e,t){if(!e){_toss(t,"true",e)}}}t.forEach((function(t){if(e){a[t]=noop;return}var r=s[t];a[t]=function(e,a){if(!r.check(e)){_toss(a,t,r.operator,e,r.actual)}}}));t.forEach((function(t){var r="optional"+_capitalize(t);if(e){a[r]=noop;return}var i=s[t];a[r]=function(e,a){if(e===undefined||e===null){return}if(!i.check(e)){_toss(a,t,i.operator,e,i.actual)}}}));t.forEach((function(t){var r="arrayOf"+_capitalize(t);if(e){a[r]=noop;return}var i=s[t];var o="["+t+"]";a[r]=function(e,t){if(!Array.isArray(e)){_toss(t,o,i.operator,e,i.actual)}var a;for(a=0;a<e.length;a++){if(!i.check(e[a])){_toss(t,o,i.operator,e,i.actual)}}}}));t.forEach((function(t){var r="optionalArrayOf"+_capitalize(t);if(e){a[r]=noop;return}var i=s[t];var o="["+t+"]";a[r]=function(e,t){if(e===undefined||e===null){return}if(!Array.isArray(e)){_toss(t,o,i.operator,e,i.actual)}var a;for(a=0;a<e.length;a++){if(!i.check(e[a])){_toss(t,o,i.operator,e,i.actual)}}}}));Object.keys(r).forEach((function(t){if(t==="AssertionError"){a[t]=r[t];return}if(e){a[t]=noop;return}a[t]=r[t]}));a._setExports=_setExports;return a}e.exports=_setExports(process.env.NODE_NDEBUG)},5094:function(e,t,a){e.exports={parallel:a(3047),serial:a(2312),serialOrdered:a(3587)}},6524:function(e){e.exports=abort;function abort(e){Object.keys(e.jobs).forEach(clean.bind(e));e.jobs={}}function clean(e){if(typeof this.jobs[e]=="function"){this.jobs[e]()}}},3134:function(e,t,a){var r=a(8374);e.exports=async;function async(e){var t=false;r((function(){t=true}));return function async_callback(a,i){if(t){e(a,i)}else{r((function nextTick_callback(){e(a,i)}))}}}},8374:function(e){e.exports=defer;function defer(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t){t(e)}else{setTimeout(e,0)}}},8056:function(e,t,a){var r=a(3134),i=a(6524);e.exports=iterate;function iterate(e,t,a,r){var o=a["keyedList"]?a["keyedList"][a.index]:a.index;a.jobs[o]=runJob(t,o,e[o],(function(e,t){if(!(o in a.jobs)){return}delete a.jobs[o];if(e){i(a)}else{a.results[o]=t}r(e,a.results)}))}function runJob(e,t,a,i){var o;if(e.length==2){o=e(a,r(i))}else{o=e(a,t,r(i))}return o}},1987:function(e){e.exports=state;function state(e,t){var a=!Array.isArray(e),r={index:0,keyedList:a||t?Object.keys(e):null,jobs:{},results:a?{}:[],size:a?Object.keys(e).length:e.length};if(t){r.keyedList.sort(a?t:function(a,r){return t(e[a],e[r])})}return r}},1393:function(e,t,a){var r=a(6524),i=a(3134);e.exports=terminator;function terminator(e){if(!Object.keys(this.jobs).length){return}this.index=this.size;r(this);i(e)(null,this.results)}},3047:function(e,t,a){var r=a(8056),i=a(1987),o=a(1393);e.exports=parallel;function parallel(e,t,a){var n=i(e);while(n.index<(n["keyedList"]||e).length){r(e,t,n,(function(e,t){if(e){a(e,t);return}if(Object.keys(n.jobs).length===0){a(null,n.results);return}}));n.index++}return o.bind(n,a)}},2312:function(e,t,a){var r=a(3587);e.exports=serial;function serial(e,t,a){return r(e,t,null,a)}},3587:function(e,t,a){var r=a(8056),i=a(1987),o=a(1393);e.exports=serialOrdered;e.exports.ascending=ascending;e.exports.descending=descending;function serialOrdered(e,t,a,n){var s=i(e,a);r(e,t,s,(function iteratorHandler(a,i){if(a){n(a,i);return}s.index++;if(s.index<(s["keyedList"]||e).length){r(e,t,s,iteratorHandler);return}n(null,s.results)}));return o.bind(s,n)}function ascending(e,t){return e<t?-1:e>t?1:0}function descending(e,t){return-1*ascending(e,t)}},2169:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NOOP=t.LIMIT_FILES_DESCRIPTORS=t.LIMIT_BASENAME_LENGTH=t.IS_USER_ROOT=t.IS_POSIX=t.DEFAULT_TIMEOUT_SYNC=t.DEFAULT_TIMEOUT_ASYNC=t.DEFAULT_WRITE_OPTIONS=t.DEFAULT_READ_OPTIONS=t.DEFAULT_FOLDER_MODE=t.DEFAULT_FILE_MODE=t.DEFAULT_ENCODING=void 0;const a="utf8";t.DEFAULT_ENCODING=a;const r=438;t.DEFAULT_FILE_MODE=r;const i=511;t.DEFAULT_FOLDER_MODE=i;const o={};t.DEFAULT_READ_OPTIONS=o;const n={};t.DEFAULT_WRITE_OPTIONS=n;const s=5e3;t.DEFAULT_TIMEOUT_ASYNC=s;const c=100;t.DEFAULT_TIMEOUT_SYNC=c;const u=!!process.getuid;t.IS_POSIX=u;const l=process.getuid?!process.getuid():false;t.IS_USER_ROOT=l;const p=128;t.LIMIT_BASENAME_LENGTH=p;const f=1e4;t.LIMIT_FILES_DESCRIPTORS=f;const NOOP=()=>{};t.NOOP=NOOP},6265:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.writeFileSync=t.writeFile=t.readFileSync=t.readFile=void 0;const r=a(6928);const i=a(2169);const o=a(8568);const n=a(9907);const s=a(1014);const c=a(1425);function readFile(e,t=i.DEFAULT_READ_OPTIONS){var a;if(n.default.isString(t))return readFile(e,{encoding:t});const r=Date.now()+((a=t.timeout)!==null&&a!==void 0?a:i.DEFAULT_TIMEOUT_ASYNC);return o.default.readFileRetry(r)(e,t)}t.readFile=readFile;function readFileSync(e,t=i.DEFAULT_READ_OPTIONS){var a;if(n.default.isString(t))return readFileSync(e,{encoding:t});const r=Date.now()+((a=t.timeout)!==null&&a!==void 0?a:i.DEFAULT_TIMEOUT_SYNC);return o.default.readFileSyncRetry(r)(e,t)}t.readFileSync=readFileSync;const writeFile=(e,t,a,r)=>{if(n.default.isFunction(a))return writeFile(e,t,i.DEFAULT_WRITE_OPTIONS,a);const o=writeFileAsync(e,t,a);if(r)o.then(r,r);return o};t.writeFile=writeFile;const writeFileAsync=async(e,t,a=i.DEFAULT_WRITE_OPTIONS)=>{var u;if(n.default.isString(a))return writeFileAsync(e,t,{encoding:a});const l=Date.now()+((u=a.timeout)!==null&&u!==void 0?u:i.DEFAULT_TIMEOUT_ASYNC);let p=null,f=null,m=null,h=null,g=null;try{if(a.schedule)p=await a.schedule(e);f=await s.default.schedule(e);e=await o.default.realpathAttempt(e)||e;[h,m]=c.default.get(e,a.tmpCreate||c.default.create,!(a.tmpPurge===false));const u=i.IS_POSIX&&n.default.isUndefined(a.chown),y=n.default.isUndefined(a.mode);if(u||y){const t=await o.default.statAttempt(e);if(t){a={...a};if(u)a.chown={uid:t.uid,gid:t.gid};if(y)a.mode=t.mode}}const b=r.dirname(e);await o.default.mkdirAttempt(b,{mode:i.DEFAULT_FOLDER_MODE,recursive:true});g=await o.default.openRetry(l)(h,"w",a.mode||i.DEFAULT_FILE_MODE);if(a.tmpCreated)a.tmpCreated(h);if(n.default.isString(t)){await o.default.writeRetry(l)(g,t,0,a.encoding||i.DEFAULT_ENCODING)}else if(!n.default.isUndefined(t)){await o.default.writeRetry(l)(g,t,0,t.length,0)}if(a.fsync!==false){if(a.fsyncWait!==false){await o.default.fsyncRetry(l)(g)}else{o.default.fsyncAttempt(g)}}await o.default.closeRetry(l)(g);g=null;if(a.chown)await o.default.chownAttempt(h,a.chown.uid,a.chown.gid);if(a.mode)await o.default.chmodAttempt(h,a.mode);try{await o.default.renameRetry(l)(h,e)}catch(t){if(t.code!=="ENAMETOOLONG")throw t;await o.default.renameRetry(l)(h,c.default.truncate(e))}m();h=null}finally{if(g)await o.default.closeAttempt(g);if(h)c.default.purge(h);if(p)p();if(f)f()}};const writeFileSync=(e,t,a=i.DEFAULT_WRITE_OPTIONS)=>{var s;if(n.default.isString(a))return writeFileSync(e,t,{encoding:a});const u=Date.now()+((s=a.timeout)!==null&&s!==void 0?s:i.DEFAULT_TIMEOUT_SYNC);let l=null,p=null,f=null;try{e=o.default.realpathSyncAttempt(e)||e;[p,l]=c.default.get(e,a.tmpCreate||c.default.create,!(a.tmpPurge===false));const s=i.IS_POSIX&&n.default.isUndefined(a.chown),m=n.default.isUndefined(a.mode);if(s||m){const t=o.default.statSyncAttempt(e);if(t){a={...a};if(s)a.chown={uid:t.uid,gid:t.gid};if(m)a.mode=t.mode}}const h=r.dirname(e);o.default.mkdirSyncAttempt(h,{mode:i.DEFAULT_FOLDER_MODE,recursive:true});f=o.default.openSyncRetry(u)(p,"w",a.mode||i.DEFAULT_FILE_MODE);if(a.tmpCreated)a.tmpCreated(p);if(n.default.isString(t)){o.default.writeSyncRetry(u)(f,t,0,a.encoding||i.DEFAULT_ENCODING)}else if(!n.default.isUndefined(t)){o.default.writeSyncRetry(u)(f,t,0,t.length,0)}if(a.fsync!==false){if(a.fsyncWait!==false){o.default.fsyncSyncRetry(u)(f)}else{o.default.fsyncAttempt(f)}}o.default.closeSyncRetry(u)(f);f=null;if(a.chown)o.default.chownSyncAttempt(p,a.chown.uid,a.chown.gid);if(a.mode)o.default.chmodSyncAttempt(p,a.mode);try{o.default.renameSyncRetry(u)(p,e)}catch(t){if(t.code!=="ENAMETOOLONG")throw t;o.default.renameSyncRetry(u)(p,c.default.truncate(e))}l();p=null}finally{if(f)o.default.closeSyncAttempt(f);if(p)c.default.purge(p)}};t.writeFileSync=writeFileSync},7250:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.attemptifySync=t.attemptifyAsync=void 0;const r=a(2169);const attemptifyAsync=(e,t=r.NOOP)=>function(){return e.apply(undefined,arguments).catch(t)};t.attemptifyAsync=attemptifyAsync;const attemptifySync=(e,t=r.NOOP)=>function(){try{return e.apply(undefined,arguments)}catch(e){return t(e)}};t.attemptifySync=attemptifySync},8568:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(9896);const i=a(9023);const o=a(7250);const n=a(1674);const s=a(3547);const c={chmodAttempt:o.attemptifyAsync(i.promisify(r.chmod),n.default.onChangeError),chownAttempt:o.attemptifyAsync(i.promisify(r.chown),n.default.onChangeError),closeAttempt:o.attemptifyAsync(i.promisify(r.close)),fsyncAttempt:o.attemptifyAsync(i.promisify(r.fsync)),mkdirAttempt:o.attemptifyAsync(i.promisify(r.mkdir)),realpathAttempt:o.attemptifyAsync(i.promisify(r.realpath)),statAttempt:o.attemptifyAsync(i.promisify(r.stat)),unlinkAttempt:o.attemptifyAsync(i.promisify(r.unlink)),closeRetry:s.retryifyAsync(i.promisify(r.close),n.default.isRetriableError),fsyncRetry:s.retryifyAsync(i.promisify(r.fsync),n.default.isRetriableError),openRetry:s.retryifyAsync(i.promisify(r.open),n.default.isRetriableError),readFileRetry:s.retryifyAsync(i.promisify(r.readFile),n.default.isRetriableError),renameRetry:s.retryifyAsync(i.promisify(r.rename),n.default.isRetriableError),statRetry:s.retryifyAsync(i.promisify(r.stat),n.default.isRetriableError),writeRetry:s.retryifyAsync(i.promisify(r.write),n.default.isRetriableError),chmodSyncAttempt:o.attemptifySync(r.chmodSync,n.default.onChangeError),chownSyncAttempt:o.attemptifySync(r.chownSync,n.default.onChangeError),closeSyncAttempt:o.attemptifySync(r.closeSync),mkdirSyncAttempt:o.attemptifySync(r.mkdirSync),realpathSyncAttempt:o.attemptifySync(r.realpathSync),statSyncAttempt:o.attemptifySync(r.statSync),unlinkSyncAttempt:o.attemptifySync(r.unlinkSync),closeSyncRetry:s.retryifySync(r.closeSync,n.default.isRetriableError),fsyncSyncRetry:s.retryifySync(r.fsyncSync,n.default.isRetriableError),openSyncRetry:s.retryifySync(r.openSync,n.default.isRetriableError),readFileSyncRetry:s.retryifySync(r.readFileSync,n.default.isRetriableError),renameSyncRetry:s.retryifySync(r.renameSync,n.default.isRetriableError),statSyncRetry:s.retryifySync(r.statSync,n.default.isRetriableError),writeSyncRetry:s.retryifySync(r.writeSync,n.default.isRetriableError)};t["default"]=c},1674:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(2169);const i={isChangeErrorOk:e=>{const{code:t}=e;if(t==="ENOSYS")return true;if(!r.IS_USER_ROOT&&(t==="EINVAL"||t==="EPERM"))return true;return false},isRetriableError:e=>{const{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCS"||t==="EPERM")return true;return false},onChangeError:e=>{if(i.isChangeErrorOk(e))return;throw e}};t["default"]=i},9907:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={isFunction:e=>typeof e==="function",isString:e=>typeof e==="string",isUndefined:e=>typeof e==="undefined"};t["default"]=a},3547:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.retryifySync=t.retryifyAsync=void 0;const r=a(2763);const retryifyAsync=(e,t)=>function(a){return function attempt(){return r.default.schedule().then((r=>e.apply(undefined,arguments).then((e=>{r();return e}),(e=>{r();if(Date.now()>=a)throw e;if(t(e)){const e=Math.round(100+400*Math.random()),t=new Promise((t=>setTimeout(t,e)));return t.then((()=>attempt.apply(undefined,arguments)))}throw e}))))}};t.retryifyAsync=retryifyAsync;const retryifySync=(e,t)=>function(a){return function attempt(){try{return e.apply(undefined,arguments)}catch(e){if(Date.now()>a)throw e;if(t(e))return attempt.apply(undefined,arguments);throw e}}};t.retryifySync=retryifySync},2763:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(2169);const i={interval:25,intervalId:undefined,limit:r.LIMIT_FILES_DESCRIPTORS,queueActive:new Set,queueWaiting:new Set,init:()=>{if(i.intervalId)return;i.intervalId=setInterval(i.tick,i.interval)},reset:()=>{if(!i.intervalId)return;clearInterval(i.intervalId);delete i.intervalId},add:e=>{i.queueWaiting.add(e);if(i.queueActive.size<i.limit/2){i.tick()}else{i.init()}},remove:e=>{i.queueWaiting.delete(e);i.queueActive.delete(e)},schedule:()=>new Promise((e=>{const cleanup=()=>i.remove(resolver);const resolver=()=>e(cleanup);i.add(resolver)})),tick:()=>{if(i.queueActive.size>=i.limit)return;if(!i.queueWaiting.size)return i.reset();for(const e of i.queueWaiting){if(i.queueActive.size>=i.limit)break;i.queueWaiting.delete(e);i.queueActive.add(e);e()}}};t["default"]=i},1014:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={};const r={next:e=>{const t=a[e];if(!t)return;t.shift();const i=t[0];if(i){i((()=>r.next(e)))}else{delete a[e]}},schedule:e=>new Promise((t=>{let i=a[e];if(!i)i=a[e]=[];i.push(t);if(i.length>1)return;t((()=>r.next(e)))}))};t["default"]=r},1425:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=a(6928);const i=a(2169);const o=a(8568);const n={store:{},create:e=>{const t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),a=Date.now().toString().slice(-10),r="tmp-",i=`.${r}${a}${t}`,o=`${e}${i}`;return o},get:(e,t,a=true)=>{const r=n.truncate(t(e));if(r in n.store)return n.get(e,t,a);n.store[r]=a;const disposer=()=>delete n.store[r];return[r,disposer]},purge:e=>{if(!n.store[e])return;delete n.store[e];o.default.unlinkAttempt(e)},purgeSync:e=>{if(!n.store[e])return;delete n.store[e];o.default.unlinkSyncAttempt(e)},purgeSyncAll:()=>{for(const e in n.store){n.purgeSync(e)}},truncate:e=>{const t=r.basename(e);if(t.length<=i.LIMIT_BASENAME_LENGTH)return e;const a=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!a)return e;const o=t.length-i.LIMIT_BASENAME_LENGTH;return`${e.slice(0,-t.length)}${a[1]}${a[2].slice(0,-o)}${a[3]}`}};process.on("exit",n.purgeSyncAll);t["default"]=n},791:function(e,t,a){
8
8
  /*!
9
9
  * Copyright 2010 LearnBoost <dev@learnboost.com>
10
10
  *
@@ -33,7 +33,7 @@ e.exports=a(7080)},6553:function(e,t,a){"use strict";
33
33
  * Copyright(c) 2014 Jonathan Ong
34
34
  * Copyright(c) 2015 Douglas Christopher Wilson
35
35
  * MIT Licensed
36
- */var r=a(8936);var i=a(6928).extname;var o=/^\s*([^;\s]*)(?:;|\s|$)/;var n=/^text\//i;t.charset=charset;t.charsets={lookup:charset};t.contentType=contentType;t.extension=extension;t.extensions=Object.create(null);t.lookup=lookup;t.types=Object.create(null);populateMaps(t.extensions,t.types);function charset(e){if(!e||typeof e!=="string"){return false}var t=o.exec(e);var a=t&&r[t[1].toLowerCase()];if(a&&a.charset){return a.charset}if(t&&n.test(t[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var a=e.indexOf("/")===-1?t.lookup(e):e;if(!a){return false}if(a.indexOf("charset")===-1){var r=t.charset(a);if(r)a+="; charset="+r.toLowerCase()}return a}function extension(e){if(!e||typeof e!=="string"){return false}var a=o.exec(e);var r=a&&t.extensions[a[1].toLowerCase()];if(!r||!r.length){return false}return r[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var a=i("x."+e).toLowerCase().substr(1);if(!a){return false}return t.types[a]||false}function populateMaps(e,t){var a=["nginx","apache",undefined,"iana"];Object.keys(r).forEach((function forEachMimeType(i){var o=r[i];var n=o.extensions;if(!n||!n.length){return}e[i]=n;for(var s=0;s<n.length;s++){var c=n[s];if(t[c]){var u=a.indexOf(r[t[c]].source);var l=a.indexOf(o.source);if(t[c]!=="application/octet-stream"&&(u>l||u===l&&t[c].substr(0,12)==="application/")){continue}}t[c]=i}}))}},7735:function(e){"use strict";const mimicFn=(e,t)=>{for(const a of Reflect.ownKeys(t)){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},316:function(e){"use strict";const copyProperty=(e,t,a,r)=>{if(a==="length"||a==="prototype"){return}if(a==="arguments"||a==="caller"){return}const i=Object.getOwnPropertyDescriptor(e,a);const o=Object.getOwnPropertyDescriptor(t,a);if(!canCopyProperty(i,o)&&r){return}Object.defineProperty(e,a,o)};const canCopyProperty=function(e,t){return e===undefined||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)};const changePrototype=(e,t)=>{const a=Object.getPrototypeOf(t);if(a===Object.getPrototypeOf(e)){return}Object.setPrototypeOf(e,a)};const wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`;const t=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const a=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(e,r,i)=>{const o=i===""?"":`with ${i.trim()}() `;const n=wrappedToString.bind(null,o,r.toString());Object.defineProperty(n,"name",a);Object.defineProperty(e,"toString",{...t,value:n})};const mimicFn=(e,t,{ignoreNonConfigurable:a=false}={})=>{const{name:r}=e;for(const r of Reflect.ownKeys(t)){copyProperty(e,t,r,a)}changePrototype(e,t);changeToString(e,t,r);return e};e.exports=mimicFn},7237:function(e,t,a){const r=a(7010);const i=a(2763);const{mkdirpNative:o,mkdirpNativeSync:n}=a(2058);const{mkdirpManual:s,mkdirpManualSync:c}=a(5559);const{useNative:u,useNativeSync:l}=a(9764);const mkdirp=(e,t)=>{e=i(e);t=r(t);return u(t)?o(e,t):s(e,t)};const mkdirpSync=(e,t)=>{e=i(e);t=r(t);return l(t)?n(e,t):c(e,t)};mkdirp.sync=mkdirpSync;mkdirp.native=(e,t)=>o(i(e),r(t));mkdirp.manual=(e,t)=>s(i(e),r(t));mkdirp.nativeSync=(e,t)=>n(i(e),r(t));mkdirp.manualSync=(e,t)=>c(i(e),r(t));e.exports=mkdirp},8874:function(e,t,a){const{dirname:r}=a(6928);const findMade=(e,t,a=undefined)=>{if(a===t)return Promise.resolve();return e.statAsync(t).then((e=>e.isDirectory()?a:undefined),(a=>a.code==="ENOENT"?findMade(e,r(t),t):undefined))};const findMadeSync=(e,t,a=undefined)=>{if(a===t)return undefined;try{return e.statSync(t).isDirectory()?a:undefined}catch(a){return a.code==="ENOENT"?findMadeSync(e,r(t),t):undefined}};e.exports={findMade:findMade,findMadeSync:findMadeSync}},5559:function(e,t,a){const{dirname:r}=a(6928);const mkdirpManual=(e,t,a)=>{t.recursive=false;const i=r(e);if(i===e){return t.mkdirAsync(e,t).catch((e=>{if(e.code!=="EISDIR")throw e}))}return t.mkdirAsync(e,t).then((()=>a||e),(r=>{if(r.code==="ENOENT")return mkdirpManual(i,t).then((a=>mkdirpManual(e,t,a)));if(r.code!=="EEXIST"&&r.code!=="EROFS")throw r;return t.statAsync(e).then((e=>{if(e.isDirectory())return a;else throw r}),(()=>{throw r}))}))};const mkdirpManualSync=(e,t,a)=>{const i=r(e);t.recursive=false;if(i===e){try{return t.mkdirSync(e,t)}catch(e){if(e.code!=="EISDIR")throw e;else return}}try{t.mkdirSync(e,t);return a||e}catch(r){if(r.code==="ENOENT")return mkdirpManualSync(e,t,mkdirpManualSync(i,t,a));if(r.code!=="EEXIST"&&r.code!=="EROFS")throw r;try{if(!t.statSync(e).isDirectory())throw r}catch(e){throw r}}};e.exports={mkdirpManual:mkdirpManual,mkdirpManualSync:mkdirpManualSync}},2058:function(e,t,a){const{dirname:r}=a(6928);const{findMade:i,findMadeSync:o}=a(8874);const{mkdirpManual:n,mkdirpManualSync:s}=a(5559);const mkdirpNative=(e,t)=>{t.recursive=true;const a=r(e);if(a===e)return t.mkdirAsync(e,t);return i(t,e).then((a=>t.mkdirAsync(e,t).then((()=>a)).catch((a=>{if(a.code==="ENOENT")return n(e,t);else throw a}))))};const mkdirpNativeSync=(e,t)=>{t.recursive=true;const a=r(e);if(a===e)return t.mkdirSync(e,t);const i=o(t,e);try{t.mkdirSync(e,t);return i}catch(a){if(a.code==="ENOENT")return s(e,t);else throw a}};e.exports={mkdirpNative:mkdirpNative,mkdirpNativeSync:mkdirpNativeSync}},7010:function(e,t,a){const{promisify:r}=a(9023);const i=a(9896);const optsArg=e=>{if(!e)e={mode:511,fs:i};else if(typeof e==="object")e={mode:511,fs:i,...e};else if(typeof e==="number")e={mode:e,fs:i};else if(typeof e==="string")e={mode:parseInt(e,8),fs:i};else throw new TypeError("invalid options argument");e.mkdir=e.mkdir||e.fs.mkdir||i.mkdir;e.mkdirAsync=r(e.mkdir);e.stat=e.stat||e.fs.stat||i.stat;e.statAsync=r(e.stat);e.statSync=e.statSync||e.fs.statSync||i.statSync;e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||i.mkdirSync;return e};e.exports=optsArg},2763:function(e,t,a){const r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform;const{resolve:i,parse:o}=a(6928);const pathArg=e=>{if(/\0/.test(e)){throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=i(e);if(r==="win32"){const t=/[*|"<>?:]/;const{root:a}=o(e);if(t.test(e.substr(a.length))){throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}}return e};e.exports=pathArg},9764:function(e,t,a){const r=a(9896);const i=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version;const o=i.replace(/^v/,"").split(".");const n=+o[0]>10||+o[0]===10&&+o[1]>=12;const s=!n?()=>false:e=>e.mkdir===r.mkdir;const c=!n?()=>false:e=>e.mkdirSync===r.mkdirSync;e.exports={useNative:s,useNativeSync:c}},3016:function(e,t,a){let r=a(9896);let i=a(857);let o=a(6928);let n=a(6982);let s=a(7237);let c=a(1567);function getFilename(e,t,a){let r=t.originalname.split(".").pop();n.pseudoRandomBytes(16,(function(e,t){a(e,e?undefined:t.toString("hex")+"."+r)}))}function getDestination(e,t,a){a(null,i.tmpdir())}function COSStorage(e={}){if(!(this instanceof COSStorage)){return new COSStorage(e)}if(e.filename==="auto"||!e.filename){this.getFilename=getFilename}else{this.getFilename=e.filename}if(typeof e.destination==="string"){s.sync(e.destination);this.getDestination=function(t,a,r){r(null,e.destination)}}else{this.getDestination=e.destination||getDestination}if(e.cos){e.cos.SecretId=e.cos.SecretId||process.env.SecretId||null;e.cos.SecretKey=e.cos.SecretKey||process.env.SecretKey||null;e.cos.Bucket=e.cos.Bucket||process.env.Bucket||null;e.cos.Region=e.cos.Region||process.env.Region||null;e.cos.domain=e.cos.domain||process.env.domain||null;e.cos.dir=e.cos.dir||process.env.dir||"";e.cos.dir=e.cos.dir==""?e.cos.dir:e.cos.dir+"/";if(!e.cos.SecretId){throw new Error("You have to specify qcloud api SecretId !")}if(!e.cos.SecretKey){throw new Error("You have to specify qcloud api SecretKey .")}this.cos=new c({SecretId:e.cos.SecretId,SecretKey:e.cos.SecretKey,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1024*1024});this.cosRun={domain:e.cos.domain,Bucket:e.cos.Bucket,Region:e.cos.Region,dir:e.cos.dir,taskId:null,onProgress:e.cos.onProgress||function(){}}}}COSStorage.prototype.test=function(){this.cos.getService((function(e,t){if(e){console.log("%s","qcloud test failed");console.error(e)}else{console.log("%s","qcloud test success");console.log(t)}}))};COSStorage.prototype.cancelTask=function(e){var e=e||this.cosRun.taskId;this.cos.cancelTask(e);console.log("canceled")};COSStorage.prototype.pauseTask=function(e){var e=e||this.cosRun.taskId;this.cos.pauseTask(e);console.log("paused")};COSStorage.prototype.restartTask=function(e){var e=e||this.cosRun.taskId;this.cos.restartTask(e);console.log("restart")};COSStorage.prototype._handleFile=function _handleFile(e,t,a){let i=this;i.getDestination(e,t,(function(n,s){if(n){return a(n)}t.destination=s;i.getFilename(e,t,(function(n,c){if(n){return a(n)}t.filename=i.cosRun.dir+c;t.tmpPath=o.join(s,c);let u=r.createWriteStream(t.tmpPath);t.stream.pipe(u);u.on("finish",(function(){i.cos.putObject({Bucket:i.cosRun.Bucket,Region:i.cosRun.Region,Key:t.filename,TaskReady:function(e){i.cosRun.taskId=e},onProgress:function(e){i.cosRun.onProgress(e)},Body:r.createReadStream(t.tmpPath),ContentLength:u.bytesWritten},(function(r,o){if(r){i._removeFile(e,t,(function(){a(r.error)}))}else{if(i.cosRun.domain){o.Location=`http://${i.cosRun.domain}/${t.filename}`}t.url=o.Location;i._removeFile(e,t,(function(){a()}))}}))}));u.on("error",(function(r){i._removeFile(e,t,a(r.error))}))}))}))};COSStorage.prototype._removeFile=function _removeFile(e,t,a){let i=t.tmpPath;this.cosRun.taskId=null;delete t.destination;delete t.filename;delete t.tmpPath;r.unlink(i,a)};e.exports=function(e){return new COSStorage(e)}},9949:function(e,t,a){var r=a(6982);function sha(e,t,a){return r.createHmac(a,e).update(t).digest("base64")}function rsa(e,t){return r.createSign("RSA-SHA1").update(t).sign(e,"base64")}function rfc3986(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function map(e){var t,a,r=[];for(t in e){a=e[t];if(Array.isArray(a))for(var i=0;i<a.length;i++)r.push([t,a[i]]);else if(typeof a==="object")for(var o in a)r.push([t+"["+o+"]",a[o]]);else r.push([t,a])}return r}function compare(e,t){return e>t?1:e<t?-1:0}function generateBase(e,t,a){var r=map(a).map((function(e){return[rfc3986(e[0]),rfc3986(e[1]||"")]})).sort((function(e,t){return compare(e[0],t[0])||compare(e[1],t[1])})).map((function(e){return e.join("=")})).join("&");var i=[rfc3986(e?e.toUpperCase():"GET"),rfc3986(t),rfc3986(r)].join("&");return i}function hmacsign(e,t,a,r,i){var o=generateBase(e,t,a);var n=[r||"",i||""].map(rfc3986).join("&");return sha(n,o,"sha1")}function hmacsign256(e,t,a,r,i){var o=generateBase(e,t,a);var n=[r||"",i||""].map(rfc3986).join("&");return sha(n,o,"sha256")}function rsasign(e,t,a,r,i){var o=generateBase(e,t,a);var n=r||"";return rsa(n,o)}function plaintext(e,t){var a=[e||"",t||""].map(rfc3986).join("&");return a}function sign(e,t,a,r,i,o){var n;var s=1;switch(e){case"RSA-SHA1":n=rsasign;break;case"HMAC-SHA1":n=hmacsign;break;case"HMAC-SHA256":n=hmacsign256;break;case"PLAINTEXT":n=plaintext;s=4;break;default:throw new Error("Signature method not supported: "+e)}return n.apply(null,[].slice.call(arguments,s))}t.hmacsign=hmacsign;t.hmacsign256=hmacsign256;t.rsasign=rsasign;t.plaintext=plaintext;t.sign=sign;t.rfc3986=rfc3986;t.generateBase=generateBase},602:function(e,t,a){"use strict";const r=a(7735);const i=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let a;let o=0;const n=e.displayName||e.name||"<anonymous>";const onetime=function(...r){i.set(onetime,++o);if(o===1){a=e.apply(this,r);e=null}else if(t.throw===true){throw new Error(`Function \`${n}\` can only be called once`)}return a};r(onetime,e);i.set(onetime,o);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!i.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return i.get(e)}},3311:function(e,t,a){"use strict";const r=a(9930);const pLimit=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"))}const t=[];let a=0;const next=()=>{a--;if(t.length>0){t.shift()()}};const run=(e,t,...i)=>{a++;const o=r(e,...i);t(o);o.then(next,next)};const enqueue=(r,i,...o)=>{if(a<e){run(r,i,...o)}else{t.push(run.bind(null,r,i,...o))}};const generator=(e,...t)=>new Promise((a=>enqueue(e,a,...t)));Object.defineProperties(generator,{activeCount:{get:()=>a},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}});return generator};e.exports=pLimit;e.exports["default"]=pLimit},9199:function(e,t,a){"use strict";const r=a(3311);class EndError extends Error{constructor(e){super();this.value=e}}const testElement=(e,t)=>Promise.resolve(e).then(t);const finder=e=>Promise.all(e).then((e=>e[1]===true&&Promise.reject(new EndError(e[0]))));e.exports=(e,t,a)=>{a=Object.assign({concurrency:Infinity,preserveOrder:true},a);const i=r(a.concurrency);const o=[...e].map((e=>[e,i(testElement,e,t)]));const n=r(a.preserveOrder?1:Infinity);return Promise.all(o.map((e=>n(finder,e)))).then((()=>{})).catch((e=>e instanceof EndError?e.value:Promise.reject(e)))}},9930:function(e){"use strict";const pTry=(e,...t)=>new Promise((a=>{a(e(...t))}));e.exports=pTry;e.exports["default"]=pTry},1813:function(e,t,a){"use strict";const r=a(9896);e.exports=e=>new Promise((t=>{r.access(e,(e=>{t(!e)}))}));e.exports.sync=e=>{try{r.accessSync(e);return true}catch(e){return false}}},540:function(e){(function(){var t,a,r,i,o,n;if(typeof performance!=="undefined"&&performance!==null&&performance.now){e.exports=function(){return performance.now()}}else if(typeof process!=="undefined"&&process!==null&&process.hrtime){e.exports=function(){return(t()-o)/1e6};a=process.hrtime;t=function(){var e;e=a();return e[0]*1e9+e[1]};i=t();n=process.uptime()*1e9;o=i-n}else if(Date.now){e.exports=function(){return Date.now()-r};r=Date.now()}else{e.exports=function(){return(new Date).getTime()-r};r=(new Date).getTime()}}).call(this)},1504:function(e,t,a){"use strict";const r=a(7559);e.exports=async({cwd:e}={})=>r("package.json",{cwd:e});e.exports.sync=({cwd:e}={})=>r.sync("package.json",{cwd:e})},3438:function(e){"use strict";var t=String.prototype.replace;var a=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return t.call(e,a,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},3594:function(e,t,a){"use strict";var r=a(7575);var i=a(7497);var o=a(3438);e.exports={formats:o,parse:i,stringify:r}},7497:function(e,t,a){"use strict";var r=a(187);var i=Object.prototype.hasOwnProperty;var o={allowDots:false,allowPrototypes:false,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:false,strictNullHandling:false};var n=function parseQueryStringValues(e,t){var a={};var r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;var n=t.parameterLimit===Infinity?undefined:t.parameterLimit;var s=r.split(t.delimiter,n);for(var c=0;c<s.length;++c){var u=s[c];var l=u.indexOf("]=");var p=l===-1?u.indexOf("="):l+1;var f,m;if(p===-1){f=t.decoder(u,o.decoder);m=t.strictNullHandling?null:""}else{f=t.decoder(u.slice(0,p),o.decoder);m=t.decoder(u.slice(p+1),o.decoder)}if(i.call(a,f)){a[f]=[].concat(a[f]).concat(m)}else{a[f]=m}}return a};var parseObject=function(e,t,a){var r=t;for(var i=e.length-1;i>=0;--i){var o;var n=e[i];if(n==="[]"&&a.parseArrays){o=[].concat(r)}else{o=a.plainObjects?Object.create(null):{};var s=n.charAt(0)==="["&&n.charAt(n.length-1)==="]"?n.slice(1,-1):n;var c=parseInt(s,10);if(!a.parseArrays&&s===""){o={0:r}}else if(!isNaN(c)&&n!==s&&String(c)===s&&c>=0&&(a.parseArrays&&c<=a.arrayLimit)){o=[];o[c]=r}else if(s!=="__proto__"){o[s]=r}}r=o}return r};var s=function parseQueryStringKeys(e,t,a){if(!e){return}var r=a.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;var o=/(\[[^[\]]*])/;var n=/(\[[^[\]]*])/g;var s=o.exec(r);var c=s?r.slice(0,s.index):r;var u=[];if(c){if(!a.plainObjects&&i.call(Object.prototype,c)){if(!a.allowPrototypes){return}}u.push(c)}var l=0;while((s=n.exec(r))!==null&&l<a.depth){l+=1;if(!a.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))){if(!a.allowPrototypes){return}}u.push(s[1])}if(s){u.push("["+r.slice(s.index)+"]")}return parseObject(u,t,a)};e.exports=function(e,t){var a=t?r.assign({},t):{};if(a.decoder!==null&&a.decoder!==undefined&&typeof a.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}a.ignoreQueryPrefix=a.ignoreQueryPrefix===true;a.delimiter=typeof a.delimiter==="string"||r.isRegExp(a.delimiter)?a.delimiter:o.delimiter;a.depth=typeof a.depth==="number"?a.depth:o.depth;a.arrayLimit=typeof a.arrayLimit==="number"?a.arrayLimit:o.arrayLimit;a.parseArrays=a.parseArrays!==false;a.decoder=typeof a.decoder==="function"?a.decoder:o.decoder;a.allowDots=typeof a.allowDots==="boolean"?a.allowDots:o.allowDots;a.plainObjects=typeof a.plainObjects==="boolean"?a.plainObjects:o.plainObjects;a.allowPrototypes=typeof a.allowPrototypes==="boolean"?a.allowPrototypes:o.allowPrototypes;a.parameterLimit=typeof a.parameterLimit==="number"?a.parameterLimit:o.parameterLimit;a.strictNullHandling=typeof a.strictNullHandling==="boolean"?a.strictNullHandling:o.strictNullHandling;if(e===""||e===null||typeof e==="undefined"){return a.plainObjects?Object.create(null):{}}var i=typeof e==="string"?n(e,a):e;var c=a.plainObjects?Object.create(null):{};var u=Object.keys(i);for(var l=0;l<u.length;++l){var p=u[l];var f=s(p,i[p],a);c=r.merge(c,f,a)}return r.compact(c)}},7575:function(e,t,a){"use strict";var r=a(187);var i=a(3438);var o={brackets:function brackets(e){return e+"[]"},indices:function indices(e,t){return e+"["+t+"]"},repeat:function repeat(e){return e}};var n=Array.isArray;var s=Array.prototype.push;var pushToArray=function(e,t){s.apply(e,n(t)?t:[t])};var c=Date.prototype.toISOString;var u={delimiter:"&",encode:true,encoder:r.encode,encodeValuesOnly:false,serializeDate:function serializeDate(e){return c.call(e)},skipNulls:false,strictNullHandling:false};var l=function stringify(e,t,a,i,o,s,c,l,p,f,m,h){var g=e;if(typeof c==="function"){g=c(t,g)}else if(g instanceof Date){g=f(g)}if(g===null){if(i){return s&&!h?s(t,u.encoder):t}g=""}if(typeof g==="string"||typeof g==="number"||typeof g==="boolean"||r.isBuffer(g)){if(s){var y=h?t:s(t,u.encoder);return[m(y)+"="+m(s(g,u.encoder))]}return[m(t)+"="+m(String(g))]}var b=[];if(typeof g==="undefined"){return b}var k;if(n(c)){k=c}else{var w=Object.keys(g);k=l?w.sort(l):w}for(var x=0;x<k.length;++x){var j=k[x];if(o&&g[j]===null){continue}if(n(g)){pushToArray(b,stringify(g[j],a(t,j),a,i,o,s,c,l,p,f,m,h))}else{pushToArray(b,stringify(g[j],t+(p?"."+j:"["+j+"]"),a,i,o,s,c,l,p,f,m,h))}}return b};e.exports=function(e,t){var a=e;var s=t?r.assign({},t):{};if(s.encoder!==null&&typeof s.encoder!=="undefined"&&typeof s.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var c=typeof s.delimiter==="undefined"?u.delimiter:s.delimiter;var p=typeof s.strictNullHandling==="boolean"?s.strictNullHandling:u.strictNullHandling;var f=typeof s.skipNulls==="boolean"?s.skipNulls:u.skipNulls;var m=typeof s.encode==="boolean"?s.encode:u.encode;var h=typeof s.encoder==="function"?s.encoder:u.encoder;var g=typeof s.sort==="function"?s.sort:null;var y=typeof s.allowDots==="undefined"?false:s.allowDots;var b=typeof s.serializeDate==="function"?s.serializeDate:u.serializeDate;var k=typeof s.encodeValuesOnly==="boolean"?s.encodeValuesOnly:u.encodeValuesOnly;if(typeof s.format==="undefined"){s.format=i["default"]}else if(!Object.prototype.hasOwnProperty.call(i.formatters,s.format)){throw new TypeError("Unknown format option provided.")}var w=i.formatters[s.format];var x;var j;if(typeof s.filter==="function"){j=s.filter;a=j("",a)}else if(n(s.filter)){j=s.filter;x=j}var P=[];if(typeof a!=="object"||a===null){return""}var C;if(s.arrayFormat in o){C=s.arrayFormat}else if("indices"in s){C=s.indices?"indices":"repeat"}else{C="indices"}var I=o[C];if(!x){x=Object.keys(a)}if(g){x.sort(g)}for(var z=0;z<x.length;++z){var O=x[z];if(f&&a[O]===null){continue}pushToArray(P,l(a[O],O,I,p,f,m?h:null,j,g,y,b,w,k))}var q=P.join(c);var H=s.addQueryPrefix===true?"?":"";return q.length>0?H+q:""}},187:function(e){"use strict";var t=Object.prototype.hasOwnProperty;var a=function(){var e=[];for(var t=0;t<256;++t){e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase())}return e}();var r=function compactQueue(e){var t;while(e.length){var a=e.pop();t=a.obj[a.prop];if(Array.isArray(t)){var r=[];for(var i=0;i<t.length;++i){if(typeof t[i]!=="undefined"){r.push(t[i])}}a.obj[a.prop]=r}}return t};var i=function arrayToObject(e,t){var a=t&&t.plainObjects?Object.create(null):{};for(var r=0;r<e.length;++r){if(typeof e[r]!=="undefined"){a[r]=e[r]}}return a};var o=function merge(e,a,r){if(!a){return e}if(typeof a!=="object"){if(Array.isArray(e)){e.push(a)}else if(e&&typeof e==="object"){if(r&&(r.plainObjects||r.allowPrototypes)||!t.call(Object.prototype,a)){e[a]=true}}else{return[e,a]}return e}if(!e||typeof e!=="object"){return[e].concat(a)}var o=e;if(Array.isArray(e)&&!Array.isArray(a)){o=i(e,r)}if(Array.isArray(e)&&Array.isArray(a)){a.forEach((function(a,i){if(t.call(e,i)){var o=e[i];if(o&&typeof o==="object"&&a&&typeof a==="object"){e[i]=merge(o,a,r)}else{e.push(a)}}else{e[i]=a}}));return e}return Object.keys(a).reduce((function(e,i){var o=a[i];if(t.call(e,i)){e[i]=merge(e[i],o,r)}else{e[i]=o}return e}),o)};var n=function assignSingleSource(e,t){return Object.keys(t).reduce((function(e,a){e[a]=t[a];return e}),e)};var decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}};var s=function encode(e){if(e.length===0){return e}var t=typeof e==="string"?e:String(e);var r="";for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(o===45||o===46||o===95||o===126||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){r+=t.charAt(i);continue}if(o<128){r=r+a[o];continue}if(o<2048){r=r+(a[192|o>>6]+a[128|o&63]);continue}if(o<55296||o>=57344){r=r+(a[224|o>>12]+a[128|o>>6&63]+a[128|o&63]);continue}i+=1;o=65536+((o&1023)<<10|t.charCodeAt(i)&1023);r+=a[240|o>>18]+a[128|o>>12&63]+a[128|o>>6&63]+a[128|o&63]}return r};var c=function compact(e){var t=[{obj:{o:e},prop:"o"}];var a=[];for(var i=0;i<t.length;++i){var o=t[i];var n=o.obj[o.prop];var s=Object.keys(n);for(var c=0;c<s.length;++c){var u=s[c];var l=n[u];if(typeof l==="object"&&l!==null&&a.indexOf(l)===-1){t.push({obj:n,prop:u});a.push(l)}}}return r(t)};var u=function isRegExp(e){return Object.prototype.toString.call(e)==="[object RegExp]"};var l=function isBuffer(e){if(e===null||typeof e==="undefined"){return false}return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};e.exports={arrayToObject:i,assign:n,compact:c,decode:decode,encode:s,isBuffer:l,isRegExp:u,merge:o}},706:function(e,t,a){"use strict";var r=a(4273);var i=a(7921);var o=a(2983);var n=o.paramsHaveRequestBody;function initParams(e,t,a){if(typeof t==="function"){a=t}var i={};if(t!==null&&typeof t==="object"){r(i,t,{uri:e})}else if(typeof e==="string"){r(i,{uri:e})}else{r(i,e)}i.callback=a||i.callback;return i}function request(e,t,a){if(typeof e==="undefined"){throw new Error("undefined is not a valid uri or options object.")}var r=initParams(e,t,a);if(r.method==="HEAD"&&n(r)){throw new Error("HTTP HEAD requests MUST NOT include a request body.")}return new request.Request(r)}function verbFunc(e){var t=e.toUpperCase();return function(e,a,r){var i=initParams(e,a,r);i.method=t;return request(i,i.callback)}}request.get=verbFunc("get");request.head=verbFunc("head");request.options=verbFunc("options");request.post=verbFunc("post");request.put=verbFunc("put");request.patch=verbFunc("patch");request.del=verbFunc("delete");request["delete"]=verbFunc("delete");request.jar=function(e){return i.jar(e)};request.cookie=function(e){return i.parse(e)};function wrapRequestMethod(e,t,a,i){return function(o,n,s){var c=initParams(o,n,s);var u={};r(true,u,t,c);u.pool=c.pool||t.pool;if(i){u.method=i.toUpperCase()}if(typeof a==="function"){e=a}return e(u,u.callback)}}request.defaults=function(e,t){var a=this;e=e||{};if(typeof e==="function"){t=e;e={}}var r=wrapRequestMethod(a,e,t);var i=["get","head","post","put","patch","del","delete"];i.forEach((function(i){r[i]=wrapRequestMethod(a[i],e,t,i)}));r.cookie=wrapRequestMethod(a.cookie,e,t);r.jar=a.jar;r.defaults=a.defaults;return r};request.forever=function(e,t){var a={};if(t){r(a,t)}if(e){a.agentOptions=e}a.forever=true;return request.defaults(a)};e.exports=request;request.Request=a(3147);request.initParams=initParams;Object.defineProperty(request,"debug",{enumerable:true,get:function(){return request.Request.debug},set:function(e){request.Request.debug=e}})},9010:function(e,t,a){"use strict";var r=a(2263);var i=a(6881);var o=a(2983);var n=o.md5;var s=o.toBase64;function Auth(e){this.request=e;this.hasAuth=false;this.sentAuth=false;this.bearerToken=null;this.user=null;this.pass=null}Auth.prototype.basic=function(e,t,a){var r=this;if(typeof e!=="string"||t!==undefined&&typeof t!=="string"){r.request.emit("error",new Error("auth() received invalid user or password"))}r.user=e;r.pass=t;r.hasAuth=true;var i=e+":"+(t||"");if(a||typeof a==="undefined"){var o="Basic "+s(i);r.sentAuth=true;return o}};Auth.prototype.bearer=function(e,t){var a=this;a.bearerToken=e;a.hasAuth=true;if(t||typeof t==="undefined"){if(typeof e==="function"){e=e()}var r="Bearer "+(e||"");a.sentAuth=true;return r}};Auth.prototype.digest=function(e,t,a){var r=this;var o={};var s=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;while(true){var c=s.exec(a);if(!c){break}o[c[1]]=c[2]||c[3]}var ha1Compute=function(e,t,a,r,i,o){var s=n(t+":"+a+":"+r);if(e&&e.toLowerCase()==="md5-sess"){return n(s+":"+i+":"+o)}else{return s}};var u=/(^|,)\s*auth\s*($|,)/.test(o.qop)&&"auth";var l=u&&"00000001";var p=u&&i().replace(/-/g,"");var f=ha1Compute(o.algorithm,r.user,o.realm,r.pass,o.nonce,p);var m=n(e+":"+t);var h=u?n(f+":"+o.nonce+":"+l+":"+p+":"+u+":"+m):n(f+":"+o.nonce+":"+m);var g={username:r.user,realm:o.realm,nonce:o.nonce,uri:t,qop:u,response:h,nc:l,cnonce:p,algorithm:o.algorithm,opaque:o.opaque};a=[];for(var y in g){if(g[y]){if(y==="qop"||y==="nc"||y==="algorithm"){a.push(y+"="+g[y])}else{a.push(y+'="'+g[y]+'"')}}}a="Digest "+a.join(", ");r.sentAuth=true;return a};Auth.prototype.onRequest=function(e,t,a,r){var i=this;var o=i.request;var n;if(r===undefined&&e===undefined){i.request.emit("error",new Error("no auth mechanism defined"))}else if(r!==undefined){n=i.bearer(r,a)}else{n=i.basic(e,t,a)}if(n){o.setHeader("authorization",n)}};Auth.prototype.onResponse=function(e){var t=this;var a=t.request;if(!t.hasAuth||t.sentAuth){return null}var i=r(e.headers);var o=i.get("www-authenticate");var n=o&&o.split(" ")[0].toLowerCase();a.debug("reauth",n);switch(n){case"basic":return t.basic(t.user,t.pass,true);case"bearer":return t.bearer(t.bearerToken,true);case"digest":return t.digest(a.method,a.path,o)}};t.N=Auth},7921:function(e,t,a){"use strict";var r=a(737);var i=r.Cookie;var o=r.CookieJar;t.parse=function(e){if(e&&e.uri){e=e.uri}if(typeof e!=="string"){throw new Error("The cookie function only accepts STRING as param")}return i.parse(e,{loose:true})};function RequestJar(e){var t=this;t._jar=new o(e,{looseMode:true})}RequestJar.prototype.setCookie=function(e,t,a){var r=this;return r._jar.setCookieSync(e,t,a||{})};RequestJar.prototype.getCookieString=function(e){var t=this;return t._jar.getCookieStringSync(e)};RequestJar.prototype.getCookies=function(e){var t=this;return t._jar.getCookiesSync(e)};t.jar=function(e){return new RequestJar(e)}},1480:function(e){"use strict";function formatHostname(e){return e.replace(/^\.*/,".").toLowerCase()}function parseNoProxyZone(e){e=e.trim().toLowerCase();var t=e.split(":",2);var a=formatHostname(t[0]);var r=t[1];var i=e.indexOf(":")>-1;return{hostname:a,port:r,hasPort:i}}function uriInNoProxy(e,t){var a=e.port||(e.protocol==="https:"?"443":"80");var r=formatHostname(e.hostname);var i=t.split(",");return i.map(parseNoProxyZone).some((function(e){var t=r.indexOf(e.hostname);var i=t>-1&&t===r.length-e.hostname.length;if(e.hasPort){return a===e.port&&i}return i}))}function getProxyFromURI(e){var t=process.env.NO_PROXY||process.env.no_proxy||"";if(t==="*"){return null}if(t!==""&&uriInNoProxy(e,t)){return null}if(e.protocol==="http:"){return process.env.HTTP_PROXY||process.env.http_proxy||null}if(e.protocol==="https:"){return process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null}return null}e.exports=getProxyFromURI},7477:function(e,t,a){"use strict";var r=a(9896);var i=a(3480);var o=a(6738);var n=a(4273);function Har(e){this.request=e}Har.prototype.reducer=function(e,t){if(e[t.name]===undefined){e[t.name]=t.value;return e}var a=[e[t.name],t.value];e[t.name]=a;return e};Har.prototype.prep=function(e){e.queryObj={};e.headersObj={};e.postData.jsonObj=false;e.postData.paramsObj=false;if(e.queryString&&e.queryString.length){e.queryObj=e.queryString.reduce(this.reducer,{})}if(e.headers&&e.headers.length){e.headersObj=e.headers.reduceRight((function(e,t){e[t.name]=t.value;return e}),{})}if(e.cookies&&e.cookies.length){var t=e.cookies.map((function(e){return e.name+"="+e.value}));if(t.length){e.headersObj.cookie=t.join("; ")}}function some(t){return t.some((function(t){return e.postData.mimeType.indexOf(t)===0}))}if(some(["multipart/mixed","multipart/related","multipart/form-data","multipart/alternative"])){e.postData.mimeType="multipart/form-data"}else if(some(["application/x-www-form-urlencoded"])){if(!e.postData.params){e.postData.text=""}else{e.postData.paramsObj=e.postData.params.reduce(this.reducer,{});e.postData.text=i.stringify(e.postData.paramsObj)}}else if(some(["text/json","text/x-json","application/json","application/x-json"])){e.postData.mimeType="application/json";if(e.postData.text){try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(t){this.request.debug(t);e.postData.mimeType="text/plain"}}}return e};Har.prototype.options=function(e){if(!e.har){return e}var t={};n(t,e.har);if(t.log&&t.log.entries){t=t.log.entries[0]}t.url=t.url||e.url||e.uri||e.baseUrl||"/";t.httpVersion=t.httpVersion||"HTTP/1.1";t.queryString=t.queryString||[];t.headers=t.headers||[];t.cookies=t.cookies||[];t.postData=t.postData||{};t.postData.mimeType=t.postData.mimeType||"application/octet-stream";t.bodySize=0;t.headersSize=0;t.postData.size=0;if(!o.request(t)){return e}var a=this.prep(t);if(a.url){e.url=a.url}if(a.method){e.method=a.method}if(Object.keys(a.queryObj).length){e.qs=a.queryObj}if(Object.keys(a.headersObj).length){e.headers=a.headersObj}function test(e){return a.postData.mimeType.indexOf(e)===0}if(test("application/x-www-form-urlencoded")){e.form=a.postData.paramsObj}else if(test("application/json")){if(a.postData.jsonObj){e.body=a.postData.jsonObj;e.json=true}}else if(test("multipart/form-data")){e.formData={};a.postData.params.forEach((function(t){var a={};if(!t.fileName&&!t.contentType){e.formData[t.name]=t.value;return}if(t.fileName&&!t.value){a.value=r.createReadStream(t.fileName)}else if(t.value){a.value=t.value}if(t.fileName){a.options={filename:t.fileName,contentType:t.contentType?t.contentType:null}}e.formData[t.name]=a}))}else{if(a.postData.text){e.body=a.postData.text}}return e};t.k=Har},7217:function(e,t,a){"use strict";var r=a(6982);function randomString(e){var t=(e+1)*6;var a=r.randomBytes(Math.ceil(t/8));var i=a.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return i.slice(0,e)}function calculatePayloadHash(e,t,a){var i=r.createHash(t);i.update("hawk.1.payload\n");i.update((a?a.split(";")[0].trim().toLowerCase():"")+"\n");i.update(e||"");i.update("\n");return i.digest("base64")}t.calculateMac=function(e,t){var a="hawk.1.header\n"+t.ts+"\n"+t.nonce+"\n"+(t.method||"").toUpperCase()+"\n"+t.resource+"\n"+t.host.toLowerCase()+"\n"+t.port+"\n"+(t.hash||"")+"\n";if(t.ext){a=a+t.ext.replace("\\","\\\\").replace("\n","\\n")}a=a+"\n";if(t.app){a=a+t.app+"\n"+(t.dlg||"")+"\n"}var i=r.createHmac(e.algorithm,e.key).update(a);var o=i.digest("base64");return o};t.header=function(e,a,r){var i=r.timestamp||Math.floor((Date.now()+(r.localtimeOffsetMsec||0))/1e3);var o=r.credentials;if(!o||!o.id||!o.key||!o.algorithm){return""}if(["sha1","sha256"].indexOf(o.algorithm)===-1){return""}var n={ts:i,nonce:r.nonce||randomString(6),method:a,resource:e.pathname+(e.search||""),host:e.hostname,port:e.port||(e.protocol==="http:"?80:443),hash:r.hash,ext:r.ext,app:r.app,dlg:r.dlg};if(!n.hash&&(r.payload||r.payload==="")){n.hash=calculatePayloadHash(r.payload,o.algorithm,r.contentType)}var s=t.calculateMac(o,n);var c=n.ext!==null&&n.ext!==undefined&&n.ext!=="";var u='Hawk id="'+o.id+'", ts="'+n.ts+'", nonce="'+n.nonce+(n.hash?'", hash="'+n.hash:"")+(c?'", ext="'+n.ext.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):"")+'", mac="'+s+'"';if(n.app){u=u+', app="'+n.app+(n.dlg?'", dlg="'+n.dlg:"")+'"'}return u}},2983:function(e,t,a){"use strict";var r=a(3035);var i=a(6982);var o=a(3476).Buffer;var n=typeof setImmediate==="undefined"?process.nextTick:setImmediate;function paramsHaveRequestBody(e){return e.body||e.requestBodyStream||e.json&&typeof e.json!=="boolean"||e.multipart}function safeStringify(e,t){var a;try{a=JSON.stringify(e,t)}catch(i){a=r(e,t)}return a}function md5(e){return i.createHash("md5").update(e).digest("hex")}function isReadStream(e){return e.readable&&e.path&&e.mode}function toBase64(e){return o.from(e||"","utf8").toString("base64")}function copy(e){var t={};Object.keys(e).forEach((function(a){t[a]=e[a]}));return t}function version(){var e=process.version.replace("v","").split(".");return{major:parseInt(e[0],10),minor:parseInt(e[1],10),patch:parseInt(e[2],10)}}t.paramsHaveRequestBody=paramsHaveRequestBody;t.safeStringify=safeStringify;t.md5=md5;t.isReadStream=isReadStream;t.toBase64=toBase64;t.copy=copy;t.version=version;t.defer=n},5406:function(e,t,a){"use strict";var r=a(6881);var i=a(7315);var o=a(8843);var n=a(3476).Buffer;function Multipart(e){this.request=e;this.boundary=r();this.chunked=false;this.body=null}Multipart.prototype.isChunked=function(e){var t=this;var a=false;var r=e.data||e;if(!r.forEach){t.request.emit("error",new Error("Argument error, options.multipart."))}if(e.chunked!==undefined){a=e.chunked}if(t.request.getHeader("transfer-encoding")==="chunked"){a=true}if(!a){r.forEach((function(e){if(typeof e.body==="undefined"){t.request.emit("error",new Error("Body attribute missing in multipart."))}if(o(e.body)){a=true}}))}return a};Multipart.prototype.setHeaders=function(e){var t=this;if(e&&!t.request.hasHeader("transfer-encoding")){t.request.setHeader("transfer-encoding","chunked")}var a=t.request.getHeader("content-type");if(!a||a.indexOf("multipart")===-1){t.request.setHeader("content-type","multipart/related; boundary="+t.boundary)}else{if(a.indexOf("boundary")!==-1){t.boundary=a.replace(/.*boundary=([^\s;]+).*/,"$1")}else{t.request.setHeader("content-type",a+"; boundary="+t.boundary)}}};Multipart.prototype.build=function(e,t){var a=this;var r=t?new i:[];function add(e){if(typeof e==="number"){e=e.toString()}return t?r.append(e):r.push(n.from(e))}if(a.request.preambleCRLF){add("\r\n")}e.forEach((function(e){var t="--"+a.boundary+"\r\n";Object.keys(e).forEach((function(a){if(a==="body"){return}t+=a+": "+e[a]+"\r\n"}));t+="\r\n";add(t);add(e.body);add("\r\n")}));add("--"+a.boundary+"--");if(a.request.postambleCRLF){add("\r\n")}return r};Multipart.prototype.onRequest=function(e){var t=this;var a=t.isChunked(e);var r=e.data||e;t.setHeaders(a);t.chunked=a;t.body=t.build(r,a)};t.F=Multipart},1001:function(e,t,a){"use strict";var r=a(7016);var i=a(3594);var o=a(2263);var n=a(6881);var s=a(9949);var c=a(6982);var u=a(3476).Buffer;function OAuth(e){this.request=e;this.params=null}OAuth.prototype.buildParams=function(e,t,a,r,i,o){var c={};for(var u in e){c["oauth_"+u]=e[u]}if(!c.oauth_version){c.oauth_version="1.0"}if(!c.oauth_timestamp){c.oauth_timestamp=Math.floor(Date.now()/1e3).toString()}if(!c.oauth_nonce){c.oauth_nonce=n().replace(/-/g,"")}if(!c.oauth_signature_method){c.oauth_signature_method="HMAC-SHA1"}var l=c.oauth_consumer_secret||c.oauth_private_key;delete c.oauth_consumer_secret;delete c.oauth_private_key;var p=c.oauth_token_secret;delete c.oauth_token_secret;var f=c.oauth_realm;delete c.oauth_realm;delete c.oauth_transport_method;var m=t.protocol+"//"+t.host+t.pathname;var h=o.parse([].concat(r,i,o.stringify(c)).join("&"));c.oauth_signature=s.sign(c.oauth_signature_method,a,m,h,l,p);if(f){c.realm=f}return c};OAuth.prototype.buildBodyHash=function(e,t){if(["HMAC-SHA1","RSA-SHA1"].indexOf(e.signature_method||"HMAC-SHA1")<0){this.request.emit("error",new Error("oauth: "+e.signature_method+" signature_method not supported with body_hash signing."))}var a=c.createHash("sha1");a.update(t||"");var r=a.digest("hex");return u.from(r,"hex").toString("base64")};OAuth.prototype.concatParams=function(e,t,a){a=a||"";var r=Object.keys(e).filter((function(e){return e!=="realm"&&e!=="oauth_signature"})).sort();if(e.realm){r.splice(0,0,"realm")}r.push("oauth_signature");return r.map((function(t){return t+"="+a+s.rfc3986(e[t])+a})).join(t)};OAuth.prototype.onRequest=function(e){var t=this;t.params=e;var a=t.request.uri||{};var n=t.request.method||"";var s=o(t.request.headers);var c=t.request.body||"";var u=t.request.qsLib||i;var l;var p;var f=s.get("content-type")||"";var m="application/x-www-form-urlencoded";var h=e.transport_method||"header";if(f.slice(0,m.length)===m){f=m;l=c}if(a.query){p=a.query}if(h==="body"&&(n!=="POST"||f!==m)){t.request.emit("error",new Error("oauth: transport_method of body requires POST "+"and content-type "+m))}if(!l&&typeof e.body_hash==="boolean"){e.body_hash=t.buildBodyHash(e,t.request.body.toString())}var g=t.buildParams(e,a,n,p,l,u);switch(h){case"header":t.request.setHeader("Authorization","OAuth "+t.concatParams(g,",",'"'));break;case"query":var y=t.request.uri.href+=(p?"&":"?")+t.concatParams(g,"&");t.request.uri=r.parse(y);t.request.path=t.request.uri.path;break;case"body":t.request.body=(l?l+"&":"")+t.concatParams(g,"&");break;default:t.request.emit("error",new Error("oauth: transport_method invalid"))}};t.W=OAuth},1527:function(e,t,a){"use strict";var r=a(3594);var i=a(3480);function Querystring(e){this.request=e;this.lib=null;this.useQuerystring=null;this.parseOptions=null;this.stringifyOptions=null}Querystring.prototype.init=function(e){if(this.lib){return}this.useQuerystring=e.useQuerystring;this.lib=this.useQuerystring?i:r;this.parseOptions=e.qsParseOptions||{};this.stringifyOptions=e.qsStringifyOptions||{}};Querystring.prototype.stringify=function(e){return this.useQuerystring?this.rfc3986(this.lib.stringify(e,this.stringifyOptions.sep||null,this.stringifyOptions.eq||null,this.stringifyOptions)):this.lib.stringify(e,this.stringifyOptions)};Querystring.prototype.parse=function(e){return this.useQuerystring?this.lib.parse(e,this.parseOptions.sep||null,this.parseOptions.eq||null,this.parseOptions):this.lib.parse(e,this.parseOptions)};Querystring.prototype.rfc3986=function(e){return e.replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))};Querystring.prototype.unescape=i.unescape;t.C=Querystring},7388:function(e,t,a){"use strict";var r=a(7016);var i=/^https?:/;function Redirect(e){this.request=e;this.followRedirect=true;this.followRedirects=true;this.followAllRedirects=false;this.followOriginalHttpMethod=false;this.allowRedirect=function(){return true};this.maxRedirects=10;this.redirects=[];this.redirectsFollowed=0;this.removeRefererHeader=false}Redirect.prototype.onRequest=function(e){var t=this;if(e.maxRedirects!==undefined){t.maxRedirects=e.maxRedirects}if(typeof e.followRedirect==="function"){t.allowRedirect=e.followRedirect}if(e.followRedirect!==undefined){t.followRedirects=!!e.followRedirect}if(e.followAllRedirects!==undefined){t.followAllRedirects=e.followAllRedirects}if(t.followRedirects||t.followAllRedirects){t.redirects=t.redirects||[]}if(e.removeRefererHeader!==undefined){t.removeRefererHeader=e.removeRefererHeader}if(e.followOriginalHttpMethod!==undefined){t.followOriginalHttpMethod=e.followOriginalHttpMethod}};Redirect.prototype.redirectTo=function(e){var t=this;var a=t.request;var r=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var i=e.caseless.get("location");a.debug("redirect",i);if(t.followAllRedirects){r=i}else if(t.followRedirects){switch(a.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:r=i;break}}}else if(e.statusCode===401){var o=a._auth.onResponse(e);if(o){a.setHeader("authorization",o);r=a.uri}}return r};Redirect.prototype.onResponse=function(e){var t=this;var a=t.request;var o=t.redirectTo(e);if(!o||!t.allowRedirect.call(a,e)){return false}a.debug("redirect to",o);if(e.resume){e.resume()}if(t.redirectsFollowed>=t.maxRedirects){a.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+a.uri.href));return false}t.redirectsFollowed+=1;if(!i.test(o)){o=r.resolve(a.uri.href,o)}var n=a.uri;a.uri=r.parse(o);if(a.uri.protocol!==n.protocol){delete a.agent}t.redirects.push({statusCode:e.statusCode,redirectUri:o});if(t.followAllRedirects&&a.method!=="HEAD"&&e.statusCode!==401&&e.statusCode!==307){a.method=t.followOriginalHttpMethod?a.method:"GET"}delete a.src;delete a.req;delete a._started;if(e.statusCode!==401&&e.statusCode!==307){delete a.body;delete a._form;if(a.headers){a.removeHeader("host");a.removeHeader("content-type");a.removeHeader("content-length");if(a.uri.hostname!==a.originalHost.split(":")[0]){a.removeHeader("authorization")}}}if(!t.removeRefererHeader){a.setHeader("referer",n.href)}a.emit("redirect");a.init();return true};t.r=Redirect},762:function(e,t,a){"use strict";var r=a(7016);var i=a(9340);var o=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"];var n=["proxy-authorization"];function constructProxyHost(e){var t=e.port;var a=e.protocol;var r=e.hostname+":";if(t){r+=t}else if(a==="https:"){r+="443"}else{r+="80"}return r}function constructProxyHeaderWhiteList(e,t){var a=t.reduce((function(e,t){e[t.toLowerCase()]=true;return e}),{});return Object.keys(e).filter((function(e){return a[e.toLowerCase()]})).reduce((function(t,a){t[a]=e[a];return t}),{})}function constructTunnelOptions(e,t){var a=e.proxy;var r={proxy:{host:a.hostname,port:+a.port,proxyAuth:a.auth,headers:t},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol};return r}function constructTunnelFnName(e,t){var a=e.protocol==="https:"?"https":"http";var r=t.protocol==="https:"?"Https":"Http";return[a,r].join("Over")}function getTunnelFn(e){var t=e.uri;var a=e.proxy;var r=constructTunnelFnName(t,a);return i[r]}function Tunnel(e){this.request=e;this.proxyHeaderWhiteList=o;this.proxyHeaderExclusiveList=[];if(typeof e.tunnel!=="undefined"){this.tunnelOverride=e.tunnel}}Tunnel.prototype.isEnabled=function(){var e=this;var t=e.request;if(typeof e.tunnelOverride!=="undefined"){return e.tunnelOverride}if(t.uri.protocol==="https:"){return true}return false};Tunnel.prototype.setup=function(e){var t=this;var a=t.request;e=e||{};if(typeof a.proxy==="string"){a.proxy=r.parse(a.proxy)}if(!a.proxy||!a.tunnel){return false}if(e.proxyHeaderWhiteList){t.proxyHeaderWhiteList=e.proxyHeaderWhiteList}if(e.proxyHeaderExclusiveList){t.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList}var i=t.proxyHeaderExclusiveList.concat(n);var o=t.proxyHeaderWhiteList.concat(i);var s=constructProxyHeaderWhiteList(a.headers,o);s.host=constructProxyHost(a.uri);i.forEach(a.removeHeader,a);var c=getTunnelFn(a);var u=constructTunnelOptions(a,s);a.agent=c(u);return true};Tunnel.defaultProxyHeaderWhiteList=o;Tunnel.defaultProxyHeaderExclusiveList=n;t.$=Tunnel},3147:function(e,t,a){"use strict";var r=a(8611);var i=a(5692);var o=a(7016);var n=a(9023);var s=a(2203);var c=a(3106);var u=a(791);var l=a(8968);var p=a(7075);var f=a(6553);var m=a(2263);var h=a(8479);var g=a(8621);var y=a(4273);var b=a(8843);var k=a(6823).strict;var w=a(2983);var x=a(7921);var j=a(1480);var P=a(1527).C;var C=a(7477).k;var I=a(9010).N;var z=a(1001).W;var O=a(7217);var q=a(5406).F;var H=a(7388).r;var V=a(762).$;var G=a(540);var X=a(3476).Buffer;var W=w.safeStringify;var Y=w.isReadStream;var ee=w.toBase64;var te=w.defer;var ae=w.copy;var re=w.version;var ie=x.jar();var oe={};function filterForNonReserved(e,t){var a={};for(var r in t){var i=e.indexOf(r)===-1;if(i){a[r]=t[r]}}return a}function filterOutReservedFunctions(e,t){var a={};for(var r in t){var i=!(e.indexOf(r)===-1);var o=typeof t[r]==="function";if(!(i&&o)){a[r]=t[r]}}return a}function requestToJSON(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function responseToJSON(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:requestToJSON.call(e.request)}}function Request(e){var t=this;if(e.har){t._har=new C(t);e=t._har.options(e)}s.Stream.call(t);var a=Object.keys(Request.prototype);var r=filterForNonReserved(a,e);y(t,r);e=filterOutReservedFunctions(a,e);t.readable=true;t.writable=true;if(e.method){t.explicitMethod=true}t._qs=new P(t);t._auth=new I(t);t._oauth=new z(t);t._multipart=new q(t);t._redirect=new H(t);t._tunnel=new V(t);t.init(e)}n.inherits(Request,s.Stream);Request.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function debug(){if(Request.debug){console.error("REQUEST %s",n.format.apply(n,arguments))}}Request.prototype.debug=debug;Request.prototype.init=function(e){var t=this;if(!e){e={}}t.headers=t.headers?ae(t.headers):{};for(var a in t.headers){if(typeof t.headers[a]==="undefined"){delete t.headers[a]}}m.httpify(t,t.headers);if(!t.method){t.method=e.method||"GET"}if(!t.localAddress){t.localAddress=e.localAddress}t._qs.init(e);debug(e);if(!t.pool&&t.pool!==false){t.pool=oe}t.dests=t.dests||[];t.__isRequestRequest=true;if(!t._callback&&t.callback){t._callback=t.callback;t.callback=function(){if(t._callbackCalled){return}t._callbackCalled=true;t._callback.apply(t,arguments)};t.on("error",t.callback.bind());t.on("complete",t.callback.bind(t,null))}if(!t.uri&&t.url){t.uri=t.url;delete t.url}if(t.baseUrl){if(typeof t.baseUrl!=="string"){return t.emit("error",new Error("options.baseUrl must be a string"))}if(typeof t.uri!=="string"){return t.emit("error",new Error("options.uri must be a string when using options.baseUrl"))}if(t.uri.indexOf("//")===0||t.uri.indexOf("://")!==-1){return t.emit("error",new Error("options.uri must be a path when using options.baseUrl"))}var n=t.baseUrl.lastIndexOf("/")===t.baseUrl.length-1;var s=t.uri.indexOf("/")===0;if(n&&s){t.uri=t.baseUrl+t.uri.slice(1)}else if(n||s){t.uri=t.baseUrl+t.uri}else if(t.uri===""){t.uri=t.baseUrl}else{t.uri=t.baseUrl+"/"+t.uri}delete t.baseUrl}if(!t.uri){return t.emit("error",new Error("options.uri is a required argument"))}if(typeof t.uri==="string"){t.uri=o.parse(t.uri)}if(!t.uri.href){t.uri.href=o.format(t.uri)}if(t.uri.protocol==="unix:"){return t.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"))}if(t.uri.host==="unix"){t.enableUnixSocket()}if(t.strictSSL===false){t.rejectUnauthorized=false}if(!t.uri.pathname){t.uri.pathname="/"}if(!(t.uri.host||t.uri.hostname&&t.uri.port)&&!t.uri.isUnix){var c=o.format(t.uri);var u='Invalid URI "'+c+'"';if(Object.keys(e).length===0){u+=". This can be caused by a crappy redirection."}t.abort();return t.emit("error",new Error(u))}if(!t.hasOwnProperty("proxy")){t.proxy=j(t.uri)}t.tunnel=t._tunnel.isEnabled();if(t.proxy){t._tunnel.setup(e)}t._redirect.onRequest(e);t.setHost=false;if(!t.hasHeader("host")){var l=t.originalHostHeaderName||"host";t.setHeader(l,t.uri.host);if(t.uri.port){if(t.uri.port==="80"&&t.uri.protocol==="http:"||t.uri.port==="443"&&t.uri.protocol==="https:"){t.setHeader(l,t.uri.hostname)}}t.setHost=true}t.jar(t._jar||e.jar);if(!t.uri.port){if(t.uri.protocol==="http:"){t.uri.port=80}else if(t.uri.protocol==="https:"){t.uri.port=443}}if(t.proxy&&!t.tunnel){t.port=t.proxy.port;t.host=t.proxy.hostname}else{t.port=t.uri.port;t.host=t.uri.hostname}if(e.form){t.form(e.form)}if(e.formData){var p=e.formData;var g=t.form();var appendFormValue=function(e,t){if(t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")){g.append(e,t.value,t.options)}else{g.append(e,t)}};for(var y in p){if(p.hasOwnProperty(y)){var w=p[y];if(w instanceof Array){for(var x=0;x<w.length;x++){appendFormValue(y,w[x])}}else{appendFormValue(y,w)}}}}if(e.qs){t.qs(e.qs)}if(t.uri.path){t.path=t.uri.path}else{t.path=t.uri.pathname+(t.uri.search||"")}if(t.path.length===0){t.path="/"}if(e.aws){t.aws(e.aws)}if(e.hawk){t.hawk(e.hawk)}if(e.httpSignature){t.httpSignature(e.httpSignature)}if(e.auth){if(Object.prototype.hasOwnProperty.call(e.auth,"username")){e.auth.user=e.auth.username}if(Object.prototype.hasOwnProperty.call(e.auth,"password")){e.auth.pass=e.auth.password}t.auth(e.auth.user,e.auth.pass,e.auth.sendImmediately,e.auth.bearer)}if(t.gzip&&!t.hasHeader("accept-encoding")){t.setHeader("accept-encoding","gzip, deflate")}if(t.uri.auth&&!t.hasHeader("authorization")){var P=t.uri.auth.split(":").map((function(e){return t._qs.unescape(e)}));t.auth(P[0],P.slice(1).join(":"),true)}if(!t.tunnel&&t.proxy&&t.proxy.auth&&!t.hasHeader("proxy-authorization")){var C=t.proxy.auth.split(":").map((function(e){return t._qs.unescape(e)}));var I="Basic "+ee(C.join(":"));t.setHeader("proxy-authorization",I)}if(t.proxy&&!t.tunnel){t.path=t.uri.protocol+"//"+t.uri.host+t.path}if(e.json){t.json(e.json)}if(e.multipart){t.multipart(e.multipart)}if(e.time){t.timing=true;t.elapsedTime=t.elapsedTime||0}function setContentLength(){if(k(t.body)){t.body=X.from(t.body)}if(!t.hasHeader("content-length")){var e;if(typeof t.body==="string"){e=X.byteLength(t.body)}else if(Array.isArray(t.body)){e=t.body.reduce((function(e,t){return e+t.length}),0)}else{e=t.body.length}if(e){t.setHeader("content-length",e)}else{t.emit("error",new Error("Argument error, options.body."))}}}if(t.body&&!b(t.body)){setContentLength()}if(e.oauth){t.oauth(e.oauth)}else if(t._oauth.params&&t.hasHeader("authorization")){t.oauth(t._oauth.params)}var z=t.proxy&&!t.tunnel?t.proxy.protocol:t.uri.protocol;var O={"http:":r,"https:":i};var q=t.httpModules||{};t.httpModule=q[z]||O[z];if(!t.httpModule){return t.emit("error",new Error("Invalid protocol: "+z))}if(e.ca){t.ca=e.ca}if(!t.agent){if(e.agentOptions){t.agentOptions=e.agentOptions}if(e.agentClass){t.agentClass=e.agentClass}else if(e.forever){var H=re();if(H.major===0&&H.minor<=10){t.agentClass=z==="http:"?h:h.SSL}else{t.agentClass=t.httpModule.Agent;t.agentOptions=t.agentOptions||{};t.agentOptions.keepAlive=true}}else{t.agentClass=t.httpModule.Agent}}if(t.pool===false){t.agent=false}else{t.agent=t.agent||t.getNewAgent()}t.on("pipe",(function(e){if(t.ntick&&t._started){t.emit("error",new Error("You cannot pipe to this stream after the outbound request has started."))}t.src=e;if(Y(e)){if(!t.hasHeader("content-type")){t.setHeader("content-type",f.lookup(e.path))}}else{if(e.headers){for(var a in e.headers){if(!t.hasHeader(a)){t.setHeader(a,e.headers[a])}}}if(t._json&&!t.hasHeader("content-type")){t.setHeader("content-type","application/json")}if(e.method&&!t.explicitMethod){t.method=e.method}}}));te((function(){if(t._aborted){return}var end=function(){if(t._form){if(!t._auth.hasAuth){t._form.pipe(t)}else if(t._auth.hasAuth&&t._auth.sentAuth){t._form.pipe(t)}}if(t._multipart&&t._multipart.chunked){t._multipart.body.pipe(t)}if(t.body){if(b(t.body)){t.body.pipe(t)}else{setContentLength();if(Array.isArray(t.body)){t.body.forEach((function(e){t.write(e)}))}else{t.write(t.body)}t.end()}}else if(t.requestBodyStream){console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.");t.requestBodyStream.pipe(t)}else if(!t.src){if(t._auth.hasAuth&&!t._auth.sentAuth){t.end();return}if(t.method!=="GET"&&typeof t.method!=="undefined"){t.setHeader("content-length",0)}t.end()}};if(t._form&&!t.hasHeader("content-length")){t.setHeader(t._form.getHeaders(),true);t._form.getLength((function(e,a){if(!e&&!isNaN(a)){t.setHeader("content-length",a)}end()}))}else{end()}t.ntick=true}))};Request.prototype.getNewAgent=function(){var e=this;var t=e.agentClass;var a={};if(e.agentOptions){for(var r in e.agentOptions){a[r]=e.agentOptions[r]}}if(e.ca){a.ca=e.ca}if(e.ciphers){a.ciphers=e.ciphers}if(e.secureProtocol){a.secureProtocol=e.secureProtocol}if(e.secureOptions){a.secureOptions=e.secureOptions}if(typeof e.rejectUnauthorized!=="undefined"){a.rejectUnauthorized=e.rejectUnauthorized}if(e.cert&&e.key){a.key=e.key;a.cert=e.cert}if(e.pfx){a.pfx=e.pfx}if(e.passphrase){a.passphrase=e.passphrase}var i="";if(t!==e.httpModule.Agent){i+=t.name}var n=e.proxy;if(typeof n==="string"){n=o.parse(n)}var s=n&&n.protocol==="https:"||this.uri.protocol==="https:";if(s){if(a.ca){if(i){i+=":"}i+=a.ca}if(typeof a.rejectUnauthorized!=="undefined"){if(i){i+=":"}i+=a.rejectUnauthorized}if(a.cert){if(i){i+=":"}i+=a.cert.toString("ascii")+a.key.toString("ascii")}if(a.pfx){if(i){i+=":"}i+=a.pfx.toString("ascii")}if(a.ciphers){if(i){i+=":"}i+=a.ciphers}if(a.secureProtocol){if(i){i+=":"}i+=a.secureProtocol}if(a.secureOptions){if(i){i+=":"}i+=a.secureOptions}}if(e.pool===oe&&!i&&Object.keys(a).length===0&&e.httpModule.globalAgent){return e.httpModule.globalAgent}i=e.uri.protocol+i;if(!e.pool[i]){e.pool[i]=new t(a);if(e.pool.maxSockets){e.pool[i].maxSockets=e.pool.maxSockets}}return e.pool[i]};Request.prototype.start=function(){var e=this;if(e.timing){var t=(new Date).getTime();var a=G()}if(e._aborted){return}e._started=true;e.method=e.method||"GET";e.href=e.uri.href;if(e.src&&e.src.stat&&e.src.stat.size&&!e.hasHeader("content-length")){e.setHeader("content-length",e.src.stat.size)}if(e._aws){e.aws(e._aws,true)}var r=ae(e);delete r.auth;debug("make request",e.uri.href);delete r.timeout;try{e.req=e.httpModule.request(r)}catch(t){e.emit("error",t);return}if(e.timing){e.startTime=t;e.startTimeNow=a;e.timings={}}var i;if(e.timeout&&!e.timeoutTimer){if(e.timeout<0){i=0}else if(typeof e.timeout==="number"&&isFinite(e.timeout)){i=e.timeout}}e.req.on("response",e.onRequestResponse.bind(e));e.req.on("error",e.onRequestError.bind(e));e.req.on("drain",(function(){e.emit("drain")}));e.req.on("socket",(function(t){var a=t._connecting||t.connecting;if(e.timing){e.timings.socket=G()-e.startTimeNow;if(a){var onLookupTiming=function(){e.timings.lookup=G()-e.startTimeNow};var onConnectTiming=function(){e.timings.connect=G()-e.startTimeNow};t.once("lookup",onLookupTiming);t.once("connect",onConnectTiming);e.req.once("error",(function(){t.removeListener("lookup",onLookupTiming);t.removeListener("connect",onConnectTiming)}))}}var setReqTimeout=function(){e.req.setTimeout(i,(function(){if(e.req){e.abort();var t=new Error("ESOCKETTIMEDOUT");t.code="ESOCKETTIMEDOUT";t.connect=false;e.emit("error",t)}}))};if(i!==undefined){if(a){var onReqSockConnect=function(){t.removeListener("connect",onReqSockConnect);e.clearTimeout();setReqTimeout()};t.on("connect",onReqSockConnect);e.req.on("error",(function(e){t.removeListener("connect",onReqSockConnect)}));e.timeoutTimer=setTimeout((function(){t.removeListener("connect",onReqSockConnect);e.abort();var a=new Error("ETIMEDOUT");a.code="ETIMEDOUT";a.connect=true;e.emit("error",a)}),i)}else{setReqTimeout()}}e.emit("socket",t)}));e.emit("request",e.req)};Request.prototype.onRequestError=function(e){var t=this;if(t._aborted){return}if(t.req&&t.req._reusedSocket&&e.code==="ECONNRESET"&&t.agent.addRequestNoreuse){t.agent={addRequest:t.agent.addRequestNoreuse.bind(t.agent)};t.start();t.req.end();return}t.clearTimeout();t.emit("error",e)};Request.prototype.onRequestResponse=function(e){var t=this;if(t.timing){t.timings.response=G()-t.startTimeNow}debug("onRequestResponse",t.uri.href,e.statusCode,e.headers);e.on("end",(function(){if(t.timing){t.timings.end=G()-t.startTimeNow;e.timingStart=t.startTime;if(!t.timings.socket){t.timings.socket=0}if(!t.timings.lookup){t.timings.lookup=t.timings.socket}if(!t.timings.connect){t.timings.connect=t.timings.lookup}if(!t.timings.response){t.timings.response=t.timings.connect}debug("elapsed time",t.timings.end);t.elapsedTime+=Math.round(t.timings.end);e.elapsedTime=t.elapsedTime;e.timings=t.timings;e.timingPhases={wait:t.timings.socket,dns:t.timings.lookup-t.timings.socket,tcp:t.timings.connect-t.timings.lookup,firstByte:t.timings.response-t.timings.connect,download:t.timings.end-t.timings.response,total:t.timings.end}}debug("response end",t.uri.href,e.statusCode,e.headers)}));if(t._aborted){debug("aborted",t.uri.href);e.resume();return}t.response=e;e.request=t;e.toJSON=responseToJSON;if(t.httpModule===i&&t.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){debug("strict ssl error",t.uri.href);var a=e.hasOwnProperty("socket")?e.socket.authorizationError:t.uri.href+" does not support SSL";t.emit("error",new Error("SSL Error: "+a));return}t.originalHost=t.getHeader("host");if(!t.originalHostHeaderName){t.originalHostHeaderName=t.hasHeader("host")}if(t.setHost){t.removeHeader("host")}t.clearTimeout();var r=t._jar&&t._jar.setCookie?t._jar:ie;var addCookie=function(e){try{r.setCookie(e,t.uri.href,{ignoreError:true})}catch(e){t.emit("error",e)}};e.caseless=m(e.headers);if(e.caseless.has("set-cookie")&&!t._disableCookies){var o=e.caseless.has("set-cookie");if(Array.isArray(e.headers[o])){e.headers[o].forEach(addCookie)}else{addCookie(e.headers[o])}}if(t._redirect.onResponse(e)){return}else{e.on("close",(function(){if(!t._ended){t.response.emit("end")}}));e.once("end",(function(){t._ended=true}));var noBody=function(e){return t.method==="HEAD"||e>=100&&e<200||e===204||e===304};var n;if(t.gzip&&!noBody(e.statusCode)){var s=e.headers["content-encoding"]||"identity";s=s.trim().toLowerCase();var u={flush:c.Z_SYNC_FLUSH,finishFlush:c.Z_SYNC_FLUSH};if(s==="gzip"){n=c.createGunzip(u);e.pipe(n)}else if(s==="deflate"){n=c.createInflate(u);e.pipe(n)}else{if(s!=="identity"){debug("ignoring unrecognized Content-Encoding "+s)}n=e}}else{n=e}if(t.encoding){if(t.dests.length!==0){console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.")}else{n.setEncoding(t.encoding)}}if(t._paused){n.pause()}t.responseContent=n;t.emit("response",e);t.dests.forEach((function(e){t.pipeDest(e)}));n.on("data",(function(a){if(t.timing&&!t.responseStarted){t.responseStartTime=(new Date).getTime();e.responseStartTime=t.responseStartTime}t._destdata=true;t.emit("data",a)}));n.once("end",(function(e){t.emit("end",e)}));n.on("error",(function(e){t.emit("error",e)}));n.on("close",(function(){t.emit("close")}));if(t.callback){t.readResponseBody(e)}else{t.on("end",(function(){if(t._aborted){debug("aborted",t.uri.href);return}t.emit("complete",e)}))}}debug("finish init function",t.uri.href)};Request.prototype.readResponseBody=function(e){var t=this;debug("reading response's body");var a=[];var r=0;var i=[];t.on("data",(function(e){if(!X.isBuffer(e)){i.push(e)}else if(e.length){r+=e.length;a.push(e)}}));t.on("end",(function(){debug("end event",t.uri.href);if(t._aborted){debug("aborted",t.uri.href);a=[];r=0;return}if(r){debug("has body",t.uri.href,r);e.body=X.concat(a,r);if(t.encoding!==null){e.body=e.body.toString(t.encoding)}a=[];r=0}else if(i.length){if(t.encoding==="utf8"&&i[0].length>0&&i[0][0]==="\ufeff"){i[0]=i[0].substring(1)}e.body=i.join("")}if(t._json){try{e.body=JSON.parse(e.body,t._jsonReviver)}catch(e){debug("invalid JSON received",t.uri.href)}}debug("emitting complete",t.uri.href);if(typeof e.body==="undefined"&&!t._json){e.body=t.encoding===null?X.alloc(0):""}t.emit("complete",e,e.body)}))};Request.prototype.abort=function(){var e=this;e._aborted=true;if(e.req){e.req.abort()}else if(e.response){e.response.destroy()}e.clearTimeout();e.emit("abort")};Request.prototype.pipeDest=function(e){var t=this;var a=t.response;if(e.headers&&!e.headersSent){if(a.caseless.has("content-type")){var r=a.caseless.has("content-type");if(e.setHeader){e.setHeader(r,a.headers[r])}else{e.headers[r]=a.headers[r]}}if(a.caseless.has("content-length")){var i=a.caseless.has("content-length");if(e.setHeader){e.setHeader(i,a.headers[i])}else{e.headers[i]=a.headers[i]}}}if(e.setHeader&&!e.headersSent){for(var o in a.headers){if(!t.gzip||o!=="content-encoding"){e.setHeader(o,a.headers[o])}}e.statusCode=a.statusCode}if(t.pipefilter){t.pipefilter(a,e)}};Request.prototype.qs=function(e,t){var a=this;var r;if(!t&&a.uri.query){r=a._qs.parse(a.uri.query)}else{r={}}for(var i in e){r[i]=e[i]}var n=a._qs.stringify(r);if(n===""){return a}a.uri=o.parse(a.uri.href.split("?")[0]+"?"+n);a.url=a.uri;a.path=a.uri.path;if(a.uri.host==="unix"){a.enableUnixSocket()}return a};Request.prototype.form=function(e){var t=this;if(e){if(!/^application\/x-www-form-urlencoded\b/.test(t.getHeader("content-type"))){t.setHeader("content-type","application/x-www-form-urlencoded")}t.body=typeof e==="string"?t._qs.rfc3986(e.toString("utf8")):t._qs.stringify(e).toString("utf8");return t}t._form=new g;t._form.on("error",(function(e){e.message="form-data: "+e.message;t.emit("error",e);t.abort()}));return t._form};Request.prototype.multipart=function(e){var t=this;t._multipart.onRequest(e);if(!t._multipart.chunked){t.body=t._multipart.body}return t};Request.prototype.json=function(e){var t=this;if(!t.hasHeader("accept")){t.setHeader("accept","application/json")}if(typeof t.jsonReplacer==="function"){t._jsonReplacer=t.jsonReplacer}t._json=true;if(typeof e==="boolean"){if(t.body!==undefined){if(!/^application\/x-www-form-urlencoded\b/.test(t.getHeader("content-type"))){t.body=W(t.body,t._jsonReplacer)}else{t.body=t._qs.rfc3986(t.body)}if(!t.hasHeader("content-type")){t.setHeader("content-type","application/json")}}}else{t.body=W(e,t._jsonReplacer);if(!t.hasHeader("content-type")){t.setHeader("content-type","application/json")}}if(typeof t.jsonReviver==="function"){t._jsonReviver=t.jsonReviver}return t};Request.prototype.getHeader=function(e,t){var a=this;var r,i,o;if(!t){t=a.headers}Object.keys(t).forEach((function(a){if(a.length!==e.length){return}i=new RegExp(e,"i");o=a.match(i);if(o){r=t[a]}}));return r};Request.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":");var t=e[0];var a=e[1];this.socketPath=t;this.uri.pathname=a;this.uri.path=a;this.uri.host=t;this.uri.hostname=t;this.uri.isUnix=true};Request.prototype.auth=function(e,t,a,r){var i=this;i._auth.onRequest(e,t,a,r);return i};Request.prototype.aws=function(e,t){var a=this;if(!t){a._aws=e;return a}if(e.sign_version===4||e.sign_version==="4"){var r={host:a.uri.host,path:a.uri.path,method:a.method,headers:a.headers,body:a.body};if(e.service){r.service=e.service}var i=l.sign(r,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});a.setHeader("authorization",i.headers.Authorization);a.setHeader("x-amz-date",i.headers["X-Amz-Date"]);if(i.headers["X-Amz-Security-Token"]){a.setHeader("x-amz-security-token",i.headers["X-Amz-Security-Token"])}}else{var o=new Date;a.setHeader("date",o.toUTCString());var n={key:e.key,secret:e.secret,verb:a.method.toUpperCase(),date:o,contentType:a.getHeader("content-type")||"",md5:a.getHeader("content-md5")||"",amazonHeaders:u.canonicalizeHeaders(a.headers)};var s=a.uri.path;if(e.bucket&&s){n.resource="/"+e.bucket+s}else if(e.bucket&&!s){n.resource="/"+e.bucket}else if(!e.bucket&&s){n.resource=s}else if(!e.bucket&&!s){n.resource="/"}n.resource=u.canonicalizeResource(n.resource);a.setHeader("authorization",u.authorization(n))}return a};Request.prototype.httpSignature=function(e){var t=this;p.signRequest({getHeader:function(e){return t.getHeader(e,t.headers)},setHeader:function(e,a){t.setHeader(e,a)},method:t.method,path:t.path},e);debug("httpSignature authorization",t.getHeader("authorization"));return t};Request.prototype.hawk=function(e){var t=this;t.setHeader("Authorization",O.header(t.uri,t.method,e))};Request.prototype.oauth=function(e){var t=this;t._oauth.onRequest(e);return t};Request.prototype.jar=function(e){var t=this;var a;if(t._redirect.redirectsFollowed===0){t.originalCookieHeader=t.getHeader("cookie")}if(!e){a=false;t._disableCookies=true}else{var r=e.getCookieString?e:ie;var i=t.uri.href;if(r){a=r.getCookieString(i)}}if(a&&a.length){if(t.originalCookieHeader){t.setHeader("cookie",t.originalCookieHeader+"; "+a)}else{t.setHeader("cookie",a)}}t._jar=e;return t};Request.prototype.pipe=function(e,t){var a=this;if(a.response){if(a._destdata){a.emit("error",new Error("You cannot pipe after data has been emitted from the response."))}else if(a._ended){a.emit("error",new Error("You cannot pipe after the response has been ended."))}else{s.Stream.prototype.pipe.call(a,e,t);a.pipeDest(e);return e}}else{a.dests.push(e);s.Stream.prototype.pipe.call(a,e,t);return e}};Request.prototype.write=function(){var e=this;if(e._aborted){return}if(!e._started){e.start()}if(e.req){return e.req.write.apply(e.req,arguments)}};Request.prototype.end=function(e){var t=this;if(t._aborted){return}if(e){t.write(e)}if(!t._started){t.start()}if(t.req){t.req.end()}};Request.prototype.pause=function(){var e=this;if(!e.responseContent){e._paused=true}else{e.responseContent.pause.apply(e.responseContent,arguments)}};Request.prototype.resume=function(){var e=this;if(!e.responseContent){e._paused=false}else{e.responseContent.resume.apply(e.responseContent,arguments)}};Request.prototype.destroy=function(){var e=this;this.clearTimeout();if(!e._ended){e.end()}else if(e.response){e.response.destroy()}};Request.prototype.clearTimeout=function(){if(this.timeoutTimer){clearTimeout(this.timeoutTimer);this.timeoutTimer=null}};Request.defaultProxyHeaderWhiteList=V.defaultProxyHeaderWhiteList.slice();Request.defaultProxyHeaderExclusiveList=V.defaultProxyHeaderExclusiveList.slice();Request.prototype.toJSON=requestToJSON;e.exports=Request},3476:function(e,t,a){
36
+ */var r=a(8936);var i=a(6928).extname;var o=/^\s*([^;\s]*)(?:;|\s|$)/;var n=/^text\//i;t.charset=charset;t.charsets={lookup:charset};t.contentType=contentType;t.extension=extension;t.extensions=Object.create(null);t.lookup=lookup;t.types=Object.create(null);populateMaps(t.extensions,t.types);function charset(e){if(!e||typeof e!=="string"){return false}var t=o.exec(e);var a=t&&r[t[1].toLowerCase()];if(a&&a.charset){return a.charset}if(t&&n.test(t[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var a=e.indexOf("/")===-1?t.lookup(e):e;if(!a){return false}if(a.indexOf("charset")===-1){var r=t.charset(a);if(r)a+="; charset="+r.toLowerCase()}return a}function extension(e){if(!e||typeof e!=="string"){return false}var a=o.exec(e);var r=a&&t.extensions[a[1].toLowerCase()];if(!r||!r.length){return false}return r[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var a=i("x."+e).toLowerCase().substr(1);if(!a){return false}return t.types[a]||false}function populateMaps(e,t){var a=["nginx","apache",undefined,"iana"];Object.keys(r).forEach((function forEachMimeType(i){var o=r[i];var n=o.extensions;if(!n||!n.length){return}e[i]=n;for(var s=0;s<n.length;s++){var c=n[s];if(t[c]){var u=a.indexOf(r[t[c]].source);var l=a.indexOf(o.source);if(t[c]!=="application/octet-stream"&&(u>l||u===l&&t[c].substr(0,12)==="application/")){continue}}t[c]=i}}))}},7735:function(e){"use strict";const mimicFn=(e,t)=>{for(const a of Reflect.ownKeys(t)){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},316:function(e){"use strict";const copyProperty=(e,t,a,r)=>{if(a==="length"||a==="prototype"){return}if(a==="arguments"||a==="caller"){return}const i=Object.getOwnPropertyDescriptor(e,a);const o=Object.getOwnPropertyDescriptor(t,a);if(!canCopyProperty(i,o)&&r){return}Object.defineProperty(e,a,o)};const canCopyProperty=function(e,t){return e===undefined||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)};const changePrototype=(e,t)=>{const a=Object.getPrototypeOf(t);if(a===Object.getPrototypeOf(e)){return}Object.setPrototypeOf(e,a)};const wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`;const t=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const a=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(e,r,i)=>{const o=i===""?"":`with ${i.trim()}() `;const n=wrappedToString.bind(null,o,r.toString());Object.defineProperty(n,"name",a);Object.defineProperty(e,"toString",{...t,value:n})};const mimicFn=(e,t,{ignoreNonConfigurable:a=false}={})=>{const{name:r}=e;for(const r of Reflect.ownKeys(t)){copyProperty(e,t,r,a)}changePrototype(e,t);changeToString(e,t,r);return e};e.exports=mimicFn},9403:function(e,t,a){var r=a(6928);var i=a(9896);var o=parseInt("0777",8);e.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(e,t,a,n){if(typeof t==="function"){a=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}var s=t.mode;var c=t.fs||i;if(s===undefined){s=o}if(!n)n=null;var u=a||function(){};e=r.resolve(e);c.mkdir(e,s,(function(a){if(!a){n=n||e;return u(null,n)}switch(a.code){case"ENOENT":if(r.dirname(e)===e)return u(a);mkdirP(r.dirname(e),t,(function(a,r){if(a)u(a,r);else mkdirP(e,t,u,r)}));break;default:c.stat(e,(function(e,t){if(e||!t.isDirectory())u(a,n);else u(null,n)}));break}}))}mkdirP.sync=function sync(e,t,a){if(!t||typeof t!=="object"){t={mode:t}}var n=t.mode;var s=t.fs||i;if(n===undefined){n=o}if(!a)a=null;e=r.resolve(e);try{s.mkdirSync(e,n);a=a||e}catch(i){switch(i.code){case"ENOENT":a=sync(r.dirname(e),t,a);sync(e,t,a);break;default:var c;try{c=s.statSync(e)}catch(e){throw i}if(!c.isDirectory())throw i;break}}return a}},3016:function(e,t,a){let r=a(9896);let i=a(857);let o=a(6928);let n=a(6982);let s=a(9403);let c=a(1567);function getFilename(e,t,a){let r=t.originalname.split(".").pop();n.pseudoRandomBytes(16,(function(e,t){a(e,e?undefined:t.toString("hex")+"."+r)}))}function getDestination(e,t,a){a(null,i.tmpdir())}function COSStorage(e={}){if(!(this instanceof COSStorage)){return new COSStorage(e)}if(e.filename==="auto"||!e.filename){this.getFilename=getFilename}else{this.getFilename=e.filename}if(typeof e.destination==="string"){s.sync(e.destination);this.getDestination=function(t,a,r){r(null,e.destination)}}else{this.getDestination=e.destination||getDestination}if(e.cos){e.cos.SecretId=e.cos.SecretId||process.env.SecretId||null;e.cos.SecretKey=e.cos.SecretKey||process.env.SecretKey||null;e.cos.Bucket=e.cos.Bucket||process.env.Bucket||null;e.cos.Region=e.cos.Region||process.env.Region||null;e.cos.domain=e.cos.domain||process.env.domain||null;e.cos.dir=e.cos.dir||process.env.dir||"";e.cos.dir=e.cos.dir==""?e.cos.dir:e.cos.dir+"/";if(!e.cos.SecretId){throw new Error("You have to specify qcloud api SecretId !")}if(!e.cos.SecretKey){throw new Error("You have to specify qcloud api SecretKey .")}this.cos=new c({SecretId:e.cos.SecretId,SecretKey:e.cos.SecretKey,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1024*1024});this.cosRun={domain:e.cos.domain,Bucket:e.cos.Bucket,Region:e.cos.Region,dir:e.cos.dir,taskId:null,onProgress:e.cos.onProgress||function(){}}}}COSStorage.prototype.test=function(){this.cos.getService((function(e,t){if(e){console.log("%s","qcloud test failed");console.error(e)}else{console.log("%s","qcloud test success");console.log(t)}}))};COSStorage.prototype.cancelTask=function(e){var e=e||this.cosRun.taskId;this.cos.cancelTask(e);console.log("canceled")};COSStorage.prototype.pauseTask=function(e){var e=e||this.cosRun.taskId;this.cos.pauseTask(e);console.log("paused")};COSStorage.prototype.restartTask=function(e){var e=e||this.cosRun.taskId;this.cos.restartTask(e);console.log("restart")};COSStorage.prototype._handleFile=function _handleFile(e,t,a){let i=this;i.getDestination(e,t,(function(n,s){if(n){return a(n)}t.destination=s;i.getFilename(e,t,(function(n,c){if(n){return a(n)}t.filename=i.cosRun.dir+c;t.tmpPath=o.join(s,c);let u=r.createWriteStream(t.tmpPath);t.stream.pipe(u);u.on("finish",(function(){i.cos.putObject({Bucket:i.cosRun.Bucket,Region:i.cosRun.Region,Key:t.filename,TaskReady:function(e){i.cosRun.taskId=e},onProgress:function(e){i.cosRun.onProgress(e)},Body:r.createReadStream(t.tmpPath),ContentLength:u.bytesWritten},(function(r,o){if(r){i._removeFile(e,t,(function(){a(r.error)}))}else{if(i.cosRun.domain){o.Location=`http://${i.cosRun.domain}/${t.filename}`}t.url=o.Location;i._removeFile(e,t,(function(){a()}))}}))}));u.on("error",(function(r){i._removeFile(e,t,a(r.error))}))}))}))};COSStorage.prototype._removeFile=function _removeFile(e,t,a){let i=t.tmpPath;this.cosRun.taskId=null;delete t.destination;delete t.filename;delete t.tmpPath;r.unlink(i,a)};e.exports=function(e){return new COSStorage(e)}},9949:function(e,t,a){var r=a(6982);function sha(e,t,a){return r.createHmac(a,e).update(t).digest("base64")}function rsa(e,t){return r.createSign("RSA-SHA1").update(t).sign(e,"base64")}function rfc3986(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}function map(e){var t,a,r=[];for(t in e){a=e[t];if(Array.isArray(a))for(var i=0;i<a.length;i++)r.push([t,a[i]]);else if(typeof a==="object")for(var o in a)r.push([t+"["+o+"]",a[o]]);else r.push([t,a])}return r}function compare(e,t){return e>t?1:e<t?-1:0}function generateBase(e,t,a){var r=map(a).map((function(e){return[rfc3986(e[0]),rfc3986(e[1]||"")]})).sort((function(e,t){return compare(e[0],t[0])||compare(e[1],t[1])})).map((function(e){return e.join("=")})).join("&");var i=[rfc3986(e?e.toUpperCase():"GET"),rfc3986(t),rfc3986(r)].join("&");return i}function hmacsign(e,t,a,r,i){var o=generateBase(e,t,a);var n=[r||"",i||""].map(rfc3986).join("&");return sha(n,o,"sha1")}function hmacsign256(e,t,a,r,i){var o=generateBase(e,t,a);var n=[r||"",i||""].map(rfc3986).join("&");return sha(n,o,"sha256")}function rsasign(e,t,a,r,i){var o=generateBase(e,t,a);var n=r||"";return rsa(n,o)}function plaintext(e,t){var a=[e||"",t||""].map(rfc3986).join("&");return a}function sign(e,t,a,r,i,o){var n;var s=1;switch(e){case"RSA-SHA1":n=rsasign;break;case"HMAC-SHA1":n=hmacsign;break;case"HMAC-SHA256":n=hmacsign256;break;case"PLAINTEXT":n=plaintext;s=4;break;default:throw new Error("Signature method not supported: "+e)}return n.apply(null,[].slice.call(arguments,s))}t.hmacsign=hmacsign;t.hmacsign256=hmacsign256;t.rsasign=rsasign;t.plaintext=plaintext;t.sign=sign;t.rfc3986=rfc3986;t.generateBase=generateBase},602:function(e,t,a){"use strict";const r=a(7735);const i=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let a;let o=0;const n=e.displayName||e.name||"<anonymous>";const onetime=function(...r){i.set(onetime,++o);if(o===1){a=e.apply(this,r);e=null}else if(t.throw===true){throw new Error(`Function \`${n}\` can only be called once`)}return a};r(onetime,e);i.set(onetime,o);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!i.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return i.get(e)}},3311:function(e,t,a){"use strict";const r=a(9930);const pLimit=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"))}const t=[];let a=0;const next=()=>{a--;if(t.length>0){t.shift()()}};const run=(e,t,...i)=>{a++;const o=r(e,...i);t(o);o.then(next,next)};const enqueue=(r,i,...o)=>{if(a<e){run(r,i,...o)}else{t.push(run.bind(null,r,i,...o))}};const generator=(e,...t)=>new Promise((a=>enqueue(e,a,...t)));Object.defineProperties(generator,{activeCount:{get:()=>a},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}});return generator};e.exports=pLimit;e.exports["default"]=pLimit},9199:function(e,t,a){"use strict";const r=a(3311);class EndError extends Error{constructor(e){super();this.value=e}}const testElement=(e,t)=>Promise.resolve(e).then(t);const finder=e=>Promise.all(e).then((e=>e[1]===true&&Promise.reject(new EndError(e[0]))));e.exports=(e,t,a)=>{a=Object.assign({concurrency:Infinity,preserveOrder:true},a);const i=r(a.concurrency);const o=[...e].map((e=>[e,i(testElement,e,t)]));const n=r(a.preserveOrder?1:Infinity);return Promise.all(o.map((e=>n(finder,e)))).then((()=>{})).catch((e=>e instanceof EndError?e.value:Promise.reject(e)))}},9930:function(e){"use strict";const pTry=(e,...t)=>new Promise((a=>{a(e(...t))}));e.exports=pTry;e.exports["default"]=pTry},1813:function(e,t,a){"use strict";const r=a(9896);e.exports=e=>new Promise((t=>{r.access(e,(e=>{t(!e)}))}));e.exports.sync=e=>{try{r.accessSync(e);return true}catch(e){return false}}},540:function(e){(function(){var t,a,r,i,o,n;if(typeof performance!=="undefined"&&performance!==null&&performance.now){e.exports=function(){return performance.now()}}else if(typeof process!=="undefined"&&process!==null&&process.hrtime){e.exports=function(){return(t()-o)/1e6};a=process.hrtime;t=function(){var e;e=a();return e[0]*1e9+e[1]};i=t();n=process.uptime()*1e9;o=i-n}else if(Date.now){e.exports=function(){return Date.now()-r};r=Date.now()}else{e.exports=function(){return(new Date).getTime()-r};r=(new Date).getTime()}}).call(this)},1504:function(e,t,a){"use strict";const r=a(7559);e.exports=async({cwd:e}={})=>r("package.json",{cwd:e});e.exports.sync=({cwd:e}={})=>r.sync("package.json",{cwd:e})},3438:function(e){"use strict";var t=String.prototype.replace;var a=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return t.call(e,a,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},3594:function(e,t,a){"use strict";var r=a(7575);var i=a(7497);var o=a(3438);e.exports={formats:o,parse:i,stringify:r}},7497:function(e,t,a){"use strict";var r=a(187);var i=Object.prototype.hasOwnProperty;var o={allowDots:false,allowPrototypes:false,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:false,strictNullHandling:false};var n=function parseQueryStringValues(e,t){var a={};var r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;var n=t.parameterLimit===Infinity?undefined:t.parameterLimit;var s=r.split(t.delimiter,n);for(var c=0;c<s.length;++c){var u=s[c];var l=u.indexOf("]=");var p=l===-1?u.indexOf("="):l+1;var f,m;if(p===-1){f=t.decoder(u,o.decoder);m=t.strictNullHandling?null:""}else{f=t.decoder(u.slice(0,p),o.decoder);m=t.decoder(u.slice(p+1),o.decoder)}if(i.call(a,f)){a[f]=[].concat(a[f]).concat(m)}else{a[f]=m}}return a};var parseObject=function(e,t,a){var r=t;for(var i=e.length-1;i>=0;--i){var o;var n=e[i];if(n==="[]"&&a.parseArrays){o=[].concat(r)}else{o=a.plainObjects?Object.create(null):{};var s=n.charAt(0)==="["&&n.charAt(n.length-1)==="]"?n.slice(1,-1):n;var c=parseInt(s,10);if(!a.parseArrays&&s===""){o={0:r}}else if(!isNaN(c)&&n!==s&&String(c)===s&&c>=0&&(a.parseArrays&&c<=a.arrayLimit)){o=[];o[c]=r}else if(s!=="__proto__"){o[s]=r}}r=o}return r};var s=function parseQueryStringKeys(e,t,a){if(!e){return}var r=a.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;var o=/(\[[^[\]]*])/;var n=/(\[[^[\]]*])/g;var s=o.exec(r);var c=s?r.slice(0,s.index):r;var u=[];if(c){if(!a.plainObjects&&i.call(Object.prototype,c)){if(!a.allowPrototypes){return}}u.push(c)}var l=0;while((s=n.exec(r))!==null&&l<a.depth){l+=1;if(!a.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))){if(!a.allowPrototypes){return}}u.push(s[1])}if(s){u.push("["+r.slice(s.index)+"]")}return parseObject(u,t,a)};e.exports=function(e,t){var a=t?r.assign({},t):{};if(a.decoder!==null&&a.decoder!==undefined&&typeof a.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}a.ignoreQueryPrefix=a.ignoreQueryPrefix===true;a.delimiter=typeof a.delimiter==="string"||r.isRegExp(a.delimiter)?a.delimiter:o.delimiter;a.depth=typeof a.depth==="number"?a.depth:o.depth;a.arrayLimit=typeof a.arrayLimit==="number"?a.arrayLimit:o.arrayLimit;a.parseArrays=a.parseArrays!==false;a.decoder=typeof a.decoder==="function"?a.decoder:o.decoder;a.allowDots=typeof a.allowDots==="boolean"?a.allowDots:o.allowDots;a.plainObjects=typeof a.plainObjects==="boolean"?a.plainObjects:o.plainObjects;a.allowPrototypes=typeof a.allowPrototypes==="boolean"?a.allowPrototypes:o.allowPrototypes;a.parameterLimit=typeof a.parameterLimit==="number"?a.parameterLimit:o.parameterLimit;a.strictNullHandling=typeof a.strictNullHandling==="boolean"?a.strictNullHandling:o.strictNullHandling;if(e===""||e===null||typeof e==="undefined"){return a.plainObjects?Object.create(null):{}}var i=typeof e==="string"?n(e,a):e;var c=a.plainObjects?Object.create(null):{};var u=Object.keys(i);for(var l=0;l<u.length;++l){var p=u[l];var f=s(p,i[p],a);c=r.merge(c,f,a)}return r.compact(c)}},7575:function(e,t,a){"use strict";var r=a(187);var i=a(3438);var o={brackets:function brackets(e){return e+"[]"},indices:function indices(e,t){return e+"["+t+"]"},repeat:function repeat(e){return e}};var n=Array.isArray;var s=Array.prototype.push;var pushToArray=function(e,t){s.apply(e,n(t)?t:[t])};var c=Date.prototype.toISOString;var u={delimiter:"&",encode:true,encoder:r.encode,encodeValuesOnly:false,serializeDate:function serializeDate(e){return c.call(e)},skipNulls:false,strictNullHandling:false};var l=function stringify(e,t,a,i,o,s,c,l,p,f,m,h){var g=e;if(typeof c==="function"){g=c(t,g)}else if(g instanceof Date){g=f(g)}if(g===null){if(i){return s&&!h?s(t,u.encoder):t}g=""}if(typeof g==="string"||typeof g==="number"||typeof g==="boolean"||r.isBuffer(g)){if(s){var y=h?t:s(t,u.encoder);return[m(y)+"="+m(s(g,u.encoder))]}return[m(t)+"="+m(String(g))]}var b=[];if(typeof g==="undefined"){return b}var k;if(n(c)){k=c}else{var w=Object.keys(g);k=l?w.sort(l):w}for(var x=0;x<k.length;++x){var j=k[x];if(o&&g[j]===null){continue}if(n(g)){pushToArray(b,stringify(g[j],a(t,j),a,i,o,s,c,l,p,f,m,h))}else{pushToArray(b,stringify(g[j],t+(p?"."+j:"["+j+"]"),a,i,o,s,c,l,p,f,m,h))}}return b};e.exports=function(e,t){var a=e;var s=t?r.assign({},t):{};if(s.encoder!==null&&typeof s.encoder!=="undefined"&&typeof s.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var c=typeof s.delimiter==="undefined"?u.delimiter:s.delimiter;var p=typeof s.strictNullHandling==="boolean"?s.strictNullHandling:u.strictNullHandling;var f=typeof s.skipNulls==="boolean"?s.skipNulls:u.skipNulls;var m=typeof s.encode==="boolean"?s.encode:u.encode;var h=typeof s.encoder==="function"?s.encoder:u.encoder;var g=typeof s.sort==="function"?s.sort:null;var y=typeof s.allowDots==="undefined"?false:s.allowDots;var b=typeof s.serializeDate==="function"?s.serializeDate:u.serializeDate;var k=typeof s.encodeValuesOnly==="boolean"?s.encodeValuesOnly:u.encodeValuesOnly;if(typeof s.format==="undefined"){s.format=i["default"]}else if(!Object.prototype.hasOwnProperty.call(i.formatters,s.format)){throw new TypeError("Unknown format option provided.")}var w=i.formatters[s.format];var x;var j;if(typeof s.filter==="function"){j=s.filter;a=j("",a)}else if(n(s.filter)){j=s.filter;x=j}var P=[];if(typeof a!=="object"||a===null){return""}var C;if(s.arrayFormat in o){C=s.arrayFormat}else if("indices"in s){C=s.indices?"indices":"repeat"}else{C="indices"}var I=o[C];if(!x){x=Object.keys(a)}if(g){x.sort(g)}for(var z=0;z<x.length;++z){var O=x[z];if(f&&a[O]===null){continue}pushToArray(P,l(a[O],O,I,p,f,m?h:null,j,g,y,b,w,k))}var q=P.join(c);var H=s.addQueryPrefix===true?"?":"";return q.length>0?H+q:""}},187:function(e){"use strict";var t=Object.prototype.hasOwnProperty;var a=function(){var e=[];for(var t=0;t<256;++t){e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase())}return e}();var r=function compactQueue(e){var t;while(e.length){var a=e.pop();t=a.obj[a.prop];if(Array.isArray(t)){var r=[];for(var i=0;i<t.length;++i){if(typeof t[i]!=="undefined"){r.push(t[i])}}a.obj[a.prop]=r}}return t};var i=function arrayToObject(e,t){var a=t&&t.plainObjects?Object.create(null):{};for(var r=0;r<e.length;++r){if(typeof e[r]!=="undefined"){a[r]=e[r]}}return a};var o=function merge(e,a,r){if(!a){return e}if(typeof a!=="object"){if(Array.isArray(e)){e.push(a)}else if(e&&typeof e==="object"){if(r&&(r.plainObjects||r.allowPrototypes)||!t.call(Object.prototype,a)){e[a]=true}}else{return[e,a]}return e}if(!e||typeof e!=="object"){return[e].concat(a)}var o=e;if(Array.isArray(e)&&!Array.isArray(a)){o=i(e,r)}if(Array.isArray(e)&&Array.isArray(a)){a.forEach((function(a,i){if(t.call(e,i)){var o=e[i];if(o&&typeof o==="object"&&a&&typeof a==="object"){e[i]=merge(o,a,r)}else{e.push(a)}}else{e[i]=a}}));return e}return Object.keys(a).reduce((function(e,i){var o=a[i];if(t.call(e,i)){e[i]=merge(e[i],o,r)}else{e[i]=o}return e}),o)};var n=function assignSingleSource(e,t){return Object.keys(t).reduce((function(e,a){e[a]=t[a];return e}),e)};var decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}};var s=function encode(e){if(e.length===0){return e}var t=typeof e==="string"?e:String(e);var r="";for(var i=0;i<t.length;++i){var o=t.charCodeAt(i);if(o===45||o===46||o===95||o===126||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){r+=t.charAt(i);continue}if(o<128){r=r+a[o];continue}if(o<2048){r=r+(a[192|o>>6]+a[128|o&63]);continue}if(o<55296||o>=57344){r=r+(a[224|o>>12]+a[128|o>>6&63]+a[128|o&63]);continue}i+=1;o=65536+((o&1023)<<10|t.charCodeAt(i)&1023);r+=a[240|o>>18]+a[128|o>>12&63]+a[128|o>>6&63]+a[128|o&63]}return r};var c=function compact(e){var t=[{obj:{o:e},prop:"o"}];var a=[];for(var i=0;i<t.length;++i){var o=t[i];var n=o.obj[o.prop];var s=Object.keys(n);for(var c=0;c<s.length;++c){var u=s[c];var l=n[u];if(typeof l==="object"&&l!==null&&a.indexOf(l)===-1){t.push({obj:n,prop:u});a.push(l)}}}return r(t)};var u=function isRegExp(e){return Object.prototype.toString.call(e)==="[object RegExp]"};var l=function isBuffer(e){if(e===null||typeof e==="undefined"){return false}return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};e.exports={arrayToObject:i,assign:n,compact:c,decode:decode,encode:s,isBuffer:l,isRegExp:u,merge:o}},706:function(e,t,a){"use strict";var r=a(4273);var i=a(7921);var o=a(2983);var n=o.paramsHaveRequestBody;function initParams(e,t,a){if(typeof t==="function"){a=t}var i={};if(t!==null&&typeof t==="object"){r(i,t,{uri:e})}else if(typeof e==="string"){r(i,{uri:e})}else{r(i,e)}i.callback=a||i.callback;return i}function request(e,t,a){if(typeof e==="undefined"){throw new Error("undefined is not a valid uri or options object.")}var r=initParams(e,t,a);if(r.method==="HEAD"&&n(r)){throw new Error("HTTP HEAD requests MUST NOT include a request body.")}return new request.Request(r)}function verbFunc(e){var t=e.toUpperCase();return function(e,a,r){var i=initParams(e,a,r);i.method=t;return request(i,i.callback)}}request.get=verbFunc("get");request.head=verbFunc("head");request.options=verbFunc("options");request.post=verbFunc("post");request.put=verbFunc("put");request.patch=verbFunc("patch");request.del=verbFunc("delete");request["delete"]=verbFunc("delete");request.jar=function(e){return i.jar(e)};request.cookie=function(e){return i.parse(e)};function wrapRequestMethod(e,t,a,i){return function(o,n,s){var c=initParams(o,n,s);var u={};r(true,u,t,c);u.pool=c.pool||t.pool;if(i){u.method=i.toUpperCase()}if(typeof a==="function"){e=a}return e(u,u.callback)}}request.defaults=function(e,t){var a=this;e=e||{};if(typeof e==="function"){t=e;e={}}var r=wrapRequestMethod(a,e,t);var i=["get","head","post","put","patch","del","delete"];i.forEach((function(i){r[i]=wrapRequestMethod(a[i],e,t,i)}));r.cookie=wrapRequestMethod(a.cookie,e,t);r.jar=a.jar;r.defaults=a.defaults;return r};request.forever=function(e,t){var a={};if(t){r(a,t)}if(e){a.agentOptions=e}a.forever=true;return request.defaults(a)};e.exports=request;request.Request=a(3147);request.initParams=initParams;Object.defineProperty(request,"debug",{enumerable:true,get:function(){return request.Request.debug},set:function(e){request.Request.debug=e}})},9010:function(e,t,a){"use strict";var r=a(2263);var i=a(6881);var o=a(2983);var n=o.md5;var s=o.toBase64;function Auth(e){this.request=e;this.hasAuth=false;this.sentAuth=false;this.bearerToken=null;this.user=null;this.pass=null}Auth.prototype.basic=function(e,t,a){var r=this;if(typeof e!=="string"||t!==undefined&&typeof t!=="string"){r.request.emit("error",new Error("auth() received invalid user or password"))}r.user=e;r.pass=t;r.hasAuth=true;var i=e+":"+(t||"");if(a||typeof a==="undefined"){var o="Basic "+s(i);r.sentAuth=true;return o}};Auth.prototype.bearer=function(e,t){var a=this;a.bearerToken=e;a.hasAuth=true;if(t||typeof t==="undefined"){if(typeof e==="function"){e=e()}var r="Bearer "+(e||"");a.sentAuth=true;return r}};Auth.prototype.digest=function(e,t,a){var r=this;var o={};var s=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;while(true){var c=s.exec(a);if(!c){break}o[c[1]]=c[2]||c[3]}var ha1Compute=function(e,t,a,r,i,o){var s=n(t+":"+a+":"+r);if(e&&e.toLowerCase()==="md5-sess"){return n(s+":"+i+":"+o)}else{return s}};var u=/(^|,)\s*auth\s*($|,)/.test(o.qop)&&"auth";var l=u&&"00000001";var p=u&&i().replace(/-/g,"");var f=ha1Compute(o.algorithm,r.user,o.realm,r.pass,o.nonce,p);var m=n(e+":"+t);var h=u?n(f+":"+o.nonce+":"+l+":"+p+":"+u+":"+m):n(f+":"+o.nonce+":"+m);var g={username:r.user,realm:o.realm,nonce:o.nonce,uri:t,qop:u,response:h,nc:l,cnonce:p,algorithm:o.algorithm,opaque:o.opaque};a=[];for(var y in g){if(g[y]){if(y==="qop"||y==="nc"||y==="algorithm"){a.push(y+"="+g[y])}else{a.push(y+'="'+g[y]+'"')}}}a="Digest "+a.join(", ");r.sentAuth=true;return a};Auth.prototype.onRequest=function(e,t,a,r){var i=this;var o=i.request;var n;if(r===undefined&&e===undefined){i.request.emit("error",new Error("no auth mechanism defined"))}else if(r!==undefined){n=i.bearer(r,a)}else{n=i.basic(e,t,a)}if(n){o.setHeader("authorization",n)}};Auth.prototype.onResponse=function(e){var t=this;var a=t.request;if(!t.hasAuth||t.sentAuth){return null}var i=r(e.headers);var o=i.get("www-authenticate");var n=o&&o.split(" ")[0].toLowerCase();a.debug("reauth",n);switch(n){case"basic":return t.basic(t.user,t.pass,true);case"bearer":return t.bearer(t.bearerToken,true);case"digest":return t.digest(a.method,a.path,o)}};t.N=Auth},7921:function(e,t,a){"use strict";var r=a(737);var i=r.Cookie;var o=r.CookieJar;t.parse=function(e){if(e&&e.uri){e=e.uri}if(typeof e!=="string"){throw new Error("The cookie function only accepts STRING as param")}return i.parse(e,{loose:true})};function RequestJar(e){var t=this;t._jar=new o(e,{looseMode:true})}RequestJar.prototype.setCookie=function(e,t,a){var r=this;return r._jar.setCookieSync(e,t,a||{})};RequestJar.prototype.getCookieString=function(e){var t=this;return t._jar.getCookieStringSync(e)};RequestJar.prototype.getCookies=function(e){var t=this;return t._jar.getCookiesSync(e)};t.jar=function(e){return new RequestJar(e)}},1480:function(e){"use strict";function formatHostname(e){return e.replace(/^\.*/,".").toLowerCase()}function parseNoProxyZone(e){e=e.trim().toLowerCase();var t=e.split(":",2);var a=formatHostname(t[0]);var r=t[1];var i=e.indexOf(":")>-1;return{hostname:a,port:r,hasPort:i}}function uriInNoProxy(e,t){var a=e.port||(e.protocol==="https:"?"443":"80");var r=formatHostname(e.hostname);var i=t.split(",");return i.map(parseNoProxyZone).some((function(e){var t=r.indexOf(e.hostname);var i=t>-1&&t===r.length-e.hostname.length;if(e.hasPort){return a===e.port&&i}return i}))}function getProxyFromURI(e){var t=process.env.NO_PROXY||process.env.no_proxy||"";if(t==="*"){return null}if(t!==""&&uriInNoProxy(e,t)){return null}if(e.protocol==="http:"){return process.env.HTTP_PROXY||process.env.http_proxy||null}if(e.protocol==="https:"){return process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null}return null}e.exports=getProxyFromURI},7477:function(e,t,a){"use strict";var r=a(9896);var i=a(3480);var o=a(6738);var n=a(4273);function Har(e){this.request=e}Har.prototype.reducer=function(e,t){if(e[t.name]===undefined){e[t.name]=t.value;return e}var a=[e[t.name],t.value];e[t.name]=a;return e};Har.prototype.prep=function(e){e.queryObj={};e.headersObj={};e.postData.jsonObj=false;e.postData.paramsObj=false;if(e.queryString&&e.queryString.length){e.queryObj=e.queryString.reduce(this.reducer,{})}if(e.headers&&e.headers.length){e.headersObj=e.headers.reduceRight((function(e,t){e[t.name]=t.value;return e}),{})}if(e.cookies&&e.cookies.length){var t=e.cookies.map((function(e){return e.name+"="+e.value}));if(t.length){e.headersObj.cookie=t.join("; ")}}function some(t){return t.some((function(t){return e.postData.mimeType.indexOf(t)===0}))}if(some(["multipart/mixed","multipart/related","multipart/form-data","multipart/alternative"])){e.postData.mimeType="multipart/form-data"}else if(some(["application/x-www-form-urlencoded"])){if(!e.postData.params){e.postData.text=""}else{e.postData.paramsObj=e.postData.params.reduce(this.reducer,{});e.postData.text=i.stringify(e.postData.paramsObj)}}else if(some(["text/json","text/x-json","application/json","application/x-json"])){e.postData.mimeType="application/json";if(e.postData.text){try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(t){this.request.debug(t);e.postData.mimeType="text/plain"}}}return e};Har.prototype.options=function(e){if(!e.har){return e}var t={};n(t,e.har);if(t.log&&t.log.entries){t=t.log.entries[0]}t.url=t.url||e.url||e.uri||e.baseUrl||"/";t.httpVersion=t.httpVersion||"HTTP/1.1";t.queryString=t.queryString||[];t.headers=t.headers||[];t.cookies=t.cookies||[];t.postData=t.postData||{};t.postData.mimeType=t.postData.mimeType||"application/octet-stream";t.bodySize=0;t.headersSize=0;t.postData.size=0;if(!o.request(t)){return e}var a=this.prep(t);if(a.url){e.url=a.url}if(a.method){e.method=a.method}if(Object.keys(a.queryObj).length){e.qs=a.queryObj}if(Object.keys(a.headersObj).length){e.headers=a.headersObj}function test(e){return a.postData.mimeType.indexOf(e)===0}if(test("application/x-www-form-urlencoded")){e.form=a.postData.paramsObj}else if(test("application/json")){if(a.postData.jsonObj){e.body=a.postData.jsonObj;e.json=true}}else if(test("multipart/form-data")){e.formData={};a.postData.params.forEach((function(t){var a={};if(!t.fileName&&!t.contentType){e.formData[t.name]=t.value;return}if(t.fileName&&!t.value){a.value=r.createReadStream(t.fileName)}else if(t.value){a.value=t.value}if(t.fileName){a.options={filename:t.fileName,contentType:t.contentType?t.contentType:null}}e.formData[t.name]=a}))}else{if(a.postData.text){e.body=a.postData.text}}return e};t.k=Har},7217:function(e,t,a){"use strict";var r=a(6982);function randomString(e){var t=(e+1)*6;var a=r.randomBytes(Math.ceil(t/8));var i=a.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return i.slice(0,e)}function calculatePayloadHash(e,t,a){var i=r.createHash(t);i.update("hawk.1.payload\n");i.update((a?a.split(";")[0].trim().toLowerCase():"")+"\n");i.update(e||"");i.update("\n");return i.digest("base64")}t.calculateMac=function(e,t){var a="hawk.1.header\n"+t.ts+"\n"+t.nonce+"\n"+(t.method||"").toUpperCase()+"\n"+t.resource+"\n"+t.host.toLowerCase()+"\n"+t.port+"\n"+(t.hash||"")+"\n";if(t.ext){a=a+t.ext.replace("\\","\\\\").replace("\n","\\n")}a=a+"\n";if(t.app){a=a+t.app+"\n"+(t.dlg||"")+"\n"}var i=r.createHmac(e.algorithm,e.key).update(a);var o=i.digest("base64");return o};t.header=function(e,a,r){var i=r.timestamp||Math.floor((Date.now()+(r.localtimeOffsetMsec||0))/1e3);var o=r.credentials;if(!o||!o.id||!o.key||!o.algorithm){return""}if(["sha1","sha256"].indexOf(o.algorithm)===-1){return""}var n={ts:i,nonce:r.nonce||randomString(6),method:a,resource:e.pathname+(e.search||""),host:e.hostname,port:e.port||(e.protocol==="http:"?80:443),hash:r.hash,ext:r.ext,app:r.app,dlg:r.dlg};if(!n.hash&&(r.payload||r.payload==="")){n.hash=calculatePayloadHash(r.payload,o.algorithm,r.contentType)}var s=t.calculateMac(o,n);var c=n.ext!==null&&n.ext!==undefined&&n.ext!=="";var u='Hawk id="'+o.id+'", ts="'+n.ts+'", nonce="'+n.nonce+(n.hash?'", hash="'+n.hash:"")+(c?'", ext="'+n.ext.replace(/\\/g,"\\\\").replace(/"/g,'\\"'):"")+'", mac="'+s+'"';if(n.app){u=u+', app="'+n.app+(n.dlg?'", dlg="'+n.dlg:"")+'"'}return u}},2983:function(e,t,a){"use strict";var r=a(3035);var i=a(6982);var o=a(3476).Buffer;var n=typeof setImmediate==="undefined"?process.nextTick:setImmediate;function paramsHaveRequestBody(e){return e.body||e.requestBodyStream||e.json&&typeof e.json!=="boolean"||e.multipart}function safeStringify(e,t){var a;try{a=JSON.stringify(e,t)}catch(i){a=r(e,t)}return a}function md5(e){return i.createHash("md5").update(e).digest("hex")}function isReadStream(e){return e.readable&&e.path&&e.mode}function toBase64(e){return o.from(e||"","utf8").toString("base64")}function copy(e){var t={};Object.keys(e).forEach((function(a){t[a]=e[a]}));return t}function version(){var e=process.version.replace("v","").split(".");return{major:parseInt(e[0],10),minor:parseInt(e[1],10),patch:parseInt(e[2],10)}}t.paramsHaveRequestBody=paramsHaveRequestBody;t.safeStringify=safeStringify;t.md5=md5;t.isReadStream=isReadStream;t.toBase64=toBase64;t.copy=copy;t.version=version;t.defer=n},5406:function(e,t,a){"use strict";var r=a(6881);var i=a(7315);var o=a(8843);var n=a(3476).Buffer;function Multipart(e){this.request=e;this.boundary=r();this.chunked=false;this.body=null}Multipart.prototype.isChunked=function(e){var t=this;var a=false;var r=e.data||e;if(!r.forEach){t.request.emit("error",new Error("Argument error, options.multipart."))}if(e.chunked!==undefined){a=e.chunked}if(t.request.getHeader("transfer-encoding")==="chunked"){a=true}if(!a){r.forEach((function(e){if(typeof e.body==="undefined"){t.request.emit("error",new Error("Body attribute missing in multipart."))}if(o(e.body)){a=true}}))}return a};Multipart.prototype.setHeaders=function(e){var t=this;if(e&&!t.request.hasHeader("transfer-encoding")){t.request.setHeader("transfer-encoding","chunked")}var a=t.request.getHeader("content-type");if(!a||a.indexOf("multipart")===-1){t.request.setHeader("content-type","multipart/related; boundary="+t.boundary)}else{if(a.indexOf("boundary")!==-1){t.boundary=a.replace(/.*boundary=([^\s;]+).*/,"$1")}else{t.request.setHeader("content-type",a+"; boundary="+t.boundary)}}};Multipart.prototype.build=function(e,t){var a=this;var r=t?new i:[];function add(e){if(typeof e==="number"){e=e.toString()}return t?r.append(e):r.push(n.from(e))}if(a.request.preambleCRLF){add("\r\n")}e.forEach((function(e){var t="--"+a.boundary+"\r\n";Object.keys(e).forEach((function(a){if(a==="body"){return}t+=a+": "+e[a]+"\r\n"}));t+="\r\n";add(t);add(e.body);add("\r\n")}));add("--"+a.boundary+"--");if(a.request.postambleCRLF){add("\r\n")}return r};Multipart.prototype.onRequest=function(e){var t=this;var a=t.isChunked(e);var r=e.data||e;t.setHeaders(a);t.chunked=a;t.body=t.build(r,a)};t.F=Multipart},1001:function(e,t,a){"use strict";var r=a(7016);var i=a(3594);var o=a(2263);var n=a(6881);var s=a(9949);var c=a(6982);var u=a(3476).Buffer;function OAuth(e){this.request=e;this.params=null}OAuth.prototype.buildParams=function(e,t,a,r,i,o){var c={};for(var u in e){c["oauth_"+u]=e[u]}if(!c.oauth_version){c.oauth_version="1.0"}if(!c.oauth_timestamp){c.oauth_timestamp=Math.floor(Date.now()/1e3).toString()}if(!c.oauth_nonce){c.oauth_nonce=n().replace(/-/g,"")}if(!c.oauth_signature_method){c.oauth_signature_method="HMAC-SHA1"}var l=c.oauth_consumer_secret||c.oauth_private_key;delete c.oauth_consumer_secret;delete c.oauth_private_key;var p=c.oauth_token_secret;delete c.oauth_token_secret;var f=c.oauth_realm;delete c.oauth_realm;delete c.oauth_transport_method;var m=t.protocol+"//"+t.host+t.pathname;var h=o.parse([].concat(r,i,o.stringify(c)).join("&"));c.oauth_signature=s.sign(c.oauth_signature_method,a,m,h,l,p);if(f){c.realm=f}return c};OAuth.prototype.buildBodyHash=function(e,t){if(["HMAC-SHA1","RSA-SHA1"].indexOf(e.signature_method||"HMAC-SHA1")<0){this.request.emit("error",new Error("oauth: "+e.signature_method+" signature_method not supported with body_hash signing."))}var a=c.createHash("sha1");a.update(t||"");var r=a.digest("hex");return u.from(r,"hex").toString("base64")};OAuth.prototype.concatParams=function(e,t,a){a=a||"";var r=Object.keys(e).filter((function(e){return e!=="realm"&&e!=="oauth_signature"})).sort();if(e.realm){r.splice(0,0,"realm")}r.push("oauth_signature");return r.map((function(t){return t+"="+a+s.rfc3986(e[t])+a})).join(t)};OAuth.prototype.onRequest=function(e){var t=this;t.params=e;var a=t.request.uri||{};var n=t.request.method||"";var s=o(t.request.headers);var c=t.request.body||"";var u=t.request.qsLib||i;var l;var p;var f=s.get("content-type")||"";var m="application/x-www-form-urlencoded";var h=e.transport_method||"header";if(f.slice(0,m.length)===m){f=m;l=c}if(a.query){p=a.query}if(h==="body"&&(n!=="POST"||f!==m)){t.request.emit("error",new Error("oauth: transport_method of body requires POST "+"and content-type "+m))}if(!l&&typeof e.body_hash==="boolean"){e.body_hash=t.buildBodyHash(e,t.request.body.toString())}var g=t.buildParams(e,a,n,p,l,u);switch(h){case"header":t.request.setHeader("Authorization","OAuth "+t.concatParams(g,",",'"'));break;case"query":var y=t.request.uri.href+=(p?"&":"?")+t.concatParams(g,"&");t.request.uri=r.parse(y);t.request.path=t.request.uri.path;break;case"body":t.request.body=(l?l+"&":"")+t.concatParams(g,"&");break;default:t.request.emit("error",new Error("oauth: transport_method invalid"))}};t.W=OAuth},1527:function(e,t,a){"use strict";var r=a(3594);var i=a(3480);function Querystring(e){this.request=e;this.lib=null;this.useQuerystring=null;this.parseOptions=null;this.stringifyOptions=null}Querystring.prototype.init=function(e){if(this.lib){return}this.useQuerystring=e.useQuerystring;this.lib=this.useQuerystring?i:r;this.parseOptions=e.qsParseOptions||{};this.stringifyOptions=e.qsStringifyOptions||{}};Querystring.prototype.stringify=function(e){return this.useQuerystring?this.rfc3986(this.lib.stringify(e,this.stringifyOptions.sep||null,this.stringifyOptions.eq||null,this.stringifyOptions)):this.lib.stringify(e,this.stringifyOptions)};Querystring.prototype.parse=function(e){return this.useQuerystring?this.lib.parse(e,this.parseOptions.sep||null,this.parseOptions.eq||null,this.parseOptions):this.lib.parse(e,this.parseOptions)};Querystring.prototype.rfc3986=function(e){return e.replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))};Querystring.prototype.unescape=i.unescape;t.C=Querystring},7388:function(e,t,a){"use strict";var r=a(7016);var i=/^https?:/;function Redirect(e){this.request=e;this.followRedirect=true;this.followRedirects=true;this.followAllRedirects=false;this.followOriginalHttpMethod=false;this.allowRedirect=function(){return true};this.maxRedirects=10;this.redirects=[];this.redirectsFollowed=0;this.removeRefererHeader=false}Redirect.prototype.onRequest=function(e){var t=this;if(e.maxRedirects!==undefined){t.maxRedirects=e.maxRedirects}if(typeof e.followRedirect==="function"){t.allowRedirect=e.followRedirect}if(e.followRedirect!==undefined){t.followRedirects=!!e.followRedirect}if(e.followAllRedirects!==undefined){t.followAllRedirects=e.followAllRedirects}if(t.followRedirects||t.followAllRedirects){t.redirects=t.redirects||[]}if(e.removeRefererHeader!==undefined){t.removeRefererHeader=e.removeRefererHeader}if(e.followOriginalHttpMethod!==undefined){t.followOriginalHttpMethod=e.followOriginalHttpMethod}};Redirect.prototype.redirectTo=function(e){var t=this;var a=t.request;var r=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var i=e.caseless.get("location");a.debug("redirect",i);if(t.followAllRedirects){r=i}else if(t.followRedirects){switch(a.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:r=i;break}}}else if(e.statusCode===401){var o=a._auth.onResponse(e);if(o){a.setHeader("authorization",o);r=a.uri}}return r};Redirect.prototype.onResponse=function(e){var t=this;var a=t.request;var o=t.redirectTo(e);if(!o||!t.allowRedirect.call(a,e)){return false}a.debug("redirect to",o);if(e.resume){e.resume()}if(t.redirectsFollowed>=t.maxRedirects){a.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+a.uri.href));return false}t.redirectsFollowed+=1;if(!i.test(o)){o=r.resolve(a.uri.href,o)}var n=a.uri;a.uri=r.parse(o);if(a.uri.protocol!==n.protocol){delete a.agent}t.redirects.push({statusCode:e.statusCode,redirectUri:o});if(t.followAllRedirects&&a.method!=="HEAD"&&e.statusCode!==401&&e.statusCode!==307){a.method=t.followOriginalHttpMethod?a.method:"GET"}delete a.src;delete a.req;delete a._started;if(e.statusCode!==401&&e.statusCode!==307){delete a.body;delete a._form;if(a.headers){a.removeHeader("host");a.removeHeader("content-type");a.removeHeader("content-length");if(a.uri.hostname!==a.originalHost.split(":")[0]){a.removeHeader("authorization")}}}if(!t.removeRefererHeader){a.setHeader("referer",n.href)}a.emit("redirect");a.init();return true};t.r=Redirect},762:function(e,t,a){"use strict";var r=a(7016);var i=a(9340);var o=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"];var n=["proxy-authorization"];function constructProxyHost(e){var t=e.port;var a=e.protocol;var r=e.hostname+":";if(t){r+=t}else if(a==="https:"){r+="443"}else{r+="80"}return r}function constructProxyHeaderWhiteList(e,t){var a=t.reduce((function(e,t){e[t.toLowerCase()]=true;return e}),{});return Object.keys(e).filter((function(e){return a[e.toLowerCase()]})).reduce((function(t,a){t[a]=e[a];return t}),{})}function constructTunnelOptions(e,t){var a=e.proxy;var r={proxy:{host:a.hostname,port:+a.port,proxyAuth:a.auth,headers:t},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol};return r}function constructTunnelFnName(e,t){var a=e.protocol==="https:"?"https":"http";var r=t.protocol==="https:"?"Https":"Http";return[a,r].join("Over")}function getTunnelFn(e){var t=e.uri;var a=e.proxy;var r=constructTunnelFnName(t,a);return i[r]}function Tunnel(e){this.request=e;this.proxyHeaderWhiteList=o;this.proxyHeaderExclusiveList=[];if(typeof e.tunnel!=="undefined"){this.tunnelOverride=e.tunnel}}Tunnel.prototype.isEnabled=function(){var e=this;var t=e.request;if(typeof e.tunnelOverride!=="undefined"){return e.tunnelOverride}if(t.uri.protocol==="https:"){return true}return false};Tunnel.prototype.setup=function(e){var t=this;var a=t.request;e=e||{};if(typeof a.proxy==="string"){a.proxy=r.parse(a.proxy)}if(!a.proxy||!a.tunnel){return false}if(e.proxyHeaderWhiteList){t.proxyHeaderWhiteList=e.proxyHeaderWhiteList}if(e.proxyHeaderExclusiveList){t.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList}var i=t.proxyHeaderExclusiveList.concat(n);var o=t.proxyHeaderWhiteList.concat(i);var s=constructProxyHeaderWhiteList(a.headers,o);s.host=constructProxyHost(a.uri);i.forEach(a.removeHeader,a);var c=getTunnelFn(a);var u=constructTunnelOptions(a,s);a.agent=c(u);return true};Tunnel.defaultProxyHeaderWhiteList=o;Tunnel.defaultProxyHeaderExclusiveList=n;t.$=Tunnel},3147:function(e,t,a){"use strict";var r=a(8611);var i=a(5692);var o=a(7016);var n=a(9023);var s=a(2203);var c=a(3106);var u=a(791);var l=a(8968);var p=a(7075);var f=a(6553);var m=a(2263);var h=a(8479);var g=a(8621);var y=a(4273);var b=a(8843);var k=a(6823).strict;var w=a(2983);var x=a(7921);var j=a(1480);var P=a(1527).C;var C=a(7477).k;var I=a(9010).N;var z=a(1001).W;var O=a(7217);var q=a(5406).F;var H=a(7388).r;var V=a(762).$;var G=a(540);var X=a(3476).Buffer;var W=w.safeStringify;var Y=w.isReadStream;var ee=w.toBase64;var te=w.defer;var ae=w.copy;var re=w.version;var ie=x.jar();var oe={};function filterForNonReserved(e,t){var a={};for(var r in t){var i=e.indexOf(r)===-1;if(i){a[r]=t[r]}}return a}function filterOutReservedFunctions(e,t){var a={};for(var r in t){var i=!(e.indexOf(r)===-1);var o=typeof t[r]==="function";if(!(i&&o)){a[r]=t[r]}}return a}function requestToJSON(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function responseToJSON(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:requestToJSON.call(e.request)}}function Request(e){var t=this;if(e.har){t._har=new C(t);e=t._har.options(e)}s.Stream.call(t);var a=Object.keys(Request.prototype);var r=filterForNonReserved(a,e);y(t,r);e=filterOutReservedFunctions(a,e);t.readable=true;t.writable=true;if(e.method){t.explicitMethod=true}t._qs=new P(t);t._auth=new I(t);t._oauth=new z(t);t._multipart=new q(t);t._redirect=new H(t);t._tunnel=new V(t);t.init(e)}n.inherits(Request,s.Stream);Request.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function debug(){if(Request.debug){console.error("REQUEST %s",n.format.apply(n,arguments))}}Request.prototype.debug=debug;Request.prototype.init=function(e){var t=this;if(!e){e={}}t.headers=t.headers?ae(t.headers):{};for(var a in t.headers){if(typeof t.headers[a]==="undefined"){delete t.headers[a]}}m.httpify(t,t.headers);if(!t.method){t.method=e.method||"GET"}if(!t.localAddress){t.localAddress=e.localAddress}t._qs.init(e);debug(e);if(!t.pool&&t.pool!==false){t.pool=oe}t.dests=t.dests||[];t.__isRequestRequest=true;if(!t._callback&&t.callback){t._callback=t.callback;t.callback=function(){if(t._callbackCalled){return}t._callbackCalled=true;t._callback.apply(t,arguments)};t.on("error",t.callback.bind());t.on("complete",t.callback.bind(t,null))}if(!t.uri&&t.url){t.uri=t.url;delete t.url}if(t.baseUrl){if(typeof t.baseUrl!=="string"){return t.emit("error",new Error("options.baseUrl must be a string"))}if(typeof t.uri!=="string"){return t.emit("error",new Error("options.uri must be a string when using options.baseUrl"))}if(t.uri.indexOf("//")===0||t.uri.indexOf("://")!==-1){return t.emit("error",new Error("options.uri must be a path when using options.baseUrl"))}var n=t.baseUrl.lastIndexOf("/")===t.baseUrl.length-1;var s=t.uri.indexOf("/")===0;if(n&&s){t.uri=t.baseUrl+t.uri.slice(1)}else if(n||s){t.uri=t.baseUrl+t.uri}else if(t.uri===""){t.uri=t.baseUrl}else{t.uri=t.baseUrl+"/"+t.uri}delete t.baseUrl}if(!t.uri){return t.emit("error",new Error("options.uri is a required argument"))}if(typeof t.uri==="string"){t.uri=o.parse(t.uri)}if(!t.uri.href){t.uri.href=o.format(t.uri)}if(t.uri.protocol==="unix:"){return t.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"))}if(t.uri.host==="unix"){t.enableUnixSocket()}if(t.strictSSL===false){t.rejectUnauthorized=false}if(!t.uri.pathname){t.uri.pathname="/"}if(!(t.uri.host||t.uri.hostname&&t.uri.port)&&!t.uri.isUnix){var c=o.format(t.uri);var u='Invalid URI "'+c+'"';if(Object.keys(e).length===0){u+=". This can be caused by a crappy redirection."}t.abort();return t.emit("error",new Error(u))}if(!t.hasOwnProperty("proxy")){t.proxy=j(t.uri)}t.tunnel=t._tunnel.isEnabled();if(t.proxy){t._tunnel.setup(e)}t._redirect.onRequest(e);t.setHost=false;if(!t.hasHeader("host")){var l=t.originalHostHeaderName||"host";t.setHeader(l,t.uri.host);if(t.uri.port){if(t.uri.port==="80"&&t.uri.protocol==="http:"||t.uri.port==="443"&&t.uri.protocol==="https:"){t.setHeader(l,t.uri.hostname)}}t.setHost=true}t.jar(t._jar||e.jar);if(!t.uri.port){if(t.uri.protocol==="http:"){t.uri.port=80}else if(t.uri.protocol==="https:"){t.uri.port=443}}if(t.proxy&&!t.tunnel){t.port=t.proxy.port;t.host=t.proxy.hostname}else{t.port=t.uri.port;t.host=t.uri.hostname}if(e.form){t.form(e.form)}if(e.formData){var p=e.formData;var g=t.form();var appendFormValue=function(e,t){if(t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")){g.append(e,t.value,t.options)}else{g.append(e,t)}};for(var y in p){if(p.hasOwnProperty(y)){var w=p[y];if(w instanceof Array){for(var x=0;x<w.length;x++){appendFormValue(y,w[x])}}else{appendFormValue(y,w)}}}}if(e.qs){t.qs(e.qs)}if(t.uri.path){t.path=t.uri.path}else{t.path=t.uri.pathname+(t.uri.search||"")}if(t.path.length===0){t.path="/"}if(e.aws){t.aws(e.aws)}if(e.hawk){t.hawk(e.hawk)}if(e.httpSignature){t.httpSignature(e.httpSignature)}if(e.auth){if(Object.prototype.hasOwnProperty.call(e.auth,"username")){e.auth.user=e.auth.username}if(Object.prototype.hasOwnProperty.call(e.auth,"password")){e.auth.pass=e.auth.password}t.auth(e.auth.user,e.auth.pass,e.auth.sendImmediately,e.auth.bearer)}if(t.gzip&&!t.hasHeader("accept-encoding")){t.setHeader("accept-encoding","gzip, deflate")}if(t.uri.auth&&!t.hasHeader("authorization")){var P=t.uri.auth.split(":").map((function(e){return t._qs.unescape(e)}));t.auth(P[0],P.slice(1).join(":"),true)}if(!t.tunnel&&t.proxy&&t.proxy.auth&&!t.hasHeader("proxy-authorization")){var C=t.proxy.auth.split(":").map((function(e){return t._qs.unescape(e)}));var I="Basic "+ee(C.join(":"));t.setHeader("proxy-authorization",I)}if(t.proxy&&!t.tunnel){t.path=t.uri.protocol+"//"+t.uri.host+t.path}if(e.json){t.json(e.json)}if(e.multipart){t.multipart(e.multipart)}if(e.time){t.timing=true;t.elapsedTime=t.elapsedTime||0}function setContentLength(){if(k(t.body)){t.body=X.from(t.body)}if(!t.hasHeader("content-length")){var e;if(typeof t.body==="string"){e=X.byteLength(t.body)}else if(Array.isArray(t.body)){e=t.body.reduce((function(e,t){return e+t.length}),0)}else{e=t.body.length}if(e){t.setHeader("content-length",e)}else{t.emit("error",new Error("Argument error, options.body."))}}}if(t.body&&!b(t.body)){setContentLength()}if(e.oauth){t.oauth(e.oauth)}else if(t._oauth.params&&t.hasHeader("authorization")){t.oauth(t._oauth.params)}var z=t.proxy&&!t.tunnel?t.proxy.protocol:t.uri.protocol;var O={"http:":r,"https:":i};var q=t.httpModules||{};t.httpModule=q[z]||O[z];if(!t.httpModule){return t.emit("error",new Error("Invalid protocol: "+z))}if(e.ca){t.ca=e.ca}if(!t.agent){if(e.agentOptions){t.agentOptions=e.agentOptions}if(e.agentClass){t.agentClass=e.agentClass}else if(e.forever){var H=re();if(H.major===0&&H.minor<=10){t.agentClass=z==="http:"?h:h.SSL}else{t.agentClass=t.httpModule.Agent;t.agentOptions=t.agentOptions||{};t.agentOptions.keepAlive=true}}else{t.agentClass=t.httpModule.Agent}}if(t.pool===false){t.agent=false}else{t.agent=t.agent||t.getNewAgent()}t.on("pipe",(function(e){if(t.ntick&&t._started){t.emit("error",new Error("You cannot pipe to this stream after the outbound request has started."))}t.src=e;if(Y(e)){if(!t.hasHeader("content-type")){t.setHeader("content-type",f.lookup(e.path))}}else{if(e.headers){for(var a in e.headers){if(!t.hasHeader(a)){t.setHeader(a,e.headers[a])}}}if(t._json&&!t.hasHeader("content-type")){t.setHeader("content-type","application/json")}if(e.method&&!t.explicitMethod){t.method=e.method}}}));te((function(){if(t._aborted){return}var end=function(){if(t._form){if(!t._auth.hasAuth){t._form.pipe(t)}else if(t._auth.hasAuth&&t._auth.sentAuth){t._form.pipe(t)}}if(t._multipart&&t._multipart.chunked){t._multipart.body.pipe(t)}if(t.body){if(b(t.body)){t.body.pipe(t)}else{setContentLength();if(Array.isArray(t.body)){t.body.forEach((function(e){t.write(e)}))}else{t.write(t.body)}t.end()}}else if(t.requestBodyStream){console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.");t.requestBodyStream.pipe(t)}else if(!t.src){if(t._auth.hasAuth&&!t._auth.sentAuth){t.end();return}if(t.method!=="GET"&&typeof t.method!=="undefined"){t.setHeader("content-length",0)}t.end()}};if(t._form&&!t.hasHeader("content-length")){t.setHeader(t._form.getHeaders(),true);t._form.getLength((function(e,a){if(!e&&!isNaN(a)){t.setHeader("content-length",a)}end()}))}else{end()}t.ntick=true}))};Request.prototype.getNewAgent=function(){var e=this;var t=e.agentClass;var a={};if(e.agentOptions){for(var r in e.agentOptions){a[r]=e.agentOptions[r]}}if(e.ca){a.ca=e.ca}if(e.ciphers){a.ciphers=e.ciphers}if(e.secureProtocol){a.secureProtocol=e.secureProtocol}if(e.secureOptions){a.secureOptions=e.secureOptions}if(typeof e.rejectUnauthorized!=="undefined"){a.rejectUnauthorized=e.rejectUnauthorized}if(e.cert&&e.key){a.key=e.key;a.cert=e.cert}if(e.pfx){a.pfx=e.pfx}if(e.passphrase){a.passphrase=e.passphrase}var i="";if(t!==e.httpModule.Agent){i+=t.name}var n=e.proxy;if(typeof n==="string"){n=o.parse(n)}var s=n&&n.protocol==="https:"||this.uri.protocol==="https:";if(s){if(a.ca){if(i){i+=":"}i+=a.ca}if(typeof a.rejectUnauthorized!=="undefined"){if(i){i+=":"}i+=a.rejectUnauthorized}if(a.cert){if(i){i+=":"}i+=a.cert.toString("ascii")+a.key.toString("ascii")}if(a.pfx){if(i){i+=":"}i+=a.pfx.toString("ascii")}if(a.ciphers){if(i){i+=":"}i+=a.ciphers}if(a.secureProtocol){if(i){i+=":"}i+=a.secureProtocol}if(a.secureOptions){if(i){i+=":"}i+=a.secureOptions}}if(e.pool===oe&&!i&&Object.keys(a).length===0&&e.httpModule.globalAgent){return e.httpModule.globalAgent}i=e.uri.protocol+i;if(!e.pool[i]){e.pool[i]=new t(a);if(e.pool.maxSockets){e.pool[i].maxSockets=e.pool.maxSockets}}return e.pool[i]};Request.prototype.start=function(){var e=this;if(e.timing){var t=(new Date).getTime();var a=G()}if(e._aborted){return}e._started=true;e.method=e.method||"GET";e.href=e.uri.href;if(e.src&&e.src.stat&&e.src.stat.size&&!e.hasHeader("content-length")){e.setHeader("content-length",e.src.stat.size)}if(e._aws){e.aws(e._aws,true)}var r=ae(e);delete r.auth;debug("make request",e.uri.href);delete r.timeout;try{e.req=e.httpModule.request(r)}catch(t){e.emit("error",t);return}if(e.timing){e.startTime=t;e.startTimeNow=a;e.timings={}}var i;if(e.timeout&&!e.timeoutTimer){if(e.timeout<0){i=0}else if(typeof e.timeout==="number"&&isFinite(e.timeout)){i=e.timeout}}e.req.on("response",e.onRequestResponse.bind(e));e.req.on("error",e.onRequestError.bind(e));e.req.on("drain",(function(){e.emit("drain")}));e.req.on("socket",(function(t){var a=t._connecting||t.connecting;if(e.timing){e.timings.socket=G()-e.startTimeNow;if(a){var onLookupTiming=function(){e.timings.lookup=G()-e.startTimeNow};var onConnectTiming=function(){e.timings.connect=G()-e.startTimeNow};t.once("lookup",onLookupTiming);t.once("connect",onConnectTiming);e.req.once("error",(function(){t.removeListener("lookup",onLookupTiming);t.removeListener("connect",onConnectTiming)}))}}var setReqTimeout=function(){e.req.setTimeout(i,(function(){if(e.req){e.abort();var t=new Error("ESOCKETTIMEDOUT");t.code="ESOCKETTIMEDOUT";t.connect=false;e.emit("error",t)}}))};if(i!==undefined){if(a){var onReqSockConnect=function(){t.removeListener("connect",onReqSockConnect);e.clearTimeout();setReqTimeout()};t.on("connect",onReqSockConnect);e.req.on("error",(function(e){t.removeListener("connect",onReqSockConnect)}));e.timeoutTimer=setTimeout((function(){t.removeListener("connect",onReqSockConnect);e.abort();var a=new Error("ETIMEDOUT");a.code="ETIMEDOUT";a.connect=true;e.emit("error",a)}),i)}else{setReqTimeout()}}e.emit("socket",t)}));e.emit("request",e.req)};Request.prototype.onRequestError=function(e){var t=this;if(t._aborted){return}if(t.req&&t.req._reusedSocket&&e.code==="ECONNRESET"&&t.agent.addRequestNoreuse){t.agent={addRequest:t.agent.addRequestNoreuse.bind(t.agent)};t.start();t.req.end();return}t.clearTimeout();t.emit("error",e)};Request.prototype.onRequestResponse=function(e){var t=this;if(t.timing){t.timings.response=G()-t.startTimeNow}debug("onRequestResponse",t.uri.href,e.statusCode,e.headers);e.on("end",(function(){if(t.timing){t.timings.end=G()-t.startTimeNow;e.timingStart=t.startTime;if(!t.timings.socket){t.timings.socket=0}if(!t.timings.lookup){t.timings.lookup=t.timings.socket}if(!t.timings.connect){t.timings.connect=t.timings.lookup}if(!t.timings.response){t.timings.response=t.timings.connect}debug("elapsed time",t.timings.end);t.elapsedTime+=Math.round(t.timings.end);e.elapsedTime=t.elapsedTime;e.timings=t.timings;e.timingPhases={wait:t.timings.socket,dns:t.timings.lookup-t.timings.socket,tcp:t.timings.connect-t.timings.lookup,firstByte:t.timings.response-t.timings.connect,download:t.timings.end-t.timings.response,total:t.timings.end}}debug("response end",t.uri.href,e.statusCode,e.headers)}));if(t._aborted){debug("aborted",t.uri.href);e.resume();return}t.response=e;e.request=t;e.toJSON=responseToJSON;if(t.httpModule===i&&t.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){debug("strict ssl error",t.uri.href);var a=e.hasOwnProperty("socket")?e.socket.authorizationError:t.uri.href+" does not support SSL";t.emit("error",new Error("SSL Error: "+a));return}t.originalHost=t.getHeader("host");if(!t.originalHostHeaderName){t.originalHostHeaderName=t.hasHeader("host")}if(t.setHost){t.removeHeader("host")}t.clearTimeout();var r=t._jar&&t._jar.setCookie?t._jar:ie;var addCookie=function(e){try{r.setCookie(e,t.uri.href,{ignoreError:true})}catch(e){t.emit("error",e)}};e.caseless=m(e.headers);if(e.caseless.has("set-cookie")&&!t._disableCookies){var o=e.caseless.has("set-cookie");if(Array.isArray(e.headers[o])){e.headers[o].forEach(addCookie)}else{addCookie(e.headers[o])}}if(t._redirect.onResponse(e)){return}else{e.on("close",(function(){if(!t._ended){t.response.emit("end")}}));e.once("end",(function(){t._ended=true}));var noBody=function(e){return t.method==="HEAD"||e>=100&&e<200||e===204||e===304};var n;if(t.gzip&&!noBody(e.statusCode)){var s=e.headers["content-encoding"]||"identity";s=s.trim().toLowerCase();var u={flush:c.Z_SYNC_FLUSH,finishFlush:c.Z_SYNC_FLUSH};if(s==="gzip"){n=c.createGunzip(u);e.pipe(n)}else if(s==="deflate"){n=c.createInflate(u);e.pipe(n)}else{if(s!=="identity"){debug("ignoring unrecognized Content-Encoding "+s)}n=e}}else{n=e}if(t.encoding){if(t.dests.length!==0){console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.")}else{n.setEncoding(t.encoding)}}if(t._paused){n.pause()}t.responseContent=n;t.emit("response",e);t.dests.forEach((function(e){t.pipeDest(e)}));n.on("data",(function(a){if(t.timing&&!t.responseStarted){t.responseStartTime=(new Date).getTime();e.responseStartTime=t.responseStartTime}t._destdata=true;t.emit("data",a)}));n.once("end",(function(e){t.emit("end",e)}));n.on("error",(function(e){t.emit("error",e)}));n.on("close",(function(){t.emit("close")}));if(t.callback){t.readResponseBody(e)}else{t.on("end",(function(){if(t._aborted){debug("aborted",t.uri.href);return}t.emit("complete",e)}))}}debug("finish init function",t.uri.href)};Request.prototype.readResponseBody=function(e){var t=this;debug("reading response's body");var a=[];var r=0;var i=[];t.on("data",(function(e){if(!X.isBuffer(e)){i.push(e)}else if(e.length){r+=e.length;a.push(e)}}));t.on("end",(function(){debug("end event",t.uri.href);if(t._aborted){debug("aborted",t.uri.href);a=[];r=0;return}if(r){debug("has body",t.uri.href,r);e.body=X.concat(a,r);if(t.encoding!==null){e.body=e.body.toString(t.encoding)}a=[];r=0}else if(i.length){if(t.encoding==="utf8"&&i[0].length>0&&i[0][0]==="\ufeff"){i[0]=i[0].substring(1)}e.body=i.join("")}if(t._json){try{e.body=JSON.parse(e.body,t._jsonReviver)}catch(e){debug("invalid JSON received",t.uri.href)}}debug("emitting complete",t.uri.href);if(typeof e.body==="undefined"&&!t._json){e.body=t.encoding===null?X.alloc(0):""}t.emit("complete",e,e.body)}))};Request.prototype.abort=function(){var e=this;e._aborted=true;if(e.req){e.req.abort()}else if(e.response){e.response.destroy()}e.clearTimeout();e.emit("abort")};Request.prototype.pipeDest=function(e){var t=this;var a=t.response;if(e.headers&&!e.headersSent){if(a.caseless.has("content-type")){var r=a.caseless.has("content-type");if(e.setHeader){e.setHeader(r,a.headers[r])}else{e.headers[r]=a.headers[r]}}if(a.caseless.has("content-length")){var i=a.caseless.has("content-length");if(e.setHeader){e.setHeader(i,a.headers[i])}else{e.headers[i]=a.headers[i]}}}if(e.setHeader&&!e.headersSent){for(var o in a.headers){if(!t.gzip||o!=="content-encoding"){e.setHeader(o,a.headers[o])}}e.statusCode=a.statusCode}if(t.pipefilter){t.pipefilter(a,e)}};Request.prototype.qs=function(e,t){var a=this;var r;if(!t&&a.uri.query){r=a._qs.parse(a.uri.query)}else{r={}}for(var i in e){r[i]=e[i]}var n=a._qs.stringify(r);if(n===""){return a}a.uri=o.parse(a.uri.href.split("?")[0]+"?"+n);a.url=a.uri;a.path=a.uri.path;if(a.uri.host==="unix"){a.enableUnixSocket()}return a};Request.prototype.form=function(e){var t=this;if(e){if(!/^application\/x-www-form-urlencoded\b/.test(t.getHeader("content-type"))){t.setHeader("content-type","application/x-www-form-urlencoded")}t.body=typeof e==="string"?t._qs.rfc3986(e.toString("utf8")):t._qs.stringify(e).toString("utf8");return t}t._form=new g;t._form.on("error",(function(e){e.message="form-data: "+e.message;t.emit("error",e);t.abort()}));return t._form};Request.prototype.multipart=function(e){var t=this;t._multipart.onRequest(e);if(!t._multipart.chunked){t.body=t._multipart.body}return t};Request.prototype.json=function(e){var t=this;if(!t.hasHeader("accept")){t.setHeader("accept","application/json")}if(typeof t.jsonReplacer==="function"){t._jsonReplacer=t.jsonReplacer}t._json=true;if(typeof e==="boolean"){if(t.body!==undefined){if(!/^application\/x-www-form-urlencoded\b/.test(t.getHeader("content-type"))){t.body=W(t.body,t._jsonReplacer)}else{t.body=t._qs.rfc3986(t.body)}if(!t.hasHeader("content-type")){t.setHeader("content-type","application/json")}}}else{t.body=W(e,t._jsonReplacer);if(!t.hasHeader("content-type")){t.setHeader("content-type","application/json")}}if(typeof t.jsonReviver==="function"){t._jsonReviver=t.jsonReviver}return t};Request.prototype.getHeader=function(e,t){var a=this;var r,i,o;if(!t){t=a.headers}Object.keys(t).forEach((function(a){if(a.length!==e.length){return}i=new RegExp(e,"i");o=a.match(i);if(o){r=t[a]}}));return r};Request.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":");var t=e[0];var a=e[1];this.socketPath=t;this.uri.pathname=a;this.uri.path=a;this.uri.host=t;this.uri.hostname=t;this.uri.isUnix=true};Request.prototype.auth=function(e,t,a,r){var i=this;i._auth.onRequest(e,t,a,r);return i};Request.prototype.aws=function(e,t){var a=this;if(!t){a._aws=e;return a}if(e.sign_version===4||e.sign_version==="4"){var r={host:a.uri.host,path:a.uri.path,method:a.method,headers:a.headers,body:a.body};if(e.service){r.service=e.service}var i=l.sign(r,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});a.setHeader("authorization",i.headers.Authorization);a.setHeader("x-amz-date",i.headers["X-Amz-Date"]);if(i.headers["X-Amz-Security-Token"]){a.setHeader("x-amz-security-token",i.headers["X-Amz-Security-Token"])}}else{var o=new Date;a.setHeader("date",o.toUTCString());var n={key:e.key,secret:e.secret,verb:a.method.toUpperCase(),date:o,contentType:a.getHeader("content-type")||"",md5:a.getHeader("content-md5")||"",amazonHeaders:u.canonicalizeHeaders(a.headers)};var s=a.uri.path;if(e.bucket&&s){n.resource="/"+e.bucket+s}else if(e.bucket&&!s){n.resource="/"+e.bucket}else if(!e.bucket&&s){n.resource=s}else if(!e.bucket&&!s){n.resource="/"}n.resource=u.canonicalizeResource(n.resource);a.setHeader("authorization",u.authorization(n))}return a};Request.prototype.httpSignature=function(e){var t=this;p.signRequest({getHeader:function(e){return t.getHeader(e,t.headers)},setHeader:function(e,a){t.setHeader(e,a)},method:t.method,path:t.path},e);debug("httpSignature authorization",t.getHeader("authorization"));return t};Request.prototype.hawk=function(e){var t=this;t.setHeader("Authorization",O.header(t.uri,t.method,e))};Request.prototype.oauth=function(e){var t=this;t._oauth.onRequest(e);return t};Request.prototype.jar=function(e){var t=this;var a;if(t._redirect.redirectsFollowed===0){t.originalCookieHeader=t.getHeader("cookie")}if(!e){a=false;t._disableCookies=true}else{var r=e.getCookieString?e:ie;var i=t.uri.href;if(r){a=r.getCookieString(i)}}if(a&&a.length){if(t.originalCookieHeader){t.setHeader("cookie",t.originalCookieHeader+"; "+a)}else{t.setHeader("cookie",a)}}t._jar=e;return t};Request.prototype.pipe=function(e,t){var a=this;if(a.response){if(a._destdata){a.emit("error",new Error("You cannot pipe after data has been emitted from the response."))}else if(a._ended){a.emit("error",new Error("You cannot pipe after the response has been ended."))}else{s.Stream.prototype.pipe.call(a,e,t);a.pipeDest(e);return e}}else{a.dests.push(e);s.Stream.prototype.pipe.call(a,e,t);return e}};Request.prototype.write=function(){var e=this;if(e._aborted){return}if(!e._started){e.start()}if(e.req){return e.req.write.apply(e.req,arguments)}};Request.prototype.end=function(e){var t=this;if(t._aborted){return}if(e){t.write(e)}if(!t._started){t.start()}if(t.req){t.req.end()}};Request.prototype.pause=function(){var e=this;if(!e.responseContent){e._paused=true}else{e.responseContent.pause.apply(e.responseContent,arguments)}};Request.prototype.resume=function(){var e=this;if(!e.responseContent){e._paused=false}else{e.responseContent.resume.apply(e.responseContent,arguments)}};Request.prototype.destroy=function(){var e=this;this.clearTimeout();if(!e._ended){e.end()}else if(e.response){e.response.destroy()}};Request.prototype.clearTimeout=function(){if(this.timeoutTimer){clearTimeout(this.timeoutTimer);this.timeoutTimer=null}};Request.defaultProxyHeaderWhiteList=V.defaultProxyHeaderWhiteList.slice();Request.defaultProxyHeaderExclusiveList=V.defaultProxyHeaderExclusiveList.slice();Request.prototype.toJSON=requestToJSON;e.exports=Request},3476:function(e,t,a){
37
37
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
38
38
  var r=a(181);var i=r.Buffer;function copyProps(e,t){for(var a in e){t[a]=e[a]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=r}else{copyProps(r,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,a){return i(e,t,a)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,a){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,a)};SafeBuffer.alloc=function(e,t,a){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var r=i(e);if(t!==undefined){if(typeof a==="string"){r.fill(t,a)}else{r.fill(t)}}else{r.fill(0)}return r};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return r.SlowBuffer(e)}},9392:function(e,t,a){"use strict";var r=a(181);var i=r.Buffer;var o={};var n;for(n in r){if(!r.hasOwnProperty(n))continue;if(n==="SlowBuffer"||n==="Buffer")continue;o[n]=r[n]}var s=o.Buffer={};for(n in i){if(!i.hasOwnProperty(n))continue;if(n==="allocUnsafe"||n==="allocUnsafeSlow")continue;s[n]=i[n]}o.Buffer.prototype=i.prototype;if(!s.from||s.from===Uint8Array.from){s.from=function(e,t,a){if(typeof e==="number"){throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e)}if(e&&typeof e.length==="undefined"){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}return i(e,t,a)}}if(!s.alloc){s.alloc=function(e,t,a){if(typeof e!=="number"){throw new TypeError('The "size" argument must be of type number. Received type '+typeof e)}if(e<0||e>=2*(1<<30)){throw new RangeError('The value "'+e+'" is invalid for option "size"')}var r=i(e);if(!t||t.length===0){r.fill(0)}else if(typeof a==="string"){r.fill(t,a)}else{r.fill(t)}return r}}if(!o.kStringMaxLength){try{o.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(e){}}if(!o.constants){o.constants={MAX_LENGTH:o.kMaxLength};if(o.kStringMaxLength){o.constants.MAX_STRING_LENGTH=o.kStringMaxLength}}e.exports=o},8804:function(e,t){t=e.exports=SemVer;var a;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){a=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER");console.log.apply(console,e)}}else{a=function(){}}t.SEMVER_SPEC_VERSION="2.0.0";var r=256;var i=Number.MAX_SAFE_INTEGER||9007199254740991;var o=16;var n=r-6;var s=t.re=[];var c=t.safeRe=[];var u=t.src=[];var l=t.tokens={};var p=0;function tok(e){l[e]=p++}var f="[a-zA-Z0-9-]";var m=[["\\s",1],["\\d",r],[f,n]];function makeSafeRe(e){for(var t=0;t<m.length;t++){var a=m[t][0];var r=m[t][1];e=e.split(a+"*").join(a+"{0,"+r+"}").split(a+"+").join(a+"{1,"+r+"}")}return e}tok("NUMERICIDENTIFIER");u[l.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");u[l.NUMERICIDENTIFIERLOOSE]="\\d+";tok("NONNUMERICIDENTIFIER");u[l.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+f+"*";tok("MAINVERSION");u[l.MAINVERSION]="("+u[l.NUMERICIDENTIFIER]+")\\."+"("+u[l.NUMERICIDENTIFIER]+")\\."+"("+u[l.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");u[l.MAINVERSIONLOOSE]="("+u[l.NUMERICIDENTIFIERLOOSE]+")\\."+"("+u[l.NUMERICIDENTIFIERLOOSE]+")\\."+"("+u[l.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");u[l.PRERELEASEIDENTIFIER]="(?:"+u[l.NUMERICIDENTIFIER]+"|"+u[l.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");u[l.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[l.NUMERICIDENTIFIERLOOSE]+"|"+u[l.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");u[l.PRERELEASE]="(?:-("+u[l.PRERELEASEIDENTIFIER]+"(?:\\."+u[l.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");u[l.PRERELEASELOOSE]="(?:-?("+u[l.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[l.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");u[l.BUILDIDENTIFIER]=f+"+";tok("BUILD");u[l.BUILD]="(?:\\+("+u[l.BUILDIDENTIFIER]+"(?:\\."+u[l.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");u[l.FULLPLAIN]="v?"+u[l.MAINVERSION]+u[l.PRERELEASE]+"?"+u[l.BUILD]+"?";u[l.FULL]="^"+u[l.FULLPLAIN]+"$";tok("LOOSEPLAIN");u[l.LOOSEPLAIN]="[v=\\s]*"+u[l.MAINVERSIONLOOSE]+u[l.PRERELEASELOOSE]+"?"+u[l.BUILD]+"?";tok("LOOSE");u[l.LOOSE]="^"+u[l.LOOSEPLAIN]+"$";tok("GTLT");u[l.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");u[l.XRANGEIDENTIFIERLOOSE]=u[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");u[l.XRANGEIDENTIFIER]=u[l.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");u[l.XRANGEPLAIN]="[v=\\s]*("+u[l.XRANGEIDENTIFIER]+")"+"(?:\\.("+u[l.XRANGEIDENTIFIER]+")"+"(?:\\.("+u[l.XRANGEIDENTIFIER]+")"+"(?:"+u[l.PRERELEASE]+")?"+u[l.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");u[l.XRANGEPLAINLOOSE]="[v=\\s]*("+u[l.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+u[l.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+u[l.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+u[l.PRERELEASELOOSE]+")?"+u[l.BUILD]+"?"+")?)?";tok("XRANGE");u[l.XRANGE]="^"+u[l.GTLT]+"\\s*"+u[l.XRANGEPLAIN]+"$";tok("XRANGELOOSE");u[l.XRANGELOOSE]="^"+u[l.GTLT]+"\\s*"+u[l.XRANGEPLAINLOOSE]+"$";tok("COERCE");u[l.COERCE]="(^|[^\\d])"+"(\\d{1,"+o+"})"+"(?:\\.(\\d{1,"+o+"}))?"+"(?:\\.(\\d{1,"+o+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");s[l.COERCERTL]=new RegExp(u[l.COERCE],"g");c[l.COERCERTL]=new RegExp(makeSafeRe(u[l.COERCE]),"g");tok("LONETILDE");u[l.LONETILDE]="(?:~>?)";tok("TILDETRIM");u[l.TILDETRIM]="(\\s*)"+u[l.LONETILDE]+"\\s+";s[l.TILDETRIM]=new RegExp(u[l.TILDETRIM],"g");c[l.TILDETRIM]=new RegExp(makeSafeRe(u[l.TILDETRIM]),"g");var h="$1~";tok("TILDE");u[l.TILDE]="^"+u[l.LONETILDE]+u[l.XRANGEPLAIN]+"$";tok("TILDELOOSE");u[l.TILDELOOSE]="^"+u[l.LONETILDE]+u[l.XRANGEPLAINLOOSE]+"$";tok("LONECARET");u[l.LONECARET]="(?:\\^)";tok("CARETTRIM");u[l.CARETTRIM]="(\\s*)"+u[l.LONECARET]+"\\s+";s[l.CARETTRIM]=new RegExp(u[l.CARETTRIM],"g");c[l.CARETTRIM]=new RegExp(makeSafeRe(u[l.CARETTRIM]),"g");var g="$1^";tok("CARET");u[l.CARET]="^"+u[l.LONECARET]+u[l.XRANGEPLAIN]+"$";tok("CARETLOOSE");u[l.CARETLOOSE]="^"+u[l.LONECARET]+u[l.XRANGEPLAINLOOSE]+"$";tok("COMPARATORLOOSE");u[l.COMPARATORLOOSE]="^"+u[l.GTLT]+"\\s*("+u[l.LOOSEPLAIN]+")$|^$";tok("COMPARATOR");u[l.COMPARATOR]="^"+u[l.GTLT]+"\\s*("+u[l.FULLPLAIN]+")$|^$";tok("COMPARATORTRIM");u[l.COMPARATORTRIM]="(\\s*)"+u[l.GTLT]+"\\s*("+u[l.LOOSEPLAIN]+"|"+u[l.XRANGEPLAIN]+")";s[l.COMPARATORTRIM]=new RegExp(u[l.COMPARATORTRIM],"g");c[l.COMPARATORTRIM]=new RegExp(makeSafeRe(u[l.COMPARATORTRIM]),"g");var y="$1$2$3";tok("HYPHENRANGE");u[l.HYPHENRANGE]="^\\s*("+u[l.XRANGEPLAIN]+")"+"\\s+-\\s+"+"("+u[l.XRANGEPLAIN]+")"+"\\s*$";tok("HYPHENRANGELOOSE");u[l.HYPHENRANGELOOSE]="^\\s*("+u[l.XRANGEPLAINLOOSE]+")"+"\\s+-\\s+"+"("+u[l.XRANGEPLAINLOOSE]+")"+"\\s*$";tok("STAR");u[l.STAR]="(<|>)?=?\\s*\\*";for(var b=0;b<p;b++){a(b,u[b]);if(!s[b]){s[b]=new RegExp(u[b]);c[b]=new RegExp(makeSafeRe(u[b]))}}t.parse=parse;function parse(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof SemVer){return e}if(typeof e!=="string"){return null}if(e.length>r){return null}var a=t.loose?c[l.LOOSE]:c[l.FULL];if(!a.test(e)){return null}try{return new SemVer(e,t)}catch(e){return null}}t.valid=valid;function valid(e,t){var a=parse(e,t);return a?a.version:null}t.clean=clean;function clean(e,t){var a=parse(e.trim().replace(/^[=v]+/,""),t);return a?a.version:null}t.SemVer=SemVer;function SemVer(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof SemVer){if(e.loose===t.loose){return e}else{e=e.version}}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r){throw new TypeError("version is longer than "+r+" characters")}if(!(this instanceof SemVer)){return new SemVer(e,t)}a("SemVer",e,t);this.options=t;this.loose=!!t.loose;var o=e.trim().match(t.loose?c[l.LOOSE]:c[l.FULL]);if(!o){throw new TypeError("Invalid Version: "+e)}this.raw=e;this.major=+o[1];this.minor=+o[2];this.patch=+o[3];if(this.major>i||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>i||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>i||this.patch<0){throw new TypeError("Invalid patch version")}if(!o[4]){this.prerelease=[]}else{this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<i){return t}}return e}))}this.build=o[5]?o[5].split("."):[];this.format()}SemVer.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length){this.version+="-"+this.prerelease.join(".")}return this.version};SemVer.prototype.toString=function(){return this.version};SemVer.prototype.compare=function(e){a("SemVer.compare",this.version,this.options,e);if(!(e instanceof SemVer)){e=new SemVer(e,this.options)}return this.compareMain(e)||this.comparePre(e)};SemVer.prototype.compareMain=function(e){if(!(e instanceof SemVer)){e=new SemVer(e,this.options)}return compareIdentifiers(this.major,e.major)||compareIdentifiers(this.minor,e.minor)||compareIdentifiers(this.patch,e.patch)};SemVer.prototype.comparePre=function(e){if(!(e instanceof SemVer)){e=new SemVer(e,this.options)}if(this.prerelease.length&&!e.prerelease.length){return-1}else if(!this.prerelease.length&&e.prerelease.length){return 1}else if(!this.prerelease.length&&!e.prerelease.length){return 0}var t=0;do{var r=this.prerelease[t];var i=e.prerelease[t];a("prerelease compare",t,r,i);if(r===undefined&&i===undefined){return 0}else if(i===undefined){return 1}else if(r===undefined){return-1}else if(r===i){continue}else{return compareIdentifiers(r,i)}}while(++t)};SemVer.prototype.compareBuild=function(e){if(!(e instanceof SemVer)){e=new SemVer(e,this.options)}var t=0;do{var r=this.build[t];var i=e.build[t];a("prerelease compare",t,r,i);if(r===undefined&&i===undefined){return 0}else if(i===undefined){return 1}else if(r===undefined){return-1}else if(r===i){continue}else{return compareIdentifiers(r,i)}}while(++t)};SemVer.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",t);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",t);break;case"prepatch":this.prerelease.length=0;this.inc("patch",t);this.inc("pre",t);break;case"prerelease":if(this.prerelease.length===0){this.inc("patch",t)}this.inc("pre",t);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0){this.major++}this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0){this.minor++}this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0){this.patch++}this.prerelease=[];break;case"pre":if(this.prerelease.length===0){this.prerelease=[0]}else{var a=this.prerelease.length;while(--a>=0){if(typeof this.prerelease[a]==="number"){this.prerelease[a]++;a=-2}}if(a===-1){this.prerelease.push(0)}}if(t){if(this.prerelease[0]===t){if(isNaN(this.prerelease[1])){this.prerelease=[t,0]}}else{this.prerelease=[t,0]}}break;default:throw new Error("invalid increment argument: "+e)}this.format();this.raw=this.version;return this};t.inc=inc;function inc(e,t,a,r){if(typeof a==="string"){r=a;a=undefined}try{return new SemVer(e,a).inc(t,r).version}catch(e){return null}}t.diff=diff;function diff(e,t){if(eq(e,t)){return null}else{var a=parse(e);var r=parse(t);var i="";if(a.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var n in a){if(n==="major"||n==="minor"||n==="patch"){if(a[n]!==r[n]){return i+n}}}return o}}t.compareIdentifiers=compareIdentifiers;var k=/^[0-9]+$/;function compareIdentifiers(e,t){var a=k.test(e);var r=k.test(t);if(a&&r){e=+e;t=+t}return e===t?0:a&&!r?-1:r&&!a?1:e<t?-1:1}t.rcompareIdentifiers=rcompareIdentifiers;function rcompareIdentifiers(e,t){return compareIdentifiers(t,e)}t.major=major;function major(e,t){return new SemVer(e,t).major}t.minor=minor;function minor(e,t){return new SemVer(e,t).minor}t.patch=patch;function patch(e,t){return new SemVer(e,t).patch}t.compare=compare;function compare(e,t,a){return new SemVer(e,a).compare(new SemVer(t,a))}t.compareLoose=compareLoose;function compareLoose(e,t){return compare(e,t,true)}t.compareBuild=compareBuild;function compareBuild(e,t,a){var r=new SemVer(e,a);var i=new SemVer(t,a);return r.compare(i)||r.compareBuild(i)}t.rcompare=rcompare;function rcompare(e,t,a){return compare(t,e,a)}t.sort=sort;function sort(e,a){return e.sort((function(e,r){return t.compareBuild(e,r,a)}))}t.rsort=rsort;function rsort(e,a){return e.sort((function(e,r){return t.compareBuild(r,e,a)}))}t.gt=gt;function gt(e,t,a){return compare(e,t,a)>0}t.lt=lt;function lt(e,t,a){return compare(e,t,a)<0}t.eq=eq;function eq(e,t,a){return compare(e,t,a)===0}t.neq=neq;function neq(e,t,a){return compare(e,t,a)!==0}t.gte=gte;function gte(e,t,a){return compare(e,t,a)>=0}t.lte=lte;function lte(e,t,a){return compare(e,t,a)<=0}t.cmp=cmp;function cmp(e,t,a,r){switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof a==="object")a=a.version;return e===a;case"!==":if(typeof e==="object")e=e.version;if(typeof a==="object")a=a.version;return e!==a;case"":case"=":case"==":return eq(e,a,r);case"!=":return neq(e,a,r);case">":return gt(e,a,r);case">=":return gte(e,a,r);case"<":return lt(e,a,r);case"<=":return lte(e,a,r);default:throw new TypeError("Invalid operator: "+t)}}t.Comparator=Comparator;function Comparator(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof Comparator){if(e.loose===!!t.loose){return e}else{e=e.value}}if(!(this instanceof Comparator)){return new Comparator(e,t)}e=e.trim().split(/\s+/).join(" ");a("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===w){this.value=""}else{this.value=this.operator+this.semver.version}a("comp",this)}var w={};Comparator.prototype.parse=function(e){var t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR];var a=e.match(t);if(!a){throw new TypeError("Invalid comparator: "+e)}this.operator=a[1]!==undefined?a[1]:"";if(this.operator==="="){this.operator=""}if(!a[2]){this.semver=w}else{this.semver=new SemVer(a[2],this.options.loose)}};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(e){a("Comparator.test",e,this.options.loose);if(this.semver===w||e===w){return true}if(typeof e==="string"){try{e=new SemVer(e,this.options)}catch(e){return false}}return cmp(e,this.operator,this.semver,this.options)};Comparator.prototype.intersects=function(e,t){if(!(e instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}var a;if(this.operator===""){if(this.value===""){return true}a=new Range(e.value,t);return satisfies(this.value,a,t)}else if(e.operator===""){if(e.value===""){return true}a=new Range(this.value,t);return satisfies(e.semver,a,t)}var r=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">");var i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<");var o=this.semver.version===e.semver.version;var n=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<=");var s=cmp(this.semver,"<",e.semver,t)&&((this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"));var c=cmp(this.semver,">",e.semver,t)&&((this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">"));return r||i||o&&n||s||c};t.Range=Range;function Range(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof Range){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{return new Range(e.raw,t)}}if(e instanceof Comparator){return new Range(e.value,t)}if(!(this instanceof Range)){return new Range(e,t)}this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;this.raw=e.trim().split(/\s+/).join(" ");this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length}));if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+this.raw)}this.format()}Range.prototype.format=function(){this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(e){var t=this.options.loose;var r=t?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(r,hyphenReplace);a("hyphen replace",e);e=e.replace(c[l.COMPARATORTRIM],y);a("comparator trim",e,c[l.COMPARATORTRIM]);e=e.replace(c[l.TILDETRIM],h);e=e.replace(c[l.CARETTRIM],g);e=e.split(/\s+/).join(" ");var i=t?c[l.COMPARATORLOOSE]:c[l.COMPARATOR];var o=e.split(" ").map((function(e){return parseComparator(e,this.options)}),this).join(" ").split(/\s+/);if(this.options.loose){o=o.filter((function(e){return!!e.match(i)}))}o=o.map((function(e){return new Comparator(e,this.options)}),this);return o};Range.prototype.intersects=function(e,t){if(!(e instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((function(a){return isSatisfiable(a,t)&&e.set.some((function(e){return isSatisfiable(e,t)&&a.every((function(a){return e.every((function(e){return a.intersects(e,t)}))}))}))}))};function isSatisfiable(e,t){var a=true;var r=e.slice();var i=r.pop();while(a&&r.length){a=r.every((function(e){return i.intersects(e,t)}));i=r.pop()}return a}t.toComparators=toComparators;function toComparators(e,t){return new Range(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))}function parseComparator(e,t){a("comp",e,t);e=replaceCarets(e,t);a("caret",e);e=replaceTildes(e,t);a("tildes",e);e=replaceXRanges(e,t);a("xrange",e);e=replaceStars(e,t);a("stars",e);return e}function isX(e){return!e||e.toLowerCase()==="x"||e==="*"}function replaceTildes(e,t){return e.trim().split(/\s+/).map((function(e){return replaceTilde(e,t)})).join(" ")}function replaceTilde(e,t){var r=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(r,(function(t,r,i,o,n){a("tilde",e,t,r,i,o,n);var s;if(isX(r)){s=""}else if(isX(i)){s=">="+r+".0.0 <"+(+r+1)+".0.0"}else if(isX(o)){s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0"}else if(n){a("replaceTilde pr",n);s=">="+r+"."+i+"."+o+"-"+n+" <"+r+"."+(+i+1)+".0"}else{s=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0"}a("tilde return",s);return s}))}function replaceCarets(e,t){return e.trim().split(/\s+/).map((function(e){return replaceCaret(e,t)})).join(" ")}function replaceCaret(e,t){a("caret",e,t);var r=t.loose?c[l.CARETLOOSE]:c[l.CARET];return e.replace(r,(function(t,r,i,o,n){a("caret",e,t,r,i,o,n);var s;if(isX(r)){s=""}else if(isX(i)){s=">="+r+".0.0 <"+(+r+1)+".0.0"}else if(isX(o)){if(r==="0"){s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0"}else{s=">="+r+"."+i+".0 <"+(+r+1)+".0.0"}}else if(n){a("replaceCaret pr",n);if(r==="0"){if(i==="0"){s=">="+r+"."+i+"."+o+"-"+n+" <"+r+"."+i+"."+(+o+1)}else{s=">="+r+"."+i+"."+o+"-"+n+" <"+r+"."+(+i+1)+".0"}}else{s=">="+r+"."+i+"."+o+"-"+n+" <"+(+r+1)+".0.0"}}else{a("no pr");if(r==="0"){if(i==="0"){s=">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1)}else{s=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0"}}else{s=">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"}}a("caret return",s);return s}))}function replaceXRanges(e,t){a("replaceXRanges",e,t);return e.split(/\s+/).map((function(e){return replaceXRange(e,t)})).join(" ")}function replaceXRange(e,t){e=e.trim();var r=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(r,(function(r,i,o,n,s,c){a("xRange",e,r,i,o,n,s,c);var u=isX(o);var l=u||isX(n);var p=l||isX(s);var f=p;if(i==="="&&f){i=""}c=t.includePrerelease?"-0":"";if(u){if(i===">"||i==="<"){r="<0.0.0-0"}else{r="*"}}else if(i&&f){if(l){n=0}s=0;if(i===">"){i=">=";if(l){o=+o+1;n=0;s=0}else{n=+n+1;s=0}}else if(i==="<="){i="<";if(l){o=+o+1}else{n=+n+1}}r=i+o+"."+n+"."+s+c}else if(l){r=">="+o+".0.0"+c+" <"+(+o+1)+".0.0"+c}else if(p){r=">="+o+"."+n+".0"+c+" <"+o+"."+(+n+1)+".0"+c}a("xRange return",r);return r}))}function replaceStars(e,t){a("replaceStars",e,t);return e.trim().replace(c[l.STAR],"")}function hyphenReplace(e,t,a,r,i,o,n,s,c,u,l,p,f){if(isX(a)){t=""}else if(isX(r)){t=">="+a+".0.0"}else if(isX(i)){t=">="+a+"."+r+".0"}else{t=">="+t}if(isX(c)){s=""}else if(isX(u)){s="<"+(+c+1)+".0.0"}else if(isX(l)){s="<"+c+"."+(+u+1)+".0"}else if(p){s="<="+c+"."+u+"."+l+"-"+p}else{s="<="+s}return(t+" "+s).trim()}Range.prototype.test=function(e){if(!e){return false}if(typeof e==="string"){try{e=new SemVer(e,this.options)}catch(e){return false}}for(var t=0;t<this.set.length;t++){if(testSet(this.set[t],e,this.options)){return true}}return false};function testSet(e,t,r){for(var i=0;i<e.length;i++){if(!e[i].test(t)){return false}}if(t.prerelease.length&&!r.includePrerelease){for(i=0;i<e.length;i++){a(e[i].semver);if(e[i].semver===w){continue}if(e[i].semver.prerelease.length>0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch){return true}}}return false}return true}t.satisfies=satisfies;function satisfies(e,t,a){try{t=new Range(t,a)}catch(e){return false}return t.test(e)}t.maxSatisfying=maxSatisfying;function maxSatisfying(e,t,a){var r=null;var i=null;try{var o=new Range(t,a)}catch(e){return null}e.forEach((function(e){if(o.test(e)){if(!r||i.compare(e)===-1){r=e;i=new SemVer(r,a)}}}));return r}t.minSatisfying=minSatisfying;function minSatisfying(e,t,a){var r=null;var i=null;try{var o=new Range(t,a)}catch(e){return null}e.forEach((function(e){if(o.test(e)){if(!r||i.compare(e)===1){r=e;i=new SemVer(r,a)}}}));return r}t.minVersion=minVersion;function minVersion(e,t){e=new Range(e,t);var a=new SemVer("0.0.0");if(e.test(a)){return a}a=new SemVer("0.0.0-0");if(e.test(a)){return a}a=null;for(var r=0;r<e.set.length;++r){var i=e.set[r];i.forEach((function(e){var t=new SemVer(e.semver.version);switch(e.operator){case">":if(t.prerelease.length===0){t.patch++}else{t.prerelease.push(0)}t.raw=t.format();case"":case">=":if(!a||gt(a,t)){a=t}break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(a&&e.test(a)){return a}return null}t.validRange=validRange;function validRange(e,t){try{return new Range(e,t).range||"*"}catch(e){return null}}t.ltr=ltr;function ltr(e,t,a){return outside(e,t,"<",a)}t.gtr=gtr;function gtr(e,t,a){return outside(e,t,">",a)}t.outside=outside;function outside(e,t,a,r){e=new SemVer(e,r);t=new Range(t,r);var i,o,n,s,c;switch(a){case">":i=gt;o=lte;n=lt;s=">";c=">=";break;case"<":i=lt;o=gte;n=gt;s="<";c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(e,t,r)){return false}for(var u=0;u<t.set.length;++u){var l=t.set[u];var p=null;var f=null;l.forEach((function(e){if(e.semver===w){e=new Comparator(">=0.0.0")}p=p||e;f=f||e;if(i(e.semver,p.semver,r)){p=e}else if(n(e.semver,f.semver,r)){f=e}}));if(p.operator===s||p.operator===c){return false}if((!f.operator||f.operator===s)&&o(e,f.semver)){return false}else if(f.operator===c&&n(e,f.semver)){return false}}return true}t.prerelease=prerelease;function prerelease(e,t){var a=parse(e,t);return a&&a.prerelease.length?a.prerelease:null}t.intersects=intersects;function intersects(e,t,a){e=new Range(e,a);t=new Range(t,a);return e.intersects(t)}t.coerce=coerce;function coerce(e,t){if(e instanceof SemVer){return e}if(typeof e==="number"){e=String(e)}if(typeof e!=="string"){return null}t=t||{};var a=null;if(!t.rtl){a=e.match(c[l.COERCE])}else{var r;while((r=c[l.COERCERTL].exec(e))&&(!a||a.index+a[0].length!==e.length)){if(!a||r.index+r[0].length!==a.index+a[0].length){a=r}c[l.COERCERTL].lastIndex=r.index+r[1].length+r[2].length}c[l.COERCERTL].lastIndex=-1}if(a===null){return null}return parse(a[2]+"."+(a[3]||"0")+"."+(a[4]||"0"),t)}},863:function(e,t,a){"use strict";const r=Symbol("SemVer ANY");class Comparator{static get ANY(){return r}constructor(e,t){t=i(t);if(e instanceof Comparator){if(e.loose===!!t.loose){return e}else{e=e.value}}e=e.trim().split(/\s+/).join(" ");c("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===r){this.value=""}else{this.value=this.operator+this.semver.version}c("comp",this)}parse(e){const t=this.options.loose?o[n.COMPARATORLOOSE]:o[n.COMPARATOR];const a=e.match(t);if(!a){throw new TypeError(`Invalid comparator: ${e}`)}this.operator=a[1]!==undefined?a[1]:"";if(this.operator==="="){this.operator=""}if(!a[2]){this.semver=r}else{this.semver=new u(a[2],this.options.loose)}}toString(){return this.value}test(e){c("Comparator.test",e,this.options.loose);if(this.semver===r||e===r){return true}if(typeof e==="string"){try{e=new u(e,this.options)}catch(e){return false}}return s(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator)){throw new TypeError("a Comparator is required")}if(this.operator===""){if(this.value===""){return true}return new l(e.value,t).test(this.value)}else if(e.operator===""){if(e.value===""){return true}return new l(this.value,t).test(e.semver)}t=i(t);if(t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")){return false}if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))){return false}if(this.operator.startsWith(">")&&e.operator.startsWith(">")){return true}if(this.operator.startsWith("<")&&e.operator.startsWith("<")){return true}if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")){return true}if(s(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")){return true}if(s(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")){return true}return false}}e.exports=Comparator;const i=a(2600);const{safeRe:o,t:n}=a(6211);const s=a(5618);const c=a(7611);const u=a(4839);const l=a(8474)},8474:function(e,t,a){"use strict";const r=/\s+/g;class Range{constructor(e,t){t=n(t);if(e instanceof Range){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{return new Range(e.raw,t)}}if(e instanceof s){this.raw=e.value;this.set=[[e]];this.formatted=undefined;return this}this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;this.raw=e.trim().replace(r," ");this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length));if(!this.set.length){throw new TypeError(`Invalid SemVer Range: ${this.raw}`)}if(this.set.length>1){const e=this.set[0];this.set=this.set.filter((e=>!isNullSet(e[0])));if(this.set.length===0){this.set=[e]}else if(this.set.length>1){for(const e of this.set){if(e.length===1&&isAny(e[0])){this.set=[e];break}}}}this.formatted=undefined}get range(){if(this.formatted===undefined){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0){this.formatted+="||"}const t=this.set[e];for(let e=0;e<t.length;e++){if(e>0){this.formatted+=" "}this.formatted+=t[e].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=(this.options.includePrerelease&&g)|(this.options.loose&&y);const a=t+":"+e;const r=o.get(a);if(r){return r}const i=this.options.loose;const n=i?l[p.HYPHENRANGELOOSE]:l[p.HYPHENRANGE];e=e.replace(n,hyphenReplace(this.options.includePrerelease));c("hyphen replace",e);e=e.replace(l[p.COMPARATORTRIM],f);c("comparator trim",e);e=e.replace(l[p.TILDETRIM],m);c("tilde trim",e);e=e.replace(l[p.CARETTRIM],h);c("caret trim",e);let u=e.split(" ").map((e=>parseComparator(e,this.options))).join(" ").split(/\s+/).map((e=>replaceGTE0(e,this.options)));if(i){u=u.filter((e=>{c("loose invalid filter",e,this.options);return!!e.match(l[p.COMPARATORLOOSE])}))}c("range list",u);const b=new Map;const k=u.map((e=>new s(e,this.options)));for(const e of k){if(isNullSet(e)){return[e]}b.set(e.value,e)}if(b.size>1&&b.has("")){b.delete("")}const w=[...b.values()];o.set(a,w);return w}intersects(e,t){if(!(e instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((a=>isSatisfiable(a,t)&&e.set.some((e=>isSatisfiable(e,t)&&a.every((a=>e.every((e=>a.intersects(e,t)))))))))}test(e){if(!e){return false}if(typeof e==="string"){try{e=new u(e,this.options)}catch(e){return false}}for(let t=0;t<this.set.length;t++){if(testSet(this.set[t],e,this.options)){return true}}return false}}e.exports=Range;const i=a(2443);const o=new i;const n=a(2600);const s=a(863);const c=a(7611);const u=a(4839);const{safeRe:l,t:p,comparatorTrimReplace:f,tildeTrimReplace:m,caretTrimReplace:h}=a(6211);const{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:y}=a(4329);const isNullSet=e=>e.value==="<0.0.0-0";const isAny=e=>e.value==="";const isSatisfiable=(e,t)=>{let a=true;const r=e.slice();let i=r.pop();while(a&&r.length){a=r.every((e=>i.intersects(e,t)));i=r.pop()}return a};const parseComparator=(e,t)=>{c("comp",e,t);e=replaceCarets(e,t);c("caret",e);e=replaceTildes(e,t);c("tildes",e);e=replaceXRanges(e,t);c("xrange",e);e=replaceStars(e,t);c("stars",e);return e};const isX=e=>!e||e.toLowerCase()==="x"||e==="*";const replaceTildes=(e,t)=>e.trim().split(/\s+/).map((e=>replaceTilde(e,t))).join(" ");const replaceTilde=(e,t)=>{const a=t.loose?l[p.TILDELOOSE]:l[p.TILDE];return e.replace(a,((t,a,r,i,o)=>{c("tilde",e,t,a,r,i,o);let n;if(isX(a)){n=""}else if(isX(r)){n=`>=${a}.0.0 <${+a+1}.0.0-0`}else if(isX(i)){n=`>=${a}.${r}.0 <${a}.${+r+1}.0-0`}else if(o){c("replaceTilde pr",o);n=`>=${a}.${r}.${i}-${o} <${a}.${+r+1}.0-0`}else{n=`>=${a}.${r}.${i} <${a}.${+r+1}.0-0`}c("tilde return",n);return n}))};const replaceCarets=(e,t)=>e.trim().split(/\s+/).map((e=>replaceCaret(e,t))).join(" ");const replaceCaret=(e,t)=>{c("caret",e,t);const a=t.loose?l[p.CARETLOOSE]:l[p.CARET];const r=t.includePrerelease?"-0":"";return e.replace(a,((t,a,i,o,n)=>{c("caret",e,t,a,i,o,n);let s;if(isX(a)){s=""}else if(isX(i)){s=`>=${a}.0.0${r} <${+a+1}.0.0-0`}else if(isX(o)){if(a==="0"){s=`>=${a}.${i}.0${r} <${a}.${+i+1}.0-0`}else{s=`>=${a}.${i}.0${r} <${+a+1}.0.0-0`}}else if(n){c("replaceCaret pr",n);if(a==="0"){if(i==="0"){s=`>=${a}.${i}.${o}-${n} <${a}.${i}.${+o+1}-0`}else{s=`>=${a}.${i}.${o}-${n} <${a}.${+i+1}.0-0`}}else{s=`>=${a}.${i}.${o}-${n} <${+a+1}.0.0-0`}}else{c("no pr");if(a==="0"){if(i==="0"){s=`>=${a}.${i}.${o}${r} <${a}.${i}.${+o+1}-0`}else{s=`>=${a}.${i}.${o}${r} <${a}.${+i+1}.0-0`}}else{s=`>=${a}.${i}.${o} <${+a+1}.0.0-0`}}c("caret return",s);return s}))};const replaceXRanges=(e,t)=>{c("replaceXRanges",e,t);return e.split(/\s+/).map((e=>replaceXRange(e,t))).join(" ")};const replaceXRange=(e,t)=>{e=e.trim();const a=t.loose?l[p.XRANGELOOSE]:l[p.XRANGE];return e.replace(a,((a,r,i,o,n,s)=>{c("xRange",e,a,r,i,o,n,s);const u=isX(i);const l=u||isX(o);const p=l||isX(n);const f=p;if(r==="="&&f){r=""}s=t.includePrerelease?"-0":"";if(u){if(r===">"||r==="<"){a="<0.0.0-0"}else{a="*"}}else if(r&&f){if(l){o=0}n=0;if(r===">"){r=">=";if(l){i=+i+1;o=0;n=0}else{o=+o+1;n=0}}else if(r==="<="){r="<";if(l){i=+i+1}else{o=+o+1}}if(r==="<"){s="-0"}a=`${r+i}.${o}.${n}${s}`}else if(l){a=`>=${i}.0.0${s} <${+i+1}.0.0-0`}else if(p){a=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`}c("xRange return",a);return a}))};const replaceStars=(e,t)=>{c("replaceStars",e,t);return e.trim().replace(l[p.STAR],"")};const replaceGTE0=(e,t)=>{c("replaceGTE0",e,t);return e.trim().replace(l[t.includePrerelease?p.GTE0PRE:p.GTE0],"")};const hyphenReplace=e=>(t,a,r,i,o,n,s,c,u,l,p,f)=>{if(isX(r)){a=""}else if(isX(i)){a=`>=${r}.0.0${e?"-0":""}`}else if(isX(o)){a=`>=${r}.${i}.0${e?"-0":""}`}else if(n){a=`>=${a}`}else{a=`>=${a}${e?"-0":""}`}if(isX(u)){c=""}else if(isX(l)){c=`<${+u+1}.0.0-0`}else if(isX(p)){c=`<${u}.${+l+1}.0-0`}else if(f){c=`<=${u}.${l}.${p}-${f}`}else if(e){c=`<${u}.${l}.${+p+1}-0`}else{c=`<=${c}`}return`${a} ${c}`.trim()};const testSet=(e,t,a)=>{for(let a=0;a<e.length;a++){if(!e[a].test(t)){return false}}if(t.prerelease.length&&!a.includePrerelease){for(let a=0;a<e.length;a++){c(e[a].semver);if(e[a].semver===s.ANY){continue}if(e[a].semver.prerelease.length>0){const r=e[a].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch){return true}}}return false}return true}},4839:function(e,t,a){"use strict";const r=a(7611);const{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=a(4329);const{safeRe:n,t:s}=a(6211);const c=a(2600);const{compareIdentifiers:u}=a(6104);class SemVer{constructor(e,t){t=c(t);if(e instanceof SemVer){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{e=e.version}}else if(typeof e!=="string"){throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`)}if(e.length>i){throw new TypeError(`version is longer than ${i} characters`)}r("SemVer",e,t);this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;const a=e.trim().match(t.loose?n[s.LOOSE]:n[s.FULL]);if(!a){throw new TypeError(`Invalid Version: ${e}`)}this.raw=e;this.major=+a[1];this.minor=+a[2];this.patch=+a[3];if(this.major>o||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>o||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>o||this.patch<0){throw new TypeError("Invalid patch version")}if(!a[4]){this.prerelease=[]}else{this.prerelease=a[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o){return t}}return e}))}this.build=a[5]?a[5].split("."):[];this.format()}format(){this.version=`${this.major}.${this.minor}.${this.patch}`;if(this.prerelease.length){this.version+=`-${this.prerelease.join(".")}`}return this.version}toString(){return this.version}compare(e){r("SemVer.compare",this.version,this.options,e);if(!(e instanceof SemVer)){if(typeof e==="string"&&e===this.version){return 0}e=new SemVer(e,this.options)}if(e.version===this.version){return 0}return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof SemVer)){e=new SemVer(e,this.options)}return u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(!(e instanceof SemVer)){e=new SemVer(e,this.options)}if(this.prerelease.length&&!e.prerelease.length){return-1}else if(!this.prerelease.length&&e.prerelease.length){return 1}else if(!this.prerelease.length&&!e.prerelease.length){return 0}let t=0;do{const a=this.prerelease[t];const i=e.prerelease[t];r("prerelease compare",t,a,i);if(a===undefined&&i===undefined){return 0}else if(i===undefined){return 1}else if(a===undefined){return-1}else if(a===i){continue}else{return u(a,i)}}while(++t)}compareBuild(e){if(!(e instanceof SemVer)){e=new SemVer(e,this.options)}let t=0;do{const a=this.build[t];const i=e.build[t];r("build compare",t,a,i);if(a===undefined&&i===undefined){return 0}else if(i===undefined){return 1}else if(a===undefined){return-1}else if(a===i){continue}else{return u(a,i)}}while(++t)}inc(e,t,a){if(e.startsWith("pre")){if(!t&&a===false){throw new Error("invalid increment argument: identifier is empty")}if(t){const e=`-${t}`.match(this.options.loose?n[s.PRERELEASELOOSE]:n[s.PRERELEASE]);if(!e||e[1]!==t){throw new Error(`invalid identifier: ${t}`)}}}switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",t,a);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",t,a);break;case"prepatch":this.prerelease.length=0;this.inc("patch",t,a);this.inc("pre",t,a);break;case"prerelease":if(this.prerelease.length===0){this.inc("patch",t,a)}this.inc("pre",t,a);break;case"release":if(this.prerelease.length===0){throw new Error(`version ${this.raw} is not a prerelease`)}this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0){this.major++}this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0){this.minor++}this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0){this.patch++}this.prerelease=[];break;case"pre":{const e=Number(a)?1:0;if(this.prerelease.length===0){this.prerelease=[e]}else{let r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1){if(t===this.prerelease.join(".")&&a===false){throw new Error("invalid increment argument: identifier already exists")}this.prerelease.push(e)}}if(t){let r=[t,e];if(a===false){r=[t]}if(u(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1])){this.prerelease=r}}else{this.prerelease=r}}break}default:throw new Error(`invalid increment argument: ${e}`)}this.raw=this.format();if(this.build.length){this.raw+=`+${this.build.join(".")}`}return this}}e.exports=SemVer},2771:function(e,t,a){"use strict";const r=a(893);const clean=(e,t)=>{const a=r(e.trim().replace(/^[=v]+/,""),t);return a?a.version:null};e.exports=clean},5618:function(e,t,a){"use strict";const r=a(5630);const i=a(3282);const o=a(5283);const n=a(6064);const s=a(6108);const c=a(3353);const cmp=(e,t,a,u)=>{switch(t){case"===":if(typeof e==="object"){e=e.version}if(typeof a==="object"){a=a.version}return e===a;case"!==":if(typeof e==="object"){e=e.version}if(typeof a==="object"){a=a.version}return e!==a;case"":case"=":case"==":return r(e,a,u);case"!=":return i(e,a,u);case">":return o(e,a,u);case">=":return n(e,a,u);case"<":return s(e,a,u);case"<=":return c(e,a,u);default:throw new TypeError(`Invalid operator: ${t}`)}};e.exports=cmp},3597:function(e,t,a){"use strict";const r=a(4839);const i=a(893);const{safeRe:o,t:n}=a(6211);const coerce=(e,t)=>{if(e instanceof r){return e}if(typeof e==="number"){e=String(e)}if(typeof e!=="string"){return null}t=t||{};let a=null;if(!t.rtl){a=e.match(t.includePrerelease?o[n.COERCEFULL]:o[n.COERCE])}else{const r=t.includePrerelease?o[n.COERCERTLFULL]:o[n.COERCERTL];let i;while((i=r.exec(e))&&(!a||a.index+a[0].length!==e.length)){if(!a||i.index+i[0].length!==a.index+a[0].length){a=i}r.lastIndex=i.index+i[1].length+i[2].length}r.lastIndex=-1}if(a===null){return null}const s=a[2];const c=a[3]||"0";const u=a[4]||"0";const l=t.includePrerelease&&a[5]?`-${a[5]}`:"";const p=t.includePrerelease&&a[6]?`+${a[6]}`:"";return i(`${s}.${c}.${u}${l}${p}`,t)};e.exports=coerce},3932:function(e,t,a){"use strict";const r=a(4839);const compareBuild=(e,t,a)=>{const i=new r(e,a);const o=new r(t,a);return i.compare(o)||i.compareBuild(o)};e.exports=compareBuild},9822:function(e,t,a){"use strict";const r=a(6625);const compareLoose=(e,t)=>r(e,t,true);e.exports=compareLoose},6625:function(e,t,a){"use strict";const r=a(4839);const compare=(e,t,a)=>new r(e,a).compare(new r(t,a));e.exports=compare},1531:function(e,t,a){"use strict";const r=a(893);const diff=(e,t)=>{const a=r(e,null,true);const i=r(t,null,true);const o=a.compare(i);if(o===0){return null}const n=o>0;const s=n?a:i;const c=n?i:a;const u=!!s.prerelease.length;const l=!!c.prerelease.length;if(l&&!u){if(!c.patch&&!c.minor){return"major"}if(c.compareMain(s)===0){if(c.minor&&!c.patch){return"minor"}return"patch"}}const p=u?"pre":"";if(a.major!==i.major){return p+"major"}if(a.minor!==i.minor){return p+"minor"}if(a.patch!==i.patch){return p+"patch"}return"prerelease"};e.exports=diff},5630:function(e,t,a){"use strict";const r=a(6625);const eq=(e,t,a)=>r(e,t,a)===0;e.exports=eq},5283:function(e,t,a){"use strict";const r=a(6625);const gt=(e,t,a)=>r(e,t,a)>0;e.exports=gt},6064:function(e,t,a){"use strict";const r=a(6625);const gte=(e,t,a)=>r(e,t,a)>=0;e.exports=gte},2782:function(e,t,a){"use strict";const r=a(4839);const inc=(e,t,a,i,o)=>{if(typeof a==="string"){o=i;i=a;a=undefined}try{return new r(e instanceof r?e.version:e,a).inc(t,i,o).version}catch(e){return null}};e.exports=inc},6108:function(e,t,a){"use strict";const r=a(6625);const lt=(e,t,a)=>r(e,t,a)<0;e.exports=lt},3353:function(e,t,a){"use strict";const r=a(6625);const lte=(e,t,a)=>r(e,t,a)<=0;e.exports=lte},5251:function(e,t,a){"use strict";const r=a(4839);const major=(e,t)=>new r(e,t).major;e.exports=major},5479:function(e,t,a){"use strict";const r=a(4839);const minor=(e,t)=>new r(e,t).minor;e.exports=minor},3282:function(e,t,a){"use strict";const r=a(6625);const neq=(e,t,a)=>r(e,t,a)!==0;e.exports=neq},893:function(e,t,a){"use strict";const r=a(4839);const parse=(e,t,a=false)=>{if(e instanceof r){return e}try{return new r(e,t)}catch(e){if(!a){return null}throw e}};e.exports=parse},7056:function(e,t,a){"use strict";const r=a(4839);const patch=(e,t)=>new r(e,t).patch;e.exports=patch},390:function(e,t,a){"use strict";const r=a(893);const prerelease=(e,t)=>{const a=r(e,t);return a&&a.prerelease.length?a.prerelease:null};e.exports=prerelease},9729:function(e,t,a){"use strict";const r=a(6625);const rcompare=(e,t,a)=>r(t,e,a);e.exports=rcompare},8828:function(e,t,a){"use strict";const r=a(3932);const rsort=(e,t)=>e.sort(((e,a)=>r(a,e,t)));e.exports=rsort},9751:function(e,t,a){"use strict";const r=a(8474);const satisfies=(e,t,a)=>{try{t=new r(t,a)}catch(e){return false}return t.test(e)};e.exports=satisfies},6476:function(e,t,a){"use strict";const r=a(3932);const sort=(e,t)=>e.sort(((e,a)=>r(e,a,t)));e.exports=sort},5752:function(e,t,a){"use strict";const r=a(893);const valid=(e,t)=>{const a=r(e,t);return a?a.version:null};e.exports=valid},2348:function(e,t,a){"use strict";const r=a(6211);const i=a(4329);const o=a(4839);const n=a(6104);const s=a(893);const c=a(5752);const u=a(2771);const l=a(2782);const p=a(1531);const f=a(5251);const m=a(5479);const h=a(7056);const g=a(390);const y=a(6625);const b=a(9729);const k=a(9822);const w=a(3932);const x=a(6476);const j=a(8828);const P=a(5283);const C=a(6108);const I=a(5630);const z=a(3282);const O=a(6064);const q=a(3353);const H=a(5618);const V=a(3597);const G=a(863);const X=a(8474);const W=a(9751);const Y=a(2258);const ee=a(9269);const te=a(1367);const ae=a(6950);const re=a(8733);const ie=a(4772);const oe=a(712);const ne=a(5585);const se=a(1357);const ce=a(7344);const ue=a(4837);e.exports={parse:s,valid:c,clean:u,inc:l,diff:p,major:f,minor:m,patch:h,prerelease:g,compare:y,rcompare:b,compareLoose:k,compareBuild:w,sort:x,rsort:j,gt:P,lt:C,eq:I,neq:z,gte:O,lte:q,cmp:H,coerce:V,Comparator:G,Range:X,satisfies:W,toComparators:Y,maxSatisfying:ee,minSatisfying:te,minVersion:ae,validRange:re,outside:ie,gtr:oe,ltr:ne,intersects:se,simplifyRange:ce,subset:ue,SemVer:o,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers}},4329:function(e){"use strict";const t="2.0.0";const a=256;const r=Number.MAX_SAFE_INTEGER||9007199254740991;const i=16;const o=a-6;const n=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e.exports={MAX_LENGTH:a,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:n,SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7611:function(e){"use strict";const t=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},6104:function(e){"use strict";const t=/^[0-9]+$/;const compareIdentifiers=(e,a)=>{const r=t.test(e);const i=t.test(a);if(r&&i){e=+e;a=+a}return e===a?0:r&&!i?-1:i&&!r?1:e<a?-1:1};const rcompareIdentifiers=(e,t)=>compareIdentifiers(t,e);e.exports={compareIdentifiers:compareIdentifiers,rcompareIdentifiers:rcompareIdentifiers}},2443:function(e){"use strict";class LRUCache{constructor(){this.max=1e3;this.map=new Map}get(e){const t=this.map.get(e);if(t===undefined){return undefined}else{this.map.delete(e);this.map.set(e,t);return t}}delete(e){return this.map.delete(e)}set(e,t){const a=this.delete(e);if(!a&&t!==undefined){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}e.exports=LRUCache},2600:function(e){"use strict";const t=Object.freeze({loose:true});const a=Object.freeze({});const parseOptions=e=>{if(!e){return a}if(typeof e!=="object"){return t}return e};e.exports=parseOptions},6211:function(e,t,a){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=a(4329);const n=a(7611);t=e.exports={};const s=t.re=[];const c=t.safeRe=[];const u=t.src=[];const l=t.safeSrc=[];const p=t.t={};let f=0;const m="[a-zA-Z0-9-]";const h=[["\\s",1],["\\d",o],[m,i]];const makeSafeRegex=e=>{for(const[t,a]of h){e=e.split(`${t}*`).join(`${t}{0,${a}}`).split(`${t}+`).join(`${t}{1,${a}}`)}return e};const createToken=(e,t,a)=>{const r=makeSafeRegex(t);const i=f++;n(e,i,t);p[e]=i;u[i]=t;l[i]=r;s[i]=new RegExp(t,a?"g":undefined);c[i]=new RegExp(r,a?"g":undefined)};createToken("NUMERICIDENTIFIER","0|[1-9]\\d*");createToken("NUMERICIDENTIFIERLOOSE","\\d+");createToken("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`);createToken("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.`+`(${u[p.NUMERICIDENTIFIER]})\\.`+`(${u[p.NUMERICIDENTIFIER]})`);createToken("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.`+`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.`+`(${u[p.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`);createToken("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`);createToken("BUILDIDENTIFIER",`${m}+`);createToken("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`);createToken("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`);createToken("FULL",`^${u[p.FULLPLAIN]}$`);createToken("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`);createToken("LOOSE",`^${u[p.LOOSEPLAIN]}$`);createToken("GTLT","((?:<|>)?=?)");createToken("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);createToken("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`);createToken("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})`+`(?:\\.(${u[p.XRANGEIDENTIFIER]})`+`(?:\\.(${u[p.XRANGEIDENTIFIER]})`+`(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?`+`)?)?`);createToken("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})`+`(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?`+`)?)?`);createToken("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`);createToken("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`);createToken("COERCEPLAIN",`${"(^|[^\\d])"+"(\\d{1,"}${r}})`+`(?:\\.(\\d{1,${r}}))?`+`(?:\\.(\\d{1,${r}}))?`);createToken("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`);createToken("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?`+`(?:$|[^\\d])`);createToken("COERCERTL",u[p.COERCE],true);createToken("COERCERTLFULL",u[p.COERCEFULL],true);createToken("LONETILDE","(?:~>?)");createToken("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,true);t.tildeTrimReplace="$1~";createToken("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`);createToken("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`);createToken("LONECARET","(?:\\^)");createToken("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,true);t.caretTrimReplace="$1^";createToken("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`);createToken("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`);createToken("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`);createToken("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`);createToken("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,true);t.comparatorTrimReplace="$1$2$3";createToken("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})`+`\\s+-\\s+`+`(${u[p.XRANGEPLAIN]})`+`\\s*$`);createToken("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})`+`\\s+-\\s+`+`(${u[p.XRANGEPLAINLOOSE]})`+`\\s*$`);createToken("STAR","(<|>)?=?\\s*\\*");createToken("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");createToken("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},712:function(e,t,a){"use strict";const r=a(4772);const gtr=(e,t,a)=>r(e,t,">",a);e.exports=gtr},1357:function(e,t,a){"use strict";const r=a(8474);const intersects=(e,t,a)=>{e=new r(e,a);t=new r(t,a);return e.intersects(t,a)};e.exports=intersects},5585:function(e,t,a){"use strict";const r=a(4772);const ltr=(e,t,a)=>r(e,t,"<",a);e.exports=ltr},9269:function(e,t,a){"use strict";const r=a(4839);const i=a(8474);const maxSatisfying=(e,t,a)=>{let o=null;let n=null;let s=null;try{s=new i(t,a)}catch(e){return null}e.forEach((e=>{if(s.test(e)){if(!o||n.compare(e)===-1){o=e;n=new r(o,a)}}}));return o};e.exports=maxSatisfying},1367:function(e,t,a){"use strict";const r=a(4839);const i=a(8474);const minSatisfying=(e,t,a)=>{let o=null;let n=null;let s=null;try{s=new i(t,a)}catch(e){return null}e.forEach((e=>{if(s.test(e)){if(!o||n.compare(e)===1){o=e;n=new r(o,a)}}}));return o};e.exports=minSatisfying},6950:function(e,t,a){"use strict";const r=a(4839);const i=a(8474);const o=a(5283);const minVersion=(e,t)=>{e=new i(e,t);let a=new r("0.0.0");if(e.test(a)){return a}a=new r("0.0.0-0");if(e.test(a)){return a}a=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let n=null;i.forEach((e=>{const t=new r(e.semver.version);switch(e.operator){case">":if(t.prerelease.length===0){t.patch++}else{t.prerelease.push(0)}t.raw=t.format();case"":case">=":if(!n||o(t,n)){n=t}break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}));if(n&&(!a||o(a,n))){a=n}}if(a&&e.test(a)){return a}return null};e.exports=minVersion},4772:function(e,t,a){"use strict";const r=a(4839);const i=a(863);const{ANY:o}=i;const n=a(8474);const s=a(9751);const c=a(5283);const u=a(6108);const l=a(3353);const p=a(6064);const outside=(e,t,a,f)=>{e=new r(e,f);t=new n(t,f);let m,h,g,y,b;switch(a){case">":m=c;h=l;g=u;y=">";b=">=";break;case"<":m=u;h=p;g=c;y="<";b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,f)){return false}for(let a=0;a<t.set.length;++a){const r=t.set[a];let n=null;let s=null;r.forEach((e=>{if(e.semver===o){e=new i(">=0.0.0")}n=n||e;s=s||e;if(m(e.semver,n.semver,f)){n=e}else if(g(e.semver,s.semver,f)){s=e}}));if(n.operator===y||n.operator===b){return false}if((!s.operator||s.operator===y)&&h(e,s.semver)){return false}else if(s.operator===b&&g(e,s.semver)){return false}}return true};e.exports=outside},7344:function(e,t,a){"use strict";const r=a(9751);const i=a(6625);e.exports=(e,t,a)=>{const o=[];let n=null;let s=null;const c=e.sort(((e,t)=>i(e,t,a)));for(const e of c){const i=r(e,t,a);if(i){s=e;if(!n){n=e}}else{if(s){o.push([n,s])}s=null;n=null}}if(n){o.push([n,null])}const u=[];for(const[e,t]of o){if(e===t){u.push(e)}else if(!t&&e===c[0]){u.push("*")}else if(!t){u.push(`>=${e}`)}else if(e===c[0]){u.push(`<=${t}`)}else{u.push(`${e} - ${t}`)}}const l=u.join(" || ");const p=typeof t.raw==="string"?t.raw:String(t);return l.length<p.length?l:t}},4837:function(e,t,a){"use strict";const r=a(8474);const i=a(863);const{ANY:o}=i;const n=a(9751);const s=a(6625);const subset=(e,t,a={})=>{if(e===t){return true}e=new r(e,a);t=new r(t,a);let i=false;e:for(const r of e.set){for(const e of t.set){const t=simpleSubset(r,e,a);i=i||t!==null;if(t){continue e}}if(i){return false}}return true};const c=[new i(">=0.0.0-0")];const u=[new i(">=0.0.0")];const simpleSubset=(e,t,a)=>{if(e===t){return true}if(e.length===1&&e[0].semver===o){if(t.length===1&&t[0].semver===o){return true}else if(a.includePrerelease){e=c}else{e=u}}if(t.length===1&&t[0].semver===o){if(a.includePrerelease){return true}else{t=u}}const r=new Set;let i,l;for(const t of e){if(t.operator===">"||t.operator===">="){i=higherGT(i,t,a)}else if(t.operator==="<"||t.operator==="<="){l=lowerLT(l,t,a)}else{r.add(t.semver)}}if(r.size>1){return null}let p;if(i&&l){p=s(i.semver,l.semver,a);if(p>0){return null}else if(p===0&&(i.operator!==">="||l.operator!=="<=")){return null}}for(const e of r){if(i&&!n(e,String(i),a)){return null}if(l&&!n(e,String(l),a)){return null}for(const r of t){if(!n(e,String(r),a)){return false}}return true}let f,m;let h,g;let y=l&&!a.includePrerelease&&l.semver.prerelease.length?l.semver:false;let b=i&&!a.includePrerelease&&i.semver.prerelease.length?i.semver:false;if(y&&y.prerelease.length===1&&l.operator==="<"&&y.prerelease[0]===0){y=false}for(const e of t){g=g||e.operator===">"||e.operator===">=";h=h||e.operator==="<"||e.operator==="<=";if(i){if(b){if(e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch){b=false}}if(e.operator===">"||e.operator===">="){f=higherGT(i,e,a);if(f===e&&f!==i){return false}}else if(i.operator===">="&&!n(i.semver,String(e),a)){return false}}if(l){if(y){if(e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch){y=false}}if(e.operator==="<"||e.operator==="<="){m=lowerLT(l,e,a);if(m===e&&m!==l){return false}}else if(l.operator==="<="&&!n(l.semver,String(e),a)){return false}}if(!e.operator&&(l||i)&&p!==0){return false}}if(i&&h&&!l&&p!==0){return false}if(l&&g&&!i&&p!==0){return false}if(b||y){return false}return true};const higherGT=(e,t,a)=>{if(!e){return t}const r=s(e.semver,t.semver,a);return r>0?e:r<0?t:t.operator===">"&&e.operator===">="?t:e};const lowerLT=(e,t,a)=>{if(!e){return t}const r=s(e.semver,t.semver,a);return r<0?e:r>0?t:t.operator==="<"&&e.operator==="<="?t:e};e.exports=subset},2258:function(e,t,a){"use strict";const r=a(8474);const toComparators=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));e.exports=toComparators},8733:function(e,t,a){"use strict";const r=a(8474);const validRange=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}};e.exports=validRange},6767:function(e,t,a){var r=a(9392).Buffer;var i={dsa:{parts:["p","q","g","y"],sizePart:"p"},rsa:{parts:["e","n"],sizePart:"n"},ecdsa:{parts:["curve","Q"],sizePart:"Q"},ed25519:{parts:["A"],sizePart:"A"}};i["curve25519"]=i["ed25519"];var o={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};o["curve25519"]=o["ed25519"];var n={md5:true,sha1:true,sha256:true,sha384:true,sha512:true};var s={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:r.from(("00"+"ffffffff 00000001 00000000 00000000"+"00000000 ffffffff ffffffff ffffffff").replace(/ /g,""),"hex"),a:r.from(("00"+"FFFFFFFF 00000001 00000000 00000000"+"00000000 FFFFFFFF FFFFFFFF FFFFFFFC").replace(/ /g,""),"hex"),b:r.from(("5ac635d8 aa3a93e7 b3ebbd55 769886bc"+"651d06b0 cc53b0f6 3bce3c3e 27d2604b").replace(/ /g,""),"hex"),s:r.from(("00"+"c49d3608 86e70493 6a6678e1 139d26b7"+"819f7e90").replace(/ /g,""),"hex"),n:r.from(("00"+"ffffffff 00000000 ffffffff ffffffff"+"bce6faad a7179e84 f3b9cac2 fc632551").replace(/ /g,""),"hex"),G:r.from(("04"+"6b17d1f2 e12c4247 f8bce6e5 63a440f2"+"77037d81 2deb33a0 f4a13945 d898c296"+"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16"+"2bce3357 6b315ece cbb64068 37bf51f5").replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:r.from(("00"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff fffffffe"+"ffffffff 00000000 00000000 ffffffff").replace(/ /g,""),"hex"),a:r.from(("00"+"FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF"+"FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE"+"FFFFFFFF 00000000 00000000 FFFFFFFC").replace(/ /g,""),"hex"),b:r.from(("b3312fa7 e23ee7e4 988e056b e3f82d19"+"181d9c6e fe814112 0314088f 5013875a"+"c656398d 8a2ed19d 2a85c8ed d3ec2aef").replace(/ /g,""),"hex"),s:r.from(("00"+"a335926a a319a27a 1d00896a 6773a482"+"7acdac73").replace(/ /g,""),"hex"),n:r.from(("00"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff c7634d81 f4372ddf"+"581a0db2 48b0a77a ecec196a ccc52973").replace(/ /g,""),"hex"),G:r.from(("04"+"aa87ca22 be8b0537 8eb1c71e f320ad74"+"6e1d3b62 8ba79b98 59f741e0 82542a38"+"5502f25d bf55296c 3a545e38 72760ab7"+"3617de4a 96262c6f 5d9e98bf 9292dc29"+"f8f41dbd 289a147c e9da3113 b5f0b8c0"+"0a60b1ce 1d7e819d 7a431d7c 90ea0e5f").replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:r.from(("01ffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff ffffffff"+"ffff").replace(/ /g,""),"hex"),a:r.from(("01FF"+"FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF"+"FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF"+"FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF"+"FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC").replace(/ /g,""),"hex"),b:r.from(("51"+"953eb961 8e1c9a1f 929a21a0 b68540ee"+"a2da725b 99b315f3 b8b48991 8ef109e1"+"56193951 ec7e937b 1652c0bd 3bb1bf07"+"3573df88 3d2c34f1 ef451fd4 6b503f00").replace(/ /g,""),"hex"),s:r.from(("00"+"d09e8800 291cb853 96cc6717 393284aa"+"a0da64ba").replace(/ /g,""),"hex"),n:r.from(("01ff"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff fffffffa"+"51868783 bf2f966b 7fcc0148 f709a5d0"+"3bb5c9b8 899c47ae bb6fb71e 91386409").replace(/ /g,""),"hex"),G:r.from(("04"+"00c6 858e06b7 0404e9cd 9e3ecb66 2395b442"+"9c648139 053fb521 f828af60 6b4d3dba"+"a14b5e77 efe75928 fe1dc127 a2ffa8de"+"3348b3c1 856a429b f97e7e31 c2e5bd66"+"0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9"+"98f54449 579b4468 17afbd17 273e662c"+"97ee7299 5ef42640 c550b901 3fad0761"+"353c7086 a272c240 88be9476 9fd16650").replace(/ /g,""),"hex")}};e.exports={info:i,privInfo:o,hashAlgs:n,curves:s}},5514:function(e,t,a){e.exports=Certificate;var r=a(7179);var i=a(9392).Buffer;var o=a(6767);var n=a(6982);var s=a(2534);var c=a(1100);var u=a(8399);var l=a(9023);var p=a(4299);var f=a(6837);var m=a(3879);var h=a(5646);var g={};g["openssh"]=a(3082);g["x509"]=a(8709);g["pem"]=a(8706);var y=u.CertificateParseError;var b=u.InvalidAlgorithmError;function Certificate(e){r.object(e,"options");r.arrayOfObject(e.subjects,"options.subjects");p.assertCompatible(e.subjects[0],h,[1,0],"options.subjects");p.assertCompatible(e.subjectKey,f,[1,0],"options.subjectKey");p.assertCompatible(e.issuer,h,[1,0],"options.issuer");if(e.issuerKey!==undefined){p.assertCompatible(e.issuerKey,f,[1,0],"options.issuerKey")}r.object(e.signatures,"options.signatures");r.buffer(e.serial,"options.serial");r.date(e.validFrom,"options.validFrom");r.date(e.validUntil,"optons.validUntil");r.optionalArrayOfString(e.purposes,"options.purposes");this._hashCache={};this.subjects=e.subjects;this.issuer=e.issuer;this.subjectKey=e.subjectKey;this.issuerKey=e.issuerKey;this.signatures=e.signatures;this.serial=e.serial;this.validFrom=e.validFrom;this.validUntil=e.validUntil;this.purposes=e.purposes}Certificate.formats=g;Certificate.prototype.toBuffer=function(e,t){if(e===undefined)e="x509";r.string(e,"format");r.object(g[e],"formats[format]");r.optionalObject(t,"options");return g[e].write(this,t)};Certificate.prototype.toString=function(e,t){if(e===undefined)e="pem";return this.toBuffer(e,t).toString()};Certificate.prototype.fingerprint=function(e){if(e===undefined)e="sha256";r.string(e,"algorithm");var t={type:"certificate",hash:this.hash(e),algorithm:e};return new s(t)};Certificate.prototype.hash=function(e){r.string(e,"algorithm");e=e.toLowerCase();if(o.hashAlgs[e]===undefined)throw new b(e);if(this._hashCache[e])return this._hashCache[e];var t=n.createHash(e).update(this.toBuffer("x509")).digest();this._hashCache[e]=t;return t};Certificate.prototype.isExpired=function(e){if(e===undefined)e=new Date;return!(e.getTime()>=this.validFrom.getTime()&&e.getTime()<this.validUntil.getTime())};Certificate.prototype.isSignedBy=function(e){p.assertCompatible(e,Certificate,[1,0],"issuer");if(!this.issuer.equals(e.subjects[0]))return false;if(this.issuer.purposes&&this.issuer.purposes.length>0&&this.issuer.purposes.indexOf("ca")===-1){return false}return this.isSignedByKey(e.subjectKey)};Certificate.prototype.getExtension=function(e){r.string(e,"keyOrOid");var t=this.getExtensions().filter((function(t){if(t.format==="x509")return t.oid===e;if(t.format==="openssh")return t.name===e;return false}))[0];return t};Certificate.prototype.getExtensions=function(){var e=[];var t=this.signatures.x509;if(t&&t.extras&&t.extras.exts){t.extras.exts.forEach((function(t){t.format="x509";e.push(t)}))}var a=this.signatures.openssh;if(a&&a.exts){a.exts.forEach((function(t){t.format="openssh";e.push(t)}))}return e};Certificate.prototype.isSignedByKey=function(e){p.assertCompatible(e,f,[1,2],"issuerKey");if(this.issuerKey!==undefined){return this.issuerKey.fingerprint("sha512").matches(e)}var t=Object.keys(this.signatures)[0];var a=g[t].verify(this,e);if(a)this.issuerKey=e;return a};Certificate.prototype.signWith=function(e){p.assertCompatible(e,m,[1,2],"key");var t=Object.keys(g);var a=false;for(var r=0;r<t.length;++r){if(t[r]!=="pem"){var i=g[t[r]].sign(this,e);if(i===true)a=true}}if(!a){throw new Error("Failed to sign the certificate for any "+"available certificate formats")}};Certificate.createSelfSigned=function(e,t,a){var o;if(Array.isArray(e))o=e;else o=[e];r.arrayOfObject(o);o.forEach((function(e){p.assertCompatible(e,h,[1,0],"subject")}));p.assertCompatible(t,m,[1,2],"private key");r.optionalObject(a,"options");if(a===undefined)a={};r.optionalObject(a.validFrom,"options.validFrom");r.optionalObject(a.validUntil,"options.validUntil");var n=a.validFrom;var s=a.validUntil;if(n===undefined)n=new Date;if(s===undefined){r.optionalNumber(a.lifetime,"options.lifetime");var c=a.lifetime;if(c===undefined)c=10*365*24*3600;s=new Date;s.setTime(s.getTime()+c*1e3)}r.optionalBuffer(a.serial,"options.serial");var u=a.serial;if(u===undefined)u=i.from("0000000000000001","hex");var l=a.purposes;if(l===undefined)l=[];if(l.indexOf("signature")===-1)l.push("signature");if(l.indexOf("ca")===-1)l.push("ca");if(l.indexOf("crl")===-1)l.push("crl");if(l.length<=3){var f=o.filter((function(e){return e.type==="host"}));var g=o.filter((function(e){return e.type==="user"}));if(f.length>0){if(l.indexOf("serverAuth")===-1)l.push("serverAuth")}if(g.length>0){if(l.indexOf("clientAuth")===-1)l.push("clientAuth")}if(g.length>0||f.length>0){if(l.indexOf("keyAgreement")===-1)l.push("keyAgreement");if(t.type==="rsa"&&l.indexOf("encryption")===-1)l.push("encryption")}}var y=new Certificate({subjects:o,issuer:o[0],subjectKey:t.toPublic(),issuerKey:t.toPublic(),signatures:{},serial:u,validFrom:n,validUntil:s,purposes:l});y.signWith(t);return y};Certificate.create=function(e,t,a,o,n){var s;if(Array.isArray(e))s=e;else s=[e];r.arrayOfObject(s);s.forEach((function(e){p.assertCompatible(e,h,[1,0],"subject")}));p.assertCompatible(t,f,[1,0],"key");if(m.isPrivateKey(t))t=t.toPublic();p.assertCompatible(a,h,[1,0],"issuer");p.assertCompatible(o,m,[1,2],"issuer key");r.optionalObject(n,"options");if(n===undefined)n={};r.optionalObject(n.validFrom,"options.validFrom");r.optionalObject(n.validUntil,"options.validUntil");var c=n.validFrom;var u=n.validUntil;if(c===undefined)c=new Date;if(u===undefined){r.optionalNumber(n.lifetime,"options.lifetime");var l=n.lifetime;if(l===undefined)l=10*365*24*3600;u=new Date;u.setTime(u.getTime()+l*1e3)}r.optionalBuffer(n.serial,"options.serial");var g=n.serial;if(g===undefined)g=i.from("0000000000000001","hex");var y=n.purposes;if(y===undefined)y=[];if(y.indexOf("signature")===-1)y.push("signature");if(n.ca===true){if(y.indexOf("ca")===-1)y.push("ca");if(y.indexOf("crl")===-1)y.push("crl")}var b=s.filter((function(e){return e.type==="host"}));var k=s.filter((function(e){return e.type==="user"}));if(b.length>0){if(y.indexOf("serverAuth")===-1)y.push("serverAuth")}if(k.length>0){if(y.indexOf("clientAuth")===-1)y.push("clientAuth")}if(k.length>0||b.length>0){if(y.indexOf("keyAgreement")===-1)y.push("keyAgreement");if(t.type==="rsa"&&y.indexOf("encryption")===-1)y.push("encryption")}var w=new Certificate({subjects:s,issuer:a,subjectKey:t,issuerKey:o.toPublic(),signatures:{},serial:g,validFrom:c,validUntil:u,purposes:y});w.signWith(o);return w};Certificate.parse=function(e,t,a){if(typeof e!=="string")r.buffer(e,"data");if(t===undefined)t="auto";r.string(t,"format");if(typeof a==="string")a={filename:a};r.optionalObject(a,"options");if(a===undefined)a={};r.optionalString(a.filename,"options.filename");if(a.filename===undefined)a.filename="(unnamed)";r.object(g[t],"formats[format]");try{var i=g[t].read(e,a);return i}catch(e){throw new y(a.filename,t,e)}};Certificate.isCertificate=function(e,t){return p.isCompatible(e,Certificate,t)};Certificate.prototype._sshpkApiVersion=[1,1];Certificate._oldVersionDetect=function(e){return[1,0]}},5857:function(e,t,a){e.exports={DiffieHellman:DiffieHellman,generateECDSA:generateECDSA,generateED25519:generateED25519};var r=a(7179);var i=a(6982);var o=a(9392).Buffer;var n=a(6767);var s=a(4299);var c=a(7567);var u=a(6837);var l=a(3879);var p=i.createECDH!==undefined;var f=a(2119);var m=a(2751);var h=a(9894).BigInteger;function DiffieHellman(e){s.assertCompatible(e,u,[1,4],"key");this._isPriv=l.isPrivateKey(e,[1,3]);this._algo=e.type;this._curve=e.curve;this._key=e;if(e.type==="dsa"){if(!p){throw new Error("Due to bugs in the node 0.10 "+"crypto API, node 0.12.x or later is required "+"to use DH")}this._dh=i.createDiffieHellman(e.part.p.data,undefined,e.part.g.data,undefined);this._p=e.part.p;this._g=e.part.g;if(this._isPriv)this._dh.setPrivateKey(e.part.x.data);this._dh.setPublicKey(e.part.y.data)}else if(e.type==="ecdsa"){if(!p){this._ecParams=new X9ECParameters(this._curve);if(this._isPriv){this._priv=new ECPrivate(this._ecParams,e.part.d.data)}return}var t={nistp256:"prime256v1",nistp384:"secp384r1",nistp521:"secp521r1"}[e.curve];this._dh=i.createECDH(t);if(typeof this._dh!=="object"||typeof this._dh.setPrivateKey!=="function"){p=false;DiffieHellman.call(this,e);return}if(this._isPriv)this._dh.setPrivateKey(e.part.d.data);this._dh.setPublicKey(e.part.Q.data)}else if(e.type==="curve25519"){if(this._isPriv){s.assertCompatible(e,l,[1,5],"key");this._priv=e.part.k.data}}else{throw new Error("DH not supported for "+e.type+" keys")}}DiffieHellman.prototype.getPublicKey=function(){if(this._isPriv)return this._key.toPublic();return this._key};DiffieHellman.prototype.getPrivateKey=function(){if(this._isPriv)return this._key;else return undefined};DiffieHellman.prototype.getKey=DiffieHellman.prototype.getPrivateKey;DiffieHellman.prototype._keyCheck=function(e,t){r.object(e,"key");if(!t)s.assertCompatible(e,l,[1,3],"key");s.assertCompatible(e,u,[1,4],"key");if(e.type!==this._algo){throw new Error("A "+e.type+" key cannot be used in "+this._algo+" Diffie-Hellman")}if(e.curve!==this._curve){throw new Error("A key from the "+e.curve+" curve "+"cannot be used with a "+this._curve+" Diffie-Hellman")}if(e.type==="dsa"){r.deepEqual(e.part.p,this._p,"DSA key prime does not match");r.deepEqual(e.part.g,this._g,"DSA key generator does not match")}};DiffieHellman.prototype.setKey=function(e){this._keyCheck(e);if(e.type==="dsa"){this._dh.setPrivateKey(e.part.x.data);this._dh.setPublicKey(e.part.y.data)}else if(e.type==="ecdsa"){if(p){this._dh.setPrivateKey(e.part.d.data);this._dh.setPublicKey(e.part.Q.data)}else{this._priv=new ECPrivate(this._ecParams,e.part.d.data)}}else if(e.type==="curve25519"){var t=e.part.k;if(!e.part.k)t=e.part.r;this._priv=t.data;if(this._priv[0]===0)this._priv=this._priv.slice(1);this._priv=this._priv.slice(0,32)}this._key=e;this._isPriv=true};DiffieHellman.prototype.setPrivateKey=DiffieHellman.prototype.setKey;DiffieHellman.prototype.computeSecret=function(e){this._keyCheck(e,true);if(!this._isPriv)throw new Error("DH exchange has not been initialized with "+"a private key yet");var t;if(this._algo==="dsa"){return this._dh.computeSecret(e.part.y.data)}else if(this._algo==="ecdsa"){if(p){return this._dh.computeSecret(e.part.Q.data)}else{t=new ECPublic(this._ecParams,e.part.Q.data);return this._priv.deriveSharedSecret(t)}}else if(this._algo==="curve25519"){t=e.part.A.data;while(t[0]===0&&t.length>32)t=t.slice(1);var a=this._priv;r.strictEqual(t.length,32);r.strictEqual(a.length,32);var i=c.box.before(new Uint8Array(t),new Uint8Array(a));return o.from(i)}throw new Error("Invalid algorithm: "+this._algo)};DiffieHellman.prototype.generateKey=function(){var e=[];var t,a;if(this._algo==="dsa"){this._dh.generateKeys();e.push({name:"p",data:this._p.data});e.push({name:"q",data:this._key.part.q.data});e.push({name:"g",data:this._g.data});e.push({name:"y",data:this._dh.getPublicKey()});e.push({name:"x",data:this._dh.getPrivateKey()});this._key=new l({type:"dsa",parts:e});this._isPriv=true;return this._key}else if(this._algo==="ecdsa"){if(p){this._dh.generateKeys();e.push({name:"curve",data:o.from(this._curve)});e.push({name:"Q",data:this._dh.getPublicKey()});e.push({name:"d",data:this._dh.getPrivateKey()});this._key=new l({type:"ecdsa",curve:this._curve,parts:e});this._isPriv=true;return this._key}else{var n=this._ecParams.getN();var s=new h(i.randomBytes(n.bitLength()));var u=n.subtract(h.ONE);t=s.mod(u).add(h.ONE);a=this._ecParams.getG().multiply(t);t=o.from(t.toByteArray());a=o.from(this._ecParams.getCurve().encodePointHex(a),"hex");this._priv=new ECPrivate(this._ecParams,t);e.push({name:"curve",data:o.from(this._curve)});e.push({name:"Q",data:a});e.push({name:"d",data:t});this._key=new l({type:"ecdsa",curve:this._curve,parts:e});this._isPriv=true;return this._key}}else if(this._algo==="curve25519"){var f=c.box.keyPair();t=o.from(f.secretKey);a=o.from(f.publicKey);t=o.concat([t,a]);r.strictEqual(t.length,64);r.strictEqual(a.length,32);e.push({name:"A",data:a});e.push({name:"k",data:t});this._key=new l({type:"curve25519",parts:e});this._isPriv=true;return this._key}throw new Error("Invalid algorithm: "+this._algo)};DiffieHellman.prototype.generateKeys=DiffieHellman.prototype.generateKey;function X9ECParameters(e){var t=n.curves[e];r.object(t);var a=new h(t.p);var i=new h(t.a);var o=new h(t.b);var s=new h(t.n);var c=h.ONE;var u=new m.ECCurveFp(a,i,o);var l=u.decodePointHex(t.G.toString("hex"));this.curve=u;this.g=l;this.n=s;this.h=c}X9ECParameters.prototype.getCurve=function(){return this.curve};X9ECParameters.prototype.getG=function(){return this.g};X9ECParameters.prototype.getN=function(){return this.n};X9ECParameters.prototype.getH=function(){return this.h};function ECPublic(e,t){this._params=e;if(t[0]===0)t=t.slice(1);this._pub=e.getCurve().decodePointHex(t.toString("hex"))}function ECPrivate(e,t){this._params=e;this._priv=new h(s.mpNormalize(t))}ECPrivate.prototype.deriveSharedSecret=function(e){r.ok(e instanceof ECPublic);var t=e._pub.multiply(this._priv);return o.from(t.getX().toBigInteger().toByteArray())};function generateED25519(){var e=c.sign.keyPair();var t=o.from(e.secretKey);var a=o.from(e.publicKey);r.strictEqual(t.length,64);r.strictEqual(a.length,32);var i=[];i.push({name:"A",data:a});i.push({name:"k",data:t.slice(0,32)});var n=new l({type:"ed25519",parts:i});return n}function generateECDSA(e){var t=[];var a;if(p){var r={nistp256:"prime256v1",nistp384:"secp384r1",nistp521:"secp521r1"}[e];var n=i.createECDH(r);n.generateKeys();t.push({name:"curve",data:o.from(e)});t.push({name:"Q",data:n.getPublicKey()});t.push({name:"d",data:n.getPrivateKey()});a=new l({type:"ecdsa",curve:e,parts:t});return a}else{var s=new X9ECParameters(e);var c=s.getN();var u=Math.ceil((c.bitLength()+64)/8);var f=new h(i.randomBytes(u));var m=c.subtract(h.ONE);var g=f.mod(m).add(h.ONE);var y=s.getG().multiply(g);g=o.from(g.toByteArray());y=o.from(s.getCurve().encodePointHex(y),"hex");t.push({name:"curve",data:o.from(e)});t.push({name:"Q",data:y});t.push({name:"d",data:g});a=new l({type:"ecdsa",curve:e,parts:t});return a}}},4436:function(e,t,a){e.exports={Verifier:Verifier,Signer:Signer};var r=a(7567);var i=a(2203);var o=a(9023);var n=a(7179);var s=a(9392).Buffer;var c=a(1100);function Verifier(e,t){if(t.toLowerCase()!=="sha512")throw new Error("ED25519 only supports the use of "+"SHA-512 hashes");this.key=e;this.chunks=[];i.Writable.call(this,{})}o.inherits(Verifier,i.Writable);Verifier.prototype._write=function(e,t,a){this.chunks.push(e);a()};Verifier.prototype.update=function(e){if(typeof e==="string")e=s.from(e,"binary");this.chunks.push(e)};Verifier.prototype.verify=function(e,t){var a;if(c.isSignature(e,[2,0])){if(e.type!=="ed25519")return false;a=e.toBuffer("raw")}else if(typeof e==="string"){a=s.from(e,"base64")}else if(c.isSignature(e,[1,0])){throw new Error("signature was created by too old "+"a version of sshpk and cannot be verified")}n.buffer(a);return r.sign.detached.verify(new Uint8Array(s.concat(this.chunks)),new Uint8Array(a),new Uint8Array(this.key.part.A.data))};function Signer(e,t){if(t.toLowerCase()!=="sha512")throw new Error("ED25519 only supports the use of "+"SHA-512 hashes");this.key=e;this.chunks=[];i.Writable.call(this,{})}o.inherits(Signer,i.Writable);Signer.prototype._write=function(e,t,a){this.chunks.push(e);a()};Signer.prototype.update=function(e){if(typeof e==="string")e=s.from(e,"binary");this.chunks.push(e)};Signer.prototype.sign=function(){var e=r.sign.detached(new Uint8Array(s.concat(this.chunks)),new Uint8Array(s.concat([this.key.part.k.data,this.key.part.A.data])));var t=s.from(e);var a=c.parse(t,"ed25519","raw");a.hashAlgorithm="sha512";return a}},8399:function(e,t,a){var r=a(7179);var i=a(9023);function FingerprintFormatError(e,t){if(Error.captureStackTrace)Error.captureStackTrace(this,FingerprintFormatError);this.name="FingerprintFormatError";this.fingerprint=e;this.format=t;this.message="Fingerprint format is not supported, or is invalid: ";if(e!==undefined)this.message+=" fingerprint = "+e;if(t!==undefined)this.message+=" format = "+t}i.inherits(FingerprintFormatError,Error);function InvalidAlgorithmError(e){if(Error.captureStackTrace)Error.captureStackTrace(this,InvalidAlgorithmError);this.name="InvalidAlgorithmError";this.algorithm=e;this.message='Algorithm "'+e+'" is not supported'}i.inherits(InvalidAlgorithmError,Error);function KeyParseError(e,t,a){if(Error.captureStackTrace)Error.captureStackTrace(this,KeyParseError);this.name="KeyParseError";this.format=t;this.keyName=e;this.innerErr=a;this.message="Failed to parse "+e+" as a valid "+t+" format key: "+a.message}i.inherits(KeyParseError,Error);function SignatureParseError(e,t,a){if(Error.captureStackTrace)Error.captureStackTrace(this,SignatureParseError);this.name="SignatureParseError";this.type=e;this.format=t;this.innerErr=a;this.message="Failed to parse the given data as a "+e+" signature in "+t+" format: "+a.message}i.inherits(SignatureParseError,Error);function CertificateParseError(e,t,a){if(Error.captureStackTrace)Error.captureStackTrace(this,CertificateParseError);this.name="CertificateParseError";this.format=t;this.certName=e;this.innerErr=a;this.message="Failed to parse "+e+" as a valid "+t+" format certificate: "+a.message}i.inherits(CertificateParseError,Error);function KeyEncryptedError(e,t){if(Error.captureStackTrace)Error.captureStackTrace(this,KeyEncryptedError);this.name="KeyEncryptedError";this.format=t;this.keyName=e;this.message="The "+t+" format key "+e+" is "+"encrypted (password-protected), and no passphrase was "+"provided in `options`"}i.inherits(KeyEncryptedError,Error);e.exports={FingerprintFormatError:FingerprintFormatError,InvalidAlgorithmError:InvalidAlgorithmError,KeyParseError:KeyParseError,SignatureParseError:SignatureParseError,KeyEncryptedError:KeyEncryptedError,CertificateParseError:CertificateParseError}},2534:function(e,t,a){e.exports=Fingerprint;var r=a(7179);var i=a(9392).Buffer;var o=a(6767);var n=a(6982);var s=a(8399);var c=a(6837);var u=a(3879);var l=a(5514);var p=a(4299);var f=s.FingerprintFormatError;var m=s.InvalidAlgorithmError;function Fingerprint(e){r.object(e,"options");r.string(e.type,"options.type");r.buffer(e.hash,"options.hash");r.string(e.algorithm,"options.algorithm");this.algorithm=e.algorithm.toLowerCase();if(o.hashAlgs[this.algorithm]!==true)throw new m(this.algorithm);this.hash=e.hash;this.type=e.type;this.hashType=e.hashType}Fingerprint.prototype.toString=function(e){if(e===undefined){if(this.algorithm==="md5"||this.hashType==="spki")e="hex";else e="base64"}r.string(e);switch(e){case"hex":if(this.hashType==="spki")return this.hash.toString("hex");return addColons(this.hash.toString("hex"));case"base64":if(this.hashType==="spki")return this.hash.toString("base64");return sshBase64Format(this.algorithm,this.hash.toString("base64"));default:throw new f(undefined,e)}};Fingerprint.prototype.matches=function(e){r.object(e,"key or certificate");if(this.type==="key"&&this.hashType!=="ssh"){p.assertCompatible(e,c,[1,7],"key with spki");if(u.isPrivateKey(e)){p.assertCompatible(e,u,[1,6],"privatekey with spki support")}}else if(this.type==="key"){p.assertCompatible(e,c,[1,0],"key")}else{p.assertCompatible(e,l,[1,0],"certificate")}var t=e.hash(this.algorithm,this.hashType);var a=n.createHash(this.algorithm).update(t).digest("base64");if(this.hash2===undefined)this.hash2=n.createHash(this.algorithm).update(this.hash).digest("base64");return this.hash2===a};var h=/^[A-Za-z0-9+\/=]+$/;var g=/^[a-fA-F0-9]+$/;Fingerprint.parse=function(e,t){r.string(e,"fingerprint");var a,n,s;if(Array.isArray(t)){s=t;t={}}r.optionalObject(t,"options");if(t===undefined)t={};if(t.enAlgs!==undefined)s=t.enAlgs;if(t.algorithms!==undefined)s=t.algorithms;r.optionalArrayOfString(s,"algorithms");var c="ssh";if(t.hashType!==undefined)c=t.hashType;r.string(c,"options.hashType");var u=e.split(":");if(u.length==2){a=u[0].toLowerCase();if(!h.test(u[1]))throw new f(e);try{n=i.from(u[1],"base64")}catch(t){throw new f(e)}}else if(u.length>2){a="md5";if(u[0].toLowerCase()==="md5")u=u.slice(1);u=u.map((function(t){while(t.length<2)t="0"+t;if(t.length>2)throw new f(e);return t}));u=u.join("");if(!g.test(u)||u.length%2!==0)throw new f(e);try{n=i.from(u,"hex")}catch(t){throw new f(e)}}else{if(g.test(e)){n=i.from(e,"hex")}else if(h.test(e)){n=i.from(e,"base64")}else{throw new f(e)}switch(n.length){case 32:a="sha256";break;case 16:a="md5";break;case 20:a="sha1";break;case 64:a="sha512";break;default:throw new f(e)}if(t.hashType===undefined)c="spki"}if(a===undefined)throw new f(e);if(o.hashAlgs[a]===undefined)throw new m(a);if(s!==undefined){s=s.map((function(e){return e.toLowerCase()}));if(s.indexOf(a)===-1)throw new m(a)}return new Fingerprint({algorithm:a,hash:n,type:t.type||"key",hashType:c})};function addColons(e){return e.replace(/(.{2})(?=.)/g,"$1:")}function base64Strip(e){return e.replace(/=*$/,"")}function sshBase64Format(e,t){return e.toUpperCase()+":"+base64Strip(t)}Fingerprint.isFingerprint=function(e,t){return p.isCompatible(e,Fingerprint,t)};Fingerprint.prototype._sshpkApiVersion=[1,2];Fingerprint._oldVersionDetect=function(e){r.func(e.toString);r.func(e.matches);return[1,0]}},4842:function(e,t,a){e.exports={read:read,write:write};var r=a(7179);var i=a(9392).Buffer;var o=a(4299);var n=a(6837);var s=a(3879);var c=a(1679);var u=a(8259);var l=a(1758);var p=a(1265);var f=a(5595);var m="Private-key-format: v1";function read(e,t){if(typeof e==="string"){if(e.trim().match(/^[-]+[ ]*BEGIN/))return c.read(e,t);if(e.match(/^\s*ssh-[a-z]/))return u.read(e,t);if(e.match(/^\s*ecdsa-/))return u.read(e,t);if(e.match(/^putty-user-key-file-2:/i))return f.read(e,t);if(findDNSSECHeader(e))return p.read(e,t);e=i.from(e,"binary")}else{r.buffer(e);if(findPEMHeader(e))return c.read(e,t);if(findSSHHeader(e))return u.read(e,t);if(findPuTTYHeader(e))return f.read(e,t);if(findDNSSECHeader(e))return p.read(e,t)}if(e.readUInt32BE(0)<e.length)return l.read(e,t);throw new Error("Failed to auto-detect format of key")}function findPuTTYHeader(e){var t=0;while(t<e.length&&(e[t]===32||e[t]===10||e[t]===9))++t;if(t+22<=e.length&&e.slice(t,t+22).toString("ascii").toLowerCase()==="putty-user-key-file-2:")return true;return false}function findSSHHeader(e){var t=0;while(t<e.length&&(e[t]===32||e[t]===10||e[t]===9))++t;if(t+4<=e.length&&e.slice(t,t+4).toString("ascii")==="ssh-")return true;if(t+6<=e.length&&e.slice(t,t+6).toString("ascii")==="ecdsa-")return true;return false}function findPEMHeader(e){var t=0;while(t<e.length&&(e[t]===32||e[t]===10))++t;if(e[t]!==45)return false;while(t<e.length&&e[t]===45)++t;while(t<e.length&&e[t]===32)++t;if(t+5>e.length||e.slice(t,t+5).toString("ascii")!=="BEGIN")return false;return true}function findDNSSECHeader(e){if(e.length<=m.length)return false;var t=e.slice(0,m.length);if(t.toString("ascii")===m)return true;if(typeof e!=="string"){e=e.toString("ascii")}var a=e.split("\n");var r=0;while(a[r].match(/^\;/))r++;if(a[r].toString("ascii").match(/\. IN KEY /))return true;if(a[r].toString("ascii").match(/\. IN DNSKEY /))return true;return false}function write(e,t){throw new Error('"auto" format cannot be used for writing')}},1265:function(e,t,a){e.exports={read:read,write:write};var r=a(7179);var i=a(9392).Buffer;var o=a(6837);var n=a(3879);var s=a(4299);var c=a(6635);var u=a(5857);var l={"rsa-sha1":5,"rsa-sha256":8,"rsa-sha512":10,"ecdsa-p256-sha256":13,"ecdsa-p384-sha384":14};var p={};Object.keys(l).forEach((function(e){p[l[e]]=e.toUpperCase()}));function read(e,t){if(typeof e!=="string"){r.buffer(e,"buf");e=e.toString("ascii")}var a=e.split("\n");if(a[0].match(/^Private-key-format\: v1/)){var i=a[1].split(" ");var o=parseInt(i[1],10);var n=i[2];if(!p[o])throw new Error("Unsupported algorithm: "+n);return readDNSSECPrivateKey(o,a.slice(2))}var s=0;while(a[s].match(/^\;/))s++;if((a[s].match(/\. IN KEY /)||a[s].match(/\. IN DNSKEY /))&&a[s+1].length===0){return readRFC3110(a[s])}throw new Error("Cannot parse dnssec key")}function readRFC3110(e){var t=e.split(" ");var a=parseInt(t[5],10);if(!p[a])throw new Error("Unsupported algorithm: "+a);var r=t.slice(6,t.length).join();var n=i.from(r,"base64");if(p[a].match(/^RSA-/)){var c=n.readUInt8(0);if(c!=3&&c!=1)throw new Error("Cannot parse dnssec key: "+"unsupported exponent length");var u=n.slice(1,c+1);u=s.mpNormalize(u);var l=n.slice(1+c);l=s.mpNormalize(l);var f={type:"rsa",parts:[]};f.parts.push({name:"e",data:u});f.parts.push({name:"n",data:l});return new o(f)}if(p[a]==="ECDSA-P384-SHA384"||p[a]==="ECDSA-P256-SHA256"){var m="nistp384";var h=384;if(p[a].match(/^ECDSA-P256-SHA256/)){m="nistp256";h=256}var g={type:"ecdsa",curve:m,size:h,parts:[{name:"curve",data:i.from(m)},{name:"Q",data:s.ecNormalize(n)}]};return new o(g)}throw new Error("Unsupported algorithm: "+p[a])}function elementToBuf(e){return i.from(e.split(" ")[1],"base64")}function readDNSSECRSAPrivateKey(e){var t={};e.forEach((function(e){if(e.split(" ")[0]==="Modulus:")t["n"]=elementToBuf(e);else if(e.split(" ")[0]==="PublicExponent:")t["e"]=elementToBuf(e);else if(e.split(" ")[0]==="PrivateExponent:")t["d"]=elementToBuf(e);else if(e.split(" ")[0]==="Prime1:")t["p"]=elementToBuf(e);else if(e.split(" ")[0]==="Prime2:")t["q"]=elementToBuf(e);else if(e.split(" ")[0]==="Exponent1:")t["dmodp"]=elementToBuf(e);else if(e.split(" ")[0]==="Exponent2:")t["dmodq"]=elementToBuf(e);else if(e.split(" ")[0]==="Coefficient:")t["iqmp"]=elementToBuf(e)}));var a={type:"rsa",parts:[{name:"e",data:s.mpNormalize(t["e"])},{name:"n",data:s.mpNormalize(t["n"])},{name:"d",data:s.mpNormalize(t["d"])},{name:"p",data:s.mpNormalize(t["p"])},{name:"q",data:s.mpNormalize(t["q"])},{name:"dmodp",data:s.mpNormalize(t["dmodp"])},{name:"dmodq",data:s.mpNormalize(t["dmodq"])},{name:"iqmp",data:s.mpNormalize(t["iqmp"])}]};return new n(a)}function readDNSSECPrivateKey(e,t){if(p[e].match(/^RSA-/)){return readDNSSECRSAPrivateKey(t)}if(p[e]==="ECDSA-P384-SHA384"||p[e]==="ECDSA-P256-SHA256"){var a=i.from(t[0].split(" ")[1],"base64");var r="nistp384";var o=384;if(p[e]==="ECDSA-P256-SHA256"){r="nistp256";o=256}var c=s.publicFromPrivateECDSA(r,a);var u=c.part["Q"].data;var l={type:"ecdsa",curve:r,size:o,parts:[{name:"curve",data:i.from(r)},{name:"d",data:a},{name:"Q",data:u}]};return new n(l)}throw new Error("Unsupported algorithm: "+p[e])}function dnssecTimestamp(e){var t=e.getFullYear()+"";var a=e.getMonth()+1;var r=t+a+e.getUTCDate();r+=""+e.getUTCHours()+e.getUTCMinutes();r+=e.getUTCSeconds();return r}function rsaAlgFromOptions(e){if(!e||!e.hashAlgo||e.hashAlgo==="sha1")return"5 (RSASHA1)";else if(e.hashAlgo==="sha256")return"8 (RSASHA256)";else if(e.hashAlgo==="sha512")return"10 (RSASHA512)";else throw new Error("Unknown or unsupported hash: "+e.hashAlgo)}function writeRSA(e,t){if(!e.part.dmodp||!e.part.dmodq){s.addRSAMissing(e)}var a="";a+="Private-key-format: v1.3\n";a+="Algorithm: "+rsaAlgFromOptions(t)+"\n";var r=s.mpDenormalize(e.part["n"].data);a+="Modulus: "+r.toString("base64")+"\n";var o=s.mpDenormalize(e.part["e"].data);a+="PublicExponent: "+o.toString("base64")+"\n";var n=s.mpDenormalize(e.part["d"].data);a+="PrivateExponent: "+n.toString("base64")+"\n";var c=s.mpDenormalize(e.part["p"].data);a+="Prime1: "+c.toString("base64")+"\n";var u=s.mpDenormalize(e.part["q"].data);a+="Prime2: "+u.toString("base64")+"\n";var l=s.mpDenormalize(e.part["dmodp"].data);a+="Exponent1: "+l.toString("base64")+"\n";var p=s.mpDenormalize(e.part["dmodq"].data);a+="Exponent2: "+p.toString("base64")+"\n";var f=s.mpDenormalize(e.part["iqmp"].data);a+="Coefficient: "+f.toString("base64")+"\n";var m=new Date;a+="Created: "+dnssecTimestamp(m)+"\n";a+="Publish: "+dnssecTimestamp(m)+"\n";a+="Activate: "+dnssecTimestamp(m)+"\n";return i.from(a,"ascii")}function writeECDSA(e,t){var a="";a+="Private-key-format: v1.3\n";if(e.curve==="nistp256"){a+="Algorithm: 13 (ECDSAP256SHA256)\n"}else if(e.curve==="nistp384"){a+="Algorithm: 14 (ECDSAP384SHA384)\n"}else{throw new Error("Unsupported curve")}var r=e.part["d"].data.toString("base64");a+="PrivateKey: "+r+"\n";var o=new Date;a+="Created: "+dnssecTimestamp(o)+"\n";a+="Publish: "+dnssecTimestamp(o)+"\n";a+="Activate: "+dnssecTimestamp(o)+"\n";return i.from(a,"ascii")}function write(e,t){if(n.isPrivateKey(e)){if(e.type==="rsa"){return writeRSA(e,t)}else if(e.type==="ecdsa"){return writeECDSA(e,t)}else{throw new Error("Unsupported algorithm: "+e.type)}}else if(o.isKey(e)){throw new Error('Format "dnssec" only supports '+"writing private keys")}else{throw new Error("key is not a Key or PrivateKey")}}},3082:function(e,t,a){e.exports={read:read,verify:verify,sign:sign,signAsync:signAsync,write:write,fromBuffer:fromBuffer,toBuffer:toBuffer};var r=a(7179);var i=a(6635);var o=a(6982);var n=a(9392).Buffer;var s=a(6767);var c=a(6837);var u=a(3879);var l=a(5646);var p=a(1758);var f=a(1100);var m=a(4299);var h=a(5514);function verify(e,t){return false}var g={user:1,host:2};Object.keys(g).forEach((function(e){g[g[e]]=e}));var y=/^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;function read(e,t){if(n.isBuffer(e))e=e.toString("ascii");var a=e.trim().split(/[ \t\n]+/g);if(a.length<2||a.length>3)throw new Error("Not a valid SSH certificate line");var r=a[0];var i=a[1];i=n.from(i,"base64");return fromBuffer(i,r)}function fromBuffer(e,t,a){var o=new i({buffer:e});var n=o.readString();if(t!==undefined&&n!==t)throw new Error("SSH certificate algorithm mismatch");if(t===undefined)t=n;var u={};u.signatures={};u.signatures.openssh={};u.signatures.openssh.nonce=o.readBuffer();var b={};var k=b.parts=[];b.type=getAlg(t);var w=s.info[b.type].parts.length;while(k.length<w)k.push(o.readPart());r.ok(k.length>=1,"key must have at least one part");var x=s.info[b.type];if(b.type==="ecdsa"){var j=y.exec(t);r.ok(j!==null);r.strictEqual(j[1],k[0].data.toString())}for(var P=0;P<x.parts.length;++P){k[P].name=x.parts[P];if(k[P].name!=="curve"&&x.normalize!==false){var C=k[P];C.data=m.mpNormalize(C.data)}}u.subjectKey=new c(b);u.serial=o.readInt64();var I=g[o.readInt()];r.string(I,"valid cert type");u.signatures.openssh.keyId=o.readString();var z=[];var O=o.readBuffer();var q=new i({buffer:O});while(!q.atEnd())z.push(q.readString());if(z.length===0)z=["*"];u.subjects=z.map((function(e){if(I==="user")return l.forUser(e);else if(I==="host")return l.forHost(e);throw new Error("Unknown identity type "+I)}));u.validFrom=int64ToDate(o.readInt64());u.validUntil=int64ToDate(o.readInt64());var H=[];var V=new i({buffer:o.readBuffer()});var G;while(!V.atEnd()){G={critical:true};G.name=V.readString();G.data=V.readBuffer();H.push(G)}V=new i({buffer:o.readBuffer()});while(!V.atEnd()){G={critical:false};G.name=V.readString();G.data=V.readBuffer();H.push(G)}u.signatures.openssh.exts=H;o.readBuffer();var X=o.readBuffer();u.issuerKey=p.read(X);u.issuer=l.forHost("**");var W=o.readBuffer();u.signatures.openssh.signature=f.parse(W,u.issuerKey.type,"ssh");if(a!==undefined){a.remainder=o.remainder();a.consumed=o._offset}return new h(u)}function int64ToDate(e){var t=e.readUInt32BE(0)*4294967296;t+=e.readUInt32BE(4);var a=new Date;a.setTime(t*1e3);a.sourceInt64=e;return a}function dateToInt64(e){if(e.sourceInt64!==undefined)return e.sourceInt64;var t=Math.round(e.getTime()/1e3);var a=Math.floor(t/4294967296);var r=Math.floor(t%4294967296);var i=n.alloc(8);i.writeUInt32BE(a,0);i.writeUInt32BE(r,4);return i}function sign(e,t){if(e.signatures.openssh===undefined)e.signatures.openssh={};try{var a=toBuffer(e,true)}catch(t){delete e.signatures.openssh;return false}var r=e.signatures.openssh;var i=undefined;if(t.type==="rsa"||t.type==="dsa")i="sha1";var o=t.createSign(i);o.write(a);r.signature=o.sign();return true}function signAsync(e,t,a){if(e.signatures.openssh===undefined)e.signatures.openssh={};try{var r=toBuffer(e,true)}catch(t){delete e.signatures.openssh;a(t);return}var i=e.signatures.openssh;t(r,(function(e,t){if(e){a(e);return}try{t.toBuffer("ssh")}catch(e){a(e);return}i.signature=t;a()}))}function write(e,t){if(t===undefined)t={};var a=toBuffer(e);var r=getCertType(e.subjectKey)+" "+a.toString("base64");if(t.comment)r=r+" "+t.comment;return r}function toBuffer(e,t){r.object(e.signatures.openssh,"signature for openssh format");var a=e.signatures.openssh;if(a.nonce===undefined)a.nonce=o.randomBytes(16);var c=new i({});c.writeString(getCertType(e.subjectKey));c.writeBuffer(a.nonce);var u=e.subjectKey;var l=s.info[u.type];l.parts.forEach((function(e){c.writePart(u.part[e])}));c.writeInt64(e.serial);var f=e.subjects[0].type;r.notStrictEqual(f,"unknown");e.subjects.forEach((function(e){r.strictEqual(e.type,f)}));f=g[f];c.writeInt(f);if(a.keyId===undefined){a.keyId=e.subjects[0].type+"_"+(e.subjects[0].uid||e.subjects[0].hostname)}c.writeString(a.keyId);var m=new i({});e.subjects.forEach((function(e){if(f===g.host)m.writeString(e.hostname);else if(f===g.user)m.writeString(e.uid)}));c.writeBuffer(m.toBuffer());c.writeInt64(dateToInt64(e.validFrom));c.writeInt64(dateToInt64(e.validUntil));var h=a.exts;if(h===undefined)h=[];var y=new i({});h.forEach((function(e){if(e.critical!==true)return;y.writeString(e.name);y.writeBuffer(e.data)}));c.writeBuffer(y.toBuffer());y=new i({});h.forEach((function(e){if(e.critical===true)return;y.writeString(e.name);y.writeBuffer(e.data)}));c.writeBuffer(y.toBuffer());c.writeBuffer(n.alloc(0));m=p.write(e.issuerKey);c.writeBuffer(m);if(!t)c.writeBuffer(a.signature.toBuffer("ssh"));return c.toBuffer()}function getAlg(e){if(e==="ssh-rsa-cert-v01@openssh.com")return"rsa";if(e==="ssh-dss-cert-v01@openssh.com")return"dsa";if(e.match(y))return"ecdsa";if(e==="ssh-ed25519-cert-v01@openssh.com")return"ed25519";throw new Error("Unsupported cert type "+e)}function getCertType(e){if(e.type==="rsa")return"ssh-rsa-cert-v01@openssh.com";if(e.type==="dsa")return"ssh-dss-cert-v01@openssh.com";if(e.type==="ecdsa")return"ecdsa-sha2-"+e.curve+"-cert-v01@openssh.com";if(e.type==="ed25519")return"ssh-ed25519-cert-v01@openssh.com";throw new Error("Unsupported key type "+e.type)}},1679:function(e,t,a){e.exports={read:read,write:write};var r=a(7179);var i=a(1594);var o=a(6982);var n=a(9392).Buffer;var s=a(6767);var c=a(4299);var u=a(6837);var l=a(3879);var p=a(7895);var f=a(6696);var m=a(6073);var h=a(1758);var g=a(8399);var y="1.2.840.113549.1.5.13";var b="1.2.840.113549.1.5.12";var k={"1.2.840.113549.3.7":"3des-cbc","2.16.840.1.101.3.4.1.2":"aes128-cbc","2.16.840.1.101.3.4.1.42":"aes256-cbc"};var w={};Object.keys(k).forEach((function(e){w[k[e]]=e}));var x={"1.2.840.113549.2.7":"sha1","1.2.840.113549.2.9":"sha256","1.2.840.113549.2.11":"sha512"};var j={};Object.keys(x).forEach((function(e){j[x[e]]=e}));function read(e,t,a){var s=e;if(typeof e!=="string"){r.buffer(e,"buf");e=e.toString("ascii")}var u=e.trim().split(/[\r\n]+/g);var l;var w=-1;while(!l&&w<u.length){l=u[++w].match(/[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/)}r.ok(l,"invalid PEM header");var j;var P=u.length;while(!j&&P>0){j=u[--P].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/)}r.ok(j,"invalid PEM footer");r.equal(l[2],j[2]);var C=l[2].toLowerCase();var I;if(l[1]){r.equal(l[1],j[1],"PEM header and footer mismatch");I=l[1].trim()}u=u.slice(w,P+1);var z={};while(true){u=u.slice(1);l=u[0].match(/^([A-Za-z0-9-]+): (.+)$/);if(!l)break;z[l[1].toLowerCase()]=l[2]}u=u.slice(0,-1).join("");e=n.from(u,"base64");var O,q,H;if(z["proc-type"]){var V=z["proc-type"].split(",");if(V[0]==="4"&&V[1]==="ENCRYPTED"){if(typeof t.passphrase==="string"){t.passphrase=n.from(t.passphrase,"utf-8")}if(!n.isBuffer(t.passphrase)){throw new g.KeyEncryptedError(t.filename,"PEM")}else{V=z["dek-info"].split(",");r.ok(V.length===2);O=V[0].toLowerCase();H=n.from(V[1],"hex");q=c.opensslKeyDeriv(O,H,t.passphrase,1).key}}}if(I&&I.toLowerCase()==="encrypted"){var G=new i.BerReader(e);var X;G.readSequence();G.readSequence();X=G.offset+G.length;var W=G.readOID();if(W!==y){throw new Error("Unsupported PEM/PKCS8 encryption "+"scheme: "+W)}G.readSequence();G.readSequence();var Y=G.offset+G.length;var ee=G.readOID();if(ee!==b)throw new Error("Unsupported PBES2 KDF: "+ee);G.readSequence();var te=G.readString(i.Ber.OctetString,true);var ae=G.readInt();var re="sha1";if(G.offset<Y){G.readSequence();var ie=G.readOID();re=x[ie];if(re===undefined){throw new Error("Unsupported PBKDF2 hash: "+ie)}}G._offset=Y;G.readSequence();var oe=G.readOID();O=k[oe];if(O===undefined){throw new Error("Unsupported PBES2 cipher: "+oe)}H=G.readString(i.Ber.OctetString,true);G._offset=X;e=G.readString(i.Ber.OctetString,true);if(typeof t.passphrase==="string"){t.passphrase=n.from(t.passphrase,"utf-8")}if(!n.isBuffer(t.passphrase)){throw new g.KeyEncryptedError(t.filename,"PEM")}var ne=c.opensshCipherInfo(O);O=ne.opensslName;q=c.pbkdf2(re,te,ae,ne.keySize,t.passphrase);I=undefined}if(O&&q&&H){var se=o.createDecipheriv(O,q,H);var ce,ue=[];se.once("error",(function(e){if(e.toString().indexOf("bad decrypt")!==-1){throw new Error("Incorrect passphrase "+"supplied, could not decrypt key")}throw e}));se.write(e);se.end();while((ce=se.read())!==null)ue.push(ce);e=n.concat(ue)}if(I&&I.toLowerCase()==="openssh")return m.readSSHPrivate(C,e,t);if(I&&I.toLowerCase()==="ssh2")return h.readType(C,e,t);var le=new i.BerReader(e);le.originalInput=s;le.readSequence();if(I){if(a)r.strictEqual(a,"pkcs1");return p.readPkcs1(I,C,le)}else{if(a)r.strictEqual(a,"pkcs8");return f.readPkcs8(I,C,le)}}function write(e,t,a){r.object(e);var o={ecdsa:"EC",rsa:"RSA",dsa:"DSA",ed25519:"EdDSA"}[e.type];var s;var c=new i.BerWriter;if(l.isPrivateKey(e)){if(a&&a==="pkcs8"){s="PRIVATE KEY";f.writePkcs8(c,e)}else{if(a)r.strictEqual(a,"pkcs1");s=o+" PRIVATE KEY";p.writePkcs1(c,e)}}else if(u.isKey(e)){if(a&&a==="pkcs1"){s=o+" PUBLIC KEY";p.writePkcs1(c,e)}else{if(a)r.strictEqual(a,"pkcs8");s="PUBLIC KEY";f.writePkcs8(c,e)}}else{throw new Error("key is not a Key or PrivateKey")}var m=c.buffer.toString("base64");var h=m.length+m.length/64+18+16+s.length*2+10;var g=n.alloc(h);var y=0;y+=g.write("-----BEGIN "+s+"-----\n",y);for(var b=0;b<m.length;){var k=b+64;if(k>m.length)k=m.length;y+=g.write(m.slice(b,k),y);g[y++]=10;b=k}y+=g.write("-----END "+s+"-----\n",y);return g.slice(0,y)}},7895:function(e,t,a){e.exports={read:read,readPkcs1:readPkcs1,write:write,writePkcs1:writePkcs1};var r=a(7179);var i=a(1594);var o=a(9392).Buffer;var n=a(6767);var s=a(4299);var c=a(6837);var u=a(3879);var l=a(1679);var p=a(6696);var f=p.readECDSACurve;function read(e,t){return l.read(e,t,"pkcs1")}function write(e,t){return l.write(e,t,"pkcs1")}function readMPInt(e,t){r.strictEqual(e.peek(),i.Ber.Integer,t+" is not an Integer");return s.mpNormalize(e.readString(i.Ber.Integer,true))}function readPkcs1(e,t,a){switch(e){case"RSA":if(t==="public")return readPkcs1RSAPublic(a);else if(t==="private")return readPkcs1RSAPrivate(a);throw new Error("Unknown key type: "+t);case"DSA":if(t==="public")return readPkcs1DSAPublic(a);else if(t==="private")return readPkcs1DSAPrivate(a);throw new Error("Unknown key type: "+t);case"EC":case"ECDSA":if(t==="private")return readPkcs1ECDSAPrivate(a);else if(t==="public")return readPkcs1ECDSAPublic(a);throw new Error("Unknown key type: "+t);case"EDDSA":case"EdDSA":if(t==="private")return readPkcs1EdDSAPrivate(a);throw new Error(t+" keys not supported with EdDSA");default:throw new Error("Unknown key algo: "+e)}}function readPkcs1RSAPublic(e){var t=readMPInt(e,"modulus");var a=readMPInt(e,"exponent");var r={type:"rsa",parts:[{name:"e",data:a},{name:"n",data:t}]};return new c(r)}function readPkcs1RSAPrivate(e){var t=readMPInt(e,"version");r.strictEqual(t[0],0);var a=readMPInt(e,"modulus");var i=readMPInt(e,"public exponent");var o=readMPInt(e,"private exponent");var n=readMPInt(e,"prime1");var s=readMPInt(e,"prime2");var c=readMPInt(e,"exponent1");var l=readMPInt(e,"exponent2");var p=readMPInt(e,"iqmp");var f={type:"rsa",parts:[{name:"n",data:a},{name:"e",data:i},{name:"d",data:o},{name:"iqmp",data:p},{name:"p",data:n},{name:"q",data:s},{name:"dmodp",data:c},{name:"dmodq",data:l}]};return new u(f)}function readPkcs1DSAPrivate(e){var t=readMPInt(e,"version");r.strictEqual(t.readUInt8(0),0);var a=readMPInt(e,"p");var i=readMPInt(e,"q");var o=readMPInt(e,"g");var n=readMPInt(e,"y");var s=readMPInt(e,"x");var c={type:"dsa",parts:[{name:"p",data:a},{name:"q",data:i},{name:"g",data:o},{name:"y",data:n},{name:"x",data:s}]};return new u(c)}function readPkcs1EdDSAPrivate(e){var t=readMPInt(e,"version");r.strictEqual(t.readUInt8(0),1);var a=e.readString(i.Ber.OctetString,true);e.readSequence(160);var o=e.readOID();r.strictEqual(o,"1.3.101.112","the ed25519 curve identifier");e.readSequence(161);var n=s.readBitString(e);var c={type:"ed25519",parts:[{name:"A",data:s.zeroPadToLength(n,32)},{name:"k",data:a}]};return new u(c)}function readPkcs1DSAPublic(e){var t=readMPInt(e,"y");var a=readMPInt(e,"p");var r=readMPInt(e,"q");var i=readMPInt(e,"g");var o={type:"dsa",parts:[{name:"y",data:t},{name:"p",data:a},{name:"q",data:r},{name:"g",data:i}]};return new c(o)}function readPkcs1ECDSAPublic(e){e.readSequence();var t=e.readOID();r.strictEqual(t,"1.2.840.10045.2.1","must be ecPublicKey");var a=e.readOID();var u;var l=Object.keys(n.curves);for(var p=0;p<l.length;++p){var f=l[p];var m=n.curves[f];if(m.pkcs8oid===a){u=f;break}}r.string(u,"a known ECDSA named curve");var h=e.readString(i.Ber.BitString,true);h=s.ecNormalize(h);var g={type:"ecdsa",parts:[{name:"curve",data:o.from(u)},{name:"Q",data:h}]};return new c(g)}function readPkcs1ECDSAPrivate(e){var t=readMPInt(e,"version");r.strictEqual(t.readUInt8(0),1);var a=e.readString(i.Ber.OctetString,true);e.readSequence(160);var n=f(e);r.string(n,"a known elliptic curve");e.readSequence(161);var c=e.readString(i.Ber.BitString,true);c=s.ecNormalize(c);var l={type:"ecdsa",parts:[{name:"curve",data:o.from(n)},{name:"Q",data:c},{name:"d",data:a}]};return new u(l)}function writePkcs1(e,t){e.startSequence();switch(t.type){case"rsa":if(u.isPrivateKey(t))writePkcs1RSAPrivate(e,t);else writePkcs1RSAPublic(e,t);break;case"dsa":if(u.isPrivateKey(t))writePkcs1DSAPrivate(e,t);else writePkcs1DSAPublic(e,t);break;case"ecdsa":if(u.isPrivateKey(t))writePkcs1ECDSAPrivate(e,t);else writePkcs1ECDSAPublic(e,t);break;case"ed25519":if(u.isPrivateKey(t))writePkcs1EdDSAPrivate(e,t);else writePkcs1EdDSAPublic(e,t);break;default:throw new Error("Unknown key algo: "+t.type)}e.endSequence()}function writePkcs1RSAPublic(e,t){e.writeBuffer(t.part.n.data,i.Ber.Integer);e.writeBuffer(t.part.e.data,i.Ber.Integer)}function writePkcs1RSAPrivate(e,t){var a=o.from([0]);e.writeBuffer(a,i.Ber.Integer);e.writeBuffer(t.part.n.data,i.Ber.Integer);e.writeBuffer(t.part.e.data,i.Ber.Integer);e.writeBuffer(t.part.d.data,i.Ber.Integer);e.writeBuffer(t.part.p.data,i.Ber.Integer);e.writeBuffer(t.part.q.data,i.Ber.Integer);if(!t.part.dmodp||!t.part.dmodq)s.addRSAMissing(t);e.writeBuffer(t.part.dmodp.data,i.Ber.Integer);e.writeBuffer(t.part.dmodq.data,i.Ber.Integer);e.writeBuffer(t.part.iqmp.data,i.Ber.Integer)}function writePkcs1DSAPrivate(e,t){var a=o.from([0]);e.writeBuffer(a,i.Ber.Integer);e.writeBuffer(t.part.p.data,i.Ber.Integer);e.writeBuffer(t.part.q.data,i.Ber.Integer);e.writeBuffer(t.part.g.data,i.Ber.Integer);e.writeBuffer(t.part.y.data,i.Ber.Integer);e.writeBuffer(t.part.x.data,i.Ber.Integer)}function writePkcs1DSAPublic(e,t){e.writeBuffer(t.part.y.data,i.Ber.Integer);e.writeBuffer(t.part.p.data,i.Ber.Integer);e.writeBuffer(t.part.q.data,i.Ber.Integer);e.writeBuffer(t.part.g.data,i.Ber.Integer)}function writePkcs1ECDSAPublic(e,t){e.startSequence();e.writeOID("1.2.840.10045.2.1");var a=t.part.curve.data.toString();var o=n.curves[a].pkcs8oid;r.string(o,"a known ECDSA named curve");e.writeOID(o);e.endSequence();var c=s.ecNormalize(t.part.Q.data,true);e.writeBuffer(c,i.Ber.BitString)}function writePkcs1ECDSAPrivate(e,t){var a=o.from([1]);e.writeBuffer(a,i.Ber.Integer);e.writeBuffer(t.part.d.data,i.Ber.OctetString);e.startSequence(160);var c=t.part.curve.data.toString();var u=n.curves[c].pkcs8oid;r.string(u,"a known ECDSA named curve");e.writeOID(u);e.endSequence();e.startSequence(161);var l=s.ecNormalize(t.part.Q.data,true);e.writeBuffer(l,i.Ber.BitString);e.endSequence()}function writePkcs1EdDSAPrivate(e,t){var a=o.from([1]);e.writeBuffer(a,i.Ber.Integer);e.writeBuffer(t.part.k.data,i.Ber.OctetString);e.startSequence(160);e.writeOID("1.3.101.112");e.endSequence();e.startSequence(161);s.writeBitString(e,t.part.A.data);e.endSequence()}function writePkcs1EdDSAPublic(e,t){throw new Error("Public keys are not supported for EdDSA PKCS#1")}},6696:function(e,t,a){e.exports={read:read,readPkcs8:readPkcs8,write:write,writePkcs8:writePkcs8,pkcs8ToBuffer:pkcs8ToBuffer,readECDSACurve:readECDSACurve,writeECDSACurve:writeECDSACurve};var r=a(7179);var i=a(1594);var o=a(9392).Buffer;var n=a(6767);var s=a(4299);var c=a(6837);var u=a(3879);var l=a(1679);function read(e,t){return l.read(e,t,"pkcs8")}function write(e,t){return l.write(e,t,"pkcs8")}function readMPInt(e,t){r.strictEqual(e.peek(),i.Ber.Integer,t+" is not an Integer");return s.mpNormalize(e.readString(i.Ber.Integer,true))}function readPkcs8(e,t,a){if(a.peek()===i.Ber.Integer){r.strictEqual(t,"private","unexpected Integer at start of public key");a.readString(i.Ber.Integer,true)}a.readSequence();var o=a.offset+a.length;var n=a.readOID();switch(n){case"1.2.840.113549.1.1.1":a._offset=o;if(t==="public")return readPkcs8RSAPublic(a);else return readPkcs8RSAPrivate(a);case"1.2.840.10040.4.1":if(t==="public")return readPkcs8DSAPublic(a);else return readPkcs8DSAPrivate(a);case"1.2.840.10045.2.1":if(t==="public")return readPkcs8ECDSAPublic(a);else return readPkcs8ECDSAPrivate(a);case"1.3.101.112":if(t==="public"){return readPkcs8EdDSAPublic(a)}else{return readPkcs8EdDSAPrivate(a)}case"1.3.101.110":if(t==="public"){return readPkcs8X25519Public(a)}else{return readPkcs8X25519Private(a)}default:throw new Error("Unknown key type OID "+n)}}function readPkcs8RSAPublic(e){e.readSequence(i.Ber.BitString);e.readByte();e.readSequence();var t=readMPInt(e,"modulus");var a=readMPInt(e,"exponent");var r={type:"rsa",source:e.originalInput,parts:[{name:"e",data:a},{name:"n",data:t}]};return new c(r)}function readPkcs8RSAPrivate(e){e.readSequence(i.Ber.OctetString);e.readSequence();var t=readMPInt(e,"version");r.equal(t[0],0,"unknown RSA private key version");var a=readMPInt(e,"modulus");var o=readMPInt(e,"public exponent");var n=readMPInt(e,"private exponent");var s=readMPInt(e,"prime1");var c=readMPInt(e,"prime2");var l=readMPInt(e,"exponent1");var p=readMPInt(e,"exponent2");var f=readMPInt(e,"iqmp");var m={type:"rsa",parts:[{name:"n",data:a},{name:"e",data:o},{name:"d",data:n},{name:"iqmp",data:f},{name:"p",data:s},{name:"q",data:c},{name:"dmodp",data:l},{name:"dmodq",data:p}]};return new u(m)}function readPkcs8DSAPublic(e){e.readSequence();var t=readMPInt(e,"p");var a=readMPInt(e,"q");var r=readMPInt(e,"g");e.readSequence(i.Ber.BitString);e.readByte();var o=readMPInt(e,"y");var n={type:"dsa",parts:[{name:"p",data:t},{name:"q",data:a},{name:"g",data:r},{name:"y",data:o}]};return new c(n)}function readPkcs8DSAPrivate(e){e.readSequence();var t=readMPInt(e,"p");var a=readMPInt(e,"q");var r=readMPInt(e,"g");e.readSequence(i.Ber.OctetString);var o=readMPInt(e,"x");var n=s.calculateDSAPublic(r,t,o);var c={type:"dsa",parts:[{name:"p",data:t},{name:"q",data:a},{name:"g",data:r},{name:"y",data:n},{name:"x",data:o}]};return new u(c)}function readECDSACurve(e){var t,a;var c,u,l;if(e.peek()===i.Ber.OID){var p=e.readOID();a=Object.keys(n.curves);for(c=0;c<a.length;++c){u=a[c];l=n.curves[u];if(l.pkcs8oid===p){t=u;break}}}else{e.readSequence();var f=e.readString(i.Ber.Integer,true);r.strictEqual(f[0],1,"ECDSA key not version 1");var m={};e.readSequence();var h=e.readOID();r.strictEqual(h,"1.2.840.10045.1.1","ECDSA key is not from a prime-field");var g=m.p=s.mpNormalize(e.readString(i.Ber.Integer,true));m.size=g.length*8-s.countZeros(g);e.readSequence();m.a=s.mpNormalize(e.readString(i.Ber.OctetString,true));m.b=s.mpNormalize(e.readString(i.Ber.OctetString,true));if(e.peek()===i.Ber.BitString)m.s=e.readString(i.Ber.BitString,true);m.G=e.readString(i.Ber.OctetString,true);r.strictEqual(m.G[0],4,"uncompressed G is required");m.n=s.mpNormalize(e.readString(i.Ber.Integer,true));m.h=s.mpNormalize(e.readString(i.Ber.Integer,true));r.strictEqual(m.h[0],1,"a cofactor=1 curve is "+"required");a=Object.keys(n.curves);var y=Object.keys(m);for(c=0;c<a.length;++c){u=a[c];l=n.curves[u];var b=true;for(var k=0;k<y.length;++k){var w=y[k];if(l[w]===undefined)continue;if(typeof l[w]==="object"&&l[w].equals!==undefined){if(!l[w].equals(m[w])){b=false;break}}else if(o.isBuffer(l[w])){if(l[w].toString("binary")!==m[w].toString("binary")){b=false;break}}else{if(l[w]!==m[w]){b=false;break}}}if(b){t=u;break}}}return t}function readPkcs8ECDSAPrivate(e){var t=readECDSACurve(e);r.string(t,"a known elliptic curve");e.readSequence(i.Ber.OctetString);e.readSequence();var a=readMPInt(e,"version");r.equal(a[0],1,"unknown version of ECDSA key");var n=e.readString(i.Ber.OctetString,true);var c;if(e.peek()==160){e.readSequence(160);e._offset+=e.length}if(e.peek()==161){e.readSequence(161);c=e.readString(i.Ber.BitString,true);c=s.ecNormalize(c)}if(c===undefined){var l=s.publicFromPrivateECDSA(t,n);c=l.part.Q.data}var p={type:"ecdsa",parts:[{name:"curve",data:o.from(t)},{name:"Q",data:c},{name:"d",data:n}]};return new u(p)}function readPkcs8ECDSAPublic(e){var t=readECDSACurve(e);r.string(t,"a known elliptic curve");var a=e.readString(i.Ber.BitString,true);a=s.ecNormalize(a);var n={type:"ecdsa",parts:[{name:"curve",data:o.from(t)},{name:"Q",data:a}]};return new c(n)}function readPkcs8EdDSAPublic(e){if(e.peek()===0)e.readByte();var t=s.readBitString(e);var a={type:"ed25519",parts:[{name:"A",data:s.zeroPadToLength(t,32)}]};return new c(a)}function readPkcs8X25519Public(e){var t=s.readBitString(e);var a={type:"curve25519",parts:[{name:"A",data:s.zeroPadToLength(t,32)}]};return new c(a)}function readPkcs8EdDSAPrivate(e){if(e.peek()===0)e.readByte();e.readSequence(i.Ber.OctetString);var t=e.readString(i.Ber.OctetString,true);t=s.zeroPadToLength(t,32);var a,r;while((r=e.peek())!==null){if(r===(i.Ber.Context|1)){a=s.readBitString(e,r)}else{e.readSequence(r);e._offset+=e.length}}if(a===undefined)a=s.calculateED25519Public(t);var o={type:"ed25519",parts:[{name:"A",data:s.zeroPadToLength(a,32)},{name:"k",data:s.zeroPadToLength(t,32)}]};return new u(o)}function readPkcs8X25519Private(e){if(e.peek()===0)e.readByte();e.readSequence(i.Ber.OctetString);var t=e.readString(i.Ber.OctetString,true);t=s.zeroPadToLength(t,32);var a=s.calculateX25519Public(t);var r={type:"curve25519",parts:[{name:"A",data:s.zeroPadToLength(a,32)},{name:"k",data:s.zeroPadToLength(t,32)}]};return new u(r)}function pkcs8ToBuffer(e){var t=new i.BerWriter;writePkcs8(t,e);return t.buffer}function writePkcs8(e,t){e.startSequence();if(u.isPrivateKey(t)){var a=0;if(t.type==="ed25519")a=1;var r=o.from([a]);e.writeBuffer(r,i.Ber.Integer)}e.startSequence();switch(t.type){case"rsa":e.writeOID("1.2.840.113549.1.1.1");if(u.isPrivateKey(t))writePkcs8RSAPrivate(t,e);else writePkcs8RSAPublic(t,e);break;case"dsa":e.writeOID("1.2.840.10040.4.1");if(u.isPrivateKey(t))writePkcs8DSAPrivate(t,e);else writePkcs8DSAPublic(t,e);break;case"ecdsa":e.writeOID("1.2.840.10045.2.1");if(u.isPrivateKey(t))writePkcs8ECDSAPrivate(t,e);else writePkcs8ECDSAPublic(t,e);break;case"ed25519":e.writeOID("1.3.101.112");if(u.isPrivateKey(t))writePkcs8EdDSAPrivate(t,e);else writePkcs8EdDSAPublic(t,e);break;default:throw new Error("Unsupported key type: "+t.type)}e.endSequence()}function writePkcs8RSAPrivate(e,t){t.writeNull();t.endSequence();t.startSequence(i.Ber.OctetString);t.startSequence();var a=o.from([0]);t.writeBuffer(a,i.Ber.Integer);t.writeBuffer(e.part.n.data,i.Ber.Integer);t.writeBuffer(e.part.e.data,i.Ber.Integer);t.writeBuffer(e.part.d.data,i.Ber.Integer);t.writeBuffer(e.part.p.data,i.Ber.Integer);t.writeBuffer(e.part.q.data,i.Ber.Integer);if(!e.part.dmodp||!e.part.dmodq)s.addRSAMissing(e);t.writeBuffer(e.part.dmodp.data,i.Ber.Integer);t.writeBuffer(e.part.dmodq.data,i.Ber.Integer);t.writeBuffer(e.part.iqmp.data,i.Ber.Integer);t.endSequence();t.endSequence()}function writePkcs8RSAPublic(e,t){t.writeNull();t.endSequence();t.startSequence(i.Ber.BitString);t.writeByte(0);t.startSequence();t.writeBuffer(e.part.n.data,i.Ber.Integer);t.writeBuffer(e.part.e.data,i.Ber.Integer);t.endSequence();t.endSequence()}function writePkcs8DSAPrivate(e,t){t.startSequence();t.writeBuffer(e.part.p.data,i.Ber.Integer);t.writeBuffer(e.part.q.data,i.Ber.Integer);t.writeBuffer(e.part.g.data,i.Ber.Integer);t.endSequence();t.endSequence();t.startSequence(i.Ber.OctetString);t.writeBuffer(e.part.x.data,i.Ber.Integer);t.endSequence()}function writePkcs8DSAPublic(e,t){t.startSequence();t.writeBuffer(e.part.p.data,i.Ber.Integer);t.writeBuffer(e.part.q.data,i.Ber.Integer);t.writeBuffer(e.part.g.data,i.Ber.Integer);t.endSequence();t.endSequence();t.startSequence(i.Ber.BitString);t.writeByte(0);t.writeBuffer(e.part.y.data,i.Ber.Integer);t.endSequence()}function writeECDSACurve(e,t){var a=n.curves[e.curve];if(a.pkcs8oid){t.writeOID(a.pkcs8oid)}else{t.startSequence();var r=o.from([1]);t.writeBuffer(r,i.Ber.Integer);t.startSequence();t.writeOID("1.2.840.10045.1.1");t.writeBuffer(a.p,i.Ber.Integer);t.endSequence();t.startSequence();var s=a.p;if(s[0]===0)s=s.slice(1);t.writeBuffer(s,i.Ber.OctetString);t.writeBuffer(a.b,i.Ber.OctetString);t.writeBuffer(a.s,i.Ber.BitString);t.endSequence();t.writeBuffer(a.G,i.Ber.OctetString);t.writeBuffer(a.n,i.Ber.Integer);var c=a.h;if(!c){c=o.from([1])}t.writeBuffer(c,i.Ber.Integer);t.endSequence()}}function writePkcs8ECDSAPublic(e,t){writeECDSACurve(e,t);t.endSequence();var a=s.ecNormalize(e.part.Q.data,true);t.writeBuffer(a,i.Ber.BitString)}function writePkcs8ECDSAPrivate(e,t){writeECDSACurve(e,t);t.endSequence();t.startSequence(i.Ber.OctetString);t.startSequence();var a=o.from([1]);t.writeBuffer(a,i.Ber.Integer);t.writeBuffer(e.part.d.data,i.Ber.OctetString);t.startSequence(161);var r=s.ecNormalize(e.part.Q.data,true);t.writeBuffer(r,i.Ber.BitString);t.endSequence();t.endSequence();t.endSequence()}function writePkcs8EdDSAPublic(e,t){t.endSequence();s.writeBitString(t,e.part.A.data)}function writePkcs8EdDSAPrivate(e,t){t.endSequence();t.startSequence(i.Ber.OctetString);var a=s.mpNormalize(e.part.k.data);while(a.length>32&&a[0]===0)a=a.slice(1);t.writeBuffer(a,i.Ber.OctetString);t.endSequence();s.writeBitString(t,e.part.A.data,i.Ber.Context|1)}},5595:function(e,t,a){e.exports={read:read,write:write};var r=a(7179);var i=a(9392).Buffer;var o=a(1758);var n=a(6837);var s=a(6635);var c=a(6982);var u=a(3879);var l=a(8399);function read(e,t){var a=e.toString("ascii").split(/[\r\n]+/);var n=false;var p;var f=0;var m;while(f<a.length){p=splitHeader(a[f++]);if(p){m={"putty-user-key-file-2":2,"putty-user-key-file-3":3}[p[0].toLowerCase()];if(m){n=true;break}}}if(!n){throw new Error("No PuTTY format first line found")}var h=p[1];p=splitHeader(a[f++]);r.equal(p[0].toLowerCase(),"encryption");var g=p[1];p=splitHeader(a[f++]);r.equal(p[0].toLowerCase(),"comment");var y=p[1];p=splitHeader(a[f++]);r.equal(p[0].toLowerCase(),"public-lines");var b=parseInt(p[1],10);if(!isFinite(b)||b<0||b>a.length){throw new Error("Invalid public-lines count")}var k=i.from(a.slice(f,f+b).join(""),"base64");var w=o.algToKeyType(h);var x=o.read(k);if(x.type!==w){throw new Error("Outer key algorithm mismatch")}f+=b;if(a[f]){p=splitHeader(a[f++]);r.equal(p[0].toLowerCase(),"private-lines");var j=parseInt(p[1],10);if(!isFinite(j)||j<0||j>a.length){throw new Error("Invalid private-lines count")}var P=i.from(a.slice(f,f+j).join(""),"base64");if(g!=="none"&&m===3){throw new Error("Encrypted keys arenot supported for"+" PuTTY format version 3")}if(g==="aes256-cbc"){if(!t.passphrase){throw new l.KeyEncryptedError(t.filename,"PEM")}var C=i.alloc(16,0);var I=c.createDecipheriv("aes-256-cbc",derivePPK2EncryptionKey(t.passphrase),C);I.setAutoPadding(false);P=i.concat([I.update(P),I.final()])}x=new u(x);if(x.type!==w){throw new Error("Outer key algorithm mismatch")}var z=new s({buffer:P});var O;if(h==="ssh-dss"){O=[{name:"x",data:z.readBuffer()}]}else if(h==="ssh-rsa"){O=[{name:"d",data:z.readBuffer()},{name:"p",data:z.readBuffer()},{name:"q",data:z.readBuffer()},{name:"iqmp",data:z.readBuffer()}]}else if(h.match(/^ecdsa-sha2-nistp/)){O=[{name:"d",data:z.readBuffer()}]}else if(h==="ssh-ed25519"){O=[{name:"k",data:z.readBuffer()}]}else{throw new Error("Unsupported PPK key type: "+h)}x=new u({type:x.type,parts:x.parts.concat(O)})}x.comment=y;return x}function derivePPK2EncryptionKey(e){var t=c.createHash("sha1").update(i.concat([i.from([0,0,0,0]),i.from(e)])).digest();var a=c.createHash("sha1").update(i.concat([i.from([0,0,0,1]),i.from(e)])).digest();return i.concat([t,a]).slice(0,32)}function splitHeader(e){var t=e.indexOf(":");if(t===-1)return null;var a=e.slice(0,t);++t;while(e[t]===" ")++t;var r=e.slice(t);return[a,r]}function write(e,t){r.object(e);if(!n.isKey(e))throw new Error("Must be a public key");var a=o.keyTypeToAlg(e);var s=o.write(e);var c=e.comment||"";var u=s.toString("base64");var l=wrap(u,64);l.unshift("Public-Lines: "+l.length);l.unshift("Comment: "+c);l.unshift("Encryption: none");l.unshift("PuTTY-User-Key-File-2: "+a);return i.from(l.join("\n")+"\n")}function wrap(e,t){var a=[];var r=0;while(r<e.length){a.push(e.slice(r,r+64));r+=64}return a}},1758:function(e,t,a){e.exports={read:read.bind(undefined,false,undefined),readType:read.bind(undefined,false),write:write,readPartial:read.bind(undefined,true),readInternal:read,keyTypeToAlg:keyTypeToAlg,algToKeyType:algToKeyType};var r=a(7179);var i=a(9392).Buffer;var o=a(6767);var n=a(4299);var s=a(6837);var c=a(3879);var u=a(6635);function algToKeyType(e){r.string(e);if(e==="ssh-dss")return"dsa";else if(e==="ssh-rsa")return"rsa";else if(e==="ssh-ed25519")return"ed25519";else if(e==="ssh-curve25519")return"curve25519";else if(e.match(/^ecdsa-sha2-/))return"ecdsa";else throw new Error("Unknown algorithm "+e)}function keyTypeToAlg(e){r.object(e);if(e.type==="dsa")return"ssh-dss";else if(e.type==="rsa")return"ssh-rsa";else if(e.type==="ed25519")return"ssh-ed25519";else if(e.type==="curve25519")return"ssh-curve25519";else if(e.type==="ecdsa")return"ecdsa-sha2-"+e.part.curve.data.toString();else throw new Error("Unknown key type "+e.type)}function read(e,t,a,l){if(typeof a==="string")a=i.from(a);r.buffer(a,"buf");var p={};var f=p.parts=[];var m=new u({buffer:a});var h=m.readString();r.ok(!m.atEnd(),"key must have at least one part");p.type=algToKeyType(h);var g=o.info[p.type].parts.length;if(t&&t==="private")g=o.privInfo[p.type].parts.length;while(!m.atEnd()&&f.length<g)f.push(m.readPart());while(!e&&!m.atEnd())f.push(m.readPart());r.ok(f.length>=1,"key must have at least one part");r.ok(e||m.atEnd(),"leftover bytes at end of key");var y=s;var b=o.info[p.type];if(t==="private"||b.parts.length!==f.length){b=o.privInfo[p.type];y=c}r.strictEqual(b.parts.length,f.length);if(p.type==="ecdsa"){var k=/^ecdsa-sha2-(.+)$/.exec(h);r.ok(k!==null);r.strictEqual(k[1],f[0].data.toString())}var w=true;for(var x=0;x<b.parts.length;++x){var j=f[x];j.name=b.parts[x];if(p.type==="ed25519"&&j.name==="k")j.data=j.data.slice(0,32);if(j.name!=="curve"&&b.normalize!==false){var P;if(p.type==="ed25519"){P=n.zeroPadToLength(j.data,32)}else{P=n.mpNormalize(j.data)}if(P.toString("binary")!==j.data.toString("binary")){j.data=P;w=false}}}if(w)p._rfc4253Cache=m.toBuffer();if(e&&typeof e==="object"){e.remainder=m.remainder();e.consumed=m._offset}return new y(p)}function write(e,t){r.object(e);var a=keyTypeToAlg(e);var s;var l=o.info[e.type];if(c.isPrivateKey(e))l=o.privInfo[e.type];var p=l.parts;var f=new u({});f.writeString(a);for(s=0;s<p.length;++s){var m=e.part[p[s]].data;if(l.normalize!==false){if(e.type==="ed25519")m=n.zeroPadToLength(m,32);else m=n.mpNormalize(m)}if(e.type==="ed25519"&&p[s]==="k")m=i.concat([m,e.part.A.data]);f.writeBuffer(m)}return f.toBuffer()}},6073:function(e,t,a){e.exports={read:read,readSSHPrivate:readSSHPrivate,write:write};var r=a(7179);var i=a(1594);var o=a(9392).Buffer;var n=a(6767);var s=a(4299);var c=a(6982);var u=a(6837);var l=a(3879);var p=a(1679);var f=a(1758);var m=a(6635);var h=a(8399);var g;function read(e,t){return p.read(e,t)}var y="openssh-key-v1";function readSSHPrivate(e,t,i){t=new m({buffer:t});var n=t.readCString();r.strictEqual(n,y,"bad magic string");var u=t.readString();var l=t.readString();var p=t.readBuffer();var b=t.readInt();if(b!==1){throw new Error("OpenSSH-format key file contains "+"multiple keys: this is unsupported.")}var k=t.readBuffer();if(e==="public"){r.ok(t.atEnd(),"excess bytes left after key");return f.read(k)}var w=t.readBuffer();r.ok(t.atEnd(),"excess bytes left after key");var x=new m({buffer:p});switch(l){case"none":if(u!=="none"){throw new Error('OpenSSH-format key uses KDF "none" '+'but specifies a cipher other than "none"')}break;case"bcrypt":var j=x.readBuffer();var P=x.readInt();var C=s.opensshCipherInfo(u);if(g===undefined){g=a(2327)}if(typeof i.passphrase==="string"){i.passphrase=o.from(i.passphrase,"utf-8")}if(!o.isBuffer(i.passphrase)){throw new h.KeyEncryptedError(i.filename,"OpenSSH")}var I=new Uint8Array(i.passphrase);var z=new Uint8Array(j);var O=new Uint8Array(C.keySize+C.blockSize);var q=g.pbkdf(I,I.length,z,z.length,O,O.length,P);if(q!==0){throw new Error("bcrypt_pbkdf function returned "+"failure, parameters invalid")}O=o.from(O);var H=O.slice(0,C.keySize);var V=O.slice(C.keySize,C.keySize+C.blockSize);var G=c.createDecipheriv(C.opensslName,H,V);G.setAutoPadding(false);var X,W=[];G.once("error",(function(e){if(e.toString().indexOf("bad decrypt")!==-1){throw new Error("Incorrect passphrase "+"supplied, could not decrypt key")}throw e}));G.write(w);G.end();while((X=G.read())!==null)W.push(X);w=o.concat(W);break;default:throw new Error('OpenSSH-format key uses unknown KDF "'+l+'"')}t=new m({buffer:w});var Y=t.readInt();var ee=t.readInt();if(Y!==ee){throw new Error("Incorrect passphrase supplied, could not "+"decrypt key")}var te={};var ae=f.readInternal(te,"private",t.remainder());t.skip(te.consumed);var re=t.readString();ae.comment=re;return ae}function write(e,t){var i;if(l.isPrivateKey(e))i=e.toPublic();else i=e;var n="none";var u="none";var p=o.alloc(0);var f={blockSize:8};var h;if(t!==undefined){h=t.passphrase;if(typeof h==="string")h=o.from(h,"utf-8");if(h!==undefined){r.buffer(h,"options.passphrase");r.optionalString(t.cipher,"options.cipher");n=t.cipher;if(n===undefined)n="aes128-ctr";f=s.opensshCipherInfo(n);u="bcrypt"}}var b;if(l.isPrivateKey(e)){b=new m({});var k=c.randomBytes(4).readUInt32BE(0);b.writeInt(k);b.writeInt(k);b.write(e.toBuffer("rfc4253"));b.writeString(e.comment||"");var w=1;while(b._offset%f.blockSize!==0)b.writeChar(w++);b=b.toBuffer()}switch(u){case"none":break;case"bcrypt":var x=c.randomBytes(16);var j=16;var P=new m({});P.writeBuffer(x);P.writeInt(j);p=P.toBuffer();if(g===undefined){g=a(2327)}var C=new Uint8Array(h);var I=new Uint8Array(x);var z=new Uint8Array(f.keySize+f.blockSize);var O=g.pbkdf(C,C.length,I,I.length,z,z.length,j);if(O!==0){throw new Error("bcrypt_pbkdf function returned "+"failure, parameters invalid")}z=o.from(z);var q=z.slice(0,f.keySize);var H=z.slice(f.keySize,f.keySize+f.blockSize);var V=c.createCipheriv(f.opensslName,q,H);V.setAutoPadding(false);var G,X=[];V.once("error",(function(e){throw e}));V.write(b);V.end();while((G=V.read())!==null)X.push(G);b=o.concat(X);break;default:throw new Error("Unsupported kdf "+u)}var W=new m({});W.writeCString(y);W.writeString(n);W.writeString(u);W.writeBuffer(p);W.writeInt(1);W.writeBuffer(i.toBuffer("rfc4253"));if(b)W.writeBuffer(b);W=W.toBuffer();var Y;if(l.isPrivateKey(e))Y="OPENSSH PRIVATE KEY";else Y="OPENSSH PUBLIC KEY";var ee=W.toString("base64");var te=ee.length+ee.length/70+18+16+Y.length*2+10;W=o.alloc(te);var ae=0;ae+=W.write("-----BEGIN "+Y+"-----\n",ae);for(var re=0;re<ee.length;){var ie=re+70;if(ie>ee.length)ie=ee.length;ae+=W.write(ee.slice(re,ie),ae);W[ae++]=10;re=ie}ae+=W.write("-----END "+Y+"-----\n",ae);return W.slice(0,ae)}},8259:function(e,t,a){e.exports={read:read,write:write};var r=a(7179);var i=a(9392).Buffer;var o=a(1758);var n=a(4299);var s=a(6837);var c=a(3879);var u=a(6073);var l=/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/;var p=/^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/;function read(e,t){if(typeof e!=="string"){r.buffer(e,"buf");e=e.toString("ascii")}var a=e.trim().replace(/[\\\r]/g,"");var n=a.match(l);if(!n)n=a.match(p);r.ok(n,"key must match regex");var s=o.algToKeyType(n[1]);var c=i.from(n[2],"base64");var u;var f={};if(n[4]){try{u=o.read(c)}catch(e){n=a.match(p);r.ok(n,"key must match regex");c=i.from(n[2],"base64");u=o.readInternal(f,"public",c)}}else{u=o.readInternal(f,"public",c)}r.strictEqual(s,u.type);if(n[4]&&n[4].length>0){u.comment=n[4]}else if(f.consumed){var m=n[2]+(n[3]?n[3]:"");var h=Math.ceil(f.consumed/3)*4;m=m.slice(0,h-2).replace(/[^a-zA-Z0-9+\/=]/g,"")+m.slice(h-2);var g=f.consumed%3;if(g>0&&m.slice(h-1,h)!=="=")h--;while(m.slice(h,h+1)==="=")h++;var y=m.slice(h);y=y.replace(/[\r\n]/g," ").replace(/^\s+/,"");if(y.match(/^[a-zA-Z0-9]/))u.comment=y}return u}function write(e,t){r.object(e);if(!s.isKey(e))throw new Error("Must be a public key");var a=[];var n=o.keyTypeToAlg(e);a.push(n);var c=o.write(e);a.push(c.toString("base64"));if(e.comment)a.push(e.comment);return i.from(a.join(" "))}},8706:function(e,t,a){var r=a(8709);e.exports={read:read,verify:r.verify,sign:r.sign,write:write};var i=a(7179);var o=a(1594);var n=a(9392).Buffer;var s=a(6767);var c=a(4299);var u=a(6837);var l=a(3879);var p=a(1679);var f=a(5646);var m=a(1100);var h=a(5514);function read(e,t){if(typeof e!=="string"){i.buffer(e,"buf");e=e.toString("ascii")}var a=e.trim().split(/[\r\n]+/g);var o;var s=-1;while(!o&&s<a.length){o=a[++s].match(/[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/)}i.ok(o,"invalid PEM header");var c;var u=a.length;while(!c&&u>0){c=a[--u].match(/[-]+[ ]*END CERTIFICATE[ ]*[-]+/)}i.ok(c,"invalid PEM footer");a=a.slice(s,u+1);var l={};while(true){a=a.slice(1);o=a[0].match(/^([A-Za-z0-9-]+): (.+)$/);if(!o)break;l[o[1].toLowerCase()]=o[2]}a=a.slice(0,-1).join("");e=n.from(a,"base64");return r.read(e,t)}function write(e,t){var a=r.write(e,t);var i="CERTIFICATE";var o=a.toString("base64");var s=o.length+o.length/64+18+16+i.length*2+10;var c=n.alloc(s);var u=0;u+=c.write("-----BEGIN "+i+"-----\n",u);for(var l=0;l<o.length;){var p=l+64;if(p>o.length)p=o.length;u+=c.write(o.slice(l,p),u);c[u++]=10;l=p}u+=c.write("-----END "+i+"-----\n",u);return c.slice(0,u)}},8709:function(e,t,a){e.exports={read:read,verify:verify,sign:sign,signAsync:signAsync,write:write};var r=a(7179);var i=a(1594);var o=a(9392).Buffer;var n=a(6767);var s=a(4299);var c=a(6837);var u=a(3879);var l=a(1679);var p=a(5646);var f=a(1100);var m=a(5514);var h=a(6696);function readMPInt(e,t){r.strictEqual(e.peek(),i.Ber.Integer,t+" is not an Integer");return s.mpNormalize(e.readString(i.Ber.Integer,true))}function verify(e,t){var a=e.signatures.x509;r.object(a,"x509 signature");var o=a.algo.split("-");if(o[0]!==t.type)return false;var n=a.cache;if(n===undefined){var s=new i.BerWriter;writeTBSCert(e,s);n=s.buffer}var c=t.createVerify(o[1]);c.write(n);return c.verify(a.signature)}function Local(e){return i.Ber.Context|i.Ber.Constructor|e}function Context(e){return i.Ber.Context|e}var g={"rsa-md5":"1.2.840.113549.1.1.4","rsa-sha1":"1.2.840.113549.1.1.5","rsa-sha256":"1.2.840.113549.1.1.11","rsa-sha384":"1.2.840.113549.1.1.12","rsa-sha512":"1.2.840.113549.1.1.13","dsa-sha1":"1.2.840.10040.4.3","dsa-sha256":"2.16.840.1.101.3.4.3.2","ecdsa-sha1":"1.2.840.10045.4.1","ecdsa-sha256":"1.2.840.10045.4.3.2","ecdsa-sha384":"1.2.840.10045.4.3.3","ecdsa-sha512":"1.2.840.10045.4.3.4","ed25519-sha512":"1.3.101.112"};Object.keys(g).forEach((function(e){g[g[e]]=e}));g["1.3.14.3.2.3"]="rsa-md5";g["1.3.14.3.2.29"]="rsa-sha1";var y={issuerKeyId:"2.5.29.35",altName:"2.5.29.17",basicConstraints:"2.5.29.19",keyUsage:"2.5.29.15",extKeyUsage:"2.5.29.37"};function read(e,t){if(typeof e==="string"){e=o.from(e,"binary")}r.buffer(e,"buf");var a=new i.BerReader(e);a.readSequence();if(Math.abs(a.length-a.remain)>1){throw new Error("DER sequence does not contain whole byte "+"stream")}var n=a.offset;a.readSequence();var s=a.offset+a.length;var c=s;if(a.peek()===Local(0)){a.readSequence(Local(0));var u=a.readInt();r.ok(u<=3,"only x.509 versions up to v3 supported")}var l={};l.signatures={};var y=l.signatures.x509={};y.extras={};l.serial=readMPInt(a,"serial");a.readSequence();var b=a.offset+a.length;var k=a.readOID();var w=g[k];if(w===undefined)throw new Error("unknown signature algorithm "+k);a._offset=b;l.issuer=p.parseAsn1(a);a.readSequence();l.validFrom=readDate(a);l.validUntil=readDate(a);l.subjects=[p.parseAsn1(a)];a.readSequence();b=a.offset+a.length;l.subjectKey=h.readPkcs8(undefined,"public",a);a._offset=b;if(a.peek()===Local(1)){a.readSequence(Local(1));y.extras.issuerUniqueID=e.slice(a.offset,a.offset+a.length);a._offset+=a.length}if(a.peek()===Local(2)){a.readSequence(Local(2));y.extras.subjectUniqueID=e.slice(a.offset,a.offset+a.length);a._offset+=a.length}if(a.peek()===Local(3)){a.readSequence(Local(3));var x=a.offset+a.length;a.readSequence();while(a.offset<x)readExtension(l,e,a);r.strictEqual(a.offset,x)}r.strictEqual(a.offset,s);a.readSequence();b=a.offset+a.length;var j=a.readOID();var P=g[j];if(P===undefined)throw new Error("unknown signature algorithm "+j);a._offset=b;var C=a.readString(i.Ber.BitString,true);if(C[0]===0)C=C.slice(1);var I=P.split("-");y.signature=f.parse(C,I[0],"asn1");y.signature.hashAlgorithm=I[1];y.algo=P;y.cache=e.slice(n,c);return new m(l)}function readDate(e){if(e.peek()===i.Ber.UTCTime){return utcTimeToDate(e.readString(i.Ber.UTCTime))}else if(e.peek()===i.Ber.GeneralizedTime){return gTimeToDate(e.readString(i.Ber.GeneralizedTime))}else{throw new Error("Unsupported date format")}}function writeDate(e,t){if(t.getUTCFullYear()>=2050||t.getUTCFullYear()<1950){e.writeString(dateToGTime(t),i.Ber.GeneralizedTime)}else{e.writeString(dateToUTCTime(t),i.Ber.UTCTime)}}var b={OtherName:Local(0),RFC822Name:Context(1),DNSName:Context(2),X400Address:Local(3),DirectoryName:Local(4),EDIPartyName:Local(5),URI:Context(6),IPAddress:Context(7),OID:Context(8)};var k={serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",joyentDocker:"1.3.6.1.4.1.38678.1.4.1",joyentCmon:"1.3.6.1.4.1.38678.1.4.2"};var w={};Object.keys(k).forEach((function(e){w[k[e]]=e}));var x=["signature","identity","keyEncryption","encryption","keyAgreement","ca","crl"];function readExtension(e,t,a){a.readSequence();var r=a.offset+a.length;var o=a.readOID();var n;var s=e.signatures.x509;if(!s.extras.exts)s.extras.exts=[];var c;if(a.peek()===i.Ber.Boolean)c=a.readBoolean();switch(o){case y.basicConstraints:a.readSequence(i.Ber.OctetString);a.readSequence();var u=a.offset+a.length;var l=false;if(a.peek()===i.Ber.Boolean)l=a.readBoolean();if(e.purposes===undefined)e.purposes=[];if(l===true)e.purposes.push("ca");var f={oid:o,critical:c};if(a.offset<u&&a.peek()===i.Ber.Integer)f.pathLen=a.readInt();s.extras.exts.push(f);break;case y.extKeyUsage:a.readSequence(i.Ber.OctetString);a.readSequence();if(e.purposes===undefined)e.purposes=[];var m=a.offset+a.length;while(a.offset<m){var h=a.readOID();e.purposes.push(w[h]||h)}if(e.purposes.indexOf("serverAuth")!==-1&&e.purposes.indexOf("clientAuth")===-1){e.subjects.forEach((function(e){if(e.type!=="host"){e.type="host";e.hostname=e.uid||e.email||e.components[0].value}}))}else if(e.purposes.indexOf("clientAuth")!==-1&&e.purposes.indexOf("serverAuth")===-1){e.subjects.forEach((function(e){if(e.type!=="user"){e.type="user";e.uid=e.hostname||e.email||e.components[0].value}}))}s.extras.exts.push({oid:o,critical:c});break;case y.keyUsage:a.readSequence(i.Ber.OctetString);var g=a.readString(i.Ber.BitString,true);var k=readBitField(g,x);k.forEach((function(t){if(e.purposes===undefined)e.purposes=[];if(e.purposes.indexOf(t)===-1)e.purposes.push(t)}));s.extras.exts.push({oid:o,critical:c,bits:g});break;case y.altName:a.readSequence(i.Ber.OctetString);a.readSequence();var j=a.offset+a.length;while(a.offset<j){switch(a.peek()){case b.OtherName:case b.EDIPartyName:a.readSequence();a._offset+=a.length;break;case b.OID:a.readOID(b.OID);break;case b.RFC822Name:var P=a.readString(b.RFC822Name);n=p.forEmail(P);if(!e.subjects[0].equals(n))e.subjects.push(n);break;case b.DirectoryName:a.readSequence(b.DirectoryName);n=p.parseAsn1(a);if(!e.subjects[0].equals(n))e.subjects.push(n);break;case b.DNSName:var C=a.readString(b.DNSName);n=p.forHost(C);if(!e.subjects[0].equals(n))e.subjects.push(n);break;default:a.readString(a.peek());break}}s.extras.exts.push({oid:o,critical:c});break;default:s.extras.exts.push({oid:o,critical:c,data:a.readString(i.Ber.OctetString,true)});break}a._offset=r}var j=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;function utcTimeToDate(e){var t=e.match(j);r.ok(t,"timestamps must be in UTC");var a=new Date;var i=a.getUTCFullYear();var o=Math.floor(i/100)*100;var n=parseInt(t[1],10);if(i%100<50&&n>=60)n+=o-1;else n+=o;a.setUTCFullYear(n,parseInt(t[2],10)-1,parseInt(t[3],10));a.setUTCHours(parseInt(t[4],10),parseInt(t[5],10));if(t[6]&&t[6].length>0)a.setUTCSeconds(parseInt(t[6],10));return a}var P=/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;function gTimeToDate(e){var t=e.match(P);r.ok(t);var a=new Date;a.setUTCFullYear(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10));a.setUTCHours(parseInt(t[4],10),parseInt(t[5],10));if(t[6]&&t[6].length>0)a.setUTCSeconds(parseInt(t[6],10));return a}function zeroPad(e,t){if(t===undefined)t=2;var a=""+e;while(a.length<t)a="0"+a;return a}function dateToUTCTime(e){var t="";t+=zeroPad(e.getUTCFullYear()%100);t+=zeroPad(e.getUTCMonth()+1);t+=zeroPad(e.getUTCDate());t+=zeroPad(e.getUTCHours());t+=zeroPad(e.getUTCMinutes());t+=zeroPad(e.getUTCSeconds());t+="Z";return t}function dateToGTime(e){var t="";t+=zeroPad(e.getUTCFullYear(),4);t+=zeroPad(e.getUTCMonth()+1);t+=zeroPad(e.getUTCDate());t+=zeroPad(e.getUTCHours());t+=zeroPad(e.getUTCMinutes());t+=zeroPad(e.getUTCSeconds());t+="Z";return t}function sign(e,t){if(e.signatures.x509===undefined)e.signatures.x509={};var a=e.signatures.x509;a.algo=t.type+"-"+t.defaultHashAlgorithm();if(g[a.algo]===undefined)return false;var r=new i.BerWriter;writeTBSCert(e,r);var o=r.buffer;a.cache=o;var n=t.createSign();n.write(o);e.signatures.x509.signature=n.sign();return true}function signAsync(e,t,a){if(e.signatures.x509===undefined)e.signatures.x509={};var r=e.signatures.x509;var o=new i.BerWriter;writeTBSCert(e,o);var n=o.buffer;r.cache=n;t(n,(function(e,t){if(e){a(e);return}r.algo=t.type+"-"+t.hashAlgorithm;if(g[r.algo]===undefined){a(new Error('Invalid signing algorithm "'+r.algo+'"'));return}r.signature=t;a()}))}function write(e,t){var a=e.signatures.x509;r.object(a,"x509 signature");var n=new i.BerWriter;n.startSequence();if(a.cache){n._ensure(a.cache.length);a.cache.copy(n._buf,n._offset);n._offset+=a.cache.length}else{writeTBSCert(e,n)}n.startSequence();n.writeOID(g[a.algo]);if(a.algo.match(/^rsa-/))n.writeNull();n.endSequence();var s=a.signature.toBuffer("asn1");var c=o.alloc(s.length+1);c[0]=0;s.copy(c,1);n.writeBuffer(c,i.Ber.BitString);n.endSequence();return n.buffer}function writeTBSCert(e,t){var a=e.signatures.x509;r.object(a,"x509 signature");t.startSequence();t.startSequence(Local(0));t.writeInt(2);t.endSequence();t.writeBuffer(s.mpNormalize(e.serial),i.Ber.Integer);t.startSequence();t.writeOID(g[a.algo]);if(a.algo.match(/^rsa-/))t.writeNull();t.endSequence();e.issuer.toAsn1(t);t.startSequence();writeDate(t,e.validFrom);writeDate(t,e.validUntil);t.endSequence();var o=e.subjects[0];var n=e.subjects.slice(1);o.toAsn1(t);h.writePkcs8(t,e.subjectKey);if(a.extras&&a.extras.issuerUniqueID){t.writeBuffer(a.extras.issuerUniqueID,Local(1))}if(a.extras&&a.extras.subjectUniqueID){t.writeBuffer(a.extras.subjectUniqueID,Local(2))}if(n.length>0||o.type==="host"||e.purposes!==undefined&&e.purposes.length>0||a.extras&&a.extras.exts){t.startSequence(Local(3));t.startSequence();var c=[];if(e.purposes!==undefined&&e.purposes.length>0){c.push({oid:y.basicConstraints,critical:true});c.push({oid:y.keyUsage,critical:true});c.push({oid:y.extKeyUsage,critical:true})}c.push({oid:y.altName});if(a.extras&&a.extras.exts)c=a.extras.exts;for(var u=0;u<c.length;++u){t.startSequence();t.writeOID(c[u].oid);if(c[u].critical!==undefined)t.writeBoolean(c[u].critical);if(c[u].oid===y.altName){t.startSequence(i.Ber.OctetString);t.startSequence();if(o.type==="host"){t.writeString(o.hostname,Context(2))}for(var l=0;l<n.length;++l){if(n[l].type==="host"){t.writeString(n[l].hostname,b.DNSName)}else if(n[l].type==="email"){t.writeString(n[l].email,b.RFC822Name)}else{t.startSequence(b.DirectoryName);n[l].toAsn1(t);t.endSequence()}}t.endSequence();t.endSequence()}else if(c[u].oid===y.basicConstraints){t.startSequence(i.Ber.OctetString);t.startSequence();var p=e.purposes.indexOf("ca")!==-1;var f=c[u].pathLen;t.writeBoolean(p);if(f!==undefined)t.writeInt(f);t.endSequence();t.endSequence()}else if(c[u].oid===y.extKeyUsage){t.startSequence(i.Ber.OctetString);t.startSequence();e.purposes.forEach((function(e){if(e==="ca")return;if(x.indexOf(e)!==-1)return;var a=e;if(k[e]!==undefined)a=k[e];t.writeOID(a)}));t.endSequence();t.endSequence()}else if(c[u].oid===y.keyUsage){t.startSequence(i.Ber.OctetString);if(c[u].bits!==undefined){t.writeBuffer(c[u].bits,i.Ber.BitString)}else{var m=writeBitField(e.purposes,x);t.writeBuffer(m,i.Ber.BitString)}t.endSequence()}else{t.writeBuffer(c[u].data,i.Ber.OctetString)}t.endSequence()}t.endSequence();t.endSequence()}t.endSequence()}function readBitField(e,t){var a=8*(e.length-1)-e[0];var r={};for(var i=0;i<a;++i){var o=1+Math.floor(i/8);var n=7-i%8;var s=1<<n;var c=(e[o]&s)!==0;var u=t[i];if(c&&typeof u==="string"){r[u]=true}}return Object.keys(r)}function writeBitField(e,t){var a=t.length;var r=Math.ceil(a/8);var i=r*8-a;var n=o.alloc(1+r);n[0]=i;for(var s=0;s<a;++s){var c=1+Math.floor(s/8);var u=7-s%8;var l=1<<u;var p=t[s];if(p===undefined)continue;var f=e.indexOf(p)!==-1;if(f){n[c]|=l}}return n}},5646:function(e,t,a){e.exports=Identity;var r=a(7179);var i=a(6767);var o=a(6982);var n=a(2534);var s=a(1100);var c=a(8399);var u=a(9023);var l=a(4299);var p=a(1594);var f=a(9392).Buffer;var m=/^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i;var h={};h.cn="2.5.4.3";h.o="2.5.4.10";h.ou="2.5.4.11";h.l="2.5.4.7";h.s="2.5.4.8";h.c="2.5.4.6";h.sn="2.5.4.4";h.postalCode="2.5.4.17";h.serialNumber="2.5.4.5";h.street="2.5.4.9";h.x500UniqueIdentifier="2.5.4.45";h.role="2.5.4.72";h.telephoneNumber="2.5.4.20";h.description="2.5.4.13";h.dc="0.9.2342.19200300.100.1.25";h.uid="0.9.2342.19200300.100.1.1";h.mail="0.9.2342.19200300.100.1.3";h.title="2.5.4.12";h.gn="2.5.4.42";h.initials="2.5.4.43";h.pseudonym="2.5.4.65";h.emailAddress="1.2.840.113549.1.9.1";var g={};Object.keys(h).forEach((function(e){g[h[e]]=e}));function Identity(e){var t=this;r.object(e,"options");r.arrayOfObject(e.components,"options.components");this.components=e.components;this.componentLookup={};this.components.forEach((function(e){if(e.name&&!e.oid)e.oid=h[e.name];if(e.oid&&!e.name)e.name=g[e.oid];if(t.componentLookup[e.name]===undefined)t.componentLookup[e.name]=[];t.componentLookup[e.name].push(e)}));if(this.componentLookup.cn&&this.componentLookup.cn.length>0){this.cn=this.componentLookup.cn[0].value}r.optionalString(e.type,"options.type");if(e.type===undefined){if(this.components.length===1&&this.componentLookup.cn&&this.componentLookup.cn.length===1&&this.componentLookup.cn[0].value.match(m)){this.type="host";this.hostname=this.componentLookup.cn[0].value}else if(this.componentLookup.dc&&this.components.length===this.componentLookup.dc.length){this.type="host";this.hostname=this.componentLookup.dc.map((function(e){return e.value})).join(".")}else if(this.componentLookup.uid&&this.components.length===this.componentLookup.uid.length){this.type="user";this.uid=this.componentLookup.uid[0].value}else if(this.componentLookup.cn&&this.componentLookup.cn.length===1&&this.componentLookup.cn[0].value.match(m)){this.type="host";this.hostname=this.componentLookup.cn[0].value}else if(this.componentLookup.uid&&this.componentLookup.uid.length===1){this.type="user";this.uid=this.componentLookup.uid[0].value}else if(this.componentLookup.mail&&this.componentLookup.mail.length===1){this.type="email";this.email=this.componentLookup.mail[0].value}else if(this.componentLookup.cn&&this.componentLookup.cn.length===1){this.type="user";this.uid=this.componentLookup.cn[0].value}else{this.type="unknown"}}else{this.type=e.type;if(this.type==="host")this.hostname=e.hostname;else if(this.type==="user")this.uid=e.uid;else if(this.type==="email")this.email=e.email;else throw new Error("Unknown type "+this.type)}}Identity.prototype.toString=function(){return this.components.map((function(e){var t=e.name.toUpperCase();t=t.replace(/=/g,"\\=");var a=e.value;a=a.replace(/,/g,"\\,");return t+"="+a})).join(", ")};Identity.prototype.get=function(e,t){r.string(e,"name");var a=this.componentLookup[e];if(a===undefined||a.length===0)return undefined;if(!t&&a.length>1)throw new Error("Multiple values for attribute "+e);if(!t)return a[0].value;return a.map((function(e){return e.value}))};Identity.prototype.toArray=function(e){return this.components.map((function(e){return{name:e.name,value:e.value}}))};var y=/[^a-zA-Z0-9 '(),+.\/:=?-]/;var b=/[^\x00-\x7f]/;Identity.prototype.toAsn1=function(e,t){e.startSequence(t);this.components.forEach((function(t){e.startSequence(p.Ber.Constructor|p.Ber.Set);e.startSequence();e.writeOID(t.oid);if(t.asn1type===p.Ber.Utf8String||t.value.match(b)){var a=f.from(t.value,"utf8");e.writeBuffer(a,p.Ber.Utf8String)}else if(t.asn1type===p.Ber.IA5String||t.value.match(y)){e.writeString(t.value,p.Ber.IA5String)}else{var r=p.Ber.PrintableString;if(t.asn1type!==undefined)r=t.asn1type;e.writeString(t.value,r)}e.endSequence();e.endSequence()}));e.endSequence()};function globMatch(e,t){if(e==="**"||t==="**")return true;var a=e.split(".");var r=t.split(".");if(a.length!==r.length)return false;for(var i=0;i<a.length;++i){if(a[i]==="*"||r[i]==="*")continue;if(a[i]!==r[i])return false}return true}Identity.prototype.equals=function(e){if(!Identity.isIdentity(e,[1,0]))return false;if(e.components.length!==this.components.length)return false;for(var t=0;t<this.components.length;++t){if(this.components[t].oid!==e.components[t].oid)return false;if(!globMatch(this.components[t].value,e.components[t].value)){return false}}return true};Identity.forHost=function(e){r.string(e,"hostname");return new Identity({type:"host",hostname:e,components:[{name:"cn",value:e}]})};Identity.forUser=function(e){r.string(e,"uid");return new Identity({type:"user",uid:e,components:[{name:"uid",value:e}]})};Identity.forEmail=function(e){r.string(e,"email");return new Identity({type:"email",email:e,components:[{name:"mail",value:e}]})};Identity.parseDN=function(e){r.string(e,"dn");var t=[""];var a=0;var i=e;while(i.length>0){var o;if((o=/^,/.exec(i))!==null){t[++a]="";i=i.slice(o[0].length)}else if((o=/^\\,/.exec(i))!==null){t[a]+=",";i=i.slice(o[0].length)}else if((o=/^\\./.exec(i))!==null){t[a]+=o[0];i=i.slice(o[0].length)}else if((o=/^[^\\,]+/.exec(i))!==null){t[a]+=o[0];i=i.slice(o[0].length)}else{throw new Error("Failed to parse DN")}}var n=t.map((function(e){e=e.trim();var t=e.indexOf("=");while(t>0&&e.charAt(t-1)==="\\")t=e.indexOf("=",t+1);if(t===-1){throw new Error("Failed to parse DN")}var a=e.slice(0,t).toLowerCase().replace(/\\=/g,"=");var r=e.slice(t+1);return{name:a,value:r}}));return new Identity({components:n})};Identity.fromArray=function(e){r.arrayOfObject(e,"components");e.forEach((function(e){r.object(e,"component");r.string(e.name,"component.name");if(!f.isBuffer(e.value)&&!(typeof e.value==="string")){throw new Error("Invalid component value")}}));return new Identity({components:e})};Identity.parseAsn1=function(e,t){var a=[];e.readSequence(t);var r=e.offset+e.length;while(e.offset<r){e.readSequence(p.Ber.Constructor|p.Ber.Set);var i=e.offset+e.length;e.readSequence();var o=e.readOID();var n=e.peek();var s;switch(n){case p.Ber.PrintableString:case p.Ber.IA5String:case p.Ber.OctetString:case p.Ber.T61String:s=e.readString(n);break;case p.Ber.Utf8String:s=e.readString(n,true);s=s.toString("utf8");break;case p.Ber.CharacterString:case p.Ber.BMPString:s=e.readString(n,true);s=s.toString("utf16le");break;default:throw new Error("Unknown asn1 type "+n)}a.push({oid:o,asn1type:n,value:s});e._offset=i}e._offset=r;return new Identity({components:a})};Identity.isIdentity=function(e,t){return l.isCompatible(e,Identity,t)};Identity.prototype._sshpkApiVersion=[1,0];Identity._oldVersionDetect=function(e){return[1,0]}},4186:function(e,t,a){var r=a(6837);var i=a(2534);var o=a(1100);var n=a(3879);var s=a(5514);var c=a(5646);var u=a(8399);e.exports={Key:r,parseKey:r.parse,Fingerprint:i,parseFingerprint:i.parse,Signature:o,parseSignature:o.parse,PrivateKey:n,parsePrivateKey:n.parse,generatePrivateKey:n.generate,Certificate:s,parseCertificate:s.parse,createSelfSignedCertificate:s.createSelfSigned,createCertificate:s.create,Identity:c,identityFromDN:c.parseDN,identityForHost:c.forHost,identityForUser:c.forUser,identityForEmail:c.forEmail,identityFromArray:c.fromArray,FingerprintFormatError:u.FingerprintFormatError,InvalidAlgorithmError:u.InvalidAlgorithmError,KeyParseError:u.KeyParseError,SignatureParseError:u.SignatureParseError,KeyEncryptedError:u.KeyEncryptedError,CertificateParseError:u.CertificateParseError}},6837:function(e,t,a){e.exports=Key;var r=a(7179);var i=a(6767);var o=a(6982);var n=a(2534);var s=a(1100);var c=a(5857).DiffieHellman;var u=a(8399);var l=a(4299);var p=a(3879);var f;try{f=a(4436)}catch(e){}var m=u.InvalidAlgorithmError;var h=u.KeyParseError;var g={};g["auto"]=a(4842);g["pem"]=a(1679);g["pkcs1"]=a(7895);g["pkcs8"]=a(6696);g["rfc4253"]=a(1758);g["ssh"]=a(8259);g["ssh-private"]=a(6073);g["openssh"]=g["ssh-private"];g["dnssec"]=a(1265);g["putty"]=a(5595);g["ppk"]=g["putty"];function Key(e){r.object(e,"options");r.arrayOfObject(e.parts,"options.parts");r.string(e.type,"options.type");r.optionalString(e.comment,"options.comment");var t=i.info[e.type];if(typeof t!=="object")throw new m(e.type);var a={};for(var o=0;o<e.parts.length;++o){var n=e.parts[o];a[n.name]=n}this.type=e.type;this.parts=e.parts;this.part=a;this.comment=undefined;this.source=e.source;this._rfc4253Cache=e._rfc4253Cache;this._hashCache={};var s;this.curve=undefined;if(this.type==="ecdsa"){var c=this.part.curve.data.toString();this.curve=c;s=i.curves[c].size}else if(this.type==="ed25519"||this.type==="curve25519"){s=256;this.curve="curve25519"}else{var u=this.part[t.sizePart];s=u.data.length;s=s*8-l.countZeros(u.data)}this.size=s}Key.formats=g;Key.prototype.toBuffer=function(e,t){if(e===undefined)e="ssh";r.string(e,"format");r.object(g[e],"formats[format]");r.optionalObject(t,"options");if(e==="rfc4253"){if(this._rfc4253Cache===undefined)this._rfc4253Cache=g["rfc4253"].write(this);return this._rfc4253Cache}return g[e].write(this,t)};Key.prototype.toString=function(e,t){return this.toBuffer(e,t).toString()};Key.prototype.hash=function(e,t){r.string(e,"algorithm");r.optionalString(t,"type");if(t===undefined)t="ssh";e=e.toLowerCase();if(i.hashAlgs[e]===undefined)throw new m(e);var a=e+"||"+t;if(this._hashCache[a])return this._hashCache[a];var n;if(t==="ssh"){n=this.toBuffer("rfc4253")}else if(t==="spki"){n=g.pkcs8.pkcs8ToBuffer(this)}else{throw new Error("Hash type "+t+" not supported")}var s=o.createHash(e).update(n).digest();this._hashCache[a]=s;return s};Key.prototype.fingerprint=function(e,t){if(e===undefined)e="sha256";if(t===undefined)t="ssh";r.string(e,"algorithm");r.string(t,"type");var a={type:"key",hash:this.hash(e,t),algorithm:e,hashType:t};return new n(a)};Key.prototype.defaultHashAlgorithm=function(){var e="sha1";if(this.type==="rsa")e="sha256";if(this.type==="dsa"&&this.size>1024)e="sha256";if(this.type==="ed25519")e="sha512";if(this.type==="ecdsa"){if(this.size<=256)e="sha256";else if(this.size<=384)e="sha384";else e="sha512"}return e};Key.prototype.createVerify=function(e){if(e===undefined)e=this.defaultHashAlgorithm();r.string(e,"hash algorithm");if(this.type==="ed25519"&&f!==undefined)return new f.Verifier(this,e);if(this.type==="curve25519")throw new Error("Curve25519 keys are not suitable for "+"signing or verification");var t,a,i;try{a=e.toUpperCase();t=o.createVerify(a)}catch(e){i=e}if(t===undefined||i instanceof Error&&i.message.match(/Unknown message digest/)){a="RSA-";a+=e.toUpperCase();t=o.createVerify(a)}r.ok(t,"failed to create verifier");var n=t.verify.bind(t);var c=this.toBuffer("pkcs8");var u=this.curve;var l=this;t.verify=function(t,a){if(s.isSignature(t,[2,0])){if(t.type!==l.type)return false;if(t.hashAlgorithm&&t.hashAlgorithm!==e)return false;if(t.curve&&l.type==="ecdsa"&&t.curve!==u)return false;return n(c,t.toBuffer("asn1"))}else if(typeof t==="string"||Buffer.isBuffer(t)){return n(c,t,a)}else if(s.isSignature(t,[1,0])){throw new Error("signature was created by too old "+"a version of sshpk and cannot be verified")}else{throw new TypeError("signature must be a string, "+"Buffer, or Signature object")}};return t};Key.prototype.createDiffieHellman=function(){if(this.type==="rsa")throw new Error("RSA keys do not support Diffie-Hellman");return new c(this)};Key.prototype.createDH=Key.prototype.createDiffieHellman;Key.parse=function(e,t,a){if(typeof e!=="string")r.buffer(e,"data");if(t===undefined)t="auto";r.string(t,"format");if(typeof a==="string")a={filename:a};r.optionalObject(a,"options");if(a===undefined)a={};r.optionalString(a.filename,"options.filename");if(a.filename===undefined)a.filename="(unnamed)";r.object(g[t],"formats[format]");try{var i=g[t].read(e,a);if(i instanceof p)i=i.toPublic();if(!i.comment)i.comment=a.filename;return i}catch(e){if(e.name==="KeyEncryptedError")throw e;throw new h(a.filename,t,e)}};Key.isKey=function(e,t){return l.isCompatible(e,Key,t)};Key.prototype._sshpkApiVersion=[1,7];Key._oldVersionDetect=function(e){r.func(e.toBuffer);r.func(e.fingerprint);if(e.createDH)return[1,4];if(e.defaultHashAlgorithm)return[1,3];if(e.formats["auto"])return[1,2];if(e.formats["pkcs1"])return[1,1];return[1,0]}},3879:function(e,t,a){e.exports=PrivateKey;var r=a(7179);var i=a(9392).Buffer;var o=a(6767);var n=a(6982);var s=a(2534);var c=a(1100);var u=a(8399);var l=a(9023);var p=a(4299);var f=a(5857);var m=f.generateECDSA;var h=f.generateED25519;var g=a(4436);var y=a(7567);var b=a(6837);var k=u.InvalidAlgorithmError;var w=u.KeyParseError;var x=u.KeyEncryptedError;var j={};j["auto"]=a(4842);j["pem"]=a(1679);j["pkcs1"]=a(7895);j["pkcs8"]=a(6696);j["rfc4253"]=a(1758);j["ssh-private"]=a(6073);j["openssh"]=j["ssh-private"];j["ssh"]=j["ssh-private"];j["dnssec"]=a(1265);j["putty"]=a(5595);function PrivateKey(e){r.object(e,"options");b.call(this,e);this._pubCache=undefined}l.inherits(PrivateKey,b);PrivateKey.formats=j;PrivateKey.prototype.toBuffer=function(e,t){if(e===undefined)e="pkcs1";r.string(e,"format");r.object(j[e],"formats[format]");r.optionalObject(t,"options");return j[e].write(this,t)};PrivateKey.prototype.hash=function(e,t){return this.toPublic().hash(e,t)};PrivateKey.prototype.fingerprint=function(e,t){return this.toPublic().fingerprint(e,t)};PrivateKey.prototype.toPublic=function(){if(this._pubCache)return this._pubCache;var e=o.info[this.type];var t=[];for(var a=0;a<e.parts.length;++a){var r=e.parts[a];t.push(this.part[r])}this._pubCache=new b({type:this.type,source:this,parts:t});if(this.comment)this._pubCache.comment=this.comment;return this._pubCache};PrivateKey.prototype.derive=function(e){r.string(e,"type");var t,a,o;if(this.type==="ed25519"&&e==="curve25519"){t=this.part.k.data;if(t[0]===0)t=t.slice(1);o=y.box.keyPair.fromSecretKey(new Uint8Array(t));a=i.from(o.publicKey);return new PrivateKey({type:"curve25519",parts:[{name:"A",data:p.mpNormalize(a)},{name:"k",data:p.mpNormalize(t)}]})}else if(this.type==="curve25519"&&e==="ed25519"){t=this.part.k.data;if(t[0]===0)t=t.slice(1);o=y.sign.keyPair.fromSeed(new Uint8Array(t));a=i.from(o.publicKey);return new PrivateKey({type:"ed25519",parts:[{name:"A",data:p.mpNormalize(a)},{name:"k",data:p.mpNormalize(t)}]})}throw new Error("Key derivation not supported from "+this.type+" to "+e)};PrivateKey.prototype.createVerify=function(e){return this.toPublic().createVerify(e)};PrivateKey.prototype.createSign=function(e){if(e===undefined)e=this.defaultHashAlgorithm();r.string(e,"hash algorithm");if(this.type==="ed25519"&&g!==undefined)return new g.Signer(this,e);if(this.type==="curve25519")throw new Error("Curve25519 keys are not suitable for "+"signing or verification");var t,a,o;try{a=e.toUpperCase();t=n.createSign(a)}catch(e){o=e}if(t===undefined||o instanceof Error&&o.message.match(/Unknown message digest/)){a="RSA-";a+=e.toUpperCase();t=n.createSign(a)}r.ok(t,"failed to create verifier");var s=t.sign.bind(t);var u=this.toBuffer("pkcs1");var l=this.type;var p=this.curve;t.sign=function(){var t=s(u);if(typeof t==="string")t=i.from(t,"binary");t=c.parse(t,l,"asn1");t.hashAlgorithm=e;t.curve=p;return t};return t};PrivateKey.parse=function(e,t,a){if(typeof e!=="string")r.buffer(e,"data");if(t===undefined)t="auto";r.string(t,"format");if(typeof a==="string")a={filename:a};r.optionalObject(a,"options");if(a===undefined)a={};r.optionalString(a.filename,"options.filename");if(a.filename===undefined)a.filename="(unnamed)";r.object(j[t],"formats[format]");try{var i=j[t].read(e,a);r.ok(i instanceof PrivateKey,"key is not a private key");if(!i.comment)i.comment=a.filename;return i}catch(e){if(e.name==="KeyEncryptedError")throw e;throw new w(a.filename,t,e)}};PrivateKey.isPrivateKey=function(e,t){return p.isCompatible(e,PrivateKey,t)};PrivateKey.generate=function(e,t){if(t===undefined)t={};r.object(t,"options");switch(e){case"ecdsa":if(t.curve===undefined)t.curve="nistp256";r.string(t.curve,"options.curve");return m(t.curve);case"ed25519":return h();default:throw new Error("Key generation not supported with key "+'type "'+e+'"')}};PrivateKey.prototype._sshpkApiVersion=[1,6];PrivateKey._oldVersionDetect=function(e){r.func(e.toPublic);r.func(e.createSign);if(e.derive)return[1,3];if(e.defaultHashAlgorithm)return[1,2];if(e.formats["auto"])return[1,1];return[1,0]}},1100:function(e,t,a){e.exports=Signature;var r=a(7179);var i=a(9392).Buffer;var o=a(6767);var n=a(6982);var s=a(8399);var c=a(4299);var u=a(1594);var l=a(6635);var p=s.InvalidAlgorithmError;var f=s.SignatureParseError;function Signature(e){r.object(e,"options");r.arrayOfObject(e.parts,"options.parts");r.string(e.type,"options.type");var t={};for(var a=0;a<e.parts.length;++a){var i=e.parts[a];t[i.name]=i}this.type=e.type;this.hashAlgorithm=e.hashAlgo;this.curve=e.curve;this.parts=e.parts;this.part=t}Signature.prototype.toBuffer=function(e){if(e===undefined)e="asn1";r.string(e,"format");var t;var a="ssh-"+this.type;switch(this.type){case"rsa":switch(this.hashAlgorithm){case"sha256":a="rsa-sha2-256";break;case"sha512":a="rsa-sha2-512";break;case"sha1":case undefined:break;default:throw new Error("SSH signature "+"format does not support hash "+"algorithm "+this.hashAlgorithm)}if(e==="ssh"){t=new l({});t.writeString(a);t.writePart(this.part.sig);return t.toBuffer()}else{return this.part.sig.data}break;case"ed25519":if(e==="ssh"){t=new l({});t.writeString(a);t.writePart(this.part.sig);return t.toBuffer()}else{return this.part.sig.data}break;case"dsa":case"ecdsa":var o,n;if(e==="asn1"){var s=new u.BerWriter;s.startSequence();o=c.mpNormalize(this.part.r.data);n=c.mpNormalize(this.part.s.data);s.writeBuffer(o,u.Ber.Integer);s.writeBuffer(n,u.Ber.Integer);s.endSequence();return s.buffer}else if(e==="ssh"&&this.type==="dsa"){t=new l({});t.writeString("ssh-dss");o=this.part.r.data;if(o.length>20&&o[0]===0)o=o.slice(1);n=this.part.s.data;if(n.length>20&&n[0]===0)n=n.slice(1);if(this.hashAlgorithm&&this.hashAlgorithm!=="sha1"||o.length+n.length!==40){throw new Error("OpenSSH only supports "+"DSA signatures with SHA1 hash")}t.writeBuffer(i.concat([o,n]));return t.toBuffer()}else if(e==="ssh"&&this.type==="ecdsa"){var p=new l({});o=this.part.r.data;p.writeBuffer(o);p.writePart(this.part.s);t=new l({});var f;if(o[0]===0)o=o.slice(1);var m=o.length*8;if(m===256)f="nistp256";else if(m===384)f="nistp384";else if(m===528)f="nistp521";t.writeString("ecdsa-sha2-"+f);t.writeBuffer(p.toBuffer());return t.toBuffer()}throw new Error("Invalid signature format");default:throw new Error("Invalid signature data")}};Signature.prototype.toString=function(e){r.optionalString(e,"format");return this.toBuffer(e).toString("base64")};Signature.parse=function(e,t,a){if(typeof e==="string")e=i.from(e,"base64");r.buffer(e,"data");r.string(a,"format");r.string(t,"type");var o={};o.type=t.toLowerCase();o.parts=[];try{r.ok(e.length>0,"signature must not be empty");switch(o.type){case"rsa":return parseOneNum(e,t,a,o);case"ed25519":return parseOneNum(e,t,a,o);case"dsa":case"ecdsa":if(a==="asn1")return parseDSAasn1(e,t,a,o);else if(o.type==="dsa")return parseDSA(e,t,a,o);else return parseECDSA(e,t,a,o);default:throw new p(t)}}catch(e){if(e instanceof p)throw e;throw new f(t,a,e)}};function parseOneNum(e,t,a,i){if(a==="ssh"){try{var o=new l({buffer:e});var n=o.readString()}catch(e){}if(o!==undefined){var s="SSH signature does not match expected "+"type (expected "+t+", got "+n+")";switch(n){case"ssh-rsa":r.strictEqual(t,"rsa",s);i.hashAlgo="sha1";break;case"rsa-sha2-256":r.strictEqual(t,"rsa",s);i.hashAlgo="sha256";break;case"rsa-sha2-512":r.strictEqual(t,"rsa",s);i.hashAlgo="sha512";break;case"ssh-ed25519":r.strictEqual(t,"ed25519",s);i.hashAlgo="sha512";break;default:throw new Error("Unknown SSH signature "+"type: "+n)}var c=o.readPart();r.ok(o.atEnd(),"extra trailing bytes");c.name="sig";i.parts.push(c);return new Signature(i)}}i.parts.push({name:"sig",data:e});return new Signature(i)}function parseDSAasn1(e,t,a,r){var i=new u.BerReader(e);i.readSequence();var o=i.readString(u.Ber.Integer,true);var n=i.readString(u.Ber.Integer,true);r.parts.push({name:"r",data:c.mpNormalize(o)});r.parts.push({name:"s",data:c.mpNormalize(n)});return new Signature(r)}function parseDSA(e,t,a,i){if(e.length!=40){var o=new l({buffer:e});var n=o.readBuffer();if(n.toString("ascii")==="ssh-dss")n=o.readBuffer();r.ok(o.atEnd(),"extra trailing bytes");r.strictEqual(n.length,40,"invalid inner length");e=n}i.parts.push({name:"r",data:e.slice(0,20)});i.parts.push({name:"s",data:e.slice(20,40)});return new Signature(i)}function parseECDSA(e,t,a,i){var o=new l({buffer:e});var n,s;var c=o.readBuffer();var u=c.toString("ascii");if(u.slice(0,6)==="ecdsa-"){var p=u.split("-");r.strictEqual(p[0],"ecdsa");r.strictEqual(p[1],"sha2");i.curve=p[2];switch(i.curve){case"nistp256":i.hashAlgo="sha256";break;case"nistp384":i.hashAlgo="sha384";break;case"nistp521":i.hashAlgo="sha512";break;default:throw new Error("Unsupported ECDSA curve: "+i.curve)}c=o.readBuffer();r.ok(o.atEnd(),"extra trailing bytes on outer");o=new l({buffer:c});n=o.readPart()}else{n={data:c}}s=o.readPart();r.ok(o.atEnd(),"extra trailing bytes");n.name="r";s.name="s";i.parts.push(n);i.parts.push(s);return new Signature(i)}Signature.isSignature=function(e,t){return c.isCompatible(e,Signature,t)};Signature.prototype._sshpkApiVersion=[2,1];Signature._oldVersionDetect=function(e){r.func(e.toBuffer);if(e.hasOwnProperty("hashAlgorithm"))return[2,0];return[1,0]}},6635:function(e,t,a){e.exports=SSHBuffer;var r=a(7179);var i=a(9392).Buffer;function SSHBuffer(e){r.object(e,"options");if(e.buffer!==undefined)r.buffer(e.buffer,"options.buffer");this._size=e.buffer?e.buffer.length:1024;this._buffer=e.buffer||i.alloc(this._size);this._offset=0}SSHBuffer.prototype.toBuffer=function(){return this._buffer.slice(0,this._offset)};SSHBuffer.prototype.atEnd=function(){return this._offset>=this._buffer.length};SSHBuffer.prototype.remainder=function(){return this._buffer.slice(this._offset)};SSHBuffer.prototype.skip=function(e){this._offset+=e};SSHBuffer.prototype.expand=function(){this._size*=2;var e=i.alloc(this._size);this._buffer.copy(e,0);this._buffer=e};SSHBuffer.prototype.readPart=function(){return{data:this.readBuffer()}};SSHBuffer.prototype.readBuffer=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4;r.ok(this._offset+e<=this._buffer.length,"length out of bounds at +0x"+this._offset.toString(16)+" (data truncated?)");var t=this._buffer.slice(this._offset,this._offset+e);this._offset+=e;return t};SSHBuffer.prototype.readString=function(){return this.readBuffer().toString()};SSHBuffer.prototype.readCString=function(){var e=this._offset;while(e<this._buffer.length&&this._buffer[e]!==0)e++;r.ok(e<this._buffer.length,"c string does not terminate");var t=this._buffer.slice(this._offset,e).toString();this._offset=e+1;return t};SSHBuffer.prototype.readInt=function(){var e=this._buffer.readUInt32BE(this._offset);this._offset+=4;return e};SSHBuffer.prototype.readInt64=function(){r.ok(this._offset+8<this._buffer.length,"buffer not long enough to read Int64");var e=this._buffer.slice(this._offset,this._offset+8);this._offset+=8;return e};SSHBuffer.prototype.readChar=function(){var e=this._buffer[this._offset++];return e};SSHBuffer.prototype.writeBuffer=function(e){while(this._offset+4+e.length>this._size)this.expand();this._buffer.writeUInt32BE(e.length,this._offset);this._offset+=4;e.copy(this._buffer,this._offset);this._offset+=e.length};SSHBuffer.prototype.writeString=function(e){this.writeBuffer(i.from(e,"utf8"))};SSHBuffer.prototype.writeCString=function(e){while(this._offset+1+e.length>this._size)this.expand();this._buffer.write(e,this._offset);this._offset+=e.length;this._buffer[this._offset++]=0};SSHBuffer.prototype.writeInt=function(e){while(this._offset+4>this._size)this.expand();this._buffer.writeUInt32BE(e,this._offset);this._offset+=4};SSHBuffer.prototype.writeInt64=function(e){r.buffer(e,"value");if(e.length>8){var t=e.slice(0,e.length-8);for(var a=0;a<t.length;++a){r.strictEqual(t[a],0,"must fit in 64 bits of precision")}e=e.slice(e.length-8,e.length)}while(this._offset+8>this._size)this.expand();e.copy(this._buffer,this._offset);this._offset+=8};SSHBuffer.prototype.writeChar=function(e){while(this._offset+1>this._size)this.expand();this._buffer[this._offset++]=e};SSHBuffer.prototype.writePart=function(e){this.writeBuffer(e.data)};SSHBuffer.prototype.write=function(e){while(this._offset+e.length>this._size)this.expand();e.copy(this._buffer,this._offset);this._offset+=e.length}},4299:function(e,t,a){e.exports={bufferSplit:bufferSplit,addRSAMissing:addRSAMissing,calculateDSAPublic:calculateDSAPublic,calculateED25519Public:calculateED25519Public,calculateX25519Public:calculateX25519Public,mpNormalize:mpNormalize,mpDenormalize:mpDenormalize,ecNormalize:ecNormalize,countZeros:countZeros,assertCompatible:assertCompatible,isCompatible:isCompatible,opensslKeyDeriv:opensslKeyDeriv,opensshCipherInfo:opensshCipherInfo,publicFromPrivateECDSA:publicFromPrivateECDSA,zeroPadToLength:zeroPadToLength,writeBitString:writeBitString,readBitString:readBitString,pbkdf2:pbkdf2};var r=a(7179);var i=a(9392).Buffer;var o=a(3879);var n=a(6837);var s=a(6982);var c=a(6767);var u=a(1594);var l=a(2751);var p=a(9894).BigInteger;var f=a(7567);var m=3;function isCompatible(e,t,a){if(e===null||typeof e!=="object")return false;if(a===undefined)a=t.prototype._sshpkApiVersion;if(e instanceof t&&t.prototype._sshpkApiVersion[0]==a[0])return true;var r=Object.getPrototypeOf(e);var i=0;while(r.constructor.name!==t.name){r=Object.getPrototypeOf(r);if(!r||++i>m)return false}if(r.constructor.name!==t.name)return false;var o=r._sshpkApiVersion;if(o===undefined)o=t._oldVersionDetect(e);if(o[0]!=a[0]||o[1]<a[1])return false;return true}function assertCompatible(e,t,a,i){if(i===undefined)i="object";r.ok(e,i+" must not be null");r.object(e,i+" must be an object");if(a===undefined)a=t.prototype._sshpkApiVersion;if(e instanceof t&&t.prototype._sshpkApiVersion[0]==a[0])return;var o=Object.getPrototypeOf(e);var n=0;while(o.constructor.name!==t.name){o=Object.getPrototypeOf(o);r.ok(o&&++n<=m,i+" must be a "+t.name+" instance")}r.strictEqual(o.constructor.name,t.name,i+" must be a "+t.name+" instance");var s=o._sshpkApiVersion;if(s===undefined)s=t._oldVersionDetect(e);r.ok(s[0]==a[0]&&s[1]>=a[1],i+" must be compatible with "+t.name+" klass "+"version "+a[0]+"."+a[1])}var h={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}};var g=8;function opensslKeyDeriv(e,t,a,o){r.buffer(t,"salt");r.buffer(a,"passphrase");r.number(o,"iteration count");var n=h[e];r.object(n,"supported cipher");t=t.slice(0,g);var c,u,l;var p=i.alloc(0);while(p.length<n.key+n.iv){l=[];if(u)l.push(u);l.push(a);l.push(t);c=i.concat(l);for(var f=0;f<o;++f)c=s.createHash("md5").update(c).digest();p=i.concat([p,c]);u=c}return{key:p.slice(0,n.key),iv:p.slice(n.key,n.key+n.iv)}}function pbkdf2(e,t,a,r,o){var n=i.alloc(t.length+4);t.copy(n);var c=0,u=[];var l=1;while(c<r){var p=T(l++);c+=p.length;u.push(p)}return i.concat(u).slice(0,r);function T(t){n.writeUInt32BE(t,n.length-4);var r=s.createHmac(e,o);r.update(n);var i=r.digest();var c=i;var u=1;while(u++<a){r=s.createHmac(e,o);r.update(c);c=r.digest();for(var l=0;l<i.length;++l)i[l]^=c[l]}return i}}function countZeros(e){var t=0,a=8;while(t<e.length){var r=1<<a;if((e[t]&r)===r)break;a--;if(a<0){t++;a=8}}return t*8+(8-a)-1}function bufferSplit(e,t){r.buffer(e);r.string(t);var a=[];var i=0;var o=0;for(var n=0;n<e.length;++n){if(e[n]===t.charCodeAt(o))++o;else if(e[n]===t.charCodeAt(0))o=1;else o=0;if(o>=t.length){var s=n+1;a.push(e.slice(i,s-o));i=s;o=0}}if(i<=e.length)a.push(e.slice(i,e.length));return a}function ecNormalize(e,t){r.buffer(e);if(e[0]===0&&e[1]===4){if(t)return e;return e.slice(1)}else if(e[0]===4){if(!t)return e}else{while(e[0]===0)e=e.slice(1);if(e[0]===2||e[0]===3)throw new Error("Compressed elliptic curve points "+"are not supported");if(e[0]!==4)throw new Error("Not a valid elliptic curve point");if(!t)return e}var a=i.alloc(e.length+1);a[0]=0;e.copy(a,1);return a}function readBitString(e,t){if(t===undefined)t=u.Ber.BitString;var a=e.readString(t,true);r.strictEqual(a[0],0,"bit strings with unused bits are "+"not supported (0x"+a[0].toString(16)+")");return a.slice(1)}function writeBitString(e,t,a){if(a===undefined)a=u.Ber.BitString;var r=i.alloc(t.length+1);r[0]=0;t.copy(r,1);e.writeBuffer(r,a)}function mpNormalize(e){r.buffer(e);while(e.length>1&&e[0]===0&&(e[1]&128)===0)e=e.slice(1);if((e[0]&128)===128){var t=i.alloc(e.length+1);t[0]=0;e.copy(t,1);e=t}return e}function mpDenormalize(e){r.buffer(e);while(e.length>1&&e[0]===0)e=e.slice(1);return e}function zeroPadToLength(e,t){r.buffer(e);r.number(t);while(e.length>t){r.equal(e[0],0);e=e.slice(1)}while(e.length<t){var a=i.alloc(e.length+1);a[0]=0;e.copy(a,1);e=a}return e}function bigintToMpBuf(e){var t=i.from(e.toByteArray());t=mpNormalize(t);return t}function calculateDSAPublic(e,t,a){r.buffer(e);r.buffer(t);r.buffer(a);e=new p(e);t=new p(t);a=new p(a);var i=e.modPow(a,t);var o=bigintToMpBuf(i);return o}function calculateED25519Public(e){r.buffer(e);var t=f.sign.keyPair.fromSeed(new Uint8Array(e));return i.from(t.publicKey)}function calculateX25519Public(e){r.buffer(e);var t=f.box.keyPair.fromSeed(new Uint8Array(e));return i.from(t.publicKey)}function addRSAMissing(e){r.object(e);assertCompatible(e,o,[1,1]);var t=new p(e.part.d.data);var a;if(!e.part.dmodp){var i=new p(e.part.p.data);var n=t.mod(i.subtract(1));a=bigintToMpBuf(n);e.part.dmodp={name:"dmodp",data:a};e.parts.push(e.part.dmodp)}if(!e.part.dmodq){var s=new p(e.part.q.data);var c=t.mod(s.subtract(1));a=bigintToMpBuf(c);e.part.dmodq={name:"dmodq",data:a};e.parts.push(e.part.dmodq)}}function publicFromPrivateECDSA(e,t){r.string(e,"curveName");r.buffer(t);var a=c.curves[e];var o=new p(a.p);var s=new p(a.a);var u=new p(a.b);var f=new l.ECCurveFp(o,s,u);var m=f.decodePointHex(a.G.toString("hex"));var h=new p(mpNormalize(t));var g=m.multiply(h);g=i.from(f.encodePointHex(g),"hex");var y=[];y.push({name:"curve",data:i.from(e)});y.push({name:"Q",data:g});var b=new n({type:"ecdsa",curve:f,parts:y});return b}function opensshCipherInfo(e){var t={};switch(e){case"3des-cbc":t.keySize=24;t.blockSize=8;t.opensslName="des-ede3-cbc";break;case"blowfish-cbc":t.keySize=16;t.blockSize=8;t.opensslName="bf-cbc";break;case"aes128-cbc":case"aes128-ctr":case"aes128-gcm@openssh.com":t.keySize=16;t.blockSize=16;t.opensslName="aes-128-"+e.slice(7,10);break;case"aes192-cbc":case"aes192-ctr":case"aes192-gcm@openssh.com":t.keySize=24;t.blockSize=16;t.opensslName="aes-192-"+e.slice(7,10);break;case"aes256-cbc":case"aes256-ctr":case"aes256-gcm@openssh.com":t.keySize=32;t.blockSize=16;t.opensslName="aes-256-"+e.slice(7,10);break;default:throw new Error('Unsupported openssl cipher "'+e+'"')}return t}},8659:function(e){const t=/^[-+]?0x[a-fA-F0-9]+$/;const a=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;const r={hex:true,leadingZeros:true,decimalPoint:".",eNotation:true};function toNumber(e,i={}){i=Object.assign({},r,i);if(!e||typeof e!=="string")return e;let o=e.trim();if(i.skipLike!==undefined&&i.skipLike.test(o))return e;else if(e==="0")return 0;else if(i.hex&&t.test(o)){return parse_int(o,16)}else if(o.search(/[eE]/)!==-1){const t=o.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(t){if(i.leadingZeros){o=(t[1]||"")+t[3]}else{if(t[2]==="0"&&t[3][0]==="."){}else{return e}}return i.eNotation?Number(o):e}else{return e}}else{const t=a.exec(o);if(t){const a=t[1];const r=t[2];let n=trimZeros(t[3]);if(!i.leadingZeros&&r.length>0&&a&&o[2]!==".")return e;else if(!i.leadingZeros&&r.length>0&&!a&&o[1]!==".")return e;else if(i.leadingZeros&&r===e)return 0;else{const t=Number(o);const s=""+t;if(s.search(/[eE]/)!==-1){if(i.eNotation)return t;else return e}else if(o.indexOf(".")!==-1){if(s==="0"&&n==="")return t;else if(s===n)return t;else if(a&&s==="-"+n)return t;else return e}if(r){return n===s||a+n===s?t:e}else{return o===s||o===a+s?t:e}}}else{return e}}}function trimZeros(e){if(e&&e.indexOf(".")!==-1){e=e.replace(/0+$/,"");if(e===".")e="0";else if(e[0]===".")e="0"+e;else if(e[e.length-1]===".")e=e.substr(0,e.length-1);return e}return e}function parse_int(e,t){if(parseInt)return parseInt(e,t);else if(Number.parseInt)return Number.parseInt(e,t);else if(window&&window.parseInt)return window.parseInt(e,t);else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}e.exports=toNumber},737:function(e,t,a){"use strict";
39
39
  /*!