@sap/generator-fiori
Version:
Create an SAPUI5 application using SAP Fiori elements or a freestyle approach
9 lines • 1.02 MB
JavaScript
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href;
var oo=Object.create;var gr=Object.defineProperty;var so=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var uo=Object.getPrototypeOf,po=Object.prototype.hasOwnProperty;var k=(f,x)=>gr(f,"name",{value:x,configurable:!0});var Et=(f,x)=>()=>{try{return x||f((x={exports:{}}).exports,x),x.exports}catch(a){throw x=0,a}},lo=(f,x)=>{for(var a in x)gr(f,a,{get:x[a],enumerable:!0})},$a=(f,x,a,e)=>{if(x&&typeof x=="object"||typeof x=="function")for(let o of co(x))!po.call(f,o)&&o!==a&&gr(f,o,{get:()=>x[o],enumerable:!(e=so(x,o))||e.enumerable});return f};var vr=(f,x,a)=>(a=f!=null?oo(uo(f)):{},$a(x||!f||!f.__esModule?gr(a,"default",{value:f,enumerable:!0}):a,f)),ho=f=>$a(gr({},"__esModule",{value:!0}),f);var Ka=Et((Cc,Ga)=>{"use strict";var mo=require("fs"),fo=require("os"),ma=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");global[ma]||Object.defineProperty(global,ma,{value:mo.realpathSync(fo.tmpdir())});Ga.exports=global[ma]});var Ya=Et((Oc,Wa)=>{Wa.exports=Xa;Xa.sync=vo;var Va=require("fs");function go(f,x){var a=x.pathExt!==void 0?x.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var e=0;e<a.length;e++){var o=a[e].toLowerCase();if(o&&f.substr(-o.length).toLowerCase()===o)return!0}return!1}k(go,"checkPathExt");function Qa(f,x,a){return!f.isSymbolicLink()&&!f.isFile()?!1:go(x,a)}k(Qa,"checkStat");function Xa(f,x,a){Va.stat(f,function(e,o){a(e,e?!1:Qa(o,f,x))})}k(Xa,"isexe");function vo(f,x){return Qa(Va.statSync(f),f,x)}k(vo,"sync")});var ri=Et((Ic,ti)=>{ti.exports=Ja;Ja.sync=yo;var Za=require("fs");function Ja(f,x,a){Za.stat(f,function(e,o){a(e,e?!1:ei(o,x))})}k(Ja,"isexe");function yo(f,x){return ei(Za.statSync(f),x)}k(yo,"sync");function ei(f,x){return f.isFile()&&bo(f,x)}k(ei,"checkStat");function bo(f,x){var a=f.mode,e=f.uid,o=f.gid,h=x.uid!==void 0?x.uid:process.getuid&&process.getuid(),t=x.gid!==void 0?x.gid:process.getgid&&process.getgid(),n=parseInt("100",8),r=parseInt("010",8),i=parseInt("001",8),d=n|r,u=a&i||a&r&&o===t||a&n&&e===h||a&d&&h===0;return u}k(bo,"checkMode")});var ii=Et((qc,ai)=>{var Dc=require("fs"),zr;process.platform==="win32"||global.TESTING_WINDOWS?zr=Ya():zr=ri();ai.exports=da;da.sync=ko;function da(f,x,a){if(typeof x=="function"&&(a=x,x={}),!a){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(e,o){da(f,x||{},function(h,t){h?o(h):e(t)})})}zr(f,x||{},function(e,o){e&&(e.code==="EACCES"||x&&x.ignoreErrors)&&(e=null,o=!1),a(e,o)})}k(da,"isexe");function ko(f,x){try{return zr.sync(f,x||{})}catch(a){if(x&&x.ignoreErrors||a.code==="EACCES")return!1;throw a}}k(ko,"sync")});var li=Et((Nc,pi)=>{var or=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ni=require("path"),wo=or?";":":",oi=ii(),si=k(f=>Object.assign(new Error(`not found: ${f}`),{code:"ENOENT"}),"getNotFoundError"),ci=k((f,x)=>{let a=x.colon||wo,e=f.match(/\//)||or&&f.match(/\\/)?[""]:[...or?[process.cwd()]:[],...(x.path||process.env.PATH||"").split(a)],o=or?x.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",h=or?o.split(a):[""];return or&&f.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:e,pathExt:h,pathExtExe:o}},"getPathInfo"),ui=k((f,x,a)=>{typeof x=="function"&&(a=x,x={}),x||(x={});let{pathEnv:e,pathExt:o,pathExtExe:h}=ci(f,x),t=[],n=k(i=>new Promise((d,u)=>{if(i===e.length)return x.all&&t.length?d(t):u(si(f));let v=e[i],m=/^".*"$/.test(v)?v.slice(1,-1):v,c=ni.join(m,f),p=!m&&/^\.[\\\/]/.test(f)?f.slice(0,2)+c:c;d(r(p,i,0))}),"step"),r=k((i,d,u)=>new Promise((v,m)=>{if(u===o.length)return v(n(d+1));let c=o[u];oi(i+c,{pathExt:h},(p,s)=>{if(!p&&s)if(x.all)t.push(i+c);else return v(i+c);return v(r(i,d,u+1))})}),"subStep");return a?n(0).then(i=>a(null,i),a):n(0)},"which"),xo=k((f,x)=>{x=x||{};let{pathEnv:a,pathExt:e,pathExtExe:o}=ci(f,x),h=[];for(let t=0;t<a.length;t++){let n=a[t],r=/^".*"$/.test(n)?n.slice(1,-1):n,i=ni.join(r,f),d=!r&&/^\.[\\\/]/.test(f)?f.slice(0,2)+i:i;for(let u=0;u<e.length;u++){let v=d+e[u];try{if(oi.sync(v,{pathExt:o}))if(x.all)h.push(v);else return v}catch{}}}if(x.all&&h.length)return h;if(x.nothrow)return null;throw si(f)},"whichSync");pi.exports=ui;ui.sync=xo});var fa=Et(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.isCloudMtaNotInstalledError=jt.ensureCloudMtaInstalledInPath=jt.ensureCloudMtaInstalled=jt.createCloudMtaNotInstalledError=jt.CloudMtaVersionMismatchError=jt.CloudMtaNotInstalledError=jt.setMtaCommandParamsForTests=jt.MIN_CLOUD_MTA_VERSION=void 0;var hi=ga(),mi=["-v"],yr={major:1,minor:0,patch:0},di=yr;jt.MIN_CLOUD_MTA_VERSION=`${yr.major}.${yr.minor}.${yr.patch}`;function jo(f){var x,a;mi=(x=f.flags)!==null&&x!==void 0?x:["-v"],di=(a=f.minVersion)!==null&&a!==void 0?a:yr}k(jo,"setMtaCommandParamsForTests");jt.setMtaCommandParamsForTests=jo;var Dr={CLOUD_MTA_NOT_INSTALLED:"Cloud MTA is not installed in your environment. Go to https://github.com/SAP/cloud-mta to install the tool and try again.",CLOUD_MTA_UNKNOWN_VERSION:"Could not determine which Cloud MTA version is installed in your system. Go to https://github.com/SAP/cloud-mta to install the tool and try again.",CLOUD_MTA_VERSION_MISMATCH:`The Cloud MTA version is lower than the minimal supported version (${jt.MIN_CLOUD_MTA_VERSION}). Go to https://github.com/SAP/cloud-mta to install the tool and try again.`},br=class extends Error{static{k(this,"CloudMtaNotInstalledError")}};jt.CloudMtaNotInstalledError=br;var sr=class extends Error{static{k(this,"CloudMtaVersionMismatchError")}};jt.CloudMtaVersionMismatchError=sr;function fi(){return new br(Dr.CLOUD_MTA_NOT_INSTALLED)}k(fi,"createCloudMtaNotInstalledError");jt.createCloudMtaNotInstalledError=fi;async function _o(){return gi(await hi.getMtaCommand())}k(_o,"ensureCloudMtaInstalled");jt.ensureCloudMtaInstalled=_o;async function gi(f){let x;try{x=await hi.runProcess(f,mi)}catch(e){throw e.code==="ENOENT"?fi():new sr(Dr.CLOUD_MTA_UNKNOWN_VERSION)}let a=/(\d+)\.(\d+)\.(\d+)/.exec(x);if(a===null)throw new sr(Dr.CLOUD_MTA_UNKNOWN_VERSION);{let e={major:Number(a[1]),minor:Number(a[2]),patch:Number(a[3])};if(Eo(e,di))throw new sr(Dr.CLOUD_MTA_VERSION_MISMATCH)}}k(gi,"ensureCloudMtaInstalledInPath");jt.ensureCloudMtaInstalledInPath=gi;function So(f){return f instanceof br}k(So,"isCloudMtaNotInstalledError");jt.isCloudMtaNotInstalledError=So;function Eo(f,x){return f.major<x.major||f.major===x.major&&f.minor<x.minor||f.major===x.major&&f.minor===x.minor&&f.patch<x.patch}k(Eo,"isVersionLower")});var bi=Et((Hc,yi)=>{yi.exports=(function(f){var x={};function a(e){if(x[e])return x[e].exports;var o=x[e]={i:e,l:!1,exports:{}};return f[e].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return k(a,"a"),a.m=f,a.c=x,a.d=function(e,o,h){a.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:h})},a.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,o){if(1&o&&(e=a(e)),8&o||4&o&&typeof e=="object"&&e&&e.__esModule)return e;var h=Object.create(null);if(a.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:e}),2&o&&typeof e!="string")for(var t in e)a.d(h,t,function(n){return e[n]}.bind(null,t));return h},a.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(o,"a",o),o},a.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},a.p="",a(a.s=118)})([function(f,x,a){var e=a(20),o=a(11).Stream,h=a(1),t=/^[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 n(v){return v.charAt(0).toUpperCase()+v.slice(1)}k(n,"s");function r(v,m,c,p,s){throw new e.AssertionError({message:h.format("%s (%s) is required",v,m),actual:s===void 0?typeof p:s(p),expected:m,operator:c||"===",stackStartFunction:r.caller})}k(r,"c");function i(v){return Object.prototype.toString.call(v).slice(8,-1)}k(i,"u");function d(){}k(d,"p");var u={bool:{check:k(function(v){return typeof v=="boolean"},"check")},func:{check:k(function(v){return typeof v=="function"},"check")},string:{check:k(function(v){return typeof v=="string"},"check")},object:{check:k(function(v){return typeof v=="object"&&v!==null},"check")},number:{check:k(function(v){return typeof v=="number"&&!isNaN(v)},"check")},finite:{check:k(function(v){return typeof v=="number"&&!isNaN(v)&&isFinite(v)},"check")},buffer:{check:k(function(v){return Buffer.isBuffer(v)},"check"),operator:"Buffer.isBuffer"},array:{check:k(function(v){return Array.isArray(v)},"check"),operator:"Array.isArray"},stream:{check:k(function(v){return v instanceof o},"check"),operator:"instanceof",actual:i},date:{check:k(function(v){return v instanceof Date},"check"),operator:"instanceof",actual:i},regexp:{check:k(function(v){return v instanceof RegExp},"check"),operator:"instanceof",actual:i},uuid:{check:k(function(v){return typeof v=="string"&&t.test(v)},"check"),operator:"isUUID"}};f.exports=k(function v(m){var c,p=Object.keys(u);return c=process.env.NODE_NDEBUG?d:function(s,l){s||r(l,"true",s)},p.forEach((function(s){if(m)c[s]=d;else{var l=u[s];c[s]=function(g,y){l.check(g)||r(y,s,l.operator,g,l.actual)}}})),p.forEach((function(s){var l="optional"+n(s);if(m)c[l]=d;else{var g=u[s];c[l]=function(y,b){y!=null&&(g.check(y)||r(b,s,g.operator,y,g.actual))}}})),p.forEach((function(s){var l="arrayOf"+n(s);if(m)c[l]=d;else{var g=u[s],y="["+s+"]";c[l]=function(b,w){var S;for(Array.isArray(b)||r(w,y,g.operator,b,g.actual),S=0;S<b.length;S++)g.check(b[S])||r(w,y,g.operator,b,g.actual)}}})),p.forEach((function(s){var l="optionalArrayOf"+n(s);if(m)c[l]=d;else{var g=u[s],y="["+s+"]";c[l]=function(b,w){var S;if(b!=null)for(Array.isArray(b)||r(w,y,g.operator,b,g.actual),S=0;S<b.length;S++)g.check(b[S])||r(w,y,g.operator,b,g.actual)}}})),Object.keys(e).forEach((function(s){c[s]=s!=="AssertionError"&&m?d:e[s]})),c._setExports=v,c},"e")(process.env.NODE_NDEBUG)},function(f,x){f.exports=require("util")},function(f,x,a){"use strict";var e,o=a(48),h=o.Buffer,t={};for(e in o)o.hasOwnProperty(e)&&e!=="SlowBuffer"&&e!=="Buffer"&&(t[e]=o[e]);var n=t.Buffer={};for(e in h)h.hasOwnProperty(e)&&e!=="allocUnsafe"&&e!=="allocUnsafeSlow"&&(n[e]=h[e]);if(t.Buffer.prototype=h.prototype,n.from&&n.from!==Uint8Array.from||(n.from=function(r,i,d){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&r.length===void 0)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return h(r,i,d)}),n.alloc||(n.alloc=function(r,i,d){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var u=h(r);return i&&i.length!==0?typeof d=="string"?u.fill(i,d):u.fill(i):u.fill(0),u}),!t.kStringMaxLength)try{t.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}t.constants||(t.constants={MAX_LENGTH:t.kMaxLength},t.kStringMaxLength&&(t.constants.MAX_STRING_LENGTH=t.kStringMaxLength)),f.exports=t},function(f,x,a){"use strict";var e=a(23),o=typeof navigator>"u",h={e:{}},t,n=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:this!==void 0?this:null;function r(){try{var X=t;return t=null,X.apply(this,arguments)}catch(M){return h.e=M,h}}k(r,"c");function i(X){return t=X,r}k(i,"u");var d=k(function(X,M){var R={}.hasOwnProperty;function ae(){for(var ee in this.constructor=X,this.constructor$=M,M.prototype)R.call(M.prototype,ee)&&ee.charAt(ee.length-1)!=="$"&&(this[ee+"$"]=M.prototype[ee])}return k(ae,"r"),ae.prototype=M.prototype,X.prototype=new ae,X.prototype},"p");function u(X){return X==null||X===!0||X===!1||typeof X=="string"||typeof X=="number"}k(u,"l");function v(X){return typeof X=="function"||typeof X=="object"&&X!==null}k(v,"h");function m(X){return u(X)?new Error(A(X)):X}k(m,"m");function c(X,M){var R,ae=X.length,ee=new Array(ae+1);for(R=0;R<ae;++R)ee[R]=X[R];return ee[R]=M,ee}k(c,"d");function p(X,M,R){if(!e.isES5)return{}.hasOwnProperty.call(X,M)?X[M]:void 0;var ae=Object.getOwnPropertyDescriptor(X,M);return ae!=null?ae.get==null&&ae.set==null?ae.value:R:void 0}k(p,"f");function s(X,M,R){if(u(X))return X;var ae={value:R,configurable:!0,enumerable:!1,writable:!0};return e.defineProperty(X,M,ae),X}k(s,"g");function l(X){throw X}k(l,"v");var g=(function(){var X=[Array.prototype,Object.prototype,Function.prototype],M=k(function(ee){for(var ie=0;ie<X.length;++ie)if(X[ie]===ee)return!0;return!1},"t");if(e.isES5){var R=Object.getOwnPropertyNames;return function(ee){for(var ie=[],se=Object.create(null);ee!=null&&!M(ee);){var we;try{we=R(ee)}catch{return ie}for(var le=0;le<we.length;++le){var _e=we[le];if(!se[_e]){se[_e]=!0;var ke=Object.getOwnPropertyDescriptor(ee,_e);ke!=null&&ke.get==null&&ke.set==null&&ie.push(_e)}}ee=e.getPrototypeOf(ee)}return ie}}var ae={}.hasOwnProperty;return function(ee){if(M(ee))return[];var ie=[];e:for(var se in ee)if(ae.call(ee,se))ie.push(se);else{for(var we=0;we<X.length;++we)if(ae.call(X[we],se))continue e;ie.push(se)}return ie}})(),y=/this\s*\.\s*\S+\s*=/;function b(X){try{if(typeof X=="function"){var M=e.names(X.prototype),R=e.isES5&&M.length>1,ae=M.length>0&&!(M.length===1&&M[0]==="constructor"),ee=y.test(X+"")&&e.names(X).length>0;if(R||ae||ee)return!0}return!1}catch{return!1}}k(b,"k");function w(X){function M(){}k(M,"t"),M.prototype=X;var R=new M;function ae(){return typeof R.foo}return k(ae,"r"),ae(),ae(),X}k(w,"x");var S=/^[a-z$_][a-z$_0-9]*$/i;function E(X){return S.test(X)}k(E,"j");function P(X,M,R){for(var ae=new Array(X),ee=0;ee<X;++ee)ae[ee]=M+ee+R;return ae}k(P,"_");function A(X){try{return X+""}catch{return"[no string representation]"}}k(A,"E");function F(X){return X instanceof Error||X!==null&&typeof X=="object"&&typeof X.message=="string"&&typeof X.name=="string"}k(F,"S");function O(X){try{s(X,"isOperational",!0)}catch{}}k(O,"F");function H(X){return X!=null&&(X instanceof Error.__BluebirdErrorTypes__.OperationalError||X.isOperational===!0)}k(H,"P");function G(X){return F(X)&&e.propertyIsWritable(X,"stack")}k(G,"z");var z="stack"in new Error?function(X){return G(X)?X:new Error(A(X))}:function(X){if(G(X))return X;try{throw new Error(A(X))}catch(M){return M}};function $(X){return{}.toString.call(X)}k($,"A");function K(X,M,R){for(var ae=e.names(X),ee=0;ee<ae.length;++ee){var ie=ae[ee];if(R(ie))try{e.defineProperty(M,ie,e.getDescriptor(X,ie))}catch{}}}k(K,"C");var V=k(function(X){return e.isArray(X)?X:null},"T");if(typeof Symbol<"u"&&Symbol.iterator){var Y=typeof Array.from=="function"?function(X){return Array.from(X)}:function(X){for(var M,R=[],ae=X[Symbol.iterator]();!(M=ae.next()).done;)R.push(M.value);return R};V=k(function(X){return e.isArray(X)?X:X!=null&&typeof X[Symbol.iterator]=="function"?Y(X):null},"T")}var J=typeof process<"u"&&$(process).toLowerCase()==="[object process]",L=typeof process<"u"&&process.env!==void 0,Q;function j(X){return L?process.env[X]:void 0}k(j,"q");function _(){if(typeof Promise=="function")try{if($(new Promise((function(){})))==="[object Promise]")return Promise}catch{}}k(_,"L");function C(X,M){if(X===null||typeof M!="function"||M===Q)return M;X.domain!==null&&(M=X.domain.bind(M));var R=X.async;if(R!==null){var ae=M;M=k(function(){for(var ee=arguments.length+2,ie=new Array(ee),se=2;se<ee;++se)ie[se]=arguments[se-2];return ie[0]=ae,ie[1]=this,R.runInAsyncScope.apply(R,ie)},"t")}return M}k(C,"N");var N={setReflectHandler:k(function(X){Q=X},"setReflectHandler"),isClass:b,isIdentifier:E,inheritedDataKeys:g,getDataPropertyOrDefault:p,thrower:l,isArray:e.isArray,asArray:V,notEnumerableProp:s,isPrimitive:u,isObject:v,isError:F,canEvaluate:o,errorObj:h,tryCatch:i,inherits:d,withAppended:c,maybeWrapAsError:m,toFastProperties:w,filledRange:P,toString:A,canAttachTrace:G,ensureErrorObject:z,originatesFromRejection:H,markAsOriginatingFromRejection:O,classString:$,copyDescriptors:K,isNode:J,hasEnvVariables:L,env:j,global:n,getNativePromise:_,contextBind:C},W;N.isRecentNode=N.isNode&&(process.versions&&process.versions.node?W=process.versions.node.split(".").map(Number):process.version&&(W=process.version.split(".").map(Number)),W[0]===0&&W[1]>10||W[0]>0),N.nodeSupportsAsyncResource=N.isNode&&(function(){var X=!1;try{X=typeof a(110).AsyncResource.prototype.runInAsyncScope=="function"}catch{X=!1}return X})(),N.isNode&&N.toFastProperties(process);try{throw new Error}catch(X){N.lastLineError=X}f.exports=N},function(f,x){f.exports=require("crypto")},function(f,x){f.exports=require("path")},function(f,x,a){f.exports=s;var e,o=a(0),h=a(10),t=a(4),n=a(27),r=a(13),i=a(53).DiffieHellman,d=a(12),u=a(7),v=a(9);try{e=a(75)}catch{}var m=d.InvalidAlgorithmError,c=d.KeyParseError,p={};function s(l){o.object(l,"options"),o.arrayOfObject(l.parts,"options.parts"),o.string(l.type,"options.type"),o.optionalString(l.comment,"options.comment");var g=h.info[l.type];if(typeof g!="object")throw new m(l.type);for(var y,b={},w=0;w<l.parts.length;++w){var S=l.parts[w];b[S.name]=S}if(this.type=l.type,this.parts=l.parts,this.part=b,this.comment=void 0,this.source=l.source,this._rfc4253Cache=l._rfc4253Cache,this._hashCache={},this.curve=void 0,this.type==="ecdsa"){var E=this.part.curve.data.toString();this.curve=E,y=h.curves[E].size}else if(this.type==="ed25519"||this.type==="curve25519")y=256,this.curve="curve25519";else{var P=this.part[g.sizePart];y=8*(y=P.data.length)-u.countZeros(P.data)}this.size=y}k(s,"g"),p.auto=a(76),p.pem=a(16),p.pkcs1=a(54),p.pkcs8=a(31),p.rfc4253=a(17),p.ssh=a(78),p["ssh-private"]=a(41),p.openssh=p["ssh-private"],p.dnssec=a(55),p.putty=a(79),p.ppk=p.putty,s.formats=p,s.prototype.toBuffer=function(l,g){return l===void 0&&(l="ssh"),o.string(l,"format"),o.object(p[l],"formats[format]"),o.optionalObject(g,"options"),l==="rfc4253"?(this._rfc4253Cache===void 0&&(this._rfc4253Cache=p.rfc4253.write(this)),this._rfc4253Cache):p[l].write(this,g)},s.prototype.toString=function(l,g){return this.toBuffer(l,g).toString()},s.prototype.hash=function(l,g){if(o.string(l,"algorithm"),o.optionalString(g,"type"),g===void 0&&(g="ssh"),l=l.toLowerCase(),h.hashAlgs[l]===void 0)throw new m(l);var y,b=l+"||"+g;if(this._hashCache[b])return this._hashCache[b];if(g==="ssh")y=this.toBuffer("rfc4253");else{if(g!=="spki")throw new Error("Hash type "+g+" not supported");y=p.pkcs8.pkcs8ToBuffer(this)}var w=t.createHash(l).update(y).digest();return this._hashCache[b]=w,w},s.prototype.fingerprint=function(l,g){l===void 0&&(l="sha256"),g===void 0&&(g="ssh"),o.string(l,"algorithm"),o.string(g,"type");var y={type:"key",hash:this.hash(l,g),algorithm:l,hashType:g};return new n(y)},s.prototype.defaultHashAlgorithm=function(){var l="sha1";return this.type==="rsa"&&(l="sha256"),this.type==="dsa"&&this.size>1024&&(l="sha256"),this.type==="ed25519"&&(l="sha512"),this.type==="ecdsa"&&(l=this.size<=256?"sha256":this.size<=384?"sha384":"sha512"),l},s.prototype.createVerify=function(l){if(l===void 0&&(l=this.defaultHashAlgorithm()),o.string(l,"hash algorithm"),this.type==="ed25519"&&e!==void 0)return new e.Verifier(this,l);if(this.type==="curve25519")throw new Error("Curve25519 keys are not suitable for signing or verification");var g,y,b;try{y=l.toUpperCase(),g=t.createVerify(y)}catch(A){b=A}(g===void 0||b instanceof Error&&b.message.match(/Unknown message digest/))&&(y="RSA-",y+=l.toUpperCase(),g=t.createVerify(y)),o.ok(g,"failed to create verifier");var w=g.verify.bind(g),S=this.toBuffer("pkcs8"),E=this.curve,P=this;return g.verify=function(A,F){if(r.isSignature(A,[2,0]))return A.type===P.type&&(!A.hashAlgorithm||A.hashAlgorithm===l)&&(!A.curve||P.type!=="ecdsa"||A.curve===E)&&w(S,A.toBuffer("asn1"));if(typeof A=="string"||Buffer.isBuffer(A))return w(S,A,F);throw r.isSignature(A,[1,0])?new Error("signature was created by too old a version of sshpk and cannot be verified"):new TypeError("signature must be a string, Buffer, or Signature object")},g},s.prototype.createDiffieHellman=function(){if(this.type==="rsa")throw new Error("RSA keys do not support Diffie-Hellman");return new i(this)},s.prototype.createDH=s.prototype.createDiffieHellman,s.parse=function(l,g,y){typeof l!="string"&&o.buffer(l,"data"),g===void 0&&(g="auto"),o.string(g,"format"),typeof y=="string"&&(y={filename:y}),o.optionalObject(y,"options"),y===void 0&&(y={}),o.optionalString(y.filename,"options.filename"),y.filename===void 0&&(y.filename="(unnamed)"),o.object(p[g],"formats[format]");try{var b=p[g].read(l,y);return b instanceof v&&(b=b.toPublic()),b.comment||(b.comment=y.filename),b}catch(w){throw w.name==="KeyEncryptedError"?w:new c(y.filename,g,w)}},s.isKey=function(l,g){return u.isCompatible(l,s,g)},s.prototype._sshpkApiVersion=[1,7],s._oldVersionDetect=function(l){return o.func(l.toBuffer),o.func(l.fingerprint),l.createDH?[1,4]:l.defaultHashAlgorithm?[1,3]:l.formats.auto?[1,2]:l.formats.pkcs1?[1,1]:[1,0]}},function(f,x,a){f.exports={bufferSplit:k(function(l,g){e.buffer(l),e.string(g);for(var y=[],b=0,w=0,S=0;S<l.length;++S)if(l[S]===g.charCodeAt(w)?++w:w=l[S]===g.charCodeAt(0)?1:0,w>=g.length){var E=S+1;y.push(l.slice(b,E-w)),b=E,w=0}return b<=l.length&&y.push(l.slice(b,l.length)),y},"bufferSplit"),addRSAMissing:k(function(l){e.object(l),m(l,h,[1,1]);var g,y=new u(l.part.d.data);if(!l.part.dmodp){var b=new u(l.part.p.data),w=y.mod(b.subtract(1));g=s(w),l.part.dmodp={name:"dmodp",data:g},l.parts.push(l.part.dmodp)}if(!l.part.dmodq){var S=new u(l.part.q.data),E=y.mod(S.subtract(1));g=s(E),l.part.dmodq={name:"dmodq",data:g},l.parts.push(l.part.dmodq)}},"addRSAMissing"),calculateDSAPublic:k(function(l,g,y){return e.buffer(l),e.buffer(g),e.buffer(y),l=new u(l),g=new u(g),y=new u(y),s(l.modPow(y,g))},"calculateDSAPublic"),calculateED25519Public:k(function(l){e.buffer(l);var g=v.sign.keyPair.fromSeed(new Uint8Array(l));return o.from(g.publicKey)},"calculateED25519Public"),calculateX25519Public:k(function(l){e.buffer(l);var g=v.box.keyPair.fromSeed(new Uint8Array(l));return o.from(g.publicKey)},"calculateX25519Public"),mpNormalize:p,mpDenormalize:k(function(l){for(e.buffer(l);l.length>1&&l[0]===0;)l=l.slice(1);return l},"mpDenormalize"),ecNormalize:k(function(l,g){if(e.buffer(l),l[0]===0&&l[1]===4)return g?l:l.slice(1);if(l[0]===4){if(!g)return l}else{for(;l[0]===0;)l=l.slice(1);if(l[0]===2||l[0]===3)throw new Error("Compressed elliptic curve points are not supported");if(l[0]!==4)throw new Error("Not a valid elliptic curve point");if(!g)return l}var y=o.alloc(l.length+1);return y[0]=0,l.copy(y,1),y},"ecNormalize"),countZeros:k(function(l){for(var g=0,y=8;g<l.length;){var b=1<<y;if((l[g]&b)===b)break;--y<0&&(g++,y=8)}return 8*g+(8-y)-1},"countZeros"),assertCompatible:m,isCompatible:k(function(l,g,y){if(l===null||typeof l!="object")return!1;if(y===void 0&&(y=g.prototype._sshpkApiVersion),l instanceof g&&g.prototype._sshpkApiVersion[0]==y[0])return!0;for(var b=Object.getPrototypeOf(l),w=0;b.constructor.name!==g.name;)if(!(b=Object.getPrototypeOf(b))||++w>3)return!1;if(b.constructor.name!==g.name)return!1;var S=b._sshpkApiVersion;return S===void 0&&(S=g._oldVersionDetect(l)),!(S[0]!=y[0]||S[1]<y[1])},"isCompatible"),opensslKeyDeriv:k(function(l,g,y,b){e.buffer(g,"salt"),e.buffer(y,"passphrase"),e.number(b,"iteration count");var w,S,E,P=c[l];e.object(P,"supported cipher"),g=g.slice(0,8);for(var A=o.alloc(0);A.length<P.key+P.iv;){E=[],S&&E.push(S),E.push(y),E.push(g),w=o.concat(E);for(var F=0;F<b;++F)w=n.createHash("md5").update(w).digest();A=o.concat([A,w]),S=w}return{key:A.slice(0,P.key),iv:A.slice(P.key,P.key+P.iv)}},"opensslKeyDeriv"),opensshCipherInfo:k(function(l){var g={};switch(l){case"3des-cbc":g.keySize=24,g.blockSize=8,g.opensslName="des-ede3-cbc";break;case"blowfish-cbc":g.keySize=16,g.blockSize=8,g.opensslName="bf-cbc";break;case"aes128-cbc":case"aes128-ctr":case"aes128-gcm@openssh.com":g.keySize=16,g.blockSize=16,g.opensslName="aes-128-"+l.slice(7,10);break;case"aes192-cbc":case"aes192-ctr":case"aes192-gcm@openssh.com":g.keySize=24,g.blockSize=16,g.opensslName="aes-192-"+l.slice(7,10);break;case"aes256-cbc":case"aes256-ctr":case"aes256-gcm@openssh.com":g.keySize=32,g.blockSize=16,g.opensslName="aes-256-"+l.slice(7,10);break;default:throw new Error('Unsupported openssl cipher "'+l+'"')}return g},"opensshCipherInfo"),publicFromPrivateECDSA:k(function(l,g){e.string(l,"curveName"),e.buffer(g);var y=r.curves[l],b=new u(y.p),w=new u(y.a),S=new u(y.b),E=new d.ECCurveFp(b,w,S),P=E.decodePointHex(y.G.toString("hex")),A=new u(p(g)),F=P.multiply(A);F=o.from(E.encodePointHex(F),"hex");var O=[];return O.push({name:"curve",data:o.from(l)}),O.push({name:"Q",data:F}),new t({type:"ecdsa",curve:E,parts:O})},"publicFromPrivateECDSA"),zeroPadToLength:k(function(l,g){for(e.buffer(l),e.number(g);l.length>g;)e.equal(l[0],0),l=l.slice(1);for(;l.length<g;){var y=o.alloc(l.length+1);y[0]=0,l.copy(y,1),l=y}return l},"zeroPadToLength"),writeBitString:k(function(l,g,y){y===void 0&&(y=i.Ber.BitString);var b=o.alloc(g.length+1);b[0]=0,g.copy(b,1),l.writeBuffer(b,y)},"writeBitString"),readBitString:k(function(l,g){g===void 0&&(g=i.Ber.BitString);var y=l.readString(g,!0);return e.strictEqual(y[0],0,"bit strings with unused bits are not supported (0x"+y[0].toString(16)+")"),y.slice(1)},"readBitString"),pbkdf2:k(function(l,g,y,b,w){var S=o.alloc(g.length+4);g.copy(S);for(var E=0,P=[],A=1;E<b;){var F=O(A++);E+=F.length,P.push(F)}return o.concat(P).slice(0,b);function O(H){S.writeUInt32BE(H,S.length-4);var G=n.createHmac(l,w);G.update(S);for(var z=G.digest(),$=z,K=1;K++<y;){(G=n.createHmac(l,w)).update($),$=G.digest();for(var V=0;V<z.length;++V)z[V]^=$[V]}return z}},"pbkdf2")};var e=a(0),o=a(2).Buffer,h=a(9),t=a(6),n=a(4),r=a(10),i=a(14),d=a(40),u=a(28).BigInteger,v=a(29);function m(l,g,y,b){if(b===void 0&&(b="object"),e.ok(l,b+" must not be null"),e.object(l,b+" must be an object"),y===void 0&&(y=g.prototype._sshpkApiVersion),!(l instanceof g&&g.prototype._sshpkApiVersion[0]==y[0])){for(var w=Object.getPrototypeOf(l),S=0;w.constructor.name!==g.name;)w=Object.getPrototypeOf(w),e.ok(w&&++S<=3,b+" must be a "+g.name+" instance");e.strictEqual(w.constructor.name,g.name,b+" must be a "+g.name+" instance");var E=w._sshpkApiVersion;E===void 0&&(E=g._oldVersionDetect(l)),e.ok(E[0]==y[0]&&E[1]>=y[1],b+" must be compatible with "+g.name+" klass version "+y[0]+"."+y[1])}}k(m,"m");var c={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}};function p(l){for(e.buffer(l);l.length>1&&l[0]===0&&(128&l[1])==0;)l=l.slice(1);if((128&l[0])==128){var g=o.alloc(l.length+1);g[0]=0,l.copy(g,1),l=g}return l}k(p,"f");function s(l){var g=o.from(l.toByteArray());return g=p(g)}k(s,"g")},function(f,x){f.exports=require("fs")},function(f,x,a){f.exports=y;var e=a(0),o=a(2).Buffer,h=a(10),t=a(4),n=(a(27),a(13)),r=a(12),i=a(1),d=a(7),u=a(53),v=u.generateECDSA,m=u.generateED25519,c=a(75),p=a(29),s=a(6),l=(r.InvalidAlgorithmError,r.KeyParseError),g=(r.KeyEncryptedError,{});function y(b){e.object(b,"options"),s.call(this,b),this._pubCache=void 0}k(y,"b"),g.auto=a(76),g.pem=a(16),g.pkcs1=a(54),g.pkcs8=a(31),g.rfc4253=a(17),g["ssh-private"]=a(41),g.openssh=g["ssh-private"],g.ssh=g["ssh-private"],g.dnssec=a(55),i.inherits(y,s),y.formats=g,y.prototype.toBuffer=function(b,w){return b===void 0&&(b="pkcs1"),e.string(b,"format"),e.object(g[b],"formats[format]"),e.optionalObject(w,"options"),g[b].write(this,w)},y.prototype.hash=function(b,w){return this.toPublic().hash(b,w)},y.prototype.fingerprint=function(b,w){return this.toPublic().fingerprint(b,w)},y.prototype.toPublic=function(){if(this._pubCache)return this._pubCache;for(var b=h.info[this.type],w=[],S=0;S<b.parts.length;++S){var E=b.parts[S];w.push(this.part[E])}return this._pubCache=new s({type:this.type,source:this,parts:w}),this.comment&&(this._pubCache.comment=this.comment),this._pubCache},y.prototype.derive=function(b){var w,S,E;if(e.string(b,"type"),this.type==="ed25519"&&b==="curve25519")return(w=this.part.k.data)[0]===0&&(w=w.slice(1)),E=p.box.keyPair.fromSecretKey(new Uint8Array(w)),S=o.from(E.publicKey),new y({type:"curve25519",parts:[{name:"A",data:d.mpNormalize(S)},{name:"k",data:d.mpNormalize(w)}]});if(this.type==="curve25519"&&b==="ed25519")return(w=this.part.k.data)[0]===0&&(w=w.slice(1)),E=p.sign.keyPair.fromSeed(new Uint8Array(w)),S=o.from(E.publicKey),new y({type:"ed25519",parts:[{name:"A",data:d.mpNormalize(S)},{name:"k",data:d.mpNormalize(w)}]});throw new Error("Key derivation not supported from "+this.type+" to "+b)},y.prototype.createVerify=function(b){return this.toPublic().createVerify(b)},y.prototype.createSign=function(b){if(b===void 0&&(b=this.defaultHashAlgorithm()),e.string(b,"hash algorithm"),this.type==="ed25519"&&c!==void 0)return new c.Signer(this,b);if(this.type==="curve25519")throw new Error("Curve25519 keys are not suitable for signing or verification");var w,S,E;try{S=b.toUpperCase(),w=t.createSign(S)}catch(H){E=H}(w===void 0||E instanceof Error&&E.message.match(/Unknown message digest/))&&(S="RSA-",S+=b.toUpperCase(),w=t.createSign(S)),e.ok(w,"failed to create verifier");var P=w.sign.bind(w),A=this.toBuffer("pkcs1"),F=this.type,O=this.curve;return w.sign=function(){var H=P(A);return typeof H=="string"&&(H=o.from(H,"binary")),(H=n.parse(H,F,"asn1")).hashAlgorithm=b,H.curve=O,H},w},y.parse=function(b,w,S){typeof b!="string"&&e.buffer(b,"data"),w===void 0&&(w="auto"),e.string(w,"format"),typeof S=="string"&&(S={filename:S}),e.optionalObject(S,"options"),S===void 0&&(S={}),e.optionalString(S.filename,"options.filename"),S.filename===void 0&&(S.filename="(unnamed)"),e.object(g[w],"formats[format]");try{var E=g[w].read(b,S);return e.ok(E instanceof y,"key is not a private key"),E.comment||(E.comment=S.filename),E}catch(P){throw P.name==="KeyEncryptedError"?P:new l(S.filename,w,P)}},y.isPrivateKey=function(b,w){return d.isCompatible(b,y,w)},y.generate=function(b,w){switch(w===void 0&&(w={}),e.object(w,"options"),b){case"ecdsa":return w.curve===void 0&&(w.curve="nistp256"),e.string(w.curve,"options.curve"),v(w.curve);case"ed25519":return m();default:throw new Error('Key generation not supported with key type "'+b+'"')}},y.prototype._sshpkApiVersion=[1,6],y._oldVersionDetect=function(b){return e.func(b.toPublic),e.func(b.createSign),b.derive?[1,3]:b.defaultHashAlgorithm?[1,2]:b.formats.auto?[1,1]:[1,0]}},function(f,x,a){var e=a(2).Buffer,o={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"}};o.curve25519=o.ed25519;var h={dsa:{parts:["p","q","g","y","x"]},rsa:{parts:["n","e","d","iqmp","p","q"]},ecdsa:{parts:["curve","Q","d"]},ed25519:{parts:["A","k"]}};h.curve25519=h.ed25519;var t={nistp256:{size:256,pkcs8oid:"1.2.840.10045.3.1.7",p:e.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g,""),"hex"),a:e.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:e.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g,""),"hex"),s:e.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g,""),"hex"),n:e.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g,""),"hex"),G:e.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g,""),"hex")},nistp384:{size:384,pkcs8oid:"1.3.132.0.34",p:e.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g,""),"hex"),a:e.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g,""),"hex"),b:e.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g,""),"hex"),s:e.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g,""),"hex"),n:e.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g,""),"hex"),G:e.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g,""),"hex")},nistp521:{size:521,pkcs8oid:"1.3.132.0.35",p:e.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g,""),"hex"),a:e.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g,""),"hex"),b:e.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g,""),"hex"),s:e.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g,""),"hex"),n:e.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g,""),"hex"),G:e.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g,""),"hex")}};f.exports={info:o,privInfo:h,hashAlgs:{md5:!0,sha1:!0,sha256:!0,sha384:!0,sha512:!0},curves:t}},function(f,x){f.exports=require("stream")},function(f,x,a){a(0);var e=a(1);function o(d,u){Error.captureStackTrace&&Error.captureStackTrace(this,o),this.name="FingerprintFormatError",this.fingerprint=d,this.format=u,this.message="Fingerprint format is not supported, or is invalid: ",d!==void 0&&(this.message+=" fingerprint = "+d),u!==void 0&&(this.message+=" format = "+u)}k(o,"i");function h(d){Error.captureStackTrace&&Error.captureStackTrace(this,h),this.name="InvalidAlgorithmError",this.algorithm=d,this.message='Algorithm "'+d+'" is not supported'}k(h,"o");function t(d,u,v){Error.captureStackTrace&&Error.captureStackTrace(this,t),this.name="KeyParseError",this.format=u,this.keyName=d,this.innerErr=v,this.message="Failed to parse "+d+" as a valid "+u+" format key: "+v.message}k(t,"n");function n(d,u,v){Error.captureStackTrace&&Error.captureStackTrace(this,n),this.name="SignatureParseError",this.type=d,this.format=u,this.innerErr=v,this.message="Failed to parse the given data as a "+d+" signature in "+u+" format: "+v.message}k(n,"s");function r(d,u,v){Error.captureStackTrace&&Error.captureStackTrace(this,r),this.name="CertificateParseError",this.format=u,this.certName=d,this.innerErr=v,this.message="Failed to parse "+d+" as a valid "+u+" format certificate: "+v.message}k(r,"c");function i(d,u){Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="KeyEncryptedError",this.format=u,this.keyName=d,this.message="The "+u+" format key "+d+" is encrypted (password-protected), and no passphrase was provided in `options`"}k(i,"u"),e.inherits(o,Error),e.inherits(h,Error),e.inherits(t,Error),e.inherits(n,Error),e.inherits(r,Error),e.inherits(i,Error),f.exports={FingerprintFormatError:o,InvalidAlgorithmError:h,KeyParseError:t,SignatureParseError:n,KeyEncryptedError:i,CertificateParseError:r}},function(f,x,a){f.exports=u;var e=a(0),o=a(2).Buffer,h=(a(10),a(4),a(12)),t=a(7),n=a(14),r=a(30),i=h.InvalidAlgorithmError,d=h.SignatureParseError;function u(m){e.object(m,"options"),e.arrayOfObject(m.parts,"options.parts"),e.string(m.type,"options.type");for(var c={},p=0;p<m.parts.length;++p){var s=m.parts[p];c[s.name]=s}this.type=m.type,this.hashAlgorithm=m.hashAlgo,this.curve=m.curve,this.parts=m.parts,this.part=c}k(u,"l");function v(m,c,p,s){if(p==="ssh"){try{var l=new r({buffer:m}),g=l.readString()}catch{}if(l!==void 0){var y="SSH signature does not match expected type (expected "+c+", got "+g+")";switch(g){case"ssh-rsa":e.strictEqual(c,"rsa",y),s.hashAlgo="sha1";break;case"rsa-sha2-256":e.strictEqual(c,"rsa",y),s.hashAlgo="sha256";break;case"rsa-sha2-512":e.strictEqual(c,"rsa",y),s.hashAlgo="sha512";break;case"ssh-ed25519":e.strictEqual(c,"ed25519",y),s.hashAlgo="sha512";break;default:throw new Error("Unknown SSH signature type: "+g)}var b=l.readPart();return e.ok(l.atEnd(),"extra trailing bytes"),b.name="sig",s.parts.push(b),new u(s)}}return s.parts.push({name:"sig",data:m}),new u(s)}k(v,"h"),u.prototype.toBuffer=function(m){var c;m===void 0&&(m="asn1"),e.string(m,"format");var p="ssh-"+this.type;switch(this.type){case"rsa":switch(this.hashAlgorithm){case"sha256":p="rsa-sha2-256";break;case"sha512":p="rsa-sha2-512";break;case"sha1":case void 0:break;default:throw new Error("SSH signature format does not support hash algorithm "+this.hashAlgorithm)}return m==="ssh"?((c=new r({})).writeString(p),c.writePart(this.part.sig),c.toBuffer()):this.part.sig.data;case"ed25519":return m==="ssh"?((c=new r({})).writeString(p),c.writePart(this.part.sig),c.toBuffer()):this.part.sig.data;case"dsa":case"ecdsa":var s,l;if(m==="asn1"){var g=new n.BerWriter;return g.startSequence(),s=t.mpNormalize(this.part.r.data),l=t.mpNormalize(this.part.s.data),g.writeBuffer(s,n.Ber.Integer),g.writeBuffer(l,n.Ber.Integer),g.endSequence(),g.buffer}if(m==="ssh"&&this.type==="dsa"){if((c=new r({})).writeString("ssh-dss"),(s=this.part.r.data).length>20&&s[0]===0&&(s=s.slice(1)),(l=this.part.s.data).length>20&&l[0]===0&&(l=l.slice(1)),this.hashAlgorithm&&this.hashAlgorithm!=="sha1"||s.length+l.length!==40)throw new Error("OpenSSH only supports DSA signatures with SHA1 hash");return c.writeBuffer(o.concat([s,l])),c.toBuffer()}if(m==="ssh"&&this.type==="ecdsa"){var y,b=new r({});s=this.part.r.data,b.writeBuffer(s),b.writePart(this.part.s),c=new r({}),s[0]===0&&(s=s.slice(1));var w=8*s.length;return w===256?y="nistp256":w===384?y="nistp384":w===528&&(y="nistp521"),c.writeString("ecdsa-sha2-"+y),c.writeBuffer(b.toBuffer()),c.toBuffer()}throw new Error("Invalid signature format");default:throw new Error("Invalid signature data")}},u.prototype.toString=function(m){return e.optionalString(m,"format"),this.toBuffer(m).toString("base64")},u.parse=function(m,c,p){typeof m=="string"&&(m=o.from(m,"base64")),e.buffer(m,"data"),e.string(p,"format"),e.string(c,"type");var s={};s.type=c.toLowerCase(),s.parts=[];try{switch(e.ok(m.length>0,"signature must not be empty"),s.type){case"rsa":case"ed25519":return v(m,c,p,s);case"dsa":case"ecdsa":return p==="asn1"?(function(l,g,y,b){var w=new n.BerReader(l);w.readSequence();var S=w.readString(n.Ber.Integer,!0),E=w.readString(n.Ber.Integer,!0);return b.parts.push({name:"r",data:t.mpNormalize(S)}),b.parts.push({name:"s",data:t.mpNormalize(E)}),new u(b)})(m,0,0,s):s.type==="dsa"?(function(l,g,y,b){if(l.length!=40){var w=new r({buffer:l}),S=w.readBuffer();S.toString("ascii")==="ssh-dss"&&(S=w.readBuffer()),e.ok(w.atEnd(),"extra trailing bytes"),e.strictEqual(S.length,40,"invalid inner length"),l=S}return b.parts.push({name:"r",data:l.slice(0,20)}),b.parts.push({name:"s",data:l.slice(20,40)}),new u(b)})(m,0,0,s):(function(l,g,y,b){var w,S,E=new r({buffer:l}),P=E.readBuffer(),A=P.toString("ascii");if(A.slice(0,6)==="ecdsa-"){var F=A.split("-");switch(e.strictEqual(F[0],"ecdsa"),e.strictEqual(F[1],"sha2"),b.curve=F[2],b.curve){case"nistp256":b.hashAlgo="sha256";break;case"nistp384":b.hashAlgo="sha384";break;case"nistp521":b.hashAlgo="sha512";break;default:throw new Error("Unsupported ECDSA curve: "+b.curve)}P=E.readBuffer(),e.ok(E.atEnd(),"extra trailing bytes on outer"),E=new r({buffer:P}),w=E.readPart()}else w={data:P};return S=E.readPart(),e.ok(E.atEnd(),"extra trailing bytes"),w.name="r",S.name="s",b.parts.push(w),b.parts.push(S),new u(b)})(m,0,0,s);default:throw new i(c)}}catch(l){throw l instanceof i?l:new d(c,p,l)}},u.isSignature=function(m,c){return t.isCompatible(m,u,c)},u.prototype._sshpkApiVersion=[2,1],u._oldVersionDetect=function(m){return e.func(m.toBuffer),m.hasOwnProperty("hashAlgorithm")?[2,0]:[1,0]}},function(f,x,a){var e=a(133);f.exports={Ber:e,BerReader:e.Reader,BerWriter:e.Writer}},function(f,x){f.exports=require("url")},function(f,x,a){f.exports={read:k(function(y,b,w){var S=y;typeof y!="string"&&(e.buffer(y,"buf"),y=y.toString("ascii"));for(var E,P,A=y.trim().split(/[\r\n]+/g),F=-1;!E&&F<A.length;)E=A[++F].match(/[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);e.ok(E,"invalid PEM header");for(var O=A.length;!P&&O>0;)P=A[--O].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);e.ok(P,"invalid PEM footer"),e.equal(E[2],P[2]);var H,G=E[2].toLowerCase();E[1]&&(e.equal(E[1],P[1],"PEM header and footer mismatch"),H=E[1].trim()),A=A.slice(F,O+1);for(var z,$,K,V={};A=A.slice(1),E=A[0].match(/^([A-Za-z0-9-]+): (.+)$/);)V[E[1].toLowerCase()]=E[2];if(A=A.slice(0,-1).join(""),y=t.from(A,"base64"),V["proc-type"]){var Y=V["proc-type"].split(",");if(Y[0]==="4"&&Y[1]==="ENCRYPTED"){if(typeof b.passphrase=="string"&&(b.passphrase=t.from(b.passphrase,"utf-8")),!t.isBuffer(b.passphrase))throw new c.KeyEncryptedError(b.filename,"PEM");Y=V["dek-info"].split(","),e.ok(Y.length===2),z=Y[0].toLowerCase(),K=t.from(Y[1],"hex"),$=n.opensslKeyDeriv(z,K,b.passphrase,1).key}}if(H&&H.toLowerCase()==="encrypted"){var J,L=new o.BerReader(y);L.readSequence(),L.readSequence(),J=L.offset+L.length;var Q=L.readOID();if(Q!=="1.2.840.113549.1.5.13")throw new Error("Unsupported PEM/PKCS8 encryption scheme: "+Q);L.readSequence(),L.readSequence();var j=L.offset+L.length,_=L.readOID();if(_!=="1.2.840.113549.1.5.12")throw new Error("Unsupported PBES2 KDF: "+_);L.readSequence();var C=L.readString(o.Ber.OctetString,!0),N=L.readInt(),W="sha1";if(L.offset<j){L.readSequence();var X=L.readOID();if((W=l[X])===void 0)throw new Error("Unsupported PBKDF2 hash: "+X)}L._offset=j,L.readSequence();var M=L.readOID();if((z=p[M])===void 0)throw new Error("Unsupported PBES2 cipher: "+M);if(K=L.readString(o.Ber.OctetString,!0),L._offset=J,y=L.readString(o.Ber.OctetString,!0),typeof b.passphrase=="string"&&(b.passphrase=t.from(b.passphrase,"utf-8")),!t.isBuffer(b.passphrase))throw new c.KeyEncryptedError(b.filename,"PEM");var R=n.opensshCipherInfo(z);z=R.opensslName,$=n.pbkdf2(W,C,N,R.keySize,b.passphrase),H=void 0}if(z&&$&&K){var ae,ee=h.createDecipheriv(z,$,K),ie=[];for(ee.once("error",(function(we){throw we.toString().indexOf("bad decrypt")!==-1?new Error("Incorrect passphrase supplied, could not decrypt key"):we})),ee.write(y),ee.end();(ae=ee.read())!==null;)ie.push(ae);y=t.concat(ie)}if(H&&H.toLowerCase()==="openssh")return v.readSSHPrivate(G,y,b);if(H&&H.toLowerCase()==="ssh2")return m.readType(G,y,b);var se=new o.BerReader(y);return se.originalInput=S,se.readSequence(),H?(w&&e.strictEqual(w,"pkcs1"),d.readPkcs1(H,G,se)):(w&&e.strictEqual(w,"pkcs8"),u.readPkcs8(H,G,se))},"read"),write:k(function(y,b,w){e.object(y);var S,E={ecdsa:"EC",rsa:"RSA",dsa:"DSA",ed25519:"EdDSA"}[y.type],P=new o.BerWriter;if(i.isPrivateKey(y))w&&w==="pkcs8"?(S="PRIVATE KEY",u.writePkcs8(P,y)):(w&&e.strictEqual(w,"pkcs1"),S=E+" PRIVATE KEY",d.writePkcs1(P,y));else{if(!r.isKey(y))throw new Error("key is not a Key or PrivateKey");w&&w==="pkcs1"?(S=E+" PUBLIC KEY",d.writePkcs1(P,y)):(w&&e.strictEqual(w,"pkcs8"),S="PUBLIC KEY",u.writePkcs8(P,y))}var A=P.buffer.toString("base64"),F=A.length+A.length/64+18+16+2*S.length+10,O=t.alloc(F),H=0;H+=O.write("-----BEGIN "+S+`-----
`,H);for(var G=0;G<A.length;){var z=G+64;z>A.length&&(z=A.length),H+=O.write(A.slice(G,z),H),O[H++]=10,G=z}return H+=O.write("-----END "+S+`-----
`,H),O.slice(0,H)},"write")};var e=a(0),o=a(14),h=a(4),t=a(2).Buffer,n=(a(10),a(7)),r=a(6),i=a(9),d=a(54),u=a(31),v=a(41),m=a(17),c=a(12),p={"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"},s={};Object.keys(p).forEach((function(y){s[p[y]]=y}));var l={"1.2.840.113549.2.7":"sha1","1.2.840.113549.2.9":"sha256","1.2.840.113549.2.11":"sha512"},g={};Object.keys(l).forEach((function(y){g[l[y]]=y}))},function(f,x,a){f.exports={read:v.bind(void 0,!1,void 0),readType:v.bind(void 0,!1),write:k(function(m,c){e.object(m);var p,s=u(m),l=h.info[m.type];r.isPrivateKey(m)&&(l=h.privInfo[m.type]);var g=l.parts,y=new i({});for(y.writeString(s),p=0;p<g.length;++p){var b=m.part[g[p]].data;l.normalize!==!1&&(b=m.type==="ed25519"?t.zeroPadToLength(b,32):t.mpNormalize(b)),m.type==="ed25519"&&g[p]==="k"&&(b=o.concat([b,m.part.A.data])),y.writeBuffer(b)}return y.toBuffer()},"write"),readPartial:v.bind(void 0,!0),readInternal:v,keyTypeToAlg:u,algToKeyType:d};var e=a(0),o=a(2).Buffer,h=a(10),t=a(7),n=a(6),r=a(9),i=a(30);function d(m){if(e.string(m),m==="ssh-dss")return"dsa";if(m==="ssh-rsa")return"rsa";if(m==="ssh-ed25519")return"ed25519";if(m==="ssh-curve25519")return"curve25519";if(m.match(/^ecdsa-sha2-/))return"ecdsa";throw new Error("Unknown algorithm "+m)}k(d,"p");function u(m){if(e.object(m),m.type==="dsa")return"ssh-dss";if(m.type==="rsa")return"ssh-rsa";if(m.type==="ed25519")return"ssh-ed25519";if(m.type==="curve25519")return"ssh-curve25519";if(m.type==="ecdsa")return"ecdsa-sha2-"+m.part.curve.data.toString();throw new Error("Unknown key type "+m.type)}k(u,"l");function v(m,c,p,s){typeof p=="string"&&(p=o.from(p)),e.buffer(p,"buf");var l={},g=l.parts=[],y=new i({buffer:p}),b=y.readString();e.ok(!y.atEnd(),"key must have at least one part"),l.type=d(b);var w=h.info[l.type].parts.length;for(c&&c==="private"&&(w=h.privInfo[l.type].parts.length);!y.atEnd()&&g.length<w;)g.push(y.readPart());for(;!m&&!y.atEnd();)g.push(y.readPart());e.ok(g.length>=1,"key must have at least one part"),e.ok(m||y.atEnd(),"leftover bytes at end of key");var S=n,E=h.info[l.type];if(c!=="private"&&E.parts.length===g.length||(E=h.privInfo[l.type],S=r),e.strictEqual(E.parts.length,g.length),l.type==="ecdsa"){var P=/^ecdsa-sha2-(.+)$/.exec(b);e.ok(P!==null),e.strictEqual(P[1],g[0].data.toString())}for(var A=!0,F=0;F<E.parts.length;++F){var O,H=g[F];H.name=E.parts[F],l.type==="ed25519"&&H.name==="k"&&(H.data=H.data.slice(0,32)),H.name!=="curve"&&E.normalize!==!1&&(O=l.type==="ed25519"?t.zeroPadToLength(H.data,32):t.mpNormalize(H.data)).toString("binary")!==H.data.toString("binary")&&(H.data=O,A=!1)}return A&&(l._rfc4253Cache=y.toBuffer()),m&&typeof m=="object"&&(m.remainder=y.remainder(),m.consumed=y._offset),new S(l)}k(v,"h")},function(f,x,a){"use strict";var e,o,h=a(23),t=h.freeze,n=a(3),r=n.inherits,i=n.notEnumerableProp;function d(b,w){function S(E){if(!(this instanceof S))return new S(E);i(this,"message",typeof E=="string"?E:w),i(this,"name",b),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return k(S,"a"),r(S,Error),S}k(d,"p");var u=d("Warning","warning"),v=d("CancellationError","cancellation error"),m=d("TimeoutError","timeout error"),c=d("AggregateError","aggregate error");try{e=TypeError,o=RangeError}catch{e=d("TypeError","type error"),o=d("RangeError","range error")}for(var p="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),s=0;s<p.length;++s)typeof Array.prototype[p[s]]=="function"&&(c.prototype[p[s]]=Array.prototype[p[s]]);h.defineProperty(c.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),c.prototype.isOperational=!0;var l=0;function g(b){if(!(this instanceof g))return new g(b);i(this,"name","OperationalError"),i(this,"message",b),this.cause=b,this.isOperational=!0,b instanceof Error?(i(this,"message",b.message),i(this,"stack",b.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}k(g,"y"),c.prototype.toString=function(){var b=Array(4*l+1).join(" "),w=`
`+b+`AggregateError of:
`;l++,b=Array(4*l+1).join(" ");for(var S=0;S<this.length;++S){for(var E=this[S]===this?"[Circular AggregateError]":this[S]+"",P=E.split(`
`),A=0;A<P.length;++A)P[A]=b+P[A];w+=(E=P.join(`
`))+`
`}return l--,w},r(g,Error);var y=Error.__BluebirdErrorTypes__;y||(y=t({CancellationError:v,TimeoutError:m,OperationalError:g,RejectionError:g,AggregateError:c}),h.defineProperty(Error,"__BluebirdErrorTypes__",{value:y,writable:!1,enumerable:!1,configurable:!1})),f.exports={Error,TypeError:e,RangeError:o,CancellationError:y.CancellationError,OperationalError:y.OperationalError,TimeoutError:y.TimeoutError,AggregateError:y.AggregateError,Warning:u}},function(f,x,a){var e=a(48),o=e.Buffer;function h(n,r){for(var i in n)r[i]=n[i]}k(h,"o");function t(n,r,i){return o(n,r,i)}k(t,"n"),o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?f.exports=e:(h(e,x),x.Buffer=t),t.prototype=Object.create(o.prototype),h(o,t),t.from=function(n,r,i){if(typeof n=="number")throw new TypeError("Argument must not be a number");return o(n,r,i)},t.alloc=function(n,r,i){if(typeof n!="number")throw new TypeError("Argument must be a number");var d=o(n);return r!==void 0?typeof i=="string"?d.fill(r,i):d.fill(r):d.fill(0),d},t.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return o(n)},t.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return e.SlowBuffer(n)}},function(f,x){f.exports=require("assert")},function(f,x){f.exports=require("events")},function(f,x,a){"use strict";let e=Buffer;e.alloc||(e=a(19).Buffer),f.exports=e},function(f,x){var a=(function(){"use strict";return this===void 0})();if(a)f.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:a,propertyIsWritable:k(function(n,r){var i=Object.getOwnPropertyDescriptor(n,r);return!(i&&!i.writable&&!i.set)},"