pangea-helpers 1.0.13 → 1.0.15
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/index.cjs.js +1 -1
- package/dist/index.es.js +6 -4
- package/dist/token-3d1b3c32.cjs +3 -0
- package/dist/token-3f22e6d2.js +1984 -0
- package/dist/token.cjs.js +1 -0
- package/dist/token.es.js +4 -0
- package/dist/types/helpers/token.d.ts +7 -0
- package/dist/types/index.d.ts +8 -7
- package/dist/types/token.d.ts +1 -0
- package/package.json +7 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./animation-6901ffc4.cjs"),r=require("./coin-fe1122f0.cjs"),t=require("./datetime-9d947e21.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./animation-6901ffc4.cjs"),r=require("./coin-fe1122f0.cjs"),t=require("./datetime-9d947e21.cjs"),n=require("./number-48ed1448.cjs"),o=require("./object-d8cc8ea7.cjs"),i=require("./token-3d1b3c32.cjs"),s=require("./url-4fb04989.cjs");exports.animationHelpers=e.animation;exports.coinHelpers=r.coin;exports.datetimeHelpers=t.datetime;exports.numberHelpers=n.number;exports.objectHelpers=o.object;exports.tokenHelpers=i.token;exports.urlHelpers=s.url;
|
package/dist/index.es.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { a as o } from "./animation-af1322b3.js";
|
|
2
2
|
import { c as s } from "./coin-251f810c.js";
|
|
3
|
-
import { d as
|
|
3
|
+
import { d as a } from "./datetime-dbf7ffd9.js";
|
|
4
4
|
import { n as l } from "./number-355de26b.js";
|
|
5
5
|
import { o as x } from "./object-7a404c78.js";
|
|
6
|
-
import {
|
|
6
|
+
import { t as n } from "./token-3f22e6d2.js";
|
|
7
|
+
import { u as c } from "./url-9802dbc9.js";
|
|
7
8
|
export {
|
|
8
9
|
o as animationHelpers,
|
|
9
10
|
s as coinHelpers,
|
|
10
|
-
|
|
11
|
+
a as datetimeHelpers,
|
|
11
12
|
l as numberHelpers,
|
|
12
13
|
x as objectHelpers,
|
|
13
|
-
n as
|
|
14
|
+
n as tokenHelpers,
|
|
15
|
+
c as urlHelpers
|
|
14
16
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var Kt=Object.defineProperty;var qt=(e,t,r)=>t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ne=(e,t,r)=>(qt(e,typeof t!="symbol"?t+"":t,r),r);function Wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jt(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var F={},Be={exports:{}};const Yt={},zt=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"})),j=Jt(zt);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=j,n=r.Buffer;function s(c,l){for(var a in c)l[a]=c[a]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(c,l,a){return n(c,l,a)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(c,l,a){if(typeof c=="number")throw new TypeError("Argument must not be a number");return n(c,l,a)},i.alloc=function(c,l,a){if(typeof c!="number")throw new TypeError("Argument must be a number");var o=n(c);return l!==void 0?typeof a=="string"?o.fill(l,a):o.fill(l):o.fill(0),o},i.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n(c)},i.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(Be,Be.exports);var re=Be.exports,ue=re.Buffer,Zt=j,Qt=j;function ye(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=ue.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=ue.alloc(0),e.pipe(this),this;if(e.length||typeof e=="object")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+")")}Qt.inherits(ye,Zt);ye.prototype.write=function(t){this.buffer=ue.concat([this.buffer,ue.from(t)]),this.emit("data",t)};ye.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};var Xr=ye,ee=j.Buffer,Ue=j.SlowBuffer,en=le;function le(e,t){if(!ee.isBuffer(e)||!ee.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}le.install=function(){ee.prototype.equal=Ue.prototype.equal=function(t){return le(this,t)}};var rn=ee.prototype.equal,tn=Ue.prototype.equal;le.restore=function(){ee.prototype.equal=rn,Ue.prototype.equal=tn};function Le(e){var t=(e/8|0)+(e%8===0?0:1);return t}var nn={ES256:Le(256),ES384:Le(384),ES512:Le(521)};function sn(e){var t=nn[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}var on=sn,he=re.Buffer,Kr=on,pe=128,qr=0,an=32,cn=16,fn=2,Wr=cn|an|qr<<6,me=fn|qr<<6;function un(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Jr(e){if(he.isBuffer(e))return e;if(typeof e=="string")return he.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function ln(e,t){e=Jr(e);var r=Kr(t),n=r+1,s=e.length,i=0;if(e[i++]!==Wr)throw new Error('Could not find expected "seq"');var c=e[i++];if(c===(pe|1)&&(c=e[i++]),s-i<c)throw new Error('"seq" specified length of "'+c+'", only "'+(s-i)+'" remaining');if(e[i++]!==me)throw new Error('Could not find expected "int" for "r"');var l=e[i++];if(s-i-2<l)throw new Error('"r" specified length of "'+l+'", only "'+(s-i-2)+'" available');if(n<l)throw new Error('"r" specified length of "'+l+'", max of "'+n+'" is acceptable');var a=i;if(i+=l,e[i++]!==me)throw new Error('Could not find expected "int" for "s"');var o=e[i++];if(s-i!==o)throw new Error('"s" specified length of "'+o+'", expected "'+(s-i)+'"');if(n<o)throw new Error('"s" specified length of "'+o+'", max of "'+n+'" is acceptable');var f=i;if(i+=o,i!==s)throw new Error('Expected to consume entire buffer, but "'+(s-i)+'" bytes remain');var u=r-l,w=r-o,m=he.allocUnsafe(u+l+w+o);for(i=0;i<u;++i)m[i]=0;e.copy(m,i,a+Math.max(-u,0),a+l),i=r;for(var h=i;i<h+w;++i)m[i]=0;return e.copy(m,i,f+Math.max(-w,0),f+o),m=m.toString("base64"),m=un(m),m}function sr(e,t,r){for(var n=0;t+n<r&&e[t+n]===0;)++n;var s=e[t+n]>=pe;return s&&--n,n}function hn(e,t){e=Jr(e);var r=Kr(t),n=e.length;if(n!==r*2)throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var s=sr(e,0,r),i=sr(e,r,e.length),c=r-s,l=r-i,a=1+1+c+1+1+l,o=a<pe,f=he.allocUnsafe((o?2:3)+a),u=0;return f[u++]=Wr,o?f[u++]=a:(f[u++]=pe|1,f[u++]=a&255),f[u++]=me,f[u++]=c,s<0?(f[u++]=0,u+=e.copy(f,u,0,r)):u+=e.copy(f,u,s,r),f[u++]=me,f[u++]=l,i<0?(f[u++]=0,e.copy(f,u,r)):e.copy(f,u,r+i),f}var pn={derToJose:ln,joseToDer:hn},mn=en,X=re.Buffer,G=j,Yr=pn,ir=j,dn=`"%s" is not a valid algorithm.
|
|
2
|
+
Supported algorithms are:
|
|
3
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Q="secret must be a string or buffer",M="key must be a string or a buffer",En="key must be a string, a buffer or an object",He=typeof G.createPublicKey=="function";He&&(M+=" or a KeyObject",Q+="or a KeyObject");function zr(e){if(!X.isBuffer(e)&&typeof e!="string"&&(!He||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw x(M)}function Zr(e){if(!X.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw x(En)}function $n(e){if(!X.isBuffer(e)){if(typeof e=="string")return e;if(!He||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw x(Q)}}function Me(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qr(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function x(e){var t=[].slice.call(arguments,1),r=ir.format.bind(ir,e).apply(null,t);return new TypeError(r)}function yn(e){return X.isBuffer(e)||typeof e=="string"}function te(e){return yn(e)||(e=JSON.stringify(e)),e}function et(e){return function(r,n){$n(n),r=te(r);var s=G.createHmac("sha"+e,n),i=(s.update(r),s.digest("base64"));return Me(i)}}function gn(e){return function(r,n,s){var i=et(e)(r,s);return mn(X.from(n),X.from(i))}}function rt(e){return function(r,n){Zr(n),r=te(r);var s=G.createSign("RSA-SHA"+e),i=(s.update(r),s.sign(n,"base64"));return Me(i)}}function tt(e){return function(r,n,s){zr(s),r=te(r),n=Qr(n);var i=G.createVerify("RSA-SHA"+e);return i.update(r),i.verify(s,n,"base64")}}function Sn(e){return function(r,n){Zr(n),r=te(r);var s=G.createSign("RSA-SHA"+e),i=(s.update(r),s.sign({key:n,padding:G.constants.RSA_PKCS1_PSS_PADDING,saltLength:G.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Me(i)}}function vn(e){return function(r,n,s){zr(s),r=te(r),n=Qr(n);var i=G.createVerify("RSA-SHA"+e);return i.update(r),i.verify({key:s,padding:G.constants.RSA_PKCS1_PSS_PADDING,saltLength:G.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function wn(e){var t=rt(e);return function(){var n=t.apply(null,arguments);return n=Yr.derToJose(n,"ES"+e),n}}function bn(e){var t=tt(e);return function(n,s,i){s=Yr.joseToDer(s,"ES"+e).toString("base64");var c=t(n,s,i);return c}}function In(){return function(){return""}}function Rn(){return function(t,r){return r===""}}var nt=function(t){var r={hs:et,rs:rt,ps:Sn,es:wn,none:In},n={hs:gn,rs:tt,ps:vn,es:bn,none:Rn},s=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!s)throw x(dn,t);var i=(s[1]||s[3]).toLowerCase(),c=s[2];return{sign:r[i](c),verify:n[i](c)}},Tn=j.Buffer,st=function(t){return typeof t=="string"?t:typeof t=="number"||Tn.isBuffer(t)?t.toString():JSON.stringify(t)},An=re.Buffer,or=Xr,On=nt,Nn=j,ar=st,Xe=j;function cr(e,t){return An.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ln(e,t,r){r=r||"utf8";var n=cr(ar(e),"binary"),s=cr(ar(t),r);return Xe.format("%s.%s",n,s)}function it(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,s=e.encoding,i=On(t.alg),c=Ln(t,r,s),l=i.sign(c,n);return Xe.format("%s.%s",c,l)}function ge(e){var t=e.secret||e.privateKey||e.key,r=new or(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new or(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))}Xe.inherits(ge,Nn);ge.prototype.sign=function(){try{var t=it({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};ge.sign=it;var jn=ge,ot=re.Buffer,fr=Xr,Pn=nt,_n=j,at=st,xn=j,Dn=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Cn(e){return Object.prototype.toString.call(e)==="[object Object]"}function Bn(e){if(Cn(e))return e;try{return JSON.parse(e)}catch{return}}function ct(e){var t=e.split(".",1)[0];return Bn(ot.from(t,"base64").toString("binary"))}function Gn(e){return e.split(".",2).join(".")}function ft(e){return e.split(".")[2]}function Fn(e,t){t=t||"utf8";var r=e.split(".")[1];return ot.from(r,"base64").toString(t)}function ut(e){return Dn.test(e)&&!!ct(e)}function lt(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=at(e);var s=ft(e),i=Gn(e),c=Pn(t);return c.verify(i,s,r)}function ht(e,t){if(t=t||{},e=at(e),!ut(e))return null;var r=ct(e);if(!r)return null;var n=Fn(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:ft(e)}}function J(e){e=e||{};var t=e.secret||e.publicKey||e.key,r=new fr(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new fr(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))}xn.inherits(J,_n);J.prototype.verify=function(){try{var t=lt(this.signature.buffer,this.algorithm,this.key.buffer),r=ht(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};J.decode=ht;J.isValid=ut;J.verify=lt;var Vn=J,pt=jn,Se=Vn,kn=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];F.ALGORITHMS=kn;F.sign=pt.sign;F.verify=Se.verify;F.decode=Se.decode;F.isValid=Se.isValid;F.createSign=function(t){return new pt(t)};F.createVerify=function(t){return new Se(t)};var Un=F,mt=function(e,t){t=t||{};var r=Un.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var s=JSON.parse(n);s!==null&&typeof s=="object"&&(n=s)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n},de=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};de.prototype=Object.create(Error.prototype);de.prototype.constructor=de;var ve=de,dt=ve,Ee=function(e,t){dt.call(this,e),this.name="NotBeforeError",this.date=t};Ee.prototype=Object.create(dt.prototype);Ee.prototype.constructor=Ee;var Et=Ee,$t=ve,$e=function(e,t){$t.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};$e.prototype=Object.create($t.prototype);$e.prototype.constructor=$e;var yt=$e,K=1e3,q=K*60,W=q*60,U=W*24,Hn=U*7,Mn=U*365.25,Xn=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Kn(e);if(r==="number"&&isFinite(e))return t.long?Wn(e):qn(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Kn(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\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(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Mn;case"weeks":case"week":case"w":return r*Hn;case"days":case"day":case"d":return r*U;case"hours":case"hour":case"hrs":case"hr":case"h":return r*W;case"minutes":case"minute":case"mins":case"min":case"m":return r*q;case"seconds":case"second":case"secs":case"sec":case"s":return r*K;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qn(e){var t=Math.abs(e);return t>=U?Math.round(e/U)+"d":t>=W?Math.round(e/W)+"h":t>=q?Math.round(e/q)+"m":t>=K?Math.round(e/K)+"s":e+"ms"}function Wn(e){var t=Math.abs(e);return t>=U?se(e,t,U,"day"):t>=W?se(e,t,W,"hour"):t>=q?se(e,t,q,"minute"):t>=K?se(e,t,K,"second"):e+" ms"}function se(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}var Jn=Xn,gt=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=Jn(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0},Ge={exports:{}};const Yn="2.0.0",St=256,zn=Number.MAX_SAFE_INTEGER||9007199254740991,Zn=16,Qn=St-6,es=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var we={MAX_LENGTH:St,MAX_SAFE_COMPONENT_LENGTH:Zn,MAX_SAFE_BUILD_LENGTH:Qn,MAX_SAFE_INTEGER:zn,RELEASE_TYPES:es,SEMVER_SPEC_VERSION:Yn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const rs=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var be=rs;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=we,i=be;t=e.exports={};const c=t.re=[],l=t.safeRe=[],a=t.src=[],o=t.t={};let f=0;const u="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",s],[u,n]],m=R=>{for(const[L,V]of w)R=R.split(`${L}*`).join(`${L}{0,${V}}`).split(`${L}+`).join(`${L}{1,${V}}`);return R},h=(R,L,V)=>{const A=m(L),_=f++;i(R,_,L),o[R]=_,a[_]=L,c[_]=new RegExp(L,V?"g":void 0),l[_]=new RegExp(A,V?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),h("MAINVERSION",`(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${a[o.NUMERICIDENTIFIER]}|${a[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${a[o.NUMERICIDENTIFIERLOOSE]}|${a[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${a[o.PRERELEASEIDENTIFIER]}(?:\\.${a[o.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${a[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[o.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${u}+`),h("BUILD",`(?:\\+(${a[o.BUILDIDENTIFIER]}(?:\\.${a[o.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${a[o.MAINVERSION]}${a[o.PRERELEASE]}?${a[o.BUILD]}?`),h("FULL",`^${a[o.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${a[o.MAINVERSIONLOOSE]}${a[o.PRERELEASELOOSE]}?${a[o.BUILD]}?`),h("LOOSE",`^${a[o.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${a[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${a[o.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:${a[o.PRERELEASE]})?${a[o.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:${a[o.PRERELEASELOOSE]})?${a[o.BUILD]}?)?)?`),h("XRANGE",`^${a[o.GTLT]}\\s*${a[o.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${a[o.GTLT]}\\s*${a[o.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),h("COERCE",`${a[o.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",a[o.COERCEPLAIN]+`(?:${a[o.PRERELEASE]})?(?:${a[o.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",a[o.COERCE],!0),h("COERCERTLFULL",a[o.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${a[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${a[o.LONETILDE]}${a[o.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${a[o.LONETILDE]}${a[o.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${a[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${a[o.LONECARET]}${a[o.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${a[o.LONECARET]}${a[o.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${a[o.GTLT]}\\s*(${a[o.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]}|${a[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${a[o.XRANGEPLAIN]})\\s+-\\s+(${a[o.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${a[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[o.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ge,Ge.exports);var ne=Ge.exports;const ts=Object.freeze({loose:!0}),ns=Object.freeze({}),ss=e=>e?typeof e!="object"?ts:e:ns;var Ke=ss;const ur=/^[0-9]+$/,vt=(e,t)=>{const r=ur.test(e),n=ur.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},is=(e,t)=>vt(t,e);var wt={compareIdentifiers:vt,rcompareIdentifiers:is};const ie=be,{MAX_LENGTH:lr,MAX_SAFE_INTEGER:oe}=we,{safeRe:hr,t:pr}=ne,os=Ke,{compareIdentifiers:H}=wt;let as=class B{constructor(t,r){if(r=os(r),t instanceof B){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>lr)throw new TypeError(`version is longer than ${lr} characters`);ie("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?hr[pr.LOOSE]:hr[pr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>oe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>oe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>oe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<oe)return i}return s}):this.prerelease=[],this.build=n[5]?n[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(t){if(ie("SemVer.compare",this.version,this.options,t),!(t instanceof B)){if(typeof t=="string"&&t===this.version)return 0;t=new B(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof B||(t=new B(t,this.options)),H(this.major,t.major)||H(this.minor,t.minor)||H(this.patch,t.patch)}comparePre(t){if(t instanceof B||(t=new B(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(ie("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return H(n,s)}while(++r)}compareBuild(t){t instanceof B||(t=new B(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(ie("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return H(n,s)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),H(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var N=as;const mr=N,cs=(e,t,r=!1)=>{if(e instanceof mr)return e;try{return new mr(e,t)}catch(n){if(!r)return null;throw n}};var Y=cs;const fs=Y,us=(e,t)=>{const r=fs(e,t);return r?r.version:null};var ls=us;const hs=Y,ps=(e,t)=>{const r=hs(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var ms=ps;const dr=N,ds=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new dr(e instanceof dr?e.version:e,r).inc(t,n,s).version}catch{return null}};var Es=ds;const Er=Y,$s=(e,t)=>{const r=Er(e,null,!0),n=Er(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,c=i?r:n,l=i?n:r,a=!!c.prerelease.length;if(!!l.prerelease.length&&!a)return!l.patch&&!l.minor?"major":c.patch?"patch":c.minor?"minor":"major";const f=a?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};var ys=$s;const gs=N,Ss=(e,t)=>new gs(e,t).major;var vs=Ss;const ws=N,bs=(e,t)=>new ws(e,t).minor;var Is=bs;const Rs=N,Ts=(e,t)=>new Rs(e,t).patch;var As=Ts;const Os=Y,Ns=(e,t)=>{const r=Os(e,t);return r&&r.prerelease.length?r.prerelease:null};var Ls=Ns;const $r=N,js=(e,t,r)=>new $r(e,r).compare(new $r(t,r));var D=js;const Ps=D,_s=(e,t,r)=>Ps(t,e,r);var xs=_s;const Ds=D,Cs=(e,t)=>Ds(e,t,!0);var Bs=Cs;const yr=N,Gs=(e,t,r)=>{const n=new yr(e,r),s=new yr(t,r);return n.compare(s)||n.compareBuild(s)};var qe=Gs;const Fs=qe,Vs=(e,t)=>e.sort((r,n)=>Fs(r,n,t));var ks=Vs;const Us=qe,Hs=(e,t)=>e.sort((r,n)=>Us(n,r,t));var Ms=Hs;const Xs=D,Ks=(e,t,r)=>Xs(e,t,r)>0;var Ie=Ks;const qs=D,Ws=(e,t,r)=>qs(e,t,r)<0;var We=Ws;const Js=D,Ys=(e,t,r)=>Js(e,t,r)===0;var bt=Ys;const zs=D,Zs=(e,t,r)=>zs(e,t,r)!==0;var It=Zs;const Qs=D,ei=(e,t,r)=>Qs(e,t,r)>=0;var Je=ei;const ri=D,ti=(e,t,r)=>ri(e,t,r)<=0;var Ye=ti;const ni=bt,si=It,ii=Ie,oi=Je,ai=We,ci=Ye,fi=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return ni(e,r,n);case"!=":return si(e,r,n);case">":return ii(e,r,n);case">=":return oi(e,r,n);case"<":return ai(e,r,n);case"<=":return ci(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Rt=fi;const ui=N,li=Y,{safeRe:ae,t:ce}=ne,hi=(e,t)=>{if(e instanceof ui)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?ae[ce.COERCEFULL]:ae[ce.COERCE]);else{const a=t.includePrerelease?ae[ce.COERCERTLFULL]:ae[ce.COERCERTL];let o;for(;(o=a.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||o.index+o[0].length!==r.index+r[0].length)&&(r=o),a.lastIndex=o.index+o[1].length+o[2].length;a.lastIndex=-1}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",l=t.includePrerelease&&r[6]?`+${r[6]}`:"";return li(`${n}.${s}.${i}${c}${l}`,t)};var pi=hi;class mi{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var di=mi,je,gr;function C(){if(gr)return je;gr=1;class e{constructor(p,g){if(g=n(g),p instanceof e)return p.loose===!!g.loose&&p.includePrerelease===!!g.includePrerelease?p:new e(p.raw,g);if(p instanceof s)return this.raw=p.value,this.set=[[p]],this.format(),this;if(this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map($=>this.parseRange($.trim())).filter($=>$.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const $=this.set[0];if(this.set=this.set.filter(y=>!h(y[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(const y of this.set)if(y.length===1&&R(y[0])){this.set=[y];break}}}this.format()}format(){return this.range=this.set.map(p=>p.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(p){const $=((this.options.includePrerelease&&w)|(this.options.loose&&m))+":"+p,y=r.get($);if(y)return y;const E=this.options.loose,S=E?l[a.HYPHENRANGELOOSE]:l[a.HYPHENRANGE];p=p.replace(S,Mt(this.options.includePrerelease)),i("hyphen replace",p),p=p.replace(l[a.COMPARATORTRIM],o),i("comparator trim",p),p=p.replace(l[a.TILDETRIM],f),i("tilde trim",p),p=p.replace(l[a.CARETTRIM],u),i("caret trim",p);let b=p.split(" ").map(O=>V(O,this.options)).join(" ").split(/\s+/).map(O=>Ht(O,this.options));E&&(b=b.filter(O=>(i("loose invalid filter",O,this.options),!!O.match(l[a.COMPARATORLOOSE])))),i("range list",b);const v=new Map,T=b.map(O=>new s(O,this.options));for(const O of T){if(h(O))return[O];v.set(O.value,O)}v.size>1&&v.has("")&&v.delete("");const P=[...v.values()];return r.set($,P),P}intersects(p,g){if(!(p instanceof e))throw new TypeError("a Range is required");return this.set.some($=>L($,g)&&p.set.some(y=>L(y,g)&&$.every(E=>y.every(S=>E.intersects(S,g)))))}test(p){if(!p)return!1;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}for(let g=0;g<this.set.length;g++)if(Xt(this.set[g],p,this.options))return!0;return!1}}je=e;const t=di,r=new t,n=Ke,s=Re(),i=be,c=N,{safeRe:l,t:a,comparatorTrimReplace:o,tildeTrimReplace:f,caretTrimReplace:u}=ne,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:m}=we,h=d=>d.value==="<0.0.0-0",R=d=>d.value==="",L=(d,p)=>{let g=!0;const $=d.slice();let y=$.pop();for(;g&&$.length;)g=$.every(E=>y.intersects(E,p)),y=$.pop();return g},V=(d,p)=>(i("comp",d,p),d=Gt(d,p),i("caret",d),d=_(d,p),i("tildes",d),d=Vt(d,p),i("xrange",d),d=Ut(d,p),i("stars",d),d),A=d=>!d||d.toLowerCase()==="x"||d==="*",_=(d,p)=>d.trim().split(/\s+/).map(g=>Bt(g,p)).join(" "),Bt=(d,p)=>{const g=p.loose?l[a.TILDELOOSE]:l[a.TILDE];return d.replace(g,($,y,E,S,b)=>{i("tilde",d,$,y,E,S,b);let v;return A(y)?v="":A(E)?v=`>=${y}.0.0 <${+y+1}.0.0-0`:A(S)?v=`>=${y}.${E}.0 <${y}.${+E+1}.0-0`:b?(i("replaceTilde pr",b),v=`>=${y}.${E}.${S}-${b} <${y}.${+E+1}.0-0`):v=`>=${y}.${E}.${S} <${y}.${+E+1}.0-0`,i("tilde return",v),v})},Gt=(d,p)=>d.trim().split(/\s+/).map(g=>Ft(g,p)).join(" "),Ft=(d,p)=>{i("caret",d,p);const g=p.loose?l[a.CARETLOOSE]:l[a.CARET],$=p.includePrerelease?"-0":"";return d.replace(g,(y,E,S,b,v)=>{i("caret",d,y,E,S,b,v);let T;return A(E)?T="":A(S)?T=`>=${E}.0.0${$} <${+E+1}.0.0-0`:A(b)?E==="0"?T=`>=${E}.${S}.0${$} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.0${$} <${+E+1}.0.0-0`:v?(i("replaceCaret pr",v),E==="0"?S==="0"?T=`>=${E}.${S}.${b}-${v} <${E}.${S}.${+b+1}-0`:T=`>=${E}.${S}.${b}-${v} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.${b}-${v} <${+E+1}.0.0-0`):(i("no pr"),E==="0"?S==="0"?T=`>=${E}.${S}.${b}${$} <${E}.${S}.${+b+1}-0`:T=`>=${E}.${S}.${b}${$} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.${b} <${+E+1}.0.0-0`),i("caret return",T),T})},Vt=(d,p)=>(i("replaceXRanges",d,p),d.split(/\s+/).map(g=>kt(g,p)).join(" ")),kt=(d,p)=>{d=d.trim();const g=p.loose?l[a.XRANGELOOSE]:l[a.XRANGE];return d.replace(g,($,y,E,S,b,v)=>{i("xRange",d,$,y,E,S,b,v);const T=A(E),P=T||A(S),O=P||A(b),z=O;return y==="="&&z&&(y=""),v=p.includePrerelease?"-0":"",T?y===">"||y==="<"?$="<0.0.0-0":$="*":y&&z?(P&&(S=0),b=0,y===">"?(y=">=",P?(E=+E+1,S=0,b=0):(S=+S+1,b=0)):y==="<="&&(y="<",P?E=+E+1:S=+S+1),y==="<"&&(v="-0"),$=`${y+E}.${S}.${b}${v}`):P?$=`>=${E}.0.0${v} <${+E+1}.0.0-0`:O&&($=`>=${E}.${S}.0${v} <${E}.${+S+1}.0-0`),i("xRange return",$),$})},Ut=(d,p)=>(i("replaceStars",d,p),d.trim().replace(l[a.STAR],"")),Ht=(d,p)=>(i("replaceGTE0",d,p),d.trim().replace(l[p.includePrerelease?a.GTE0PRE:a.GTE0],"")),Mt=d=>(p,g,$,y,E,S,b,v,T,P,O,z)=>(A($)?g="":A(y)?g=`>=${$}.0.0${d?"-0":""}`:A(E)?g=`>=${$}.${y}.0${d?"-0":""}`:S?g=`>=${g}`:g=`>=${g}${d?"-0":""}`,A(T)?v="":A(P)?v=`<${+T+1}.0.0-0`:A(O)?v=`<${T}.${+P+1}.0-0`:z?v=`<=${T}.${P}.${O}-${z}`:d?v=`<${T}.${P}.${+O+1}-0`:v=`<=${v}`,`${g} ${v}`.trim()),Xt=(d,p,g)=>{for(let $=0;$<d.length;$++)if(!d[$].test(p))return!1;if(p.prerelease.length&&!g.includePrerelease){for(let $=0;$<d.length;$++)if(i(d[$].semver),d[$].semver!==s.ANY&&d[$].semver.prerelease.length>0){const y=d[$].semver;if(y.major===p.major&&y.minor===p.minor&&y.patch===p.patch)return!0}return!1}return!0};return je}var Pe,Sr;function Re(){if(Sr)return Pe;Sr=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,u){if(u=r(u),f instanceof t){if(f.loose===!!u.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),c("comparator",f,u),this.options=u,this.loose=!!u.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(f){const u=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],w=f.match(u);if(!w)throw new TypeError(`Invalid comparator: ${f}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new l(w[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(c("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new l(f,this.options)}catch{return!1}return i(f,this.operator,this.semver,this.options)}intersects(f,u){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(f.value,u).test(this.value):f.operator===""?f.value===""?!0:new a(this.value,u).test(f.semver):(u=r(u),u.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||i(this.semver,"<",f.semver,u)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||i(this.semver,">",f.semver,u)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}Pe=t;const r=Ke,{safeRe:n,t:s}=ne,i=Rt,c=be,l=N,a=C();return Pe}const Ei=C(),$i=(e,t,r)=>{try{t=new Ei(t,r)}catch{return!1}return t.test(e)};var Te=$i;const yi=C(),gi=(e,t)=>new yi(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Si=gi;const vi=N,wi=C(),bi=(e,t,r)=>{let n=null,s=null,i=null;try{i=new wi(t,r)}catch{return null}return e.forEach(c=>{i.test(c)&&(!n||s.compare(c)===-1)&&(n=c,s=new vi(n,r))}),n};var Ii=bi;const Ri=N,Ti=C(),Ai=(e,t,r)=>{let n=null,s=null,i=null;try{i=new Ti(t,r)}catch{return null}return e.forEach(c=>{i.test(c)&&(!n||s.compare(c)===1)&&(n=c,s=new Ri(n,r))}),n};var Oi=Ai;const _e=N,Ni=C(),vr=Ie,Li=(e,t)=>{e=new Ni(e,t);let r=new _e("0.0.0");if(e.test(r)||(r=new _e("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(c=>{const l=new _e(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!i||vr(l,i))&&(i=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),i&&(!r||vr(r,i))&&(r=i)}return r&&e.test(r)?r:null};var ji=Li;const Pi=C(),_i=(e,t)=>{try{return new Pi(e,t).range||"*"}catch{return null}};var xi=_i;const Di=N,Tt=Re(),{ANY:Ci}=Tt,Bi=C(),Gi=Te,wr=Ie,br=We,Fi=Ye,Vi=Je,ki=(e,t,r,n)=>{e=new Di(e,n),t=new Bi(t,n);let s,i,c,l,a;switch(r){case">":s=wr,i=Fi,c=br,l=">",a=">=";break;case"<":s=br,i=Vi,c=wr,l="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gi(e,t,n))return!1;for(let o=0;o<t.set.length;++o){const f=t.set[o];let u=null,w=null;if(f.forEach(m=>{m.semver===Ci&&(m=new Tt(">=0.0.0")),u=u||m,w=w||m,s(m.semver,u.semver,n)?u=m:c(m.semver,w.semver,n)&&(w=m)}),u.operator===l||u.operator===a||(!w.operator||w.operator===l)&&i(e,w.semver))return!1;if(w.operator===a&&c(e,w.semver))return!1}return!0};var ze=ki;const Ui=ze,Hi=(e,t,r)=>Ui(e,t,">",r);var Mi=Hi;const Xi=ze,Ki=(e,t,r)=>Xi(e,t,"<",r);var qi=Ki;const Ir=C(),Wi=(e,t,r)=>(e=new Ir(e,r),t=new Ir(t,r),e.intersects(t,r));var Ji=Wi;const Yi=Te,zi=D;var Zi=(e,t,r)=>{const n=[];let s=null,i=null;const c=e.sort((f,u)=>zi(f,u,r));for(const f of c)Yi(f,t,r)?(i=f,s||(s=f)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const l=[];for(const[f,u]of n)f===u?l.push(f):!u&&f===c[0]?l.push("*"):u?f===c[0]?l.push(`<=${u}`):l.push(`${f} - ${u}`):l.push(`>=${f}`);const a=l.join(" || "),o=typeof t.raw=="string"?t.raw:String(t);return a.length<o.length?a:t};const Rr=C(),Ze=Re(),{ANY:xe}=Ze,Z=Te,Qe=D,Qi=(e,t,r={})=>{if(e===t)return!0;e=new Rr(e,r),t=new Rr(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const c=ro(s,i,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},eo=[new Ze(">=0.0.0-0")],Tr=[new Ze(">=0.0.0")],ro=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===xe){if(t.length===1&&t[0].semver===xe)return!0;r.includePrerelease?e=eo:e=Tr}if(t.length===1&&t[0].semver===xe){if(r.includePrerelease)return!0;t=Tr}const n=new Set;let s,i;for(const m of e)m.operator===">"||m.operator===">="?s=Ar(s,m,r):m.operator==="<"||m.operator==="<="?i=Or(i,m,r):n.add(m.semver);if(n.size>1)return null;let c;if(s&&i){if(c=Qe(s.semver,i.semver,r),c>0)return null;if(c===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const m of n){if(s&&!Z(m,String(s),r)||i&&!Z(m,String(i),r))return null;for(const h of t)if(!Z(m,String(h),r))return!1;return!0}let l,a,o,f,u=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,w=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;u&&u.prerelease.length===1&&i.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const m of t){if(f=f||m.operator===">"||m.operator===">=",o=o||m.operator==="<"||m.operator==="<=",s){if(w&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===w.major&&m.semver.minor===w.minor&&m.semver.patch===w.patch&&(w=!1),m.operator===">"||m.operator===">="){if(l=Ar(s,m,r),l===m&&l!==s)return!1}else if(s.operator===">="&&!Z(s.semver,String(m),r))return!1}if(i){if(u&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===u.major&&m.semver.minor===u.minor&&m.semver.patch===u.patch&&(u=!1),m.operator==="<"||m.operator==="<="){if(a=Or(i,m,r),a===m&&a!==i)return!1}else if(i.operator==="<="&&!Z(i.semver,String(m),r))return!1}if(!m.operator&&(i||s)&&c!==0)return!1}return!(s&&o&&!i&&c!==0||i&&f&&!s&&c!==0||w||u)},Ar=(e,t,r)=>{if(!e)return t;const n=Qe(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Or=(e,t,r)=>{if(!e)return t;const n=Qe(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var to=Qi;const De=ne,Nr=we,no=N,Lr=wt,so=Y,io=ls,oo=ms,ao=Es,co=ys,fo=vs,uo=Is,lo=As,ho=Ls,po=D,mo=xs,Eo=Bs,$o=qe,yo=ks,go=Ms,So=Ie,vo=We,wo=bt,bo=It,Io=Je,Ro=Ye,To=Rt,Ao=pi,Oo=Re(),No=C(),Lo=Te,jo=Si,Po=Ii,_o=Oi,xo=ji,Do=xi,Co=ze,Bo=Mi,Go=qi,Fo=Ji,Vo=Zi,ko=to;var er={parse:so,valid:io,clean:oo,inc:ao,diff:co,major:fo,minor:uo,patch:lo,prerelease:ho,compare:po,rcompare:mo,compareLoose:Eo,compareBuild:$o,sort:yo,rsort:go,gt:So,lt:vo,eq:wo,neq:bo,gte:Io,lte:Ro,cmp:To,coerce:Ao,Comparator:Oo,Range:No,satisfies:Lo,toComparators:jo,maxSatisfying:Po,minSatisfying:_o,minVersion:xo,validRange:Do,outside:Co,gtr:Bo,ltr:Go,intersects:Fo,simplifyRange:Vo,subset:ko,SemVer:no,re:De.re,src:De.src,tokens:De.t,SEMVER_SPEC_VERSION:Nr.SEMVER_SPEC_VERSION,RELEASE_TYPES:Nr.RELEASE_TYPES,compareIdentifiers:Lr.compareIdentifiers,rcompareIdentifiers:Lr.rcompareIdentifiers};const Uo=er;var Ho=Uo.satisfies(process.version,">=15.7.0");const Mo=er;var Xo=Mo.satisfies(process.version,">=16.9.0");const Ko=Ho,qo=Xo,Wo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Jo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};var At=function(e,t){if(!e||!t)return;const r=t.asymmetricKeyType;if(!r)return;const n=Wo[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(Ko)switch(r){case"ec":const s=t.asymmetricKeyDetails.namedCurve,i=Jo[e];if(s!==i)throw new Error(`"alg" parameter "${e}" requires curve "${i}".`);break;case"rsa-pss":if(qo){const c=parseInt(e.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:a,saltLength:o}=t.asymmetricKeyDetails;if(l!==`sha${c}`||a!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(o!==void 0&&o>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}},Yo=er,Ot=Yo.satisfies(process.version,"^6.12.0 || >=8.0.0");const I=ve,zo=Et,jr=yt,Zo=mt,Qo=gt,ea=At,ra=Ot,ta=F,{KeyObject:na,createSecretKey:sa,createPublicKey:ia}=j,Fe=["RS256","RS384","RS512"],oa=["ES256","ES384","ES512"],Ve=["RS256","RS384","RS512"],aa=["HS256","HS384","HS512"];ra&&(Fe.splice(Fe.length,0,"PS256","PS384","PS512"),Ve.splice(Ve.length,0,"PS256","PS384","PS512"));var ca=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let s;if(n?s=n:s=function(f,u){if(f)throw f;return u},r.clockTimestamp&&typeof r.clockTimestamp!="number")return s(new I("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return s(new I("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return s(new I("allowInvalidAsymmetricKeyTypes must be a boolean"));const i=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return s(new I("jwt must be provided"));if(typeof e!="string")return s(new I("jwt must be a string"));const c=e.split(".");if(c.length!==3)return s(new I("jwt malformed"));let l;try{l=Zo(e,{complete:!0})}catch(f){return s(f)}if(!l)return s(new I("invalid token"));const a=l.header;let o;if(typeof t=="function"){if(!n)return s(new I("verify must be called asynchronous if secret or public key is provided as a callback"));o=t}else o=function(f,u){return u(null,t)};return o(a,function(f,u){if(f)return s(new I("error in secret or public key callback: "+f.message));const w=c[2].trim()!=="";if(!w&&u)return s(new I("jwt signature is required"));if(w&&!u)return s(new I("secret or public key must be provided"));if(!w&&!r.algorithms)return s(new I('please specify "none" in "algorithms" to verify unsigned tokens'));if(u!=null&&!(u instanceof na))try{u=ia(u)}catch{try{u=sa(typeof u=="string"?Buffer.from(u):u)}catch{return s(new I("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(u.type==="secret"?r.algorithms=aa:["rsa","rsa-pss"].includes(u.asymmetricKeyType)?r.algorithms=Ve:u.asymmetricKeyType==="ec"?r.algorithms=oa:r.algorithms=Fe),r.algorithms.indexOf(l.header.alg)===-1)return s(new I("invalid algorithm"));if(a.alg.startsWith("HS")&&u.type!=="secret")return s(new I(`secretOrPublicKey must be a symmetric key when using ${a.alg}`));if(/^(?:RS|PS|ES)/.test(a.alg)&&u.type!=="public")return s(new I(`secretOrPublicKey must be an asymmetric key when using ${a.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{ea(a.alg,u)}catch(R){return s(R)}let m;try{m=ta.verify(e,l.header.alg,u)}catch(R){return s(R)}if(!m)return s(new I("invalid signature"));const h=l.payload;if(typeof h.nbf<"u"&&!r.ignoreNotBefore){if(typeof h.nbf!="number")return s(new I("invalid nbf value"));if(h.nbf>i+(r.clockTolerance||0))return s(new zo("jwt not active",new Date(h.nbf*1e3)))}if(typeof h.exp<"u"&&!r.ignoreExpiration){if(typeof h.exp!="number")return s(new I("invalid exp value"));if(i>=h.exp+(r.clockTolerance||0))return s(new jr("jwt expired",new Date(h.exp*1e3)))}if(r.audience){const R=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(h.aud)?h.aud:[h.aud]).some(function(A){return R.some(function(_){return _ instanceof RegExp?_.test(A):_===A})}))return s(new I("jwt audience invalid. expected: "+R.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&h.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(h.iss)===-1))return s(new I("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&h.sub!==r.subject)return s(new I("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&h.jti!==r.jwtid)return s(new I("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&h.nonce!==r.nonce)return s(new I("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof h.iat!="number")return s(new I("iat required when maxAge is specified"));const R=Qo(r.maxAge,h.iat);if(typeof R>"u")return s(new I('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(i>=R+(r.clockTolerance||0))return s(new jr("maxAge exceeded",new Date(R*1e3)))}if(r.complete===!0){const R=l.signature;return s(null,{header:a,payload:h,signature:R})}return s(null,h)})},Pr=1/0,Nt=9007199254740991,fa=17976931348623157e292,_r=0/0,ua="[object Arguments]",la="[object Function]",ha="[object GeneratorFunction]",pa="[object String]",ma="[object Symbol]",da=/^\s+|\s+$/g,Ea=/^[-+]0x[0-9a-f]+$/i,$a=/^0b[01]+$/i,ya=/^0o[0-7]+$/i,ga=/^(?:0|[1-9]\d*)$/,Sa=parseInt;function va(e,t){for(var r=-1,n=e?e.length:0,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}function wa(e,t,r,n){for(var s=e.length,i=r+(n?1:-1);n?i--:++i<s;)if(t(e[i],i,e))return i;return-1}function ba(e,t,r){if(t!==t)return wa(e,Ia,r);for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}function Ia(e){return e!==e}function Ra(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ta(e,t){return va(t,function(r){return e[r]})}function Aa(e,t){return function(r){return e(t(r))}}var Ae=Object.prototype,rr=Ae.hasOwnProperty,Oe=Ae.toString,Oa=Ae.propertyIsEnumerable,Na=Aa(Object.keys,Object),La=Math.max;function ja(e,t){var r=Lt(e)||Ca(e)?Ra(e.length,String):[],n=r.length,s=!!n;for(var i in e)(t||rr.call(e,i))&&!(s&&(i=="length"||_a(i,n)))&&r.push(i);return r}function Pa(e){if(!xa(e))return Na(e);var t=[];for(var r in Object(e))rr.call(e,r)&&r!="constructor"&&t.push(r);return t}function _a(e,t){return t=t??Nt,!!t&&(typeof e=="number"||ga.test(e))&&e>-1&&e%1==0&&e<t}function xa(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ae;return e===r}function Da(e,t,r,n){e=tr(e)?e:Ka(e),r=r&&!n?Ha(r):0;var s=e.length;return r<0&&(r=La(s+r,0)),Va(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&ba(e,t,r)>-1}function Ca(e){return Ba(e)&&rr.call(e,"callee")&&(!Oa.call(e,"callee")||Oe.call(e)==ua)}var Lt=Array.isArray;function tr(e){return e!=null&&Fa(e.length)&&!Ga(e)}function Ba(e){return nr(e)&&tr(e)}function Ga(e){var t=ke(e)?Oe.call(e):"";return t==la||t==ha}function Fa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Nt}function ke(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nr(e){return!!e&&typeof e=="object"}function Va(e){return typeof e=="string"||!Lt(e)&&nr(e)&&Oe.call(e)==pa}function ka(e){return typeof e=="symbol"||nr(e)&&Oe.call(e)==ma}function Ua(e){if(!e)return e===0?e:0;if(e=Ma(e),e===Pr||e===-Pr){var t=e<0?-1:1;return t*fa}return e===e?e:0}function Ha(e){var t=Ua(e),r=t%1;return t===t?r?t-r:t:0}function Ma(e){if(typeof e=="number")return e;if(ka(e))return _r;if(ke(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ke(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(da,"");var r=$a.test(e);return r||ya.test(e)?Sa(e.slice(2),r?2:8):Ea.test(e)?_r:+e}function Xa(e){return tr(e)?ja(e):Pa(e)}function Ka(e){return e?Ta(e,Xa(e)):[]}var qa=Da,Wa="[object Boolean]",Ja=Object.prototype,Ya=Ja.toString;function za(e){return e===!0||e===!1||Za(e)&&Ya.call(e)==Wa}function Za(e){return!!e&&typeof e=="object"}var Qa=za,xr=1/0,ec=17976931348623157e292,Dr=0/0,rc="[object Symbol]",tc=/^\s+|\s+$/g,nc=/^[-+]0x[0-9a-f]+$/i,sc=/^0b[01]+$/i,ic=/^0o[0-7]+$/i,oc=parseInt,ac=Object.prototype,cc=ac.toString;function fc(e){return typeof e=="number"&&e==pc(e)}function Cr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function uc(e){return!!e&&typeof e=="object"}function lc(e){return typeof e=="symbol"||uc(e)&&cc.call(e)==rc}function hc(e){if(!e)return e===0?e:0;if(e=mc(e),e===xr||e===-xr){var t=e<0?-1:1;return t*ec}return e===e?e:0}function pc(e){var t=hc(e),r=t%1;return t===t?r?t-r:t:0}function mc(e){if(typeof e=="number")return e;if(lc(e))return Dr;if(Cr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Cr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(tc,"");var r=sc.test(e);return r||ic.test(e)?oc(e.slice(2),r?2:8):nc.test(e)?Dr:+e}var dc=fc,Ec="[object Number]",$c=Object.prototype,yc=$c.toString;function gc(e){return!!e&&typeof e=="object"}function Sc(e){return typeof e=="number"||gc(e)&&yc.call(e)==Ec}var vc=Sc,wc="[object Object]";function bc(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function Ic(e,t){return function(r){return e(t(r))}}var Rc=Function.prototype,jt=Object.prototype,Pt=Rc.toString,Tc=jt.hasOwnProperty,Ac=Pt.call(Object),Oc=jt.toString,Nc=Ic(Object.getPrototypeOf,Object);function Lc(e){return!!e&&typeof e=="object"}function jc(e){if(!Lc(e)||Oc.call(e)!=wc||bc(e))return!1;var t=Nc(e);if(t===null)return!0;var r=Tc.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Pt.call(r)==Ac}var Pc=jc,_c="[object String]",xc=Object.prototype,Dc=xc.toString,Cc=Array.isArray;function Bc(e){return!!e&&typeof e=="object"}function Gc(e){return typeof e=="string"||!Cc(e)&&Bc(e)&&Dc.call(e)==_c}var Fc=Gc,Vc="Expected a function",Br=1/0,kc=17976931348623157e292,Gr=0/0,Uc="[object Symbol]",Hc=/^\s+|\s+$/g,Mc=/^[-+]0x[0-9a-f]+$/i,Xc=/^0b[01]+$/i,Kc=/^0o[0-7]+$/i,qc=parseInt,Wc=Object.prototype,Jc=Wc.toString;function Yc(e,t){var r;if(typeof t!="function")throw new TypeError(Vc);return e=rf(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function zc(e){return Yc(2,e)}function Fr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Zc(e){return!!e&&typeof e=="object"}function Qc(e){return typeof e=="symbol"||Zc(e)&&Jc.call(e)==Uc}function ef(e){if(!e)return e===0?e:0;if(e=tf(e),e===Br||e===-Br){var t=e<0?-1:1;return t*kc}return e===e?e:0}function rf(e){var t=ef(e),r=t%1;return t===t?r?t-r:t:0}function tf(e){if(typeof e=="number")return e;if(Qc(e))return Gr;if(Fr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Fr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Hc,"");var r=Xc.test(e);return r||Kc.test(e)?qc(e.slice(2),r?2:8):Mc.test(e)?Gr:+e}var nf=zc;const Vr=gt,sf=Ot,of=At,kr=F,af=qa,fe=Qa,Ur=dc,Ce=vc,_t=Pc,k=Fc,cf=nf,{KeyObject:ff,createSecretKey:uf,createPrivateKey:lf}=j,xt=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];sf&&xt.splice(3,0,"PS256","PS384","PS512");const hf={expiresIn:{isValid:function(e){return Ur(e)||k(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return Ur(e)||k(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return k(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:af.bind(null,xt),message:'"algorithm" must be a valid string enum value'},header:{isValid:_t,message:'"header" must be an object'},encoding:{isValid:k,message:'"encoding" must be a string'},issuer:{isValid:k,message:'"issuer" must be a string'},subject:{isValid:k,message:'"subject" must be a string'},jwtid:{isValid:k,message:'"jwtid" must be a string'},noTimestamp:{isValid:fe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:k,message:'"keyid" must be a string'},mutatePayload:{isValid:fe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:fe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:fe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},pf={iat:{isValid:Ce,message:'"iat" should be a number of seconds'},exp:{isValid:Ce,message:'"exp" should be a number of seconds'},nbf:{isValid:Ce,message:'"nbf" should be a number of seconds'}};function Dt(e,t,r,n){if(!_t(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(s){const i=e[s];if(!i){if(!t)throw new Error('"'+s+'" is not allowed in "'+n+'"');return}if(!i.isValid(r[s]))throw new Error(i.message)})}function mf(e){return Dt(hf,!1,e,"options")}function df(e){return Dt(pf,!0,e,"payload")}const Hr={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Ef=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];var $f=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};const s=typeof e=="object"&&!Buffer.isBuffer(e),i=Object.assign({alg:r.algorithm||"HS256",typ:s?"JWT":void 0,kid:r.keyid},r.header);function c(o){if(n)return n(o);throw o}if(!t&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof ff))try{t=lf(t)}catch{try{t=uf(typeof t=="string"?Buffer.from(t):t)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(i.alg.startsWith("HS")&&t.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${i.alg}`));if(/^(?:RS|PS|ES)/.test(i.alg)){if(t.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${i.alg}`));if(!r.allowInsecureKeySizes&&!i.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`))}if(typeof e>"u")return c(new Error("payload is required"));if(s){try{df(e)}catch(o){return c(o)}r.mutatePayload||(e=Object.assign({},e))}else{const o=Ef.filter(function(f){return typeof r[f]<"u"});if(o.length>0)return c(new Error("invalid "+o.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{mf(r)}catch(o){return c(o)}if(!r.allowInvalidAsymmetricKeyTypes)try{of(i.alg,t)}catch(o){return c(o)}const l=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:s&&(e.iat=l),typeof r.notBefore<"u"){try{e.nbf=Vr(r.notBefore,l)}catch(o){return c(o)}if(typeof e.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=Vr(r.expiresIn,l)}catch(o){return c(o)}if(typeof e.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Hr).forEach(function(o){const f=Hr[o];if(typeof r[o]<"u"){if(typeof e[f]<"u")return c(new Error('Bad "options.'+o+'" option. The payload already has an "'+f+'" property.'));e[f]=r[o]}});const a=r.encoding||"utf8";if(typeof n=="function")n=n&&cf(n),kr.createSign({header:i,privateKey:t,payload:e,encoding:a}).once("error",n).once("done",function(o){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(i.alg)&&o.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`));n(null,o)});else{let o=kr.sign({header:i,payload:e,secret:t,encoding:a});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(i.alg)&&o.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`);return o}},yf={decode:mt,verify:ca,sign:$f,JsonWebTokenError:ve,NotBeforeError:Et,TokenExpiredError:yt};const Mr=Wt(yf);class Ct{constructor(t,r){Ne(this,"secretPrivateKey","secretPrivateKey");Ne(this,"daysToExpire",30);this.secretPrivateKey=t,this.daysToExpire=r}createAccessToken(t,r){return Mr.sign({[t]:r},this.secretPrivateKey,{expiresIn:60*60*24*this.daysToExpire})}verifyAccessToken(t){return Mr.verify(t,this.secretPrivateKey)}}const gf=Object.freeze(Object.defineProperty({__proto__:null,Token:Ct},Symbol.toStringTag,{value:"Module"}));exports.Token=Ct;exports.token=gf;
|