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