@rebasepro/server-core 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/build-errors.txt +52 -0
  2. package/dist/api/ast-schema-editor.d.ts +21 -0
  3. package/dist/api/collections_for_test/callbacks_test_collection.d.ts +2 -0
  4. package/dist/api/errors.d.ts +53 -0
  5. package/dist/api/graphql/graphql-schema-generator.d.ts +44 -0
  6. package/dist/api/graphql/index.d.ts +1 -0
  7. package/dist/api/index.d.ts +9 -0
  8. package/dist/api/logs-routes.d.ts +37 -0
  9. package/dist/api/openapi-generator.d.ts +16 -0
  10. package/dist/api/rest/api-generator.d.ts +76 -0
  11. package/dist/api/rest/index.d.ts +1 -0
  12. package/dist/api/rest/query-parser.d.ts +8 -0
  13. package/dist/api/schema-editor-routes.d.ts +3 -0
  14. package/dist/api/server.d.ts +40 -0
  15. package/dist/api/types.d.ts +104 -0
  16. package/dist/auth/adapter-middleware.d.ts +43 -0
  17. package/dist/auth/admin-roles-route.d.ts +18 -0
  18. package/dist/auth/admin-user-ops.d.ts +79 -0
  19. package/dist/auth/admin-users-route.d.ts +28 -0
  20. package/dist/auth/api-keys/api-key-middleware.d.ts +39 -0
  21. package/dist/auth/api-keys/api-key-permission-guard.d.ts +32 -0
  22. package/dist/auth/api-keys/api-key-routes.d.ts +20 -0
  23. package/dist/auth/api-keys/api-key-store.d.ts +35 -0
  24. package/dist/auth/api-keys/api-key-types.d.ts +96 -0
  25. package/dist/auth/api-keys/index.d.ts +17 -0
  26. package/dist/auth/apple-oauth.d.ts +30 -0
  27. package/dist/auth/auth-hooks.d.ts +242 -0
  28. package/dist/auth/bitbucket-oauth.d.ts +11 -0
  29. package/dist/auth/builtin-auth-adapter.d.ts +51 -0
  30. package/dist/auth/crypto-utils.d.ts +16 -0
  31. package/dist/auth/custom-auth-adapter.d.ts +39 -0
  32. package/dist/auth/discord-oauth.d.ts +14 -0
  33. package/dist/auth/facebook-oauth.d.ts +14 -0
  34. package/dist/auth/github-oauth.d.ts +15 -0
  35. package/dist/auth/gitlab-oauth.d.ts +13 -0
  36. package/dist/auth/google-oauth.d.ts +47 -0
  37. package/dist/auth/index.d.ts +37 -0
  38. package/dist/auth/interfaces.d.ts +431 -0
  39. package/dist/auth/jwt.d.ts +55 -0
  40. package/dist/auth/linkedin-oauth.d.ts +18 -0
  41. package/dist/auth/magic-link-routes.d.ts +30 -0
  42. package/dist/auth/mfa-crypto.d.ts +23 -0
  43. package/dist/auth/mfa-routes.d.ts +7 -0
  44. package/dist/auth/mfa.d.ts +49 -0
  45. package/dist/auth/microsoft-oauth.d.ts +16 -0
  46. package/dist/auth/middleware.d.ts +113 -0
  47. package/dist/auth/password.d.ts +22 -0
  48. package/dist/auth/rate-limiter.d.ts +50 -0
  49. package/dist/auth/reset-password-admin.d.ts +29 -0
  50. package/dist/auth/rls-scope.d.ts +31 -0
  51. package/dist/auth/routes.d.ts +35 -0
  52. package/dist/auth/session-routes.d.ts +27 -0
  53. package/dist/auth/slack-oauth.d.ts +12 -0
  54. package/dist/auth/spotify-oauth.d.ts +12 -0
  55. package/dist/auth/twitter-oauth.d.ts +18 -0
  56. package/dist/backend-CIxN4FVm.js +15 -0
  57. package/dist/backend-CIxN4FVm.js.map +1 -0
  58. package/dist/base64-js-C_frYBkI.js +1687 -0
  59. package/dist/base64-js-C_frYBkI.js.map +1 -0
  60. package/dist/chunk-Dze3rakg.js +42 -0
  61. package/dist/collections/BackendCollectionRegistry.d.ts +13 -0
  62. package/dist/collections/loader.d.ts +5 -0
  63. package/dist/cron/cron-loader.d.ts +17 -0
  64. package/dist/cron/cron-routes.d.ts +14 -0
  65. package/dist/cron/cron-scheduler.d.ts +106 -0
  66. package/dist/cron/cron-store.d.ts +32 -0
  67. package/dist/cron/index.d.ts +6 -0
  68. package/dist/db/interfaces.d.ts +18 -0
  69. package/dist/dist-DMO-zF6D.js +832 -0
  70. package/dist/dist-DMO-zF6D.js.map +1 -0
  71. package/dist/email/index.d.ts +6 -0
  72. package/dist/email/smtp-email-service.d.ts +25 -0
  73. package/dist/email/templates.d.ts +50 -0
  74. package/dist/email/types.d.ts +126 -0
  75. package/dist/env.d.ts +102 -0
  76. package/dist/from-VbwD7xRf.js +3849 -0
  77. package/dist/from-VbwD7xRf.js.map +1 -0
  78. package/dist/functions/define-function.d.ts +50 -0
  79. package/dist/functions/function-loader.d.ts +17 -0
  80. package/dist/functions/function-routes.d.ts +10 -0
  81. package/dist/functions/index.d.ts +5 -0
  82. package/dist/history/history-routes.d.ts +23 -0
  83. package/dist/history/index.d.ts +1 -0
  84. package/dist/index.d.ts +31 -0
  85. package/dist/index.es.js +61322 -0
  86. package/dist/index.es.js.map +1 -0
  87. package/dist/index.umd.js +103633 -0
  88. package/dist/index.umd.js.map +1 -0
  89. package/dist/init/docs.d.ts +4 -0
  90. package/dist/init/health.d.ts +2 -0
  91. package/dist/init/middlewares.d.ts +10 -0
  92. package/dist/init/shutdown.d.ts +11 -0
  93. package/dist/init/storage.d.ts +5 -0
  94. package/dist/init.d.ts +314 -0
  95. package/dist/jws-BqRRaK11.js +616 -0
  96. package/dist/jws-BqRRaK11.js.map +1 -0
  97. package/dist/jwt-BETC8a1J.js +3560 -0
  98. package/dist/jwt-BETC8a1J.js.map +1 -0
  99. package/dist/logger-BYU66ENZ.js +94 -0
  100. package/dist/logger-BYU66ENZ.js.map +1 -0
  101. package/dist/ms-BeBSuOXN.js +125 -0
  102. package/dist/ms-BeBSuOXN.js.map +1 -0
  103. package/dist/multipart-parser-CedBDOeC.js +299 -0
  104. package/dist/multipart-parser-CedBDOeC.js.map +1 -0
  105. package/dist/serve-spa.d.ts +30 -0
  106. package/dist/services/driver-registry.d.ts +78 -0
  107. package/dist/services/routed-realtime-service.d.ts +43 -0
  108. package/dist/services/webhook-service.d.ts +29 -0
  109. package/dist/singleton.d.ts +35 -0
  110. package/dist/src-CB2PIpBe.js +1182 -0
  111. package/dist/src-CB2PIpBe.js.map +1 -0
  112. package/dist/src-DjzOT1kG.js +29746 -0
  113. package/dist/src-DjzOT1kG.js.map +1 -0
  114. package/dist/storage/GCSStorageController.d.ts +43 -0
  115. package/dist/storage/LocalStorageController.d.ts +46 -0
  116. package/dist/storage/S3StorageController.d.ts +36 -0
  117. package/dist/storage/image-transform.d.ts +50 -0
  118. package/dist/storage/index.d.ts +31 -0
  119. package/dist/storage/routes.d.ts +70 -0
  120. package/dist/storage/storage-registry.d.ts +78 -0
  121. package/dist/storage/tus-handler.d.ts +53 -0
  122. package/dist/storage/types.d.ts +128 -0
  123. package/dist/types/index.d.ts +11 -0
  124. package/dist/utils/dev-port.d.ts +37 -0
  125. package/dist/utils/logger.d.ts +31 -0
  126. package/dist/utils/logging.d.ts +9 -0
  127. package/dist/utils/request-id.d.ts +4 -0
  128. package/dist/utils/request-logger.d.ts +19 -0
  129. package/dist/utils/sql.d.ts +27 -0
  130. package/package.json +22 -14
  131. package/src/api/graphql/graphql-schema-generator.ts +5 -5
  132. package/src/api/openapi-generator.ts +2 -2
  133. package/src/api/rest/api-generator.ts +44 -123
  134. package/src/api/rest/query-parser.ts +6 -23
  135. package/src/api/types.ts +2 -2
  136. package/src/auth/auth-hooks.ts +1 -1
  137. package/src/auth/builtin-auth-adapter.ts +1 -2
  138. package/src/auth/interfaces.ts +11 -2
  139. package/src/auth/middleware.ts +4 -4
  140. package/src/auth/routes.ts +1 -2
  141. package/src/functions/define-function.ts +59 -0
  142. package/src/functions/function-loader.ts +16 -0
  143. package/src/functions/index.ts +2 -0
  144. package/src/index.ts +70 -37
  145. package/src/init.ts +78 -21
  146. package/src/storage/GCSStorageController.ts +334 -0
  147. package/src/storage/index.ts +9 -3
  148. package/src/storage/routes.ts +191 -23
  149. package/src/storage/tus-handler.ts +16 -4
  150. package/src/storage/types.ts +25 -3
  151. package/test/api-generator.test.ts +1 -1
  152. package/test/auth-config-types.test.ts +40 -0
  153. package/test/define-function.test.ts +45 -0
  154. package/test/storage-routes.test.ts +160 -0
  155. package/test/backend-hooks-data.test.ts +0 -477
@@ -0,0 +1,3560 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ import process from "process";
3
+ __createRequire(import.meta.url);
4
+ import { i as __require, o as __toESM, r as __exportAll, t as __commonJSMin } from "./chunk-Dze3rakg.js";
5
+ import { t as logger } from "./logger-BYU66ENZ.js";
6
+ import { t as require_jws } from "./jws-BqRRaK11.js";
7
+ import { t as require_ms } from "./ms-BeBSuOXN.js";
8
+ import { createHash, randomBytes } from "crypto";
9
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/decode.js
10
+ var require_decode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11
+ var jws = require_jws();
12
+ module.exports = function(jwt, options) {
13
+ options = options || {};
14
+ var decoded = jws.decode(jwt, options);
15
+ if (!decoded) return null;
16
+ var payload = decoded.payload;
17
+ if (typeof payload === "string") try {
18
+ var obj = JSON.parse(payload);
19
+ if (obj !== null && typeof obj === "object") payload = obj;
20
+ } catch (e) {}
21
+ if (options.complete === true) return {
22
+ header: decoded.header,
23
+ payload,
24
+ signature: decoded.signature
25
+ };
26
+ return payload;
27
+ };
28
+ }));
29
+ //#endregion
30
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/JsonWebTokenError.js
31
+ var require_JsonWebTokenError = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32
+ var JsonWebTokenError = function(message, error) {
33
+ Error.call(this, message);
34
+ if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
35
+ this.name = "JsonWebTokenError";
36
+ this.message = message;
37
+ if (error) this.inner = error;
38
+ };
39
+ JsonWebTokenError.prototype = Object.create(Error.prototype);
40
+ JsonWebTokenError.prototype.constructor = JsonWebTokenError;
41
+ module.exports = JsonWebTokenError;
42
+ }));
43
+ //#endregion
44
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/NotBeforeError.js
45
+ var require_NotBeforeError = /* @__PURE__ */ __commonJSMin(((exports, module) => {
46
+ var JsonWebTokenError = require_JsonWebTokenError();
47
+ var NotBeforeError = function(message, date) {
48
+ JsonWebTokenError.call(this, message);
49
+ this.name = "NotBeforeError";
50
+ this.date = date;
51
+ };
52
+ NotBeforeError.prototype = Object.create(JsonWebTokenError.prototype);
53
+ NotBeforeError.prototype.constructor = NotBeforeError;
54
+ module.exports = NotBeforeError;
55
+ }));
56
+ //#endregion
57
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/TokenExpiredError.js
58
+ var require_TokenExpiredError = /* @__PURE__ */ __commonJSMin(((exports, module) => {
59
+ var JsonWebTokenError = require_JsonWebTokenError();
60
+ var TokenExpiredError = function(message, expiredAt) {
61
+ JsonWebTokenError.call(this, message);
62
+ this.name = "TokenExpiredError";
63
+ this.expiredAt = expiredAt;
64
+ };
65
+ TokenExpiredError.prototype = Object.create(JsonWebTokenError.prototype);
66
+ TokenExpiredError.prototype.constructor = TokenExpiredError;
67
+ module.exports = TokenExpiredError;
68
+ }));
69
+ //#endregion
70
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/timespan.js
71
+ var require_timespan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
72
+ var ms = require_ms();
73
+ module.exports = function(time, iat) {
74
+ var timestamp = iat || Math.floor(Date.now() / 1e3);
75
+ if (typeof time === "string") {
76
+ var milliseconds = ms(time);
77
+ if (typeof milliseconds === "undefined") return;
78
+ return Math.floor(timestamp + milliseconds / 1e3);
79
+ } else if (typeof time === "number") return timestamp + time;
80
+ else return;
81
+ };
82
+ }));
83
+ //#endregion
84
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js
85
+ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86
+ var SEMVER_SPEC_VERSION = "2.0.0";
87
+ var MAX_LENGTH = 256;
88
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
89
+ module.exports = {
90
+ MAX_LENGTH,
91
+ MAX_SAFE_COMPONENT_LENGTH: 16,
92
+ MAX_SAFE_BUILD_LENGTH: MAX_LENGTH - 6,
93
+ MAX_SAFE_INTEGER,
94
+ RELEASE_TYPES: [
95
+ "major",
96
+ "premajor",
97
+ "minor",
98
+ "preminor",
99
+ "patch",
100
+ "prepatch",
101
+ "prerelease"
102
+ ],
103
+ SEMVER_SPEC_VERSION,
104
+ FLAG_INCLUDE_PRERELEASE: 1,
105
+ FLAG_LOOSE: 2
106
+ };
107
+ }));
108
+ //#endregion
109
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js
110
+ var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
111
+ module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
112
+ }));
113
+ //#endregion
114
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
115
+ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
116
+ var { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
117
+ var debug = require_debug();
118
+ exports = module.exports = {};
119
+ var re = exports.re = [];
120
+ var safeRe = exports.safeRe = [];
121
+ var src = exports.src = [];
122
+ var safeSrc = exports.safeSrc = [];
123
+ var t = exports.t = {};
124
+ var R = 0;
125
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
126
+ var safeRegexReplacements = [
127
+ ["\\s", 1],
128
+ ["\\d", MAX_LENGTH],
129
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
130
+ ];
131
+ var makeSafeRegex = (value) => {
132
+ for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
133
+ return value;
134
+ };
135
+ var createToken = (name, value, isGlobal) => {
136
+ const safe = makeSafeRegex(value);
137
+ const index = R++;
138
+ debug(name, index, value);
139
+ t[name] = index;
140
+ src[index] = value;
141
+ safeSrc[index] = safe;
142
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
143
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
144
+ };
145
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
146
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
147
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
148
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
149
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
150
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
151
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
152
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
153
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
154
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
155
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
156
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
157
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
158
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
159
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
160
+ createToken("GTLT", "((?:<|>)?=?)");
161
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
162
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
163
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
164
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
165
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
166
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
167
+ createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
168
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
169
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
170
+ createToken("COERCERTL", src[t.COERCE], true);
171
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
172
+ createToken("LONETILDE", "(?:~>?)");
173
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
174
+ exports.tildeTrimReplace = "$1~";
175
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
176
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
177
+ createToken("LONECARET", "(?:\\^)");
178
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
179
+ exports.caretTrimReplace = "$1^";
180
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
181
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
182
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
183
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
184
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
185
+ exports.comparatorTrimReplace = "$1$2$3";
186
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
187
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
188
+ createToken("STAR", "(<|>)?=?\\s*\\*");
189
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
190
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
191
+ }));
192
+ //#endregion
193
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
194
+ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
195
+ var looseOption = Object.freeze({ loose: true });
196
+ var emptyOpts = Object.freeze({});
197
+ var parseOptions = (options) => {
198
+ if (!options) return emptyOpts;
199
+ if (typeof options !== "object") return looseOption;
200
+ return options;
201
+ };
202
+ module.exports = parseOptions;
203
+ }));
204
+ //#endregion
205
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
206
+ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
207
+ var numeric = /^[0-9]+$/;
208
+ var compareIdentifiers = (a, b) => {
209
+ if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
210
+ const anum = numeric.test(a);
211
+ const bnum = numeric.test(b);
212
+ if (anum && bnum) {
213
+ a = +a;
214
+ b = +b;
215
+ }
216
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
217
+ };
218
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
219
+ module.exports = {
220
+ compareIdentifiers,
221
+ rcompareIdentifiers
222
+ };
223
+ }));
224
+ //#endregion
225
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
226
+ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
227
+ var debug = require_debug();
228
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
229
+ var { safeRe: re, t } = require_re();
230
+ var parseOptions = require_parse_options();
231
+ var { compareIdentifiers } = require_identifiers();
232
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
233
+ const identifiers = identifier.split(".");
234
+ if (identifiers.length > prerelease.length) return false;
235
+ for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
236
+ return true;
237
+ };
238
+ module.exports = class SemVer {
239
+ constructor(version, options) {
240
+ options = parseOptions(options);
241
+ if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
242
+ else version = version.version;
243
+ else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
244
+ if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
245
+ debug("SemVer", version, options);
246
+ this.options = options;
247
+ this.loose = !!options.loose;
248
+ this.includePrerelease = !!options.includePrerelease;
249
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
250
+ if (!m) throw new TypeError(`Invalid Version: ${version}`);
251
+ this.raw = version;
252
+ this.major = +m[1];
253
+ this.minor = +m[2];
254
+ this.patch = +m[3];
255
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
256
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
257
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
258
+ if (!m[4]) this.prerelease = [];
259
+ else this.prerelease = m[4].split(".").map((id) => {
260
+ if (/^[0-9]+$/.test(id)) {
261
+ const num = +id;
262
+ if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
263
+ }
264
+ return id;
265
+ });
266
+ this.build = m[5] ? m[5].split(".") : [];
267
+ this.format();
268
+ }
269
+ format() {
270
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
271
+ if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
272
+ return this.version;
273
+ }
274
+ toString() {
275
+ return this.version;
276
+ }
277
+ compare(other) {
278
+ debug("SemVer.compare", this.version, this.options, other);
279
+ if (!(other instanceof SemVer)) {
280
+ if (typeof other === "string" && other === this.version) return 0;
281
+ other = new SemVer(other, this.options);
282
+ }
283
+ if (other.version === this.version) return 0;
284
+ return this.compareMain(other) || this.comparePre(other);
285
+ }
286
+ compareMain(other) {
287
+ if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
288
+ if (this.major < other.major) return -1;
289
+ if (this.major > other.major) return 1;
290
+ if (this.minor < other.minor) return -1;
291
+ if (this.minor > other.minor) return 1;
292
+ if (this.patch < other.patch) return -1;
293
+ if (this.patch > other.patch) return 1;
294
+ return 0;
295
+ }
296
+ comparePre(other) {
297
+ if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
298
+ if (this.prerelease.length && !other.prerelease.length) return -1;
299
+ else if (!this.prerelease.length && other.prerelease.length) return 1;
300
+ else if (!this.prerelease.length && !other.prerelease.length) return 0;
301
+ let i = 0;
302
+ do {
303
+ const a = this.prerelease[i];
304
+ const b = other.prerelease[i];
305
+ debug("prerelease compare", i, a, b);
306
+ if (a === void 0 && b === void 0) return 0;
307
+ else if (b === void 0) return 1;
308
+ else if (a === void 0) return -1;
309
+ else if (a === b) continue;
310
+ else return compareIdentifiers(a, b);
311
+ } while (++i);
312
+ }
313
+ compareBuild(other) {
314
+ if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
315
+ let i = 0;
316
+ do {
317
+ const a = this.build[i];
318
+ const b = other.build[i];
319
+ debug("build compare", i, a, b);
320
+ if (a === void 0 && b === void 0) return 0;
321
+ else if (b === void 0) return 1;
322
+ else if (a === void 0) return -1;
323
+ else if (a === b) continue;
324
+ else return compareIdentifiers(a, b);
325
+ } while (++i);
326
+ }
327
+ inc(release, identifier, identifierBase) {
328
+ if (release.startsWith("pre")) {
329
+ if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
330
+ if (identifier) {
331
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
332
+ if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
333
+ }
334
+ }
335
+ switch (release) {
336
+ case "premajor":
337
+ this.prerelease.length = 0;
338
+ this.patch = 0;
339
+ this.minor = 0;
340
+ this.major++;
341
+ this.inc("pre", identifier, identifierBase);
342
+ break;
343
+ case "preminor":
344
+ this.prerelease.length = 0;
345
+ this.patch = 0;
346
+ this.minor++;
347
+ this.inc("pre", identifier, identifierBase);
348
+ break;
349
+ case "prepatch":
350
+ this.prerelease.length = 0;
351
+ this.inc("patch", identifier, identifierBase);
352
+ this.inc("pre", identifier, identifierBase);
353
+ break;
354
+ case "prerelease":
355
+ if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
356
+ this.inc("pre", identifier, identifierBase);
357
+ break;
358
+ case "release":
359
+ if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
360
+ this.prerelease.length = 0;
361
+ break;
362
+ case "major":
363
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
364
+ this.minor = 0;
365
+ this.patch = 0;
366
+ this.prerelease = [];
367
+ break;
368
+ case "minor":
369
+ if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
370
+ this.patch = 0;
371
+ this.prerelease = [];
372
+ break;
373
+ case "patch":
374
+ if (this.prerelease.length === 0) this.patch++;
375
+ this.prerelease = [];
376
+ break;
377
+ case "pre": {
378
+ const base = Number(identifierBase) ? 1 : 0;
379
+ if (this.prerelease.length === 0) this.prerelease = [base];
380
+ else {
381
+ let i = this.prerelease.length;
382
+ while (--i >= 0) if (typeof this.prerelease[i] === "number") {
383
+ this.prerelease[i]++;
384
+ i = -2;
385
+ }
386
+ if (i === -1) {
387
+ if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
388
+ this.prerelease.push(base);
389
+ }
390
+ }
391
+ if (identifier) {
392
+ let prerelease = [identifier, base];
393
+ if (identifierBase === false) prerelease = [identifier];
394
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
395
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
396
+ if (isNaN(prereleaseBase)) this.prerelease = prerelease;
397
+ } else this.prerelease = prerelease;
398
+ }
399
+ break;
400
+ }
401
+ default: throw new Error(`invalid increment argument: ${release}`);
402
+ }
403
+ this.raw = this.format();
404
+ if (this.build.length) this.raw += `+${this.build.join(".")}`;
405
+ return this;
406
+ }
407
+ };
408
+ }));
409
+ //#endregion
410
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
411
+ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
412
+ var SemVer = require_semver$1();
413
+ var parse = (version, options, throwErrors = false) => {
414
+ if (version instanceof SemVer) return version;
415
+ try {
416
+ return new SemVer(version, options);
417
+ } catch (er) {
418
+ if (!throwErrors) return null;
419
+ throw er;
420
+ }
421
+ };
422
+ module.exports = parse;
423
+ }));
424
+ //#endregion
425
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
426
+ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
427
+ var parse = require_parse();
428
+ var valid = (version, options) => {
429
+ const v = parse(version, options);
430
+ return v ? v.version : null;
431
+ };
432
+ module.exports = valid;
433
+ }));
434
+ //#endregion
435
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
436
+ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
437
+ var parse = require_parse();
438
+ var clean = (version, options) => {
439
+ const s = parse(version.trim().replace(/^[=v]+/, ""), options);
440
+ return s ? s.version : null;
441
+ };
442
+ module.exports = clean;
443
+ }));
444
+ //#endregion
445
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
446
+ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
447
+ var SemVer = require_semver$1();
448
+ var inc = (version, release, options, identifier, identifierBase) => {
449
+ if (typeof options === "string") {
450
+ identifierBase = identifier;
451
+ identifier = options;
452
+ options = void 0;
453
+ }
454
+ try {
455
+ return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
456
+ } catch (er) {
457
+ return null;
458
+ }
459
+ };
460
+ module.exports = inc;
461
+ }));
462
+ //#endregion
463
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
464
+ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
465
+ var parse = require_parse();
466
+ var diff = (version1, version2) => {
467
+ const v1 = parse(version1, null, true);
468
+ const v2 = parse(version2, null, true);
469
+ const comparison = v1.compare(v2);
470
+ if (comparison === 0) return null;
471
+ const v1Higher = comparison > 0;
472
+ const highVersion = v1Higher ? v1 : v2;
473
+ const lowVersion = v1Higher ? v2 : v1;
474
+ const highHasPre = !!highVersion.prerelease.length;
475
+ if (!!lowVersion.prerelease.length && !highHasPre) {
476
+ if (!lowVersion.patch && !lowVersion.minor) return "major";
477
+ if (lowVersion.compareMain(highVersion) === 0) {
478
+ if (lowVersion.minor && !lowVersion.patch) return "minor";
479
+ return "patch";
480
+ }
481
+ }
482
+ const prefix = highHasPre ? "pre" : "";
483
+ if (v1.major !== v2.major) return prefix + "major";
484
+ if (v1.minor !== v2.minor) return prefix + "minor";
485
+ if (v1.patch !== v2.patch) return prefix + "patch";
486
+ return "prerelease";
487
+ };
488
+ module.exports = diff;
489
+ }));
490
+ //#endregion
491
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
492
+ var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
493
+ var SemVer = require_semver$1();
494
+ var major = (a, loose) => new SemVer(a, loose).major;
495
+ module.exports = major;
496
+ }));
497
+ //#endregion
498
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
499
+ var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
500
+ var SemVer = require_semver$1();
501
+ var minor = (a, loose) => new SemVer(a, loose).minor;
502
+ module.exports = minor;
503
+ }));
504
+ //#endregion
505
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
506
+ var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
507
+ var SemVer = require_semver$1();
508
+ var patch = (a, loose) => new SemVer(a, loose).patch;
509
+ module.exports = patch;
510
+ }));
511
+ //#endregion
512
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
513
+ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
514
+ var parse = require_parse();
515
+ var prerelease = (version, options) => {
516
+ const parsed = parse(version, options);
517
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
518
+ };
519
+ module.exports = prerelease;
520
+ }));
521
+ //#endregion
522
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
523
+ var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
524
+ var SemVer = require_semver$1();
525
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
526
+ module.exports = compare;
527
+ }));
528
+ //#endregion
529
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
530
+ var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
531
+ var compare = require_compare();
532
+ var rcompare = (a, b, loose) => compare(b, a, loose);
533
+ module.exports = rcompare;
534
+ }));
535
+ //#endregion
536
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
537
+ var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
538
+ var compare = require_compare();
539
+ var compareLoose = (a, b) => compare(a, b, true);
540
+ module.exports = compareLoose;
541
+ }));
542
+ //#endregion
543
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
544
+ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
545
+ var SemVer = require_semver$1();
546
+ var compareBuild = (a, b, loose) => {
547
+ const versionA = new SemVer(a, loose);
548
+ const versionB = new SemVer(b, loose);
549
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
550
+ };
551
+ module.exports = compareBuild;
552
+ }));
553
+ //#endregion
554
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
555
+ var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
556
+ var compareBuild = require_compare_build();
557
+ var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
558
+ module.exports = sort;
559
+ }));
560
+ //#endregion
561
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
562
+ var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
563
+ var compareBuild = require_compare_build();
564
+ var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
565
+ module.exports = rsort;
566
+ }));
567
+ //#endregion
568
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
569
+ var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
570
+ var compare = require_compare();
571
+ var gt = (a, b, loose) => compare(a, b, loose) > 0;
572
+ module.exports = gt;
573
+ }));
574
+ //#endregion
575
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
576
+ var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
577
+ var compare = require_compare();
578
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
579
+ module.exports = lt;
580
+ }));
581
+ //#endregion
582
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
583
+ var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
584
+ var compare = require_compare();
585
+ var eq = (a, b, loose) => compare(a, b, loose) === 0;
586
+ module.exports = eq;
587
+ }));
588
+ //#endregion
589
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
590
+ var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
591
+ var compare = require_compare();
592
+ var neq = (a, b, loose) => compare(a, b, loose) !== 0;
593
+ module.exports = neq;
594
+ }));
595
+ //#endregion
596
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
597
+ var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
598
+ var compare = require_compare();
599
+ var gte = (a, b, loose) => compare(a, b, loose) >= 0;
600
+ module.exports = gte;
601
+ }));
602
+ //#endregion
603
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
604
+ var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
605
+ var compare = require_compare();
606
+ var lte = (a, b, loose) => compare(a, b, loose) <= 0;
607
+ module.exports = lte;
608
+ }));
609
+ //#endregion
610
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
611
+ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
612
+ var eq = require_eq();
613
+ var neq = require_neq();
614
+ var gt = require_gt();
615
+ var gte = require_gte();
616
+ var lt = require_lt();
617
+ var lte = require_lte();
618
+ var cmp = (a, op, b, loose) => {
619
+ switch (op) {
620
+ case "===":
621
+ if (typeof a === "object") a = a.version;
622
+ if (typeof b === "object") b = b.version;
623
+ return a === b;
624
+ case "!==":
625
+ if (typeof a === "object") a = a.version;
626
+ if (typeof b === "object") b = b.version;
627
+ return a !== b;
628
+ case "":
629
+ case "=":
630
+ case "==": return eq(a, b, loose);
631
+ case "!=": return neq(a, b, loose);
632
+ case ">": return gt(a, b, loose);
633
+ case ">=": return gte(a, b, loose);
634
+ case "<": return lt(a, b, loose);
635
+ case "<=": return lte(a, b, loose);
636
+ default: throw new TypeError(`Invalid operator: ${op}`);
637
+ }
638
+ };
639
+ module.exports = cmp;
640
+ }));
641
+ //#endregion
642
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
643
+ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
644
+ var SemVer = require_semver$1();
645
+ var parse = require_parse();
646
+ var { safeRe: re, t } = require_re();
647
+ var coerce = (version, options) => {
648
+ if (version instanceof SemVer) return version;
649
+ if (typeof version === "number") version = String(version);
650
+ if (typeof version !== "string") return null;
651
+ options = options || {};
652
+ let match = null;
653
+ if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
654
+ else {
655
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
656
+ let next;
657
+ while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
658
+ if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
659
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
660
+ }
661
+ coerceRtlRegex.lastIndex = -1;
662
+ }
663
+ if (match === null) return null;
664
+ const major = match[2];
665
+ return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
666
+ };
667
+ module.exports = coerce;
668
+ }));
669
+ //#endregion
670
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
671
+ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
672
+ var parse = require_parse();
673
+ var constants = require_constants();
674
+ var SemVer = require_semver$1();
675
+ var truncate = (version, truncation, options) => {
676
+ if (!constants.RELEASE_TYPES.includes(truncation)) return null;
677
+ const clonedVersion = cloneInputVersion(version, options);
678
+ return clonedVersion && doTruncation(clonedVersion, truncation);
679
+ };
680
+ var cloneInputVersion = (version, options) => {
681
+ return parse(version instanceof SemVer ? version.version : version, options);
682
+ };
683
+ var doTruncation = (version, truncation) => {
684
+ if (isPrerelease(truncation)) return version.version;
685
+ version.prerelease = [];
686
+ switch (truncation) {
687
+ case "major":
688
+ version.minor = 0;
689
+ version.patch = 0;
690
+ break;
691
+ case "minor":
692
+ version.patch = 0;
693
+ break;
694
+ }
695
+ return version.format();
696
+ };
697
+ var isPrerelease = (type) => {
698
+ return type.startsWith("pre");
699
+ };
700
+ module.exports = truncate;
701
+ }));
702
+ //#endregion
703
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/lrucache.js
704
+ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
705
+ var LRUCache = class {
706
+ constructor() {
707
+ this.max = 1e3;
708
+ this.map = /* @__PURE__ */ new Map();
709
+ }
710
+ get(key) {
711
+ const value = this.map.get(key);
712
+ if (value === void 0) return;
713
+ else {
714
+ this.map.delete(key);
715
+ this.map.set(key, value);
716
+ return value;
717
+ }
718
+ }
719
+ delete(key) {
720
+ return this.map.delete(key);
721
+ }
722
+ set(key, value) {
723
+ if (!this.delete(key) && value !== void 0) {
724
+ if (this.map.size >= this.max) {
725
+ const firstKey = this.map.keys().next().value;
726
+ this.delete(firstKey);
727
+ }
728
+ this.map.set(key, value);
729
+ }
730
+ return this;
731
+ }
732
+ };
733
+ module.exports = LRUCache;
734
+ }));
735
+ //#endregion
736
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js
737
+ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
738
+ var SPACE_CHARACTERS = /\s+/g;
739
+ module.exports = class Range {
740
+ constructor(range, options) {
741
+ options = parseOptions(options);
742
+ if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
743
+ else return new Range(range.raw, options);
744
+ if (range instanceof Comparator) {
745
+ this.raw = range.value;
746
+ this.set = [[range]];
747
+ this.formatted = void 0;
748
+ return this;
749
+ }
750
+ this.options = options;
751
+ this.loose = !!options.loose;
752
+ this.includePrerelease = !!options.includePrerelease;
753
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
754
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
755
+ if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
756
+ if (this.set.length > 1) {
757
+ const first = this.set[0];
758
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
759
+ if (this.set.length === 0) this.set = [first];
760
+ else if (this.set.length > 1) {
761
+ for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
762
+ this.set = [c];
763
+ break;
764
+ }
765
+ }
766
+ }
767
+ this.formatted = void 0;
768
+ }
769
+ get range() {
770
+ if (this.formatted === void 0) {
771
+ this.formatted = "";
772
+ for (let i = 0; i < this.set.length; i++) {
773
+ if (i > 0) this.formatted += "||";
774
+ const comps = this.set[i];
775
+ for (let k = 0; k < comps.length; k++) {
776
+ if (k > 0) this.formatted += " ";
777
+ this.formatted += comps[k].toString().trim();
778
+ }
779
+ }
780
+ }
781
+ return this.formatted;
782
+ }
783
+ format() {
784
+ return this.range;
785
+ }
786
+ toString() {
787
+ return this.range;
788
+ }
789
+ parseRange(range) {
790
+ range = range.replace(BUILDSTRIPRE, "");
791
+ const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
792
+ const cached = cache.get(memoKey);
793
+ if (cached) return cached;
794
+ const loose = this.options.loose;
795
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
796
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
797
+ debug("hyphen replace", range);
798
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
799
+ debug("comparator trim", range);
800
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
801
+ debug("tilde trim", range);
802
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
803
+ debug("caret trim", range);
804
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
805
+ if (loose) rangeList = rangeList.filter((comp) => {
806
+ debug("loose invalid filter", comp, this.options);
807
+ return !!comp.match(re[t.COMPARATORLOOSE]);
808
+ });
809
+ debug("range list", rangeList);
810
+ const rangeMap = /* @__PURE__ */ new Map();
811
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
812
+ for (const comp of comparators) {
813
+ if (isNullSet(comp)) return [comp];
814
+ rangeMap.set(comp.value, comp);
815
+ }
816
+ if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
817
+ const result = [...rangeMap.values()];
818
+ cache.set(memoKey, result);
819
+ return result;
820
+ }
821
+ intersects(range, options) {
822
+ if (!(range instanceof Range)) throw new TypeError("a Range is required");
823
+ return this.set.some((thisComparators) => {
824
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
825
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
826
+ return rangeComparators.every((rangeComparator) => {
827
+ return thisComparator.intersects(rangeComparator, options);
828
+ });
829
+ });
830
+ });
831
+ });
832
+ }
833
+ test(version) {
834
+ if (!version) return false;
835
+ if (typeof version === "string") try {
836
+ version = new SemVer(version, this.options);
837
+ } catch (er) {
838
+ return false;
839
+ }
840
+ for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
841
+ return false;
842
+ }
843
+ };
844
+ var cache = new (require_lrucache())();
845
+ var parseOptions = require_parse_options();
846
+ var Comparator = require_comparator();
847
+ var debug = require_debug();
848
+ var SemVer = require_semver$1();
849
+ var { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
850
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
851
+ var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
852
+ var isNullSet = (c) => c.value === "<0.0.0-0";
853
+ var isAny = (c) => c.value === "";
854
+ var isSatisfiable = (comparators, options) => {
855
+ let result = true;
856
+ const remainingComparators = comparators.slice();
857
+ let testComparator = remainingComparators.pop();
858
+ while (result && remainingComparators.length) {
859
+ result = remainingComparators.every((otherComparator) => {
860
+ return testComparator.intersects(otherComparator, options);
861
+ });
862
+ testComparator = remainingComparators.pop();
863
+ }
864
+ return result;
865
+ };
866
+ var parseComparator = (comp, options) => {
867
+ comp = comp.replace(re[t.BUILD], "");
868
+ debug("comp", comp, options);
869
+ comp = replaceCarets(comp, options);
870
+ debug("caret", comp);
871
+ comp = replaceTildes(comp, options);
872
+ debug("tildes", comp);
873
+ comp = replaceXRanges(comp, options);
874
+ debug("xrange", comp);
875
+ comp = replaceStars(comp, options);
876
+ debug("stars", comp);
877
+ return comp;
878
+ };
879
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
880
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
881
+ var replaceTildes = (comp, options) => {
882
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
883
+ };
884
+ var replaceTilde = (comp, options) => {
885
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
886
+ return comp.replace(r, (_, M, m, p, pr) => {
887
+ debug("tilde", comp, _, M, m, p, pr);
888
+ let ret;
889
+ if (isX(M)) ret = "";
890
+ else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
891
+ else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
892
+ else if (pr) {
893
+ debug("replaceTilde pr", pr);
894
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
895
+ } else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
896
+ debug("tilde return", ret);
897
+ return ret;
898
+ });
899
+ };
900
+ var replaceCarets = (comp, options) => {
901
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
902
+ };
903
+ var replaceCaret = (comp, options) => {
904
+ debug("caret", comp, options);
905
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
906
+ const z = options.includePrerelease ? "-0" : "";
907
+ return comp.replace(r, (_, M, m, p, pr) => {
908
+ debug("caret", comp, _, M, m, p, pr);
909
+ let ret;
910
+ if (isX(M)) ret = "";
911
+ else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
912
+ else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
913
+ else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
914
+ else if (pr) {
915
+ debug("replaceCaret pr", pr);
916
+ if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
917
+ else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
918
+ else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
919
+ } else {
920
+ debug("no pr");
921
+ if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
922
+ else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
923
+ else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
924
+ }
925
+ debug("caret return", ret);
926
+ return ret;
927
+ });
928
+ };
929
+ var replaceXRanges = (comp, options) => {
930
+ debug("replaceXRanges", comp, options);
931
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
932
+ };
933
+ var replaceXRange = (comp, options) => {
934
+ comp = comp.trim();
935
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
936
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
937
+ debug("xRange", comp, ret, gtlt, M, m, p, pr);
938
+ if (invalidXRangeOrder(M, m, p)) return comp;
939
+ const xM = isX(M);
940
+ const xm = xM || isX(m);
941
+ const xp = xm || isX(p);
942
+ const anyX = xp;
943
+ if (gtlt === "=" && anyX) gtlt = "";
944
+ pr = options.includePrerelease ? "-0" : "";
945
+ if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
946
+ else ret = "*";
947
+ else if (gtlt && anyX) {
948
+ if (xm) m = 0;
949
+ p = 0;
950
+ if (gtlt === ">") {
951
+ gtlt = ">=";
952
+ if (xm) {
953
+ M = +M + 1;
954
+ m = 0;
955
+ p = 0;
956
+ } else {
957
+ m = +m + 1;
958
+ p = 0;
959
+ }
960
+ } else if (gtlt === "<=") {
961
+ gtlt = "<";
962
+ if (xm) M = +M + 1;
963
+ else m = +m + 1;
964
+ }
965
+ if (gtlt === "<") pr = "-0";
966
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
967
+ } else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
968
+ else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
969
+ debug("xRange return", ret);
970
+ return ret;
971
+ });
972
+ };
973
+ var replaceStars = (comp, options) => {
974
+ debug("replaceStars", comp, options);
975
+ return comp.trim().replace(re[t.STAR], "");
976
+ };
977
+ var replaceGTE0 = (comp, options) => {
978
+ debug("replaceGTE0", comp, options);
979
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
980
+ };
981
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
982
+ if (isX(fM)) from = "";
983
+ else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
984
+ else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
985
+ else if (fpr) from = `>=${from}`;
986
+ else from = `>=${from}${incPr ? "-0" : ""}`;
987
+ if (isX(tM)) to = "";
988
+ else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
989
+ else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
990
+ else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
991
+ else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
992
+ else to = `<=${to}`;
993
+ return `${from} ${to}`.trim();
994
+ };
995
+ var testSet = (set, version, options) => {
996
+ for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
997
+ if (version.prerelease.length && !options.includePrerelease) {
998
+ for (let i = 0; i < set.length; i++) {
999
+ debug(set[i].semver);
1000
+ if (set[i].semver === Comparator.ANY) continue;
1001
+ if (set[i].semver.prerelease.length > 0) {
1002
+ const allowed = set[i].semver;
1003
+ if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
1004
+ }
1005
+ }
1006
+ return false;
1007
+ }
1008
+ return true;
1009
+ };
1010
+ }));
1011
+ //#endregion
1012
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js
1013
+ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1014
+ var ANY = Symbol("SemVer ANY");
1015
+ module.exports = class Comparator {
1016
+ static get ANY() {
1017
+ return ANY;
1018
+ }
1019
+ constructor(comp, options) {
1020
+ options = parseOptions(options);
1021
+ if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
1022
+ else comp = comp.value;
1023
+ comp = comp.trim().split(/\s+/).join(" ");
1024
+ debug("comparator", comp, options);
1025
+ this.options = options;
1026
+ this.loose = !!options.loose;
1027
+ this.parse(comp);
1028
+ if (this.semver === ANY) this.value = "";
1029
+ else this.value = this.operator + this.semver.version;
1030
+ debug("comp", this);
1031
+ }
1032
+ parse(comp) {
1033
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1034
+ const m = comp.match(r);
1035
+ if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
1036
+ this.operator = m[1] !== void 0 ? m[1] : "";
1037
+ if (this.operator === "=") this.operator = "";
1038
+ if (!m[2]) this.semver = ANY;
1039
+ else this.semver = new SemVer(m[2], this.options.loose);
1040
+ }
1041
+ toString() {
1042
+ return this.value;
1043
+ }
1044
+ test(version) {
1045
+ debug("Comparator.test", version, this.options.loose);
1046
+ if (this.semver === ANY || version === ANY) return true;
1047
+ if (typeof version === "string") try {
1048
+ version = new SemVer(version, this.options);
1049
+ } catch (er) {
1050
+ return false;
1051
+ }
1052
+ return cmp(version, this.operator, this.semver, this.options);
1053
+ }
1054
+ intersects(comp, options) {
1055
+ if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
1056
+ if (this.operator === "") {
1057
+ if (this.value === "") return true;
1058
+ return new Range(comp.value, options).test(this.value);
1059
+ } else if (comp.operator === "") {
1060
+ if (comp.value === "") return true;
1061
+ return new Range(this.value, options).test(comp.semver);
1062
+ }
1063
+ options = parseOptions(options);
1064
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
1065
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
1066
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
1067
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
1068
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
1069
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
1070
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
1071
+ return false;
1072
+ }
1073
+ };
1074
+ var parseOptions = require_parse_options();
1075
+ var { safeRe: re, t } = require_re();
1076
+ var cmp = require_cmp();
1077
+ var debug = require_debug();
1078
+ var SemVer = require_semver$1();
1079
+ var Range = require_range();
1080
+ }));
1081
+ //#endregion
1082
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
1083
+ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1084
+ var Range = require_range();
1085
+ var satisfies = (version, range, options) => {
1086
+ try {
1087
+ range = new Range(range, options);
1088
+ } catch (er) {
1089
+ return false;
1090
+ }
1091
+ return range.test(version);
1092
+ };
1093
+ module.exports = satisfies;
1094
+ }));
1095
+ //#endregion
1096
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
1097
+ var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1098
+ var Range = require_range();
1099
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
1100
+ module.exports = toComparators;
1101
+ }));
1102
+ //#endregion
1103
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
1104
+ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1105
+ var SemVer = require_semver$1();
1106
+ var Range = require_range();
1107
+ var maxSatisfying = (versions, range, options) => {
1108
+ let max = null;
1109
+ let maxSV = null;
1110
+ let rangeObj = null;
1111
+ try {
1112
+ rangeObj = new Range(range, options);
1113
+ } catch (er) {
1114
+ return null;
1115
+ }
1116
+ versions.forEach((v) => {
1117
+ if (rangeObj.test(v)) {
1118
+ if (!max || maxSV.compare(v) === -1) {
1119
+ max = v;
1120
+ maxSV = new SemVer(max, options);
1121
+ }
1122
+ }
1123
+ });
1124
+ return max;
1125
+ };
1126
+ module.exports = maxSatisfying;
1127
+ }));
1128
+ //#endregion
1129
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
1130
+ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1131
+ var SemVer = require_semver$1();
1132
+ var Range = require_range();
1133
+ var minSatisfying = (versions, range, options) => {
1134
+ let min = null;
1135
+ let minSV = null;
1136
+ let rangeObj = null;
1137
+ try {
1138
+ rangeObj = new Range(range, options);
1139
+ } catch (er) {
1140
+ return null;
1141
+ }
1142
+ versions.forEach((v) => {
1143
+ if (rangeObj.test(v)) {
1144
+ if (!min || minSV.compare(v) === 1) {
1145
+ min = v;
1146
+ minSV = new SemVer(min, options);
1147
+ }
1148
+ }
1149
+ });
1150
+ return min;
1151
+ };
1152
+ module.exports = minSatisfying;
1153
+ }));
1154
+ //#endregion
1155
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-version.js
1156
+ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1157
+ var SemVer = require_semver$1();
1158
+ var Range = require_range();
1159
+ var gt = require_gt();
1160
+ var minVersion = (range, loose) => {
1161
+ range = new Range(range, loose);
1162
+ let minver = new SemVer("0.0.0");
1163
+ if (range.test(minver)) return minver;
1164
+ minver = new SemVer("0.0.0-0");
1165
+ if (range.test(minver)) return minver;
1166
+ minver = null;
1167
+ for (let i = 0; i < range.set.length; ++i) {
1168
+ const comparators = range.set[i];
1169
+ let setMin = null;
1170
+ comparators.forEach((comparator) => {
1171
+ const compver = new SemVer(comparator.semver.version);
1172
+ switch (comparator.operator) {
1173
+ case ">":
1174
+ if (compver.prerelease.length === 0) compver.patch++;
1175
+ else compver.prerelease.push(0);
1176
+ compver.raw = compver.format();
1177
+ case "":
1178
+ case ">=":
1179
+ if (!setMin || gt(compver, setMin)) setMin = compver;
1180
+ break;
1181
+ case "<":
1182
+ case "<=": break;
1183
+ /* istanbul ignore next */
1184
+ default: throw new Error(`Unexpected operation: ${comparator.operator}`);
1185
+ }
1186
+ });
1187
+ if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
1188
+ }
1189
+ if (minver && range.test(minver)) return minver;
1190
+ return null;
1191
+ };
1192
+ module.exports = minVersion;
1193
+ }));
1194
+ //#endregion
1195
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/valid.js
1196
+ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1197
+ var Range = require_range();
1198
+ var validRange = (range, options) => {
1199
+ try {
1200
+ return new Range(range, options).range || "*";
1201
+ } catch (er) {
1202
+ return null;
1203
+ }
1204
+ };
1205
+ module.exports = validRange;
1206
+ }));
1207
+ //#endregion
1208
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/outside.js
1209
+ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1210
+ var SemVer = require_semver$1();
1211
+ var Comparator = require_comparator();
1212
+ var { ANY } = Comparator;
1213
+ var Range = require_range();
1214
+ var satisfies = require_satisfies();
1215
+ var gt = require_gt();
1216
+ var lt = require_lt();
1217
+ var lte = require_lte();
1218
+ var gte = require_gte();
1219
+ var outside = (version, range, hilo, options) => {
1220
+ version = new SemVer(version, options);
1221
+ range = new Range(range, options);
1222
+ let gtfn, ltefn, ltfn, comp, ecomp;
1223
+ switch (hilo) {
1224
+ case ">":
1225
+ gtfn = gt;
1226
+ ltefn = lte;
1227
+ ltfn = lt;
1228
+ comp = ">";
1229
+ ecomp = ">=";
1230
+ break;
1231
+ case "<":
1232
+ gtfn = lt;
1233
+ ltefn = gte;
1234
+ ltfn = gt;
1235
+ comp = "<";
1236
+ ecomp = "<=";
1237
+ break;
1238
+ default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
1239
+ }
1240
+ if (satisfies(version, range, options)) return false;
1241
+ for (let i = 0; i < range.set.length; ++i) {
1242
+ const comparators = range.set[i];
1243
+ let high = null;
1244
+ let low = null;
1245
+ comparators.forEach((comparator) => {
1246
+ if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
1247
+ high = high || comparator;
1248
+ low = low || comparator;
1249
+ if (gtfn(comparator.semver, high.semver, options)) high = comparator;
1250
+ else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
1251
+ });
1252
+ if (high.operator === comp || high.operator === ecomp) return false;
1253
+ if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
1254
+ else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
1255
+ }
1256
+ return true;
1257
+ };
1258
+ module.exports = outside;
1259
+ }));
1260
+ //#endregion
1261
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
1262
+ var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1263
+ var outside = require_outside();
1264
+ var gtr = (version, range, options) => outside(version, range, ">", options);
1265
+ module.exports = gtr;
1266
+ }));
1267
+ //#endregion
1268
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
1269
+ var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1270
+ var outside = require_outside();
1271
+ var ltr = (version, range, options) => outside(version, range, "<", options);
1272
+ module.exports = ltr;
1273
+ }));
1274
+ //#endregion
1275
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
1276
+ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1277
+ var Range = require_range();
1278
+ var intersects = (r1, r2, options) => {
1279
+ r1 = new Range(r1, options);
1280
+ r2 = new Range(r2, options);
1281
+ return r1.intersects(r2, options);
1282
+ };
1283
+ module.exports = intersects;
1284
+ }));
1285
+ //#endregion
1286
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
1287
+ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1288
+ var satisfies = require_satisfies();
1289
+ var compare = require_compare();
1290
+ module.exports = (versions, range, options) => {
1291
+ const set = [];
1292
+ let first = null;
1293
+ let prev = null;
1294
+ const v = versions.sort((a, b) => compare(a, b, options));
1295
+ for (const version of v) if (satisfies(version, range, options)) {
1296
+ prev = version;
1297
+ if (!first) first = version;
1298
+ } else {
1299
+ if (prev) set.push([first, prev]);
1300
+ prev = null;
1301
+ first = null;
1302
+ }
1303
+ if (first) set.push([first, null]);
1304
+ const ranges = [];
1305
+ for (const [min, max] of set) if (min === max) ranges.push(min);
1306
+ else if (!max && min === v[0]) ranges.push("*");
1307
+ else if (!max) ranges.push(`>=${min}`);
1308
+ else if (min === v[0]) ranges.push(`<=${max}`);
1309
+ else ranges.push(`${min} - ${max}`);
1310
+ const simplified = ranges.join(" || ");
1311
+ const original = typeof range.raw === "string" ? range.raw : String(range);
1312
+ return simplified.length < original.length ? simplified : range;
1313
+ };
1314
+ }));
1315
+ //#endregion
1316
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
1317
+ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1318
+ var Range = require_range();
1319
+ var Comparator = require_comparator();
1320
+ var { ANY } = Comparator;
1321
+ var satisfies = require_satisfies();
1322
+ var compare = require_compare();
1323
+ var subset = (sub, dom, options = {}) => {
1324
+ if (sub === dom) return true;
1325
+ sub = new Range(sub, options);
1326
+ dom = new Range(dom, options);
1327
+ let sawNonNull = false;
1328
+ OUTER: for (const simpleSub of sub.set) {
1329
+ for (const simpleDom of dom.set) {
1330
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
1331
+ sawNonNull = sawNonNull || isSub !== null;
1332
+ if (isSub) continue OUTER;
1333
+ }
1334
+ if (sawNonNull) return false;
1335
+ }
1336
+ return true;
1337
+ };
1338
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
1339
+ var minimumVersion = [new Comparator(">=0.0.0")];
1340
+ var simpleSubset = (sub, dom, options) => {
1341
+ if (sub === dom) return true;
1342
+ if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
1343
+ else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
1344
+ else sub = minimumVersion;
1345
+ if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
1346
+ else dom = minimumVersion;
1347
+ const eqSet = /* @__PURE__ */ new Set();
1348
+ let gt, lt;
1349
+ for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
1350
+ else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
1351
+ else eqSet.add(c.semver);
1352
+ if (eqSet.size > 1) return null;
1353
+ let gtltComp;
1354
+ if (gt && lt) {
1355
+ gtltComp = compare(gt.semver, lt.semver, options);
1356
+ if (gtltComp > 0) return null;
1357
+ else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
1358
+ }
1359
+ for (const eq of eqSet) {
1360
+ if (gt && !satisfies(eq, String(gt), options)) return null;
1361
+ if (lt && !satisfies(eq, String(lt), options)) return null;
1362
+ for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
1363
+ return true;
1364
+ }
1365
+ let higher, lower;
1366
+ let hasDomLT, hasDomGT;
1367
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
1368
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
1369
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
1370
+ for (const c of dom) {
1371
+ hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
1372
+ hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
1373
+ if (gt) {
1374
+ if (needDomGTPre) {
1375
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
1376
+ }
1377
+ if (c.operator === ">" || c.operator === ">=") {
1378
+ higher = higherGT(gt, c, options);
1379
+ if (higher === c && higher !== gt) return false;
1380
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
1381
+ }
1382
+ if (lt) {
1383
+ if (needDomLTPre) {
1384
+ if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
1385
+ }
1386
+ if (c.operator === "<" || c.operator === "<=") {
1387
+ lower = lowerLT(lt, c, options);
1388
+ if (lower === c && lower !== lt) return false;
1389
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
1390
+ }
1391
+ if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
1392
+ }
1393
+ if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
1394
+ if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
1395
+ if (needDomGTPre || needDomLTPre) return false;
1396
+ return true;
1397
+ };
1398
+ var higherGT = (a, b, options) => {
1399
+ if (!a) return b;
1400
+ const comp = compare(a.semver, b.semver, options);
1401
+ return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
1402
+ };
1403
+ var lowerLT = (a, b, options) => {
1404
+ if (!a) return b;
1405
+ const comp = compare(a.semver, b.semver, options);
1406
+ return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
1407
+ };
1408
+ module.exports = subset;
1409
+ }));
1410
+ //#endregion
1411
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/index.js
1412
+ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1413
+ var internalRe = require_re();
1414
+ var constants = require_constants();
1415
+ var SemVer = require_semver$1();
1416
+ var identifiers = require_identifiers();
1417
+ module.exports = {
1418
+ parse: require_parse(),
1419
+ valid: require_valid$1(),
1420
+ clean: require_clean(),
1421
+ inc: require_inc(),
1422
+ diff: require_diff(),
1423
+ major: require_major(),
1424
+ minor: require_minor(),
1425
+ patch: require_patch(),
1426
+ prerelease: require_prerelease(),
1427
+ compare: require_compare(),
1428
+ rcompare: require_rcompare(),
1429
+ compareLoose: require_compare_loose(),
1430
+ compareBuild: require_compare_build(),
1431
+ sort: require_sort(),
1432
+ rsort: require_rsort(),
1433
+ gt: require_gt(),
1434
+ lt: require_lt(),
1435
+ eq: require_eq(),
1436
+ neq: require_neq(),
1437
+ gte: require_gte(),
1438
+ lte: require_lte(),
1439
+ cmp: require_cmp(),
1440
+ coerce: require_coerce(),
1441
+ truncate: require_truncate(),
1442
+ Comparator: require_comparator(),
1443
+ Range: require_range(),
1444
+ satisfies: require_satisfies(),
1445
+ toComparators: require_to_comparators(),
1446
+ maxSatisfying: require_max_satisfying(),
1447
+ minSatisfying: require_min_satisfying(),
1448
+ minVersion: require_min_version(),
1449
+ validRange: require_valid(),
1450
+ outside: require_outside(),
1451
+ gtr: require_gtr(),
1452
+ ltr: require_ltr(),
1453
+ intersects: require_intersects(),
1454
+ simplifyRange: require_simplify(),
1455
+ subset: require_subset(),
1456
+ SemVer,
1457
+ re: internalRe.re,
1458
+ src: internalRe.src,
1459
+ tokens: internalRe.t,
1460
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
1461
+ RELEASE_TYPES: constants.RELEASE_TYPES,
1462
+ compareIdentifiers: identifiers.compareIdentifiers,
1463
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
1464
+ };
1465
+ }));
1466
+ //#endregion
1467
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js
1468
+ var require_asymmetricKeyDetailsSupported = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1469
+ module.exports = require_semver().satisfies(process.version, ">=15.7.0");
1470
+ }));
1471
+ //#endregion
1472
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js
1473
+ var require_rsaPssKeyDetailsSupported = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1474
+ module.exports = require_semver().satisfies(process.version, ">=16.9.0");
1475
+ }));
1476
+ //#endregion
1477
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js
1478
+ var require_validateAsymmetricKey = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1479
+ var ASYMMETRIC_KEY_DETAILS_SUPPORTED = require_asymmetricKeyDetailsSupported();
1480
+ var RSA_PSS_KEY_DETAILS_SUPPORTED = require_rsaPssKeyDetailsSupported();
1481
+ var allowedAlgorithmsForKeys = {
1482
+ "ec": [
1483
+ "ES256",
1484
+ "ES384",
1485
+ "ES512"
1486
+ ],
1487
+ "rsa": [
1488
+ "RS256",
1489
+ "PS256",
1490
+ "RS384",
1491
+ "PS384",
1492
+ "RS512",
1493
+ "PS512"
1494
+ ],
1495
+ "rsa-pss": [
1496
+ "PS256",
1497
+ "PS384",
1498
+ "PS512"
1499
+ ]
1500
+ };
1501
+ var allowedCurves = {
1502
+ ES256: "prime256v1",
1503
+ ES384: "secp384r1",
1504
+ ES512: "secp521r1"
1505
+ };
1506
+ module.exports = function(algorithm, key) {
1507
+ if (!algorithm || !key) return;
1508
+ const keyType = key.asymmetricKeyType;
1509
+ if (!keyType) return;
1510
+ const allowedAlgorithms = allowedAlgorithmsForKeys[keyType];
1511
+ if (!allowedAlgorithms) throw new Error(`Unknown key type "${keyType}".`);
1512
+ if (!allowedAlgorithms.includes(algorithm)) throw new Error(`"alg" parameter for "${keyType}" key type must be one of: ${allowedAlgorithms.join(", ")}.`);
1513
+ /* istanbul ignore next */
1514
+ if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) switch (keyType) {
1515
+ case "ec":
1516
+ const keyCurve = key.asymmetricKeyDetails.namedCurve;
1517
+ const allowedCurve = allowedCurves[algorithm];
1518
+ if (keyCurve !== allowedCurve) throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`);
1519
+ break;
1520
+ case "rsa-pss":
1521
+ if (RSA_PSS_KEY_DETAILS_SUPPORTED) {
1522
+ const length = parseInt(algorithm.slice(-3), 10);
1523
+ const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key.asymmetricKeyDetails;
1524
+ if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`);
1525
+ if (saltLength !== void 0 && saltLength > length >> 3) throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${algorithm}.`);
1526
+ }
1527
+ break;
1528
+ }
1529
+ };
1530
+ }));
1531
+ //#endregion
1532
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/psSupported.js
1533
+ var require_psSupported = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1534
+ module.exports = require_semver().satisfies(process.version, "^6.12.0 || >=8.0.0");
1535
+ }));
1536
+ //#endregion
1537
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/verify.js
1538
+ var require_verify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1539
+ var JsonWebTokenError = require_JsonWebTokenError();
1540
+ var NotBeforeError = require_NotBeforeError();
1541
+ var TokenExpiredError = require_TokenExpiredError();
1542
+ var decode = require_decode();
1543
+ var timespan = require_timespan();
1544
+ var validateAsymmetricKey = require_validateAsymmetricKey();
1545
+ var PS_SUPPORTED = require_psSupported();
1546
+ var jws = require_jws();
1547
+ var { KeyObject: KeyObject$1, createSecretKey: createSecretKey$1, createPublicKey } = __require("crypto");
1548
+ var PUB_KEY_ALGS = [
1549
+ "RS256",
1550
+ "RS384",
1551
+ "RS512"
1552
+ ];
1553
+ var EC_KEY_ALGS = [
1554
+ "ES256",
1555
+ "ES384",
1556
+ "ES512"
1557
+ ];
1558
+ var RSA_KEY_ALGS = [
1559
+ "RS256",
1560
+ "RS384",
1561
+ "RS512"
1562
+ ];
1563
+ var HS_ALGS = [
1564
+ "HS256",
1565
+ "HS384",
1566
+ "HS512"
1567
+ ];
1568
+ if (PS_SUPPORTED) {
1569
+ PUB_KEY_ALGS.splice(PUB_KEY_ALGS.length, 0, "PS256", "PS384", "PS512");
1570
+ RSA_KEY_ALGS.splice(RSA_KEY_ALGS.length, 0, "PS256", "PS384", "PS512");
1571
+ }
1572
+ module.exports = function(jwtString, secretOrPublicKey, options, callback) {
1573
+ if (typeof options === "function" && !callback) {
1574
+ callback = options;
1575
+ options = {};
1576
+ }
1577
+ if (!options) options = {};
1578
+ options = Object.assign({}, options);
1579
+ let done;
1580
+ if (callback) done = callback;
1581
+ else done = function(err, data) {
1582
+ if (err) throw err;
1583
+ return data;
1584
+ };
1585
+ if (options.clockTimestamp && typeof options.clockTimestamp !== "number") return done(new JsonWebTokenError("clockTimestamp must be a number"));
1586
+ if (options.nonce !== void 0 && (typeof options.nonce !== "string" || options.nonce.trim() === "")) return done(new JsonWebTokenError("nonce must be a non-empty string"));
1587
+ if (options.allowInvalidAsymmetricKeyTypes !== void 0 && typeof options.allowInvalidAsymmetricKeyTypes !== "boolean") return done(new JsonWebTokenError("allowInvalidAsymmetricKeyTypes must be a boolean"));
1588
+ const clockTimestamp = options.clockTimestamp || Math.floor(Date.now() / 1e3);
1589
+ if (!jwtString) return done(new JsonWebTokenError("jwt must be provided"));
1590
+ if (typeof jwtString !== "string") return done(new JsonWebTokenError("jwt must be a string"));
1591
+ const parts = jwtString.split(".");
1592
+ if (parts.length !== 3) return done(new JsonWebTokenError("jwt malformed"));
1593
+ let decodedToken;
1594
+ try {
1595
+ decodedToken = decode(jwtString, { complete: true });
1596
+ } catch (err) {
1597
+ return done(err);
1598
+ }
1599
+ if (!decodedToken) return done(new JsonWebTokenError("invalid token"));
1600
+ const header = decodedToken.header;
1601
+ let getSecret;
1602
+ if (typeof secretOrPublicKey === "function") {
1603
+ if (!callback) return done(new JsonWebTokenError("verify must be called asynchronous if secret or public key is provided as a callback"));
1604
+ getSecret = secretOrPublicKey;
1605
+ } else getSecret = function(header, secretCallback) {
1606
+ return secretCallback(null, secretOrPublicKey);
1607
+ };
1608
+ return getSecret(header, function(err, secretOrPublicKey) {
1609
+ if (err) return done(new JsonWebTokenError("error in secret or public key callback: " + err.message));
1610
+ const hasSignature = parts[2].trim() !== "";
1611
+ if (!hasSignature && secretOrPublicKey) return done(new JsonWebTokenError("jwt signature is required"));
1612
+ if (hasSignature && !secretOrPublicKey) return done(new JsonWebTokenError("secret or public key must be provided"));
1613
+ if (!hasSignature && !options.algorithms) return done(new JsonWebTokenError("please specify \"none\" in \"algorithms\" to verify unsigned tokens"));
1614
+ if (secretOrPublicKey != null && !(secretOrPublicKey instanceof KeyObject$1)) try {
1615
+ secretOrPublicKey = createPublicKey(secretOrPublicKey);
1616
+ } catch (_) {
1617
+ try {
1618
+ secretOrPublicKey = createSecretKey$1(typeof secretOrPublicKey === "string" ? Buffer.from(secretOrPublicKey) : secretOrPublicKey);
1619
+ } catch (_) {
1620
+ return done(new JsonWebTokenError("secretOrPublicKey is not valid key material"));
1621
+ }
1622
+ }
1623
+ if (!options.algorithms) if (secretOrPublicKey.type === "secret") options.algorithms = HS_ALGS;
1624
+ else if (["rsa", "rsa-pss"].includes(secretOrPublicKey.asymmetricKeyType)) options.algorithms = RSA_KEY_ALGS;
1625
+ else if (secretOrPublicKey.asymmetricKeyType === "ec") options.algorithms = EC_KEY_ALGS;
1626
+ else options.algorithms = PUB_KEY_ALGS;
1627
+ if (options.algorithms.indexOf(decodedToken.header.alg) === -1) return done(new JsonWebTokenError("invalid algorithm"));
1628
+ if (header.alg.startsWith("HS") && secretOrPublicKey.type !== "secret") return done(new JsonWebTokenError(`secretOrPublicKey must be a symmetric key when using ${header.alg}`));
1629
+ else if (/^(?:RS|PS|ES)/.test(header.alg) && secretOrPublicKey.type !== "public") return done(new JsonWebTokenError(`secretOrPublicKey must be an asymmetric key when using ${header.alg}`));
1630
+ if (!options.allowInvalidAsymmetricKeyTypes) try {
1631
+ validateAsymmetricKey(header.alg, secretOrPublicKey);
1632
+ } catch (e) {
1633
+ return done(e);
1634
+ }
1635
+ let valid;
1636
+ try {
1637
+ valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey);
1638
+ } catch (e) {
1639
+ return done(e);
1640
+ }
1641
+ if (!valid) return done(new JsonWebTokenError("invalid signature"));
1642
+ const payload = decodedToken.payload;
1643
+ if (typeof payload.nbf !== "undefined" && !options.ignoreNotBefore) {
1644
+ if (typeof payload.nbf !== "number") return done(new JsonWebTokenError("invalid nbf value"));
1645
+ if (payload.nbf > clockTimestamp + (options.clockTolerance || 0)) return done(new NotBeforeError("jwt not active", /* @__PURE__ */ new Date(payload.nbf * 1e3)));
1646
+ }
1647
+ if (typeof payload.exp !== "undefined" && !options.ignoreExpiration) {
1648
+ if (typeof payload.exp !== "number") return done(new JsonWebTokenError("invalid exp value"));
1649
+ if (clockTimestamp >= payload.exp + (options.clockTolerance || 0)) return done(new TokenExpiredError("jwt expired", /* @__PURE__ */ new Date(payload.exp * 1e3)));
1650
+ }
1651
+ if (options.audience) {
1652
+ const audiences = Array.isArray(options.audience) ? options.audience : [options.audience];
1653
+ if (!(Array.isArray(payload.aud) ? payload.aud : [payload.aud]).some(function(targetAudience) {
1654
+ return audiences.some(function(audience) {
1655
+ return audience instanceof RegExp ? audience.test(targetAudience) : audience === targetAudience;
1656
+ });
1657
+ })) return done(new JsonWebTokenError("jwt audience invalid. expected: " + audiences.join(" or ")));
1658
+ }
1659
+ if (options.issuer) {
1660
+ if (typeof options.issuer === "string" && payload.iss !== options.issuer || Array.isArray(options.issuer) && options.issuer.indexOf(payload.iss) === -1) return done(new JsonWebTokenError("jwt issuer invalid. expected: " + options.issuer));
1661
+ }
1662
+ if (options.subject) {
1663
+ if (payload.sub !== options.subject) return done(new JsonWebTokenError("jwt subject invalid. expected: " + options.subject));
1664
+ }
1665
+ if (options.jwtid) {
1666
+ if (payload.jti !== options.jwtid) return done(new JsonWebTokenError("jwt jwtid invalid. expected: " + options.jwtid));
1667
+ }
1668
+ if (options.nonce) {
1669
+ if (payload.nonce !== options.nonce) return done(new JsonWebTokenError("jwt nonce invalid. expected: " + options.nonce));
1670
+ }
1671
+ if (options.maxAge) {
1672
+ if (typeof payload.iat !== "number") return done(new JsonWebTokenError("iat required when maxAge is specified"));
1673
+ const maxAgeTimestamp = timespan(options.maxAge, payload.iat);
1674
+ if (typeof maxAgeTimestamp === "undefined") return done(new JsonWebTokenError("\"maxAge\" should be a number of seconds or string representing a timespan eg: \"1d\", \"20h\", 60"));
1675
+ if (clockTimestamp >= maxAgeTimestamp + (options.clockTolerance || 0)) return done(new TokenExpiredError("maxAge exceeded", /* @__PURE__ */ new Date(maxAgeTimestamp * 1e3)));
1676
+ }
1677
+ if (options.complete === true) {
1678
+ const signature = decodedToken.signature;
1679
+ return done(null, {
1680
+ header,
1681
+ payload,
1682
+ signature
1683
+ });
1684
+ }
1685
+ return done(null, payload);
1686
+ });
1687
+ };
1688
+ }));
1689
+ //#endregion
1690
+ //#region ../../node_modules/.pnpm/lodash.includes@4.3.0/node_modules/lodash.includes/index.js
1691
+ var require_lodash_includes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1692
+ /**
1693
+ * lodash (Custom Build) <https://lodash.com/>
1694
+ * Build: `lodash modularize exports="npm" -o ./`
1695
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
1696
+ * Released under MIT license <https://lodash.com/license>
1697
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1698
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1699
+ */
1700
+ /** Used as references for various `Number` constants. */
1701
+ var INFINITY = Infinity, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = NaN;
1702
+ /** `Object#toString` result references. */
1703
+ var argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", stringTag = "[object String]", symbolTag = "[object Symbol]";
1704
+ /** Used to match leading and trailing whitespace. */
1705
+ var reTrim = /^\s+|\s+$/g;
1706
+ /** Used to detect bad signed hexadecimal string values. */
1707
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
1708
+ /** Used to detect binary string values. */
1709
+ var reIsBinary = /^0b[01]+$/i;
1710
+ /** Used to detect octal string values. */
1711
+ var reIsOctal = /^0o[0-7]+$/i;
1712
+ /** Used to detect unsigned integer values. */
1713
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1714
+ /** Built-in method references without a dependency on `root`. */
1715
+ var freeParseInt = parseInt;
1716
+ /**
1717
+ * A specialized version of `_.map` for arrays without support for iteratee
1718
+ * shorthands.
1719
+ *
1720
+ * @private
1721
+ * @param {Array} [array] The array to iterate over.
1722
+ * @param {Function} iteratee The function invoked per iteration.
1723
+ * @returns {Array} Returns the new mapped array.
1724
+ */
1725
+ function arrayMap(array, iteratee) {
1726
+ var index = -1, length = array ? array.length : 0, result = Array(length);
1727
+ while (++index < length) result[index] = iteratee(array[index], index, array);
1728
+ return result;
1729
+ }
1730
+ /**
1731
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
1732
+ * support for iteratee shorthands.
1733
+ *
1734
+ * @private
1735
+ * @param {Array} array The array to inspect.
1736
+ * @param {Function} predicate The function invoked per iteration.
1737
+ * @param {number} fromIndex The index to search from.
1738
+ * @param {boolean} [fromRight] Specify iterating from right to left.
1739
+ * @returns {number} Returns the index of the matched value, else `-1`.
1740
+ */
1741
+ function baseFindIndex(array, predicate, fromIndex, fromRight) {
1742
+ var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
1743
+ while (fromRight ? index-- : ++index < length) if (predicate(array[index], index, array)) return index;
1744
+ return -1;
1745
+ }
1746
+ /**
1747
+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
1748
+ *
1749
+ * @private
1750
+ * @param {Array} array The array to inspect.
1751
+ * @param {*} value The value to search for.
1752
+ * @param {number} fromIndex The index to search from.
1753
+ * @returns {number} Returns the index of the matched value, else `-1`.
1754
+ */
1755
+ function baseIndexOf(array, value, fromIndex) {
1756
+ if (value !== value) return baseFindIndex(array, baseIsNaN, fromIndex);
1757
+ var index = fromIndex - 1, length = array.length;
1758
+ while (++index < length) if (array[index] === value) return index;
1759
+ return -1;
1760
+ }
1761
+ /**
1762
+ * The base implementation of `_.isNaN` without support for number objects.
1763
+ *
1764
+ * @private
1765
+ * @param {*} value The value to check.
1766
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
1767
+ */
1768
+ function baseIsNaN(value) {
1769
+ return value !== value;
1770
+ }
1771
+ /**
1772
+ * The base implementation of `_.times` without support for iteratee shorthands
1773
+ * or max array length checks.
1774
+ *
1775
+ * @private
1776
+ * @param {number} n The number of times to invoke `iteratee`.
1777
+ * @param {Function} iteratee The function invoked per iteration.
1778
+ * @returns {Array} Returns the array of results.
1779
+ */
1780
+ function baseTimes(n, iteratee) {
1781
+ var index = -1, result = Array(n);
1782
+ while (++index < n) result[index] = iteratee(index);
1783
+ return result;
1784
+ }
1785
+ /**
1786
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
1787
+ * array of `object` property values corresponding to the property names
1788
+ * of `props`.
1789
+ *
1790
+ * @private
1791
+ * @param {Object} object The object to query.
1792
+ * @param {Array} props The property names to get values for.
1793
+ * @returns {Object} Returns the array of property values.
1794
+ */
1795
+ function baseValues(object, props) {
1796
+ return arrayMap(props, function(key) {
1797
+ return object[key];
1798
+ });
1799
+ }
1800
+ /**
1801
+ * Creates a unary function that invokes `func` with its argument transformed.
1802
+ *
1803
+ * @private
1804
+ * @param {Function} func The function to wrap.
1805
+ * @param {Function} transform The argument transform.
1806
+ * @returns {Function} Returns the new function.
1807
+ */
1808
+ function overArg(func, transform) {
1809
+ return function(arg) {
1810
+ return func(transform(arg));
1811
+ };
1812
+ }
1813
+ /** Used for built-in method references. */
1814
+ var objectProto = Object.prototype;
1815
+ /** Used to check objects for own properties. */
1816
+ var hasOwnProperty = objectProto.hasOwnProperty;
1817
+ /**
1818
+ * Used to resolve the
1819
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1820
+ * of values.
1821
+ */
1822
+ var objectToString = objectProto.toString;
1823
+ /** Built-in value references. */
1824
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
1825
+ var nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max;
1826
+ /**
1827
+ * Creates an array of the enumerable property names of the array-like `value`.
1828
+ *
1829
+ * @private
1830
+ * @param {*} value The value to query.
1831
+ * @param {boolean} inherited Specify returning inherited property names.
1832
+ * @returns {Array} Returns the array of property names.
1833
+ */
1834
+ function arrayLikeKeys(value, inherited) {
1835
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
1836
+ var length = result.length, skipIndexes = !!length;
1837
+ for (var key in value) if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) result.push(key);
1838
+ return result;
1839
+ }
1840
+ /**
1841
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1842
+ *
1843
+ * @private
1844
+ * @param {Object} object The object to query.
1845
+ * @returns {Array} Returns the array of property names.
1846
+ */
1847
+ function baseKeys(object) {
1848
+ if (!isPrototype(object)) return nativeKeys(object);
1849
+ var result = [];
1850
+ for (var key in Object(object)) if (hasOwnProperty.call(object, key) && key != "constructor") result.push(key);
1851
+ return result;
1852
+ }
1853
+ /**
1854
+ * Checks if `value` is a valid array-like index.
1855
+ *
1856
+ * @private
1857
+ * @param {*} value The value to check.
1858
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1859
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1860
+ */
1861
+ function isIndex(value, length) {
1862
+ length = length == null ? MAX_SAFE_INTEGER : length;
1863
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1864
+ }
1865
+ /**
1866
+ * Checks if `value` is likely a prototype object.
1867
+ *
1868
+ * @private
1869
+ * @param {*} value The value to check.
1870
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1871
+ */
1872
+ function isPrototype(value) {
1873
+ var Ctor = value && value.constructor;
1874
+ return value === (typeof Ctor == "function" && Ctor.prototype || objectProto);
1875
+ }
1876
+ /**
1877
+ * Checks if `value` is in `collection`. If `collection` is a string, it's
1878
+ * checked for a substring of `value`, otherwise
1879
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1880
+ * is used for equality comparisons. If `fromIndex` is negative, it's used as
1881
+ * the offset from the end of `collection`.
1882
+ *
1883
+ * @static
1884
+ * @memberOf _
1885
+ * @since 0.1.0
1886
+ * @category Collection
1887
+ * @param {Array|Object|string} collection The collection to inspect.
1888
+ * @param {*} value The value to search for.
1889
+ * @param {number} [fromIndex=0] The index to search from.
1890
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
1891
+ * @returns {boolean} Returns `true` if `value` is found, else `false`.
1892
+ * @example
1893
+ *
1894
+ * _.includes([1, 2, 3], 1);
1895
+ * // => true
1896
+ *
1897
+ * _.includes([1, 2, 3], 1, 2);
1898
+ * // => false
1899
+ *
1900
+ * _.includes({ 'a': 1, 'b': 2 }, 1);
1901
+ * // => true
1902
+ *
1903
+ * _.includes('abcd', 'bc');
1904
+ * // => true
1905
+ */
1906
+ function includes(collection, value, fromIndex, guard) {
1907
+ collection = isArrayLike(collection) ? collection : values(collection);
1908
+ fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
1909
+ var length = collection.length;
1910
+ if (fromIndex < 0) fromIndex = nativeMax(length + fromIndex, 0);
1911
+ return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
1912
+ }
1913
+ /**
1914
+ * Checks if `value` is likely an `arguments` object.
1915
+ *
1916
+ * @static
1917
+ * @memberOf _
1918
+ * @since 0.1.0
1919
+ * @category Lang
1920
+ * @param {*} value The value to check.
1921
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1922
+ * else `false`.
1923
+ * @example
1924
+ *
1925
+ * _.isArguments(function() { return arguments; }());
1926
+ * // => true
1927
+ *
1928
+ * _.isArguments([1, 2, 3]);
1929
+ * // => false
1930
+ */
1931
+ function isArguments(value) {
1932
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
1933
+ }
1934
+ /**
1935
+ * Checks if `value` is classified as an `Array` object.
1936
+ *
1937
+ * @static
1938
+ * @memberOf _
1939
+ * @since 0.1.0
1940
+ * @category Lang
1941
+ * @param {*} value The value to check.
1942
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1943
+ * @example
1944
+ *
1945
+ * _.isArray([1, 2, 3]);
1946
+ * // => true
1947
+ *
1948
+ * _.isArray(document.body.children);
1949
+ * // => false
1950
+ *
1951
+ * _.isArray('abc');
1952
+ * // => false
1953
+ *
1954
+ * _.isArray(_.noop);
1955
+ * // => false
1956
+ */
1957
+ var isArray = Array.isArray;
1958
+ /**
1959
+ * Checks if `value` is array-like. A value is considered array-like if it's
1960
+ * not a function and has a `value.length` that's an integer greater than or
1961
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1962
+ *
1963
+ * @static
1964
+ * @memberOf _
1965
+ * @since 4.0.0
1966
+ * @category Lang
1967
+ * @param {*} value The value to check.
1968
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1969
+ * @example
1970
+ *
1971
+ * _.isArrayLike([1, 2, 3]);
1972
+ * // => true
1973
+ *
1974
+ * _.isArrayLike(document.body.children);
1975
+ * // => true
1976
+ *
1977
+ * _.isArrayLike('abc');
1978
+ * // => true
1979
+ *
1980
+ * _.isArrayLike(_.noop);
1981
+ * // => false
1982
+ */
1983
+ function isArrayLike(value) {
1984
+ return value != null && isLength(value.length) && !isFunction(value);
1985
+ }
1986
+ /**
1987
+ * This method is like `_.isArrayLike` except that it also checks if `value`
1988
+ * is an object.
1989
+ *
1990
+ * @static
1991
+ * @memberOf _
1992
+ * @since 4.0.0
1993
+ * @category Lang
1994
+ * @param {*} value The value to check.
1995
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
1996
+ * else `false`.
1997
+ * @example
1998
+ *
1999
+ * _.isArrayLikeObject([1, 2, 3]);
2000
+ * // => true
2001
+ *
2002
+ * _.isArrayLikeObject(document.body.children);
2003
+ * // => true
2004
+ *
2005
+ * _.isArrayLikeObject('abc');
2006
+ * // => false
2007
+ *
2008
+ * _.isArrayLikeObject(_.noop);
2009
+ * // => false
2010
+ */
2011
+ function isArrayLikeObject(value) {
2012
+ return isObjectLike(value) && isArrayLike(value);
2013
+ }
2014
+ /**
2015
+ * Checks if `value` is classified as a `Function` object.
2016
+ *
2017
+ * @static
2018
+ * @memberOf _
2019
+ * @since 0.1.0
2020
+ * @category Lang
2021
+ * @param {*} value The value to check.
2022
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
2023
+ * @example
2024
+ *
2025
+ * _.isFunction(_);
2026
+ * // => true
2027
+ *
2028
+ * _.isFunction(/abc/);
2029
+ * // => false
2030
+ */
2031
+ function isFunction(value) {
2032
+ var tag = isObject(value) ? objectToString.call(value) : "";
2033
+ return tag == funcTag || tag == genTag;
2034
+ }
2035
+ /**
2036
+ * Checks if `value` is a valid array-like length.
2037
+ *
2038
+ * **Note:** This method is loosely based on
2039
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2040
+ *
2041
+ * @static
2042
+ * @memberOf _
2043
+ * @since 4.0.0
2044
+ * @category Lang
2045
+ * @param {*} value The value to check.
2046
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2047
+ * @example
2048
+ *
2049
+ * _.isLength(3);
2050
+ * // => true
2051
+ *
2052
+ * _.isLength(Number.MIN_VALUE);
2053
+ * // => false
2054
+ *
2055
+ * _.isLength(Infinity);
2056
+ * // => false
2057
+ *
2058
+ * _.isLength('3');
2059
+ * // => false
2060
+ */
2061
+ function isLength(value) {
2062
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2063
+ }
2064
+ /**
2065
+ * Checks if `value` is the
2066
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
2067
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
2068
+ *
2069
+ * @static
2070
+ * @memberOf _
2071
+ * @since 0.1.0
2072
+ * @category Lang
2073
+ * @param {*} value The value to check.
2074
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
2075
+ * @example
2076
+ *
2077
+ * _.isObject({});
2078
+ * // => true
2079
+ *
2080
+ * _.isObject([1, 2, 3]);
2081
+ * // => true
2082
+ *
2083
+ * _.isObject(_.noop);
2084
+ * // => true
2085
+ *
2086
+ * _.isObject(null);
2087
+ * // => false
2088
+ */
2089
+ function isObject(value) {
2090
+ var type = typeof value;
2091
+ return !!value && (type == "object" || type == "function");
2092
+ }
2093
+ /**
2094
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2095
+ * and has a `typeof` result of "object".
2096
+ *
2097
+ * @static
2098
+ * @memberOf _
2099
+ * @since 4.0.0
2100
+ * @category Lang
2101
+ * @param {*} value The value to check.
2102
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2103
+ * @example
2104
+ *
2105
+ * _.isObjectLike({});
2106
+ * // => true
2107
+ *
2108
+ * _.isObjectLike([1, 2, 3]);
2109
+ * // => true
2110
+ *
2111
+ * _.isObjectLike(_.noop);
2112
+ * // => false
2113
+ *
2114
+ * _.isObjectLike(null);
2115
+ * // => false
2116
+ */
2117
+ function isObjectLike(value) {
2118
+ return !!value && typeof value == "object";
2119
+ }
2120
+ /**
2121
+ * Checks if `value` is classified as a `String` primitive or object.
2122
+ *
2123
+ * @static
2124
+ * @since 0.1.0
2125
+ * @memberOf _
2126
+ * @category Lang
2127
+ * @param {*} value The value to check.
2128
+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.
2129
+ * @example
2130
+ *
2131
+ * _.isString('abc');
2132
+ * // => true
2133
+ *
2134
+ * _.isString(1);
2135
+ * // => false
2136
+ */
2137
+ function isString(value) {
2138
+ return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag;
2139
+ }
2140
+ /**
2141
+ * Checks if `value` is classified as a `Symbol` primitive or object.
2142
+ *
2143
+ * @static
2144
+ * @memberOf _
2145
+ * @since 4.0.0
2146
+ * @category Lang
2147
+ * @param {*} value The value to check.
2148
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
2149
+ * @example
2150
+ *
2151
+ * _.isSymbol(Symbol.iterator);
2152
+ * // => true
2153
+ *
2154
+ * _.isSymbol('abc');
2155
+ * // => false
2156
+ */
2157
+ function isSymbol(value) {
2158
+ return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
2159
+ }
2160
+ /**
2161
+ * Converts `value` to a finite number.
2162
+ *
2163
+ * @static
2164
+ * @memberOf _
2165
+ * @since 4.12.0
2166
+ * @category Lang
2167
+ * @param {*} value The value to convert.
2168
+ * @returns {number} Returns the converted number.
2169
+ * @example
2170
+ *
2171
+ * _.toFinite(3.2);
2172
+ * // => 3.2
2173
+ *
2174
+ * _.toFinite(Number.MIN_VALUE);
2175
+ * // => 5e-324
2176
+ *
2177
+ * _.toFinite(Infinity);
2178
+ * // => 1.7976931348623157e+308
2179
+ *
2180
+ * _.toFinite('3.2');
2181
+ * // => 3.2
2182
+ */
2183
+ function toFinite(value) {
2184
+ if (!value) return value === 0 ? value : 0;
2185
+ value = toNumber(value);
2186
+ if (value === INFINITY || value === -INFINITY) return (value < 0 ? -1 : 1) * MAX_INTEGER;
2187
+ return value === value ? value : 0;
2188
+ }
2189
+ /**
2190
+ * Converts `value` to an integer.
2191
+ *
2192
+ * **Note:** This method is loosely based on
2193
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
2194
+ *
2195
+ * @static
2196
+ * @memberOf _
2197
+ * @since 4.0.0
2198
+ * @category Lang
2199
+ * @param {*} value The value to convert.
2200
+ * @returns {number} Returns the converted integer.
2201
+ * @example
2202
+ *
2203
+ * _.toInteger(3.2);
2204
+ * // => 3
2205
+ *
2206
+ * _.toInteger(Number.MIN_VALUE);
2207
+ * // => 0
2208
+ *
2209
+ * _.toInteger(Infinity);
2210
+ * // => 1.7976931348623157e+308
2211
+ *
2212
+ * _.toInteger('3.2');
2213
+ * // => 3
2214
+ */
2215
+ function toInteger(value) {
2216
+ var result = toFinite(value), remainder = result % 1;
2217
+ return result === result ? remainder ? result - remainder : result : 0;
2218
+ }
2219
+ /**
2220
+ * Converts `value` to a number.
2221
+ *
2222
+ * @static
2223
+ * @memberOf _
2224
+ * @since 4.0.0
2225
+ * @category Lang
2226
+ * @param {*} value The value to process.
2227
+ * @returns {number} Returns the number.
2228
+ * @example
2229
+ *
2230
+ * _.toNumber(3.2);
2231
+ * // => 3.2
2232
+ *
2233
+ * _.toNumber(Number.MIN_VALUE);
2234
+ * // => 5e-324
2235
+ *
2236
+ * _.toNumber(Infinity);
2237
+ * // => Infinity
2238
+ *
2239
+ * _.toNumber('3.2');
2240
+ * // => 3.2
2241
+ */
2242
+ function toNumber(value) {
2243
+ if (typeof value == "number") return value;
2244
+ if (isSymbol(value)) return NAN;
2245
+ if (isObject(value)) {
2246
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
2247
+ value = isObject(other) ? other + "" : other;
2248
+ }
2249
+ if (typeof value != "string") return value === 0 ? value : +value;
2250
+ value = value.replace(reTrim, "");
2251
+ var isBinary = reIsBinary.test(value);
2252
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
2253
+ }
2254
+ /**
2255
+ * Creates an array of the own enumerable property names of `object`.
2256
+ *
2257
+ * **Note:** Non-object values are coerced to objects. See the
2258
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2259
+ * for more details.
2260
+ *
2261
+ * @static
2262
+ * @since 0.1.0
2263
+ * @memberOf _
2264
+ * @category Object
2265
+ * @param {Object} object The object to query.
2266
+ * @returns {Array} Returns the array of property names.
2267
+ * @example
2268
+ *
2269
+ * function Foo() {
2270
+ * this.a = 1;
2271
+ * this.b = 2;
2272
+ * }
2273
+ *
2274
+ * Foo.prototype.c = 3;
2275
+ *
2276
+ * _.keys(new Foo);
2277
+ * // => ['a', 'b'] (iteration order is not guaranteed)
2278
+ *
2279
+ * _.keys('hi');
2280
+ * // => ['0', '1']
2281
+ */
2282
+ function keys(object) {
2283
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2284
+ }
2285
+ /**
2286
+ * Creates an array of the own enumerable string keyed property values of `object`.
2287
+ *
2288
+ * **Note:** Non-object values are coerced to objects.
2289
+ *
2290
+ * @static
2291
+ * @since 0.1.0
2292
+ * @memberOf _
2293
+ * @category Object
2294
+ * @param {Object} object The object to query.
2295
+ * @returns {Array} Returns the array of property values.
2296
+ * @example
2297
+ *
2298
+ * function Foo() {
2299
+ * this.a = 1;
2300
+ * this.b = 2;
2301
+ * }
2302
+ *
2303
+ * Foo.prototype.c = 3;
2304
+ *
2305
+ * _.values(new Foo);
2306
+ * // => [1, 2] (iteration order is not guaranteed)
2307
+ *
2308
+ * _.values('hi');
2309
+ * // => ['h', 'i']
2310
+ */
2311
+ function values(object) {
2312
+ return object ? baseValues(object, keys(object)) : [];
2313
+ }
2314
+ module.exports = includes;
2315
+ }));
2316
+ //#endregion
2317
+ //#region ../../node_modules/.pnpm/lodash.isboolean@3.0.3/node_modules/lodash.isboolean/index.js
2318
+ var require_lodash_isboolean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2319
+ /**
2320
+ * lodash 3.0.3 (Custom Build) <https://lodash.com/>
2321
+ * Build: `lodash modularize exports="npm" -o ./`
2322
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
2323
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2324
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2325
+ * Available under MIT license <https://lodash.com/license>
2326
+ */
2327
+ /** `Object#toString` result references. */
2328
+ var boolTag = "[object Boolean]";
2329
+ /**
2330
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
2331
+ * of values.
2332
+ */
2333
+ var objectToString = Object.prototype.toString;
2334
+ /**
2335
+ * Checks if `value` is classified as a boolean primitive or object.
2336
+ *
2337
+ * @static
2338
+ * @memberOf _
2339
+ * @category Lang
2340
+ * @param {*} value The value to check.
2341
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
2342
+ * @example
2343
+ *
2344
+ * _.isBoolean(false);
2345
+ * // => true
2346
+ *
2347
+ * _.isBoolean(null);
2348
+ * // => false
2349
+ */
2350
+ function isBoolean(value) {
2351
+ return value === true || value === false || isObjectLike(value) && objectToString.call(value) == boolTag;
2352
+ }
2353
+ /**
2354
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2355
+ * and has a `typeof` result of "object".
2356
+ *
2357
+ * @static
2358
+ * @memberOf _
2359
+ * @category Lang
2360
+ * @param {*} value The value to check.
2361
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2362
+ * @example
2363
+ *
2364
+ * _.isObjectLike({});
2365
+ * // => true
2366
+ *
2367
+ * _.isObjectLike([1, 2, 3]);
2368
+ * // => true
2369
+ *
2370
+ * _.isObjectLike(_.noop);
2371
+ * // => false
2372
+ *
2373
+ * _.isObjectLike(null);
2374
+ * // => false
2375
+ */
2376
+ function isObjectLike(value) {
2377
+ return !!value && typeof value == "object";
2378
+ }
2379
+ module.exports = isBoolean;
2380
+ }));
2381
+ //#endregion
2382
+ //#region ../../node_modules/.pnpm/lodash.isinteger@4.0.4/node_modules/lodash.isinteger/index.js
2383
+ var require_lodash_isinteger = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2384
+ /**
2385
+ * lodash (Custom Build) <https://lodash.com/>
2386
+ * Build: `lodash modularize exports="npm" -o ./`
2387
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
2388
+ * Released under MIT license <https://lodash.com/license>
2389
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2390
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2391
+ */
2392
+ /** Used as references for various `Number` constants. */
2393
+ var INFINITY = Infinity, MAX_INTEGER = 17976931348623157e292, NAN = NaN;
2394
+ /** `Object#toString` result references. */
2395
+ var symbolTag = "[object Symbol]";
2396
+ /** Used to match leading and trailing whitespace. */
2397
+ var reTrim = /^\s+|\s+$/g;
2398
+ /** Used to detect bad signed hexadecimal string values. */
2399
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
2400
+ /** Used to detect binary string values. */
2401
+ var reIsBinary = /^0b[01]+$/i;
2402
+ /** Used to detect octal string values. */
2403
+ var reIsOctal = /^0o[0-7]+$/i;
2404
+ /** Built-in method references without a dependency on `root`. */
2405
+ var freeParseInt = parseInt;
2406
+ /**
2407
+ * Used to resolve the
2408
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2409
+ * of values.
2410
+ */
2411
+ var objectToString = Object.prototype.toString;
2412
+ /**
2413
+ * Checks if `value` is an integer.
2414
+ *
2415
+ * **Note:** This method is based on
2416
+ * [`Number.isInteger`](https://mdn.io/Number/isInteger).
2417
+ *
2418
+ * @static
2419
+ * @memberOf _
2420
+ * @since 4.0.0
2421
+ * @category Lang
2422
+ * @param {*} value The value to check.
2423
+ * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
2424
+ * @example
2425
+ *
2426
+ * _.isInteger(3);
2427
+ * // => true
2428
+ *
2429
+ * _.isInteger(Number.MIN_VALUE);
2430
+ * // => false
2431
+ *
2432
+ * _.isInteger(Infinity);
2433
+ * // => false
2434
+ *
2435
+ * _.isInteger('3');
2436
+ * // => false
2437
+ */
2438
+ function isInteger(value) {
2439
+ return typeof value == "number" && value == toInteger(value);
2440
+ }
2441
+ /**
2442
+ * Checks if `value` is the
2443
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
2444
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
2445
+ *
2446
+ * @static
2447
+ * @memberOf _
2448
+ * @since 0.1.0
2449
+ * @category Lang
2450
+ * @param {*} value The value to check.
2451
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
2452
+ * @example
2453
+ *
2454
+ * _.isObject({});
2455
+ * // => true
2456
+ *
2457
+ * _.isObject([1, 2, 3]);
2458
+ * // => true
2459
+ *
2460
+ * _.isObject(_.noop);
2461
+ * // => true
2462
+ *
2463
+ * _.isObject(null);
2464
+ * // => false
2465
+ */
2466
+ function isObject(value) {
2467
+ var type = typeof value;
2468
+ return !!value && (type == "object" || type == "function");
2469
+ }
2470
+ /**
2471
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2472
+ * and has a `typeof` result of "object".
2473
+ *
2474
+ * @static
2475
+ * @memberOf _
2476
+ * @since 4.0.0
2477
+ * @category Lang
2478
+ * @param {*} value The value to check.
2479
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2480
+ * @example
2481
+ *
2482
+ * _.isObjectLike({});
2483
+ * // => true
2484
+ *
2485
+ * _.isObjectLike([1, 2, 3]);
2486
+ * // => true
2487
+ *
2488
+ * _.isObjectLike(_.noop);
2489
+ * // => false
2490
+ *
2491
+ * _.isObjectLike(null);
2492
+ * // => false
2493
+ */
2494
+ function isObjectLike(value) {
2495
+ return !!value && typeof value == "object";
2496
+ }
2497
+ /**
2498
+ * Checks if `value` is classified as a `Symbol` primitive or object.
2499
+ *
2500
+ * @static
2501
+ * @memberOf _
2502
+ * @since 4.0.0
2503
+ * @category Lang
2504
+ * @param {*} value The value to check.
2505
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
2506
+ * @example
2507
+ *
2508
+ * _.isSymbol(Symbol.iterator);
2509
+ * // => true
2510
+ *
2511
+ * _.isSymbol('abc');
2512
+ * // => false
2513
+ */
2514
+ function isSymbol(value) {
2515
+ return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
2516
+ }
2517
+ /**
2518
+ * Converts `value` to a finite number.
2519
+ *
2520
+ * @static
2521
+ * @memberOf _
2522
+ * @since 4.12.0
2523
+ * @category Lang
2524
+ * @param {*} value The value to convert.
2525
+ * @returns {number} Returns the converted number.
2526
+ * @example
2527
+ *
2528
+ * _.toFinite(3.2);
2529
+ * // => 3.2
2530
+ *
2531
+ * _.toFinite(Number.MIN_VALUE);
2532
+ * // => 5e-324
2533
+ *
2534
+ * _.toFinite(Infinity);
2535
+ * // => 1.7976931348623157e+308
2536
+ *
2537
+ * _.toFinite('3.2');
2538
+ * // => 3.2
2539
+ */
2540
+ function toFinite(value) {
2541
+ if (!value) return value === 0 ? value : 0;
2542
+ value = toNumber(value);
2543
+ if (value === INFINITY || value === -INFINITY) return (value < 0 ? -1 : 1) * MAX_INTEGER;
2544
+ return value === value ? value : 0;
2545
+ }
2546
+ /**
2547
+ * Converts `value` to an integer.
2548
+ *
2549
+ * **Note:** This method is loosely based on
2550
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
2551
+ *
2552
+ * @static
2553
+ * @memberOf _
2554
+ * @since 4.0.0
2555
+ * @category Lang
2556
+ * @param {*} value The value to convert.
2557
+ * @returns {number} Returns the converted integer.
2558
+ * @example
2559
+ *
2560
+ * _.toInteger(3.2);
2561
+ * // => 3
2562
+ *
2563
+ * _.toInteger(Number.MIN_VALUE);
2564
+ * // => 0
2565
+ *
2566
+ * _.toInteger(Infinity);
2567
+ * // => 1.7976931348623157e+308
2568
+ *
2569
+ * _.toInteger('3.2');
2570
+ * // => 3
2571
+ */
2572
+ function toInteger(value) {
2573
+ var result = toFinite(value), remainder = result % 1;
2574
+ return result === result ? remainder ? result - remainder : result : 0;
2575
+ }
2576
+ /**
2577
+ * Converts `value` to a number.
2578
+ *
2579
+ * @static
2580
+ * @memberOf _
2581
+ * @since 4.0.0
2582
+ * @category Lang
2583
+ * @param {*} value The value to process.
2584
+ * @returns {number} Returns the number.
2585
+ * @example
2586
+ *
2587
+ * _.toNumber(3.2);
2588
+ * // => 3.2
2589
+ *
2590
+ * _.toNumber(Number.MIN_VALUE);
2591
+ * // => 5e-324
2592
+ *
2593
+ * _.toNumber(Infinity);
2594
+ * // => Infinity
2595
+ *
2596
+ * _.toNumber('3.2');
2597
+ * // => 3.2
2598
+ */
2599
+ function toNumber(value) {
2600
+ if (typeof value == "number") return value;
2601
+ if (isSymbol(value)) return NAN;
2602
+ if (isObject(value)) {
2603
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
2604
+ value = isObject(other) ? other + "" : other;
2605
+ }
2606
+ if (typeof value != "string") return value === 0 ? value : +value;
2607
+ value = value.replace(reTrim, "");
2608
+ var isBinary = reIsBinary.test(value);
2609
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
2610
+ }
2611
+ module.exports = isInteger;
2612
+ }));
2613
+ //#endregion
2614
+ //#region ../../node_modules/.pnpm/lodash.isnumber@3.0.3/node_modules/lodash.isnumber/index.js
2615
+ var require_lodash_isnumber = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2616
+ /**
2617
+ * lodash 3.0.3 (Custom Build) <https://lodash.com/>
2618
+ * Build: `lodash modularize exports="npm" -o ./`
2619
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
2620
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2621
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2622
+ * Available under MIT license <https://lodash.com/license>
2623
+ */
2624
+ /** `Object#toString` result references. */
2625
+ var numberTag = "[object Number]";
2626
+ /**
2627
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
2628
+ * of values.
2629
+ */
2630
+ var objectToString = Object.prototype.toString;
2631
+ /**
2632
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2633
+ * and has a `typeof` result of "object".
2634
+ *
2635
+ * @static
2636
+ * @memberOf _
2637
+ * @category Lang
2638
+ * @param {*} value The value to check.
2639
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2640
+ * @example
2641
+ *
2642
+ * _.isObjectLike({});
2643
+ * // => true
2644
+ *
2645
+ * _.isObjectLike([1, 2, 3]);
2646
+ * // => true
2647
+ *
2648
+ * _.isObjectLike(_.noop);
2649
+ * // => false
2650
+ *
2651
+ * _.isObjectLike(null);
2652
+ * // => false
2653
+ */
2654
+ function isObjectLike(value) {
2655
+ return !!value && typeof value == "object";
2656
+ }
2657
+ /**
2658
+ * Checks if `value` is classified as a `Number` primitive or object.
2659
+ *
2660
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
2661
+ * as numbers, use the `_.isFinite` method.
2662
+ *
2663
+ * @static
2664
+ * @memberOf _
2665
+ * @category Lang
2666
+ * @param {*} value The value to check.
2667
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
2668
+ * @example
2669
+ *
2670
+ * _.isNumber(3);
2671
+ * // => true
2672
+ *
2673
+ * _.isNumber(Number.MIN_VALUE);
2674
+ * // => true
2675
+ *
2676
+ * _.isNumber(Infinity);
2677
+ * // => true
2678
+ *
2679
+ * _.isNumber('3');
2680
+ * // => false
2681
+ */
2682
+ function isNumber(value) {
2683
+ return typeof value == "number" || isObjectLike(value) && objectToString.call(value) == numberTag;
2684
+ }
2685
+ module.exports = isNumber;
2686
+ }));
2687
+ //#endregion
2688
+ //#region ../../node_modules/.pnpm/lodash.isplainobject@4.0.6/node_modules/lodash.isplainobject/index.js
2689
+ var require_lodash_isplainobject = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2690
+ /**
2691
+ * lodash (Custom Build) <https://lodash.com/>
2692
+ * Build: `lodash modularize exports="npm" -o ./`
2693
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
2694
+ * Released under MIT license <https://lodash.com/license>
2695
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2696
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2697
+ */
2698
+ /** `Object#toString` result references. */
2699
+ var objectTag = "[object Object]";
2700
+ /**
2701
+ * Checks if `value` is a host object in IE < 9.
2702
+ *
2703
+ * @private
2704
+ * @param {*} value The value to check.
2705
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
2706
+ */
2707
+ function isHostObject(value) {
2708
+ var result = false;
2709
+ if (value != null && typeof value.toString != "function") try {
2710
+ result = !!(value + "");
2711
+ } catch (e) {}
2712
+ return result;
2713
+ }
2714
+ /**
2715
+ * Creates a unary function that invokes `func` with its argument transformed.
2716
+ *
2717
+ * @private
2718
+ * @param {Function} func The function to wrap.
2719
+ * @param {Function} transform The argument transform.
2720
+ * @returns {Function} Returns the new function.
2721
+ */
2722
+ function overArg(func, transform) {
2723
+ return function(arg) {
2724
+ return func(transform(arg));
2725
+ };
2726
+ }
2727
+ /** Used for built-in method references. */
2728
+ var funcProto = Function.prototype, objectProto = Object.prototype;
2729
+ /** Used to resolve the decompiled source of functions. */
2730
+ var funcToString = funcProto.toString;
2731
+ /** Used to check objects for own properties. */
2732
+ var hasOwnProperty = objectProto.hasOwnProperty;
2733
+ /** Used to infer the `Object` constructor. */
2734
+ var objectCtorString = funcToString.call(Object);
2735
+ /**
2736
+ * Used to resolve the
2737
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2738
+ * of values.
2739
+ */
2740
+ var objectToString = objectProto.toString;
2741
+ /** Built-in value references. */
2742
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
2743
+ /**
2744
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2745
+ * and has a `typeof` result of "object".
2746
+ *
2747
+ * @static
2748
+ * @memberOf _
2749
+ * @since 4.0.0
2750
+ * @category Lang
2751
+ * @param {*} value The value to check.
2752
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2753
+ * @example
2754
+ *
2755
+ * _.isObjectLike({});
2756
+ * // => true
2757
+ *
2758
+ * _.isObjectLike([1, 2, 3]);
2759
+ * // => true
2760
+ *
2761
+ * _.isObjectLike(_.noop);
2762
+ * // => false
2763
+ *
2764
+ * _.isObjectLike(null);
2765
+ * // => false
2766
+ */
2767
+ function isObjectLike(value) {
2768
+ return !!value && typeof value == "object";
2769
+ }
2770
+ /**
2771
+ * Checks if `value` is a plain object, that is, an object created by the
2772
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
2773
+ *
2774
+ * @static
2775
+ * @memberOf _
2776
+ * @since 0.8.0
2777
+ * @category Lang
2778
+ * @param {*} value The value to check.
2779
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
2780
+ * @example
2781
+ *
2782
+ * function Foo() {
2783
+ * this.a = 1;
2784
+ * }
2785
+ *
2786
+ * _.isPlainObject(new Foo);
2787
+ * // => false
2788
+ *
2789
+ * _.isPlainObject([1, 2, 3]);
2790
+ * // => false
2791
+ *
2792
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
2793
+ * // => true
2794
+ *
2795
+ * _.isPlainObject(Object.create(null));
2796
+ * // => true
2797
+ */
2798
+ function isPlainObject(value) {
2799
+ if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) return false;
2800
+ var proto = getPrototype(value);
2801
+ if (proto === null) return true;
2802
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
2803
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
2804
+ }
2805
+ module.exports = isPlainObject;
2806
+ }));
2807
+ //#endregion
2808
+ //#region ../../node_modules/.pnpm/lodash.isstring@4.0.1/node_modules/lodash.isstring/index.js
2809
+ var require_lodash_isstring = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2810
+ /**
2811
+ * lodash 4.0.1 (Custom Build) <https://lodash.com/>
2812
+ * Build: `lodash modularize exports="npm" -o ./`
2813
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
2814
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2815
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2816
+ * Available under MIT license <https://lodash.com/license>
2817
+ */
2818
+ /** `Object#toString` result references. */
2819
+ var stringTag = "[object String]";
2820
+ /**
2821
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
2822
+ * of values.
2823
+ */
2824
+ var objectToString = Object.prototype.toString;
2825
+ /**
2826
+ * Checks if `value` is classified as an `Array` object.
2827
+ *
2828
+ * @static
2829
+ * @memberOf _
2830
+ * @type Function
2831
+ * @category Lang
2832
+ * @param {*} value The value to check.
2833
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
2834
+ * @example
2835
+ *
2836
+ * _.isArray([1, 2, 3]);
2837
+ * // => true
2838
+ *
2839
+ * _.isArray(document.body.children);
2840
+ * // => false
2841
+ *
2842
+ * _.isArray('abc');
2843
+ * // => false
2844
+ *
2845
+ * _.isArray(_.noop);
2846
+ * // => false
2847
+ */
2848
+ var isArray = Array.isArray;
2849
+ /**
2850
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2851
+ * and has a `typeof` result of "object".
2852
+ *
2853
+ * @static
2854
+ * @memberOf _
2855
+ * @category Lang
2856
+ * @param {*} value The value to check.
2857
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2858
+ * @example
2859
+ *
2860
+ * _.isObjectLike({});
2861
+ * // => true
2862
+ *
2863
+ * _.isObjectLike([1, 2, 3]);
2864
+ * // => true
2865
+ *
2866
+ * _.isObjectLike(_.noop);
2867
+ * // => false
2868
+ *
2869
+ * _.isObjectLike(null);
2870
+ * // => false
2871
+ */
2872
+ function isObjectLike(value) {
2873
+ return !!value && typeof value == "object";
2874
+ }
2875
+ /**
2876
+ * Checks if `value` is classified as a `String` primitive or object.
2877
+ *
2878
+ * @static
2879
+ * @memberOf _
2880
+ * @category Lang
2881
+ * @param {*} value The value to check.
2882
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
2883
+ * @example
2884
+ *
2885
+ * _.isString('abc');
2886
+ * // => true
2887
+ *
2888
+ * _.isString(1);
2889
+ * // => false
2890
+ */
2891
+ function isString(value) {
2892
+ return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag;
2893
+ }
2894
+ module.exports = isString;
2895
+ }));
2896
+ //#endregion
2897
+ //#region ../../node_modules/.pnpm/lodash.once@4.1.1/node_modules/lodash.once/index.js
2898
+ var require_lodash_once = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2899
+ /**
2900
+ * lodash (Custom Build) <https://lodash.com/>
2901
+ * Build: `lodash modularize exports="npm" -o ./`
2902
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
2903
+ * Released under MIT license <https://lodash.com/license>
2904
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2905
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2906
+ */
2907
+ /** Used as the `TypeError` message for "Functions" methods. */
2908
+ var FUNC_ERROR_TEXT = "Expected a function";
2909
+ /** Used as references for various `Number` constants. */
2910
+ var INFINITY = Infinity, MAX_INTEGER = 17976931348623157e292, NAN = NaN;
2911
+ /** `Object#toString` result references. */
2912
+ var symbolTag = "[object Symbol]";
2913
+ /** Used to match leading and trailing whitespace. */
2914
+ var reTrim = /^\s+|\s+$/g;
2915
+ /** Used to detect bad signed hexadecimal string values. */
2916
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
2917
+ /** Used to detect binary string values. */
2918
+ var reIsBinary = /^0b[01]+$/i;
2919
+ /** Used to detect octal string values. */
2920
+ var reIsOctal = /^0o[0-7]+$/i;
2921
+ /** Built-in method references without a dependency on `root`. */
2922
+ var freeParseInt = parseInt;
2923
+ /**
2924
+ * Used to resolve the
2925
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2926
+ * of values.
2927
+ */
2928
+ var objectToString = Object.prototype.toString;
2929
+ /**
2930
+ * Creates a function that invokes `func`, with the `this` binding and arguments
2931
+ * of the created function, while it's called less than `n` times. Subsequent
2932
+ * calls to the created function return the result of the last `func` invocation.
2933
+ *
2934
+ * @static
2935
+ * @memberOf _
2936
+ * @since 3.0.0
2937
+ * @category Function
2938
+ * @param {number} n The number of calls at which `func` is no longer invoked.
2939
+ * @param {Function} func The function to restrict.
2940
+ * @returns {Function} Returns the new restricted function.
2941
+ * @example
2942
+ *
2943
+ * jQuery(element).on('click', _.before(5, addContactToList));
2944
+ * // => Allows adding up to 4 contacts to the list.
2945
+ */
2946
+ function before(n, func) {
2947
+ var result;
2948
+ if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
2949
+ n = toInteger(n);
2950
+ return function() {
2951
+ if (--n > 0) result = func.apply(this, arguments);
2952
+ if (n <= 1) func = void 0;
2953
+ return result;
2954
+ };
2955
+ }
2956
+ /**
2957
+ * Creates a function that is restricted to invoking `func` once. Repeat calls
2958
+ * to the function return the value of the first invocation. The `func` is
2959
+ * invoked with the `this` binding and arguments of the created function.
2960
+ *
2961
+ * @static
2962
+ * @memberOf _
2963
+ * @since 0.1.0
2964
+ * @category Function
2965
+ * @param {Function} func The function to restrict.
2966
+ * @returns {Function} Returns the new restricted function.
2967
+ * @example
2968
+ *
2969
+ * var initialize = _.once(createApplication);
2970
+ * initialize();
2971
+ * initialize();
2972
+ * // => `createApplication` is invoked once
2973
+ */
2974
+ function once(func) {
2975
+ return before(2, func);
2976
+ }
2977
+ /**
2978
+ * Checks if `value` is the
2979
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
2980
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
2981
+ *
2982
+ * @static
2983
+ * @memberOf _
2984
+ * @since 0.1.0
2985
+ * @category Lang
2986
+ * @param {*} value The value to check.
2987
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
2988
+ * @example
2989
+ *
2990
+ * _.isObject({});
2991
+ * // => true
2992
+ *
2993
+ * _.isObject([1, 2, 3]);
2994
+ * // => true
2995
+ *
2996
+ * _.isObject(_.noop);
2997
+ * // => true
2998
+ *
2999
+ * _.isObject(null);
3000
+ * // => false
3001
+ */
3002
+ function isObject(value) {
3003
+ var type = typeof value;
3004
+ return !!value && (type == "object" || type == "function");
3005
+ }
3006
+ /**
3007
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
3008
+ * and has a `typeof` result of "object".
3009
+ *
3010
+ * @static
3011
+ * @memberOf _
3012
+ * @since 4.0.0
3013
+ * @category Lang
3014
+ * @param {*} value The value to check.
3015
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
3016
+ * @example
3017
+ *
3018
+ * _.isObjectLike({});
3019
+ * // => true
3020
+ *
3021
+ * _.isObjectLike([1, 2, 3]);
3022
+ * // => true
3023
+ *
3024
+ * _.isObjectLike(_.noop);
3025
+ * // => false
3026
+ *
3027
+ * _.isObjectLike(null);
3028
+ * // => false
3029
+ */
3030
+ function isObjectLike(value) {
3031
+ return !!value && typeof value == "object";
3032
+ }
3033
+ /**
3034
+ * Checks if `value` is classified as a `Symbol` primitive or object.
3035
+ *
3036
+ * @static
3037
+ * @memberOf _
3038
+ * @since 4.0.0
3039
+ * @category Lang
3040
+ * @param {*} value The value to check.
3041
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
3042
+ * @example
3043
+ *
3044
+ * _.isSymbol(Symbol.iterator);
3045
+ * // => true
3046
+ *
3047
+ * _.isSymbol('abc');
3048
+ * // => false
3049
+ */
3050
+ function isSymbol(value) {
3051
+ return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
3052
+ }
3053
+ /**
3054
+ * Converts `value` to a finite number.
3055
+ *
3056
+ * @static
3057
+ * @memberOf _
3058
+ * @since 4.12.0
3059
+ * @category Lang
3060
+ * @param {*} value The value to convert.
3061
+ * @returns {number} Returns the converted number.
3062
+ * @example
3063
+ *
3064
+ * _.toFinite(3.2);
3065
+ * // => 3.2
3066
+ *
3067
+ * _.toFinite(Number.MIN_VALUE);
3068
+ * // => 5e-324
3069
+ *
3070
+ * _.toFinite(Infinity);
3071
+ * // => 1.7976931348623157e+308
3072
+ *
3073
+ * _.toFinite('3.2');
3074
+ * // => 3.2
3075
+ */
3076
+ function toFinite(value) {
3077
+ if (!value) return value === 0 ? value : 0;
3078
+ value = toNumber(value);
3079
+ if (value === INFINITY || value === -INFINITY) return (value < 0 ? -1 : 1) * MAX_INTEGER;
3080
+ return value === value ? value : 0;
3081
+ }
3082
+ /**
3083
+ * Converts `value` to an integer.
3084
+ *
3085
+ * **Note:** This method is loosely based on
3086
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
3087
+ *
3088
+ * @static
3089
+ * @memberOf _
3090
+ * @since 4.0.0
3091
+ * @category Lang
3092
+ * @param {*} value The value to convert.
3093
+ * @returns {number} Returns the converted integer.
3094
+ * @example
3095
+ *
3096
+ * _.toInteger(3.2);
3097
+ * // => 3
3098
+ *
3099
+ * _.toInteger(Number.MIN_VALUE);
3100
+ * // => 0
3101
+ *
3102
+ * _.toInteger(Infinity);
3103
+ * // => 1.7976931348623157e+308
3104
+ *
3105
+ * _.toInteger('3.2');
3106
+ * // => 3
3107
+ */
3108
+ function toInteger(value) {
3109
+ var result = toFinite(value), remainder = result % 1;
3110
+ return result === result ? remainder ? result - remainder : result : 0;
3111
+ }
3112
+ /**
3113
+ * Converts `value` to a number.
3114
+ *
3115
+ * @static
3116
+ * @memberOf _
3117
+ * @since 4.0.0
3118
+ * @category Lang
3119
+ * @param {*} value The value to process.
3120
+ * @returns {number} Returns the number.
3121
+ * @example
3122
+ *
3123
+ * _.toNumber(3.2);
3124
+ * // => 3.2
3125
+ *
3126
+ * _.toNumber(Number.MIN_VALUE);
3127
+ * // => 5e-324
3128
+ *
3129
+ * _.toNumber(Infinity);
3130
+ * // => Infinity
3131
+ *
3132
+ * _.toNumber('3.2');
3133
+ * // => 3.2
3134
+ */
3135
+ function toNumber(value) {
3136
+ if (typeof value == "number") return value;
3137
+ if (isSymbol(value)) return NAN;
3138
+ if (isObject(value)) {
3139
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
3140
+ value = isObject(other) ? other + "" : other;
3141
+ }
3142
+ if (typeof value != "string") return value === 0 ? value : +value;
3143
+ value = value.replace(reTrim, "");
3144
+ var isBinary = reIsBinary.test(value);
3145
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
3146
+ }
3147
+ module.exports = once;
3148
+ }));
3149
+ //#endregion
3150
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/sign.js
3151
+ var require_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3152
+ var timespan = require_timespan();
3153
+ var PS_SUPPORTED = require_psSupported();
3154
+ var validateAsymmetricKey = require_validateAsymmetricKey();
3155
+ var jws = require_jws();
3156
+ var includes = require_lodash_includes();
3157
+ var isBoolean = require_lodash_isboolean();
3158
+ var isInteger = require_lodash_isinteger();
3159
+ var isNumber = require_lodash_isnumber();
3160
+ var isPlainObject = require_lodash_isplainobject();
3161
+ var isString = require_lodash_isstring();
3162
+ var once = require_lodash_once();
3163
+ var { KeyObject, createSecretKey, createPrivateKey } = __require("crypto");
3164
+ var SUPPORTED_ALGS = [
3165
+ "RS256",
3166
+ "RS384",
3167
+ "RS512",
3168
+ "ES256",
3169
+ "ES384",
3170
+ "ES512",
3171
+ "HS256",
3172
+ "HS384",
3173
+ "HS512",
3174
+ "none"
3175
+ ];
3176
+ if (PS_SUPPORTED) SUPPORTED_ALGS.splice(3, 0, "PS256", "PS384", "PS512");
3177
+ var sign_options_schema = {
3178
+ expiresIn: {
3179
+ isValid: function(value) {
3180
+ return isInteger(value) || isString(value) && value;
3181
+ },
3182
+ message: "\"expiresIn\" should be a number of seconds or string representing a timespan"
3183
+ },
3184
+ notBefore: {
3185
+ isValid: function(value) {
3186
+ return isInteger(value) || isString(value) && value;
3187
+ },
3188
+ message: "\"notBefore\" should be a number of seconds or string representing a timespan"
3189
+ },
3190
+ audience: {
3191
+ isValid: function(value) {
3192
+ return isString(value) || Array.isArray(value);
3193
+ },
3194
+ message: "\"audience\" must be a string or array"
3195
+ },
3196
+ algorithm: {
3197
+ isValid: includes.bind(null, SUPPORTED_ALGS),
3198
+ message: "\"algorithm\" must be a valid string enum value"
3199
+ },
3200
+ header: {
3201
+ isValid: isPlainObject,
3202
+ message: "\"header\" must be an object"
3203
+ },
3204
+ encoding: {
3205
+ isValid: isString,
3206
+ message: "\"encoding\" must be a string"
3207
+ },
3208
+ issuer: {
3209
+ isValid: isString,
3210
+ message: "\"issuer\" must be a string"
3211
+ },
3212
+ subject: {
3213
+ isValid: isString,
3214
+ message: "\"subject\" must be a string"
3215
+ },
3216
+ jwtid: {
3217
+ isValid: isString,
3218
+ message: "\"jwtid\" must be a string"
3219
+ },
3220
+ noTimestamp: {
3221
+ isValid: isBoolean,
3222
+ message: "\"noTimestamp\" must be a boolean"
3223
+ },
3224
+ keyid: {
3225
+ isValid: isString,
3226
+ message: "\"keyid\" must be a string"
3227
+ },
3228
+ mutatePayload: {
3229
+ isValid: isBoolean,
3230
+ message: "\"mutatePayload\" must be a boolean"
3231
+ },
3232
+ allowInsecureKeySizes: {
3233
+ isValid: isBoolean,
3234
+ message: "\"allowInsecureKeySizes\" must be a boolean"
3235
+ },
3236
+ allowInvalidAsymmetricKeyTypes: {
3237
+ isValid: isBoolean,
3238
+ message: "\"allowInvalidAsymmetricKeyTypes\" must be a boolean"
3239
+ }
3240
+ };
3241
+ var registered_claims_schema = {
3242
+ iat: {
3243
+ isValid: isNumber,
3244
+ message: "\"iat\" should be a number of seconds"
3245
+ },
3246
+ exp: {
3247
+ isValid: isNumber,
3248
+ message: "\"exp\" should be a number of seconds"
3249
+ },
3250
+ nbf: {
3251
+ isValid: isNumber,
3252
+ message: "\"nbf\" should be a number of seconds"
3253
+ }
3254
+ };
3255
+ function validate(schema, allowUnknown, object, parameterName) {
3256
+ if (!isPlainObject(object)) throw new Error("Expected \"" + parameterName + "\" to be a plain object.");
3257
+ Object.keys(object).forEach(function(key) {
3258
+ const validator = schema[key];
3259
+ if (!validator) {
3260
+ if (!allowUnknown) throw new Error("\"" + key + "\" is not allowed in \"" + parameterName + "\"");
3261
+ return;
3262
+ }
3263
+ if (!validator.isValid(object[key])) throw new Error(validator.message);
3264
+ });
3265
+ }
3266
+ function validateOptions(options) {
3267
+ return validate(sign_options_schema, false, options, "options");
3268
+ }
3269
+ function validatePayload(payload) {
3270
+ return validate(registered_claims_schema, true, payload, "payload");
3271
+ }
3272
+ var options_to_payload = {
3273
+ "audience": "aud",
3274
+ "issuer": "iss",
3275
+ "subject": "sub",
3276
+ "jwtid": "jti"
3277
+ };
3278
+ var options_for_objects = [
3279
+ "expiresIn",
3280
+ "notBefore",
3281
+ "noTimestamp",
3282
+ "audience",
3283
+ "issuer",
3284
+ "subject",
3285
+ "jwtid"
3286
+ ];
3287
+ module.exports = function(payload, secretOrPrivateKey, options, callback) {
3288
+ if (typeof options === "function") {
3289
+ callback = options;
3290
+ options = {};
3291
+ } else options = options || {};
3292
+ const isObjectPayload = typeof payload === "object" && !Buffer.isBuffer(payload);
3293
+ const header = Object.assign({
3294
+ alg: options.algorithm || "HS256",
3295
+ typ: isObjectPayload ? "JWT" : void 0,
3296
+ kid: options.keyid
3297
+ }, options.header);
3298
+ function failure(err) {
3299
+ if (callback) return callback(err);
3300
+ throw err;
3301
+ }
3302
+ if (!secretOrPrivateKey && options.algorithm !== "none") return failure(/* @__PURE__ */ new Error("secretOrPrivateKey must have a value"));
3303
+ if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) try {
3304
+ secretOrPrivateKey = createPrivateKey(secretOrPrivateKey);
3305
+ } catch (_) {
3306
+ try {
3307
+ secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === "string" ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey);
3308
+ } catch (_) {
3309
+ return failure(/* @__PURE__ */ new Error("secretOrPrivateKey is not valid key material"));
3310
+ }
3311
+ }
3312
+ if (header.alg.startsWith("HS") && secretOrPrivateKey.type !== "secret") return failure(/* @__PURE__ */ new Error(`secretOrPrivateKey must be a symmetric key when using ${header.alg}`));
3313
+ else if (/^(?:RS|PS|ES)/.test(header.alg)) {
3314
+ if (secretOrPrivateKey.type !== "private") return failure(/* @__PURE__ */ new Error(`secretOrPrivateKey must be an asymmetric key when using ${header.alg}`));
3315
+ if (!options.allowInsecureKeySizes && !header.alg.startsWith("ES") && secretOrPrivateKey.asymmetricKeyDetails !== void 0 && secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) return failure(/* @__PURE__ */ new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`));
3316
+ }
3317
+ if (typeof payload === "undefined") return failure(/* @__PURE__ */ new Error("payload is required"));
3318
+ else if (isObjectPayload) {
3319
+ try {
3320
+ validatePayload(payload);
3321
+ } catch (error) {
3322
+ return failure(error);
3323
+ }
3324
+ if (!options.mutatePayload) payload = Object.assign({}, payload);
3325
+ } else {
3326
+ const invalid_options = options_for_objects.filter(function(opt) {
3327
+ return typeof options[opt] !== "undefined";
3328
+ });
3329
+ if (invalid_options.length > 0) return failure(/* @__PURE__ */ new Error("invalid " + invalid_options.join(",") + " option for " + typeof payload + " payload"));
3330
+ }
3331
+ if (typeof payload.exp !== "undefined" && typeof options.expiresIn !== "undefined") return failure(/* @__PURE__ */ new Error("Bad \"options.expiresIn\" option the payload already has an \"exp\" property."));
3332
+ if (typeof payload.nbf !== "undefined" && typeof options.notBefore !== "undefined") return failure(/* @__PURE__ */ new Error("Bad \"options.notBefore\" option the payload already has an \"nbf\" property."));
3333
+ try {
3334
+ validateOptions(options);
3335
+ } catch (error) {
3336
+ return failure(error);
3337
+ }
3338
+ if (!options.allowInvalidAsymmetricKeyTypes) try {
3339
+ validateAsymmetricKey(header.alg, secretOrPrivateKey);
3340
+ } catch (error) {
3341
+ return failure(error);
3342
+ }
3343
+ const timestamp = payload.iat || Math.floor(Date.now() / 1e3);
3344
+ if (options.noTimestamp) delete payload.iat;
3345
+ else if (isObjectPayload) payload.iat = timestamp;
3346
+ if (typeof options.notBefore !== "undefined") {
3347
+ try {
3348
+ payload.nbf = timespan(options.notBefore, timestamp);
3349
+ } catch (err) {
3350
+ return failure(err);
3351
+ }
3352
+ if (typeof payload.nbf === "undefined") return failure(/* @__PURE__ */ new Error("\"notBefore\" should be a number of seconds or string representing a timespan eg: \"1d\", \"20h\", 60"));
3353
+ }
3354
+ if (typeof options.expiresIn !== "undefined" && typeof payload === "object") {
3355
+ try {
3356
+ payload.exp = timespan(options.expiresIn, timestamp);
3357
+ } catch (err) {
3358
+ return failure(err);
3359
+ }
3360
+ if (typeof payload.exp === "undefined") return failure(/* @__PURE__ */ new Error("\"expiresIn\" should be a number of seconds or string representing a timespan eg: \"1d\", \"20h\", 60"));
3361
+ }
3362
+ Object.keys(options_to_payload).forEach(function(key) {
3363
+ const claim = options_to_payload[key];
3364
+ if (typeof options[key] !== "undefined") {
3365
+ if (typeof payload[claim] !== "undefined") return failure(/* @__PURE__ */ new Error("Bad \"options." + key + "\" option. The payload already has an \"" + claim + "\" property."));
3366
+ payload[claim] = options[key];
3367
+ }
3368
+ });
3369
+ const encoding = options.encoding || "utf8";
3370
+ if (typeof callback === "function") {
3371
+ callback = callback && once(callback);
3372
+ jws.createSign({
3373
+ header,
3374
+ privateKey: secretOrPrivateKey,
3375
+ payload,
3376
+ encoding
3377
+ }).once("error", callback).once("done", function(signature) {
3378
+ if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) return callback(/* @__PURE__ */ new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`));
3379
+ callback(null, signature);
3380
+ });
3381
+ } else {
3382
+ let signature = jws.sign({
3383
+ header,
3384
+ payload,
3385
+ secret: secretOrPrivateKey,
3386
+ encoding
3387
+ });
3388
+ if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`);
3389
+ return signature;
3390
+ }
3391
+ };
3392
+ }));
3393
+ //#endregion
3394
+ //#region ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/index.js
3395
+ var require_jsonwebtoken = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3396
+ module.exports = {
3397
+ decode: require_decode(),
3398
+ verify: require_verify(),
3399
+ sign: require_sign(),
3400
+ JsonWebTokenError: require_JsonWebTokenError(),
3401
+ NotBeforeError: require_NotBeforeError(),
3402
+ TokenExpiredError: require_TokenExpiredError()
3403
+ };
3404
+ }));
3405
+ //#endregion
3406
+ //#region src/auth/jwt.ts
3407
+ var jwt_exports = /* @__PURE__ */ __exportAll({
3408
+ configureJwt: () => configureJwt,
3409
+ generateAccessToken: () => generateAccessToken,
3410
+ generateRefreshToken: () => generateRefreshToken,
3411
+ getAccessTokenExpiry: () => getAccessTokenExpiry,
3412
+ getAccessTokenExpiryMs: () => getAccessTokenExpiryMs,
3413
+ getRefreshTokenExpiry: () => getRefreshTokenExpiry,
3414
+ hashRefreshToken: () => hashRefreshToken,
3415
+ verifyAccessToken: () => verifyAccessToken
3416
+ });
3417
+ var import_jsonwebtoken = /* @__PURE__ */ __toESM(require_jsonwebtoken(), 1);
3418
+ var jwtConfig = {
3419
+ secret: "",
3420
+ accessExpiresIn: "1h",
3421
+ refreshExpiresIn: "30d"
3422
+ };
3423
+ /**
3424
+ * Configure JWT settings - call this during initialization.
3425
+ * Validates the secret strength to prevent deployment with default/weak secrets.
3426
+ */
3427
+ function configureJwt(config) {
3428
+ const weakSecrets = new Set([
3429
+ "secret",
3430
+ "jwt-secret",
3431
+ "jwt_secret",
3432
+ "your-secret",
3433
+ "your-super-secret-jwt-key-change-in-production",
3434
+ "super-secret-jwt-key-change-in-production",
3435
+ "change-me",
3436
+ "changeme",
3437
+ "password",
3438
+ "test",
3439
+ "mysecret",
3440
+ "my-secret",
3441
+ "my_secret",
3442
+ "example-secret",
3443
+ "please-change-me",
3444
+ "replace-this-with-a-real-secret",
3445
+ "default-secret",
3446
+ "rebase_saas_jwt_secret_must_be_long_long_long_long",
3447
+ "rebase_saas_service_key_must_be_long_long_long_long"
3448
+ ]);
3449
+ if (!config.secret || config.secret.length < 32) throw new Error("JWT secret is too short. Must be at least 32 characters. Generate one with: node -e \"logger.info(require('crypto').randomBytes(48).toString('base64'))\"");
3450
+ if (weakSecrets.has(config.secret.toLowerCase())) throw new Error("JWT secret is a known default/weak value. Please use a strong, randomly generated secret. Generate one with: node -e \"logger.info(require('crypto').randomBytes(48).toString('base64'))\"");
3451
+ jwtConfig = {
3452
+ ...jwtConfig,
3453
+ ...config
3454
+ };
3455
+ }
3456
+ /**
3457
+ * Generate an access token (short-lived, 1 hour by default)
3458
+ */
3459
+ function generateAccessToken(userId, roles, aal = "aal1", customClaims) {
3460
+ if (!jwtConfig.secret) throw new Error("JWT secret not configured. Call configureJwt() first.");
3461
+ const payload = {
3462
+ userId,
3463
+ roles,
3464
+ aal,
3465
+ ...customClaims
3466
+ };
3467
+ return import_jsonwebtoken.default.sign(payload, jwtConfig.secret, {
3468
+ expiresIn: jwtConfig.accessExpiresIn,
3469
+ algorithm: "HS256"
3470
+ });
3471
+ }
3472
+ /**
3473
+ * Get the expiration time of an access token in milliseconds from now
3474
+ */
3475
+ function getAccessTokenExpiryMs() {
3476
+ const match = (jwtConfig.accessExpiresIn || "1h").match(/^(\d+)([dhms])$/);
3477
+ if (!match) return 3600 * 1e3;
3478
+ const value = parseInt(match[1], 10);
3479
+ switch (match[2]) {
3480
+ case "d": return value * 24 * 60 * 60 * 1e3;
3481
+ case "h": return value * 60 * 60 * 1e3;
3482
+ case "m": return value * 60 * 1e3;
3483
+ case "s": return value * 1e3;
3484
+ default: return 3600 * 1e3;
3485
+ }
3486
+ }
3487
+ /**
3488
+ * Get the expiration timestamp for an access token
3489
+ */
3490
+ function getAccessTokenExpiry() {
3491
+ return Date.now() + getAccessTokenExpiryMs();
3492
+ }
3493
+ /**
3494
+ * Verify and decode an access token
3495
+ */
3496
+ function verifyAccessToken(token) {
3497
+ if (!jwtConfig.secret) throw new Error("JWT secret not configured. Call configureJwt() first.");
3498
+ try {
3499
+ const decoded = import_jsonwebtoken.default.verify(token, jwtConfig.secret, { algorithms: ["HS256"] });
3500
+ const id = decoded.userId || decoded.uid || decoded.sub;
3501
+ if (!id) {
3502
+ logger.error("[JWT] Verification failed: missing id in payload", { detail: decoded });
3503
+ return null;
3504
+ }
3505
+ const aal = decoded.aal === "aal1" || decoded.aal === "aal2" ? decoded.aal : "aal1";
3506
+ return {
3507
+ userId: id,
3508
+ roles: decoded.roles || [],
3509
+ aal
3510
+ };
3511
+ } catch (error) {
3512
+ logger.error("[JWT] Verification failed", {
3513
+ error,
3514
+ detail: token.substring(0, 15)
3515
+ });
3516
+ return null;
3517
+ }
3518
+ }
3519
+ /**
3520
+ * Generate a random refresh token (long-lived, 30 days by default)
3521
+ */
3522
+ function generateRefreshToken() {
3523
+ return randomBytes(40).toString("hex");
3524
+ }
3525
+ /**
3526
+ * Hash a refresh token for database storage (don't store raw tokens)
3527
+ */
3528
+ function hashRefreshToken(token) {
3529
+ return createHash("sha256").update(token).digest("hex");
3530
+ }
3531
+ /**
3532
+ * Calculate refresh token expiration date
3533
+ */
3534
+ function getRefreshTokenExpiry() {
3535
+ const match = (jwtConfig.refreshExpiresIn || "30d").match(/^(\d+)([dhms])$/);
3536
+ if (!match) return new Date(Date.now() + 720 * 60 * 60 * 1e3);
3537
+ const value = parseInt(match[1], 10);
3538
+ const unit = match[2];
3539
+ let ms;
3540
+ switch (unit) {
3541
+ case "d":
3542
+ ms = value * 24 * 60 * 60 * 1e3;
3543
+ break;
3544
+ case "h":
3545
+ ms = value * 60 * 60 * 1e3;
3546
+ break;
3547
+ case "m":
3548
+ ms = value * 60 * 1e3;
3549
+ break;
3550
+ case "s":
3551
+ ms = value * 1e3;
3552
+ break;
3553
+ default: ms = 720 * 60 * 60 * 1e3;
3554
+ }
3555
+ return new Date(Date.now() + ms);
3556
+ }
3557
+ //#endregion
3558
+ export { getRefreshTokenExpiry as a, verifyAccessToken as c, getAccessTokenExpiry as i, require_jsonwebtoken as l, generateAccessToken as n, hashRefreshToken as o, generateRefreshToken as r, jwt_exports as s, configureJwt as t };
3559
+
3560
+ //# sourceMappingURL=jwt-BETC8a1J.js.map