next
Version:
The React Framework
9 lines • 121 kB
JavaScript
(()=>{var e={112:(e,r,t)=>{"use strict";var n=t(300).Buffer;var a=t(300).SlowBuffer;e.exports=bufferEq;function bufferEq(e,r){if(!n.isBuffer(e)||!n.isBuffer(r)){return false}if(e.length!==r.length){return false}var t=0;for(var a=0;a<e.length;a++){t|=e[a]^r[a]}return t===0}bufferEq.install=function(){n.prototype.equal=a.prototype.equal=function equal(e){return bufferEq(this,e)}};var i=n.prototype.equal;var s=a.prototype.equal;bufferEq.restore=function(){n.prototype.equal=i;a.prototype.equal=s}},160:(e,r,t)=>{"use strict";var n=t(911).Buffer;var a=t(8);var i=128,s=0,o=32,u=16,l=2,c=u|o|s<<6,f=l|s<<6;function base64Url(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function signatureAsBuffer(e){if(n.isBuffer(e)){return e}else if("string"===typeof e){return n.from(e,"base64")}throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function derToJose(e,r){e=signatureAsBuffer(e);var t=a(r);var s=t+1;var o=e.length;var u=0;if(e[u++]!==c){throw new Error('Could not find expected "seq"')}var l=e[u++];if(l===(i|1)){l=e[u++]}if(o-u<l){throw new Error('"seq" specified length of "'+l+'", only "'+(o-u)+'" remaining')}if(e[u++]!==f){throw new Error('Could not find expected "int" for "r"')}var h=e[u++];if(o-u-2<h){throw new Error('"r" specified length of "'+h+'", only "'+(o-u-2)+'" available')}if(s<h){throw new Error('"r" specified length of "'+h+'", max of "'+s+'" is acceptable')}var p=u;u+=h;if(e[u++]!==f){throw new Error('Could not find expected "int" for "s"')}var d=e[u++];if(o-u!==d){throw new Error('"s" specified length of "'+d+'", expected "'+(o-u)+'"')}if(s<d){throw new Error('"s" specified length of "'+d+'", max of "'+s+'" is acceptable')}var y=u;u+=d;if(u!==o){throw new Error('Expected to consume entire buffer, but "'+(o-u)+'" bytes remain')}var g=t-h,v=t-d;var b=n.allocUnsafe(g+h+v+d);for(u=0;u<g;++u){b[u]=0}e.copy(b,u,p+Math.max(-g,0),p+h);u=t;for(var m=u;u<m+v;++u){b[u]=0}e.copy(b,u,y+Math.max(-v,0),y+d);b=b.toString("base64");b=base64Url(b);return b}function countPadding(e,r,t){var n=0;while(r+n<t&&e[r+n]===0){++n}var a=e[r+n]>=i;if(a){--n}return n}function joseToDer(e,r){e=signatureAsBuffer(e);var t=a(r);var s=e.length;if(s!==t*2){throw new TypeError('"'+r+'" signatures must be "'+t*2+'" bytes, saw "'+s+'"')}var o=countPadding(e,0,t);var u=countPadding(e,t,e.length);var l=t-o;var h=t-u;var p=1+1+l+1+1+h;var d=p<i;var y=n.allocUnsafe((d?2:3)+p);var g=0;y[g++]=c;if(d){y[g++]=p}else{y[g++]=i|1;y[g++]=p&255}y[g++]=f;y[g++]=l;if(o<0){y[g++]=0;g+=e.copy(y,g,0,t)}else{g+=e.copy(y,g,o,t)}y[g++]=f;y[g++]=h;if(u<0){y[g++]=0;e.copy(y,g,t)}else{e.copy(y,g,t+u)}return y}e.exports={derToJose:derToJose,joseToDer:joseToDer}},8:e=>{"use strict";function getParamSize(e){var r=(e/8|0)+(e%8===0?0:1);return r}var r={ES256:getParamSize(256),ES384:getParamSize(384),ES512:getParamSize(521)};function getParamBytesForAlg(e){var t=r[e];if(t){return t}throw new Error('Unknown algorithm "'+e+'"')}e.exports=getParamBytesForAlg},443:(e,r,t)=>{var n=t(111);e.exports=function(e,r){r=r||{};var t=n.decode(e,r);if(!t){return null}var a=t.payload;if(typeof a==="string"){try{var i=JSON.parse(a);if(i!==null&&typeof i==="object"){a=i}}catch(e){}}if(r.complete===true){return{header:t.header,payload:a,signature:t.signature}}return a}},773:(e,r,t)=>{e.exports={verify:t(624),sign:t(743),JsonWebTokenError:t(131),NotBeforeError:t(422),TokenExpiredError:t(794)};Object.defineProperty(e.exports,"decode",{enumerable:false,value:t(443)})},131:e=>{var JsonWebTokenError=function(e,r){Error.call(this,e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="JsonWebTokenError";this.message=e;if(r)this.inner=r};JsonWebTokenError.prototype=Object.create(Error.prototype);JsonWebTokenError.prototype.constructor=JsonWebTokenError;e.exports=JsonWebTokenError},422:(e,r,t)=>{var n=t(131);var NotBeforeError=function(e,r){n.call(this,e);this.name="NotBeforeError";this.date=r};NotBeforeError.prototype=Object.create(n.prototype);NotBeforeError.prototype.constructor=NotBeforeError;e.exports=NotBeforeError},794:(e,r,t)=>{var n=t(131);var TokenExpiredError=function(e,r){n.call(this,e);this.name="TokenExpiredError";this.expiredAt=r};TokenExpiredError.prototype=Object.create(n.prototype);TokenExpiredError.prototype.constructor=TokenExpiredError;e.exports=TokenExpiredError},186:(e,r,t)=>{const n=t(521);e.exports=n.satisfies(process.version,">=15.7.0")},900:(e,r,t)=>{var n=t(521);e.exports=n.satisfies(process.version,"^6.12.0 || >=8.0.0")},444:(e,r,t)=>{const n=t(521);e.exports=n.satisfies(process.version,">=16.9.0")},126:(e,r,t)=>{var n=t(958);e.exports=function(e,r){var t=r||Math.floor(Date.now()/1e3);if(typeof e==="string"){var a=n(e);if(typeof a==="undefined"){return}return Math.floor(t+a/1e3)}else if(typeof e==="number"){return t+e}else{return}}},253:(e,r,t)=>{const n=t(186);const a=t(444);const i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]};const s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,r){if(!e||!r)return;const t=r.asymmetricKeyType;if(!t)return;const o=i[t];if(!o){throw new Error(`Unknown key type "${t}".`)}if(!o.includes(e)){throw new Error(`"alg" parameter for "${t}" key type must be one of: ${o.join(", ")}.`)}if(n){switch(t){case"ec":const t=r.asymmetricKeyDetails.namedCurve;const n=s[e];if(t!==n){throw new Error(`"alg" parameter "${e}" requires curve "${n}".`)}break;case"rsa-pss":if(a){const t=parseInt(e.slice(-3),10);const{hashAlgorithm:n,mgf1HashAlgorithm:a,saltLength:i}=r.asymmetricKeyDetails;if(n!==`sha${t}`||a!==n){throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`)}if(i!==undefined&&i>t>>3){throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}break}}}},743:(e,r,t)=>{const n=t(126);const a=t(900);const i=t(253);const s=t(111);const{includes:o,isBoolean:u,isInteger:l,isNumber:c,isPlainObject:f,isString:h,once:p}=t(788);const{KeyObject:d,createSecretKey:y,createPrivateKey:g}=t(113);const v=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(a){v.splice(3,0,"PS256","PS384","PS512")}const b={expiresIn:{isValid:function(e){return l(e)||h(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return l(e)||h(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return h(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:o.bind(null,v),message:'"algorithm" must be a valid string enum value'},header:{isValid:f,message:'"header" must be an object'},encoding:{isValid:h,message:'"encoding" must be a string'},issuer:{isValid:h,message:'"issuer" must be a string'},subject:{isValid:h,message:'"subject" must be a string'},jwtid:{isValid:h,message:'"jwtid" must be a string'},noTimestamp:{isValid:u,message:'"noTimestamp" must be a boolean'},keyid:{isValid:h,message:'"keyid" must be a string'},mutatePayload:{isValid:u,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:u,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:u,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}};const m={iat:{isValid:c,message:'"iat" should be a number of seconds'},exp:{isValid:c,message:'"exp" should be a number of seconds'},nbf:{isValid:c,message:'"nbf" should be a number of seconds'}};function validate(e,r,t,n){if(!f(t)){throw new Error('Expected "'+n+'" to be a plain object.')}Object.keys(t).forEach((function(a){const i=e[a];if(!i){if(!r){throw new Error('"'+a+'" is not allowed in "'+n+'"')}return}if(!i.isValid(t[a])){throw new Error(i.message)}}))}function validateOptions(e){return validate(b,false,e,"options")}function validatePayload(e){return validate(m,true,e,"payload")}const _={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"};const w=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,r,t,a){if(typeof t==="function"){a=t;t={}}else{t=t||{}}const o=typeof e==="object"&&!Buffer.isBuffer(e);const u=Object.assign({alg:t.algorithm||"HS256",typ:o?"JWT":undefined,kid:t.keyid},t.header);function failure(e){if(a){return a(e)}throw e}if(!r&&t.algorithm!=="none"){return failure(new Error("secretOrPrivateKey must have a value"))}if(r!=null&&!(r instanceof d)){try{r=g(r)}catch(e){try{r=y(typeof r==="string"?Buffer.from(r):r)}catch(e){return failure(new Error("secretOrPrivateKey is not valid key material"))}}}if(u.alg.startsWith("HS")&&r.type!=="secret"){return failure(new Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`))}else if(/^(?:RS|PS|ES)/.test(u.alg)){if(r.type!=="private"){return failure(new Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`))}if(!t.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&r.asymmetricKeyDetails!==undefined&&r.asymmetricKeyDetails.modulusLength<2048){return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}}if(typeof e==="undefined"){return failure(new Error("payload is required"))}else if(o){try{validatePayload(e)}catch(e){return failure(e)}if(!t.mutatePayload){e=Object.assign({},e)}}else{const r=w.filter((function(e){return typeof t[e]!=="undefined"}));if(r.length>0){return failure(new Error("invalid "+r.join(",")+" option for "+typeof e+" payload"))}}if(typeof e.exp!=="undefined"&&typeof t.expiresIn!=="undefined"){return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'))}if(typeof e.nbf!=="undefined"&&typeof t.notBefore!=="undefined"){return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'))}try{validateOptions(t)}catch(e){return failure(e)}if(!t.allowInvalidAsymmetricKeyTypes){try{i(u.alg,r)}catch(e){return failure(e)}}const l=e.iat||Math.floor(Date.now()/1e3);if(t.noTimestamp){delete e.iat}else if(o){e.iat=l}if(typeof t.notBefore!=="undefined"){try{e.nbf=n(t.notBefore,l)}catch(e){return failure(e)}if(typeof e.nbf==="undefined"){return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}}if(typeof t.expiresIn!=="undefined"&&typeof e==="object"){try{e.exp=n(t.expiresIn,l)}catch(e){return failure(e)}if(typeof e.exp==="undefined"){return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}}Object.keys(_).forEach((function(r){const n=_[r];if(typeof t[r]!=="undefined"){if(typeof e[n]!=="undefined"){return failure(new Error('Bad "options.'+r+'" option. The payload already has an "'+n+'" property.'))}e[n]=t[r]}}));const c=t.encoding||"utf8";if(typeof a==="function"){a=a&&p(a);s.createSign({header:u,privateKey:r,payload:e,encoding:c}).once("error",a).once("done",(function(e){if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256){return a(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}a(null,e)}))}else{let n=s.sign({header:u,payload:e,secret:r,encoding:c});if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&n.length<256){throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`)}return n}}},624:(e,r,t)=>{const n=t(131);const a=t(422);const i=t(794);const s=t(443);const o=t(126);const u=t(253);const l=t(900);const c=t(111);const{KeyObject:f,createSecretKey:h,createPublicKey:p}=t(113);const d=["RS256","RS384","RS512"];const y=["ES256","ES384","ES512"];const g=["RS256","RS384","RS512"];const v=["HS256","HS384","HS512"];if(l){d.splice(d.length,0,"PS256","PS384","PS512");g.splice(g.length,0,"PS256","PS384","PS512")}e.exports=function(e,r,t,l){if(typeof t==="function"&&!l){l=t;t={}}if(!t){t={}}t=Object.assign({},t);let b;if(l){b=l}else{b=function(e,r){if(e)throw e;return r}}if(t.clockTimestamp&&typeof t.clockTimestamp!=="number"){return b(new n("clockTimestamp must be a number"))}if(t.nonce!==undefined&&(typeof t.nonce!=="string"||t.nonce.trim()==="")){return b(new n("nonce must be a non-empty string"))}if(t.allowInvalidAsymmetricKeyTypes!==undefined&&typeof t.allowInvalidAsymmetricKeyTypes!=="boolean"){return b(new n("allowInvalidAsymmetricKeyTypes must be a boolean"))}const m=t.clockTimestamp||Math.floor(Date.now()/1e3);if(!e){return b(new n("jwt must be provided"))}if(typeof e!=="string"){return b(new n("jwt must be a string"))}const _=e.split(".");if(_.length!==3){return b(new n("jwt malformed"))}let w;try{w=s(e,{complete:true})}catch(e){return b(e)}if(!w){return b(new n("invalid token"))}const S=w.header;let I;if(typeof r==="function"){if(!l){return b(new n("verify must be called asynchronous if secret or public key is provided as a callback"))}I=r}else{I=function(e,t){return t(null,r)}}return I(S,(function(r,s){if(r){return b(new n("error in secret or public key callback: "+r.message))}const l=_[2].trim()!=="";if(!l&&s){return b(new n("jwt signature is required"))}if(l&&!s){return b(new n("secret or public key must be provided"))}if(!l&&!t.algorithms){return b(new n('please specify "none" in "algorithms" to verify unsigned tokens'))}if(s!=null&&!(s instanceof f)){try{s=p(s)}catch(e){try{s=h(typeof s==="string"?Buffer.from(s):s)}catch(e){return b(new n("secretOrPublicKey is not valid key material"))}}}if(!t.algorithms){if(s.type==="secret"){t.algorithms=v}else if(["rsa","rsa-pss"].includes(s.asymmetricKeyType)){t.algorithms=g}else if(s.asymmetricKeyType==="ec"){t.algorithms=y}else{t.algorithms=d}}if(t.algorithms.indexOf(w.header.alg)===-1){return b(new n("invalid algorithm"))}if(S.alg.startsWith("HS")&&s.type!=="secret"){return b(new n(`secretOrPublicKey must be a symmetric key when using ${S.alg}`))}else if(/^(?:RS|PS|ES)/.test(S.alg)&&s.type!=="public"){return b(new n(`secretOrPublicKey must be an asymmetric key when using ${S.alg}`))}if(!t.allowInvalidAsymmetricKeyTypes){try{u(S.alg,s)}catch(e){return b(e)}}let I;try{I=c.verify(e,w.header.alg,s)}catch(e){return b(e)}if(!I){return b(new n("invalid signature"))}const A=w.payload;if(typeof A.nbf!=="undefined"&&!t.ignoreNotBefore){if(typeof A.nbf!=="number"){return b(new n("invalid nbf value"))}if(A.nbf>m+(t.clockTolerance||0)){return b(new a("jwt not active",new Date(A.nbf*1e3)))}}if(typeof A.exp!=="undefined"&&!t.ignoreExpiration){if(typeof A.exp!=="number"){return b(new n("invalid exp value"))}if(m>=A.exp+(t.clockTolerance||0)){return b(new i("jwt expired",new Date(A.exp*1e3)))}}if(t.audience){const e=Array.isArray(t.audience)?t.audience:[t.audience];const r=Array.isArray(A.aud)?A.aud:[A.aud];const a=r.some((function(r){return e.some((function(e){return e instanceof RegExp?e.test(r):e===r}))}));if(!a){return b(new n("jwt audience invalid. expected: "+e.join(" or ")))}}if(t.issuer){const e=typeof t.issuer==="string"&&A.iss!==t.issuer||Array.isArray(t.issuer)&&t.issuer.indexOf(A.iss)===-1;if(e){return b(new n("jwt issuer invalid. expected: "+t.issuer))}}if(t.subject){if(A.sub!==t.subject){return b(new n("jwt subject invalid. expected: "+t.subject))}}if(t.jwtid){if(A.jti!==t.jwtid){return b(new n("jwt jwtid invalid. expected: "+t.jwtid))}}if(t.nonce){if(A.nonce!==t.nonce){return b(new n("jwt nonce invalid. expected: "+t.nonce))}}if(t.maxAge){if(typeof A.iat!=="number"){return b(new n("iat required when maxAge is specified"))}const e=o(t.maxAge,A.iat);if(typeof e==="undefined"){return b(new n('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(m>=e+(t.clockTolerance||0)){return b(new i("maxAge exceeded",new Date(e*1e3)))}}if(t.complete===true){const e=w.signature;return b(null,{header:S,payload:A,signature:e})}return b(null,A)}))}},251:(e,r,t)=>{var n=t(112);var a=t(911).Buffer;var i=t(113);var s=t(160);var o=t(837);var u='"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".';var l="secret must be a string or buffer";var c="key must be a string or a buffer";var f="key must be a string, a buffer or an object";var h=typeof i.createPublicKey==="function";if(h){c+=" or a KeyObject";l+="or a KeyObject"}function checkIsPublicKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return}if(!h){throw typeError(c)}if(typeof e!=="object"){throw typeError(c)}if(typeof e.type!=="string"){throw typeError(c)}if(typeof e.asymmetricKeyType!=="string"){throw typeError(c)}if(typeof e.export!=="function"){throw typeError(c)}}function checkIsPrivateKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return}if(typeof e==="object"){return}throw typeError(f)}function checkIsSecretKey(e){if(a.isBuffer(e)){return}if(typeof e==="string"){return e}if(!h){throw typeError(l)}if(typeof e!=="object"){throw typeError(l)}if(e.type!=="secret"){throw typeError(l)}if(typeof e.export!=="function"){throw typeError(l)}}function fromBase64(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function toBase64(e){e=e.toString();var r=4-e.length%4;if(r!==4){for(var t=0;t<r;++t){e+="="}}return e.replace(/\-/g,"+").replace(/_/g,"/")}function typeError(e){var r=[].slice.call(arguments,1);var t=o.format.bind(o,e).apply(null,r);return new TypeError(t)}function bufferOrString(e){return a.isBuffer(e)||typeof e==="string"}function normalizeInput(e){if(!bufferOrString(e))e=JSON.stringify(e);return e}function createHmacSigner(e){return function sign(r,t){checkIsSecretKey(t);r=normalizeInput(r);var n=i.createHmac("sha"+e,t);var a=(n.update(r),n.digest("base64"));return fromBase64(a)}}function createHmacVerifier(e){return function verify(r,t,i){var s=createHmacSigner(e)(r,i);return n(a.from(t),a.from(s))}}function createKeySigner(e){return function sign(r,t){checkIsPrivateKey(t);r=normalizeInput(r);var n=i.createSign("RSA-SHA"+e);var a=(n.update(r),n.sign(t,"base64"));return fromBase64(a)}}function createKeyVerifier(e){return function verify(r,t,n){checkIsPublicKey(n);r=normalizeInput(r);t=toBase64(t);var a=i.createVerify("RSA-SHA"+e);a.update(r);return a.verify(n,t,"base64")}}function createPSSKeySigner(e){return function sign(r,t){checkIsPrivateKey(t);r=normalizeInput(r);var n=i.createSign("RSA-SHA"+e);var a=(n.update(r),n.sign({key:t,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return fromBase64(a)}}function createPSSKeyVerifier(e){return function verify(r,t,n){checkIsPublicKey(n);r=normalizeInput(r);t=toBase64(t);var a=i.createVerify("RSA-SHA"+e);a.update(r);return a.verify({key:n,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},t,"base64")}}function createECDSASigner(e){var r=createKeySigner(e);return function sign(){var t=r.apply(null,arguments);t=s.derToJose(t,"ES"+e);return t}}function createECDSAVerifer(e){var r=createKeyVerifier(e);return function verify(t,n,a){n=s.joseToDer(n,"ES"+e).toString("base64");var i=r(t,n,a);return i}}function createNoneSigner(){return function sign(){return""}}function createNoneVerifier(){return function verify(e,r){return r===""}}e.exports=function jwa(e){var r={hs:createHmacSigner,rs:createKeySigner,ps:createPSSKeySigner,es:createECDSASigner,none:createNoneSigner};var t={hs:createHmacVerifier,rs:createKeyVerifier,ps:createPSSKeyVerifier,es:createECDSAVerifer,none:createNoneVerifier};var n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!n)throw typeError(u,e);var a=(n[1]||n[3]).toLowerCase();var i=n[2];return{sign:r[a](i),verify:t[a](i)}}},111:(e,r,t)=>{var n=t(409);var a=t(851);var i=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];r.ALGORITHMS=i;r.sign=n.sign;r.verify=a.verify;r.decode=a.decode;r.isValid=a.isValid;r.createSign=function createSign(e){return new n(e)};r.createVerify=function createVerify(e){return new a(e)}},626:(e,r,t)=>{var n=t(911).Buffer;var a=t(781);var i=t(837);function DataStream(e){this.buffer=null;this.writable=true;this.readable=true;if(!e){this.buffer=n.alloc(0);return this}if(typeof e.pipe==="function"){this.buffer=n.alloc(0);e.pipe(this);return this}if(e.length||typeof e==="object"){this.buffer=e;this.writable=false;process.nextTick(function(){this.emit("end",e);this.readable=false;this.emit("close")}.bind(this));return this}throw new TypeError("Unexpected data type ("+typeof e+")")}i.inherits(DataStream,a);DataStream.prototype.write=function write(e){this.buffer=n.concat([this.buffer,n.from(e)]);this.emit("data",e)};DataStream.prototype.end=function end(e){if(e)this.write(e);this.emit("end",e);this.emit("close");this.writable=false;this.readable=false};e.exports=DataStream},409:(e,r,t)=>{var n=t(911).Buffer;var a=t(626);var i=t(251);var s=t(781);var o=t(730);var u=t(837);function base64url(e,r){return n.from(e,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jwsSecuredInput(e,r,t){t=t||"utf8";var n=base64url(o(e),"binary");var a=base64url(o(r),t);return u.format("%s.%s",n,a)}function jwsSign(e){var r=e.header;var t=e.payload;var n=e.secret||e.privateKey;var a=e.encoding;var s=i(r.alg);var o=jwsSecuredInput(r,t,a);var l=s.sign(o,n);return u.format("%s.%s",o,l)}function SignStream(e){var r=e.secret||e.privateKey||e.key;var t=new a(r);this.readable=true;this.header=e.header;this.encoding=e.encoding;this.secret=this.privateKey=this.key=t;this.payload=new a(e.payload);this.secret.once("close",function(){if(!this.payload.writable&&this.readable)this.sign()}.bind(this));this.payload.once("close",function(){if(!this.secret.writable&&this.readable)this.sign()}.bind(this))}u.inherits(SignStream,s);SignStream.prototype.sign=function sign(){try{var e=jwsSign({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});this.emit("done",e);this.emit("data",e);this.emit("end");this.readable=false;return e}catch(e){this.readable=false;this.emit("error",e);this.emit("close")}};SignStream.sign=jwsSign;e.exports=SignStream},730:(e,r,t)=>{var n=t(300).Buffer;e.exports=function toString(e){if(typeof e==="string")return e;if(typeof e==="number"||n.isBuffer(e))return e.toString();return JSON.stringify(e)}},851:(e,r,t)=>{var n=t(911).Buffer;var a=t(626);var i=t(251);var s=t(781);var o=t(730);var u=t(837);var l=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function safeJsonParse(e){if(isObject(e))return e;try{return JSON.parse(e)}catch(e){return undefined}}function headerFromJWS(e){var r=e.split(".",1)[0];return safeJsonParse(n.from(r,"base64").toString("binary"))}function securedInputFromJWS(e){return e.split(".",2).join(".")}function signatureFromJWS(e){return e.split(".")[2]}function payloadFromJWS(e,r){r=r||"utf8";var t=e.split(".")[1];return n.from(t,"base64").toString(r)}function isValidJws(e){return l.test(e)&&!!headerFromJWS(e)}function jwsVerify(e,r,t){if(!r){var n=new Error("Missing algorithm parameter for jws.verify");n.code="MISSING_ALGORITHM";throw n}e=o(e);var a=signatureFromJWS(e);var s=securedInputFromJWS(e);var u=i(r);return u.verify(s,a,t)}function jwsDecode(e,r){r=r||{};e=o(e);if(!isValidJws(e))return null;var t=headerFromJWS(e);if(!t)return null;var n=payloadFromJWS(e);if(t.typ==="JWT"||r.json)n=JSON.parse(n,r.encoding);return{header:t,payload:n,signature:signatureFromJWS(e)}}function VerifyStream(e){e=e||{};var r=e.secret||e.publicKey||e.key;var t=new a(r);this.readable=true;this.algorithm=e.algorithm;this.encoding=e.encoding;this.secret=this.publicKey=this.key=t;this.signature=new a(e.signature);this.secret.once("close",function(){if(!this.signature.writable&&this.readable)this.verify()}.bind(this));this.signature.once("close",function(){if(!this.secret.writable&&this.readable)this.verify()}.bind(this))}u.inherits(VerifyStream,s);VerifyStream.prototype.verify=function verify(){try{var e=jwsVerify(this.signature.buffer,this.algorithm,this.key.buffer);var r=jwsDecode(this.signature.buffer,this.encoding);this.emit("done",e,r);this.emit("data",e);this.emit("end");this.readable=false;return e}catch(e){this.readable=false;this.emit("error",e);this.emit("close")}};VerifyStream.decode=jwsDecode;VerifyStream.isValid=isValidJws;VerifyStream.verify=jwsVerify;e.exports=VerifyStream},788:function(e,r,t){e=t.nmd(e);
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(){var t;var n="4.17.21";var a=200;var i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`";var u="__lodash_hash_undefined__";var l=500;var c="__lodash_placeholder__";var f=1,h=2,p=4;var d=1,y=2;var g=1,v=2,b=4,m=8,_=16,w=32,S=64,I=128,A=256,x=512;var k=30,j="...";var O=800,E=16;var R=1,L=2,C=3;var T=1/0,W=9007199254740991,P=17976931348623157e292,z=0/0;var B=4294967295,F=B-1,M=B>>>1;var D=[["ary",I],["bind",g],["bindKey",v],["curry",m],["curryRight",_],["flip",x],["partial",w],["partialRight",S],["rearg",A]];var K="[object Arguments]",q="[object Array]",V="[object AsyncFunction]",U="[object Boolean]",N="[object Date]",H="[object DOMException]",G="[object Error]",$="[object Function]",J="[object GeneratorFunction]",Z="[object Map]",X="[object Number]",Y="[object Null]",Q="[object Object]",ee="[object Promise]",re="[object Proxy]",te="[object RegExp]",ne="[object Set]",ae="[object String]",ie="[object Symbol]",se="[object Undefined]",oe="[object WeakMap]",ue="[object WeakSet]";var le="[object ArrayBuffer]",ce="[object DataView]",fe="[object Float32Array]",he="[object Float64Array]",pe="[object Int8Array]",de="[object Int16Array]",ye="[object Int32Array]",ge="[object Uint8Array]",ve="[object Uint8ClampedArray]",be="[object Uint16Array]",me="[object Uint32Array]";var _e=/\b__p \+= '';/g,we=/\b(__p \+=) '' \+/g,Se=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var Ie=/&(?:amp|lt|gt|quot|#39);/g,Ae=/[&<>"']/g,xe=RegExp(Ie.source),ke=RegExp(Ae.source);var je=/<%-([\s\S]+?)%>/g,Oe=/<%([\s\S]+?)%>/g,Ee=/<%=([\s\S]+?)%>/g;var Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Le=/^\w*$/,Ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var Te=/[\\^$.*+?()[\]{}|]/g,We=RegExp(Te.source);var Pe=/^\s+/;var ze=/\s/;var Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fe=/\{\n\/\* \[wrapped with (.+)\] \*/,Me=/,? & /;var De=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Ke=/[()=,{}\[\]\/\s]/;var qe=/\\(\\)?/g;var Ve=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var Ue=/\w*$/;var Ne=/^[-+]0x[0-9a-f]+$/i;var He=/^0b[01]+$/i;var Ge=/^\[object .+?Constructor\]$/;var $e=/^0o[0-7]+$/i;var Je=/^(?:0|[1-9]\d*)$/;var Ze=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var Xe=/($^)/;var Ye=/['\n\r\u2028\u2029\\]/g;var Qe="\\ud800-\\udfff",er="\\u0300-\\u036f",rr="\\ufe20-\\ufe2f",tr="\\u20d0-\\u20ff",nr=er+rr+tr,ar="\\u2700-\\u27bf",ir="a-z\\xdf-\\xf6\\xf8-\\xff",sr="\\xac\\xb1\\xd7\\xf7",or="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ur="\\u2000-\\u206f",lr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cr="A-Z\\xc0-\\xd6\\xd8-\\xde",fr="\\ufe0e\\ufe0f",hr=sr+or+ur+lr;var pr="['’]",dr="["+Qe+"]",yr="["+hr+"]",gr="["+nr+"]",vr="\\d+",br="["+ar+"]",mr="["+ir+"]",_r="[^"+Qe+hr+vr+ar+ir+cr+"]",wr="\\ud83c[\\udffb-\\udfff]",Sr="(?:"+gr+"|"+wr+")",Ir="[^"+Qe+"]",Ar="(?:\\ud83c[\\udde6-\\uddff]){2}",xr="[\\ud800-\\udbff][\\udc00-\\udfff]",kr="["+cr+"]",jr="\\u200d";var Or="(?:"+mr+"|"+_r+")",Er="(?:"+kr+"|"+_r+")",Rr="(?:"+pr+"(?:d|ll|m|re|s|t|ve))?",Lr="(?:"+pr+"(?:D|LL|M|RE|S|T|VE))?",Cr=Sr+"?",Tr="["+fr+"]?",Wr="(?:"+jr+"(?:"+[Ir,Ar,xr].join("|")+")"+Tr+Cr+")*",Pr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Br=Tr+Cr+Wr,Fr="(?:"+[br,Ar,xr].join("|")+")"+Br,Mr="(?:"+[Ir+gr+"?",gr,Ar,xr,dr].join("|")+")";var Dr=RegExp(pr,"g");var Kr=RegExp(gr,"g");var qr=RegExp(wr+"(?="+wr+")|"+Mr+Br,"g");var Vr=RegExp([kr+"?"+mr+"+"+Rr+"(?="+[yr,kr,"$"].join("|")+")",Er+"+"+Lr+"(?="+[yr,kr+Or,"$"].join("|")+")",kr+"?"+Or+"+"+Rr,kr+"+"+Lr,zr,Pr,vr,Fr].join("|"),"g");var Ur=RegExp("["+jr+Qe+nr+fr+"]");var Nr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Hr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"];var Gr=-1;var $r={};$r[fe]=$r[he]=$r[pe]=$r[de]=$r[ye]=$r[ge]=$r[ve]=$r[be]=$r[me]=true;$r[K]=$r[q]=$r[le]=$r[U]=$r[ce]=$r[N]=$r[G]=$r[$]=$r[Z]=$r[X]=$r[Q]=$r[te]=$r[ne]=$r[ae]=$r[oe]=false;var Jr={};Jr[K]=Jr[q]=Jr[le]=Jr[ce]=Jr[U]=Jr[N]=Jr[fe]=Jr[he]=Jr[pe]=Jr[de]=Jr[ye]=Jr[Z]=Jr[X]=Jr[Q]=Jr[te]=Jr[ne]=Jr[ae]=Jr[ie]=Jr[ge]=Jr[ve]=Jr[be]=Jr[me]=true;Jr[G]=Jr[$]=Jr[oe]=false;var Zr={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"};var Xr={"&":"&","<":"<",">":">",'"':""","'":"'"};var Yr={"&":"&","<":"<",">":">",""":'"',"'":"'"};var Qr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var et=parseFloat,rt=parseInt;var tt=typeof global=="object"&&global&&global.Object===Object&&global;var nt=typeof self=="object"&&self&&self.Object===Object&&self;var at=tt||nt||Function("return this")();var it=true&&r&&!r.nodeType&&r;var st=it&&"object"=="object"&&e&&!e.nodeType&&e;var ot=st&&st.exports===it;var ut=ot&&tt.process;var lt=function(){try{var e=st&&st.require&&st.require("util").types;if(e){return e}return ut&&ut.binding&&ut.binding("util")}catch(e){}}();var ct=lt&<.isArrayBuffer,ft=lt&<.isDate,ht=lt&<.isMap,pt=lt&<.isRegExp,dt=lt&<.isSet,yt=lt&<.isTypedArray;function apply(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}function arrayAggregator(e,r,t,n){var a=-1,i=e==null?0:e.length;while(++a<i){var s=e[a];r(n,s,t(s),e)}return n}function arrayEach(e,r){var t=-1,n=e==null?0:e.length;while(++t<n){if(r(e[t],t,e)===false){break}}return e}function arrayEachRight(e,r){var t=e==null?0:e.length;while(t--){if(r(e[t],t,e)===false){break}}return e}function arrayEvery(e,r){var t=-1,n=e==null?0:e.length;while(++t<n){if(!r(e[t],t,e)){return false}}return true}function arrayFilter(e,r){var t=-1,n=e==null?0:e.length,a=0,i=[];while(++t<n){var s=e[t];if(r(s,t,e)){i[a++]=s}}return i}function arrayIncludes(e,r){var t=e==null?0:e.length;return!!t&&baseIndexOf(e,r,0)>-1}function arrayIncludesWith(e,r,t){var n=-1,a=e==null?0:e.length;while(++n<a){if(t(r,e[n])){return true}}return false}function arrayMap(e,r){var t=-1,n=e==null?0:e.length,a=Array(n);while(++t<n){a[t]=r(e[t],t,e)}return a}function arrayPush(e,r){var t=-1,n=r.length,a=e.length;while(++t<n){e[a+t]=r[t]}return e}function arrayReduce(e,r,t,n){var a=-1,i=e==null?0:e.length;if(n&&i){t=e[++a]}while(++a<i){t=r(t,e[a],a,e)}return t}function arrayReduceRight(e,r,t,n){var a=e==null?0:e.length;if(n&&a){t=e[--a]}while(a--){t=r(t,e[a],a,e)}return t}function arraySome(e,r){var t=-1,n=e==null?0:e.length;while(++t<n){if(r(e[t],t,e)){return true}}return false}var gt=baseProperty("length");function asciiToArray(e){return e.split("")}function asciiWords(e){return e.match(De)||[]}function baseFindKey(e,r,t){var n;t(e,(function(e,t,a){if(r(e,t,a)){n=t;return false}}));return n}function baseFindIndex(e,r,t,n){var a=e.length,i=t+(n?1:-1);while(n?i--:++i<a){if(r(e[i],i,e)){return i}}return-1}function baseIndexOf(e,r,t){return r===r?strictIndexOf(e,r,t):baseFindIndex(e,baseIsNaN,t)}function baseIndexOfWith(e,r,t,n){var a=t-1,i=e.length;while(++a<i){if(n(e[a],r)){return a}}return-1}function baseIsNaN(e){return e!==e}function baseMean(e,r){var t=e==null?0:e.length;return t?baseSum(e,r)/t:z}function baseProperty(e){return function(r){return r==null?t:r[e]}}function basePropertyOf(e){return function(r){return e==null?t:e[r]}}function baseReduce(e,r,t,n,a){a(e,(function(e,a,i){t=n?(n=false,e):r(t,e,a,i)}));return t}function baseSortBy(e,r){var t=e.length;e.sort(r);while(t--){e[t]=e[t].value}return e}function baseSum(e,r){var n,a=-1,i=e.length;while(++a<i){var s=r(e[a]);if(s!==t){n=n===t?s:n+s}}return n}function baseTimes(e,r){var t=-1,n=Array(e);while(++t<e){n[t]=r(t)}return n}function baseToPairs(e,r){return arrayMap(r,(function(r){return[r,e[r]]}))}function baseTrim(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(Pe,""):e}function baseUnary(e){return function(r){return e(r)}}function baseValues(e,r){return arrayMap(r,(function(r){return e[r]}))}function cacheHas(e,r){return e.has(r)}function charsStartIndex(e,r){var t=-1,n=e.length;while(++t<n&&baseIndexOf(r,e[t],0)>-1){}return t}function charsEndIndex(e,r){var t=e.length;while(t--&&baseIndexOf(r,e[t],0)>-1){}return t}function countHolders(e,r){var t=e.length,n=0;while(t--){if(e[t]===r){++n}}return n}var vt=basePropertyOf(Zr);var bt=basePropertyOf(Xr);function escapeStringChar(e){return"\\"+Qr[e]}function getValue(e,r){return e==null?t:e[r]}function hasUnicode(e){return Ur.test(e)}function hasUnicodeWord(e){return Nr.test(e)}function iteratorToArray(e){var r,t=[];while(!(r=e.next()).done){t.push(r.value)}return t}function mapToArray(e){var r=-1,t=Array(e.size);e.forEach((function(e,n){t[++r]=[n,e]}));return t}function overArg(e,r){return function(t){return e(r(t))}}function replaceHolders(e,r){var t=-1,n=e.length,a=0,i=[];while(++t<n){var s=e[t];if(s===r||s===c){e[t]=c;i[a++]=t}}return i}function setToArray(e){var r=-1,t=Array(e.size);e.forEach((function(e){t[++r]=e}));return t}function setToPairs(e){var r=-1,t=Array(e.size);e.forEach((function(e){t[++r]=[e,e]}));return t}function strictIndexOf(e,r,t){var n=t-1,a=e.length;while(++n<a){if(e[n]===r){return n}}return-1}function strictLastIndexOf(e,r,t){var n=t+1;while(n--){if(e[n]===r){return n}}return n}function stringSize(e){return hasUnicode(e)?unicodeSize(e):gt(e)}function stringToArray(e){return hasUnicode(e)?unicodeToArray(e):asciiToArray(e)}function trimmedEndIndex(e){var r=e.length;while(r--&&ze.test(e.charAt(r))){}return r}var mt=basePropertyOf(Yr);function unicodeSize(e){var r=qr.lastIndex=0;while(qr.test(e)){++r}return r}function unicodeToArray(e){return e.match(qr)||[]}function unicodeWords(e){return e.match(Vr)||[]}var _t=function runInContext(e){e=e==null?at:wt.defaults(at.Object(),e,wt.pick(at,Hr));var r=e.Array,ze=e.Date,De=e.Error,Qe=e.Function,er=e.Math,rr=e.Object,tr=e.RegExp,nr=e.String,ar=e.TypeError;var ir=r.prototype,sr=Qe.prototype,or=rr.prototype;var ur=e["__core-js_shared__"];var lr=sr.toString;var cr=or.hasOwnProperty;var fr=0;var hr=function(){var e=/[^.]+$/.exec(ur&&ur.keys&&ur.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var pr=or.toString;var dr=lr.call(rr);var yr=at._;var gr=tr("^"+lr.call(cr).replace(Te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var vr=ot?e.Buffer:t,br=e.Symbol,mr=e.Uint8Array,_r=vr?vr.allocUnsafe:t,wr=overArg(rr.getPrototypeOf,rr),Sr=rr.create,Ir=or.propertyIsEnumerable,Ar=ir.splice,xr=br?br.isConcatSpreadable:t,kr=br?br.iterator:t,jr=br?br.toStringTag:t;var Or=function(){try{var e=getNative(rr,"defineProperty");e({},"",{});return e}catch(e){}}();var Er=e.clearTimeout!==at.clearTimeout&&e.clearTimeout,Rr=ze&&ze.now!==at.Date.now&&ze.now,Lr=e.setTimeout!==at.setTimeout&&e.setTimeout;var Cr=er.ceil,Tr=er.floor,Wr=rr.getOwnPropertySymbols,Pr=vr?vr.isBuffer:t,zr=e.isFinite,Br=ir.join,Fr=overArg(rr.keys,rr),Mr=er.max,qr=er.min,Vr=ze.now,Ur=e.parseInt,Nr=er.random,Zr=ir.reverse;var Xr=getNative(e,"DataView"),Yr=getNative(e,"Map"),Qr=getNative(e,"Promise"),tt=getNative(e,"Set"),nt=getNative(e,"WeakMap"),it=getNative(rr,"create");var st=nt&&new nt;var ut={};var lt=toSource(Xr),gt=toSource(Yr),_t=toSource(Qr),St=toSource(tt),It=toSource(nt);var At=br?br.prototype:t,xt=At?At.valueOf:t,kt=At?At.toString:t;function lodash(e){if(isObjectLike(e)&&!Ln(e)&&!(e instanceof LazyWrapper)){if(e instanceof LodashWrapper){return e}if(cr.call(e,"__wrapped__")){return wrapperClone(e)}}return new LodashWrapper(e)}var jt=function(){function object(){}return function(e){if(!isObject(e)){return{}}if(Sr){return Sr(e)}object.prototype=e;var r=new object;object.prototype=t;return r}}();function baseLodash(){}function LodashWrapper(e,r){this.__wrapped__=e;this.__actions__=[];this.__chain__=!!r;this.__index__=0;this.__values__=t}lodash.templateSettings={escape:je,evaluate:Oe,interpolate:Ee,variable:"",imports:{_:lodash}};lodash.prototype=baseLodash.prototype;lodash.prototype.constructor=lodash;LodashWrapper.prototype=jt(baseLodash.prototype);LodashWrapper.prototype.constructor=LodashWrapper;function LazyWrapper(e){this.__wrapped__=e;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=B;this.__views__=[]}function lazyClone(){var e=new LazyWrapper(this.__wrapped__);e.__actions__=copyArray(this.__actions__);e.__dir__=this.__dir__;e.__filtered__=this.__filtered__;e.__iteratees__=copyArray(this.__iteratees__);e.__takeCount__=this.__takeCount__;e.__views__=copyArray(this.__views__);return e}function lazyReverse(){if(this.__filtered__){var e=new LazyWrapper(this);e.__dir__=-1;e.__filtered__=true}else{e=this.clone();e.__dir__*=-1}return e}function lazyValue(){var e=this.__wrapped__.value(),r=this.__dir__,t=Ln(e),n=r<0,a=t?e.length:0,i=getView(0,a,this.__views__),s=i.start,o=i.end,u=o-s,l=n?o:s-1,c=this.__iteratees__,f=c.length,h=0,p=qr(u,this.__takeCount__);if(!t||!n&&a==u&&p==u){return baseWrapperValue(e,this.__actions__)}var d=[];e:while(u--&&h<p){l+=r;var y=-1,g=e[l];while(++y<f){var v=c[y],b=v.iteratee,m=v.type,_=b(g);if(m==L){g=_}else if(!_){if(m==R){continue e}else{break e}}}d[h++]=g}return d}LazyWrapper.prototype=jt(baseLodash.prototype);LazyWrapper.prototype.constructor=LazyWrapper;function Hash(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r<t){var n=e[r];this.set(n[0],n[1])}}function hashClear(){this.__data__=it?it(null):{};this.size=0}function hashDelete(e){var r=this.has(e)&&delete this.__data__[e];this.size-=r?1:0;return r}function hashGet(e){var r=this.__data__;if(it){var n=r[e];return n===u?t:n}return cr.call(r,e)?r[e]:t}function hashHas(e){var r=this.__data__;return it?r[e]!==t:cr.call(r,e)}function hashSet(e,r){var n=this.__data__;this.size+=this.has(e)?0:1;n[e]=it&&r===t?u:r;return this}Hash.prototype.clear=hashClear;Hash.prototype["delete"]=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r<t){var n=e[r];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[];this.size=0}function listCacheDelete(e){var r=this.__data__,t=assocIndexOf(r,e);if(t<0){return false}var n=r.length-1;if(t==n){r.pop()}else{Ar.call(r,t,1)}--this.size;return true}function listCacheGet(e){var r=this.__data__,n=assocIndexOf(r,e);return n<0?t:r[n][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,r){var t=this.__data__,n=assocIndexOf(t,e);if(n<0){++this.size;t.push([e,r])}else{t[n][1]=r}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(e){var r=-1,t=e==null?0:e.length;this.clear();while(++r<t){var n=e[r];this.set(n[0],n[1])}}function mapCacheClear(){this.size=0;this.__data__={hash:new Hash,map:new(Yr||ListCache),string:new Hash}}function mapCacheDelete(e){var r=getMapData(this,e)["delete"](e);this.size-=r?1:0;return r}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,r){var t=getMapData(this,e),n=t.size;t.set(e,r);this.size+=t.size==n?0:1;return this}MapCache.prototype.clear=mapCacheClear;MapCache.prototype["delete"]=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function SetCache(e){var r=-1,t=e==null?0:e.length;this.__data__=new MapCache;while(++r<t){this.add(e[r])}}function setCacheAdd(e){this.__data__.set(e,u);return this}function setCacheHas(e){return this.__data__.has(e)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd;SetCache.prototype.has=setCacheHas;function Stack(e){var r=this.__data__=new ListCache(e);this.size=r.size}function stackClear(){this.__data__=new ListCache;this.size=0}function stackDelete(e){var r=this.__data__,t=r["delete"](e);this.size=r.size;return t}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}function stackSet(e,r){var t=this.__data__;if(t instanceof ListCache){var n=t.__data__;if(!Yr||n.length<a-1){n.push([e,r]);this.size=++t.size;return this}t=this.__data__=new MapCache(n)}t.set(e,r);this.size=t.size;return this}Stack.prototype.clear=stackClear;Stack.prototype["delete"]=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;function arrayLikeKeys(e,r){var t=Ln(e),n=!t&&Rn(e),a=!t&&!n&&Tn(e),i=!t&&!n&&!a&&Fn(e),s=t||n||a||i,o=s?baseTimes(e.length,nr):[],u=o.length;for(var l in e){if((r||cr.call(e,l))&&!(s&&(l=="length"||a&&(l=="offset"||l=="parent")||i&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||isIndex(l,u)))){o.push(l)}}return o}function arraySample(e){var r=e.length;return r?e[baseRandom(0,r-1)]:t}function arraySampleSize(e,r){return shuffleSelf(copyArray(e),baseClamp(r,0,e.length))}function arrayShuffle(e){return shuffleSelf(copyArray(e))}function assignMergeValue(e,r,n){if(n!==t&&!eq(e[r],n)||n===t&&!(r in e)){baseAssignValue(e,r,n)}}function assignValue(e,r,n){var a=e[r];if(!(cr.call(e,r)&&eq(a,n))||n===t&&!(r in e)){baseAssignValue(e,r,n)}}function assocIndexOf(e,r){var t=e.length;while(t--){if(eq(e[t][0],r)){return t}}return-1}function baseAggregator(e,r,t,n){Ot(e,(function(e,a,i){r(n,e,t(e),i)}));return n}function baseAssign(e,r){return e&©Object(r,keys(r),e)}function baseAssignIn(e,r){return e&©Object(r,keysIn(r),e)}function baseAssignValue(e,r,t){if(r=="__proto__"&&Or){Or(e,r,{configurable:true,enumerable:true,value:t,writable:true})}else{e[r]=t}}function baseAt(e,n){var a=-1,i=n.length,s=r(i),o=e==null;while(++a<i){s[a]=o?t:get(e,n[a])}return s}function baseClamp(e,r,n){if(e===e){if(n!==t){e=e<=n?e:n}if(r!==t){e=e>=r?e:r}}return e}function baseClone(e,r,n,a,i,s){var o,u=r&f,l=r&h,c=r&p;if(n){o=i?n(e,a,i,s):n(e)}if(o!==t){return o}if(!isObject(e)){return e}var d=Ln(e);if(d){o=initCloneArray(e);if(!u){return copyArray(e,o)}}else{var y=Dt(e),g=y==$||y==J;if(Tn(e)){return cloneBuffer(e,u)}if(y==Q||y==K||g&&!i){o=l||g?{}:initCloneObject(e);if(!u){return l?copySymbolsIn(e,baseAssignIn(o,e)):copySymbols(e,baseAssign(o,e))}}else{if(!Jr[y]){return i?e:{}}o=initCloneByTag(e,y,u)}}s||(s=new Stack);var v=s.get(e);if(v){return v}s.set(e,o);if(Bn(e)){e.forEach((function(t){o.add(baseClone(t,r,n,t,e,s))}))}else if(Pn(e)){e.forEach((function(t,a){o.set(a,baseClone(t,r,n,a,e,s))}))}var b=c?l?getAllKeysIn:getAllKeys:l?keysIn:keys;var m=d?t:b(e);arrayEach(m||e,(function(t,a){if(m){a=t;t=e[a]}assignValue(o,a,baseClone(t,r,n,a,e,s))}));return o}function baseConforms(e){var r=keys(e);return function(t){return baseConformsTo(t,e,r)}}function baseConformsTo(e,r,n){var a=n.length;if(e==null){return!a}e=rr(e);while(a--){var i=n[a],s=r[i],o=e[i];if(o===t&&!(i in e)||!s(o)){return false}}return true}function baseDelay(e,r,n){if(typeof e!="function"){throw new ar(s)}return Vt((function(){e.apply(t,n)}),r)}function baseDifference(e,r,t,n){var i=-1,s=arrayIncludes,o=true,u=e.length,l=[],c=r.length;if(!u){return l}if(t){r=arrayMap(r,baseUnary(t))}if(n){s=arrayIncludesWith;o=false}else if(r.length>=a){s=cacheHas;o=false;r=new SetCache(r)}e:while(++i<u){var f=e[i],h=t==null?f:t(f);f=n||f!==0?f:0;if(o&&h===h){var p=c;while(p--){if(r[p]===h){continue e}}l.push(f)}else if(!s(r,h,n)){l.push(f)}}return l}var Ot=createBaseEach(baseForOwn);var Et=createBaseEach(baseForOwnRight,true);function baseEvery(e,r){var t=true;Ot(e,(function(e,n,a){t=!!r(e,n,a);return t}));return t}function baseExtremum(e,r,n){var a=-1,i=e.length;while(++a<i){var s=e[a],o=r(s);if(o!=null&&(u===t?o===o&&!isSymbol(o):n(o,u))){var u=o,l=s}}return l}function baseFill(e,r,n,a){var i=e.length;n=toInteger(n);if(n<0){n=-n>i?0:i+n}a=a===t||a>i?i:toInteger(a);if(a<0){a+=i}a=n>a?0:toLength(a);while(n<a){e[n++]=r}return e}function baseFilter(e,r){var t=[];Ot(e,(function(e,n,a){if(r(e,n,a)){t.push(e)}}));return t}function baseFlatten(e,r,t,n,a){var i=-1,s=e.length;t||(t=isFlattenable);a||(a=[]);while(++i<s){var o=e[i];if(r>0&&t(o)){if(r>1){baseFlatten(o,r-1,t,n,a)}else{arrayPush(a,o)}}else if(!n){a[a.length]=o}}return a}var Rt=createBaseFor();var Lt=createBaseFor(true);function baseForOwn(e,r){return e&&Rt(e,r,keys)}function baseForOwnRight(e,r){return e&&Lt(e,r,keys)}function baseFunctions(e,r){return arrayFilter(r,(function(r){return isFunction(e[r])}))}function baseGet(e,r){r=castPath(r,e);var n=0,a=r.length;while(e!=null&&n<a){e=e[toKey(r[n++])]}return n&&n==a?e:t}function baseGetAllKeys(e,r,t){var n=r(e);return Ln(e)?n:arrayPush(n,t(e))}function baseGetTag(e){if(e==null){return e===t?se:Y}return jr&&jr in rr(e)?getRawTag(e):objectToString(e)}function baseGt(e,r){return e>r}function baseHas(e,r){return e!=null&&cr.call(e,r)}function baseHasIn(e,r){return e!=null&&r in rr(e)}function baseInRange(e,r,t){return e>=qr(r,t)&&e<Mr(r,t)}function baseIntersection(e,n,a){var i=a?arrayIncludesWith:arrayIncludes,s=e[0].length,o=e.length,u=o,l=r(o),c=Infinity,f=[];while(u--){var h=e[u];if(u&&n){h=arrayMap(h,baseUnary(n))}c=qr(h.length,c);l[u]=!a&&(n||s>=120&&h.length>=120)?new SetCache(u&&h):t}h=e[0];var p=-1,d=l[0];e:while(++p<s&&f.length<c){var y=h[p],g=n?n(y):y;y=a||y!==0?y:0;if(!(d?cacheHas(d,g):i(f,g,a))){u=o;while(--u){var v=l[u];if(!(v?cacheHas(v,g):i(e[u],g,a))){continue e}}if(d){d.push(g)}f.push(y)}}return f}function baseInverter(e,r,t,n){baseForOwn(e,(function(e,a,i){r(n,t(e),a,i)}));return n}function baseInvoke(e,r,n){r=castPath(r,e);e=parent(e,r);var a=e==null?e:e[toKey(last(r))];return a==null?t:apply(a,e,n)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==K}function baseIsArrayBuffer(e){return isObjectLike(e)&&baseGetTag(e)==le}function baseIsDate(e){return isObjectLike(e)&&baseGetTag(e)==N}function baseIsEqual(e,r,t,n,a){if(e===r){return true}if(e==null||r==null||!isObjectLike(e)&&!isObjectLike(r)){return e!==e&&r!==r}return baseIsEqualDeep(e,r,t,n,baseIsEqual,a)}function baseIsEqualDeep(e,r,t,n,a,i){var s=Ln(e),o=Ln(r),u=s?q:Dt(e),l=o?q:Dt(r);u=u==K?Q:u;l=l==K?Q:l;var c=u==Q,f=l==Q,h=u==l;if(h&&Tn(e)){if(!Tn(r)){return false}s=true;c=false}if(h&&!c){i||(i=new Stack);return s||Fn(e)?equalArrays(e,r,t,n,a,i):equalByTag(e,r,u,t,n,a,i)}if(!(t&d)){var p=c&&cr.call(e,"__wrapped__"),y=f&&cr.call(r,"__wrapped__");if(p||y){var g=p?e.value():e,v=y?r.value():r;i||(i=new Stack);return a(g,v,t,n,i)}}if(!h){return false}i||(i=new Stack);return equalObjects(e,r,t,n,a,i)}function baseIsMap(e){return isObjectLike(e)&&Dt(e)==Z}function baseIsMatch(e,r,n,a){var i=n.length,s=i,o=!a;if(e==null){return!s}e=rr(e);while(i--){var u=n[i];if(o&&u[2]?u[1]!==e[u[0]]:!(u[0]in e)){return false}}while(++i<s){u=n[i];var l=u[0],c=e[l],f=u[1];if(o&&u[2]){if(c===t&&!(l in e)){return false}}else{var h=new Stack;if(a){var p=a(c,f,l,e,r,h)}if(!(p===t?baseIsEqual(f,c,d|y,a,h):p)){return false}}}return true}function baseIsNative(e){if(!isObject(e)||isMasked(e)){return false}var r=isFunction(e)?gr:Ge;return r.test(toSource(e))}function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==te}function baseIsSet(e){return isObjectLike(e)&&Dt(e)==ne}function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!$r[baseGetTag(e)]}function baseIteratee(e){if(typeof e=="function"){return e}if(e==null){return