@liflig/cdk-cloudfront-auth 1.8.16 → 1.8.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/check-auth/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={49:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsecuredJWT=void 0;const n=r(82),o=r(5821),i=r(6247),s=r(493),a=r(751);class c extends a.ProduceJWT{encode(){return`${n.encode(JSON.stringify({alg:"none"}))}.${n.encode(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new i.JWTInvalid("Unsecured JWT must be a string");const{0:r,1:a,2:c,length:u}=e.split(".");if(3!==u||""!==c)throw new i.JWTInvalid("Invalid Unsecured JWT");let l;try{if(l=JSON.parse(o.decoder.decode(n.decode(r))),"none"!==l.alg)throw new Error}catch{throw new i.JWTInvalid("Invalid Unsecured JWT")}return{payload:(0,s.default)(l,n.decode(a),t),header:l}}}t.UnsecuredJWT=c},68:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exportJWK=t.exportPKCS8=t.exportSPKI=void 0;const n=r(293),o=r(293),i=r(9590);t.exportSPKI=async function(e){return(0,n.toSPKI)(e)},t.exportPKCS8=async function(e){return(0,o.toPKCS8)(e)},t.exportJWK=async function(e){return(0,i.default)(e)}},82:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=t.encodeBase64=t.decodeBase64=void 0;const n=r(181),o=r(5821);let i;n.Buffer.isEncoding("base64url")?t.encode=i=e=>n.Buffer.from(e).toString("base64url"):t.encode=i=e=>n.Buffer.from(e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),t.decodeBase64=e=>n.Buffer.from(e,"base64"),t.encodeBase64=e=>n.Buffer.from(e).toString("base64"),t.decode=e=>n.Buffer.from(function(e){let t=e;return t instanceof Uint8Array&&(t=o.decoder.decode(t)),t}(e),"base64")},144:(e,t,r)=>{"use strict";const n=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},181:e=>{"use strict";e.exports=require("buffer")},257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cryptoRuntime=t.base64url=t.generateSecret=t.generateKeyPair=t.errors=t.decodeJwt=t.decodeProtectedHeader=t.importJWK=t.importX509=t.importPKCS8=t.importSPKI=t.exportJWK=t.exportSPKI=t.exportPKCS8=t.UnsecuredJWT=t.createRemoteJWKSet=t.createLocalJWKSet=t.EmbeddedJWK=t.calculateJwkThumbprintUri=t.calculateJwkThumbprint=t.EncryptJWT=t.SignJWT=t.GeneralSign=t.FlattenedSign=t.CompactSign=t.FlattenedEncrypt=t.CompactEncrypt=t.jwtDecrypt=t.jwtVerify=t.generalVerify=t.flattenedVerify=t.compactVerify=t.GeneralEncrypt=t.generalDecrypt=t.flattenedDecrypt=t.compactDecrypt=void 0;var n=r(6923);Object.defineProperty(t,"compactDecrypt",{enumerable:!0,get:function(){return n.compactDecrypt}});var o=r(4533);Object.defineProperty(t,"flattenedDecrypt",{enumerable:!0,get:function(){return o.flattenedDecrypt}});var i=r(774);Object.defineProperty(t,"generalDecrypt",{enumerable:!0,get:function(){return i.generalDecrypt}});var s=r(782);Object.defineProperty(t,"GeneralEncrypt",{enumerable:!0,get:function(){return s.GeneralEncrypt}});var a=r(1427);Object.defineProperty(t,"compactVerify",{enumerable:!0,get:function(){return a.compactVerify}});var c=r(6833);Object.defineProperty(t,"flattenedVerify",{enumerable:!0,get:function(){return c.flattenedVerify}});var u=r(9060);Object.defineProperty(t,"generalVerify",{enumerable:!0,get:function(){return u.generalVerify}});var l=r(3082);Object.defineProperty(t,"jwtVerify",{enumerable:!0,get:function(){return l.jwtVerify}});var d=r(3814);Object.defineProperty(t,"jwtDecrypt",{enumerable:!0,get:function(){return d.jwtDecrypt}});var p=r(7815);Object.defineProperty(t,"CompactEncrypt",{enumerable:!0,get:function(){return p.CompactEncrypt}});var f=r(9805);Object.defineProperty(t,"FlattenedEncrypt",{enumerable:!0,get:function(){return f.FlattenedEncrypt}});var h=r(9851);Object.defineProperty(t,"CompactSign",{enumerable:!0,get:function(){return h.CompactSign}});var y=r(4329);Object.defineProperty(t,"FlattenedSign",{enumerable:!0,get:function(){return y.FlattenedSign}});var m=r(7440);Object.defineProperty(t,"GeneralSign",{enumerable:!0,get:function(){return m.GeneralSign}});var g=r(2230);Object.defineProperty(t,"SignJWT",{enumerable:!0,get:function(){return g.SignJWT}});var v=r(6638);Object.defineProperty(t,"EncryptJWT",{enumerable:!0,get:function(){return v.EncryptJWT}});var w=r(2599);Object.defineProperty(t,"calculateJwkThumbprint",{enumerable:!0,get:function(){return w.calculateJwkThumbprint}}),Object.defineProperty(t,"calculateJwkThumbprintUri",{enumerable:!0,get:function(){return w.calculateJwkThumbprintUri}});var E=r(278);Object.defineProperty(t,"EmbeddedJWK",{enumerable:!0,get:function(){return E.EmbeddedJWK}});var b=r(6980);Object.defineProperty(t,"createLocalJWKSet",{enumerable:!0,get:function(){return b.createLocalJWKSet}});var S=r(9877);Object.defineProperty(t,"createRemoteJWKSet",{enumerable:!0,get:function(){return S.createRemoteJWKSet}});var _=r(49);Object.defineProperty(t,"UnsecuredJWT",{enumerable:!0,get:function(){return _.UnsecuredJWT}});var A=r(68);Object.defineProperty(t,"exportPKCS8",{enumerable:!0,get:function(){return A.exportPKCS8}}),Object.defineProperty(t,"exportSPKI",{enumerable:!0,get:function(){return A.exportSPKI}}),Object.defineProperty(t,"exportJWK",{enumerable:!0,get:function(){return A.exportJWK}});var P=r(7364);Object.defineProperty(t,"importSPKI",{enumerable:!0,get:function(){return P.importSPKI}}),Object.defineProperty(t,"importPKCS8",{enumerable:!0,get:function(){return P.importPKCS8}}),Object.defineProperty(t,"importX509",{enumerable:!0,get:function(){return P.importX509}}),Object.defineProperty(t,"importJWK",{enumerable:!0,get:function(){return P.importJWK}});var I=r(4443);Object.defineProperty(t,"decodeProtectedHeader",{enumerable:!0,get:function(){return I.decodeProtectedHeader}});var O=r(8396);Object.defineProperty(t,"decodeJwt",{enumerable:!0,get:function(){return O.decodeJwt}}),t.errors=r(6247);var k=r(409);Object.defineProperty(t,"generateKeyPair",{enumerable:!0,get:function(){return k.generateKeyPair}});var C=r(4121);Object.defineProperty(t,"generateSecret",{enumerable:!0,get:function(){return C.generateSecret}}),t.base64url=r(8462);var T=r(4166);Object.defineProperty(t,"cryptoRuntime",{enumerable:!0,get:function(){return T.default}})},270:(e,t,r)=>{"use strict";const n=r(3908),o=r(8311);e.exports=(e,t,r)=>{let i=null,s=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(i&&1!==s.compare(e)||(i=e,s=new n(i,r)))}),i}},278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmbeddedJWK=void 0;const n=r(7364),o=r(1855),i=r(6247);t.EmbeddedJWK=async function(e,t){const r={...e,...null==t?void 0:t.header};if(!(0,o.default)(r.jwk))throw new i.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const s=await(0,n.importJWK)({...r.jwk,ext:!0},r.alg,!0);if(s instanceof Uint8Array||"public"!==s.type)throw new i.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a public key');return s}},293:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromX509=t.fromSPKI=t.fromPKCS8=t.toPKCS8=t.toSPKI=void 0;const n=r(6982),o=r(181),i=r(8993),s=r(4512),a=r(8737),c=r(740),u=(e,t,r)=>{let o;if((0,i.isCryptoKey)(r)){if(!r.extractable)throw new TypeError("CryptoKey is not extractable");o=n.KeyObject.from(r)}else{if(!(0,s.default)(r))throw new TypeError((0,a.default)(r,...c.types));o=r}if(o.type!==e)throw new TypeError(`key is not a ${e} key`);return o.export({format:"pem",type:t})};t.toSPKI=e=>u("public","spki",e),t.toPKCS8=e=>u("private","pkcs8",e),t.fromPKCS8=e=>(0,n.createPrivateKey)({key:o.Buffer.from(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,""),"base64"),type:"pkcs8",format:"der"}),t.fromSPKI=e=>(0,n.createPublicKey)({key:o.Buffer.from(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,""),"base64"),type:"spki",format:"der"}),t.fromX509=e=>(0,n.createPublicKey)({key:e,type:"spki",format:"pem"})},349:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,o=arguments.length;r<o;r++)t.push(arguments[r]);return t}function o(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function i(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,o=this.head;null!==o;)r.push(e.call(t,o.value,this)),o=o.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,o=this.tail;null!==o;)r.push(e.call(t,o.value,this)),o=o.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var o=0;null!==n;o++)r=e(r,n.value,o),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var o=this.length-1;null!==n;o--)r=e(r,n.value,o),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,i=this.head;null!==i&&o<e;o++)i=i.next;for(;null!==i&&o<t;o++,i=i.next)r.push(i.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,i=this.tail;null!==i&&o>t;o--)i=i.prev;for(;null!==i&&o>e;o--,i=i.prev)r.push(i.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var s=[];for(n=0;i&&n<t;n++)s.push(i.value),i=this.removeNode(i);for(null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev),n=0;n<r.length;n++)i=o(this,i,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(9669)(n)}catch(e){}},409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=void 0;const n=r(7975);t.generateKeyPair=async function(e,t){return(0,n.generateKeyPair)(e,t)}},493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247),o=r(5821),i=r(936),s=r(9743),a=r(1855),c=e=>e.toLowerCase().replace(/^application\//,"");t.default=(e,t,r={})=>{const{typ:u}=r;if(u&&("string"!=typeof e.typ||c(e.typ)!==c(u)))throw new n.JWTClaimValidationFailed('unexpected "typ" JWT header value',"typ","check_failed");let l;try{l=JSON.parse(o.decoder.decode(t))}catch{}if(!(0,a.default)(l))throw new n.JWTInvalid("JWT Claims Set must be a top-level JSON object");const{requiredClaims:d=[],issuer:p,subject:f,audience:h,maxTokenAge:y}=r;void 0!==y&&d.push("iat"),void 0!==h&&d.push("aud"),void 0!==f&&d.push("sub"),void 0!==p&&d.push("iss");for(const e of new Set(d.reverse()))if(!(e in l))throw new n.JWTClaimValidationFailed(`missing required "${e}" claim`,e,"missing");if(p&&!(Array.isArray(p)?p:[p]).includes(l.iss))throw new n.JWTClaimValidationFailed('unexpected "iss" claim value',"iss","check_failed");if(f&&l.sub!==f)throw new n.JWTClaimValidationFailed('unexpected "sub" claim value',"sub","check_failed");if(h&&(g="string"==typeof h?[h]:h,!("string"==typeof(m=l.aud)?g.includes(m):Array.isArray(m)&&g.some(Set.prototype.has.bind(new Set(m))))))throw new n.JWTClaimValidationFailed('unexpected "aud" claim value',"aud","check_failed");var m,g;let v;switch(typeof r.clockTolerance){case"string":v=(0,s.default)(r.clockTolerance);break;case"number":v=r.clockTolerance;break;case"undefined":v=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:w}=r,E=(0,i.default)(w||new Date);if((void 0!==l.iat||y)&&"number"!=typeof l.iat)throw new n.JWTClaimValidationFailed('"iat" claim must be a number',"iat","invalid");if(void 0!==l.nbf){if("number"!=typeof l.nbf)throw new n.JWTClaimValidationFailed('"nbf" claim must be a number',"nbf","invalid");if(l.nbf>E+v)throw new n.JWTClaimValidationFailed('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==l.exp){if("number"!=typeof l.exp)throw new n.JWTClaimValidationFailed('"exp" claim must be a number',"exp","invalid");if(l.exp<=E-v)throw new n.JWTExpired('"exp" claim timestamp check failed',"exp","check_failed")}if(y){const e=E-l.iat;if(e-v>("number"==typeof y?y:(0,s.default)(y)))throw new n.JWTExpired('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-v)throw new n.JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return l}},508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2395),o=r(6112),i=r(5904),s=r(3020),a=r(82),c=r(1784),u=r(6247),l=r(68),d=r(1688),p=r(7031);t.default=async function(e,t,r,f,h={}){let y,m,g;switch((0,d.default)(e,r,"encrypt"),e){case"dir":g=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!o.ecdhAllowed(r))throw new u.JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:i,apv:s}=h;let{epk:d}=h;d||(d=(await o.generateEpk(r)).privateKey);const{x:p,y:v,crv:w,kty:E}=await(0,l.exportJWK)(d),b=await o.deriveKey(r,d,"ECDH-ES"===e?t:e,"ECDH-ES"===e?(0,c.bitLength)(t):parseInt(e.slice(-5,-2),10),i,s);if(m={epk:{x:p,crv:w,kty:E}},"EC"===E&&(m.epk.y=v),i&&(m.apu=(0,a.encode)(i)),s&&(m.apv=(0,a.encode)(s)),"ECDH-ES"===e){g=b;break}g=f||(0,c.default)(t);const S=e.slice(-6);y=await(0,n.wrap)(S,b,g);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":g=f||(0,c.default)(t),y=await(0,s.encrypt)(e,r,g);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{g=f||(0,c.default)(t);const{p2c:n,p2s:o}=h;({encryptedKey:y,...m}=await(0,i.encrypt)(e,r,g,n,o));break}case"A128KW":case"A192KW":case"A256KW":g=f||(0,c.default)(t),y=await(0,n.wrap)(e,r,g);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{g=f||(0,c.default)(t);const{iv:n}=h;({encryptedKey:y,...m}=await(0,p.wrap)(e,r,g,n));break}default:throw new u.JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:g,encryptedKey:y,parameters:m}}},560:(e,t,r)=>{"use strict";const n=r(3908);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},736:(e,t,r)=>{e.exports=function(e){function t(e){let r,o,i,s=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),i=o-(r||o);n.diff=i,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];r=i.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function o(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(o(e,r))return!1;for(const r of t.names)if(o(e,r))return!0;return!1},t.humanize=r(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.types=void 0;const n=r(8993),o=r(4512);t.default=e=>(0,o.default)(e)||(0,n.isCryptoKey)(e);const i=["KeyObject"];t.types=i,(globalThis.CryptoKey||(null===n.default||void 0===n.default?void 0:n.default.CryptoKey))&&i.push("CryptoKey")},751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProduceJWT=void 0;const n=r(936),o=r(1855),i=r(9743);t.ProduceJWT=class{constructor(e){if(!(0,o.default)(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:(0,n.default)(new Date)+(0,i.default)(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:(0,n.default)(new Date)+(0,i.default)(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:(0,n.default)(new Date)}:{...this._payload,iat:e},this}}},774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalDecrypt=void 0;const n=r(4533),o=r(6247),i=r(1855);t.generalDecrypt=async function(e,t,r){if(!(0,i.default)(e))throw new o.JWEInvalid("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(i.default))throw new o.JWEInvalid("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new o.JWEInvalid("JWE Recipients has no members");for(const o of e.recipients)try{return await(0,n.flattenedDecrypt)({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:o.encrypted_key,header:o.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,r)}catch{}throw new o.JWEDecryptionFailed}},782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralEncrypt=void 0;const n=r(9805),o=r(6247),i=r(1784),s=r(9476),a=r(508),c=r(82),u=r(2458);class l{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}t.GeneralEncrypt=class{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const r=new l(this,e,{crit:null==t?void 0:t.crit});return this._recipients.push(r),r}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(e){var t,r,l;if(!this._recipients.length)throw new o.JWEInvalid("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){const[t]=this._recipients,r=await new n.FlattenedEncrypt(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e});let o={ciphertext:r.ciphertext,iv:r.iv,recipients:[{}],tag:r.tag};return r.aad&&(o.aad=r.aad),r.protected&&(o.protected=r.protected),r.unprotected&&(o.unprotected=r.unprotected),r.encrypted_key&&(o.recipients[0].encrypted_key=r.encrypted_key),r.header&&(o.recipients[0].header=r.header),o}let d;for(let e=0;e<this._recipients.length;e++){const t=this._recipients[e];if(!(0,s.default)(this._protectedHeader,this._unprotectedHeader,t.unprotectedHeader))throw new o.JWEInvalid("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...t.unprotectedHeader},{alg:n}=r;if("string"!=typeof n||!n)throw new o.JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===n||"ECDH-ES"===n)throw new o.JWEInvalid('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof r.enc||!r.enc)throw new o.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(d){if(d!==r.enc)throw new o.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else d=r.enc;if((0,u.default)(o.JWEInvalid,new Map,t.options.crit,this._protectedHeader,r),!(void 0===r.zip||this._protectedHeader&&this._protectedHeader.zip))throw new o.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const p=(0,i.default)(d);let f={ciphertext:"",iv:"",recipients:[],tag:""};for(let o=0;o<this._recipients.length;o++){const i=this._recipients[o],s={};f.recipients.push(s);const u={...this._protectedHeader,...this._unprotectedHeader,...i.unprotectedHeader}.alg.startsWith("PBES2")?2048+o:void 0;if(0===o){const t=await new n.FlattenedEncrypt(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(p).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(i.unprotectedHeader).setKeyManagementParameters({p2c:u}).encrypt(i.key,{...i.options,...e,[n.unprotected]:!0});f.ciphertext=t.ciphertext,f.iv=t.iv,f.tag=t.tag,t.aad&&(f.aad=t.aad),t.protected&&(f.protected=t.protected),t.unprotected&&(f.unprotected=t.unprotected),s.encrypted_key=t.encrypted_key,t.header&&(s.header=t.header);continue}const{encryptedKey:h,parameters:y}=await(0,a.default)((null===(t=i.unprotectedHeader)||void 0===t?void 0:t.alg)||(null===(r=this._protectedHeader)||void 0===r?void 0:r.alg)||(null===(l=this._unprotectedHeader)||void 0===l?void 0:l.alg),d,i.key,p,{p2c:u});s.encrypted_key=(0,c.encode)(h),(i.unprotectedHeader||y)&&(s.header={...i.unprotectedHeader,...y})}return f}}},855:(e,t,r)=>{var n=r(6585);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var o=n(e);if(void 0===o)return;return Math.floor(r+o/1e3)}return"number"==typeof e?r+e:void 0}},857:e=>{"use strict";e.exports=require("os")},909:(e,t,r)=>{"use strict";const n=r(3908);e.exports=(e,t,r)=>{const o=new n(e,r),i=new n(t,r);return o.compare(i)||o.compareBuild(i)}},927:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(6982);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.randomFillSync}})},936:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>Math.floor(e.getTime()/1e3)},947:e=>{function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="ArgumentError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},1045:(e,t,r)=>{"use strict";var n=r(181).Buffer,o=r(181).SlowBuffer;function i(e,t){if(!n.isBuffer(e)||!n.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(var r=0,o=0;o<e.length;o++)r|=e[o]^t[o];return 0===r}e.exports=i,i.install=function(){n.prototype.equal=o.prototype.equal=function(e){return i(this,e)}};var s=n.prototype.equal,a=o.prototype.equal;i.restore=function(){n.prototype.equal=s,o.prototype.equal=a}},1123:e=>{"use strict";const t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;const n=t.test(e),o=t.test(r);return n&&o&&(e=+e,r=+r),e===r?0:n&&!o?-1:o&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},1146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247),o=r(7974);t.default=(e,t)=>{if(t.length<<3!==(0,o.bitLength)(e))throw new n.JWEInvalid("Invalid Initialization Vector length")}},1161:e=>{function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},1185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwkImport=t.jwkExport=t.rsaPssParams=t.oneShotCallback=void 0;const[r,n]=process.versions.node.split(".").map(e=>parseInt(e,10));t.oneShotCallback=r>=16||15===r&&n>=13,t.rsaPssParams=!("electron"in process.versions)&&(r>=17||16===r&&n>=9),t.jwkExport=r>=16||15===r&&n>=9,t.jwkImport=r>=16||15===r&&n>=12},1261:(e,t,r)=>{"use strict";const n=r(3908),o=r(8311),i=r(5580);e.exports=(e,t)=>{e=new o(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const o=e.set[t];let s=null;o.forEach(e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!i(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!s||r&&!i(r,s)||(r=s)}return r&&e.test(r)?r:null}},1326:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){if(48!==e[0])throw new TypeError;if(this.buffer=e,this.offset=1,this.decodeLength()!==e.length-this.offset)throw new TypeError}decodeLength(){let e=this.buffer[this.offset++];if(128&e){const t=-129&e;e=0;for(let r=0;r<t;r++)e=e<<8|this.buffer[this.offset+r];this.offset+=t}return e}unsignedInteger(){if(2!==this.buffer[this.offset++])throw new TypeError;let e=this.decodeLength();0===this.buffer[this.offset]&&(this.offset++,e--);const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}end(){if(this.offset!==this.buffer.length)throw new TypeError}}},1389:(e,t,r)=>{const n=r(5753)("jwks"),o=r(8639),{promisify:i,callbackify:s}=r(9023);e.exports.A=function(e,{cacheMaxEntries:t=5,cacheMaxAge:r=6e5}){return n(`Configured caching of signing keys. Max: ${t} / Age: ${r}`),i(o({hash:e=>e,load:s(e.getSigningKey.bind(e)),maxAge:r,max:t}))}},1427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactVerify=void 0;const n=r(6833),o=r(6247),i=r(5821);t.compactVerify=async function(e,t,r){if(e instanceof Uint8Array&&(e=i.decoder.decode(e)),"string"!=typeof e)throw new o.JWSInvalid("Compact JWS must be a string or Uint8Array");const{0:s,1:a,2:c,length:u}=e.split(".");if(3!==u)throw new o.JWSInvalid("Invalid Compact JWS");const l=await(0,n.flattenedVerify)({payload:a,protected:s,signature:c},t,r),d={payload:l.payload,protectedHeader:l.protectedHeader};return"function"==typeof t?{...d,key:l.key}:d}},1603:(e,t,r)=>{"use strict";const n=r(349),o=Symbol("max"),i=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),d=Symbol("lruList"),p=Symbol("cache"),f=Symbol("updateAgeOnGet"),h=()=>1,y=(e,t,r)=>{const n=e[p].get(t);if(n){const t=n.value;if(m(e,t)){if(v(e,n),!e[a])return}else r&&(e[f]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},g=e=>{if(e[i]>e[o])for(let t=e[d].tail;e[i]>e[o]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[i]-=r.length,e[p].delete(r.key),e[d].removeNode(t)}};class w{constructor(e,t,r,n,o){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=o||0}}const E=(e,t,r,n)=>{let o=r.value;m(e,o)&&(v(e,r),e[a]||(o=void 0)),o&&t.call(n,o.value,o.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||h;if(this[s]="function"!=typeof t?h:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,g(this)}get max(){return this[o]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,g(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[s]&&(this[s]=e,this[i]=0,this[d].forEach(e=>{e.length=this[s](e.value,e.key),this[i]+=e.length})),g(this)}get lengthCalculator(){return this[s]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){const n=r.prev;E(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){const n=r.next;E(this,e,r,t),r=n}}keys(){return this[d].toArray().map(e=>e.key)}values(){return this[d].toArray().map(e=>e.value)}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach(e=>this[u](e.key,e.value)),this[p]=new Map,this[d]=new n,this[i]=0}dump(){return this[d].map(e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[d]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[p].has(e)){if(a>this[o])return v(this,this[p].get(e)),!1;const s=this[p].get(e).value;return this[u]&&(this[l]||this[u](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[i]+=a-s.length,s.length=a,this.get(e),g(this),!0}const f=new w(e,t,a,n,r);return f.length>this[o]?(this[u]&&this[u](e,t),!1):(this[i]+=f.length,this[d].unshift(f),this[p].set(e,this[d].head),g(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!m(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],o=n.e||0;if(0===o)this.set(n.k,n.v);else{const e=o-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[p].forEach((e,t)=>y(this,t,!1))}}},1688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8737),o=r(740);t.default=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!(0,o.default)(t))throw new TypeError((0,n.withAlg)(e,t,...o.types,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${o.types.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!(0,o.default)(t))throw new TypeError((0,n.withAlg)(e,t,...o.types));if("secret"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)}},1691:(e,t,r)=>{const n=r(1741),o=r(3726),i=r(8980),s=r(7260),a=r(855),c=r(7019),u=r(4977),l=r(5747),{KeyObject:d,createSecretKey:p,createPublicKey:f}=r(6982),h=["RS256","RS384","RS512"],y=["ES256","ES384","ES512"],m=["RS256","RS384","RS512"],g=["HS256","HS384","HS512"];u&&(h.splice(h.length,0,"PS256","PS384","PS512"),m.splice(m.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,u){let v;if("function"!=typeof r||u||(u=r,r={}),r||(r={}),r=Object.assign({},r),v=u||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new n("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new n("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new n("allowInvalidAsymmetricKeyTypes must be a boolean"));const w=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new n("jwt must be provided"));if("string"!=typeof e)return v(new n("jwt must be a string"));const E=e.split(".");if(3!==E.length)return v(new n("jwt malformed"));let b;try{b=s(e,{complete:!0})}catch(e){return v(e)}if(!b)return v(new n("invalid token"));const S=b.header;let _;if("function"==typeof t){if(!u)return v(new n("verify must be called asynchronous if secret or public key is provided as a callback"));_=t}else _=function(e,r){return r(null,t)};return _(S,function(t,s){if(t)return v(new n("error in secret or public key callback: "+t.message));const u=""!==E[2].trim();if(!u&&s)return v(new n("jwt signature is required"));if(u&&!s)return v(new n("secret or public key must be provided"));if(!u&&!r.algorithms)return v(new n('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof d))try{s=f(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new n("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=g:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=m:"ec"===s.asymmetricKeyType?r.algorithms=y:r.algorithms=h),-1===r.algorithms.indexOf(b.header.alg))return v(new n("invalid algorithm"));if(S.alg.startsWith("HS")&&"secret"!==s.type)return v(new n(`secretOrPublicKey must be a symmetric key when using ${S.alg}`));if(/^(?:RS|PS|ES)/.test(S.alg)&&"public"!==s.type)return v(new n(`secretOrPublicKey must be an asymmetric key when using ${S.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{c(S.alg,s)}catch(e){return v(e)}let _;try{_=l.verify(e,b.header.alg,s)}catch(e){return v(e)}if(!_)return v(new n("invalid signature"));const A=b.payload;if(void 0!==A.nbf&&!r.ignoreNotBefore){if("number"!=typeof A.nbf)return v(new n("invalid nbf value"));if(A.nbf>w+(r.clockTolerance||0))return v(new o("jwt not active",new Date(1e3*A.nbf)))}if(void 0!==A.exp&&!r.ignoreExpiration){if("number"!=typeof A.exp)return v(new n("invalid exp value"));if(w>=A.exp+(r.clockTolerance||0))return v(new i("jwt expired",new Date(1e3*A.exp)))}if(r.audience){const e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new n("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&A.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(A.iss)))return v(new n("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return v(new n("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return v(new n("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return v(new n("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof A.iat)return v(new n("iat required when maxAge is specified"));const e=a(r.maxAge,A.iat);if(void 0===e)return v(new n('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(w>=e+(r.clockTolerance||0))return v(new i("maxAge exceeded",new Date(1e3*e)))}if(!0===r.complete){const e=b.signature;return v(null,{header:S,payload:A,signature:e})}return v(null,A)})}},1729:(e,t,r)=>{"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},1741:e=>{var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};(t.prototype=Object.create(Error.prototype)).constructor=t,e.exports=t},1763:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t)=>n(e,t,!0)},1784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitLength=void 0;const n=r(6247),o=r(927);function i(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new n.JOSENotSupported(`Unsupported JWE Algorithm: ${e}`)}}t.bitLength=i,t.default=e=>(0,o.default)(new Uint8Array(i(e)>>3))},1832:(e,t,r)=>{"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e,null,!0),o=n(t,null,!0),i=r.compare(o);if(0===i)return null;const s=i>0,a=s?r:o,c=s?o:r,u=!!a.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const l=u?"pre":"";return r.major!==o.major?l+"major":r.minor!==o.minor?l+"minor":r.patch!==o.patch?l+"patch":"prerelease"}},1855:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}},1977:(e,t,r)=>{const n=r(9589);e.exports=n.satisfies(process.version,">=15.7.0")},2010:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=r(3527);function i(e){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=128&&--n,n}e.exports={derToJose:function(e,t){e=i(e);var r=o(t),s=r+1,a=e.length,c=0;if(48!==e[c++])throw new Error('Could not find expected "seq"');var u=e[c++];if(129===u&&(u=e[c++]),a-c<u)throw new Error('"seq" specified length of "'+u+'", only "'+(a-c)+'" remaining');if(2!==e[c++])throw new Error('Could not find expected "int" for "r"');var l=e[c++];if(a-c-2<l)throw new Error('"r" specified length of "'+l+'", only "'+(a-c-2)+'" available');if(s<l)throw new Error('"r" specified length of "'+l+'", max of "'+s+'" is acceptable');var d=c;if(c+=l,2!==e[c++])throw new Error('Could not find expected "int" for "s"');var p=e[c++];if(a-c!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(a-c)+'"');if(s<p)throw new Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var f=c;if((c+=p)!==a)throw new Error('Expected to consume entire buffer, but "'+(a-c)+'" bytes remain');var h=r-l,y=r-p,m=n.allocUnsafe(h+l+y+p);for(c=0;c<h;++c)m[c]=0;e.copy(m,c,d+Math.max(-h,0),d+l);for(var g=c=r;c<g+y;++c)m[c]=0;return e.copy(m,c,f+Math.max(-y,0),f+p),(m=m.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=i(e);var r=o(t),a=e.length;if(a!==2*r)throw new TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+a+'"');var c=s(e,0,r),u=s(e,r,e.length),l=r-c,d=r-u,p=2+l+1+1+d,f=p<128,h=n.allocUnsafe((f?2:3)+p),y=0;return h[y++]=48,f?h[y++]=p:(h[y++]=129,h[y++]=255&p),h[y++]=2,h[y++]=l,c<0?(h[y++]=0,y+=e.copy(h,y,0,r)):y+=e.copy(h,y,c,r),h[y++]=2,h[y++]=d,u<0?(h[y++]=0,e.copy(h,y,r)):e.copy(h,y,r+u),h}}},2018:e=>{"use strict";e.exports=require("tty")},2027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(1146),i=r(2319),s=r(5821),a=r(4803),c=r(8993),u=r(2484),l=r(4512),d=r(8737),p=r(6247),f=r(3022),h=r(740);t.default=(e,t,r,y,m)=>{let g;if((0,c.isCryptoKey)(r))(0,u.checkEncCryptoKey)(r,e,"encrypt"),g=n.KeyObject.from(r);else{if(!(r instanceof Uint8Array||(0,l.default)(r)))throw new TypeError((0,d.default)(r,...h.types,"Uint8Array"));g=r}switch((0,i.default)(e,g),(0,o.default)(e,y),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return function(e,t,r,o,i){const c=parseInt(e.slice(1,4),10);(0,l.default)(r)&&(r=r.export());const u=r.subarray(c>>3),d=r.subarray(0,c>>3),h=`aes-${c}-cbc`;if(!(0,f.default)(h))throw new p.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);const y=(0,n.createCipheriv)(h,u,o),m=(0,s.concat)(y.update(t),y.final()),g=parseInt(e.slice(-3),10);return{ciphertext:m,tag:(0,a.default)(i,o,m,g,d,c)}}(e,t,g,y,m);case"A128GCM":case"A192GCM":case"A256GCM":return function(e,t,r,o,i){const s=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!(0,f.default)(s))throw new p.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);const a=(0,n.createCipheriv)(s,r,o,{authTagLength:16});i.byteLength&&a.setAAD(i,{plaintextLength:t.length});const c=a.update(t);return a.final(),{ciphertext:c,tag:a.getAuthTag()}}(e,t,g,y,m);default:throw new p.JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}}},2111:(e,t,r)=>{"use strict";const n=r(4641),o=r(3999),i=r(5580),s=r(4089),a=r(7059),c=r(5200);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return o(e,r,u);case">":return i(e,r,u);case">=":return s(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},2167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982).timingSafeEqual;t.default=n},2203:e=>{"use strict";e.exports=require("stream")},2230:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignJWT=void 0;const n=r(9851),o=r(6247),i=r(5821),s=r(751);class a extends s.ProduceJWT{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var r;const s=new n.CompactSign(i.encoder.encode(JSON.stringify(this._payload)));if(s.setProtectedHeader(this._protectedHeader),Array.isArray(null===(r=this._protectedHeader)||void 0===r?void 0:r.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new o.JWTInvalid("JWTs MUST NOT use unencoded payload");return s.sign(e,t)}}t.SignJWT=a},2319:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247),o=r(4512);t.default=(e,t)=>{let r;switch(e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":r=parseInt(e.slice(-3),10);break;case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10);break;default:throw new n.JOSENotSupported(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){const e=t.byteLength<<3;if(e!==r)throw new n.JWEInvalid(`Invalid Content Encryption Key length. Expected ${r} bits, got ${e} bits`);return}if((0,o.default)(t)&&"secret"===t.type){const e=t.symmetricKeySize<<3;if(e!==r)throw new n.JWEInvalid(`Invalid Content Encryption Key length. Expected ${r} bits, got ${e} bits`);return}throw new TypeError("Invalid Content Encryption Key type")}},2395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=t.wrap=void 0;const n=r(181),o=r(6982),i=r(6247),s=r(5821),a=r(8993),c=r(2484),u=r(4512),l=r(8737),d=r(3022),p=r(740);function f(e,t){if(e.symmetricKeySize<<3!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function h(e,t,r){if((0,u.default)(e))return e;if(e instanceof Uint8Array)return(0,o.createSecretKey)(e);if((0,a.isCryptoKey)(e))return(0,c.checkEncCryptoKey)(e,t,r),o.KeyObject.from(e);throw new TypeError((0,l.default)(e,...p.types,"Uint8Array"))}t.wrap=(e,t,r)=>{const a=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!(0,d.default)(a))throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`);const c=h(t,e,"wrapKey");f(c,e);const u=(0,o.createCipheriv)(a,c,n.Buffer.alloc(8,166));return(0,s.concat)(u.update(r),u.final())},t.unwrap=(e,t,r)=>{const a=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!(0,d.default)(a))throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`);const c=h(t,e,"unwrapKey");f(c,e);const u=(0,o.createDecipheriv)(a,c,n.Buffer.alloc(8,166));return(0,s.concat)(u.update(r),u.final())}},2458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e,t,r,o,i){if(void 0!==i.crit&&void 0===o.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;s=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of o.crit){if(!s.has(t))throw new n.JOSENotSupported(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(s.get(t)&&void 0===o[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(o.crit)}},2484:(e,t)=>{"use strict";function r(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function n(e,t){return e.name===t}function o(e){return parseInt(e.name.slice(4),10)}function i(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkEncCryptoKey=t.checkSigCryptoKey=void 0,t.checkSigCryptoKey=function(e,t,...s){switch(t){case"HS256":case"HS384":case"HS512":{if(!n(e.algorithm,"HMAC"))throw r("HMAC");const i=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!n(e.algorithm,"RSASSA-PKCS1-v1_5"))throw r("RSASSA-PKCS1-v1_5");const i=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!n(e.algorithm,"RSA-PSS"))throw r("RSA-PSS");const i=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw r("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!n(e.algorithm,"ECDSA"))throw r("ECDSA");const o=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==o)throw r(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}i(e,s)},t.checkEncCryptoKey=function(e,t,...s){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!n(e.algorithm,"AES-GCM"))throw r("AES-GCM");const o=parseInt(t.slice(1,4),10);if(e.algorithm.length!==o)throw r(o,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!n(e.algorithm,"AES-KW"))throw r("AES-KW");const o=parseInt(t.slice(1,4),10);if(e.algorithm.length!==o)throw r(o,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw r("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!n(e.algorithm,"PBKDF2"))throw r("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!n(e.algorithm,"RSA-OAEP"))throw r("RSA-OAEP");const i=parseInt(t.slice(9),10)||1;if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}i(e,s)}},2525:(e,t,r)=>{"use strict";const n=r(7638),o=r(560);e.exports=(e,t,r)=>{const i=[];let s=null,a=null;const c=e.sort((e,t)=>o(e,t,r));for(const e of c)n(e,t,r)?(a=e,s||(s=e)):(a&&i.push([s,a]),a=null,s=null);s&&i.push([s,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return l.length<d.length?l:t}},2599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateJwkThumbprintUri=t.calculateJwkThumbprint=void 0;const n=r(6332),o=r(82),i=r(6247),s=r(5821),a=r(1855),c=(e,t)=>{if("string"!=typeof e||!e)throw new i.JWKInvalid(`${t} missing or invalid`)};async function u(e,t){if(!(0,a.default)(e))throw new TypeError("JWK must be an object");if(null!=t||(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let r;switch(e.kty){case"EC":c(e.crv,'"crv" (Curve) Parameter'),c(e.x,'"x" (X Coordinate) Parameter'),c(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":c(e.crv,'"crv" (Subtype of Key Pair) Parameter'),c(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":c(e.e,'"e" (Exponent) Parameter'),c(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":c(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new i.JOSENotSupported('"kty" (Key Type) Parameter missing or unsupported')}const u=s.encoder.encode(JSON.stringify(r));return(0,o.encode)(await(0,n.default)(t,u))}t.calculateJwkThumbprint=u,t.calculateJwkThumbprintUri=async function(e,t){null!=t||(t="sha256");const r=await u(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}},2813:e=>{function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="SigningKeyNotFoundError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},2851:(e,t,r)=>{var n=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||n.isBuffer(e)?e.toString():JSON.stringify(e)}},2861:(e,t,r)=>{var n=r(181),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},2912:(e,t,r)=>{const n=r(4263).retrieveSigningKeys;e.exports.A=function(e,{getKeysInterceptor:t}){const r=e.getSigningKey.bind(e);return async e=>{const o=await t();let i;if(o&&o.length&&(i=await n(o)),i&&i.length){const t=i.find(t=>!e||t.kid===e);if(t)return t}return r(e)}}},2938:(e,t,r)=>{"use strict";const n=r(3908);e.exports=(e,t)=>new n(e,t).major},3007:(e,t,r)=>{"use strict";const n=r(3908);e.exports=(e,t,r,o,i)=>{"string"==typeof r&&(i=o,o=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,o,i).version}catch(e){return null}}},3020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;const n=r(6982),o=r(5363),i=r(8993),s=r(2484),a=r(4512),c=r(8737),u=r(740),l=(e,t)=>{if("rsa"!==e.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");(0,o.default)(e,t)},d=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return n.constants.RSA_PKCS1_OAEP_PADDING;case"RSA1_5":return n.constants.RSA_PKCS1_PADDING;default:return}},p=e=>{switch(e){case"RSA-OAEP":return"sha1";case"RSA-OAEP-256":return"sha256";case"RSA-OAEP-384":return"sha384";case"RSA-OAEP-512":return"sha512";default:return}};function f(e,t,...r){if((0,a.default)(e))return e;if((0,i.isCryptoKey)(e))return(0,s.checkEncCryptoKey)(e,t,...r),n.KeyObject.from(e);throw new TypeError((0,c.default)(e,...u.types))}t.encrypt=(e,t,r)=>{const o=d(e),i=p(e),s=f(t,e,"wrapKey","encrypt");return l(s,e),(0,n.publicEncrypt)({key:s,oaepHash:i,padding:o},r)},t.decrypt=(e,t,r)=>{const o=d(e),i=p(e),s=f(t,e,"unwrapKey","decrypt");return l(s,e),(0,n.privateDecrypt)({key:s,oaepHash:i,padding:o},r)}},3022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982);let o;t.default=e=>(o||(o=new Set((0,n.getCiphers)())),o.has(e))},3065:(e,t,r)=>{var n=r(5472),o=r(3085),i=function(e,t,r){this.tokenBucket=new n(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=o(),this.tokensThisInterval=0,this.fireImmediately=r};i.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,n=o();if((n<this.curIntervalStart||n-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=n,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)process.nextTick(t.bind(null,null,-1));else{var i=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-n);setTimeout(function(){r.tokenBucket.removeTokens(e,s)},i)}return!1}return this.tokenBucket.removeTokens(e,s);function s(n,o){if(n)return t(n,null);r.tokensThisInterval+=e,t(null,o)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=o();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var r=this.tokenBucket.tryRemoveTokens(e);return r&&(this.tokensThisInterval+=e),r},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},e.exports=i},3082:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtVerify=void 0;const n=r(1427),o=r(493),i=r(6247);t.jwtVerify=async function(e,t,r){var s;const a=await(0,n.compactVerify)(e,t,r);if((null===(s=a.protectedHeader.crit)||void 0===s?void 0:s.includes("b64"))&&!1===a.protectedHeader.b64)throw new i.JWTInvalid("JWTs MUST NOT use unencoded payload");const c={payload:(0,o.default)(a.protectedHeader,a.payload,r),protectedHeader:a.protectedHeader};return"function"==typeof t?{...c,key:a.key}:c}},3085:e=>{e.exports=function(){if("undefined"!=typeof process&&process.hrtime){var e=process.hrtime(),t=e[0],r=e[1];return 1e3*t+Math.floor(r/1e6)}return(new Date).getTime()}},3106:e=>{"use strict";e.exports=require("zlib")},3110:(e,t,r)=>{const n=r(5753)("jwks"),{retrieveSigningKeys:o}=r(4263),{request:i,cacheSigningKey:s,rateLimitSigningKey:a,getKeysInterceptor:c,callbackSupport:u}=r(3171),l=r(1161),d=r(2813);e.exports={JwksClient:class{constructor(e){this.options={rateLimit:!1,cache:!0,timeout:3e4,...e},this.options.getKeysInterceptor&&(this.getSigningKey=c(this,e)),this.options.rateLimit&&(this.getSigningKey=a(this,e)),this.options.cache&&(this.getSigningKey=s(this,e)),this.getSigningKey=u(this,e)}async getKeys(){n(`Fetching keys from '${this.options.jwksUri}'`);try{const e=await i({uri:this.options.jwksUri,headers:this.options.requestHeaders,agent:this.options.requestAgent,timeout:this.options.timeout,fetcher:this.options.fetcher});return n("Keys:",e.keys),e.keys}catch(e){const{errorMsg:t}=e;throw n("Failure:",t||e),t?new l(t):e}}async getSigningKeys(){const e=await this.getKeys();if(!e||!e.length)throw new l("The JWKS endpoint did not contain any keys");const t=await o(e);if(!t.length)throw new l("The JWKS endpoint did not contain any signing keys");return n("Signing Keys:",t),t}async getSigningKey(e){n(`Fetching signing key for '${e}'`);const t=await this.getSigningKeys(),r=null!=e;if(!r&&t.length>1)throw n("No KID specified and JWKS endpoint returned more than 1 key"),new d("No KID specified and JWKS endpoint returned more than 1 key");const o=t.find(t=>!r||t.kid===e);if(o)return o;throw n(`Unable to find a signing key that matches '${e}'`),new d(`Unable to find a signing key that matches '${e}'`)}}}},3117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(9023),i=r(5945),s=r(7980),a=r(7965),c=r(5206),u=r(1185);let l;l=n.verify.length>4&&u.oneShotCallback?(0,o.promisify)(n.verify):n.verify,t.default=async(e,t,r,o)=>{const u=(0,c.default)(e,t,"verify");if(e.startsWith("HS")){const t=await(0,a.default)(e,u,o),i=r;try{return n.timingSafeEqual(i,t)}catch{return!1}}const d=(0,i.default)(e),p=(0,s.default)(e,u);try{return await l(d,o,p,r)}catch{return!1}}},3171:(e,t,r)=>{e.exports={request:r(3858).A,cacheSigningKey:r(1389).A,rateLimitSigningKey:r(8730).A,getKeysInterceptor:r(2912).A,callbackSupport:r(6545).A}},3254:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e){switch(e){case"HS256":return"sha256";case"HS384":return"sha384";case"HS512":return"sha512";default:throw new n.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},3387:(e,t,r)=>{var n=r(2861).Buffer,o=r(8948),i=r(8789),s=r(2203),a=r(2851),c=r(9023);function u(e,t){return n.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function l(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,o=e.encoding,s=i(t.alg),l=function(e,t,r){r=r||"utf8";var n=u(a(e),"binary"),o=u(a(t),r);return c.format("%s.%s",n,o)}(t,r,o),d=s.sign(l,n);return c.format("%s.%s",l,d)}function d(e){var t=e.secret;if(t=null==(t=null==t?e.privateKey:t)?e.key:t,!0===/^hs/i.test(e.header.alg)&&null==t)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new o(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new o(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}c.inherits(d,s),d.prototype.sign=function(){try{var e=l({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},d.sign=l,e.exports=d},3503:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.syncMemoizer=void 0;var s=i(r(1603)),a=r(4434),c=i(r(7193)),u=r(7644);t.syncMemoizer=function(e){var t=new s.default(e),r=e.load,n=e.hash,i=e.bypass,l=e.itemMaxAge,d=e.freeze,p=e.clone,f=new a.EventEmitter,h=Object.assign({del:function(){var e=n.apply(void 0,o(arguments));t.del(e)},reset:function(){return t.reset()},keys:t.keys.bind(t),on:f.on.bind(f),once:f.once.bind(f)},e);if(e.disable)return Object.assign(r,h);function y(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.emit.apply(f,o([e],t))}function m(e){return e&&e.then&&"function"==typeof e.then}function g(e){var t=e;return p&&(t=m(t)?t.then(c.default):c.default(t)),d&&(m(t)?t=t.then(u.deepFreeze):u.deepFreeze(t)),t}return Object.assign(function(){for(var e=[],s=0;s<arguments.length;s++)e[s]=arguments[s];if(i&&i.apply(void 0,o(e)))return y.apply(void 0,o(["miss"],e)),r.apply(void 0,o(e));var a=n.apply(void 0,o(e)),c=t.get(a);if(c)return y.apply(void 0,o(["hit"],e)),g(c);y.apply(void 0,o(["miss"],e));var u=r.apply(void 0,o(e));return l?t.set(a,u,l.apply(void 0,o(e.concat([u])))):t.set(a,u),g(u)},h)}},3527:e=>{"use strict";function t(e){return(e/8|0)+(e%8==0?0:1)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}},3552:e=>{e.exports=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES256K","ES384","ES512","EdDSA"]},3639:e=>{var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Number]"==t.call(e)}},3726:(e,t,r)=>{var n=r(1741),o=function(e,t){n.call(this,e),this.name="NotBeforeError",this.date=t};(o.prototype=Object.create(n.prototype)).constructor=o,e.exports=o},3780:(e,t,r)=>{e.exports={ArgumentError:r(947),JwksError:r(1161),JwksRateLimitError:r(9950),SigningKeyNotFoundError:r(2813)}},3814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtDecrypt=void 0;const n=r(6923),o=r(493),i=r(6247);t.jwtDecrypt=async function(e,t,r){const s=await(0,n.compactDecrypt)(e,t,r),a=(0,o.default)(s.protectedHeader,s.plaintext,r),{protectedHeader:c}=s;if(void 0!==c.iss&&c.iss!==a.iss)throw new i.JWTClaimValidationFailed('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==c.sub&&c.sub!==a.sub)throw new i.JWTClaimValidationFailed('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==c.aud&&JSON.stringify(c.aud)!==JSON.stringify(a.aud))throw new i.JWTClaimValidationFailed('replicated "aud" claim header parameter mismatch',"aud","mismatch");const u={payload:a,protectedHeader:c};return"function"==typeof t?{...u,key:s.key}:u}},3858:(e,t,r)=>{const n=r(8611),o=r(5692),i=r(7016);e.exports.A=e=>e.fetcher?e.fetcher(e.uri):new Promise((t,r)=>{const{hostname:s,path:a,port:c,protocol:u}=i.parse(e.uri),l={hostname:s,path:a,port:c,method:"GET",...e.headers&&{headers:{...e.headers}},...e.timeout&&{timeout:e.timeout},...e.agent&&{agent:e.agent}},d=("https:"===u?o:n).request(l,e=>{let n="";e.setEncoding("utf8"),e.on("data",e=>{n+=e}),e.on("end",()=>{if(e.statusCode<200||e.statusCode>=300){const t=e.body&&(e.body.message||e.body)||e.statusMessage||`Http Error ${e.statusCode}`;r({errorMsg:t})}else try{t(n&&JSON.parse(n))}catch(e){r(e)}})});d.on("timeout",()=>d.destroy()).on("error",e=>r(e)).end()})},3874:(e,t,r)=>{"use strict";const n=r(8311);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},3904:(e,t,r)=>{"use strict";const n=Symbol("SemVer ANY");class o{static get ANY(){return n}constructor(e,t){if(t=i(t),e instanceof o){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=o;const i=r(8587),{safeRe:s,t:a}=r(9718),c=r(2111),u=r(7272),l=r(3908),d=r(8311)},3908:(e,t,r)=>{"use strict";const n=r(7272),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=r(6874),{safeRe:s,t:a}=r(9718),c=r(8587),{compareIdentifiers:u}=r(1123);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>o)throw new TypeError(`version is longer than ${o} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],o=e.build[t];if(n("build compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?s[a.PRERELEASELOOSE]:s[a.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},3927:(e,t,r)=>{"use strict";const n=r(909);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},3999:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t,r)=>0!==n(e,t,r)},4040:(e,t,r)=>{e.exports={decode:r(7260),verify:r(1691),sign:r(7651),JsonWebTokenError:r(1741),NotBeforeError:r(3726),TokenExpiredError:r(8980)}},4089:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)>=0},4121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateSecret=void 0;const n=r(7975);t.generateSecret=async function(e,t){return(0,n.generateSecret)(e,t)}},4138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(181),o=r(6247),i=n.Buffer.from([0]),s=n.Buffer.from([2]),a=n.Buffer.from([3]),c=n.Buffer.from([48]),u=n.Buffer.from([4]),l=e=>{if(e<128)return n.Buffer.from([e]);const t=n.Buffer.alloc(5);t.writeUInt32BE(e,1);let r=1;for(;0===t[r];)r++;return t[r-1]=128|5-r,t.slice(r-1)},d=new Map([["P-256",n.Buffer.from("06 08 2A 86 48 CE 3D 03 01 07".replace(/ /g,""),"hex")],["secp256k1",n.Buffer.from("06 05 2B 81 04 00 0A".replace(/ /g,""),"hex")],["P-384",n.Buffer.from("06 05 2B 81 04 00 22".replace(/ /g,""),"hex")],["P-521",n.Buffer.from("06 05 2B 81 04 00 23".replace(/ /g,""),"hex")],["ecPublicKey",n.Buffer.from("06 07 2A 86 48 CE 3D 02 01".replace(/ /g,""),"hex")],["X25519",n.Buffer.from("06 03 2B 65 6E".replace(/ /g,""),"hex")],["X448",n.Buffer.from("06 03 2B 65 6F".replace(/ /g,""),"hex")],["Ed25519",n.Buffer.from("06 03 2B 65 70".replace(/ /g,""),"hex")],["Ed448",n.Buffer.from("06 03 2B 65 71".replace(/ /g,""),"hex")]]);t.default=class{constructor(){this.length=0,this.elements=[]}oidFor(e){const t=d.get(e);if(!t)throw new o.JOSENotSupported("Invalid or unsupported OID");this.elements.push(t),this.length+=t.length}zero(){this.elements.push(s,n.Buffer.from([1]),i),this.length+=3}one(){this.elements.push(s,n.Buffer.from([1]),n.Buffer.from([1])),this.length+=3}unsignedInteger(e){if(128&e[0]){const t=l(e.length+1);this.elements.push(s,t,i,e),this.length+=2+t.length+e.length}else{let t=0;for(;0===e[t]&&!(128&e[t+1]);)t++;const r=l(e.length-t);this.elements.push(s,l(e.length-t),e.slice(t)),this.length+=1+r.length+e.length-t}}octStr(e){const t=l(e.length);this.elements.push(u,l(e.length),e),this.length+=1+t.length+e.length}bitStr(e){const t=l(e.length+1);this.elements.push(a,l(e.length+1),i,e),this.length+=1+t.length+e.length+1}add(e){this.elements.push(e),this.length+=e.length}end(e=c){const t=l(this.length);return n.Buffer.concat([e,t,...this.elements],1+t.length+this.length)}}},4166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9754);t.default=n.default},4263:(e,t,r)=>{const n=r(257),o=r(1161);function i(e){if(e.alg)return e.alg;if("RSA"===e.kty)return"RS256";if("EC"===e.kty)switch(e.crv){case"P-256":return"ES256";case"secp256k1":return"ES256K";case"P-384":return"ES384";case"P-521":return"ES512"}if("OKP"===e.kty)switch(e.crv){case"Ed25519":case"Ed448":return"EdDSA"}throw new o("Unsupported JWK")}e.exports={retrieveSigningKeys:async function(e){const t=[];e=e.filter(({use:e})=>"sig"===e||void 0===e).filter(({kty:e})=>"RSA"===e||"EC"===e||"OKP"===e);for(const r of e)try{const e=await n.importJWK({...r,ext:!0},i(r));if("public"!==e.type)continue;let o;switch(e[Symbol.toStringTag]){case"CryptoKey":{const t=await n.exportSPKI(e);o=()=>t;break}default:o=()=>e.export({format:"pem",type:"spki"})}t.push({get publicKey(){return o()},get rsaPublicKey(){return o()},getPublicKey:()=>o(),..."string"==typeof r.kid&&r.kid?{kid:r.kid}:void 0,..."string"==typeof r.alg&&r.alg?{alg:r.alg}:void 0})}catch(e){continue}return t}}},4277:(e,t,r)=>{"use strict";const n=r(909);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},4329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlattenedSign=void 0;const n=r(82),o=r(7965),i=r(9476),s=r(6247),a=r(5821),c=r(1688),u=r(2458);t.FlattenedSign=class{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new s.JWSInvalid("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!(0,i.default)(this._protectedHeader,this._unprotectedHeader))throw new s.JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let l=!0;if((0,u.default)(s.JWSInvalid,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(l=this._protectedHeader.b64,"boolean"!=typeof l))throw new s.JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:d}=r;if("string"!=typeof d||!d)throw new s.JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');(0,c.default)(d,e,"sign");let p,f=this._payload;l&&(f=a.encoder.encode((0,n.encode)(f))),p=this._protectedHeader?a.encoder.encode((0,n.encode)(JSON.stringify(this._protectedHeader))):a.encoder.encode("");const h=(0,a.concat)(p,a.encoder.encode("."),f),y=await(0,o.default)(d,e,h),m={signature:(0,n.encode)(y),payload:""};return l&&(m.payload=a.decoder.decode(f)),this._unprotectedHeader&&(m.header=this._unprotectedHeader),this._protectedHeader&&(m.protected=a.decoder.decode(p)),m}}},4388:(e,t,r)=>{const n=r(257),{ArgumentError:o}=r(3780),{JwksClient:i}=r(3110),s=r(3552),a=(e,t)=>e&&"SigningKeyNotFoundError"===e.name?t(null):e?t(e):void 0;e.exports.passportJwtSecret=function(e){if(null==e)throw new o("An options object must be provided when initializing passportJwtSecret");if(!e.jwksUri)throw new o("No JWKS provided. Please provide a jwksUri");const t=new i(e),r=e.handleSigningKeyError||a;return function(e,o,i){let a;try{a={payload:n.decodeJwt(o),header:n.decodeProtectedHeader(o)}}catch(e){a=null}if(!a||!s.includes(a.header.alg))return i(null,null);t.getSigningKey(a.header.kid).then(e=>{i(null,e.publicKey||e.rsaPublicKey)}).catch(e=>{r(e,e=>i(e,null))})}}},4434:e=>{"use strict";e.exports=require("events")},4443:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeProtectedHeader=void 0;const n=r(8462),o=r(5821),i=r(1855);t.decodeProtectedHeader=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(o.decoder.decode((0,n.decode)(t)));if(!(0,i.default)(e))throw new Error;return e}catch{throw new TypeError("Invalid Token or Protected Header formatting")}}},4493:(e,t,r)=>{"use strict";const n=r(3908);e.exports=(e,t)=>new n(e,t).patch},4512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(9023);t.default=o.types.isKeyObject?e=>o.types.isKeyObject(e):e=>null!=e&&e instanceof n.KeyObject},4533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenedDecrypt=void 0;const n=r(82),o=r(4799),i=r(7609),s=r(6247),a=r(9476),c=r(1855),u=r(4760),l=r(5821),d=r(1784),p=r(2458),f=r(8604);t.flattenedDecrypt=async function(e,t,r){var h;if(!(0,c.default)(e))throw new s.JWEInvalid("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new s.JWEInvalid("JOSE Header missing");if("string"!=typeof e.iv)throw new s.JWEInvalid("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new s.JWEInvalid("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new s.JWEInvalid("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new s.JWEInvalid("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new s.JWEInvalid("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new s.JWEInvalid("JWE AAD incorrect type");if(void 0!==e.header&&!(0,c.default)(e.header))throw new s.JWEInvalid("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!(0,c.default)(e.unprotected))throw new s.JWEInvalid("JWE Per-Recipient Unprotected Header incorrect type");let y;if(e.protected)try{const t=(0,n.decode)(e.protected);y=JSON.parse(l.decoder.decode(t))}catch{throw new s.JWEInvalid("JWE Protected Header is invalid")}if(!(0,a.default)(y,e.header,e.unprotected))throw new s.JWEInvalid("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const m={...y,...e.header,...e.unprotected};if((0,p.default)(s.JWEInvalid,new Map,null==r?void 0:r.crit,y,m),void 0!==m.zip){if(!y||!y.zip)throw new s.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==m.zip)throw new s.JOSENotSupported('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:g,enc:v}=m;if("string"!=typeof g||!g)throw new s.JWEInvalid("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof v||!v)throw new s.JWEInvalid("missing JWE Encryption Algorithm (enc) in JWE Header");const w=r&&(0,f.default)("keyManagementAlgorithms",r.keyManagementAlgorithms),E=r&&(0,f.default)("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(w&&!w.has(g))throw new s.JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter not allowed');if(E&&!E.has(v))throw new s.JOSEAlgNotAllowed('"enc" (Encryption Algorithm) Header Parameter not allowed');let b;if(void 0!==e.encrypted_key)try{b=(0,n.decode)(e.encrypted_key)}catch{throw new s.JWEInvalid("Failed to base64url decode the encrypted_key")}let S,_,A,P=!1;"function"==typeof t&&(t=await t(y,e),P=!0);try{S=await(0,u.default)(g,t,b,m,r)}catch(e){if(e instanceof TypeError||e instanceof s.JWEInvalid||e instanceof s.JOSENotSupported)throw e;S=(0,d.default)(v)}try{_=(0,n.decode)(e.iv)}catch{throw new s.JWEInvalid("Failed to base64url decode the iv")}try{A=(0,n.decode)(e.tag)}catch{throw new s.JWEInvalid("Failed to base64url decode the tag")}const I=l.encoder.encode(null!==(h=e.protected)&&void 0!==h?h:"");let O,k;O=void 0!==e.aad?(0,l.concat)(I,l.encoder.encode("."),l.encoder.encode(e.aad)):I;try{k=(0,n.decode)(e.ciphertext)}catch{throw new s.JWEInvalid("Failed to base64url decode the ciphertext")}let C=await(0,o.default)(v,S,k,_,A,O);"DEF"===m.zip&&(C=await((null==r?void 0:r.inflateRaw)||i.inflate)(C));const T={plaintext:C};if(void 0!==e.protected&&(T.protectedHeader=y),void 0!==e.aad)try{T.additionalAuthenticatedData=(0,n.decode)(e.aad)}catch{throw new s.JWEInvalid("Failed to base64url decode the aad")}return void 0!==e.unprotected&&(T.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(T.unprotectedHeader=e.header),P?{...T,key:t}:T}},4601:(e,t,r)=>{const{JwksClient:n}=r(3110),o=r(3780),{hapiJwt2Key:i,hapiJwt2KeyAsync:s}=r(4698),{expressJwtSecret:a}=r(5064),{koaJwtSecret:c}=r(7897),{passportJwtSecret:u}=r(4388);e.exports=e=>new n(e),e.exports.JwksClient=n,e.exports.ArgumentError=o.ArgumentError,e.exports.JwksError=o.JwksError,e.exports.JwksRateLimitError=o.JwksRateLimitError,e.exports.SigningKeyNotFoundError=o.SigningKeyNotFoundError,e.exports.expressJwtSecret=a,e.exports.hapiJwt2Key=i,e.exports.hapiJwt2KeyAsync=s,e.exports.koaJwtSecret=c,e.exports.passportJwtSecret=u},4623:(e,t,r)=>{const n=r(9589);e.exports=n.satisfies(process.version,">=16.9.0")},4641:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t,r)=>0===n(e,t,r)},4660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(181),o=r(6982),i=r(82),s=r(6247),a=r(8960),c=r(5363),u=r(4138),l=r(1185);t.default=e=>{if(l.jwkImport&&"oct"!==e.kty)return e.d?(0,o.createPrivateKey)({format:"jwk",key:e}):(0,o.createPublicKey)({format:"jwk",key:e});switch(e.kty){case"oct":return(0,o.createSecretKey)((0,i.decode)(e.k));case"RSA":{const t=new u.default,r=void 0!==e.d,i=n.Buffer.from(e.n,"base64"),s=n.Buffer.from(e.e,"base64");r?(t.zero(),t.unsignedInteger(i),t.unsignedInteger(s),t.unsignedInteger(n.Buffer.from(e.d,"base64")),t.unsignedInteger(n.Buffer.from(e.p,"base64")),t.unsignedInteger(n.Buffer.from(e.q,"base64")),t.unsignedInteger(n.Buffer.from(e.dp,"base64")),t.unsignedInteger(n.Buffer.from(e.dq,"base64")),t.unsignedInteger(n.Buffer.from(e.qi,"base64"))):(t.unsignedInteger(i),t.unsignedInteger(s));const a={key:t.end(),format:"der",type:"pkcs1"},l=r?(0,o.createPrivateKey)(a):(0,o.createPublicKey)(a);return(0,c.setModulusLength)(l,i.length<<3),l}case"EC":{const t=new u.default,r=void 0!==e.d,i=n.Buffer.concat([n.Buffer.alloc(1,4),n.Buffer.from(e.x,"base64"),n.Buffer.from(e.y,"base64")]);if(r){t.zero();const r=new u.default;r.oidFor("ecPublicKey"),r.oidFor(e.crv),t.add(r.end());const s=new u.default;s.one(),s.octStr(n.Buffer.from(e.d,"base64"));const c=new u.default;c.bitStr(i);const l=c.end(n.Buffer.from([161]));s.add(l);const d=s.end(),p=new u.default;p.add(d);const f=p.end(n.Buffer.from([4]));t.add(f);const h=t.end(),y=(0,o.createPrivateKey)({key:h,format:"der",type:"pkcs8"});return(0,a.setCurve)(y,e.crv),y}const s=new u.default;s.oidFor("ecPublicKey"),s.oidFor(e.crv),t.add(s.end()),t.bitStr(i);const c=t.end(),l=(0,o.createPublicKey)({key:c,format:"der",type:"spki"});return(0,a.setCurve)(l,e.crv),l}case"OKP":{const t=new u.default;if(void 0!==e.d){t.zero();const r=new u.default;r.oidFor(e.crv),t.add(r.end());const i=new u.default;i.octStr(n.Buffer.from(e.d,"base64"));const s=i.end(n.Buffer.from([4]));t.add(s);const a=t.end();return(0,o.createPrivateKey)({key:a,format:"der",type:"pkcs8"})}const r=new u.default;r.oidFor(e.crv),t.add(r.end()),t.bitStr(n.Buffer.from(e.x,"base64"));const i=t.end();return(0,o.createPublicKey)({key:i,format:"der",type:"spki"})}default:throw new s.JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}}},4698:(e,t,r)=>{const{ArgumentError:n}=r(3780),{JwksClient:o}=r(3110),i=r(3552),s=(e,t)=>e&&"SigningKeyNotFoundError"===e.name||e?t(e,null,null):void 0;e.exports.hapiJwt2KeyAsync=t=>{const r=e.exports.hapiJwt2Key(t);return function(e){return new Promise((t,n)=>{r(e,(e,r)=>{!r||e?n(e):t({key:r})})})}},e.exports.hapiJwt2Key=function(e){if(null==e)throw new n("An options object must be provided when initializing hapiJwt2Key");const t=new o(e),r=e.handleSigningKeyError||s;return function(e,n){return e&&e.header?i.includes(e.header.alg)?void t.getSigningKey(e.header.kid).then(e=>n(null,e.publicKey||e.rsaPublicKey,e)).catch(e=>r(e,e=>n(e,null,null))):n(new Error("Unsupported algorithm "+e.header.alg+" supplied."),null,null):n(new Error("Cannot find a signing certificate if there is no header"),null,null)}}},4760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2395),o=r(6112),i=r(5904),s=r(3020),a=r(82),c=r(6247),u=r(1784),l=r(7364),d=r(1688),p=r(1855),f=r(7031);t.default=async function(e,t,r,h,y){switch((0,d.default)(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new c.JWEInvalid("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new c.JWEInvalid("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!(0,p.default)(h.epk))throw new c.JWEInvalid('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!o.ecdhAllowed(t))throw new c.JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await(0,l.importJWK)(h.epk,e);let s,d;if(void 0!==h.apu){if("string"!=typeof h.apu)throw new c.JWEInvalid('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{s=(0,a.decode)(h.apu)}catch{throw new c.JWEInvalid("Failed to base64url decode the apu")}}if(void 0!==h.apv){if("string"!=typeof h.apv)throw new c.JWEInvalid('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{d=(0,a.decode)(h.apv)}catch{throw new c.JWEInvalid("Failed to base64url decode the apv")}}const f=await o.deriveKey(i,t,"ECDH-ES"===e?h.enc:e,"ECDH-ES"===e?(0,u.bitLength)(h.enc):parseInt(e.slice(-5,-2),10),s,d);if("ECDH-ES"===e)return f;if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");return(0,n.unwrap)(e.slice(-6),f,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");return(0,s.decrypt)(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");if("number"!=typeof h.p2c)throw new c.JWEInvalid('JOSE Header "p2c" (PBES2 Count) missing or invalid');const n=(null==y?void 0:y.maxPBES2Count)||1e4;if(h.p2c>n)throw new c.JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof h.p2s)throw new c.JWEInvalid('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let o;try{o=(0,a.decode)(h.p2s)}catch{throw new c.JWEInvalid("Failed to base64url decode the p2s")}return(0,i.decrypt)(e,t,r,h.p2c,o)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");return(0,n.unwrap)(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");if("string"!=typeof h.iv)throw new c.JWEInvalid('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof h.tag)throw new c.JWEInvalid('JOSE Header "tag" (Authentication Tag) missing or invalid');let n,o;try{n=(0,a.decode)(h.iv)}catch{throw new c.JWEInvalid("Failed to base64url decode the iv")}try{o=(0,a.decode)(h.tag)}catch{throw new c.JWEInvalid("Failed to base64url decode the tag")}return(0,f.unwrap)(e,t,r,n,o)}default:throw new c.JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}}},4799:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(1146),i=r(2319),s=r(5821),a=r(6247),c=r(2167),u=r(4803),l=r(8993),d=r(2484),p=r(4512),f=r(8737),h=r(3022),y=r(740);t.default=(e,t,r,m,g,v)=>{let w;if((0,l.isCryptoKey)(t))(0,d.checkEncCryptoKey)(t,e,"decrypt"),w=n.KeyObject.from(t);else{if(!(t instanceof Uint8Array||(0,p.default)(t)))throw new TypeError((0,f.default)(t,...y.types,"Uint8Array"));w=t}switch((0,i.default)(e,w),(0,o.default)(e,m),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return function(e,t,r,o,i,l){const d=parseInt(e.slice(1,4),10);(0,p.default)(t)&&(t=t.export());const f=t.subarray(d>>3),y=t.subarray(0,d>>3),m=parseInt(e.slice(-3),10),g=`aes-${d}-cbc`;if(!(0,h.default)(g))throw new a.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);const v=(0,u.default)(l,o,r,m,y,d);let w,E;try{w=(0,c.default)(i,v)}catch{}if(!w)throw new a.JWEDecryptionFailed;try{const e=(0,n.createDecipheriv)(g,f,o);E=(0,s.concat)(e.update(r),e.final())}catch{}if(!E)throw new a.JWEDecryptionFailed;return E}(e,w,r,m,g,v);case"A128GCM":case"A192GCM":case"A256GCM":return function(e,t,r,o,i,s){const c=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!(0,h.default)(c))throw new a.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);try{const e=(0,n.createDecipheriv)(c,t,o,{authTagLength:16});e.setAuthTag(i),s.byteLength&&e.setAAD(s,{plaintextLength:r.length});const a=e.update(r);return e.final(),a}catch{throw new a.JWEDecryptionFailed}}(e,w,r,m,g,v);default:throw new a.JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}}},4803:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(5821);t.default=function(e,t,r,i,s,a){const c=(0,o.concat)(e,t,r,(0,o.uint64be)(e.length<<3)),u=(0,n.createHmac)(`sha${i}`,s);return u.update(c),u.digest().slice(0,a>>3)}},4977:(e,t,r)=>{var n=r(9589);e.exports=n.satisfies(process.version,"^6.12.0 || >=8.0.0")},5032:(e,t,r)=>{"use strict";const n=r(8311),o=r(3904),{ANY:i}=o,s=r(7638),a=r(560),c=[new o(">=0.0.0-0")],u=[new o(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?c:u}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=u}const n=new Set;let o,l,f,h,y,m,g;for(const t of e)">"===t.operator||">="===t.operator?o=d(o,t,r):"<"===t.operator||"<="===t.operator?l=p(l,t,r):n.add(t.semver);if(n.size>1)return null;if(o&&l){if(f=a(o.semver,l.semver,r),f>0)return null;if(0===f&&(">="!==o.operator||"<="!==l.operator))return null}for(const e of n){if(o&&!s(e,String(o),r))return null;if(l&&!s(e,String(l),r))return null;for(const n of t)if(!s(e,String(n),r))return!1;return!0}let v=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,w=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver;v&&1===v.prerelease.length&&"<"===l.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,o)if(w&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===w.major&&e.semver.minor===w.minor&&e.semver.patch===w.patch&&(w=!1),">"===e.operator||">="===e.operator){if(h=d(o,e,r),h===e&&h!==o)return!1}else if(">="===o.operator&&!s(o.semver,String(e),r))return!1;if(l)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(y=p(l,e,r),y===e&&y!==l)return!1}else if("<="===l.operator&&!s(l.semver,String(e),r))return!1;if(!e.operator&&(l||o)&&0!==f)return!1}return!(o&&m&&!l&&0!==f||l&&g&&!o&&0!==f||w||v)},d=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let o=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},5064:(e,t,r)=>{const{ArgumentError:n}=r(3780),{JwksClient:o}=r(3110),i=r(3552),s=(e,t)=>e&&"SigningKeyNotFoundError"===e.name?t(null):e?t(e):void 0;e.exports.expressJwtSecret=function(e){if(null==e)throw new n("An options object must be provided when initializing expressJwtSecret");const t=new o(e),r=e.handleSigningKeyError||s,a=async(e,n)=>{if(!n)return;const o=n.header;if(o&&i.includes(o.alg))try{const e=await t.getSigningKey(o.kid);return e.publicKey||e.rsaPublicKey}catch(e){return new Promise((t,n)=>{r(e,e=>{if(!e)return t();n(e)})})}};return function(e,t,r,n){if(4!==arguments.length)return a(0,arguments[1]);a(0,{header:t}).then(e=>{setImmediate(n,null,e)}).catch(e=>{setImmediate(n,e)})}}},5200:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)<=0},5206:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(8993),i=r(2484),s=r(8737),a=r(740);t.default=function(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError((0,s.default)(t,...a.types));return(0,n.createSecretKey)(t)}if(t instanceof n.KeyObject)return t;if((0,o.isCryptoKey)(t))return(0,i.checkSigCryptoKey)(t,e,r),n.KeyObject.from(t);throw new TypeError((0,s.default)(t,...a.types,"Uint8Array"))}},5342:(e,t,r)=>{"use strict";const n=r(7075);e.exports=(e,t,r)=>n(e,t,"<",r)},5363:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModulusLength=t.weakMap=void 0,t.weakMap=new WeakMap;const r=(e,t)=>{let n=e.readUInt8(1);if(!(128&n))return 0===t?n:r(e.subarray(2+n),t-1);const o=127&n;n=0;for(let t=0;t<o;t++)n<<=8,n|=e.readUInt8(2+t);return 0===t?n:r(e.subarray(2+n),t-1)};t.setModulusLength=(e,r)=>{t.weakMap.set(e,r)},t.default=(e,n)=>{if((e=>{var n,o;if(t.weakMap.has(e))return t.weakMap.get(e);const i=null!==(o=null===(n=e.asymmetricKeyDetails)||void 0===n?void 0:n.modulusLength)&&void 0!==o?o:((e,t)=>{const n=e.readUInt8(1);if(!(128&n))return r(e.subarray(2),t);const o=127&n;return r(e.subarray(2+o),t)})(e.export({format:"der",type:"pkcs1"}),"private"===e.type?1:0)-1<<3;return t.weakMap.set(e,i),i})(e)<2048)throw new TypeError(`${n} requires key modulusLength to be 2048 bits or larger`)}},5472:e=>{var t=function(e,t,r,n){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof r)switch(r){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+r)}else this.interval=r;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};t.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,t){var r=this;return this.bucketSize?e>this.bucketSize?(process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),e>this.content?n():this.parentBucket?this.parentBucket.removeTokens(e,function(o,i){return o?t(o,null):e>r.content?n():(r.content-=e,void t(null,Math.min(i,r.content)))}):(this.content-=e,process.nextTick(t.bind(null,null,this.content)),!0)):(process.nextTick(t.bind(null,null,e,Number.POSITIVE_INFINITY)),!0);function n(){var n=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout(function(){r.removeTokens(e,t)},n),!1}},tryRemoveTokens:function(e){return!(this.bucketSize&&(e>this.bucketSize||(this.drip(),e>this.content||this.parentBucket&&!this.parentBucket.tryRemoveTokens(e)||(this.content-=e,0))))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var r=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+r,this.bucketSize)}else this.content=this.bucketSize}},e.exports=t},5571:(e,t,r)=>{"use strict";const n=r(7075);e.exports=(e,t,r)=>n(e,t,">",r)},5580:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)>0},5692:e=>{"use strict";e.exports=require("https")},5747:(e,t,r)=>{var n=r(3387),o=r(7599);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=n.sign,t.verify=o.verify,t.decode=o.decode,t.isValid=o.isValid,t.createSign=function(e){return new n(e)},t.createVerify=function(e){return new o(e)}},5753:(e,t,r)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=r(7833):e.exports=r(6033)},5821:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatKdf=t.lengthAndInput=t.uint32be=t.uint64be=t.p2s=t.concat=t.decoder=t.encoder=void 0;const n=r(6332);t.encoder=new TextEncoder,t.decoder=new TextDecoder;const o=2**32;function i(...e){const t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t);let n=0;return e.forEach(e=>{r.set(e,n),n+=e.length}),r}function s(e,t,r){if(t<0||t>=o)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function a(e){const t=new Uint8Array(4);return s(t,e),t}t.concat=i,t.p2s=function(e,r){return i(t.encoder.encode(e),new Uint8Array([0]),r)},t.uint64be=function(e){const t=Math.floor(e/o),r=e%o,n=new Uint8Array(8);return s(n,t,0),s(n,r,4),n},t.uint32be=a,t.lengthAndInput=function(e){return i(a(e.length),e)},t.concatKdf=async function(e,t,r){const o=Math.ceil((t>>3)/32),i=new Uint8Array(32*o);for(let t=0;t<o;t++){const o=new Uint8Array(4+e.length+r.length);o.set(a(t+1)),o.set(e,4),o.set(r,4+e.length),i.set(await(0,n.default)("sha256",o),32*t)}return i.slice(0,t>>3)}},5884:e=>{"use strict";e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)}},5904:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;const n=r(9023),o=r(6982),i=r(927),s=r(5821),a=r(82),c=r(2395),u=r(8405),l=r(8993),d=r(2484),p=r(4512),f=r(8737),h=r(740),y=(0,n.promisify)(o.pbkdf2);function m(e,t){if((0,p.default)(e))return e.export();if(e instanceof Uint8Array)return e;if((0,l.isCryptoKey)(e))return(0,d.checkEncCryptoKey)(e,t,"deriveBits","deriveKey"),o.KeyObject.from(e).export();throw new TypeError((0,f.default)(e,...h.types,"Uint8Array"))}t.encrypt=async(e,t,r,n=2048,o=(0,i.default)(new Uint8Array(16)))=>{(0,u.default)(o);const l=(0,s.p2s)(e,o),d=parseInt(e.slice(13,16),10)>>3,p=m(t,e),f=await y(p,l,n,d,`sha${e.slice(8,11)}`);return{encryptedKey:await(0,c.wrap)(e.slice(-6),f,r),p2c:n,p2s:(0,a.encode)(o)}},t.decrypt=async(e,t,r,n,o)=>{(0,u.default)(o);const i=(0,s.p2s)(e,o),a=parseInt(e.slice(13,16),10)>>3,l=m(t,e),d=await y(l,i,n,a,`sha${e.slice(8,11)}`);return(0,c.unwrap)(e.slice(-6),d,r)}},5931:e=>{var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){return"string"==typeof e||!r(e)&&function(e){return!!e&&"object"==typeof e}(e)&&"[object String]"==t.call(e)}},5945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e){switch(e){case"PS256":case"RS256":case"ES256":case"ES256K":return"sha256";case"PS384":case"RS384":case"ES384":return"sha384";case"PS512":case"RS512":case"ES512":return"sha512";case"EdDSA":return;default:throw new n.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},6033:(e,t,r)=>{const n=r(2018),o=r(9023);t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(o.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${n} [0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=o.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=r(7687);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=r(736)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},6111:e=>{var t=1/0,r=9007199254740991,n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=/^(?:0|[1-9]\d*)$/,c=parseInt;function u(e){return e!=e}var l,d,p=Object.prototype,f=p.hasOwnProperty,h=p.toString,y=p.propertyIsEnumerable,m=(l=Object.keys,d=Object,function(e){return l(d(e))}),g=Math.max;function v(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||a.test(e))&&e>-1&&e%1==0&&e<t}var w=Array.isArray;function E(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!function(e){var t=b(e)?h.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function S(e){return!!e&&"object"==typeof e}e.exports=function(e,r,a,l){var d;e=E(e)?e:(d=e)?function(e,t){return function(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r<n;)o[r]=t(e[r]);return o}(t,function(t){return e[t]})}(d,function(e){return E(e)?function(e,t){var r=w(e)||function(e){return function(e){return S(e)&&E(e)}(e)&&f.call(e,"callee")&&(!y.call(e,"callee")||"[object Arguments]"==h.call(e))}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var i in e)!t&&!f.call(e,i)||o&&("length"==i||v(i,n))||r.push(i);return r}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return m(e);var t,r,n=[];for(var o in Object(e))f.call(e,o)&&"constructor"!=o&&n.push(o);return n}(e)}(d)):[],a=a&&!l?function(e){var r=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||S(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=i.test(e);return r||s.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),a=r%1;return r==r?a?r-a:r:0}(a):0;var _=e.length;return a<0&&(a=g(_+a,0)),function(e){return"string"==typeof e||!w(e)&&S(e)&&"[object String]"==h.call(e)}(e)?a<=_&&e.indexOf(r,a)>-1:!!_&&function(e,t,r){if(t!=t)return function(e,t,r){for(var n=e.length,o=r+-1;++o<n;)if(t(e[o],o,e))return o;return-1}(e,u,r);for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}(e,r,a)>-1}},6112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecdhAllowed=t.generateEpk=t.deriveKey=void 0;const n=r(6982),o=r(9023),i=r(8960),s=r(5821),a=r(6247),c=r(8993),u=r(2484),l=r(4512),d=r(8737),p=r(740),f=(0,o.promisify)(n.generateKeyPair);t.deriveKey=async function(e,t,r,o,i=new Uint8Array(0),a=new Uint8Array(0)){let f,h;if((0,c.isCryptoKey)(e))(0,u.checkEncCryptoKey)(e,"ECDH"),f=n.KeyObject.from(e);else{if(!(0,l.default)(e))throw new TypeError((0,d.default)(e,...p.types));f=e}if((0,c.isCryptoKey)(t))(0,u.checkEncCryptoKey)(t,"ECDH","deriveBits"),h=n.KeyObject.from(t);else{if(!(0,l.default)(t))throw new TypeError((0,d.default)(t,...p.types));h=t}const y=(0,s.concat)((0,s.lengthAndInput)(s.encoder.encode(r)),(0,s.lengthAndInput)(i),(0,s.lengthAndInput)(a),(0,s.uint32be)(o)),m=(0,n.diffieHellman)({privateKey:h,publicKey:f});return(0,s.concatKdf)(m,o,y)},t.generateEpk=async function(e){let t;if((0,c.isCryptoKey)(e))t=n.KeyObject.from(e);else{if(!(0,l.default)(e))throw new TypeError((0,d.default)(e,...p.types));t=e}switch(t.asymmetricKeyType){case"x25519":return f("x25519");case"x448":return f("x448");case"ec":{const e=(0,i.default)(t);return f("ec",{namedCurve:e})}default:throw new a.JOSENotSupported("Invalid or unsupported EPK")}},t.ecdhAllowed=e=>["P-256","P-384","P-521","X25519","X448"].includes((0,i.default)(e))},6170:(e,t,r)=>{"use strict";const n=r(3908),o=r(144),{safeRe:i,t:s}=r(9718);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];let o;for(;(o=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",u=r[4]||"0",l=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return o(`${a}.${c}.${u}${l}${d}`,t)}},6247:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JWSSignatureVerificationFailed=t.JWKSTimeout=t.JWKSMultipleMatchingKeys=t.JWKSNoMatchingKey=t.JWKSInvalid=t.JWKInvalid=t.JWTInvalid=t.JWSInvalid=t.JWEInvalid=t.JWEDecompressionFailed=t.JWEDecryptionFailed=t.JOSENotSupported=t.JOSEAlgNotAllowed=t.JWTExpired=t.JWTClaimValidationFailed=t.JOSEError=void 0;class r extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}t.JOSEError=r,t.JWTClaimValidationFailed=class extends r{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}},t.JWTExpired=class extends r{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}},t.JOSEAlgNotAllowed=class extends r{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}},t.JOSENotSupported=class extends r{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}},t.JWEDecryptionFailed=class extends r{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}},t.JWEDecompressionFailed=class extends r{constructor(){super(...arguments),this.code="ERR_JWE_DECOMPRESSION_FAILED",this.message="decompression operation failed"}static get code(){return"ERR_JWE_DECOMPRESSION_FAILED"}},t.JWEInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}},t.JWSInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}},t.JWTInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}},t.JWKInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}},t.JWKSInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}},t.JWKSNoMatchingKey=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}},t.JWKSMultipleMatchingKeys=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}},Symbol.asyncIterator,t.JWKSTimeout=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}},t.JWSSignatureVerificationFailed=class extends r{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}},6254:(e,t,r)=>{"use strict";const n=r(3908);e.exports=(e,t)=>new n(e,t).minor},6332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982);t.default=(e,t)=>(0,n.createHash)(e).update(t).digest()},6545:(e,t,r)=>{const{callbackify:n}=r(9023);e.exports.A=e=>{const t=e.getSigningKey.bind(e);return(e,r)=>r?n(t)(e,r):t(e)}},6585:e=>{var t=1e3,r=60*t,n=60*r,o=24*n,i=7*o;function s(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,a){a=a||{};var c,u,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===l&&isFinite(e))return a.long?(c=e,(u=Math.abs(c))>=o?s(c,u,o,"day"):u>=n?s(c,u,n,"hour"):u>=r?s(c,u,r,"minute"):u>=t?s(c,u,t,"second"):c+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=n?Math.round(e/n)+"h":i>=r?Math.round(e/r)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptJWT=void 0;const n=r(7815),o=r(5821),i=r(751);class s extends i.ProduceJWT{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){const r=new n.CompactEncrypt(o.encoder.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}}t.EncryptJWT=s},6780:(e,t,r)=>{"use strict";const n=r(8311);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},6833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenedVerify=void 0;const n=r(82),o=r(3117),i=r(6247),s=r(5821),a=r(9476),c=r(1855),u=r(1688),l=r(2458),d=r(8604);t.flattenedVerify=async function(e,t,r){var p;if(!(0,c.default)(e))throw new i.JWSInvalid("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new i.JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new i.JWSInvalid("JWS Protected Header incorrect type");if(void 0===e.payload)throw new i.JWSInvalid("JWS Payload missing");if("string"!=typeof e.signature)throw new i.JWSInvalid("JWS Signature missing or incorrect type");if(void 0!==e.header&&!(0,c.default)(e.header))throw new i.JWSInvalid("JWS Unprotected Header incorrect type");let f={};if(e.protected)try{const t=(0,n.decode)(e.protected);f=JSON.parse(s.decoder.decode(t))}catch{throw new i.JWSInvalid("JWS Protected Header is invalid")}if(!(0,a.default)(f,e.header))throw new i.JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const h={...f,...e.header};let y=!0;if((0,l.default)(i.JWSInvalid,new Map([["b64",!0]]),null==r?void 0:r.crit,f,h).has("b64")&&(y=f.b64,"boolean"!=typeof y))throw new i.JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:m}=h;if("string"!=typeof m||!m)throw new i.JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');const g=r&&(0,d.default)("algorithms",r.algorithms);if(g&&!g.has(m))throw new i.JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter not allowed');if(y){if("string"!=typeof e.payload)throw new i.JWSInvalid("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new i.JWSInvalid("JWS Payload must be a string or an Uint8Array instance");let v=!1;"function"==typeof t&&(t=await t(f,e),v=!0),(0,u.default)(m,t,"verify");const w=(0,s.concat)(s.encoder.encode(null!==(p=e.protected)&&void 0!==p?p:""),s.encoder.encode("."),"string"==typeof e.payload?s.encoder.encode(e.payload):e.payload);let E,b;try{E=(0,n.decode)(e.signature)}catch{throw new i.JWSInvalid("Failed to base64url decode the signature")}if(!await(0,o.default)(m,t,E,w))throw new i.JWSSignatureVerificationFailed;if(y)try{b=(0,n.decode)(e.payload)}catch{throw new i.JWSInvalid("Failed to base64url decode the payload")}else b="string"==typeof e.payload?s.encoder.encode(e.payload):e.payload;const S={payload:b};return void 0!==e.protected&&(S.protectedHeader=f),void 0!==e.header&&(S.unprotectedHeader=e.header),v?{...S,key:t}:S}},6874:e=>{"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},6923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactDecrypt=void 0;const n=r(4533),o=r(6247),i=r(5821);t.compactDecrypt=async function(e,t,r){if(e instanceof Uint8Array&&(e=i.decoder.decode(e)),"string"!=typeof e)throw new o.JWEInvalid("Compact JWE must be a string or Uint8Array");const{0:s,1:a,2:c,3:u,4:l,length:d}=e.split(".");if(5!==d)throw new o.JWEInvalid("Invalid Compact JWE");const p=await(0,n.flattenedDecrypt)({ciphertext:u,iv:c||void 0,protected:s||void 0,tag:l||void 0,encrypted_key:a||void 0},t,r),f={plaintext:p.plaintext,protectedHeader:p.protectedHeader};return"function"==typeof t?{...f,key:p.key}:f}},6953:(e,t,r)=>{"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},6980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLocalJWKSet=t.LocalJWKSet=t.isJWKSLike=void 0;const n=r(7364),o=r(6247),i=r(1855);function s(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(a)}function a(e){return(0,i.default)(e)}t.isJWKSLike=s;class c{constructor(e){if(this._cached=new WeakMap,!s(e))throw new o.JWKSInvalid("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0:t.header},i=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new o.JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set')}}(r),s=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t}),{0:a,length:c}=s;if(0===c)throw new o.JWKSNoMatchingKey;if(1!==c){const e=new o.JWKSMultipleMatchingKeys,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of s)try{yield await u(t,e,r)}catch{continue}},e}return u(this._cached,a,r)}}async function u(e,t,r){const i=e.get(t)||e.set(t,{}).get(t);if(void 0===i[r]){const e=await(0,n.importJWK)({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new o.JWKSInvalid("JSON Web Key Set members must be public keys");i[r]=e}return i[r]}t.LocalJWKSet=c,t.createLocalJWKSet=function(e){const t=new c(e);return async function(e,r){return t.getKey(e,r)}}},6982:e=>{"use strict";e.exports=require("crypto")},7016:e=>{"use strict";e.exports=require("url")},7019:(e,t,r)=>{const n=r(1977),o=r(4623),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;const r=t.asymmetricKeyType;if(!r)return;const a=i[r];if(!a)throw new Error(`Unknown key type "${r}".`);if(!a.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${a.join(", ")}.`);if(n)switch(r){case"ec":const r=t.asymmetricKeyDetails.namedCurve,n=s[e];if(r!==n)throw new Error(`"alg" parameter "${e}" requires curve "${n}".`);break;case"rsa-pss":if(o){const r=parseInt(e.slice(-3),10),{hashAlgorithm:n,mgf1HashAlgorithm:o,saltLength:i}=t.asymmetricKeyDetails;if(n!==`sha${r}`||o!==n)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},7031:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=t.wrap=void 0;const n=r(2027),o=r(4799),i=r(7974),s=r(82);t.wrap=async function(e,t,r,o){const a=e.slice(0,7);o||(o=(0,i.default)(a));const{ciphertext:c,tag:u}=await(0,n.default)(a,r,t,o,new Uint8Array(0));return{encryptedKey:c,iv:(0,s.encode)(o),tag:(0,s.encode)(u)}},t.unwrap=async function(e,t,r,n,i){const s=e.slice(0,7);return(0,o.default)(s,t,r,n,i,new Uint8Array(0))}},7059:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)<0},7075:(e,t,r)=>{"use strict";const n=r(3908),o=r(3904),{ANY:i}=o,s=r(8311),a=r(7638),c=r(5580),u=r(7059),l=r(5200),d=r(4089);e.exports=(e,t,r,p)=>{let f,h,y,m,g;switch(e=new n(e,p),t=new s(t,p),r){case">":f=c,h=l,y=u,m=">",g=">=";break;case"<":f=u,h=d,y=c,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let s=null,a=null;if(n.forEach(e=>{e.semver===i&&(e=new o(">=0.0.0")),s=s||e,a=a||e,f(e.semver,s.semver,p)?s=e:y(e.semver,a.semver,p)&&(a=e)}),s.operator===m||s.operator===g)return!1;if((!a.operator||a.operator===m)&&h(e,a.semver))return!1;if(a.operator===g&&y(e,a.semver))return!1}return!0}},7083:e=>{var t=1/0,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,a=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){return function(e,u){var l;if("function"!=typeof u)throw new TypeError("Expected a function");return e=function(e){var u=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==a.call(e)}(e))return NaN;if(c(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=c(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var u=o.test(e);return u||i.test(e)?s(e.slice(2),u?2:8):n.test(e)?NaN:+e}(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),l=u%1;return u==u?l?u-l:u:0}(e),function(){return--e>0&&(l=u.apply(this,arguments)),e<=1&&(u=void 0),l}}(2,e)}},7193:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",l="[object Map]",d="[object Number]",p="[object Object]",f="[object Promise]",h="[object RegExp]",y="[object Set]",m="[object String]",g="[object Symbol]",v="[object WeakMap]",w="[object ArrayBuffer]",E="[object DataView]",b="[object Float32Array]",S="[object Float64Array]",_="[object Int8Array]",A="[object Int16Array]",P="[object Int32Array]",I="[object Uint8Array]",O="[object Uint8ClampedArray]",k="[object Uint16Array]",C="[object Uint32Array]",T=/\w*$/,J=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,K={};K[i]=K["[object Array]"]=K[w]=K[E]=K[s]=K[a]=K[b]=K[S]=K[_]=K[A]=K[P]=K[l]=K[d]=K[p]=K[h]=K[y]=K[m]=K[g]=K[I]=K[O]=K[k]=K[C]=!0,K["[object Error]"]=K[c]=K[v]=!1;var R="object"==typeof global&&global&&global.Object===Object&&global,j="object"==typeof self&&self&&self.Object===Object&&self,W=R||j||Function("return this")(),$=t&&!t.nodeType&&t,H=$&&e&&!e.nodeType&&e,N=H&&H.exports===$;function M(e,t){return e.set(t[0],t[1]),e}function L(e,t){return e.add(t),e}function D(e,t,r,n){var o=-1,i=e?e.length:0;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}function F(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function U(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function B(e,t){return function(r){return e(t(r))}}function G(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var V,z=Array.prototype,q=Function.prototype,X=Object.prototype,Y=W["__core-js_shared__"],Z=(V=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Q=q.toString,ee=X.hasOwnProperty,te=X.toString,re=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=N?W.Buffer:void 0,oe=W.Symbol,ie=W.Uint8Array,se=B(Object.getPrototypeOf,Object),ae=Object.create,ce=X.propertyIsEnumerable,ue=z.splice,le=Object.getOwnPropertySymbols,de=ne?ne.isBuffer:void 0,pe=B(Object.keys,Object),fe=We(W,"DataView"),he=We(W,"Map"),ye=We(W,"Promise"),me=We(W,"Set"),ge=We(W,"WeakMap"),ve=We(Object,"create"),we=Le(fe),Ee=Le(he),be=Le(ye),Se=Le(me),_e=Le(ge),Ae=oe?oe.prototype:void 0,Pe=Ae?Ae.valueOf:void 0;function Ie(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Oe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ke(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ce(e){this.__data__=new Oe(e)}function Te(e,t,r){var n=e[t];ee.call(e,t)&&De(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function Je(e,t){for(var r=e.length;r--;)if(De(e[r][0],t))return r;return-1}function xe(e,t,r,n,o,f,v){var J;if(n&&(J=f?n(e,o,f,v):n(e)),void 0!==J)return J;if(!Ve(e))return e;var x=Fe(e);if(x){if(J=function(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!t)return function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(e,J)}else{var R=He(e),j=R==c||R==u;if(Be(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(R==p||R==i||j&&!f){if(F(e))return f?e:{};if(J=function(e){return"function"!=typeof e.constructor||Me(e)?{}:Ve(t=se(e))?ae(t):{};var t}(j?{}:e),!t)return function(e,t){return Re(e,$e(e),t)}(e,function(e,t){return e&&Re(t,ze(t),e)}(J,e))}else{if(!K[R])return f?e:{};J=function(e,t,r,n){var o,i=e.constructor;switch(t){case w:return Ke(e);case s:case a:return new i(+e);case E:return function(e,t){var r=t?Ke(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case b:case S:case _:case A:case P:case I:case O:case k:case C:return function(e,t){var r=t?Ke(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case l:return function(e,t,r){return D(t?r(U(e),!0):U(e),M,new e.constructor)}(e,n,r);case d:case m:return new i(e);case h:return function(e){var t=new e.constructor(e.source,T.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return function(e,t,r){return D(t?r(G(e),!0):G(e),L,new e.constructor)}(e,n,r);case g:return o=e,Pe?Object(Pe.call(o)):{}}}(e,R,xe,t)}}v||(v=new Ce);var W=v.get(e);if(W)return W;if(v.set(e,J),!x)var $=r?function(e){return function(e,t,r){var n=t(e);return Fe(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,ze,$e)}(e):ze(e);return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r););}($||e,function(o,i){$&&(o=e[i=o]),Te(J,i,xe(o,t,r,n,i,e,v))}),J}function Ke(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Re(e,t,r,n){r||(r={});for(var o=-1,i=t.length;++o<i;){var s=t[o],a=n?n(r[s],e[s],s,r,e):void 0;Te(r,s,void 0===a?e[s]:a)}return r}function je(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function We(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ve(e)||(t=e,Z&&Z in t))&&(Ge(e)||F(e)?re:J).test(Le(e));var t}(r)?r:void 0}Ie.prototype.clear=function(){this.__data__=ve?ve(null):{}},Ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ie.prototype.get=function(e){var t=this.__data__;if(ve){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ie.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:ee.call(t,e)},Ie.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?n:t,this},Oe.prototype.clear=function(){this.__data__=[]},Oe.prototype.delete=function(e){var t=this.__data__,r=Je(t,e);return!(r<0||(r==t.length-1?t.pop():ue.call(t,r,1),0))},Oe.prototype.get=function(e){var t=this.__data__,r=Je(t,e);return r<0?void 0:t[r][1]},Oe.prototype.has=function(e){return Je(this.__data__,e)>-1},Oe.prototype.set=function(e,t){var r=this.__data__,n=Je(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ke.prototype.clear=function(){this.__data__={hash:new Ie,map:new(he||Oe),string:new Ie}},ke.prototype.delete=function(e){return je(this,e).delete(e)},ke.prototype.get=function(e){return je(this,e).get(e)},ke.prototype.has=function(e){return je(this,e).has(e)},ke.prototype.set=function(e,t){return je(this,e).set(e,t),this},Ce.prototype.clear=function(){this.__data__=new Oe},Ce.prototype.delete=function(e){return this.__data__.delete(e)},Ce.prototype.get=function(e){return this.__data__.get(e)},Ce.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Oe){var n=r.__data__;if(!he||n.length<199)return n.push([e,t]),this;r=this.__data__=new ke(n)}return r.set(e,t),this};var $e=le?B(le,Object):function(){return[]},He=function(e){return te.call(e)};function Ne(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||x.test(e))&&e>-1&&e%1==0&&e<t}function Me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function Le(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function De(e,t){return e===t||e!=e&&t!=t}(fe&&He(new fe(new ArrayBuffer(1)))!=E||he&&He(new he)!=l||ye&&He(ye.resolve())!=f||me&&He(new me)!=y||ge&&He(new ge)!=v)&&(He=function(e){var t=te.call(e),r=t==p?e.constructor:void 0,n=r?Le(r):void 0;if(n)switch(n){case we:return E;case Ee:return l;case be:return f;case Se:return y;case _e:return v}return t});var Fe=Array.isArray;function Ue(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Ge(e)}var Be=de||function(){return!1};function Ge(e){var t=Ve(e)?te.call(e):"";return t==c||t==u}function Ve(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ze(e){return Ue(e)?function(e,t){var r=Fe(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ue(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==i)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var s in e)!t&&!ee.call(e,s)||o&&("length"==s||Ne(s,n))||r.push(s);return r}(e):function(e){if(!Me(e))return pe(e);var t=[];for(var r in Object(e))ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return xe(e,!0,!0)}},7260:(e,t,r)=>{var n=r(5747);e.exports=function(e,t){t=t||{};var r=n.decode(e,t);if(!r)return null;var o=r.payload;if("string"==typeof o)try{var i=JSON.parse(o);null!==i&&"object"==typeof i&&(o=i)}catch(e){}return!0===t.complete?{header:r.header,payload:o,signature:r.signature}:o}},7272:e=>{"use strict";const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},7364:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.importJWK=t.importPKCS8=t.importX509=t.importSPKI=void 0;const n=r(82),o=r(293),i=r(4660),s=r(6247),a=r(1855);t.importSPKI=async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return(0,o.fromSPKI)(e,t,r)},t.importX509=async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return(0,o.fromX509)(e,t,r)},t.importPKCS8=async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return(0,o.fromPKCS8)(e,t,r)},t.importJWK=async function(e,t,r){var o;if(!(0,a.default)(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?(0,i.default)({...e,alg:t,ext:null!==(o=e.ext)&&void 0!==o&&o}):(0,n.decode)(e.k);case"RSA":if(void 0!==e.oth)throw new s.JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return(0,i.default)({...e,alg:t});default:throw new s.JOSENotSupported('Unsupported "kty" (Key Type) Parameter value')}}},7414:(e,t,r)=>{"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},7440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralSign=void 0;const n=r(4329),o=r(6247);class i{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}t.GeneralSign=class{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new i(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new o.JWSInvalid("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t<this._signatures.length;t++){const r=this._signatures[t],i=new n.FlattenedSign(this._payload);i.setProtectedHeader(r.protectedHeader),i.setUnprotectedHeader(r.unprotectedHeader);const{payload:s,...a}=await i.sign(r.key,r.options);if(0===t)e.payload=s;else if(e.payload!==s)throw new o.JWSInvalid("inconsistent use of JWS Unencoded Payload (RFC7797)");e.signatures.push(a)}return e}}},7599:(e,t,r)=>{var n=r(2861).Buffer,o=r(8948),i=r(8789),s=r(2203),a=r(2851),c=r(9023),u=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function l(e){var t=e.split(".",1)[0];return function(e){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e))return e;try{return JSON.parse(e)}catch(e){return}}(n.from(t,"base64").toString("binary"))}function d(e){return e.split(".")[2]}function p(e){return u.test(e)&&!!l(e)}function f(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var o=d(e=a(e)),s=function(e){return e.split(".",2).join(".")}(e);return i(t).verify(s,o,r)}function h(e,t){if(t=t||{},!p(e=a(e)))return null;var r=l(e);if(!r)return null;var o=function(e,t){t=t||"utf8";var r=e.split(".")[1];return n.from(r,"base64").toString(t)}(e);return("JWT"===r.typ||t.json)&&(o=JSON.parse(o,t.encoding)),{header:r,payload:o,signature:d(e)}}function y(e){var t=(e=e||{}).secret;if(t=null==(t=null==t?e.publicKey:t)?e.key:t,!0===/^hs/i.test(e.algorithm)&&null==t)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new o(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new o(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}c.inherits(y,s),y.prototype.verify=function(){try{var e=f(this.signature.buffer,this.algorithm,this.key.buffer),t=h(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},y.decode=h,y.isValid=p,y.verify=f,e.exports=y},7609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deflate=t.inflate=void 0;const n=r(9023),o=r(3106),i=r(6247),s=(0,n.promisify)(o.inflateRaw),a=(0,n.promisify)(o.deflateRaw);t.inflate=e=>s(e,{maxOutputLength:25e4}).catch(()=>{throw new i.JWEDecompressionFailed}),t.deflate=e=>a(e)},7631:(e,t,r)=>{"use strict";const n=r(8311);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},7638:(e,t,r)=>{"use strict";const n=r(8311);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},7644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepFreeze=void 0,t.deepFreeze=function e(t){return t&&(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(r){!t.hasOwnProperty(r)||null===t[r]||"object"!=typeof t[r]&&"function"!=typeof t[r]||t[r].constructor===Buffer||Object.isFrozen(t[r])||e(t[r])})),t}},7651:(e,t,r)=>{const n=r(855),o=r(4977),i=r(7019),s=r(5747),a=r(6111),c=r(7914),u=r(8928),l=r(3639),d=r(9001),p=r(5931),f=r(7083),{KeyObject:h,createSecretKey:y,createPrivateKey:m}=r(6982),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];o&&g.splice(3,0,"PS256","PS384","PS512");const v={expiresIn:{isValid:function(e){return u(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return u(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:a.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:c,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:c,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:c,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:c,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},w={iat:{isValid:l,message:'"iat" should be a number of seconds'},exp:{isValid:l,message:'"exp" should be a number of seconds'},nbf:{isValid:l,message:'"nbf" should be a number of seconds'}};function E(e,t,r,n){if(!d(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){const i=e[o];if(i){if(!i.isValid(r[o]))throw new Error(i.message)}else if(!t)throw new Error('"'+o+'" is not allowed in "'+n+'"')})}const b={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},S=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,o){"function"==typeof r?(o=r,r={}):r=r||{};const a="object"==typeof e&&!Buffer.isBuffer(e),c=Object.assign({alg:r.algorithm||"HS256",typ:a?"JWT":void 0,kid:r.keyid},r.header);function u(e){if(o)return o(e);throw e}if(!t&&"none"!==r.algorithm)return u(new Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof h))try{t=m(t)}catch(e){try{t=y("string"==typeof t?Buffer.from(t):t)}catch(e){return u(new Error("secretOrPrivateKey is not valid key material"))}}if(c.alg.startsWith("HS")&&"secret"!==t.type)return u(new Error(`secretOrPrivateKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)){if("private"!==t.type)return u(new Error(`secretOrPrivateKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInsecureKeySizes&&!c.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return u(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`))}if(void 0===e)return u(new Error("payload is required"));if(a){try{!function(e){E(w,!0,e,"payload")}(e)}catch(e){return u(e)}r.mutatePayload||(e=Object.assign({},e))}else{const t=S.filter(function(e){return void 0!==r[e]});if(t.length>0)return u(new Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return u(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return u(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{!function(e){E(v,!1,e,"options")}(r)}catch(e){return u(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{i(c.alg,t)}catch(e){return u(e)}const l=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:a&&(e.iat=l),void 0!==r.notBefore){try{e.nbf=n(r.notBefore,l)}catch(e){return u(e)}if(void 0===e.nbf)return u(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=n(r.expiresIn,l)}catch(e){return u(e)}if(void 0===e.exp)return u(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(b).forEach(function(t){const n=b[t];if(void 0!==r[t]){if(void 0!==e[n])return u(new Error('Bad "options.'+t+'" option. The payload already has an "'+n+'" property.'));e[n]=r[t]}});const d=r.encoding||"utf8";if("function"!=typeof o){let n=s.sign({header:c,payload:e,secret:t,encoding:d});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&n.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`);return n}o=o&&f(o),s.createSign({header:c,privateKey:t,payload:e,encoding:d}).once("error",o).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&e.length<256)return o(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`));o(null,e)})}},7687:(e,t,r)=>{"use strict";const n=r(857),o=r(2018),i=r(5884),{env:s}=process;let a;function c(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function u(e,t){if(0===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!t&&void 0===a)return 0;const r=a||0;if("dumb"===s.TERM)return r;if("win32"===process.platform){const e=n.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in s)||"codeship"===s.CI_NAME?1:r;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:r}i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),"FORCE_COLOR"in s&&(a="true"===s.FORCE_COLOR?1:"false"===s.FORCE_COLOR?0:0===s.FORCE_COLOR.length?1:Math.min(parseInt(s.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return c(u(e,e&&e.isTTY))},stdout:c(u(!0,o.isatty(1))),stderr:c(u(!0,o.isatty(2)))}},7815:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactEncrypt=void 0;const n=r(9805);t.CompactEncrypt=class{constructor(e){this._flattened=new n.FlattenedEncrypt(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}},7833:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7897:(e,t,r)=>{const{ArgumentError:n}=r(3780),{JwksClient:o}=r(3110),i=r(3552);e.exports.koaJwtSecret=function(e={}){if(!e.jwksUri)throw new n("No JWKS provided. Please provide a jwksUri");const t=new o(e);return function({alg:r,kid:n}={}){return new Promise((o,s)=>{if(!i.includes(r))return s(new Error("Missing / invalid token algorithm"));t.getSigningKey(n).then(e=>{o(e.publicKey||e.rsaPublicKey)}).catch(t=>e.handleSigningKeyError?e.handleSigningKeyError(t).then(s):s(t))})}}},7914:e=>{var t=Object.prototype.toString;e.exports=function(e){return!0===e||!1===e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Boolean]"==t.call(e)}},7965:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(9023),i=r(5945),s=r(3254),a=r(7980),c=r(5206);let u;u=n.sign.length>3?(0,o.promisify)(n.sign):n.sign,t.default=async(e,t,r)=>{const o=(0,c.default)(e,t,"sign");if(e.startsWith("HS")){const t=n.createHmac((0,s.default)(e),o);return t.update(r),t.digest()}return u((0,i.default)(e),r,(0,a.default)(e,o))}},7974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitLength=void 0;const n=r(6247),o=r(927);function i(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new n.JOSENotSupported(`Unsupported JWE Algorithm: ${e}`)}}t.bitLength=i,t.default=e=>(0,o.default)(new Uint8Array(i(e)>>3))},7975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=t.generateSecret=void 0;const n=r(6982),o=r(9023),i=r(927),s=r(5363),a=r(6247),c=(0,o.promisify)(n.generateKeyPair);t.generateSecret=async function(e,t){let r;switch(e){case"HS256":case"HS384":case"HS512":case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":r=parseInt(e.slice(-3),10);break;case"A128KW":case"A192KW":case"A256KW":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10);break;default:throw new a.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return(0,n.createSecretKey)((0,i.default)(new Uint8Array(r>>3)))},t.generateKeyPair=async function(e,t){var r,n;switch(e){case"RS256":case"RS384":case"RS512":case"PS256":case"PS384":case"PS512":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":case"RSA1_5":{const e=null!==(r=null==t?void 0:t.modulusLength)&&void 0!==r?r:2048;if("number"!=typeof e||e<2048)throw new a.JOSENotSupported("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");const n=await c("rsa",{modulusLength:e,publicExponent:65537});return(0,s.setModulusLength)(n.privateKey,e),(0,s.setModulusLength)(n.publicKey,e),n}case"ES256":return c("ec",{namedCurve:"P-256"});case"ES256K":return c("ec",{namedCurve:"secp256k1"});case"ES384":return c("ec",{namedCurve:"P-384"});case"ES512":return c("ec",{namedCurve:"P-521"});case"EdDSA":switch(null==t?void 0:t.crv){case void 0:case"Ed25519":return c("ed25519");case"Ed448":return c("ed448");default:throw new a.JOSENotSupported("Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448")}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":const e=null!==(n=null==t?void 0:t.crv)&&void 0!==n?n:"P-256";switch(e){case void 0:case"P-256":case"P-384":case"P-521":return c("ec",{namedCurve:e});case"X25519":return c("x25519");case"X448":return c("x448");default:throw new a.JOSENotSupported("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}default:throw new a.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}}},7980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(8960),i=r(6247),s=r(5363),a=r(1185),c={padding:n.constants.RSA_PKCS1_PSS_PADDING,saltLength:n.constants.RSA_PSS_SALTLEN_DIGEST},u=new Map([["ES256","P-256"],["ES256K","secp256k1"],["ES384","P-384"],["ES512","P-521"]]);t.default=function(e,t){switch(e){case"EdDSA":if(!["ed25519","ed448"].includes(t.asymmetricKeyType))throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448");return t;case"RS256":case"RS384":case"RS512":if("rsa"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");return(0,s.default)(t,e),t;case a.rsaPssParams&&"PS256":case a.rsaPssParams&&"PS384":case a.rsaPssParams&&"PS512":if("rsa-pss"===t.asymmetricKeyType){const{hashAlgorithm:r,mgf1HashAlgorithm:n,saltLength:o}=t.asymmetricKeyDetails,i=parseInt(e.slice(-3),10);if(void 0!==r&&(r!==`sha${i}`||n!==r))throw new TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(void 0!==o&&o>i>>3)throw new TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if("rsa"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss");return(0,s.default)(t,e),{key:t,...c};case!a.rsaPssParams&&"PS256":case!a.rsaPssParams&&"PS384":case!a.rsaPssParams&&"PS512":if("rsa"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");return(0,s.default)(t,e),{key:t,...c};case"ES256":case"ES256K":case"ES384":case"ES512":{if("ec"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ec");const r=(0,o.default)(t),n=u.get(e);if(r!==n)throw new TypeError(`Invalid key curve for the algorithm, its curve must be ${n}, got ${r}`);return{dsaEncoding:"ieee-p1363",key:t}}default:throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},8232:(e,t)=>{"use strict";t.qg=function(e,t){const a=new r,c=e.length;if(c<2)return a;const u=t?.decode||s;let l=0;do{const t=o(e,l,c);if(-1===t)break;const r=n(e,l,c);if(t>r){l=e.lastIndexOf(";",t-1)+1;continue}const s=i(e,l,t);void 0===a[s]&&(a[s]=u(i(e,t+1,r))),l=r+1}while(l<c);return a};Object.prototype.toString;const r=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function n(e,t,r){const n=e.indexOf(";",t);return-1===n?r:n}function o(e,t,r){const n=e.indexOf("=",t);return n<r?n:-1}function i(e,t,r){let n=t,o=r;do{const t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<o);for(;o>n;){const t=e.charCodeAt(o-1);if(32!==t&&9!==t)break;o--}return e.slice(n,o)}function s(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},8311:(e,t,r)=>{"use strict";const n=/\s+/g;class o{constructor(e,t){if(t=s(t),e instanceof o)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new o(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&y)|(this.options.loose&&m))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?l[d.HYPHENRANGELOOSE]:l[d.HYPHENRANGE];e=e.replace(o,T(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(l[d.COMPARATORTRIM],p),c("comparator trim",e),e=e.replace(l[d.TILDETRIM],f),c("tilde trim",e),e=e.replace(l[d.CARETTRIM],h),c("caret trim",e);let s=e.split(" ").map(e=>E(e,this.options)).join(" ").split(/\s+/).map(e=>C(e,this.options));n&&(s=s.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(l[d.COMPARATORLOOSE])))),c("range list",s);const u=new Map,v=s.map(e=>new a(e,this.options));for(const e of v){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const w=[...u.values()];return i.set(t,w),w}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Range is required");return this.set.some(r=>w(r,t)&&e.set.some(e=>w(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(J(this.set[t],e,this.options))return!0;return!1}}e.exports=o;const i=new(r(8794)),s=r(8587),a=r(3904),c=r(7272),u=r(3908),{safeRe:l,t:d,comparatorTrimReplace:p,tildeTrimReplace:f,caretTrimReplace:h}=r(9718),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:m}=r(6874),g=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,w=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every(e=>o.intersects(e,t)),o=n.pop();return r},E=(e,t)=>(e=e.replace(l[d.BUILD],""),c("comp",e,t),e=A(e,t),c("caret",e),e=S(e,t),c("tildes",e),e=I(e,t),c("xrange",e),e=k(e,t),c("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,S=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const r=t.loose?l[d.TILDELOOSE]:l[d.TILDE];return e.replace(r,(t,r,n,o,i)=>{let s;return c("tilde",e,t,r,n,o,i),b(r)?s="":b(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:b(o)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(c("replaceTilde pr",i),s=`>=${r}.${n}.${o}-${i} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,c("tilde return",s),s})},A=(e,t)=>e.trim().split(/\s+/).map(e=>P(e,t)).join(" "),P=(e,t)=>{c("caret",e,t);const r=t.loose?l[d.CARETLOOSE]:l[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,o,i,s)=>{let a;return c("caret",e,t,r,o,i,s),b(r)?a="":b(o)?a=`>=${r}.0.0${n} <${+r+1}.0.0-0`:b(i)?a="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:s?(c("replaceCaret pr",s),a="0"===r?"0"===o?`>=${r}.${o}.${i}-${s} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i}-${s} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===o?`>=${r}.${o}.${i}${n} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i} <${+r+1}.0.0-0`),c("caret return",a),a})},I=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>O(e,t)).join(" ")),O=(e,t)=>{e=e.trim();const r=t.loose?l[d.XRANGELOOSE]:l[d.XRANGE];return e.replace(r,(r,n,o,i,s,a)=>{c("xRange",e,r,n,o,i,s,a);const u=b(o),l=u||b(i),d=l||b(s),p=d;return"="===n&&p&&(n=""),a=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&p?(l&&(i=0),s=0,">"===n?(n=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===n&&(n="<",l?o=+o+1:i=+i+1),"<"===n&&(a="-0"),r=`${n+o}.${i}.${s}${a}`):l?r=`>=${o}.0.0${a} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${i}.0${a} <${o}.${+i+1}.0-0`),c("xRange return",r),r})},k=(e,t)=>(c("replaceStars",e,t),e.trim().replace(l[d.STAR],"")),C=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),T=e=>(t,r,n,o,i,s,a,c,u,l,d,p)=>`${r=b(n)?"":b(o)?`>=${n}.0.0${e?"-0":""}`:b(i)?`>=${n}.${o}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=b(u)?"":b(l)?`<${+u+1}.0.0-0`:b(d)?`<${u}.${+l+1}.0-0`:p?`<=${u}.${l}.${d}-${p}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),J=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(c(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},8396:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeJwt=void 0;const n=r(8462),o=r(5821),i=r(1855),s=r(6247);t.decodeJwt=function(e){if("string"!=typeof e)throw new s.JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:r}=e.split(".");if(5===r)throw new s.JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");if(3!==r)throw new s.JWTInvalid("Invalid JWT");if(!t)throw new s.JWTInvalid("JWTs must contain a payload");let a,c;try{a=(0,n.decode)(t)}catch{throw new s.JWTInvalid("Failed to base64url decode the payload")}try{c=JSON.parse(o.decoder.decode(a))}catch{throw new s.JWTInvalid("Failed to parse the decoded payload as JSON")}if(!(0,i.default)(c))throw new s.JWTInvalid("Invalid JWT Claims Set");return c}},8405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new n.JWEInvalid("PBES2 Salt Input must be 8 or more octets")}},8462:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const n=r(82);t.encode=n.encode,t.decode=n.decode},8587:e=>{"use strict";const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},8604:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}},8611:e=>{"use strict";e.exports=require("http")},8639:(e,t,r)=>{"use strict";var n=r(9831);e.exports=n.asyncMemoizer},8730:(e,t,r)=>{const n=r(5753)("jwks"),{RateLimiter:o}=r(9439),i=r(9950);e.exports.A=function(e,{jwksRequestsPerMinute:t=10}){const r=e.getSigningKey.bind(e),s=new o(t,"minute",!0);return n(`Configured rate limiting to JWKS endpoint at ${t}/minute`),async e=>await new Promise((t,o)=>{s.removeTokens(1,async(s,a)=>{if(s&&o(s),n("Requests to the JWKS endpoint available for the next minute:",a),a<0)n("Too many requests to the JWKS endpoint"),o(new i("Too many requests to the JWKS endpoint"));else try{const n=await r(e);t(n)}catch(e){o(e)}})})}},8737:(e,t)=>{"use strict";function r(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}Object.defineProperty(t,"__esModule",{value:!0}),t.withAlg=void 0,t.default=(e,...t)=>r("Key must be ",e,...t),t.withAlg=function(e,t,...n){return r(`Key for the ${e} algorithm must be `,t,...n)}},8789:(e,t,r)=>{var n,o=r(2861).Buffer,i=r(6982),s=r(2010),a=r(9023),c="secret must be a string or buffer",u="key must be a string or a buffer",l="function"==typeof i.createPublicKey;function d(e){if(!o.isBuffer(e)&&"string"!=typeof e){if(!l)throw y(u);if("object"!=typeof e)throw y(u);if("string"!=typeof e.type)throw y(u);if("string"!=typeof e.asymmetricKeyType)throw y(u);if("function"!=typeof e.export)throw y(u)}}function p(e){if(!o.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw y("key must be a string, a buffer or an object")}function f(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function h(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function y(e){var t=[].slice.call(arguments,1),r=a.format.bind(a,e).apply(null,t);return new TypeError(r)}function m(e){var t;return t=e,o.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function g(e){return function(t,r){!function(e){if(!o.isBuffer(e)){if("string"==typeof e)return e;if(!l)throw y(c);if("object"!=typeof e)throw y(c);if("secret"!==e.type)throw y(c);if("function"!=typeof e.export)throw y(c)}}(r),t=m(t);var n=i.createHmac("sha"+e,r);return f((n.update(t),n.digest("base64")))}}l&&(u+=" or a KeyObject",c+="or a KeyObject");var v="timingSafeEqual"in i?function(e,t){return e.byteLength===t.byteLength&&i.timingSafeEqual(e,t)}:function(e,t){return n||(n=r(1045)),n(e,t)};function w(e){return function(t,r,n){var i=g(e)(t,n);return v(o.from(r),o.from(i))}}function E(e){return function(t,r){p(r),t=m(t);var n=i.createSign("RSA-SHA"+e);return f((n.update(t),n.sign(r,"base64")))}}function b(e){return function(t,r,n){d(n),t=m(t),r=h(r);var o=i.createVerify("RSA-SHA"+e);return o.update(t),o.verify(n,r,"base64")}}function S(e){return function(t,r){p(r),t=m(t);var n=i.createSign("RSA-SHA"+e);return f((n.update(t),n.sign({key:r,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function _(e){return function(t,r,n){d(n),t=m(t),r=h(r);var o=i.createVerify("RSA-SHA"+e);return o.update(t),o.verify({key:n,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function A(e){var t=E(e);return function(){var r=t.apply(null,arguments);return s.derToJose(r,"ES"+e)}}function P(e){var t=b(e);return function(r,n,o){return n=s.joseToDer(n,"ES"+e).toString("base64"),t(r,n,o)}}function I(){return function(){return""}}function O(){return function(e,t){return""===t}}e.exports=function(e){var t={hs:g,rs:E,ps:S,es:A,none:I},r={hs:w,rs:b,ps:_,es:P,none:O},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw y('"%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".',e);var o=(n[1]||n[3]).toLowerCase(),i=n[2];return{sign:t[o](i),verify:r[o](i)}}},8794:e=>{"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8611),o=r(5692),i=r(4434),s=r(6247),a=r(5821);t.default=async(e,t,r)=>{let c;switch(e.protocol){case"https:":c=o.get;break;case"http:":c=n.get;break;default:throw new TypeError("Unsupported URL protocol.")}const{agent:u,headers:l}=r,d=c(e.href,{agent:u,timeout:t,headers:l}),[p]=await Promise.race([(0,i.once)(d,"response"),(0,i.once)(d,"timeout")]);if(!p)throw d.destroy(),new s.JWKSTimeout;if(200!==p.statusCode)throw new s.JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");const f=[];for await(const e of p)f.push(e);try{return JSON.parse(a.decoder.decode((0,a.concat)(...f)))}catch{throw new s.JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON")}}},8928:e=>{var t=1/0,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,a=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){return"number"==typeof e&&e==function(e){var u=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==a.call(e)}(e))return NaN;if(c(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=c(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var u=o.test(e);return u||i.test(e)?s(e.slice(2),u?2:8):n.test(e)?NaN:+e}(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),l=u%1;return u==u?l?u-l:u:0}(e)}},8948:(e,t,r)=>{var n=r(2861).Buffer,o=r(2203);function i(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=n.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=n.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}r(9023).inherits(i,o),i.prototype.write=function(e){this.buffer=n.concat([this.buffer,n.from(e)]),this.emit("data",e)},i.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=i},8960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCurve=t.weakMap=void 0;const n=r(181),o=r(6982),i=r(6247),s=r(8993),a=r(4512),c=r(8737),u=r(740),l=n.Buffer.from([42,134,72,206,61,3,1,7]),d=n.Buffer.from([43,129,4,0,34]),p=n.Buffer.from([43,129,4,0,35]),f=n.Buffer.from([43,129,4,0,10]);t.weakMap=new WeakMap;const h=(e,r)=>{var n;let y;if((0,s.isCryptoKey)(e))y=o.KeyObject.from(e);else{if(!(0,a.default)(e))throw new TypeError((0,c.default)(e,...u.types));y=e}if("secret"===y.type)throw new TypeError('only "private" or "public" type keys can be used for this operation');switch(y.asymmetricKeyType){case"ed25519":case"ed448":return`Ed${y.asymmetricKeyType.slice(2)}`;case"x25519":case"x448":return`X${y.asymmetricKeyType.slice(1)}`;case"ec":{if(t.weakMap.has(y))return t.weakMap.get(y);let e=null===(n=y.asymmetricKeyDetails)||void 0===n?void 0:n.namedCurve;if(e||"private"!==y.type){if(!e){const t=y.export({format:"der",type:"spki"}),r=t[1]<128?14:15,n=t[r],o=t.slice(r+1,r+1+n);if(o.equals(l))e="prime256v1";else if(o.equals(d))e="secp384r1";else if(o.equals(p))e="secp521r1";else{if(!o.equals(f))throw new i.JOSENotSupported("Unsupported key curve for this operation");e="secp256k1"}}}else e=h((0,o.createPublicKey)(y),!0);if(r)return e;const s=(e=>{switch(e){case"prime256v1":return"P-256";case"secp384r1":return"P-384";case"secp521r1":return"P-521";case"secp256k1":return"secp256k1";default:throw new i.JOSENotSupported("Unsupported key curve for this operation")}})(e);return t.weakMap.set(y,s),s}default:throw new TypeError("Invalid asymmetric key type for this operation")}};t.setCurve=function(e,r){t.weakMap.set(e,r)},t.default=h},8980:(e,t,r)=>{var n=r(1741),o=function(e,t){n.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};(o.prototype=Object.create(n.prototype)).constructor=o,e.exports=o},8993:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCryptoKey=void 0;const n=r(6982),o=r(9023),i=n.webcrypto;t.default=i,t.isCryptoKey=o.types.isCryptoKey?e=>o.types.isCryptoKey(e):e=>!1},9001:e=>{var t,r,n=Function.prototype,o=Object.prototype,i=n.toString,s=o.hasOwnProperty,a=i.call(Object),c=o.toString,u=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=c.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=u(e);if(null===t)return!0;var r=s.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&i.call(r)==a}},9023:e=>{"use strict";e.exports=require("util")},9060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalVerify=void 0;const n=r(6833),o=r(6247),i=r(1855);t.generalVerify=async function(e,t,r){if(!(0,i.default)(e))throw new o.JWSInvalid("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(i.default))throw new o.JWSInvalid("JWS Signatures missing or incorrect type");for(const o of e.signatures)try{return await(0,n.flattenedVerify)({header:o.header,payload:e.payload,protected:o.protected,signature:o.signature},t,r)}catch{}throw new o.JWSSignatureVerificationFailed}},9439:(e,t,r)=>{t.RateLimiter=r(3065),t.TokenBucket=r(5472)},9476:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0}},9589:(e,t,r)=>{"use strict";const n=r(9718),o=r(6874),i=r(3908),s=r(1123),a=r(144),c=r(6953),u=r(7414),l=r(3007),d=r(1832),p=r(2938),f=r(6254),h=r(4493),y=r(1729),m=r(560),g=r(9970),v=r(1763),w=r(909),E=r(3927),b=r(4277),S=r(5580),_=r(7059),A=r(4641),P=r(3999),I=r(4089),O=r(5200),k=r(2111),C=r(6170),T=r(3904),J=r(8311),x=r(7638),K=r(7631),R=r(9628),j=r(270),W=r(1261),$=r(3874),H=r(7075),N=r(5571),M=r(5342),L=r(6780),D=r(2525),F=r(5032);e.exports={parse:a,valid:c,clean:u,inc:l,diff:d,major:p,minor:f,patch:h,prerelease:y,compare:m,rcompare:g,compareLoose:v,compareBuild:w,sort:E,rsort:b,gt:S,lt:_,eq:A,neq:P,gte:I,lte:O,cmp:k,coerce:C,Comparator:T,Range:J,satisfies:x,toComparators:K,maxSatisfying:R,minSatisfying:j,minVersion:W,validRange:$,outside:H,gtr:N,ltr:M,intersects:L,simplifyRange:D,subset:F,SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},9590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(82),i=r(1326),s=r(6247),a=r(8960),c=r(8993),u=r(4512),l=r(8737),d=r(740),p=r(1185),f=e=>{let t;if((0,c.isCryptoKey)(e)){if(!e.extractable)throw new TypeError("CryptoKey is not extractable");t=n.KeyObject.from(e)}else{if(!(0,u.default)(e)){if(e instanceof Uint8Array)return{kty:"oct",k:(0,o.encode)(e)};throw new TypeError((0,l.default)(e,...d.types,"Uint8Array"))}t=e}if(p.jwkExport){if("secret"!==t.type&&!["rsa","ec","ed25519","x25519","ed448","x448"].includes(t.asymmetricKeyType))throw new s.JOSENotSupported("Unsupported key asymmetricKeyType");return t.export({format:"jwk"})}switch(t.type){case"secret":return{kty:"oct",k:(0,o.encode)(t.export())};case"private":case"public":switch(t.asymmetricKeyType){case"rsa":{const e=t.export({format:"der",type:"pkcs1"}),r=new i.default(e);"private"===t.type&&r.unsignedInteger();const n=(0,o.encode)(r.unsignedInteger()),s=(0,o.encode)(r.unsignedInteger());let a;return"private"===t.type&&(a={d:(0,o.encode)(r.unsignedInteger()),p:(0,o.encode)(r.unsignedInteger()),q:(0,o.encode)(r.unsignedInteger()),dp:(0,o.encode)(r.unsignedInteger()),dq:(0,o.encode)(r.unsignedInteger()),qi:(0,o.encode)(r.unsignedInteger())}),r.end(),{kty:"RSA",n,e:s,...a}}case"ec":{const e=(0,a.default)(t);let r,i,c;switch(e){case"secp256k1":r=64,i=33,c=-1;break;case"P-256":r=64,i=36,c=-1;break;case"P-384":r=96,i=35,c=-3;break;case"P-521":r=132,i=35,c=-3;break;default:throw new s.JOSENotSupported("Unsupported curve")}if("public"===t.type){const n=t.export({type:"spki",format:"der"});return{kty:"EC",crv:e,x:(0,o.encode)(n.subarray(-r,-r/2)),y:(0,o.encode)(n.subarray(-r/2))}}const u=t.export({type:"pkcs8",format:"der"});return u.length<100&&(i+=c),{...f((0,n.createPublicKey)(t)),d:(0,o.encode)(u.subarray(i,i+r/2))}}case"ed25519":case"x25519":{const e=(0,a.default)(t);if("public"===t.type){const r=t.export({type:"spki",format:"der"});return{kty:"OKP",crv:e,x:(0,o.encode)(r.subarray(-32))}}const r=t.export({type:"pkcs8",format:"der"});return{...f((0,n.createPublicKey)(t)),d:(0,o.encode)(r.subarray(-32))}}case"ed448":case"x448":{const e=(0,a.default)(t);if("public"===t.type){const r=t.export({type:"spki",format:"der"});return{kty:"OKP",crv:e,x:(0,o.encode)(r.subarray("Ed448"===e?-57:-56))}}const r=t.export({type:"pkcs8",format:"der"});return{...f((0,n.createPublicKey)(t)),d:(0,o.encode)(r.subarray("Ed448"===e?-57:-56))}}default:throw new s.JOSENotSupported("Unsupported key asymmetricKeyType")}default:throw new s.JOSENotSupported("Unsupported key type")}};t.default=f},9628:(e,t,r)=>{"use strict";const n=r(3908),o=r(8311);e.exports=(e,t,r)=>{let i=null,s=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(i&&-1!==s.compare(e)||(i=e,s=new n(i,r)))}),i}},9669:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},9718:(e,t,r)=>{"use strict";const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=r(6874),s=r(7272),a=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],d=t.t={};let p=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,o]],y=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=p++;s(e,o,t),d[e]=o,u[o]=t,l[o]=n,a[o]=new RegExp(t,r?"g":void 0),c[o]=new RegExp(n,r?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),y("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${f}+`),y("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),y("FULL",`^${u[d.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),y("LOOSE",`^${u[d.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),y("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),y("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),y("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?(?:$|[^\\d])`),y("COERCERTL",u[d.COERCE],!0),y("COERCERTLFULL",u[d.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",y("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),y("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",y("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",y("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},9743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;t.default=e=>{const t=r.exec(e);if(!t)throw new TypeError("Invalid time period format");const n=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(n);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*n);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*n);case"day":case"days":case"d":return Math.round(86400*n);case"week":case"weeks":case"w":return Math.round(604800*n);default:return Math.round(31557600*n)}}},9754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="node:crypto"},9805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlattenedEncrypt=t.unprotected=void 0;const n=r(82),o=r(2027),i=r(7609),s=r(7974),a=r(508),c=r(6247),u=r(9476),l=r(5821),d=r(2458);t.unprotected=Symbol(),t.FlattenedEncrypt=class{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,r){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new c.JWEInvalid("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!(0,u.default)(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new c.JWEInvalid("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const p={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if((0,d.default)(c.JWEInvalid,new Map,null==r?void 0:r.crit,this._protectedHeader,p),void 0!==p.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new c.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==p.zip)throw new c.JOSENotSupported('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:f,enc:h}=p;if("string"!=typeof f||!f)throw new c.JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof h||!h)throw new c.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let y,m,g,v,w,E,b;if("dir"===f){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===f&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let n;({cek:m,encryptedKey:y,parameters:n}=await(0,a.default)(f,h,e,this._cek,this._keyManagementParameters)),n&&(r&&t.unprotected in r?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}if(this._iv||(this._iv=(0,s.default)(h)),v=this._protectedHeader?l.encoder.encode((0,n.encode)(JSON.stringify(this._protectedHeader))):l.encoder.encode(""),this._aad?(w=(0,n.encode)(this._aad),g=(0,l.concat)(v,l.encoder.encode("."),l.encoder.encode(w))):g=v,"DEF"===p.zip){const e=await((null==r?void 0:r.deflateRaw)||i.deflate)(this._plaintext);({ciphertext:E,tag:b}=await(0,o.default)(h,e,m,this._iv,g))}else({ciphertext:E,tag:b}=await(0,o.default)(h,this._plaintext,m,this._iv,g));const S={ciphertext:(0,n.encode)(E),iv:(0,n.encode)(this._iv),tag:(0,n.encode)(b)};return y&&(S.encrypted_key=(0,n.encode)(y)),w&&(S.aad=w),this._protectedHeader&&(S.protected=l.decoder.decode(v)),this._sharedUnprotectedHeader&&(S.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(S.header=this._unprotectedHeader),S}}},9831:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.asyncMemoizer=void 0;var a=s(r(1603)),c=r(4434),u=s(r(7193)),l=r(7644),d=r(3503);function p(e){var t=new a.default(e),r=e.load,n=e.hash,s=e.bypass,d=e.itemMaxAge,p=e.freeze,f=e.clone,h=e.queueMaxAge||1e3,y=new Map,m=new c.EventEmitter,g=Object.assign({del:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=n.apply(void 0,o(e));t.del(i)},reset:function(){return t.reset()},keys:t.keys.bind(t),on:m.on.bind(m),once:m.once.bind(m)},e);if(e.disable)return Object.assign(r,g);function v(e,t){var r,n;try{for(var s=i(e),a=s.next();!a.done;a=s.next()){var c=a.value;f?setImmediate.apply(void 0,o([c],t.map(u.default))):setImmediate.apply(void 0,o([c],t))}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}function w(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];m.emit.apply(m,o([e],t))}return Object.assign(function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var a,c=e.slice(0,-1),u=e.slice(-1).pop();if(s&&s.apply(void 0,o(c)))return w.apply(void 0,o(["miss"],c)),r.apply(void 0,o(e));a=0!==c.length||n?n.apply(void 0,o(c)):"_";var f=t.get(a);if(f)return w.apply(void 0,o(["hit"],c)),v([u],[null].concat(f));var m=y.get(a);if(m&&m.expiresAt>Date.now())return m.queue.push(u),void w.apply(void 0,o(["queue"],c));w.apply(void 0,o(["miss"],c));var g=Date.now(),E=[u];y.set(a,{queue:E,expiresAt:g+h}),r.apply(void 0,o(c,[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];e[0]||function(e,r,n){p&&n.forEach(l.deepFreeze),d?t.set(e,n,d.apply(void 0,o(r.concat(n)))):t.set(e,n)}(a,c,e.slice(1)),y.delete(a),w.apply(void 0,o(["loaded",Date.now()-g],c)),v(E,e)}]))},g)}t.asyncMemoizer=p,p.sync=d.syncMemoizer},9851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactSign=void 0;const n=r(4329);t.CompactSign=class{constructor(e){this._flattened=new n.FlattenedSign(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}},9877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRemoteJWKSet=void 0;const n=r(8832),o=r(6247),i=r(6980);class s extends i.LocalJWKSet{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof o.JWKSNoMatchingKey&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw r}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(0,n.default)(this._url,this._timeoutDuration,this._options).then(e=>{if(!(0,i.isJWKSLike)(e))throw new o.JWKSInvalid("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e})),await this._pendingFetch}}t.createRemoteJWKSet=function(e,t){const r=new s(e,t);return async function(e,t){return r.getKey(e,t)}}},9950:e=>{function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksRateLimitError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},9970:(e,t,r)=>{"use strict";const n=r(560);e.exports=(e,t,r)=>n(t,e,r)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";r.r(n),r.d(n,{handler:()=>b,isAuthorized:()=>S});const e=require("node:crypto");function t(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}const o=require("node:fs"),i=require("node:path"),s=require("node:url");var a,c=r(8232);!function(e){e[e.none=0]="none",e[e.error=10]="error",e[e.warn=20]="warn",e[e.info=30]="info",e[e.debug=40]="debug"}(a||(a={}));class u{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map(e=>{if("object"==typeof e)try{return JSON.stringify(e)}catch{return e}return e})}info(...e){this.logLevel>=a.info&&console.log(...this.jsonify(e))}warn(...e){this.logLevel>=a.warn&&console.warn(...this.jsonify(e))}error(...e){this.logLevel>=a.error&&console.error(...this.jsonify(e))}debug(...e){this.logLevel>=a.debug&&console.trace(...this.jsonify(e))}}const l=(0,s.fileURLToPath)("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),d=i.dirname(l);function p(e,t){return{status:"307",statusDescription:"Temporary Redirect",headers:{location:[{key:"location",value:e}],...t?.cookies?{"set-cookie":t.cookies.map(e=>({key:"set-cookie",value:e}))}:{}}}}function f(e){const t={...e,region:process.env.AWS_REGION};return'<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/> </head> <body> <h1>${title}</h1> <p>${message}</p> <p> ${details} [log region: ${region}] </p> <p> <a href="${linkHref}">${linkText}</a> </p> </body> </html> '.replace(/\${([^}]*)}/g,(e,r)=>t[r]||"")}var h=r(4040),y=r.n(h),m=r(4601),g=r.n(m);let v;function w(){const t=(0,e.randomBytes)(16).toString("hex");return`${Date.now()/1e3|0}T${t}`}function E(t,r){return(0,e.createHmac)("sha256",r.nonceSigningSecret).update(t).digest("hex")}const b=function(){let e;return async t=>{e||(e=function(){const e=process.env.LAMBDA_TASK_ROOT||d,t=i.join(e,"config.json");console.log("Loading config from",t);const r=JSON.parse((0,o.readFileSync)(t,"utf-8")),n=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(r.userPoolId)[1]}.amazonaws.com/${r.userPoolId}`,s=`${n}/.well-known/jwks.json`;return{nonceMaxAge:Number.parseInt((0,c.qg)(r.cookieSettings.nonce.toLowerCase())["max-age"],10)||86400,...r,tokenIssuer:n,tokenJwksUri:s,logger:new u(a[r.logLevel])}}()),e.logger.debug("Handling event:",t);const r=function(e,t){if(!t)throw new Error("Expected response value");return{...t,headers:{...t.headers??{},...(r=e.httpHeaders,Object.entries(r).reduce((e,[t,r])=>Object.assign(e,{[t.toLowerCase()]:[{key:t,value:r}]}),{}))}};var r}(e,await(async(e,t)=>{const r=t.Records[0].cf.request,n=r.headers.host[0].value,o=`${r.uri}${r.querystring?`?${r.querystring}`:""}`,{idToken:i,refreshToken:s,nonce:a,nonceHmac:u}=function(e,t){const r=function(e){return e.cookie?e.cookie.reduce((e,t)=>({...e,...(0,c.qg)(t.value)}),{}):{}}(e);if(!r)return{};const n=`CognitoIdentityServiceProvider.${t}`,o=r[`${n}.LastAuthUser`];return{tokenUserName:o,idToken:r[`${n}.${o??""}.idToken`],accessToken:r[`${n}.${o??""}.accessToken`],refreshToken:r[`${n}.${o??""}.refreshToken`],scopes:r[`${n}.${o??""}.tokenScopesString`],nonce:r["spa-auth-edge-nonce"],nonceHmac:r["spa-auth-edge-nonce-hmac"],pkce:r["spa-auth-edge-pkce"]}}(r.headers,e.clientId);if(e.logger.debug("Extracted cookies:",{idToken:i,refreshToken:s,nonce:a,nonceHmac:u}),!i)return _({config:e,domainName:n,requestedUri:o});const l=function(e){const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(Buffer.from(t,"base64").toString())}(i),{exp:d}=l;if(e.logger.debug("ID token exp:",d,new Date(1e3*d).toISOString()),Date.now()/1e3>d-600&&s)return function({config:e,domainName:t,requestedUri:r}){e.logger.info("Redirecting to refresh endpoint");const n=w(),o=new URLSearchParams({requestedUri:r,nonce:n}).toString();return p(`https://${t}${e.refreshAuthPath}?${o}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(n)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(E(n,e))}; ${e.cookieSettings.nonce}`]})}({config:e,domainName:n,requestedUri:o});e.logger.info("Validating JWT");const h=await async function(e,t,r,n){const o=y().decode(e,{complete:!0});if(!o||"string"==typeof o)return{validationError:new Error("Cannot parse JWT token")};const i=o.header.kid,s=await async function(e,t){v||(v=g()({cache:!0,rateLimit:!0,jwksUri:e}));const r=await v.getSigningKey(t);return"rsaPublicKey"in r?r.rsaPublicKey:r.publicKey}(t,i);if(s instanceof Error)return{validationError:s};const a={audience:n,issuer:r,ignoreExpiration:!1};return new Promise(t=>y().verify(e,s,a,e=>t(e?{validationError:e}:void 0)))}(i,e.tokenJwksUri,e.tokenIssuer,e.clientId);return void 0!==h?(e.logger.debug("ID token not valid:",h.validationError),_({config:e,domainName:n,requestedUri:o})):(e.logger.info("JWT is valid"),S(e,l)?r:{body:f(m={title:"Not authorized",statusCode:"403",message:"You are not authorized for this resource.",details:"Your sign in was successful, but your user is not allowed to access this resource.",linkHref:`https://${n}${e.signOutPath}`,linkText:"Sign out"}),status:m.statusCode??"500",headers:{"content-type":[{key:"Content-Type",value:"text/html; charset=UTF-8"}]}});var m})(e,t));return e.logger.debug("Returning response:",r),r}}();function S(e,t){if(e.requireGroupAnyOf){const r=t["cognito:groups"]||[];if(!e.requireGroupAnyOf.some(e=>r.includes(e)))return!1}return!0}function _({config:e,domainName:r,requestedUri:n}){const o=w(),i={nonce:o,nonceHmac:E(o,e),...A(e)};e.logger.debug("Using new state:",i);const s=new URLSearchParams({redirect_uri:`https://${r}${e.callbackPath}`,response_type:"code",client_id:e.clientId,state:t(Buffer.from(JSON.stringify({nonce:i.nonce,requestedUri:n})).toString("base64")),scope:e.oauthScopes.join(" "),code_challenge_method:"S256",code_challenge:i.pkceHash}).toString();return p(`https://${e.cognitoAuthDomain}/oauth2/authorize?${s}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(i.nonce)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(i.nonceHmac)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-pkce=${encodeURIComponent(i.pkce)}; ${e.cookieSettings.nonce}`]})}function A(r){const n=(0,e.randomBytes)(26).toString("hex"),o={pkce:n,pkceHash:t((0,e.createHash)("sha256").update(n,"utf8").digest("base64"))};return r.logger.debug("Generated PKCE verifier:",o),o}})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|
|
2
|
+
(()=>{var e={49(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsecuredJWT=void 0;const n=r(82),o=r(5821),i=r(6247),s=r(493),a=r(751);class c extends a.ProduceJWT{encode(){return`${n.encode(JSON.stringify({alg:"none"}))}.${n.encode(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new i.JWTInvalid("Unsecured JWT must be a string");const{0:r,1:a,2:c,length:u}=e.split(".");if(3!==u||""!==c)throw new i.JWTInvalid("Invalid Unsecured JWT");let l;try{if(l=JSON.parse(o.decoder.decode(n.decode(r))),"none"!==l.alg)throw new Error}catch{throw new i.JWTInvalid("Invalid Unsecured JWT")}return{payload:(0,s.default)(l,n.decode(a),t),header:l}}}t.UnsecuredJWT=c},68(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exportJWK=t.exportPKCS8=t.exportSPKI=void 0;const n=r(293),o=r(293),i=r(9590);t.exportSPKI=async function(e){return(0,n.toSPKI)(e)},t.exportPKCS8=async function(e){return(0,o.toPKCS8)(e)},t.exportJWK=async function(e){return(0,i.default)(e)}},82(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=t.encodeBase64=t.decodeBase64=void 0;const n=r(181),o=r(5821);let i;n.Buffer.isEncoding("base64url")?t.encode=i=e=>n.Buffer.from(e).toString("base64url"):t.encode=i=e=>n.Buffer.from(e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),t.decodeBase64=e=>n.Buffer.from(e,"base64"),t.encodeBase64=e=>n.Buffer.from(e).toString("base64"),t.decode=e=>n.Buffer.from(function(e){let t=e;return t instanceof Uint8Array&&(t=o.decoder.decode(t)),t}(e),"base64")},144(e,t,r){"use strict";const n=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},181(e){"use strict";e.exports=require("buffer")},257(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cryptoRuntime=t.base64url=t.generateSecret=t.generateKeyPair=t.errors=t.decodeJwt=t.decodeProtectedHeader=t.importJWK=t.importX509=t.importPKCS8=t.importSPKI=t.exportJWK=t.exportSPKI=t.exportPKCS8=t.UnsecuredJWT=t.createRemoteJWKSet=t.createLocalJWKSet=t.EmbeddedJWK=t.calculateJwkThumbprintUri=t.calculateJwkThumbprint=t.EncryptJWT=t.SignJWT=t.GeneralSign=t.FlattenedSign=t.CompactSign=t.FlattenedEncrypt=t.CompactEncrypt=t.jwtDecrypt=t.jwtVerify=t.generalVerify=t.flattenedVerify=t.compactVerify=t.GeneralEncrypt=t.generalDecrypt=t.flattenedDecrypt=t.compactDecrypt=void 0;var n=r(6923);Object.defineProperty(t,"compactDecrypt",{enumerable:!0,get:function(){return n.compactDecrypt}});var o=r(4533);Object.defineProperty(t,"flattenedDecrypt",{enumerable:!0,get:function(){return o.flattenedDecrypt}});var i=r(774);Object.defineProperty(t,"generalDecrypt",{enumerable:!0,get:function(){return i.generalDecrypt}});var s=r(782);Object.defineProperty(t,"GeneralEncrypt",{enumerable:!0,get:function(){return s.GeneralEncrypt}});var a=r(1427);Object.defineProperty(t,"compactVerify",{enumerable:!0,get:function(){return a.compactVerify}});var c=r(6833);Object.defineProperty(t,"flattenedVerify",{enumerable:!0,get:function(){return c.flattenedVerify}});var u=r(9060);Object.defineProperty(t,"generalVerify",{enumerable:!0,get:function(){return u.generalVerify}});var l=r(3082);Object.defineProperty(t,"jwtVerify",{enumerable:!0,get:function(){return l.jwtVerify}});var d=r(3814);Object.defineProperty(t,"jwtDecrypt",{enumerable:!0,get:function(){return d.jwtDecrypt}});var p=r(7815);Object.defineProperty(t,"CompactEncrypt",{enumerable:!0,get:function(){return p.CompactEncrypt}});var f=r(9805);Object.defineProperty(t,"FlattenedEncrypt",{enumerable:!0,get:function(){return f.FlattenedEncrypt}});var h=r(9851);Object.defineProperty(t,"CompactSign",{enumerable:!0,get:function(){return h.CompactSign}});var y=r(4329);Object.defineProperty(t,"FlattenedSign",{enumerable:!0,get:function(){return y.FlattenedSign}});var m=r(7440);Object.defineProperty(t,"GeneralSign",{enumerable:!0,get:function(){return m.GeneralSign}});var g=r(2230);Object.defineProperty(t,"SignJWT",{enumerable:!0,get:function(){return g.SignJWT}});var v=r(6638);Object.defineProperty(t,"EncryptJWT",{enumerable:!0,get:function(){return v.EncryptJWT}});var w=r(2599);Object.defineProperty(t,"calculateJwkThumbprint",{enumerable:!0,get:function(){return w.calculateJwkThumbprint}}),Object.defineProperty(t,"calculateJwkThumbprintUri",{enumerable:!0,get:function(){return w.calculateJwkThumbprintUri}});var E=r(278);Object.defineProperty(t,"EmbeddedJWK",{enumerable:!0,get:function(){return E.EmbeddedJWK}});var b=r(6980);Object.defineProperty(t,"createLocalJWKSet",{enumerable:!0,get:function(){return b.createLocalJWKSet}});var S=r(9877);Object.defineProperty(t,"createRemoteJWKSet",{enumerable:!0,get:function(){return S.createRemoteJWKSet}});var _=r(49);Object.defineProperty(t,"UnsecuredJWT",{enumerable:!0,get:function(){return _.UnsecuredJWT}});var A=r(68);Object.defineProperty(t,"exportPKCS8",{enumerable:!0,get:function(){return A.exportPKCS8}}),Object.defineProperty(t,"exportSPKI",{enumerable:!0,get:function(){return A.exportSPKI}}),Object.defineProperty(t,"exportJWK",{enumerable:!0,get:function(){return A.exportJWK}});var P=r(7364);Object.defineProperty(t,"importSPKI",{enumerable:!0,get:function(){return P.importSPKI}}),Object.defineProperty(t,"importPKCS8",{enumerable:!0,get:function(){return P.importPKCS8}}),Object.defineProperty(t,"importX509",{enumerable:!0,get:function(){return P.importX509}}),Object.defineProperty(t,"importJWK",{enumerable:!0,get:function(){return P.importJWK}});var I=r(4443);Object.defineProperty(t,"decodeProtectedHeader",{enumerable:!0,get:function(){return I.decodeProtectedHeader}});var O=r(8396);Object.defineProperty(t,"decodeJwt",{enumerable:!0,get:function(){return O.decodeJwt}}),t.errors=r(6247);var k=r(409);Object.defineProperty(t,"generateKeyPair",{enumerable:!0,get:function(){return k.generateKeyPair}});var C=r(4121);Object.defineProperty(t,"generateSecret",{enumerable:!0,get:function(){return C.generateSecret}}),t.base64url=r(8462);var T=r(4166);Object.defineProperty(t,"cryptoRuntime",{enumerable:!0,get:function(){return T.default}})},270(e,t,r){"use strict";const n=r(3908),o=r(8311);e.exports=(e,t,r)=>{let i=null,s=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(i&&1!==s.compare(e)||(i=e,s=new n(i,r)))}),i}},278(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmbeddedJWK=void 0;const n=r(7364),o=r(1855),i=r(6247);t.EmbeddedJWK=async function(e,t){const r={...e,...null==t?void 0:t.header};if(!(0,o.default)(r.jwk))throw new i.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const s=await(0,n.importJWK)({...r.jwk,ext:!0},r.alg,!0);if(s instanceof Uint8Array||"public"!==s.type)throw new i.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a public key');return s}},293(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromX509=t.fromSPKI=t.fromPKCS8=t.toPKCS8=t.toSPKI=void 0;const n=r(6982),o=r(181),i=r(8993),s=r(4512),a=r(8737),c=r(740),u=(e,t,r)=>{let o;if((0,i.isCryptoKey)(r)){if(!r.extractable)throw new TypeError("CryptoKey is not extractable");o=n.KeyObject.from(r)}else{if(!(0,s.default)(r))throw new TypeError((0,a.default)(r,...c.types));o=r}if(o.type!==e)throw new TypeError(`key is not a ${e} key`);return o.export({format:"pem",type:t})};t.toSPKI=e=>u("public","spki",e),t.toPKCS8=e=>u("private","pkcs8",e),t.fromPKCS8=e=>(0,n.createPrivateKey)({key:o.Buffer.from(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,""),"base64"),type:"pkcs8",format:"der"}),t.fromSPKI=e=>(0,n.createPublicKey)({key:o.Buffer.from(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,""),"base64"),type:"spki",format:"der"}),t.fromX509=e=>(0,n.createPublicKey)({key:e,type:"spki",format:"pem"})},349(e,t,r){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,o=arguments.length;r<o;r++)t.push(arguments[r]);return t}function o(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function i(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,o=this.head;null!==o;)r.push(e.call(t,o.value,this)),o=o.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,o=this.tail;null!==o;)r.push(e.call(t,o.value,this)),o=o.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var o=0;null!==n;o++)r=e(r,n.value,o),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var o=this.length-1;null!==n;o--)r=e(r,n.value,o),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,i=this.head;null!==i&&o<e;o++)i=i.next;for(;null!==i&&o<t;o++,i=i.next)r.push(i.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,i=this.tail;null!==i&&o>t;o--)i=i.prev;for(;null!==i&&o>e;o--,i=i.prev)r.push(i.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var s=[];for(n=0;i&&n<t;n++)s.push(i.value),i=this.removeNode(i);for(null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev),n=0;n<r.length;n++)i=o(this,i,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(9669)(n)}catch(e){}},409(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=void 0;const n=r(7975);t.generateKeyPair=async function(e,t){return(0,n.generateKeyPair)(e,t)}},493(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247),o=r(5821),i=r(936),s=r(9743),a=r(1855),c=e=>e.toLowerCase().replace(/^application\//,"");t.default=(e,t,r={})=>{const{typ:u}=r;if(u&&("string"!=typeof e.typ||c(e.typ)!==c(u)))throw new n.JWTClaimValidationFailed('unexpected "typ" JWT header value',"typ","check_failed");let l;try{l=JSON.parse(o.decoder.decode(t))}catch{}if(!(0,a.default)(l))throw new n.JWTInvalid("JWT Claims Set must be a top-level JSON object");const{requiredClaims:d=[],issuer:p,subject:f,audience:h,maxTokenAge:y}=r;void 0!==y&&d.push("iat"),void 0!==h&&d.push("aud"),void 0!==f&&d.push("sub"),void 0!==p&&d.push("iss");for(const e of new Set(d.reverse()))if(!(e in l))throw new n.JWTClaimValidationFailed(`missing required "${e}" claim`,e,"missing");if(p&&!(Array.isArray(p)?p:[p]).includes(l.iss))throw new n.JWTClaimValidationFailed('unexpected "iss" claim value',"iss","check_failed");if(f&&l.sub!==f)throw new n.JWTClaimValidationFailed('unexpected "sub" claim value',"sub","check_failed");if(h&&(g="string"==typeof h?[h]:h,!("string"==typeof(m=l.aud)?g.includes(m):Array.isArray(m)&&g.some(Set.prototype.has.bind(new Set(m))))))throw new n.JWTClaimValidationFailed('unexpected "aud" claim value',"aud","check_failed");var m,g;let v;switch(typeof r.clockTolerance){case"string":v=(0,s.default)(r.clockTolerance);break;case"number":v=r.clockTolerance;break;case"undefined":v=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:w}=r,E=(0,i.default)(w||new Date);if((void 0!==l.iat||y)&&"number"!=typeof l.iat)throw new n.JWTClaimValidationFailed('"iat" claim must be a number',"iat","invalid");if(void 0!==l.nbf){if("number"!=typeof l.nbf)throw new n.JWTClaimValidationFailed('"nbf" claim must be a number',"nbf","invalid");if(l.nbf>E+v)throw new n.JWTClaimValidationFailed('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==l.exp){if("number"!=typeof l.exp)throw new n.JWTClaimValidationFailed('"exp" claim must be a number',"exp","invalid");if(l.exp<=E-v)throw new n.JWTExpired('"exp" claim timestamp check failed',"exp","check_failed")}if(y){const e=E-l.iat;if(e-v>("number"==typeof y?y:(0,s.default)(y)))throw new n.JWTExpired('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-v)throw new n.JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return l}},508(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2395),o=r(6112),i=r(5904),s=r(3020),a=r(82),c=r(1784),u=r(6247),l=r(68),d=r(1688),p=r(7031);t.default=async function(e,t,r,f,h={}){let y,m,g;switch((0,d.default)(e,r,"encrypt"),e){case"dir":g=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!o.ecdhAllowed(r))throw new u.JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:i,apv:s}=h;let{epk:d}=h;d||(d=(await o.generateEpk(r)).privateKey);const{x:p,y:v,crv:w,kty:E}=await(0,l.exportJWK)(d),b=await o.deriveKey(r,d,"ECDH-ES"===e?t:e,"ECDH-ES"===e?(0,c.bitLength)(t):parseInt(e.slice(-5,-2),10),i,s);if(m={epk:{x:p,crv:w,kty:E}},"EC"===E&&(m.epk.y=v),i&&(m.apu=(0,a.encode)(i)),s&&(m.apv=(0,a.encode)(s)),"ECDH-ES"===e){g=b;break}g=f||(0,c.default)(t);const S=e.slice(-6);y=await(0,n.wrap)(S,b,g);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":g=f||(0,c.default)(t),y=await(0,s.encrypt)(e,r,g);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{g=f||(0,c.default)(t);const{p2c:n,p2s:o}=h;({encryptedKey:y,...m}=await(0,i.encrypt)(e,r,g,n,o));break}case"A128KW":case"A192KW":case"A256KW":g=f||(0,c.default)(t),y=await(0,n.wrap)(e,r,g);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{g=f||(0,c.default)(t);const{iv:n}=h;({encryptedKey:y,...m}=await(0,p.wrap)(e,r,g,n));break}default:throw new u.JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:g,encryptedKey:y,parameters:m}}},560(e,t,r){"use strict";const n=r(3908);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},736(e,t,r){e.exports=function(e){function t(e){let r,o,i,s=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),i=o-(r||o);n.diff=i,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];r=i.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function o(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(o(e,r))return!1;for(const r of t.names)if(o(e,r))return!0;return!1},t.humanize=r(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},740(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.types=void 0;const n=r(8993),o=r(4512);t.default=e=>(0,o.default)(e)||(0,n.isCryptoKey)(e);const i=["KeyObject"];t.types=i,(globalThis.CryptoKey||(null===n.default||void 0===n.default?void 0:n.default.CryptoKey))&&i.push("CryptoKey")},751(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProduceJWT=void 0;const n=r(936),o=r(1855),i=r(9743);t.ProduceJWT=class{constructor(e){if(!(0,o.default)(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:(0,n.default)(new Date)+(0,i.default)(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:(0,n.default)(new Date)+(0,i.default)(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:(0,n.default)(new Date)}:{...this._payload,iat:e},this}}},774(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalDecrypt=void 0;const n=r(4533),o=r(6247),i=r(1855);t.generalDecrypt=async function(e,t,r){if(!(0,i.default)(e))throw new o.JWEInvalid("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(i.default))throw new o.JWEInvalid("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new o.JWEInvalid("JWE Recipients has no members");for(const o of e.recipients)try{return await(0,n.flattenedDecrypt)({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:o.encrypted_key,header:o.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,r)}catch{}throw new o.JWEDecryptionFailed}},782(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralEncrypt=void 0;const n=r(9805),o=r(6247),i=r(1784),s=r(9476),a=r(508),c=r(82),u=r(2458);class l{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}t.GeneralEncrypt=class{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const r=new l(this,e,{crit:null==t?void 0:t.crit});return this._recipients.push(r),r}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(e){var t,r,l;if(!this._recipients.length)throw new o.JWEInvalid("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){const[t]=this._recipients,r=await new n.FlattenedEncrypt(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e});let o={ciphertext:r.ciphertext,iv:r.iv,recipients:[{}],tag:r.tag};return r.aad&&(o.aad=r.aad),r.protected&&(o.protected=r.protected),r.unprotected&&(o.unprotected=r.unprotected),r.encrypted_key&&(o.recipients[0].encrypted_key=r.encrypted_key),r.header&&(o.recipients[0].header=r.header),o}let d;for(let e=0;e<this._recipients.length;e++){const t=this._recipients[e];if(!(0,s.default)(this._protectedHeader,this._unprotectedHeader,t.unprotectedHeader))throw new o.JWEInvalid("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...t.unprotectedHeader},{alg:n}=r;if("string"!=typeof n||!n)throw new o.JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===n||"ECDH-ES"===n)throw new o.JWEInvalid('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof r.enc||!r.enc)throw new o.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(d){if(d!==r.enc)throw new o.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else d=r.enc;if((0,u.default)(o.JWEInvalid,new Map,t.options.crit,this._protectedHeader,r),!(void 0===r.zip||this._protectedHeader&&this._protectedHeader.zip))throw new o.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const p=(0,i.default)(d);let f={ciphertext:"",iv:"",recipients:[],tag:""};for(let o=0;o<this._recipients.length;o++){const i=this._recipients[o],s={};f.recipients.push(s);const u={...this._protectedHeader,...this._unprotectedHeader,...i.unprotectedHeader}.alg.startsWith("PBES2")?2048+o:void 0;if(0===o){const t=await new n.FlattenedEncrypt(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(p).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(i.unprotectedHeader).setKeyManagementParameters({p2c:u}).encrypt(i.key,{...i.options,...e,[n.unprotected]:!0});f.ciphertext=t.ciphertext,f.iv=t.iv,f.tag=t.tag,t.aad&&(f.aad=t.aad),t.protected&&(f.protected=t.protected),t.unprotected&&(f.unprotected=t.unprotected),s.encrypted_key=t.encrypted_key,t.header&&(s.header=t.header);continue}const{encryptedKey:h,parameters:y}=await(0,a.default)((null===(t=i.unprotectedHeader)||void 0===t?void 0:t.alg)||(null===(r=this._protectedHeader)||void 0===r?void 0:r.alg)||(null===(l=this._unprotectedHeader)||void 0===l?void 0:l.alg),d,i.key,p,{p2c:u});s.encrypted_key=(0,c.encode)(h),(i.unprotectedHeader||y)&&(s.header={...i.unprotectedHeader,...y})}return f}}},855(e,t,r){var n=r(6585);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var o=n(e);if(void 0===o)return;return Math.floor(r+o/1e3)}return"number"==typeof e?r+e:void 0}},857(e){"use strict";e.exports=require("os")},909(e,t,r){"use strict";const n=r(3908);e.exports=(e,t,r)=>{const o=new n(e,r),i=new n(t,r);return o.compare(i)||o.compareBuild(i)}},927(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(6982);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.randomFillSync}})},936(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>Math.floor(e.getTime()/1e3)},947(e){function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="ArgumentError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},1045(e,t,r){"use strict";var n=r(181).Buffer,o=r(181).SlowBuffer;function i(e,t){if(!n.isBuffer(e)||!n.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(var r=0,o=0;o<e.length;o++)r|=e[o]^t[o];return 0===r}e.exports=i,i.install=function(){n.prototype.equal=o.prototype.equal=function(e){return i(this,e)}};var s=n.prototype.equal,a=o.prototype.equal;i.restore=function(){n.prototype.equal=s,o.prototype.equal=a}},1123(e){"use strict";const t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;const n=t.test(e),o=t.test(r);return n&&o&&(e=+e,r=+r),e===r?0:n&&!o?-1:o&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},1146(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247),o=r(7974);t.default=(e,t)=>{if(t.length<<3!==(0,o.bitLength)(e))throw new n.JWEInvalid("Invalid Initialization Vector length")}},1161(e){function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},1185(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwkImport=t.jwkExport=t.rsaPssParams=t.oneShotCallback=void 0;const[r,n]=process.versions.node.split(".").map(e=>parseInt(e,10));t.oneShotCallback=r>=16||15===r&&n>=13,t.rsaPssParams=!("electron"in process.versions)&&(r>=17||16===r&&n>=9),t.jwkExport=r>=16||15===r&&n>=9,t.jwkImport=r>=16||15===r&&n>=12},1261(e,t,r){"use strict";const n=r(3908),o=r(8311),i=r(5580);e.exports=(e,t)=>{e=new o(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const o=e.set[t];let s=null;o.forEach(e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!i(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!s||r&&!i(r,s)||(r=s)}return r&&e.test(r)?r:null}},1326(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){if(48!==e[0])throw new TypeError;if(this.buffer=e,this.offset=1,this.decodeLength()!==e.length-this.offset)throw new TypeError}decodeLength(){let e=this.buffer[this.offset++];if(128&e){const t=-129&e;e=0;for(let r=0;r<t;r++)e=e<<8|this.buffer[this.offset+r];this.offset+=t}return e}unsignedInteger(){if(2!==this.buffer[this.offset++])throw new TypeError;let e=this.decodeLength();0===this.buffer[this.offset]&&(this.offset++,e--);const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}end(){if(this.offset!==this.buffer.length)throw new TypeError}}},1389(e,t,r){const n=r(5753)("jwks"),o=r(8639),{promisify:i,callbackify:s}=r(9023);e.exports.A=function(e,{cacheMaxEntries:t=5,cacheMaxAge:r=6e5}){return n(`Configured caching of signing keys. Max: ${t} / Age: ${r}`),i(o({hash:e=>e,load:s(e.getSigningKey.bind(e)),maxAge:r,max:t}))}},1427(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactVerify=void 0;const n=r(6833),o=r(6247),i=r(5821);t.compactVerify=async function(e,t,r){if(e instanceof Uint8Array&&(e=i.decoder.decode(e)),"string"!=typeof e)throw new o.JWSInvalid("Compact JWS must be a string or Uint8Array");const{0:s,1:a,2:c,length:u}=e.split(".");if(3!==u)throw new o.JWSInvalid("Invalid Compact JWS");const l=await(0,n.flattenedVerify)({payload:a,protected:s,signature:c},t,r),d={payload:l.payload,protectedHeader:l.protectedHeader};return"function"==typeof t?{...d,key:l.key}:d}},1603(e,t,r){"use strict";const n=r(349),o=Symbol("max"),i=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),d=Symbol("lruList"),p=Symbol("cache"),f=Symbol("updateAgeOnGet"),h=()=>1,y=(e,t,r)=>{const n=e[p].get(t);if(n){const t=n.value;if(m(e,t)){if(v(e,n),!e[a])return}else r&&(e[f]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},g=e=>{if(e[i]>e[o])for(let t=e[d].tail;e[i]>e[o]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[i]-=r.length,e[p].delete(r.key),e[d].removeNode(t)}};class w{constructor(e,t,r,n,o){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=o||0}}const E=(e,t,r,n)=>{let o=r.value;m(e,o)&&(v(e,r),e[a]||(o=void 0)),o&&t.call(n,o.value,o.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||h;if(this[s]="function"!=typeof t?h:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,g(this)}get max(){return this[o]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,g(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[s]&&(this[s]=e,this[i]=0,this[d].forEach(e=>{e.length=this[s](e.value,e.key),this[i]+=e.length})),g(this)}get lengthCalculator(){return this[s]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){const n=r.prev;E(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){const n=r.next;E(this,e,r,t),r=n}}keys(){return this[d].toArray().map(e=>e.key)}values(){return this[d].toArray().map(e=>e.value)}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach(e=>this[u](e.key,e.value)),this[p]=new Map,this[d]=new n,this[i]=0}dump(){return this[d].map(e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[d]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[p].has(e)){if(a>this[o])return v(this,this[p].get(e)),!1;const s=this[p].get(e).value;return this[u]&&(this[l]||this[u](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[i]+=a-s.length,s.length=a,this.get(e),g(this),!0}const f=new w(e,t,a,n,r);return f.length>this[o]?(this[u]&&this[u](e,t),!1):(this[i]+=f.length,this[d].unshift(f),this[p].set(e,this[d].head),g(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!m(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],o=n.e||0;if(0===o)this.set(n.k,n.v);else{const e=o-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[p].forEach((e,t)=>y(this,t,!1))}}},1688(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8737),o=r(740);t.default=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!(0,o.default)(t))throw new TypeError((0,n.withAlg)(e,t,...o.types,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${o.types.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!(0,o.default)(t))throw new TypeError((0,n.withAlg)(e,t,...o.types));if("secret"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${o.types.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)}},1691(e,t,r){const n=r(1741),o=r(3726),i=r(8980),s=r(7260),a=r(855),c=r(7019),u=r(4977),l=r(5747),{KeyObject:d,createSecretKey:p,createPublicKey:f}=r(6982),h=["RS256","RS384","RS512"],y=["ES256","ES384","ES512"],m=["RS256","RS384","RS512"],g=["HS256","HS384","HS512"];u&&(h.splice(h.length,0,"PS256","PS384","PS512"),m.splice(m.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,u){let v;if("function"!=typeof r||u||(u=r,r={}),r||(r={}),r=Object.assign({},r),v=u||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new n("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new n("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new n("allowInvalidAsymmetricKeyTypes must be a boolean"));const w=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new n("jwt must be provided"));if("string"!=typeof e)return v(new n("jwt must be a string"));const E=e.split(".");if(3!==E.length)return v(new n("jwt malformed"));let b;try{b=s(e,{complete:!0})}catch(e){return v(e)}if(!b)return v(new n("invalid token"));const S=b.header;let _;if("function"==typeof t){if(!u)return v(new n("verify must be called asynchronous if secret or public key is provided as a callback"));_=t}else _=function(e,r){return r(null,t)};return _(S,function(t,s){if(t)return v(new n("error in secret or public key callback: "+t.message));const u=""!==E[2].trim();if(!u&&s)return v(new n("jwt signature is required"));if(u&&!s)return v(new n("secret or public key must be provided"));if(!u&&!r.algorithms)return v(new n('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof d))try{s=f(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new n("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=g:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=m:"ec"===s.asymmetricKeyType?r.algorithms=y:r.algorithms=h),-1===r.algorithms.indexOf(b.header.alg))return v(new n("invalid algorithm"));if(S.alg.startsWith("HS")&&"secret"!==s.type)return v(new n(`secretOrPublicKey must be a symmetric key when using ${S.alg}`));if(/^(?:RS|PS|ES)/.test(S.alg)&&"public"!==s.type)return v(new n(`secretOrPublicKey must be an asymmetric key when using ${S.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{c(S.alg,s)}catch(e){return v(e)}let _;try{_=l.verify(e,b.header.alg,s)}catch(e){return v(e)}if(!_)return v(new n("invalid signature"));const A=b.payload;if(void 0!==A.nbf&&!r.ignoreNotBefore){if("number"!=typeof A.nbf)return v(new n("invalid nbf value"));if(A.nbf>w+(r.clockTolerance||0))return v(new o("jwt not active",new Date(1e3*A.nbf)))}if(void 0!==A.exp&&!r.ignoreExpiration){if("number"!=typeof A.exp)return v(new n("invalid exp value"));if(w>=A.exp+(r.clockTolerance||0))return v(new i("jwt expired",new Date(1e3*A.exp)))}if(r.audience){const e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new n("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&A.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(A.iss)))return v(new n("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return v(new n("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return v(new n("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return v(new n("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof A.iat)return v(new n("iat required when maxAge is specified"));const e=a(r.maxAge,A.iat);if(void 0===e)return v(new n('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(w>=e+(r.clockTolerance||0))return v(new i("maxAge exceeded",new Date(1e3*e)))}if(!0===r.complete){const e=b.signature;return v(null,{header:S,payload:A,signature:e})}return v(null,A)})}},1729(e,t,r){"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},1741(e){var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};(t.prototype=Object.create(Error.prototype)).constructor=t,e.exports=t},1763(e,t,r){"use strict";const n=r(560);e.exports=(e,t)=>n(e,t,!0)},1784(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitLength=void 0;const n=r(6247),o=r(927);function i(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new n.JOSENotSupported(`Unsupported JWE Algorithm: ${e}`)}}t.bitLength=i,t.default=e=>(0,o.default)(new Uint8Array(i(e)>>3))},1832(e,t,r){"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e,null,!0),o=n(t,null,!0),i=r.compare(o);if(0===i)return null;const s=i>0,a=s?r:o,c=s?o:r,u=!!a.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const l=u?"pre":"";return r.major!==o.major?l+"major":r.minor!==o.minor?l+"minor":r.patch!==o.patch?l+"patch":"prerelease"}},1855(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}},1977(e,t,r){const n=r(9589);e.exports=n.satisfies(process.version,">=15.7.0")},2010(e,t,r){"use strict";var n=r(2861).Buffer,o=r(3527);function i(e){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=128&&--n,n}e.exports={derToJose:function(e,t){e=i(e);var r=o(t),s=r+1,a=e.length,c=0;if(48!==e[c++])throw new Error('Could not find expected "seq"');var u=e[c++];if(129===u&&(u=e[c++]),a-c<u)throw new Error('"seq" specified length of "'+u+'", only "'+(a-c)+'" remaining');if(2!==e[c++])throw new Error('Could not find expected "int" for "r"');var l=e[c++];if(a-c-2<l)throw new Error('"r" specified length of "'+l+'", only "'+(a-c-2)+'" available');if(s<l)throw new Error('"r" specified length of "'+l+'", max of "'+s+'" is acceptable');var d=c;if(c+=l,2!==e[c++])throw new Error('Could not find expected "int" for "s"');var p=e[c++];if(a-c!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(a-c)+'"');if(s<p)throw new Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var f=c;if((c+=p)!==a)throw new Error('Expected to consume entire buffer, but "'+(a-c)+'" bytes remain');var h=r-l,y=r-p,m=n.allocUnsafe(h+l+y+p);for(c=0;c<h;++c)m[c]=0;e.copy(m,c,d+Math.max(-h,0),d+l);for(var g=c=r;c<g+y;++c)m[c]=0;return e.copy(m,c,f+Math.max(-y,0),f+p),(m=m.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=i(e);var r=o(t),a=e.length;if(a!==2*r)throw new TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+a+'"');var c=s(e,0,r),u=s(e,r,e.length),l=r-c,d=r-u,p=2+l+1+1+d,f=p<128,h=n.allocUnsafe((f?2:3)+p),y=0;return h[y++]=48,f?h[y++]=p:(h[y++]=129,h[y++]=255&p),h[y++]=2,h[y++]=l,c<0?(h[y++]=0,y+=e.copy(h,y,0,r)):y+=e.copy(h,y,c,r),h[y++]=2,h[y++]=d,u<0?(h[y++]=0,e.copy(h,y,r)):e.copy(h,y,r+u),h}}},2018(e){"use strict";e.exports=require("tty")},2027(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(1146),i=r(2319),s=r(5821),a=r(4803),c=r(8993),u=r(2484),l=r(4512),d=r(8737),p=r(6247),f=r(3022),h=r(740);t.default=(e,t,r,y,m)=>{let g;if((0,c.isCryptoKey)(r))(0,u.checkEncCryptoKey)(r,e,"encrypt"),g=n.KeyObject.from(r);else{if(!(r instanceof Uint8Array||(0,l.default)(r)))throw new TypeError((0,d.default)(r,...h.types,"Uint8Array"));g=r}switch((0,i.default)(e,g),(0,o.default)(e,y),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return function(e,t,r,o,i){const c=parseInt(e.slice(1,4),10);(0,l.default)(r)&&(r=r.export());const u=r.subarray(c>>3),d=r.subarray(0,c>>3),h=`aes-${c}-cbc`;if(!(0,f.default)(h))throw new p.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);const y=(0,n.createCipheriv)(h,u,o),m=(0,s.concat)(y.update(t),y.final()),g=parseInt(e.slice(-3),10);return{ciphertext:m,tag:(0,a.default)(i,o,m,g,d,c)}}(e,t,g,y,m);case"A128GCM":case"A192GCM":case"A256GCM":return function(e,t,r,o,i){const s=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!(0,f.default)(s))throw new p.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);const a=(0,n.createCipheriv)(s,r,o,{authTagLength:16});i.byteLength&&a.setAAD(i,{plaintextLength:t.length});const c=a.update(t);return a.final(),{ciphertext:c,tag:a.getAuthTag()}}(e,t,g,y,m);default:throw new p.JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}}},2111(e,t,r){"use strict";const n=r(4641),o=r(3999),i=r(5580),s=r(4089),a=r(7059),c=r(5200);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return o(e,r,u);case">":return i(e,r,u);case">=":return s(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},2167(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982).timingSafeEqual;t.default=n},2203(e){"use strict";e.exports=require("stream")},2230(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignJWT=void 0;const n=r(9851),o=r(6247),i=r(5821),s=r(751);class a extends s.ProduceJWT{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var r;const s=new n.CompactSign(i.encoder.encode(JSON.stringify(this._payload)));if(s.setProtectedHeader(this._protectedHeader),Array.isArray(null===(r=this._protectedHeader)||void 0===r?void 0:r.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new o.JWTInvalid("JWTs MUST NOT use unencoded payload");return s.sign(e,t)}}t.SignJWT=a},2319(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247),o=r(4512);t.default=(e,t)=>{let r;switch(e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":r=parseInt(e.slice(-3),10);break;case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10);break;default:throw new n.JOSENotSupported(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){const e=t.byteLength<<3;if(e!==r)throw new n.JWEInvalid(`Invalid Content Encryption Key length. Expected ${r} bits, got ${e} bits`);return}if((0,o.default)(t)&&"secret"===t.type){const e=t.symmetricKeySize<<3;if(e!==r)throw new n.JWEInvalid(`Invalid Content Encryption Key length. Expected ${r} bits, got ${e} bits`);return}throw new TypeError("Invalid Content Encryption Key type")}},2395(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=t.wrap=void 0;const n=r(181),o=r(6982),i=r(6247),s=r(5821),a=r(8993),c=r(2484),u=r(4512),l=r(8737),d=r(3022),p=r(740);function f(e,t){if(e.symmetricKeySize<<3!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function h(e,t,r){if((0,u.default)(e))return e;if(e instanceof Uint8Array)return(0,o.createSecretKey)(e);if((0,a.isCryptoKey)(e))return(0,c.checkEncCryptoKey)(e,t,r),o.KeyObject.from(e);throw new TypeError((0,l.default)(e,...p.types,"Uint8Array"))}t.wrap=(e,t,r)=>{const a=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!(0,d.default)(a))throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`);const c=h(t,e,"wrapKey");f(c,e);const u=(0,o.createCipheriv)(a,c,n.Buffer.alloc(8,166));return(0,s.concat)(u.update(r),u.final())},t.unwrap=(e,t,r)=>{const a=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!(0,d.default)(a))throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`);const c=h(t,e,"unwrapKey");f(c,e);const u=(0,o.createDecipheriv)(a,c,n.Buffer.alloc(8,166));return(0,s.concat)(u.update(r),u.final())}},2458(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e,t,r,o,i){if(void 0!==i.crit&&void 0===o.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;s=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of o.crit){if(!s.has(t))throw new n.JOSENotSupported(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(s.get(t)&&void 0===o[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(o.crit)}},2484(e,t){"use strict";function r(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function n(e,t){return e.name===t}function o(e){return parseInt(e.name.slice(4),10)}function i(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkEncCryptoKey=t.checkSigCryptoKey=void 0,t.checkSigCryptoKey=function(e,t,...s){switch(t){case"HS256":case"HS384":case"HS512":{if(!n(e.algorithm,"HMAC"))throw r("HMAC");const i=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!n(e.algorithm,"RSASSA-PKCS1-v1_5"))throw r("RSASSA-PKCS1-v1_5");const i=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!n(e.algorithm,"RSA-PSS"))throw r("RSA-PSS");const i=parseInt(t.slice(2),10);if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw r("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!n(e.algorithm,"ECDSA"))throw r("ECDSA");const o=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==o)throw r(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}i(e,s)},t.checkEncCryptoKey=function(e,t,...s){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!n(e.algorithm,"AES-GCM"))throw r("AES-GCM");const o=parseInt(t.slice(1,4),10);if(e.algorithm.length!==o)throw r(o,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!n(e.algorithm,"AES-KW"))throw r("AES-KW");const o=parseInt(t.slice(1,4),10);if(e.algorithm.length!==o)throw r(o,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw r("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!n(e.algorithm,"PBKDF2"))throw r("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!n(e.algorithm,"RSA-OAEP"))throw r("RSA-OAEP");const i=parseInt(t.slice(9),10)||1;if(o(e.algorithm.hash)!==i)throw r(`SHA-${i}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}i(e,s)}},2525(e,t,r){"use strict";const n=r(7638),o=r(560);e.exports=(e,t,r)=>{const i=[];let s=null,a=null;const c=e.sort((e,t)=>o(e,t,r));for(const e of c)n(e,t,r)?(a=e,s||(s=e)):(a&&i.push([s,a]),a=null,s=null);s&&i.push([s,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return l.length<d.length?l:t}},2599(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateJwkThumbprintUri=t.calculateJwkThumbprint=void 0;const n=r(6332),o=r(82),i=r(6247),s=r(5821),a=r(1855),c=(e,t)=>{if("string"!=typeof e||!e)throw new i.JWKInvalid(`${t} missing or invalid`)};async function u(e,t){if(!(0,a.default)(e))throw new TypeError("JWK must be an object");if(null!=t||(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let r;switch(e.kty){case"EC":c(e.crv,'"crv" (Curve) Parameter'),c(e.x,'"x" (X Coordinate) Parameter'),c(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":c(e.crv,'"crv" (Subtype of Key Pair) Parameter'),c(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":c(e.e,'"e" (Exponent) Parameter'),c(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":c(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new i.JOSENotSupported('"kty" (Key Type) Parameter missing or unsupported')}const u=s.encoder.encode(JSON.stringify(r));return(0,o.encode)(await(0,n.default)(t,u))}t.calculateJwkThumbprint=u,t.calculateJwkThumbprintUri=async function(e,t){null!=t||(t="sha256");const r=await u(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}},2813(e){function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="SigningKeyNotFoundError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},2851(e,t,r){var n=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||n.isBuffer(e)?e.toString():JSON.stringify(e)}},2861(e,t,r){var n=r(181),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},2912(e,t,r){const n=r(4263).retrieveSigningKeys;e.exports.A=function(e,{getKeysInterceptor:t}){const r=e.getSigningKey.bind(e);return async e=>{const o=await t();let i;if(o&&o.length&&(i=await n(o)),i&&i.length){const t=i.find(t=>!e||t.kid===e);if(t)return t}return r(e)}}},2938(e,t,r){"use strict";const n=r(3908);e.exports=(e,t)=>new n(e,t).major},3007(e,t,r){"use strict";const n=r(3908);e.exports=(e,t,r,o,i)=>{"string"==typeof r&&(i=o,o=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,o,i).version}catch(e){return null}}},3020(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;const n=r(6982),o=r(5363),i=r(8993),s=r(2484),a=r(4512),c=r(8737),u=r(740),l=(e,t)=>{if("rsa"!==e.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");(0,o.default)(e,t)},d=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return n.constants.RSA_PKCS1_OAEP_PADDING;case"RSA1_5":return n.constants.RSA_PKCS1_PADDING;default:return}},p=e=>{switch(e){case"RSA-OAEP":return"sha1";case"RSA-OAEP-256":return"sha256";case"RSA-OAEP-384":return"sha384";case"RSA-OAEP-512":return"sha512";default:return}};function f(e,t,...r){if((0,a.default)(e))return e;if((0,i.isCryptoKey)(e))return(0,s.checkEncCryptoKey)(e,t,...r),n.KeyObject.from(e);throw new TypeError((0,c.default)(e,...u.types))}t.encrypt=(e,t,r)=>{const o=d(e),i=p(e),s=f(t,e,"wrapKey","encrypt");return l(s,e),(0,n.publicEncrypt)({key:s,oaepHash:i,padding:o},r)},t.decrypt=(e,t,r)=>{const o=d(e),i=p(e),s=f(t,e,"unwrapKey","decrypt");return l(s,e),(0,n.privateDecrypt)({key:s,oaepHash:i,padding:o},r)}},3022(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982);let o;t.default=e=>(o||(o=new Set((0,n.getCiphers)())),o.has(e))},3065(e,t,r){var n=r(5472),o=r(3085),i=function(e,t,r){this.tokenBucket=new n(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=o(),this.tokensThisInterval=0,this.fireImmediately=r};i.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,n=o();if((n<this.curIntervalStart||n-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=n,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)process.nextTick(t.bind(null,null,-1));else{var i=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-n);setTimeout(function(){r.tokenBucket.removeTokens(e,s)},i)}return!1}return this.tokenBucket.removeTokens(e,s);function s(n,o){if(n)return t(n,null);r.tokensThisInterval+=e,t(null,o)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=o();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var r=this.tokenBucket.tryRemoveTokens(e);return r&&(this.tokensThisInterval+=e),r},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},e.exports=i},3082(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtVerify=void 0;const n=r(1427),o=r(493),i=r(6247);t.jwtVerify=async function(e,t,r){var s;const a=await(0,n.compactVerify)(e,t,r);if((null===(s=a.protectedHeader.crit)||void 0===s?void 0:s.includes("b64"))&&!1===a.protectedHeader.b64)throw new i.JWTInvalid("JWTs MUST NOT use unencoded payload");const c={payload:(0,o.default)(a.protectedHeader,a.payload,r),protectedHeader:a.protectedHeader};return"function"==typeof t?{...c,key:a.key}:c}},3085(e){e.exports=function(){if("undefined"!=typeof process&&process.hrtime){var e=process.hrtime(),t=e[0],r=e[1];return 1e3*t+Math.floor(r/1e6)}return(new Date).getTime()}},3106(e){"use strict";e.exports=require("zlib")},3110(e,t,r){const n=r(5753)("jwks"),{retrieveSigningKeys:o}=r(4263),{request:i,cacheSigningKey:s,rateLimitSigningKey:a,getKeysInterceptor:c,callbackSupport:u}=r(3171),l=r(1161),d=r(2813);e.exports={JwksClient:class{constructor(e){this.options={rateLimit:!1,cache:!0,timeout:3e4,...e},this.options.getKeysInterceptor&&(this.getSigningKey=c(this,e)),this.options.rateLimit&&(this.getSigningKey=a(this,e)),this.options.cache&&(this.getSigningKey=s(this,e)),this.getSigningKey=u(this,e)}async getKeys(){n(`Fetching keys from '${this.options.jwksUri}'`);try{const e=await i({uri:this.options.jwksUri,headers:this.options.requestHeaders,agent:this.options.requestAgent,timeout:this.options.timeout,fetcher:this.options.fetcher});return n("Keys:",e.keys),e.keys}catch(e){const{errorMsg:t}=e;throw n("Failure:",t||e),t?new l(t):e}}async getSigningKeys(){const e=await this.getKeys();if(!e||!e.length)throw new l("The JWKS endpoint did not contain any keys");const t=await o(e);if(!t.length)throw new l("The JWKS endpoint did not contain any signing keys");return n("Signing Keys:",t),t}async getSigningKey(e){n(`Fetching signing key for '${e}'`);const t=await this.getSigningKeys(),r=null!=e;if(!r&&t.length>1)throw n("No KID specified and JWKS endpoint returned more than 1 key"),new d("No KID specified and JWKS endpoint returned more than 1 key");const o=t.find(t=>!r||t.kid===e);if(o)return o;throw n(`Unable to find a signing key that matches '${e}'`),new d(`Unable to find a signing key that matches '${e}'`)}}}},3117(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(9023),i=r(5945),s=r(7980),a=r(7965),c=r(5206),u=r(1185);let l;l=n.verify.length>4&&u.oneShotCallback?(0,o.promisify)(n.verify):n.verify,t.default=async(e,t,r,o)=>{const u=(0,c.default)(e,t,"verify");if(e.startsWith("HS")){const t=await(0,a.default)(e,u,o),i=r;try{return n.timingSafeEqual(i,t)}catch{return!1}}const d=(0,i.default)(e),p=(0,s.default)(e,u);try{return await l(d,o,p,r)}catch{return!1}}},3171(e,t,r){e.exports={request:r(3858).A,cacheSigningKey:r(1389).A,rateLimitSigningKey:r(8730).A,getKeysInterceptor:r(2912).A,callbackSupport:r(6545).A}},3254(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e){switch(e){case"HS256":return"sha256";case"HS384":return"sha384";case"HS512":return"sha512";default:throw new n.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},3387(e,t,r){var n=r(2861).Buffer,o=r(8948),i=r(8789),s=r(2203),a=r(2851),c=r(9023);function u(e,t){return n.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function l(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,o=e.encoding,s=i(t.alg),l=function(e,t,r){r=r||"utf8";var n=u(a(e),"binary"),o=u(a(t),r);return c.format("%s.%s",n,o)}(t,r,o),d=s.sign(l,n);return c.format("%s.%s",l,d)}function d(e){var t=e.secret;if(t=null==(t=null==t?e.privateKey:t)?e.key:t,!0===/^hs/i.test(e.header.alg)&&null==t)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new o(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new o(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}c.inherits(d,s),d.prototype.sign=function(){try{var e=l({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},d.sign=l,e.exports=d},3503(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.syncMemoizer=void 0;var s=i(r(1603)),a=r(4434),c=i(r(7193)),u=r(7644);t.syncMemoizer=function(e){var t=new s.default(e),r=e.load,n=e.hash,i=e.bypass,l=e.itemMaxAge,d=e.freeze,p=e.clone,f=new a.EventEmitter,h=Object.assign({del:function(){var e=n.apply(void 0,o(arguments));t.del(e)},reset:function(){return t.reset()},keys:t.keys.bind(t),on:f.on.bind(f),once:f.once.bind(f)},e);if(e.disable)return Object.assign(r,h);function y(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.emit.apply(f,o([e],t))}function m(e){return e&&e.then&&"function"==typeof e.then}function g(e){var t=e;return p&&(t=m(t)?t.then(c.default):c.default(t)),d&&(m(t)?t=t.then(u.deepFreeze):u.deepFreeze(t)),t}return Object.assign(function(){for(var e=[],s=0;s<arguments.length;s++)e[s]=arguments[s];if(i&&i.apply(void 0,o(e)))return y.apply(void 0,o(["miss"],e)),r.apply(void 0,o(e));var a=n.apply(void 0,o(e)),c=t.get(a);if(c)return y.apply(void 0,o(["hit"],e)),g(c);y.apply(void 0,o(["miss"],e));var u=r.apply(void 0,o(e));return l?t.set(a,u,l.apply(void 0,o(e.concat([u])))):t.set(a,u),g(u)},h)}},3527(e){"use strict";function t(e){return(e/8|0)+(e%8==0?0:1)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}},3552(e){e.exports=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES256K","ES384","ES512","EdDSA"]},3639(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Number]"==t.call(e)}},3726(e,t,r){var n=r(1741),o=function(e,t){n.call(this,e),this.name="NotBeforeError",this.date=t};(o.prototype=Object.create(n.prototype)).constructor=o,e.exports=o},3780(e,t,r){e.exports={ArgumentError:r(947),JwksError:r(1161),JwksRateLimitError:r(9950),SigningKeyNotFoundError:r(2813)}},3814(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtDecrypt=void 0;const n=r(6923),o=r(493),i=r(6247);t.jwtDecrypt=async function(e,t,r){const s=await(0,n.compactDecrypt)(e,t,r),a=(0,o.default)(s.protectedHeader,s.plaintext,r),{protectedHeader:c}=s;if(void 0!==c.iss&&c.iss!==a.iss)throw new i.JWTClaimValidationFailed('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==c.sub&&c.sub!==a.sub)throw new i.JWTClaimValidationFailed('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==c.aud&&JSON.stringify(c.aud)!==JSON.stringify(a.aud))throw new i.JWTClaimValidationFailed('replicated "aud" claim header parameter mismatch',"aud","mismatch");const u={payload:a,protectedHeader:c};return"function"==typeof t?{...u,key:s.key}:u}},3858(e,t,r){const n=r(8611),o=r(5692),i=r(7016);e.exports.A=e=>e.fetcher?e.fetcher(e.uri):new Promise((t,r)=>{const{hostname:s,path:a,port:c,protocol:u}=i.parse(e.uri),l={hostname:s,path:a,port:c,method:"GET",...e.headers&&{headers:{...e.headers}},...e.timeout&&{timeout:e.timeout},...e.agent&&{agent:e.agent}},d=("https:"===u?o:n).request(l,e=>{let n="";e.setEncoding("utf8"),e.on("data",e=>{n+=e}),e.on("end",()=>{if(e.statusCode<200||e.statusCode>=300){const t=e.body&&(e.body.message||e.body)||e.statusMessage||`Http Error ${e.statusCode}`;r({errorMsg:t})}else try{t(n&&JSON.parse(n))}catch(e){r(e)}})});d.on("timeout",()=>d.destroy()).on("error",e=>r(e)).end()})},3874(e,t,r){"use strict";const n=r(8311);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},3904(e,t,r){"use strict";const n=Symbol("SemVer ANY");class o{static get ANY(){return n}constructor(e,t){if(t=i(t),e instanceof o){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=o;const i=r(8587),{safeRe:s,t:a}=r(9718),c=r(2111),u=r(7272),l=r(3908),d=r(8311)},3908(e,t,r){"use strict";const n=r(7272),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=r(6874),{safeRe:s,t:a}=r(9718),c=r(8587),{compareIdentifiers:u}=r(1123);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>o)throw new TypeError(`version is longer than ${o} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],o=e.build[t];if(n("build compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?s[a.PRERELEASELOOSE]:s[a.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},3927(e,t,r){"use strict";const n=r(909);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},3999(e,t,r){"use strict";const n=r(560);e.exports=(e,t,r)=>0!==n(e,t,r)},4040(e,t,r){e.exports={decode:r(7260),verify:r(1691),sign:r(7651),JsonWebTokenError:r(1741),NotBeforeError:r(3726),TokenExpiredError:r(8980)}},4089(e,t,r){"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)>=0},4121(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateSecret=void 0;const n=r(7975);t.generateSecret=async function(e,t){return(0,n.generateSecret)(e,t)}},4138(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(181),o=r(6247),i=n.Buffer.from([0]),s=n.Buffer.from([2]),a=n.Buffer.from([3]),c=n.Buffer.from([48]),u=n.Buffer.from([4]),l=e=>{if(e<128)return n.Buffer.from([e]);const t=n.Buffer.alloc(5);t.writeUInt32BE(e,1);let r=1;for(;0===t[r];)r++;return t[r-1]=128|5-r,t.slice(r-1)},d=new Map([["P-256",n.Buffer.from("06 08 2A 86 48 CE 3D 03 01 07".replace(/ /g,""),"hex")],["secp256k1",n.Buffer.from("06 05 2B 81 04 00 0A".replace(/ /g,""),"hex")],["P-384",n.Buffer.from("06 05 2B 81 04 00 22".replace(/ /g,""),"hex")],["P-521",n.Buffer.from("06 05 2B 81 04 00 23".replace(/ /g,""),"hex")],["ecPublicKey",n.Buffer.from("06 07 2A 86 48 CE 3D 02 01".replace(/ /g,""),"hex")],["X25519",n.Buffer.from("06 03 2B 65 6E".replace(/ /g,""),"hex")],["X448",n.Buffer.from("06 03 2B 65 6F".replace(/ /g,""),"hex")],["Ed25519",n.Buffer.from("06 03 2B 65 70".replace(/ /g,""),"hex")],["Ed448",n.Buffer.from("06 03 2B 65 71".replace(/ /g,""),"hex")]]);t.default=class{constructor(){this.length=0,this.elements=[]}oidFor(e){const t=d.get(e);if(!t)throw new o.JOSENotSupported("Invalid or unsupported OID");this.elements.push(t),this.length+=t.length}zero(){this.elements.push(s,n.Buffer.from([1]),i),this.length+=3}one(){this.elements.push(s,n.Buffer.from([1]),n.Buffer.from([1])),this.length+=3}unsignedInteger(e){if(128&e[0]){const t=l(e.length+1);this.elements.push(s,t,i,e),this.length+=2+t.length+e.length}else{let t=0;for(;0===e[t]&&!(128&e[t+1]);)t++;const r=l(e.length-t);this.elements.push(s,l(e.length-t),e.slice(t)),this.length+=1+r.length+e.length-t}}octStr(e){const t=l(e.length);this.elements.push(u,l(e.length),e),this.length+=1+t.length+e.length}bitStr(e){const t=l(e.length+1);this.elements.push(a,l(e.length+1),i,e),this.length+=1+t.length+e.length+1}add(e){this.elements.push(e),this.length+=e.length}end(e=c){const t=l(this.length);return n.Buffer.concat([e,t,...this.elements],1+t.length+this.length)}}},4166(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9754);t.default=n.default},4263(e,t,r){const n=r(257),o=r(1161);function i(e){if(e.alg)return e.alg;if("RSA"===e.kty)return"RS256";if("EC"===e.kty)switch(e.crv){case"P-256":return"ES256";case"secp256k1":return"ES256K";case"P-384":return"ES384";case"P-521":return"ES512"}if("OKP"===e.kty)switch(e.crv){case"Ed25519":case"Ed448":return"EdDSA"}throw new o("Unsupported JWK")}e.exports={retrieveSigningKeys:async function(e){const t=[];e=e.filter(({use:e})=>"sig"===e||void 0===e).filter(({kty:e})=>"RSA"===e||"EC"===e||"OKP"===e);for(const r of e)try{const e=await n.importJWK({...r,ext:!0},i(r));if("public"!==e.type)continue;let o;switch(e[Symbol.toStringTag]){case"CryptoKey":{const t=await n.exportSPKI(e);o=()=>t;break}default:o=()=>e.export({format:"pem",type:"spki"})}t.push({get publicKey(){return o()},get rsaPublicKey(){return o()},getPublicKey:()=>o(),..."string"==typeof r.kid&&r.kid?{kid:r.kid}:void 0,..."string"==typeof r.alg&&r.alg?{alg:r.alg}:void 0})}catch(e){continue}return t}}},4277(e,t,r){"use strict";const n=r(909);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},4329(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlattenedSign=void 0;const n=r(82),o=r(7965),i=r(9476),s=r(6247),a=r(5821),c=r(1688),u=r(2458);t.FlattenedSign=class{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new s.JWSInvalid("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!(0,i.default)(this._protectedHeader,this._unprotectedHeader))throw new s.JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let l=!0;if((0,u.default)(s.JWSInvalid,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(l=this._protectedHeader.b64,"boolean"!=typeof l))throw new s.JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:d}=r;if("string"!=typeof d||!d)throw new s.JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');(0,c.default)(d,e,"sign");let p,f=this._payload;l&&(f=a.encoder.encode((0,n.encode)(f))),p=this._protectedHeader?a.encoder.encode((0,n.encode)(JSON.stringify(this._protectedHeader))):a.encoder.encode("");const h=(0,a.concat)(p,a.encoder.encode("."),f),y=await(0,o.default)(d,e,h),m={signature:(0,n.encode)(y),payload:""};return l&&(m.payload=a.decoder.decode(f)),this._unprotectedHeader&&(m.header=this._unprotectedHeader),this._protectedHeader&&(m.protected=a.decoder.decode(p)),m}}},4388(e,t,r){const n=r(257),{ArgumentError:o}=r(3780),{JwksClient:i}=r(3110),s=r(3552),a=(e,t)=>e&&"SigningKeyNotFoundError"===e.name?t(null):e?t(e):void 0;e.exports.passportJwtSecret=function(e){if(null==e)throw new o("An options object must be provided when initializing passportJwtSecret");if(!e.jwksUri)throw new o("No JWKS provided. Please provide a jwksUri");const t=new i(e),r=e.handleSigningKeyError||a;return function(e,o,i){let a;try{a={payload:n.decodeJwt(o),header:n.decodeProtectedHeader(o)}}catch(e){a=null}if(!a||!s.includes(a.header.alg))return i(null,null);t.getSigningKey(a.header.kid).then(e=>{i(null,e.publicKey||e.rsaPublicKey)}).catch(e=>{r(e,e=>i(e,null))})}}},4434(e){"use strict";e.exports=require("events")},4443(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeProtectedHeader=void 0;const n=r(8462),o=r(5821),i=r(1855);t.decodeProtectedHeader=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(o.decoder.decode((0,n.decode)(t)));if(!(0,i.default)(e))throw new Error;return e}catch{throw new TypeError("Invalid Token or Protected Header formatting")}}},4493(e,t,r){"use strict";const n=r(3908);e.exports=(e,t)=>new n(e,t).patch},4512(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(9023);t.default=o.types.isKeyObject?e=>o.types.isKeyObject(e):e=>null!=e&&e instanceof n.KeyObject},4533(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenedDecrypt=void 0;const n=r(82),o=r(4799),i=r(7609),s=r(6247),a=r(9476),c=r(1855),u=r(4760),l=r(5821),d=r(1784),p=r(2458),f=r(8604);t.flattenedDecrypt=async function(e,t,r){var h;if(!(0,c.default)(e))throw new s.JWEInvalid("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new s.JWEInvalid("JOSE Header missing");if("string"!=typeof e.iv)throw new s.JWEInvalid("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new s.JWEInvalid("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new s.JWEInvalid("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new s.JWEInvalid("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new s.JWEInvalid("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new s.JWEInvalid("JWE AAD incorrect type");if(void 0!==e.header&&!(0,c.default)(e.header))throw new s.JWEInvalid("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!(0,c.default)(e.unprotected))throw new s.JWEInvalid("JWE Per-Recipient Unprotected Header incorrect type");let y;if(e.protected)try{const t=(0,n.decode)(e.protected);y=JSON.parse(l.decoder.decode(t))}catch{throw new s.JWEInvalid("JWE Protected Header is invalid")}if(!(0,a.default)(y,e.header,e.unprotected))throw new s.JWEInvalid("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const m={...y,...e.header,...e.unprotected};if((0,p.default)(s.JWEInvalid,new Map,null==r?void 0:r.crit,y,m),void 0!==m.zip){if(!y||!y.zip)throw new s.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==m.zip)throw new s.JOSENotSupported('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:g,enc:v}=m;if("string"!=typeof g||!g)throw new s.JWEInvalid("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof v||!v)throw new s.JWEInvalid("missing JWE Encryption Algorithm (enc) in JWE Header");const w=r&&(0,f.default)("keyManagementAlgorithms",r.keyManagementAlgorithms),E=r&&(0,f.default)("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(w&&!w.has(g))throw new s.JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter not allowed');if(E&&!E.has(v))throw new s.JOSEAlgNotAllowed('"enc" (Encryption Algorithm) Header Parameter not allowed');let b;if(void 0!==e.encrypted_key)try{b=(0,n.decode)(e.encrypted_key)}catch{throw new s.JWEInvalid("Failed to base64url decode the encrypted_key")}let S,_,A,P=!1;"function"==typeof t&&(t=await t(y,e),P=!0);try{S=await(0,u.default)(g,t,b,m,r)}catch(e){if(e instanceof TypeError||e instanceof s.JWEInvalid||e instanceof s.JOSENotSupported)throw e;S=(0,d.default)(v)}try{_=(0,n.decode)(e.iv)}catch{throw new s.JWEInvalid("Failed to base64url decode the iv")}try{A=(0,n.decode)(e.tag)}catch{throw new s.JWEInvalid("Failed to base64url decode the tag")}const I=l.encoder.encode(null!==(h=e.protected)&&void 0!==h?h:"");let O,k;O=void 0!==e.aad?(0,l.concat)(I,l.encoder.encode("."),l.encoder.encode(e.aad)):I;try{k=(0,n.decode)(e.ciphertext)}catch{throw new s.JWEInvalid("Failed to base64url decode the ciphertext")}let C=await(0,o.default)(v,S,k,_,A,O);"DEF"===m.zip&&(C=await((null==r?void 0:r.inflateRaw)||i.inflate)(C));const T={plaintext:C};if(void 0!==e.protected&&(T.protectedHeader=y),void 0!==e.aad)try{T.additionalAuthenticatedData=(0,n.decode)(e.aad)}catch{throw new s.JWEInvalid("Failed to base64url decode the aad")}return void 0!==e.unprotected&&(T.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(T.unprotectedHeader=e.header),P?{...T,key:t}:T}},4601(e,t,r){const{JwksClient:n}=r(3110),o=r(3780),{hapiJwt2Key:i,hapiJwt2KeyAsync:s}=r(4698),{expressJwtSecret:a}=r(5064),{koaJwtSecret:c}=r(7897),{passportJwtSecret:u}=r(4388);e.exports=e=>new n(e),e.exports.JwksClient=n,e.exports.ArgumentError=o.ArgumentError,e.exports.JwksError=o.JwksError,e.exports.JwksRateLimitError=o.JwksRateLimitError,e.exports.SigningKeyNotFoundError=o.SigningKeyNotFoundError,e.exports.expressJwtSecret=a,e.exports.hapiJwt2Key=i,e.exports.hapiJwt2KeyAsync=s,e.exports.koaJwtSecret=c,e.exports.passportJwtSecret=u},4623(e,t,r){const n=r(9589);e.exports=n.satisfies(process.version,">=16.9.0")},4641(e,t,r){"use strict";const n=r(560);e.exports=(e,t,r)=>0===n(e,t,r)},4660(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(181),o=r(6982),i=r(82),s=r(6247),a=r(8960),c=r(5363),u=r(4138),l=r(1185);t.default=e=>{if(l.jwkImport&&"oct"!==e.kty)return e.d?(0,o.createPrivateKey)({format:"jwk",key:e}):(0,o.createPublicKey)({format:"jwk",key:e});switch(e.kty){case"oct":return(0,o.createSecretKey)((0,i.decode)(e.k));case"RSA":{const t=new u.default,r=void 0!==e.d,i=n.Buffer.from(e.n,"base64"),s=n.Buffer.from(e.e,"base64");r?(t.zero(),t.unsignedInteger(i),t.unsignedInteger(s),t.unsignedInteger(n.Buffer.from(e.d,"base64")),t.unsignedInteger(n.Buffer.from(e.p,"base64")),t.unsignedInteger(n.Buffer.from(e.q,"base64")),t.unsignedInteger(n.Buffer.from(e.dp,"base64")),t.unsignedInteger(n.Buffer.from(e.dq,"base64")),t.unsignedInteger(n.Buffer.from(e.qi,"base64"))):(t.unsignedInteger(i),t.unsignedInteger(s));const a={key:t.end(),format:"der",type:"pkcs1"},l=r?(0,o.createPrivateKey)(a):(0,o.createPublicKey)(a);return(0,c.setModulusLength)(l,i.length<<3),l}case"EC":{const t=new u.default,r=void 0!==e.d,i=n.Buffer.concat([n.Buffer.alloc(1,4),n.Buffer.from(e.x,"base64"),n.Buffer.from(e.y,"base64")]);if(r){t.zero();const r=new u.default;r.oidFor("ecPublicKey"),r.oidFor(e.crv),t.add(r.end());const s=new u.default;s.one(),s.octStr(n.Buffer.from(e.d,"base64"));const c=new u.default;c.bitStr(i);const l=c.end(n.Buffer.from([161]));s.add(l);const d=s.end(),p=new u.default;p.add(d);const f=p.end(n.Buffer.from([4]));t.add(f);const h=t.end(),y=(0,o.createPrivateKey)({key:h,format:"der",type:"pkcs8"});return(0,a.setCurve)(y,e.crv),y}const s=new u.default;s.oidFor("ecPublicKey"),s.oidFor(e.crv),t.add(s.end()),t.bitStr(i);const c=t.end(),l=(0,o.createPublicKey)({key:c,format:"der",type:"spki"});return(0,a.setCurve)(l,e.crv),l}case"OKP":{const t=new u.default;if(void 0!==e.d){t.zero();const r=new u.default;r.oidFor(e.crv),t.add(r.end());const i=new u.default;i.octStr(n.Buffer.from(e.d,"base64"));const s=i.end(n.Buffer.from([4]));t.add(s);const a=t.end();return(0,o.createPrivateKey)({key:a,format:"der",type:"pkcs8"})}const r=new u.default;r.oidFor(e.crv),t.add(r.end()),t.bitStr(n.Buffer.from(e.x,"base64"));const i=t.end();return(0,o.createPublicKey)({key:i,format:"der",type:"spki"})}default:throw new s.JOSENotSupported('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}}},4698(e,t,r){const{ArgumentError:n}=r(3780),{JwksClient:o}=r(3110),i=r(3552),s=(e,t)=>e&&"SigningKeyNotFoundError"===e.name||e?t(e,null,null):void 0;e.exports.hapiJwt2KeyAsync=t=>{const r=e.exports.hapiJwt2Key(t);return function(e){return new Promise((t,n)=>{r(e,(e,r)=>{!r||e?n(e):t({key:r})})})}},e.exports.hapiJwt2Key=function(e){if(null==e)throw new n("An options object must be provided when initializing hapiJwt2Key");const t=new o(e),r=e.handleSigningKeyError||s;return function(e,n){return e&&e.header?i.includes(e.header.alg)?void t.getSigningKey(e.header.kid).then(e=>n(null,e.publicKey||e.rsaPublicKey,e)).catch(e=>r(e,e=>n(e,null,null))):n(new Error("Unsupported algorithm "+e.header.alg+" supplied."),null,null):n(new Error("Cannot find a signing certificate if there is no header"),null,null)}}},4760(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2395),o=r(6112),i=r(5904),s=r(3020),a=r(82),c=r(6247),u=r(1784),l=r(7364),d=r(1688),p=r(1855),f=r(7031);t.default=async function(e,t,r,h,y){switch((0,d.default)(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new c.JWEInvalid("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new c.JWEInvalid("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!(0,p.default)(h.epk))throw new c.JWEInvalid('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!o.ecdhAllowed(t))throw new c.JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await(0,l.importJWK)(h.epk,e);let s,d;if(void 0!==h.apu){if("string"!=typeof h.apu)throw new c.JWEInvalid('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{s=(0,a.decode)(h.apu)}catch{throw new c.JWEInvalid("Failed to base64url decode the apu")}}if(void 0!==h.apv){if("string"!=typeof h.apv)throw new c.JWEInvalid('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{d=(0,a.decode)(h.apv)}catch{throw new c.JWEInvalid("Failed to base64url decode the apv")}}const f=await o.deriveKey(i,t,"ECDH-ES"===e?h.enc:e,"ECDH-ES"===e?(0,u.bitLength)(h.enc):parseInt(e.slice(-5,-2),10),s,d);if("ECDH-ES"===e)return f;if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");return(0,n.unwrap)(e.slice(-6),f,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");return(0,s.decrypt)(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");if("number"!=typeof h.p2c)throw new c.JWEInvalid('JOSE Header "p2c" (PBES2 Count) missing or invalid');const n=(null==y?void 0:y.maxPBES2Count)||1e4;if(h.p2c>n)throw new c.JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof h.p2s)throw new c.JWEInvalid('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let o;try{o=(0,a.decode)(h.p2s)}catch{throw new c.JWEInvalid("Failed to base64url decode the p2s")}return(0,i.decrypt)(e,t,r,h.p2c,o)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");return(0,n.unwrap)(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(void 0===r)throw new c.JWEInvalid("JWE Encrypted Key missing");if("string"!=typeof h.iv)throw new c.JWEInvalid('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof h.tag)throw new c.JWEInvalid('JOSE Header "tag" (Authentication Tag) missing or invalid');let n,o;try{n=(0,a.decode)(h.iv)}catch{throw new c.JWEInvalid("Failed to base64url decode the iv")}try{o=(0,a.decode)(h.tag)}catch{throw new c.JWEInvalid("Failed to base64url decode the tag")}return(0,f.unwrap)(e,t,r,n,o)}default:throw new c.JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}}},4799(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(1146),i=r(2319),s=r(5821),a=r(6247),c=r(2167),u=r(4803),l=r(8993),d=r(2484),p=r(4512),f=r(8737),h=r(3022),y=r(740);t.default=(e,t,r,m,g,v)=>{let w;if((0,l.isCryptoKey)(t))(0,d.checkEncCryptoKey)(t,e,"decrypt"),w=n.KeyObject.from(t);else{if(!(t instanceof Uint8Array||(0,p.default)(t)))throw new TypeError((0,f.default)(t,...y.types,"Uint8Array"));w=t}switch((0,i.default)(e,w),(0,o.default)(e,m),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return function(e,t,r,o,i,l){const d=parseInt(e.slice(1,4),10);(0,p.default)(t)&&(t=t.export());const f=t.subarray(d>>3),y=t.subarray(0,d>>3),m=parseInt(e.slice(-3),10),g=`aes-${d}-cbc`;if(!(0,h.default)(g))throw new a.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);const v=(0,u.default)(l,o,r,m,y,d);let w,E;try{w=(0,c.default)(i,v)}catch{}if(!w)throw new a.JWEDecryptionFailed;try{const e=(0,n.createDecipheriv)(g,f,o);E=(0,s.concat)(e.update(r),e.final())}catch{}if(!E)throw new a.JWEDecryptionFailed;return E}(e,w,r,m,g,v);case"A128GCM":case"A192GCM":case"A256GCM":return function(e,t,r,o,i,s){const c=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!(0,h.default)(c))throw new a.JOSENotSupported(`alg ${e} is not supported by your javascript runtime`);try{const e=(0,n.createDecipheriv)(c,t,o,{authTagLength:16});e.setAuthTag(i),s.byteLength&&e.setAAD(s,{plaintextLength:r.length});const a=e.update(r);return e.final(),a}catch{throw new a.JWEDecryptionFailed}}(e,w,r,m,g,v);default:throw new a.JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}}},4803(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(5821);t.default=function(e,t,r,i,s,a){const c=(0,o.concat)(e,t,r,(0,o.uint64be)(e.length<<3)),u=(0,n.createHmac)(`sha${i}`,s);return u.update(c),u.digest().slice(0,a>>3)}},4977(e,t,r){var n=r(9589);e.exports=n.satisfies(process.version,"^6.12.0 || >=8.0.0")},5032(e,t,r){"use strict";const n=r(8311),o=r(3904),{ANY:i}=o,s=r(7638),a=r(560),c=[new o(">=0.0.0-0")],u=[new o(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?c:u}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=u}const n=new Set;let o,l,f,h,y,m,g;for(const t of e)">"===t.operator||">="===t.operator?o=d(o,t,r):"<"===t.operator||"<="===t.operator?l=p(l,t,r):n.add(t.semver);if(n.size>1)return null;if(o&&l){if(f=a(o.semver,l.semver,r),f>0)return null;if(0===f&&(">="!==o.operator||"<="!==l.operator))return null}for(const e of n){if(o&&!s(e,String(o),r))return null;if(l&&!s(e,String(l),r))return null;for(const n of t)if(!s(e,String(n),r))return!1;return!0}let v=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,w=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver;v&&1===v.prerelease.length&&"<"===l.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,o)if(w&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===w.major&&e.semver.minor===w.minor&&e.semver.patch===w.patch&&(w=!1),">"===e.operator||">="===e.operator){if(h=d(o,e,r),h===e&&h!==o)return!1}else if(">="===o.operator&&!s(o.semver,String(e),r))return!1;if(l)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(y=p(l,e,r),y===e&&y!==l)return!1}else if("<="===l.operator&&!s(l.semver,String(e),r))return!1;if(!e.operator&&(l||o)&&0!==f)return!1}return!(o&&m&&!l&&0!==f||l&&g&&!o&&0!==f||w||v)},d=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let o=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},5064(e,t,r){const{ArgumentError:n}=r(3780),{JwksClient:o}=r(3110),i=r(3552),s=(e,t)=>e&&"SigningKeyNotFoundError"===e.name?t(null):e?t(e):void 0;e.exports.expressJwtSecret=function(e){if(null==e)throw new n("An options object must be provided when initializing expressJwtSecret");const t=new o(e),r=e.handleSigningKeyError||s,a=async(e,n)=>{if(!n)return;const o=n.header;if(o&&i.includes(o.alg))try{const e=await t.getSigningKey(o.kid);return e.publicKey||e.rsaPublicKey}catch(e){return new Promise((t,n)=>{r(e,e=>{if(!e)return t();n(e)})})}};return function(e,t,r,n){if(4!==arguments.length)return a(0,arguments[1]);a(0,{header:t}).then(e=>{setImmediate(n,null,e)}).catch(e=>{setImmediate(n,e)})}}},5200(e,t,r){"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)<=0},5206(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(8993),i=r(2484),s=r(8737),a=r(740);t.default=function(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError((0,s.default)(t,...a.types));return(0,n.createSecretKey)(t)}if(t instanceof n.KeyObject)return t;if((0,o.isCryptoKey)(t))return(0,i.checkSigCryptoKey)(t,e,r),n.KeyObject.from(t);throw new TypeError((0,s.default)(t,...a.types,"Uint8Array"))}},5342(e,t,r){"use strict";const n=r(7075);e.exports=(e,t,r)=>n(e,t,"<",r)},5363(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setModulusLength=t.weakMap=void 0,t.weakMap=new WeakMap;const r=(e,t)=>{let n=e.readUInt8(1);if(!(128&n))return 0===t?n:r(e.subarray(2+n),t-1);const o=127&n;n=0;for(let t=0;t<o;t++)n<<=8,n|=e.readUInt8(2+t);return 0===t?n:r(e.subarray(2+n),t-1)};t.setModulusLength=(e,r)=>{t.weakMap.set(e,r)},t.default=(e,n)=>{if((e=>{var n,o;if(t.weakMap.has(e))return t.weakMap.get(e);const i=null!==(o=null===(n=e.asymmetricKeyDetails)||void 0===n?void 0:n.modulusLength)&&void 0!==o?o:((e,t)=>{const n=e.readUInt8(1);if(!(128&n))return r(e.subarray(2),t);const o=127&n;return r(e.subarray(2+o),t)})(e.export({format:"der",type:"pkcs1"}),"private"===e.type?1:0)-1<<3;return t.weakMap.set(e,i),i})(e)<2048)throw new TypeError(`${n} requires key modulusLength to be 2048 bits or larger`)}},5472(e){var t=function(e,t,r,n){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof r)switch(r){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+r)}else this.interval=r;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};t.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,t){var r=this;return this.bucketSize?e>this.bucketSize?(process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),e>this.content?n():this.parentBucket?this.parentBucket.removeTokens(e,function(o,i){return o?t(o,null):e>r.content?n():(r.content-=e,void t(null,Math.min(i,r.content)))}):(this.content-=e,process.nextTick(t.bind(null,null,this.content)),!0)):(process.nextTick(t.bind(null,null,e,Number.POSITIVE_INFINITY)),!0);function n(){var n=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout(function(){r.removeTokens(e,t)},n),!1}},tryRemoveTokens:function(e){return!(this.bucketSize&&(e>this.bucketSize||(this.drip(),e>this.content||this.parentBucket&&!this.parentBucket.tryRemoveTokens(e)||(this.content-=e,0))))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var r=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+r,this.bucketSize)}else this.content=this.bucketSize}},e.exports=t},5571(e,t,r){"use strict";const n=r(7075);e.exports=(e,t,r)=>n(e,t,">",r)},5580(e,t,r){"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)>0},5692(e){"use strict";e.exports=require("https")},5747(e,t,r){var n=r(3387),o=r(7599);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=n.sign,t.verify=o.verify,t.decode=o.decode,t.isValid=o.isValid,t.createSign=function(e){return new n(e)},t.createVerify=function(e){return new o(e)}},5753(e,t,r){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=r(7833):e.exports=r(6033)},5821(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatKdf=t.lengthAndInput=t.uint32be=t.uint64be=t.p2s=t.concat=t.decoder=t.encoder=void 0;const n=r(6332);t.encoder=new TextEncoder,t.decoder=new TextDecoder;const o=2**32;function i(...e){const t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t);let n=0;return e.forEach(e=>{r.set(e,n),n+=e.length}),r}function s(e,t,r){if(t<0||t>=o)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function a(e){const t=new Uint8Array(4);return s(t,e),t}t.concat=i,t.p2s=function(e,r){return i(t.encoder.encode(e),new Uint8Array([0]),r)},t.uint64be=function(e){const t=Math.floor(e/o),r=e%o,n=new Uint8Array(8);return s(n,t,0),s(n,r,4),n},t.uint32be=a,t.lengthAndInput=function(e){return i(a(e.length),e)},t.concatKdf=async function(e,t,r){const o=Math.ceil((t>>3)/32),i=new Uint8Array(32*o);for(let t=0;t<o;t++){const o=new Uint8Array(4+e.length+r.length);o.set(a(t+1)),o.set(e,4),o.set(r,4+e.length),i.set(await(0,n.default)("sha256",o),32*t)}return i.slice(0,t>>3)}},5884(e){"use strict";e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)}},5904(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;const n=r(9023),o=r(6982),i=r(927),s=r(5821),a=r(82),c=r(2395),u=r(8405),l=r(8993),d=r(2484),p=r(4512),f=r(8737),h=r(740),y=(0,n.promisify)(o.pbkdf2);function m(e,t){if((0,p.default)(e))return e.export();if(e instanceof Uint8Array)return e;if((0,l.isCryptoKey)(e))return(0,d.checkEncCryptoKey)(e,t,"deriveBits","deriveKey"),o.KeyObject.from(e).export();throw new TypeError((0,f.default)(e,...h.types,"Uint8Array"))}t.encrypt=async(e,t,r,n=2048,o=(0,i.default)(new Uint8Array(16)))=>{(0,u.default)(o);const l=(0,s.p2s)(e,o),d=parseInt(e.slice(13,16),10)>>3,p=m(t,e),f=await y(p,l,n,d,`sha${e.slice(8,11)}`);return{encryptedKey:await(0,c.wrap)(e.slice(-6),f,r),p2c:n,p2s:(0,a.encode)(o)}},t.decrypt=async(e,t,r,n,o)=>{(0,u.default)(o);const i=(0,s.p2s)(e,o),a=parseInt(e.slice(13,16),10)>>3,l=m(t,e),d=await y(l,i,n,a,`sha${e.slice(8,11)}`);return(0,c.unwrap)(e.slice(-6),d,r)}},5931(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){return"string"==typeof e||!r(e)&&function(e){return!!e&&"object"==typeof e}(e)&&"[object String]"==t.call(e)}},5945(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e){switch(e){case"PS256":case"RS256":case"ES256":case"ES256K":return"sha256";case"PS384":case"RS384":case"ES384":return"sha384";case"PS512":case"RS512":case"ES512":return"sha512";case"EdDSA":return;default:throw new n.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},6033(e,t,r){const n=r(2018),o=r(9023);t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(o.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${n} [0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=o.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=r(7687);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=r(736)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},6111(e){var t=1/0,r=9007199254740991,n=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=/^(?:0|[1-9]\d*)$/,c=parseInt;function u(e){return e!=e}var l,d,p=Object.prototype,f=p.hasOwnProperty,h=p.toString,y=p.propertyIsEnumerable,m=(l=Object.keys,d=Object,function(e){return l(d(e))}),g=Math.max;function v(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||a.test(e))&&e>-1&&e%1==0&&e<t}var w=Array.isArray;function E(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!function(e){var t=b(e)?h.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function S(e){return!!e&&"object"==typeof e}e.exports=function(e,r,a,l){var d;e=E(e)?e:(d=e)?function(e,t){return function(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r<n;)o[r]=t(e[r]);return o}(t,function(t){return e[t]})}(d,function(e){return E(e)?function(e,t){var r=w(e)||function(e){return function(e){return S(e)&&E(e)}(e)&&f.call(e,"callee")&&(!y.call(e,"callee")||"[object Arguments]"==h.call(e))}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var i in e)!t&&!f.call(e,i)||o&&("length"==i||v(i,n))||r.push(i);return r}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return m(e);var t,r,n=[];for(var o in Object(e))f.call(e,o)&&"constructor"!=o&&n.push(o);return n}(e)}(d)):[],a=a&&!l?function(e){var r=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||S(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=i.test(e);return r||s.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),a=r%1;return r==r?a?r-a:r:0}(a):0;var _=e.length;return a<0&&(a=g(_+a,0)),function(e){return"string"==typeof e||!w(e)&&S(e)&&"[object String]"==h.call(e)}(e)?a<=_&&e.indexOf(r,a)>-1:!!_&&function(e,t,r){if(t!=t)return function(e,t,r){for(var n=e.length,o=r+-1;++o<n;)if(t(e[o],o,e))return o;return-1}(e,u,r);for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}(e,r,a)>-1}},6112(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ecdhAllowed=t.generateEpk=t.deriveKey=void 0;const n=r(6982),o=r(9023),i=r(8960),s=r(5821),a=r(6247),c=r(8993),u=r(2484),l=r(4512),d=r(8737),p=r(740),f=(0,o.promisify)(n.generateKeyPair);t.deriveKey=async function(e,t,r,o,i=new Uint8Array(0),a=new Uint8Array(0)){let f,h;if((0,c.isCryptoKey)(e))(0,u.checkEncCryptoKey)(e,"ECDH"),f=n.KeyObject.from(e);else{if(!(0,l.default)(e))throw new TypeError((0,d.default)(e,...p.types));f=e}if((0,c.isCryptoKey)(t))(0,u.checkEncCryptoKey)(t,"ECDH","deriveBits"),h=n.KeyObject.from(t);else{if(!(0,l.default)(t))throw new TypeError((0,d.default)(t,...p.types));h=t}const y=(0,s.concat)((0,s.lengthAndInput)(s.encoder.encode(r)),(0,s.lengthAndInput)(i),(0,s.lengthAndInput)(a),(0,s.uint32be)(o)),m=(0,n.diffieHellman)({privateKey:h,publicKey:f});return(0,s.concatKdf)(m,o,y)},t.generateEpk=async function(e){let t;if((0,c.isCryptoKey)(e))t=n.KeyObject.from(e);else{if(!(0,l.default)(e))throw new TypeError((0,d.default)(e,...p.types));t=e}switch(t.asymmetricKeyType){case"x25519":return f("x25519");case"x448":return f("x448");case"ec":{const e=(0,i.default)(t);return f("ec",{namedCurve:e})}default:throw new a.JOSENotSupported("Invalid or unsupported EPK")}},t.ecdhAllowed=e=>["P-256","P-384","P-521","X25519","X448"].includes((0,i.default)(e))},6170(e,t,r){"use strict";const n=r(3908),o=r(144),{safeRe:i,t:s}=r(9718);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];let o;for(;(o=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",u=r[4]||"0",l=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return o(`${a}.${c}.${u}${l}${d}`,t)}},6247(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JWSSignatureVerificationFailed=t.JWKSTimeout=t.JWKSMultipleMatchingKeys=t.JWKSNoMatchingKey=t.JWKSInvalid=t.JWKInvalid=t.JWTInvalid=t.JWSInvalid=t.JWEInvalid=t.JWEDecompressionFailed=t.JWEDecryptionFailed=t.JOSENotSupported=t.JOSEAlgNotAllowed=t.JWTExpired=t.JWTClaimValidationFailed=t.JOSEError=void 0;class r extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}t.JOSEError=r,t.JWTClaimValidationFailed=class extends r{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}},t.JWTExpired=class extends r{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}},t.JOSEAlgNotAllowed=class extends r{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}},t.JOSENotSupported=class extends r{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}},t.JWEDecryptionFailed=class extends r{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}},t.JWEDecompressionFailed=class extends r{constructor(){super(...arguments),this.code="ERR_JWE_DECOMPRESSION_FAILED",this.message="decompression operation failed"}static get code(){return"ERR_JWE_DECOMPRESSION_FAILED"}},t.JWEInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}},t.JWSInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}},t.JWTInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}},t.JWKInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}},t.JWKSInvalid=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}},t.JWKSNoMatchingKey=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}},t.JWKSMultipleMatchingKeys=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}},Symbol.asyncIterator,t.JWKSTimeout=class extends r{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}},t.JWSSignatureVerificationFailed=class extends r{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}},6254(e,t,r){"use strict";const n=r(3908);e.exports=(e,t)=>new n(e,t).minor},6332(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982);t.default=(e,t)=>(0,n.createHash)(e).update(t).digest()},6545(e,t,r){const{callbackify:n}=r(9023);e.exports.A=e=>{const t=e.getSigningKey.bind(e);return(e,r)=>r?n(t)(e,r):t(e)}},6585(e){var t=1e3,r=60*t,n=60*r,o=24*n,i=7*o;function s(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,a){a=a||{};var c,u,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===l&&isFinite(e))return a.long?(c=e,(u=Math.abs(c))>=o?s(c,u,o,"day"):u>=n?s(c,u,n,"hour"):u>=r?s(c,u,r,"minute"):u>=t?s(c,u,t,"second"):c+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=n?Math.round(e/n)+"h":i>=r?Math.round(e/r)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6638(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EncryptJWT=void 0;const n=r(7815),o=r(5821),i=r(751);class s extends i.ProduceJWT{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){const r=new n.CompactEncrypt(o.encoder.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}}t.EncryptJWT=s},6780(e,t,r){"use strict";const n=r(8311);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},6833(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flattenedVerify=void 0;const n=r(82),o=r(3117),i=r(6247),s=r(5821),a=r(9476),c=r(1855),u=r(1688),l=r(2458),d=r(8604);t.flattenedVerify=async function(e,t,r){var p;if(!(0,c.default)(e))throw new i.JWSInvalid("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new i.JWSInvalid('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new i.JWSInvalid("JWS Protected Header incorrect type");if(void 0===e.payload)throw new i.JWSInvalid("JWS Payload missing");if("string"!=typeof e.signature)throw new i.JWSInvalid("JWS Signature missing or incorrect type");if(void 0!==e.header&&!(0,c.default)(e.header))throw new i.JWSInvalid("JWS Unprotected Header incorrect type");let f={};if(e.protected)try{const t=(0,n.decode)(e.protected);f=JSON.parse(s.decoder.decode(t))}catch{throw new i.JWSInvalid("JWS Protected Header is invalid")}if(!(0,a.default)(f,e.header))throw new i.JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const h={...f,...e.header};let y=!0;if((0,l.default)(i.JWSInvalid,new Map([["b64",!0]]),null==r?void 0:r.crit,f,h).has("b64")&&(y=f.b64,"boolean"!=typeof y))throw new i.JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:m}=h;if("string"!=typeof m||!m)throw new i.JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');const g=r&&(0,d.default)("algorithms",r.algorithms);if(g&&!g.has(m))throw new i.JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter not allowed');if(y){if("string"!=typeof e.payload)throw new i.JWSInvalid("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new i.JWSInvalid("JWS Payload must be a string or an Uint8Array instance");let v=!1;"function"==typeof t&&(t=await t(f,e),v=!0),(0,u.default)(m,t,"verify");const w=(0,s.concat)(s.encoder.encode(null!==(p=e.protected)&&void 0!==p?p:""),s.encoder.encode("."),"string"==typeof e.payload?s.encoder.encode(e.payload):e.payload);let E,b;try{E=(0,n.decode)(e.signature)}catch{throw new i.JWSInvalid("Failed to base64url decode the signature")}if(!await(0,o.default)(m,t,E,w))throw new i.JWSSignatureVerificationFailed;if(y)try{b=(0,n.decode)(e.payload)}catch{throw new i.JWSInvalid("Failed to base64url decode the payload")}else b="string"==typeof e.payload?s.encoder.encode(e.payload):e.payload;const S={payload:b};return void 0!==e.protected&&(S.protectedHeader=f),void 0!==e.header&&(S.unprotectedHeader=e.header),v?{...S,key:t}:S}},6874(e){"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},6923(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactDecrypt=void 0;const n=r(4533),o=r(6247),i=r(5821);t.compactDecrypt=async function(e,t,r){if(e instanceof Uint8Array&&(e=i.decoder.decode(e)),"string"!=typeof e)throw new o.JWEInvalid("Compact JWE must be a string or Uint8Array");const{0:s,1:a,2:c,3:u,4:l,length:d}=e.split(".");if(5!==d)throw new o.JWEInvalid("Invalid Compact JWE");const p=await(0,n.flattenedDecrypt)({ciphertext:u,iv:c||void 0,protected:s||void 0,tag:l||void 0,encrypted_key:a||void 0},t,r),f={plaintext:p.plaintext,protectedHeader:p.protectedHeader};return"function"==typeof t?{...f,key:p.key}:f}},6953(e,t,r){"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},6980(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLocalJWKSet=t.LocalJWKSet=t.isJWKSLike=void 0;const n=r(7364),o=r(6247),i=r(1855);function s(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(a)}function a(e){return(0,i.default)(e)}t.isJWKSLike=s;class c{constructor(e){if(this._cached=new WeakMap,!s(e))throw new o.JWKSInvalid("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0:t.header},i=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new o.JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set')}}(r),s=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t}),{0:a,length:c}=s;if(0===c)throw new o.JWKSNoMatchingKey;if(1!==c){const e=new o.JWKSMultipleMatchingKeys,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of s)try{yield await u(t,e,r)}catch{continue}},e}return u(this._cached,a,r)}}async function u(e,t,r){const i=e.get(t)||e.set(t,{}).get(t);if(void 0===i[r]){const e=await(0,n.importJWK)({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new o.JWKSInvalid("JSON Web Key Set members must be public keys");i[r]=e}return i[r]}t.LocalJWKSet=c,t.createLocalJWKSet=function(e){const t=new c(e);return async function(e,r){return t.getKey(e,r)}}},6982(e){"use strict";e.exports=require("crypto")},7016(e){"use strict";e.exports=require("url")},7019(e,t,r){const n=r(1977),o=r(4623),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;const r=t.asymmetricKeyType;if(!r)return;const a=i[r];if(!a)throw new Error(`Unknown key type "${r}".`);if(!a.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${a.join(", ")}.`);if(n)switch(r){case"ec":const r=t.asymmetricKeyDetails.namedCurve,n=s[e];if(r!==n)throw new Error(`"alg" parameter "${e}" requires curve "${n}".`);break;case"rsa-pss":if(o){const r=parseInt(e.slice(-3),10),{hashAlgorithm:n,mgf1HashAlgorithm:o,saltLength:i}=t.asymmetricKeyDetails;if(n!==`sha${r}`||o!==n)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},7031(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unwrap=t.wrap=void 0;const n=r(2027),o=r(4799),i=r(7974),s=r(82);t.wrap=async function(e,t,r,o){const a=e.slice(0,7);o||(o=(0,i.default)(a));const{ciphertext:c,tag:u}=await(0,n.default)(a,r,t,o,new Uint8Array(0));return{encryptedKey:c,iv:(0,s.encode)(o),tag:(0,s.encode)(u)}},t.unwrap=async function(e,t,r,n,i){const s=e.slice(0,7);return(0,o.default)(s,t,r,n,i,new Uint8Array(0))}},7059(e,t,r){"use strict";const n=r(560);e.exports=(e,t,r)=>n(e,t,r)<0},7075(e,t,r){"use strict";const n=r(3908),o=r(3904),{ANY:i}=o,s=r(8311),a=r(7638),c=r(5580),u=r(7059),l=r(5200),d=r(4089);e.exports=(e,t,r,p)=>{let f,h,y,m,g;switch(e=new n(e,p),t=new s(t,p),r){case">":f=c,h=l,y=u,m=">",g=">=";break;case"<":f=u,h=d,y=c,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let s=null,a=null;if(n.forEach(e=>{e.semver===i&&(e=new o(">=0.0.0")),s=s||e,a=a||e,f(e.semver,s.semver,p)?s=e:y(e.semver,a.semver,p)&&(a=e)}),s.operator===m||s.operator===g)return!1;if((!a.operator||a.operator===m)&&h(e,a.semver))return!1;if(a.operator===g&&y(e,a.semver))return!1}return!0}},7083(e){var t=1/0,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,a=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){return function(e,u){var l;if("function"!=typeof u)throw new TypeError("Expected a function");return e=function(e){var u=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==a.call(e)}(e))return NaN;if(c(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=c(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var u=o.test(e);return u||i.test(e)?s(e.slice(2),u?2:8):n.test(e)?NaN:+e}(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),l=u%1;return u==u?l?u-l:u:0}(e),function(){return--e>0&&(l=u.apply(this,arguments)),e<=1&&(u=void 0),l}}(2,e)}},7193(e,t,r){e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",l="[object Map]",d="[object Number]",p="[object Object]",f="[object Promise]",h="[object RegExp]",y="[object Set]",m="[object String]",g="[object Symbol]",v="[object WeakMap]",w="[object ArrayBuffer]",E="[object DataView]",b="[object Float32Array]",S="[object Float64Array]",_="[object Int8Array]",A="[object Int16Array]",P="[object Int32Array]",I="[object Uint8Array]",O="[object Uint8ClampedArray]",k="[object Uint16Array]",C="[object Uint32Array]",T=/\w*$/,J=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,K={};K[i]=K["[object Array]"]=K[w]=K[E]=K[s]=K[a]=K[b]=K[S]=K[_]=K[A]=K[P]=K[l]=K[d]=K[p]=K[h]=K[y]=K[m]=K[g]=K[I]=K[O]=K[k]=K[C]=!0,K["[object Error]"]=K[c]=K[v]=!1;var R="object"==typeof global&&global&&global.Object===Object&&global,j="object"==typeof self&&self&&self.Object===Object&&self,W=R||j||Function("return this")(),$=t&&!t.nodeType&&t,H=$&&e&&!e.nodeType&&e,N=H&&H.exports===$;function M(e,t){return e.set(t[0],t[1]),e}function L(e,t){return e.add(t),e}function D(e,t,r,n){var o=-1,i=e?e.length:0;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}function F(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function U(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function B(e,t){return function(r){return e(t(r))}}function G(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var V,z=Array.prototype,q=Function.prototype,X=Object.prototype,Y=W["__core-js_shared__"],Z=(V=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Q=q.toString,ee=X.hasOwnProperty,te=X.toString,re=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=N?W.Buffer:void 0,oe=W.Symbol,ie=W.Uint8Array,se=B(Object.getPrototypeOf,Object),ae=Object.create,ce=X.propertyIsEnumerable,ue=z.splice,le=Object.getOwnPropertySymbols,de=ne?ne.isBuffer:void 0,pe=B(Object.keys,Object),fe=We(W,"DataView"),he=We(W,"Map"),ye=We(W,"Promise"),me=We(W,"Set"),ge=We(W,"WeakMap"),ve=We(Object,"create"),we=Le(fe),Ee=Le(he),be=Le(ye),Se=Le(me),_e=Le(ge),Ae=oe?oe.prototype:void 0,Pe=Ae?Ae.valueOf:void 0;function Ie(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Oe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ke(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ce(e){this.__data__=new Oe(e)}function Te(e,t,r){var n=e[t];ee.call(e,t)&&De(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function Je(e,t){for(var r=e.length;r--;)if(De(e[r][0],t))return r;return-1}function xe(e,t,r,n,o,f,v){var J;if(n&&(J=f?n(e,o,f,v):n(e)),void 0!==J)return J;if(!Ve(e))return e;var x=Fe(e);if(x){if(J=function(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!t)return function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(e,J)}else{var R=He(e),j=R==c||R==u;if(Be(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(R==p||R==i||j&&!f){if(F(e))return f?e:{};if(J=function(e){return"function"!=typeof e.constructor||Me(e)?{}:Ve(t=se(e))?ae(t):{};var t}(j?{}:e),!t)return function(e,t){return Re(e,$e(e),t)}(e,function(e,t){return e&&Re(t,ze(t),e)}(J,e))}else{if(!K[R])return f?e:{};J=function(e,t,r,n){var o,i=e.constructor;switch(t){case w:return Ke(e);case s:case a:return new i(+e);case E:return function(e,t){var r=t?Ke(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case b:case S:case _:case A:case P:case I:case O:case k:case C:return function(e,t){var r=t?Ke(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case l:return function(e,t,r){return D(t?r(U(e),!0):U(e),M,new e.constructor)}(e,n,r);case d:case m:return new i(e);case h:return function(e){var t=new e.constructor(e.source,T.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return function(e,t,r){return D(t?r(G(e),!0):G(e),L,new e.constructor)}(e,n,r);case g:return o=e,Pe?Object(Pe.call(o)):{}}}(e,R,xe,t)}}v||(v=new Ce);var W=v.get(e);if(W)return W;if(v.set(e,J),!x)var $=r?function(e){return function(e,t,r){var n=t(e);return Fe(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,ze,$e)}(e):ze(e);return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r););}($||e,function(o,i){$&&(o=e[i=o]),Te(J,i,xe(o,t,r,n,i,e,v))}),J}function Ke(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Re(e,t,r,n){r||(r={});for(var o=-1,i=t.length;++o<i;){var s=t[o],a=n?n(r[s],e[s],s,r,e):void 0;Te(r,s,void 0===a?e[s]:a)}return r}function je(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function We(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ve(e)||(t=e,Z&&Z in t))&&(Ge(e)||F(e)?re:J).test(Le(e));var t}(r)?r:void 0}Ie.prototype.clear=function(){this.__data__=ve?ve(null):{}},Ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ie.prototype.get=function(e){var t=this.__data__;if(ve){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},Ie.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:ee.call(t,e)},Ie.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?n:t,this},Oe.prototype.clear=function(){this.__data__=[]},Oe.prototype.delete=function(e){var t=this.__data__,r=Je(t,e);return!(r<0||(r==t.length-1?t.pop():ue.call(t,r,1),0))},Oe.prototype.get=function(e){var t=this.__data__,r=Je(t,e);return r<0?void 0:t[r][1]},Oe.prototype.has=function(e){return Je(this.__data__,e)>-1},Oe.prototype.set=function(e,t){var r=this.__data__,n=Je(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ke.prototype.clear=function(){this.__data__={hash:new Ie,map:new(he||Oe),string:new Ie}},ke.prototype.delete=function(e){return je(this,e).delete(e)},ke.prototype.get=function(e){return je(this,e).get(e)},ke.prototype.has=function(e){return je(this,e).has(e)},ke.prototype.set=function(e,t){return je(this,e).set(e,t),this},Ce.prototype.clear=function(){this.__data__=new Oe},Ce.prototype.delete=function(e){return this.__data__.delete(e)},Ce.prototype.get=function(e){return this.__data__.get(e)},Ce.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Oe){var n=r.__data__;if(!he||n.length<199)return n.push([e,t]),this;r=this.__data__=new ke(n)}return r.set(e,t),this};var $e=le?B(le,Object):function(){return[]},He=function(e){return te.call(e)};function Ne(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||x.test(e))&&e>-1&&e%1==0&&e<t}function Me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function Le(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function De(e,t){return e===t||e!=e&&t!=t}(fe&&He(new fe(new ArrayBuffer(1)))!=E||he&&He(new he)!=l||ye&&He(ye.resolve())!=f||me&&He(new me)!=y||ge&&He(new ge)!=v)&&(He=function(e){var t=te.call(e),r=t==p?e.constructor:void 0,n=r?Le(r):void 0;if(n)switch(n){case we:return E;case Ee:return l;case be:return f;case Se:return y;case _e:return v}return t});var Fe=Array.isArray;function Ue(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Ge(e)}var Be=de||function(){return!1};function Ge(e){var t=Ve(e)?te.call(e):"";return t==c||t==u}function Ve(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ze(e){return Ue(e)?function(e,t){var r=Fe(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ue(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==i)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var s in e)!t&&!ee.call(e,s)||o&&("length"==s||Ne(s,n))||r.push(s);return r}(e):function(e){if(!Me(e))return pe(e);var t=[];for(var r in Object(e))ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return xe(e,!0,!0)}},7260(e,t,r){var n=r(5747);e.exports=function(e,t){t=t||{};var r=n.decode(e,t);if(!r)return null;var o=r.payload;if("string"==typeof o)try{var i=JSON.parse(o);null!==i&&"object"==typeof i&&(o=i)}catch(e){}return!0===t.complete?{header:r.header,payload:o,signature:r.signature}:o}},7272(e){"use strict";const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},7364(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.importJWK=t.importPKCS8=t.importX509=t.importSPKI=void 0;const n=r(82),o=r(293),i=r(4660),s=r(6247),a=r(1855);t.importSPKI=async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return(0,o.fromSPKI)(e,t,r)},t.importX509=async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return(0,o.fromX509)(e,t,r)},t.importPKCS8=async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return(0,o.fromPKCS8)(e,t,r)},t.importJWK=async function(e,t,r){var o;if(!(0,a.default)(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?(0,i.default)({...e,alg:t,ext:null!==(o=e.ext)&&void 0!==o&&o}):(0,n.decode)(e.k);case"RSA":if(void 0!==e.oth)throw new s.JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return(0,i.default)({...e,alg:t});default:throw new s.JOSENotSupported('Unsupported "kty" (Key Type) Parameter value')}}},7414(e,t,r){"use strict";const n=r(144);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},7440(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeneralSign=void 0;const n=r(4329),o=r(6247);class i{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}t.GeneralSign=class{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new i(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new o.JWSInvalid("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t<this._signatures.length;t++){const r=this._signatures[t],i=new n.FlattenedSign(this._payload);i.setProtectedHeader(r.protectedHeader),i.setUnprotectedHeader(r.unprotectedHeader);const{payload:s,...a}=await i.sign(r.key,r.options);if(0===t)e.payload=s;else if(e.payload!==s)throw new o.JWSInvalid("inconsistent use of JWS Unencoded Payload (RFC7797)");e.signatures.push(a)}return e}}},7599(e,t,r){var n=r(2861).Buffer,o=r(8948),i=r(8789),s=r(2203),a=r(2851),c=r(9023),u=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function l(e){var t=e.split(".",1)[0];return function(e){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e))return e;try{return JSON.parse(e)}catch(e){return}}(n.from(t,"base64").toString("binary"))}function d(e){return e.split(".")[2]}function p(e){return u.test(e)&&!!l(e)}function f(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var o=d(e=a(e)),s=function(e){return e.split(".",2).join(".")}(e);return i(t).verify(s,o,r)}function h(e,t){if(t=t||{},!p(e=a(e)))return null;var r=l(e);if(!r)return null;var o=function(e,t){t=t||"utf8";var r=e.split(".")[1];return n.from(r,"base64").toString(t)}(e);return("JWT"===r.typ||t.json)&&(o=JSON.parse(o,t.encoding)),{header:r,payload:o,signature:d(e)}}function y(e){var t=(e=e||{}).secret;if(t=null==(t=null==t?e.publicKey:t)?e.key:t,!0===/^hs/i.test(e.algorithm)&&null==t)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new o(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new o(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}c.inherits(y,s),y.prototype.verify=function(){try{var e=f(this.signature.buffer,this.algorithm,this.key.buffer),t=h(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},y.decode=h,y.isValid=p,y.verify=f,e.exports=y},7609(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deflate=t.inflate=void 0;const n=r(9023),o=r(3106),i=r(6247),s=(0,n.promisify)(o.inflateRaw),a=(0,n.promisify)(o.deflateRaw);t.inflate=e=>s(e,{maxOutputLength:25e4}).catch(()=>{throw new i.JWEDecompressionFailed}),t.deflate=e=>a(e)},7631(e,t,r){"use strict";const n=r(8311);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},7638(e,t,r){"use strict";const n=r(8311);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},7644(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepFreeze=void 0,t.deepFreeze=function e(t){return t&&(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(r){!t.hasOwnProperty(r)||null===t[r]||"object"!=typeof t[r]&&"function"!=typeof t[r]||t[r].constructor===Buffer||Object.isFrozen(t[r])||e(t[r])})),t}},7651(e,t,r){const n=r(855),o=r(4977),i=r(7019),s=r(5747),a=r(6111),c=r(7914),u=r(8928),l=r(3639),d=r(9001),p=r(5931),f=r(7083),{KeyObject:h,createSecretKey:y,createPrivateKey:m}=r(6982),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];o&&g.splice(3,0,"PS256","PS384","PS512");const v={expiresIn:{isValid:function(e){return u(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return u(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:a.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:c,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:c,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:c,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:c,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},w={iat:{isValid:l,message:'"iat" should be a number of seconds'},exp:{isValid:l,message:'"exp" should be a number of seconds'},nbf:{isValid:l,message:'"nbf" should be a number of seconds'}};function E(e,t,r,n){if(!d(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){const i=e[o];if(i){if(!i.isValid(r[o]))throw new Error(i.message)}else if(!t)throw new Error('"'+o+'" is not allowed in "'+n+'"')})}const b={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},S=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,o){"function"==typeof r?(o=r,r={}):r=r||{};const a="object"==typeof e&&!Buffer.isBuffer(e),c=Object.assign({alg:r.algorithm||"HS256",typ:a?"JWT":void 0,kid:r.keyid},r.header);function u(e){if(o)return o(e);throw e}if(!t&&"none"!==r.algorithm)return u(new Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof h))try{t=m(t)}catch(e){try{t=y("string"==typeof t?Buffer.from(t):t)}catch(e){return u(new Error("secretOrPrivateKey is not valid key material"))}}if(c.alg.startsWith("HS")&&"secret"!==t.type)return u(new Error(`secretOrPrivateKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)){if("private"!==t.type)return u(new Error(`secretOrPrivateKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInsecureKeySizes&&!c.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return u(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`))}if(void 0===e)return u(new Error("payload is required"));if(a){try{!function(e){E(w,!0,e,"payload")}(e)}catch(e){return u(e)}r.mutatePayload||(e=Object.assign({},e))}else{const t=S.filter(function(e){return void 0!==r[e]});if(t.length>0)return u(new Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return u(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return u(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{!function(e){E(v,!1,e,"options")}(r)}catch(e){return u(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{i(c.alg,t)}catch(e){return u(e)}const l=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:a&&(e.iat=l),void 0!==r.notBefore){try{e.nbf=n(r.notBefore,l)}catch(e){return u(e)}if(void 0===e.nbf)return u(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=n(r.expiresIn,l)}catch(e){return u(e)}if(void 0===e.exp)return u(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(b).forEach(function(t){const n=b[t];if(void 0!==r[t]){if(void 0!==e[n])return u(new Error('Bad "options.'+t+'" option. The payload already has an "'+n+'" property.'));e[n]=r[t]}});const d=r.encoding||"utf8";if("function"!=typeof o){let n=s.sign({header:c,payload:e,secret:t,encoding:d});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&n.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`);return n}o=o&&f(o),s.createSign({header:c,privateKey:t,payload:e,encoding:d}).once("error",o).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(c.alg)&&e.length<256)return o(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${c.alg}`));o(null,e)})}},7687(e,t,r){"use strict";const n=r(857),o=r(2018),i=r(5884),{env:s}=process;let a;function c(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function u(e,t){if(0===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(e&&!t&&void 0===a)return 0;const r=a||0;if("dumb"===s.TERM)return r;if("win32"===process.platform){const e=n.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in s)||"codeship"===s.CI_NAME?1:r;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:r}i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),"FORCE_COLOR"in s&&(a="true"===s.FORCE_COLOR?1:"false"===s.FORCE_COLOR?0:0===s.FORCE_COLOR.length?1:Math.min(parseInt(s.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return c(u(e,e&&e.isTTY))},stdout:c(u(!0,o.isatty(1))),stderr:c(u(!0,o.isatty(2)))}},7815(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactEncrypt=void 0;const n=r(9805);t.CompactEncrypt=class{constructor(e){this._flattened=new n.FlattenedEncrypt(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}},7833(e,t,r){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7897(e,t,r){const{ArgumentError:n}=r(3780),{JwksClient:o}=r(3110),i=r(3552);e.exports.koaJwtSecret=function(e={}){if(!e.jwksUri)throw new n("No JWKS provided. Please provide a jwksUri");const t=new o(e);return function({alg:r,kid:n}={}){return new Promise((o,s)=>{if(!i.includes(r))return s(new Error("Missing / invalid token algorithm"));t.getSigningKey(n).then(e=>{o(e.publicKey||e.rsaPublicKey)}).catch(t=>e.handleSigningKeyError?e.handleSigningKeyError(t).then(s):s(t))})}}},7914(e){var t=Object.prototype.toString;e.exports=function(e){return!0===e||!1===e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Boolean]"==t.call(e)}},7965(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(9023),i=r(5945),s=r(3254),a=r(7980),c=r(5206);let u;u=n.sign.length>3?(0,o.promisify)(n.sign):n.sign,t.default=async(e,t,r)=>{const o=(0,c.default)(e,t,"sign");if(e.startsWith("HS")){const t=n.createHmac((0,s.default)(e),o);return t.update(r),t.digest()}return u((0,i.default)(e),r,(0,a.default)(e,o))}},7974(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitLength=void 0;const n=r(6247),o=r(927);function i(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new n.JOSENotSupported(`Unsupported JWE Algorithm: ${e}`)}}t.bitLength=i,t.default=e=>(0,o.default)(new Uint8Array(i(e)>>3))},7975(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateKeyPair=t.generateSecret=void 0;const n=r(6982),o=r(9023),i=r(927),s=r(5363),a=r(6247),c=(0,o.promisify)(n.generateKeyPair);t.generateSecret=async function(e,t){let r;switch(e){case"HS256":case"HS384":case"HS512":case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":r=parseInt(e.slice(-3),10);break;case"A128KW":case"A192KW":case"A256KW":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10);break;default:throw new a.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return(0,n.createSecretKey)((0,i.default)(new Uint8Array(r>>3)))},t.generateKeyPair=async function(e,t){var r,n;switch(e){case"RS256":case"RS384":case"RS512":case"PS256":case"PS384":case"PS512":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":case"RSA1_5":{const e=null!==(r=null==t?void 0:t.modulusLength)&&void 0!==r?r:2048;if("number"!=typeof e||e<2048)throw new a.JOSENotSupported("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");const n=await c("rsa",{modulusLength:e,publicExponent:65537});return(0,s.setModulusLength)(n.privateKey,e),(0,s.setModulusLength)(n.publicKey,e),n}case"ES256":return c("ec",{namedCurve:"P-256"});case"ES256K":return c("ec",{namedCurve:"secp256k1"});case"ES384":return c("ec",{namedCurve:"P-384"});case"ES512":return c("ec",{namedCurve:"P-521"});case"EdDSA":switch(null==t?void 0:t.crv){case void 0:case"Ed25519":return c("ed25519");case"Ed448":return c("ed448");default:throw new a.JOSENotSupported("Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448")}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":const e=null!==(n=null==t?void 0:t.crv)&&void 0!==n?n:"P-256";switch(e){case void 0:case"P-256":case"P-384":case"P-521":return c("ec",{namedCurve:e});case"X25519":return c("x25519");case"X448":return c("x448");default:throw new a.JOSENotSupported("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}default:throw new a.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}}},7980(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(8960),i=r(6247),s=r(5363),a=r(1185),c={padding:n.constants.RSA_PKCS1_PSS_PADDING,saltLength:n.constants.RSA_PSS_SALTLEN_DIGEST},u=new Map([["ES256","P-256"],["ES256K","secp256k1"],["ES384","P-384"],["ES512","P-521"]]);t.default=function(e,t){switch(e){case"EdDSA":if(!["ed25519","ed448"].includes(t.asymmetricKeyType))throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448");return t;case"RS256":case"RS384":case"RS512":if("rsa"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");return(0,s.default)(t,e),t;case a.rsaPssParams&&"PS256":case a.rsaPssParams&&"PS384":case a.rsaPssParams&&"PS512":if("rsa-pss"===t.asymmetricKeyType){const{hashAlgorithm:r,mgf1HashAlgorithm:n,saltLength:o}=t.asymmetricKeyDetails,i=parseInt(e.slice(-3),10);if(void 0!==r&&(r!==`sha${i}`||n!==r))throw new TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(void 0!==o&&o>i>>3)throw new TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if("rsa"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss");return(0,s.default)(t,e),{key:t,...c};case!a.rsaPssParams&&"PS256":case!a.rsaPssParams&&"PS384":case!a.rsaPssParams&&"PS512":if("rsa"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");return(0,s.default)(t,e),{key:t,...c};case"ES256":case"ES256K":case"ES384":case"ES512":{if("ec"!==t.asymmetricKeyType)throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be ec");const r=(0,o.default)(t),n=u.get(e);if(r!==n)throw new TypeError(`Invalid key curve for the algorithm, its curve must be ${n}, got ${r}`);return{dsaEncoding:"ieee-p1363",key:t}}default:throw new i.JOSENotSupported(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}},8232(e,t){"use strict";t.qg=function(e,t){const a=new r,c=e.length;if(c<2)return a;const u=t?.decode||s;let l=0;do{const t=o(e,l,c);if(-1===t)break;const r=n(e,l,c);if(t>r){l=e.lastIndexOf(";",t-1)+1;continue}const s=i(e,l,t);void 0===a[s]&&(a[s]=u(i(e,t+1,r))),l=r+1}while(l<c);return a};Object.prototype.toString;const r=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function n(e,t,r){const n=e.indexOf(";",t);return-1===n?r:n}function o(e,t,r){const n=e.indexOf("=",t);return n<r?n:-1}function i(e,t,r){let n=t,o=r;do{const t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<o);for(;o>n;){const t=e.charCodeAt(o-1);if(32!==t&&9!==t)break;o--}return e.slice(n,o)}function s(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},8311(e,t,r){"use strict";const n=/\s+/g;class o{constructor(e,t){if(t=s(t),e instanceof o)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new o(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&y)|(this.options.loose&&m))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?l[d.HYPHENRANGELOOSE]:l[d.HYPHENRANGE];e=e.replace(o,T(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(l[d.COMPARATORTRIM],p),c("comparator trim",e),e=e.replace(l[d.TILDETRIM],f),c("tilde trim",e),e=e.replace(l[d.CARETTRIM],h),c("caret trim",e);let s=e.split(" ").map(e=>E(e,this.options)).join(" ").split(/\s+/).map(e=>C(e,this.options));n&&(s=s.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(l[d.COMPARATORLOOSE])))),c("range list",s);const u=new Map,v=s.map(e=>new a(e,this.options));for(const e of v){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const w=[...u.values()];return i.set(t,w),w}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Range is required");return this.set.some(r=>w(r,t)&&e.set.some(e=>w(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(J(this.set[t],e,this.options))return!0;return!1}}e.exports=o;const i=new(r(8794)),s=r(8587),a=r(3904),c=r(7272),u=r(3908),{safeRe:l,t:d,comparatorTrimReplace:p,tildeTrimReplace:f,caretTrimReplace:h}=r(9718),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:m}=r(6874),g=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,w=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every(e=>o.intersects(e,t)),o=n.pop();return r},E=(e,t)=>(e=e.replace(l[d.BUILD],""),c("comp",e,t),e=A(e,t),c("caret",e),e=S(e,t),c("tildes",e),e=I(e,t),c("xrange",e),e=k(e,t),c("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,S=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const r=t.loose?l[d.TILDELOOSE]:l[d.TILDE];return e.replace(r,(t,r,n,o,i)=>{let s;return c("tilde",e,t,r,n,o,i),b(r)?s="":b(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:b(o)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(c("replaceTilde pr",i),s=`>=${r}.${n}.${o}-${i} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,c("tilde return",s),s})},A=(e,t)=>e.trim().split(/\s+/).map(e=>P(e,t)).join(" "),P=(e,t)=>{c("caret",e,t);const r=t.loose?l[d.CARETLOOSE]:l[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,o,i,s)=>{let a;return c("caret",e,t,r,o,i,s),b(r)?a="":b(o)?a=`>=${r}.0.0${n} <${+r+1}.0.0-0`:b(i)?a="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:s?(c("replaceCaret pr",s),a="0"===r?"0"===o?`>=${r}.${o}.${i}-${s} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}-${s} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i}-${s} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===o?`>=${r}.${o}.${i}${n} <${r}.${o}.${+i+1}-0`:`>=${r}.${o}.${i}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${i} <${+r+1}.0.0-0`),c("caret return",a),a})},I=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>O(e,t)).join(" ")),O=(e,t)=>{e=e.trim();const r=t.loose?l[d.XRANGELOOSE]:l[d.XRANGE];return e.replace(r,(r,n,o,i,s,a)=>{c("xRange",e,r,n,o,i,s,a);const u=b(o),l=u||b(i),d=l||b(s),p=d;return"="===n&&p&&(n=""),a=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&p?(l&&(i=0),s=0,">"===n?(n=">=",l?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===n&&(n="<",l?o=+o+1:i=+i+1),"<"===n&&(a="-0"),r=`${n+o}.${i}.${s}${a}`):l?r=`>=${o}.0.0${a} <${+o+1}.0.0-0`:d&&(r=`>=${o}.${i}.0${a} <${o}.${+i+1}.0-0`),c("xRange return",r),r})},k=(e,t)=>(c("replaceStars",e,t),e.trim().replace(l[d.STAR],"")),C=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),T=e=>(t,r,n,o,i,s,a,c,u,l,d,p)=>`${r=b(n)?"":b(o)?`>=${n}.0.0${e?"-0":""}`:b(i)?`>=${n}.${o}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=b(u)?"":b(l)?`<${+u+1}.0.0-0`:b(d)?`<${u}.${+l+1}.0-0`:p?`<=${u}.${l}.${d}-${p}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim(),J=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(c(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},8396(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeJwt=void 0;const n=r(8462),o=r(5821),i=r(1855),s=r(6247);t.decodeJwt=function(e){if("string"!=typeof e)throw new s.JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:r}=e.split(".");if(5===r)throw new s.JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");if(3!==r)throw new s.JWTInvalid("Invalid JWT");if(!t)throw new s.JWTInvalid("JWTs must contain a payload");let a,c;try{a=(0,n.decode)(t)}catch{throw new s.JWTInvalid("Failed to base64url decode the payload")}try{c=JSON.parse(o.decoder.decode(a))}catch{throw new s.JWTInvalid("Failed to parse the decoded payload as JSON")}if(!(0,i.default)(c))throw new s.JWTInvalid("Invalid JWT Claims Set");return c}},8405(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6247);t.default=function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new n.JWEInvalid("PBES2 Salt Input must be 8 or more octets")}},8462(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const n=r(82);t.encode=n.encode,t.decode=n.decode},8587(e){"use strict";const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},8604(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}},8611(e){"use strict";e.exports=require("http")},8639(e,t,r){"use strict";var n=r(9831);e.exports=n.asyncMemoizer},8730(e,t,r){const n=r(5753)("jwks"),{RateLimiter:o}=r(9439),i=r(9950);e.exports.A=function(e,{jwksRequestsPerMinute:t=10}){const r=e.getSigningKey.bind(e),s=new o(t,"minute",!0);return n(`Configured rate limiting to JWKS endpoint at ${t}/minute`),async e=>await new Promise((t,o)=>{s.removeTokens(1,async(s,a)=>{if(s&&o(s),n("Requests to the JWKS endpoint available for the next minute:",a),a<0)n("Too many requests to the JWKS endpoint"),o(new i("Too many requests to the JWKS endpoint"));else try{const n=await r(e);t(n)}catch(e){o(e)}})})}},8737(e,t){"use strict";function r(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}Object.defineProperty(t,"__esModule",{value:!0}),t.withAlg=void 0,t.default=(e,...t)=>r("Key must be ",e,...t),t.withAlg=function(e,t,...n){return r(`Key for the ${e} algorithm must be `,t,...n)}},8789(e,t,r){var n,o=r(2861).Buffer,i=r(6982),s=r(2010),a=r(9023),c="secret must be a string or buffer",u="key must be a string or a buffer",l="function"==typeof i.createPublicKey;function d(e){if(!o.isBuffer(e)&&"string"!=typeof e){if(!l)throw y(u);if("object"!=typeof e)throw y(u);if("string"!=typeof e.type)throw y(u);if("string"!=typeof e.asymmetricKeyType)throw y(u);if("function"!=typeof e.export)throw y(u)}}function p(e){if(!o.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw y("key must be a string, a buffer or an object")}function f(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function h(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function y(e){var t=[].slice.call(arguments,1),r=a.format.bind(a,e).apply(null,t);return new TypeError(r)}function m(e){var t;return t=e,o.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function g(e){return function(t,r){!function(e){if(!o.isBuffer(e)){if("string"==typeof e)return e;if(!l)throw y(c);if("object"!=typeof e)throw y(c);if("secret"!==e.type)throw y(c);if("function"!=typeof e.export)throw y(c)}}(r),t=m(t);var n=i.createHmac("sha"+e,r);return f((n.update(t),n.digest("base64")))}}l&&(u+=" or a KeyObject",c+="or a KeyObject");var v="timingSafeEqual"in i?function(e,t){return e.byteLength===t.byteLength&&i.timingSafeEqual(e,t)}:function(e,t){return n||(n=r(1045)),n(e,t)};function w(e){return function(t,r,n){var i=g(e)(t,n);return v(o.from(r),o.from(i))}}function E(e){return function(t,r){p(r),t=m(t);var n=i.createSign("RSA-SHA"+e);return f((n.update(t),n.sign(r,"base64")))}}function b(e){return function(t,r,n){d(n),t=m(t),r=h(r);var o=i.createVerify("RSA-SHA"+e);return o.update(t),o.verify(n,r,"base64")}}function S(e){return function(t,r){p(r),t=m(t);var n=i.createSign("RSA-SHA"+e);return f((n.update(t),n.sign({key:r,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function _(e){return function(t,r,n){d(n),t=m(t),r=h(r);var o=i.createVerify("RSA-SHA"+e);return o.update(t),o.verify({key:n,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function A(e){var t=E(e);return function(){var r=t.apply(null,arguments);return s.derToJose(r,"ES"+e)}}function P(e){var t=b(e);return function(r,n,o){return n=s.joseToDer(n,"ES"+e).toString("base64"),t(r,n,o)}}function I(){return function(){return""}}function O(){return function(e,t){return""===t}}e.exports=function(e){var t={hs:g,rs:E,ps:S,es:A,none:I},r={hs:w,rs:b,ps:_,es:P,none:O},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw y('"%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".',e);var o=(n[1]||n[3]).toLowerCase(),i=n[2];return{sign:t[o](i),verify:r[o](i)}}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8832(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8611),o=r(5692),i=r(4434),s=r(6247),a=r(5821);t.default=async(e,t,r)=>{let c;switch(e.protocol){case"https:":c=o.get;break;case"http:":c=n.get;break;default:throw new TypeError("Unsupported URL protocol.")}const{agent:u,headers:l}=r,d=c(e.href,{agent:u,timeout:t,headers:l}),[p]=await Promise.race([(0,i.once)(d,"response"),(0,i.once)(d,"timeout")]);if(!p)throw d.destroy(),new s.JWKSTimeout;if(200!==p.statusCode)throw new s.JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");const f=[];for await(const e of p)f.push(e);try{return JSON.parse(a.decoder.decode((0,a.concat)(...f)))}catch{throw new s.JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON")}}},8928(e){var t=1/0,r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt,a=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){return"number"==typeof e&&e==function(e){var u=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==a.call(e)}(e))return NaN;if(c(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=c(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var u=o.test(e);return u||i.test(e)?s(e.slice(2),u?2:8):n.test(e)?NaN:+e}(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),l=u%1;return u==u?l?u-l:u:0}(e)}},8948(e,t,r){var n=r(2861).Buffer,o=r(2203);function i(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=n.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=n.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}r(9023).inherits(i,o),i.prototype.write=function(e){this.buffer=n.concat([this.buffer,n.from(e)]),this.emit("data",e)},i.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=i},8960(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCurve=t.weakMap=void 0;const n=r(181),o=r(6982),i=r(6247),s=r(8993),a=r(4512),c=r(8737),u=r(740),l=n.Buffer.from([42,134,72,206,61,3,1,7]),d=n.Buffer.from([43,129,4,0,34]),p=n.Buffer.from([43,129,4,0,35]),f=n.Buffer.from([43,129,4,0,10]);t.weakMap=new WeakMap;const h=(e,r)=>{var n;let y;if((0,s.isCryptoKey)(e))y=o.KeyObject.from(e);else{if(!(0,a.default)(e))throw new TypeError((0,c.default)(e,...u.types));y=e}if("secret"===y.type)throw new TypeError('only "private" or "public" type keys can be used for this operation');switch(y.asymmetricKeyType){case"ed25519":case"ed448":return`Ed${y.asymmetricKeyType.slice(2)}`;case"x25519":case"x448":return`X${y.asymmetricKeyType.slice(1)}`;case"ec":{if(t.weakMap.has(y))return t.weakMap.get(y);let e=null===(n=y.asymmetricKeyDetails)||void 0===n?void 0:n.namedCurve;if(e||"private"!==y.type){if(!e){const t=y.export({format:"der",type:"spki"}),r=t[1]<128?14:15,n=t[r],o=t.slice(r+1,r+1+n);if(o.equals(l))e="prime256v1";else if(o.equals(d))e="secp384r1";else if(o.equals(p))e="secp521r1";else{if(!o.equals(f))throw new i.JOSENotSupported("Unsupported key curve for this operation");e="secp256k1"}}}else e=h((0,o.createPublicKey)(y),!0);if(r)return e;const s=(e=>{switch(e){case"prime256v1":return"P-256";case"secp384r1":return"P-384";case"secp521r1":return"P-521";case"secp256k1":return"secp256k1";default:throw new i.JOSENotSupported("Unsupported key curve for this operation")}})(e);return t.weakMap.set(y,s),s}default:throw new TypeError("Invalid asymmetric key type for this operation")}};t.setCurve=function(e,r){t.weakMap.set(e,r)},t.default=h},8980(e,t,r){var n=r(1741),o=function(e,t){n.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};(o.prototype=Object.create(n.prototype)).constructor=o,e.exports=o},8993(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCryptoKey=void 0;const n=r(6982),o=r(9023),i=n.webcrypto;t.default=i,t.isCryptoKey=o.types.isCryptoKey?e=>o.types.isCryptoKey(e):e=>!1},9001(e){var t,r,n=Function.prototype,o=Object.prototype,i=n.toString,s=o.hasOwnProperty,a=i.call(Object),c=o.toString,u=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=c.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=u(e);if(null===t)return!0;var r=s.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&i.call(r)==a}},9023(e){"use strict";e.exports=require("util")},9060(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generalVerify=void 0;const n=r(6833),o=r(6247),i=r(1855);t.generalVerify=async function(e,t,r){if(!(0,i.default)(e))throw new o.JWSInvalid("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(i.default))throw new o.JWSInvalid("JWS Signatures missing or incorrect type");for(const o of e.signatures)try{return await(0,n.flattenedVerify)({header:o.header,payload:e.payload,protected:o.protected,signature:o.signature},t,r)}catch{}throw new o.JWSSignatureVerificationFailed}},9439(e,t,r){t.RateLimiter=r(3065),t.TokenBucket=r(5472)},9476(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0}},9589(e,t,r){"use strict";const n=r(9718),o=r(6874),i=r(3908),s=r(1123),a=r(144),c=r(6953),u=r(7414),l=r(3007),d=r(1832),p=r(2938),f=r(6254),h=r(4493),y=r(1729),m=r(560),g=r(9970),v=r(1763),w=r(909),E=r(3927),b=r(4277),S=r(5580),_=r(7059),A=r(4641),P=r(3999),I=r(4089),O=r(5200),k=r(2111),C=r(6170),T=r(3904),J=r(8311),x=r(7638),K=r(7631),R=r(9628),j=r(270),W=r(1261),$=r(3874),H=r(7075),N=r(5571),M=r(5342),L=r(6780),D=r(2525),F=r(5032);e.exports={parse:a,valid:c,clean:u,inc:l,diff:d,major:p,minor:f,patch:h,prerelease:y,compare:m,rcompare:g,compareLoose:v,compareBuild:w,sort:E,rsort:b,gt:S,lt:_,eq:A,neq:P,gte:I,lte:O,cmp:k,coerce:C,Comparator:T,Range:J,satisfies:x,toComparators:K,maxSatisfying:R,minSatisfying:j,minVersion:W,validRange:$,outside:H,gtr:N,ltr:M,intersects:L,simplifyRange:D,subset:F,SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},9590(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6982),o=r(82),i=r(1326),s=r(6247),a=r(8960),c=r(8993),u=r(4512),l=r(8737),d=r(740),p=r(1185),f=e=>{let t;if((0,c.isCryptoKey)(e)){if(!e.extractable)throw new TypeError("CryptoKey is not extractable");t=n.KeyObject.from(e)}else{if(!(0,u.default)(e)){if(e instanceof Uint8Array)return{kty:"oct",k:(0,o.encode)(e)};throw new TypeError((0,l.default)(e,...d.types,"Uint8Array"))}t=e}if(p.jwkExport){if("secret"!==t.type&&!["rsa","ec","ed25519","x25519","ed448","x448"].includes(t.asymmetricKeyType))throw new s.JOSENotSupported("Unsupported key asymmetricKeyType");return t.export({format:"jwk"})}switch(t.type){case"secret":return{kty:"oct",k:(0,o.encode)(t.export())};case"private":case"public":switch(t.asymmetricKeyType){case"rsa":{const e=t.export({format:"der",type:"pkcs1"}),r=new i.default(e);"private"===t.type&&r.unsignedInteger();const n=(0,o.encode)(r.unsignedInteger()),s=(0,o.encode)(r.unsignedInteger());let a;return"private"===t.type&&(a={d:(0,o.encode)(r.unsignedInteger()),p:(0,o.encode)(r.unsignedInteger()),q:(0,o.encode)(r.unsignedInteger()),dp:(0,o.encode)(r.unsignedInteger()),dq:(0,o.encode)(r.unsignedInteger()),qi:(0,o.encode)(r.unsignedInteger())}),r.end(),{kty:"RSA",n,e:s,...a}}case"ec":{const e=(0,a.default)(t);let r,i,c;switch(e){case"secp256k1":r=64,i=33,c=-1;break;case"P-256":r=64,i=36,c=-1;break;case"P-384":r=96,i=35,c=-3;break;case"P-521":r=132,i=35,c=-3;break;default:throw new s.JOSENotSupported("Unsupported curve")}if("public"===t.type){const n=t.export({type:"spki",format:"der"});return{kty:"EC",crv:e,x:(0,o.encode)(n.subarray(-r,-r/2)),y:(0,o.encode)(n.subarray(-r/2))}}const u=t.export({type:"pkcs8",format:"der"});return u.length<100&&(i+=c),{...f((0,n.createPublicKey)(t)),d:(0,o.encode)(u.subarray(i,i+r/2))}}case"ed25519":case"x25519":{const e=(0,a.default)(t);if("public"===t.type){const r=t.export({type:"spki",format:"der"});return{kty:"OKP",crv:e,x:(0,o.encode)(r.subarray(-32))}}const r=t.export({type:"pkcs8",format:"der"});return{...f((0,n.createPublicKey)(t)),d:(0,o.encode)(r.subarray(-32))}}case"ed448":case"x448":{const e=(0,a.default)(t);if("public"===t.type){const r=t.export({type:"spki",format:"der"});return{kty:"OKP",crv:e,x:(0,o.encode)(r.subarray("Ed448"===e?-57:-56))}}const r=t.export({type:"pkcs8",format:"der"});return{...f((0,n.createPublicKey)(t)),d:(0,o.encode)(r.subarray("Ed448"===e?-57:-56))}}default:throw new s.JOSENotSupported("Unsupported key asymmetricKeyType")}default:throw new s.JOSENotSupported("Unsupported key type")}};t.default=f},9628(e,t,r){"use strict";const n=r(3908),o=r(8311);e.exports=(e,t,r)=>{let i=null,s=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(i&&-1!==s.compare(e)||(i=e,s=new n(i,r)))}),i}},9669(e){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},9718(e,t,r){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:i}=r(6874),s=r(7272),a=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],d=t.t={};let p=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,o]],y=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=p++;s(e,o,t),d[e]=o,u[o]=t,l[o]=n,a[o]=new RegExp(t,r?"g":void 0),c[o]=new RegExp(n,r?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),y("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${f}+`),y("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),y("FULL",`^${u[d.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),y("LOOSE",`^${u[d.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),y("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),y("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),y("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?(?:$|[^\\d])`),y("COERCERTL",u[d.COERCE],!0),y("COERCERTLFULL",u[d.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",y("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),y("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",y("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",y("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},9743(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;t.default=e=>{const t=r.exec(e);if(!t)throw new TypeError("Invalid time period format");const n=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(n);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*n);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*n);case"day":case"days":case"d":return Math.round(86400*n);case"week":case"weeks":case"w":return Math.round(604800*n);default:return Math.round(31557600*n)}}},9754(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="node:crypto"},9805(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlattenedEncrypt=t.unprotected=void 0;const n=r(82),o=r(2027),i=r(7609),s=r(7974),a=r(508),c=r(6247),u=r(9476),l=r(5821),d=r(2458);t.unprotected=Symbol(),t.FlattenedEncrypt=class{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,r){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new c.JWEInvalid("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!(0,u.default)(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new c.JWEInvalid("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const p={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if((0,d.default)(c.JWEInvalid,new Map,null==r?void 0:r.crit,this._protectedHeader,p),void 0!==p.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new c.JWEInvalid('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==p.zip)throw new c.JOSENotSupported('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:f,enc:h}=p;if("string"!=typeof f||!f)throw new c.JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof h||!h)throw new c.JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let y,m,g,v,w,E,b;if("dir"===f){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===f&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let n;({cek:m,encryptedKey:y,parameters:n}=await(0,a.default)(f,h,e,this._cek,this._keyManagementParameters)),n&&(r&&t.unprotected in r?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}if(this._iv||(this._iv=(0,s.default)(h)),v=this._protectedHeader?l.encoder.encode((0,n.encode)(JSON.stringify(this._protectedHeader))):l.encoder.encode(""),this._aad?(w=(0,n.encode)(this._aad),g=(0,l.concat)(v,l.encoder.encode("."),l.encoder.encode(w))):g=v,"DEF"===p.zip){const e=await((null==r?void 0:r.deflateRaw)||i.deflate)(this._plaintext);({ciphertext:E,tag:b}=await(0,o.default)(h,e,m,this._iv,g))}else({ciphertext:E,tag:b}=await(0,o.default)(h,this._plaintext,m,this._iv,g));const S={ciphertext:(0,n.encode)(E),iv:(0,n.encode)(this._iv),tag:(0,n.encode)(b)};return y&&(S.encrypted_key=(0,n.encode)(y)),w&&(S.aad=w),this._protectedHeader&&(S.protected=l.decoder.decode(v)),this._sharedUnprotectedHeader&&(S.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(S.header=this._unprotectedHeader),S}}},9831(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.asyncMemoizer=void 0;var a=s(r(1603)),c=r(4434),u=s(r(7193)),l=r(7644),d=r(3503);function p(e){var t=new a.default(e),r=e.load,n=e.hash,s=e.bypass,d=e.itemMaxAge,p=e.freeze,f=e.clone,h=e.queueMaxAge||1e3,y=new Map,m=new c.EventEmitter,g=Object.assign({del:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=n.apply(void 0,o(e));t.del(i)},reset:function(){return t.reset()},keys:t.keys.bind(t),on:m.on.bind(m),once:m.once.bind(m)},e);if(e.disable)return Object.assign(r,g);function v(e,t){var r,n;try{for(var s=i(e),a=s.next();!a.done;a=s.next()){var c=a.value;f?setImmediate.apply(void 0,o([c],t.map(u.default))):setImmediate.apply(void 0,o([c],t))}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}function w(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];m.emit.apply(m,o([e],t))}return Object.assign(function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var a,c=e.slice(0,-1),u=e.slice(-1).pop();if(s&&s.apply(void 0,o(c)))return w.apply(void 0,o(["miss"],c)),r.apply(void 0,o(e));a=0!==c.length||n?n.apply(void 0,o(c)):"_";var f=t.get(a);if(f)return w.apply(void 0,o(["hit"],c)),v([u],[null].concat(f));var m=y.get(a);if(m&&m.expiresAt>Date.now())return m.queue.push(u),void w.apply(void 0,o(["queue"],c));w.apply(void 0,o(["miss"],c));var g=Date.now(),E=[u];y.set(a,{queue:E,expiresAt:g+h}),r.apply(void 0,o(c,[function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];e[0]||function(e,r,n){p&&n.forEach(l.deepFreeze),d?t.set(e,n,d.apply(void 0,o(r.concat(n)))):t.set(e,n)}(a,c,e.slice(1)),y.delete(a),w.apply(void 0,o(["loaded",Date.now()-g],c)),v(E,e)}]))},g)}t.asyncMemoizer=p,p.sync=d.syncMemoizer},9851(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactSign=void 0;const n=r(4329);t.CompactSign=class{constructor(e){this._flattened=new n.FlattenedSign(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}},9877(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRemoteJWKSet=void 0;const n=r(8832),o=r(6247),i=r(6980);class s extends i.LocalJWKSet{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof o.JWKSNoMatchingKey&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw r}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(0,n.default)(this._url,this._timeoutDuration,this._options).then(e=>{if(!(0,i.isJWKSLike)(e))throw new o.JWKSInvalid("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e})),await this._pendingFetch}}t.createRemoteJWKSet=function(e,t){const r=new s(e,t);return async function(e,t){return r.getKey(e,t)}}},9950(e){function t(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksRateLimitError",this.message=e}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},9970(e,t,r){"use strict";const n=r(560);e.exports=(e,t,r)=>n(t,e,r)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";r.r(n),r.d(n,{handler:()=>b,isAuthorized:()=>S});const e=require("node:crypto");function t(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}const o=require("node:fs"),i=require("node:path"),s=require("node:url");var a,c=r(8232);!function(e){e[e.none=0]="none",e[e.error=10]="error",e[e.warn=20]="warn",e[e.info=30]="info",e[e.debug=40]="debug"}(a||(a={}));class u{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map(e=>{if("object"==typeof e)try{return JSON.stringify(e)}catch{return e}return e})}info(...e){this.logLevel>=a.info&&console.log(...this.jsonify(e))}warn(...e){this.logLevel>=a.warn&&console.warn(...this.jsonify(e))}error(...e){this.logLevel>=a.error&&console.error(...this.jsonify(e))}debug(...e){this.logLevel>=a.debug&&console.trace(...this.jsonify(e))}}const l=(0,s.fileURLToPath)("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),d=i.dirname(l);function p(e,t){return{status:"307",statusDescription:"Temporary Redirect",headers:{location:[{key:"location",value:e}],...t?.cookies?{"set-cookie":t.cookies.map(e=>({key:"set-cookie",value:e}))}:{}}}}function f(e){const t={...e,region:process.env.AWS_REGION};return'<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/> </head> <body> <h1>${title}</h1> <p>${message}</p> <p> ${details} [log region: ${region}] </p> <p> <a href="${linkHref}">${linkText}</a> </p> </body> </html> '.replace(/\${([^}]*)}/g,(e,r)=>t[r]||"")}var h=r(4040),y=r.n(h),m=r(4601),g=r.n(m);let v;function w(){const t=(0,e.randomBytes)(16).toString("hex");return`${Date.now()/1e3|0}T${t}`}function E(t,r){return(0,e.createHmac)("sha256",r.nonceSigningSecret).update(t).digest("hex")}const b=function(){let e;return async t=>{e||(e=function(){const e=process.env.LAMBDA_TASK_ROOT||d,t=i.join(e,"config.json");console.log("Loading config from",t);const r=JSON.parse((0,o.readFileSync)(t,"utf-8")),n=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(r.userPoolId)[1]}.amazonaws.com/${r.userPoolId}`,s=`${n}/.well-known/jwks.json`;return{nonceMaxAge:Number.parseInt((0,c.qg)(r.cookieSettings.nonce.toLowerCase())["max-age"],10)||86400,...r,tokenIssuer:n,tokenJwksUri:s,logger:new u(a[r.logLevel])}}()),e.logger.debug("Handling event:",t);const r=function(e,t){if(!t)throw new Error("Expected response value");return{...t,headers:{...t.headers??{},...(r=e.httpHeaders,Object.entries(r).reduce((e,[t,r])=>Object.assign(e,{[t.toLowerCase()]:[{key:t,value:r}]}),{}))}};var r}(e,await(async(e,t)=>{const r=t.Records[0].cf.request,n=r.headers.host[0].value,o=`${r.uri}${r.querystring?`?${r.querystring}`:""}`,{idToken:i,refreshToken:s,nonce:a,nonceHmac:u}=function(e,t){const r=function(e){return e.cookie?e.cookie.reduce((e,t)=>({...e,...(0,c.qg)(t.value)}),{}):{}}(e);if(!r)return{};const n=`CognitoIdentityServiceProvider.${t}`,o=r[`${n}.LastAuthUser`];return{tokenUserName:o,idToken:r[`${n}.${o??""}.idToken`],accessToken:r[`${n}.${o??""}.accessToken`],refreshToken:r[`${n}.${o??""}.refreshToken`],scopes:r[`${n}.${o??""}.tokenScopesString`],nonce:r["spa-auth-edge-nonce"],nonceHmac:r["spa-auth-edge-nonce-hmac"],pkce:r["spa-auth-edge-pkce"]}}(r.headers,e.clientId);if(e.logger.debug("Extracted cookies:",{idToken:i,refreshToken:s,nonce:a,nonceHmac:u}),!i)return _({config:e,domainName:n,requestedUri:o});const l=function(e){const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(Buffer.from(t,"base64").toString())}(i),{exp:d}=l;if(e.logger.debug("ID token exp:",d,new Date(1e3*d).toISOString()),Date.now()/1e3>d-600&&s)return function({config:e,domainName:t,requestedUri:r}){e.logger.info("Redirecting to refresh endpoint");const n=w(),o=new URLSearchParams({requestedUri:r,nonce:n}).toString();return p(`https://${t}${e.refreshAuthPath}?${o}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(n)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(E(n,e))}; ${e.cookieSettings.nonce}`]})}({config:e,domainName:n,requestedUri:o});e.logger.info("Validating JWT");const h=await async function(e,t,r,n){const o=y().decode(e,{complete:!0});if(!o||"string"==typeof o)return{validationError:new Error("Cannot parse JWT token")};const i=o.header.kid,s=await async function(e,t){v||(v=g()({cache:!0,rateLimit:!0,jwksUri:e}));const r=await v.getSigningKey(t);return"rsaPublicKey"in r?r.rsaPublicKey:r.publicKey}(t,i);if(s instanceof Error)return{validationError:s};const a={audience:n,issuer:r,ignoreExpiration:!1};return new Promise(t=>y().verify(e,s,a,e=>t(e?{validationError:e}:void 0)))}(i,e.tokenJwksUri,e.tokenIssuer,e.clientId);return void 0!==h?(e.logger.debug("ID token not valid:",h.validationError),_({config:e,domainName:n,requestedUri:o})):(e.logger.info("JWT is valid"),S(e,l)?r:{body:f(m={title:"Not authorized",statusCode:"403",message:"You are not authorized for this resource.",details:"Your sign in was successful, but your user is not allowed to access this resource.",linkHref:`https://${n}${e.signOutPath}`,linkText:"Sign out"}),status:m.statusCode??"500",headers:{"content-type":[{key:"Content-Type",value:"text/html; charset=UTF-8"}]}});var m})(e,t));return e.logger.debug("Returning response:",r),r}}();function S(e,t){if(e.requireGroupAnyOf){const r=t["cognito:groups"]||[];if(!e.requireGroupAnyOf.some(e=>r.includes(e)))return!1}return!0}function _({config:e,domainName:r,requestedUri:n}){const o=w(),i={nonce:o,nonceHmac:E(o,e),...A(e)};e.logger.debug("Using new state:",i);const s=new URLSearchParams({redirect_uri:`https://${r}${e.callbackPath}`,response_type:"code",client_id:e.clientId,state:t(Buffer.from(JSON.stringify({nonce:i.nonce,requestedUri:n})).toString("base64")),scope:e.oauthScopes.join(" "),code_challenge_method:"S256",code_challenge:i.pkceHash}).toString();return p(`https://${e.cognitoAuthDomain}/oauth2/authorize?${s}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(i.nonce)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(i.nonceHmac)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-pkce=${encodeURIComponent(i.pkce)}; ${e.cookieSettings.nonce}`]})}function A(r){const n=(0,e.randomBytes)(26).toString("hex"),o={pkce:n,pkceHash:t((0,e.createHash)("sha256").update(n,"utf8").digest("base64"))};return r.logger.debug("Generated PKCE verifier:",o),o}})();var o=exports;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|