stockhub-sms 1.0.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 (2189) hide show
  1. package/.gitignore +35 -0
  2. package/README.md +303 -0
  3. package/backend-project/.env +3 -0
  4. package/backend-project/.env.example +3 -0
  5. package/backend-project/config/database.js +13 -0
  6. package/backend-project/controllers/authController.js +70 -0
  7. package/backend-project/controllers/productController.js +58 -0
  8. package/backend-project/controllers/reportController.js +206 -0
  9. package/backend-project/controllers/transactionController.js +199 -0
  10. package/backend-project/controllers/warehouseController.js +54 -0
  11. package/backend-project/middleware/auth.js +20 -0
  12. package/backend-project/models/Product.js +44 -0
  13. package/backend-project/models/StockTransaction.js +32 -0
  14. package/backend-project/models/User.js +18 -0
  15. package/backend-project/models/Warehouse.js +24 -0
  16. package/backend-project/node_modules/.bin/mime +16 -0
  17. package/backend-project/node_modules/.bin/mime.cmd +17 -0
  18. package/backend-project/node_modules/.bin/mime.ps1 +28 -0
  19. package/backend-project/node_modules/.bin/nodemon +16 -0
  20. package/backend-project/node_modules/.bin/nodemon.cmd +17 -0
  21. package/backend-project/node_modules/.bin/nodemon.ps1 +28 -0
  22. package/backend-project/node_modules/.bin/nodetouch +16 -0
  23. package/backend-project/node_modules/.bin/nodetouch.cmd +17 -0
  24. package/backend-project/node_modules/.bin/nodetouch.ps1 +28 -0
  25. package/backend-project/node_modules/.bin/semver +16 -0
  26. package/backend-project/node_modules/.bin/semver.cmd +17 -0
  27. package/backend-project/node_modules/.bin/semver.ps1 +28 -0
  28. package/backend-project/node_modules/.package-lock.json +1609 -0
  29. package/backend-project/node_modules/@mongodb-js/saslprep/LICENSE +22 -0
  30. package/backend-project/node_modules/@mongodb-js/saslprep/dist/.esm-wrapper.mjs +4 -0
  31. package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.d.ts +5 -0
  32. package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.d.ts.map +1 -0
  33. package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.js +12 -0
  34. package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.js.map +1 -0
  35. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts +3 -0
  36. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts.map +1 -0
  37. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js +5 -0
  38. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js.map +1 -0
  39. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts +3 -0
  40. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts.map +1 -0
  41. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.js +5 -0
  42. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.js.map +1 -0
  43. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts +7 -0
  44. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts.map +1 -0
  45. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.js +881 -0
  46. package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.js.map +1 -0
  47. package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts +2 -0
  48. package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts.map +1 -0
  49. package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js +83 -0
  50. package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js.map +1 -0
  51. package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.d.ts +11 -0
  52. package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.d.ts.map +1 -0
  53. package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.js +65 -0
  54. package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.js.map +1 -0
  55. package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts +10 -0
  56. package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts.map +1 -0
  57. package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js +32 -0
  58. package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js.map +1 -0
  59. package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.d.ts +10 -0
  60. package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.d.ts.map +1 -0
  61. package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.js +15 -0
  62. package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.js.map +1 -0
  63. package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.d.ts +2 -0
  64. package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.d.ts.map +1 -0
  65. package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.js +11 -0
  66. package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.js.map +1 -0
  67. package/backend-project/node_modules/@mongodb-js/saslprep/package.json +87 -0
  68. package/backend-project/node_modules/@mongodb-js/saslprep/readme.md +29 -0
  69. package/backend-project/node_modules/@types/node/LICENSE +21 -0
  70. package/backend-project/node_modules/@types/node/README.md +15 -0
  71. package/backend-project/node_modules/@types/node/assert/strict.d.ts +59 -0
  72. package/backend-project/node_modules/@types/node/assert.d.ts +950 -0
  73. package/backend-project/node_modules/@types/node/async_hooks.d.ts +711 -0
  74. package/backend-project/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  75. package/backend-project/node_modules/@types/node/buffer.d.ts +1765 -0
  76. package/backend-project/node_modules/@types/node/child_process.d.ts +1366 -0
  77. package/backend-project/node_modules/@types/node/cluster.d.ts +432 -0
  78. package/backend-project/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  79. package/backend-project/node_modules/@types/node/console.d.ts +93 -0
  80. package/backend-project/node_modules/@types/node/constants.d.ts +14 -0
  81. package/backend-project/node_modules/@types/node/crypto.d.ts +4058 -0
  82. package/backend-project/node_modules/@types/node/dgram.d.ts +537 -0
  83. package/backend-project/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
  84. package/backend-project/node_modules/@types/node/dns/promises.d.ts +497 -0
  85. package/backend-project/node_modules/@types/node/dns.d.ts +876 -0
  86. package/backend-project/node_modules/@types/node/domain.d.ts +150 -0
  87. package/backend-project/node_modules/@types/node/events.d.ts +1008 -0
  88. package/backend-project/node_modules/@types/node/fs/promises.d.ts +1468 -0
  89. package/backend-project/node_modules/@types/node/fs.d.ts +4780 -0
  90. package/backend-project/node_modules/@types/node/globals.d.ts +150 -0
  91. package/backend-project/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  92. package/backend-project/node_modules/@types/node/http.d.ts +2147 -0
  93. package/backend-project/node_modules/@types/node/http2.d.ts +2485 -0
  94. package/backend-project/node_modules/@types/node/https.d.ts +400 -0
  95. package/backend-project/node_modules/@types/node/index.d.ts +117 -0
  96. package/backend-project/node_modules/@types/node/inspector/promises.d.ts +35 -0
  97. package/backend-project/node_modules/@types/node/inspector.d.ts +264 -0
  98. package/backend-project/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  99. package/backend-project/node_modules/@types/node/module.d.ts +755 -0
  100. package/backend-project/node_modules/@types/node/net.d.ts +970 -0
  101. package/backend-project/node_modules/@types/node/os.d.ts +498 -0
  102. package/backend-project/node_modules/@types/node/package.json +155 -0
  103. package/backend-project/node_modules/@types/node/path/posix.d.ts +8 -0
  104. package/backend-project/node_modules/@types/node/path/win32.d.ts +8 -0
  105. package/backend-project/node_modules/@types/node/path.d.ts +178 -0
  106. package/backend-project/node_modules/@types/node/perf_hooks.d.ts +612 -0
  107. package/backend-project/node_modules/@types/node/process.d.ts +2204 -0
  108. package/backend-project/node_modules/@types/node/punycode.d.ts +89 -0
  109. package/backend-project/node_modules/@types/node/querystring.d.ts +139 -0
  110. package/backend-project/node_modules/@types/node/quic.d.ts +897 -0
  111. package/backend-project/node_modules/@types/node/readline/promises.d.ts +158 -0
  112. package/backend-project/node_modules/@types/node/readline.d.ts +507 -0
  113. package/backend-project/node_modules/@types/node/repl.d.ts +420 -0
  114. package/backend-project/node_modules/@types/node/sea.d.ts +47 -0
  115. package/backend-project/node_modules/@types/node/sqlite.d.ts +1068 -0
  116. package/backend-project/node_modules/@types/node/stream/consumers.d.ts +114 -0
  117. package/backend-project/node_modules/@types/node/stream/iter.d.ts +301 -0
  118. package/backend-project/node_modules/@types/node/stream/promises.d.ts +211 -0
  119. package/backend-project/node_modules/@types/node/stream/web.d.ts +300 -0
  120. package/backend-project/node_modules/@types/node/stream.d.ts +1774 -0
  121. package/backend-project/node_modules/@types/node/string_decoder.d.ts +27 -0
  122. package/backend-project/node_modules/@types/node/test/reporters.d.ts +59 -0
  123. package/backend-project/node_modules/@types/node/test.d.ts +2279 -0
  124. package/backend-project/node_modules/@types/node/timers/promises.d.ts +93 -0
  125. package/backend-project/node_modules/@types/node/timers.d.ts +149 -0
  126. package/backend-project/node_modules/@types/node/tls.d.ts +1193 -0
  127. package/backend-project/node_modules/@types/node/trace_events.d.ts +103 -0
  128. package/backend-project/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  129. package/backend-project/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  130. package/backend-project/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  131. package/backend-project/node_modules/@types/node/ts5.6/index.d.ts +119 -0
  132. package/backend-project/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  133. package/backend-project/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  134. package/backend-project/node_modules/@types/node/tty.d.ts +225 -0
  135. package/backend-project/node_modules/@types/node/url.d.ts +556 -0
  136. package/backend-project/node_modules/@types/node/util/types.d.ts +558 -0
  137. package/backend-project/node_modules/@types/node/util.d.ts +1677 -0
  138. package/backend-project/node_modules/@types/node/v8.d.ts +980 -0
  139. package/backend-project/node_modules/@types/node/vm.d.ts +1136 -0
  140. package/backend-project/node_modules/@types/node/wasi.d.ts +131 -0
  141. package/backend-project/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  142. package/backend-project/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  143. package/backend-project/node_modules/@types/node/web-globals/console.d.ts +9 -0
  144. package/backend-project/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  145. package/backend-project/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  146. package/backend-project/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  147. package/backend-project/node_modules/@types/node/web-globals/events.d.ts +106 -0
  148. package/backend-project/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  149. package/backend-project/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  150. package/backend-project/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  151. package/backend-project/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  152. package/backend-project/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  153. package/backend-project/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  154. package/backend-project/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  155. package/backend-project/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  156. package/backend-project/node_modules/@types/node/web-globals/url.d.ts +24 -0
  157. package/backend-project/node_modules/@types/node/worker_threads.d.ts +671 -0
  158. package/backend-project/node_modules/@types/node/zlib/iter.d.ts +131 -0
  159. package/backend-project/node_modules/@types/node/zlib.d.ts +589 -0
  160. package/backend-project/node_modules/@types/webidl-conversions/LICENSE +21 -0
  161. package/backend-project/node_modules/@types/webidl-conversions/README.md +15 -0
  162. package/backend-project/node_modules/@types/webidl-conversions/index.d.ts +91 -0
  163. package/backend-project/node_modules/@types/webidl-conversions/package.json +30 -0
  164. package/backend-project/node_modules/@types/whatwg-url/LICENSE +21 -0
  165. package/backend-project/node_modules/@types/whatwg-url/README.md +16 -0
  166. package/backend-project/node_modules/@types/whatwg-url/dist/URL-impl.d.ts +23 -0
  167. package/backend-project/node_modules/@types/whatwg-url/dist/URL.d.ts +76 -0
  168. package/backend-project/node_modules/@types/whatwg-url/dist/URLSearchParams-impl.d.ts +23 -0
  169. package/backend-project/node_modules/@types/whatwg-url/dist/URLSearchParams.d.ts +91 -0
  170. package/backend-project/node_modules/@types/whatwg-url/index.d.ts +162 -0
  171. package/backend-project/node_modules/@types/whatwg-url/package.json +33 -0
  172. package/backend-project/node_modules/@types/whatwg-url/webidl2js-wrapper.d.ts +4 -0
  173. package/backend-project/node_modules/accepts/HISTORY.md +243 -0
  174. package/backend-project/node_modules/accepts/LICENSE +23 -0
  175. package/backend-project/node_modules/accepts/README.md +140 -0
  176. package/backend-project/node_modules/accepts/index.js +238 -0
  177. package/backend-project/node_modules/accepts/package.json +47 -0
  178. package/backend-project/node_modules/anymatch/LICENSE +15 -0
  179. package/backend-project/node_modules/anymatch/README.md +87 -0
  180. package/backend-project/node_modules/anymatch/index.d.ts +20 -0
  181. package/backend-project/node_modules/anymatch/index.js +104 -0
  182. package/backend-project/node_modules/anymatch/package.json +48 -0
  183. package/backend-project/node_modules/array-flatten/LICENSE +21 -0
  184. package/backend-project/node_modules/array-flatten/README.md +43 -0
  185. package/backend-project/node_modules/array-flatten/array-flatten.js +64 -0
  186. package/backend-project/node_modules/array-flatten/package.json +39 -0
  187. package/backend-project/node_modules/balanced-match/LICENSE.md +23 -0
  188. package/backend-project/node_modules/balanced-match/README.md +57 -0
  189. package/backend-project/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
  190. package/backend-project/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
  191. package/backend-project/node_modules/balanced-match/dist/commonjs/index.js +59 -0
  192. package/backend-project/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
  193. package/backend-project/node_modules/balanced-match/dist/commonjs/package.json +3 -0
  194. package/backend-project/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
  195. package/backend-project/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
  196. package/backend-project/node_modules/balanced-match/dist/esm/index.js +54 -0
  197. package/backend-project/node_modules/balanced-match/dist/esm/index.js.map +1 -0
  198. package/backend-project/node_modules/balanced-match/dist/esm/package.json +3 -0
  199. package/backend-project/node_modules/balanced-match/package.json +68 -0
  200. package/backend-project/node_modules/bcryptjs/.travis.yml +18 -0
  201. package/backend-project/node_modules/bcryptjs/.vscode/settings.json +3 -0
  202. package/backend-project/node_modules/bcryptjs/LICENSE +50 -0
  203. package/backend-project/node_modules/bcryptjs/README.md +251 -0
  204. package/backend-project/node_modules/bcryptjs/bin/bcrypt +25 -0
  205. package/backend-project/node_modules/bcryptjs/bower.json +22 -0
  206. package/backend-project/node_modules/bcryptjs/dist/README.md +15 -0
  207. package/backend-project/node_modules/bcryptjs/dist/bcrypt.js +1379 -0
  208. package/backend-project/node_modules/bcryptjs/dist/bcrypt.min.js +48 -0
  209. package/backend-project/node_modules/bcryptjs/dist/bcrypt.min.js.gz +0 -0
  210. package/backend-project/node_modules/bcryptjs/dist/bcrypt.min.map +8 -0
  211. package/backend-project/node_modules/bcryptjs/externs/bcrypt.js +91 -0
  212. package/backend-project/node_modules/bcryptjs/externs/minimal-env.js +98 -0
  213. package/backend-project/node_modules/bcryptjs/index.js +29 -0
  214. package/backend-project/node_modules/bcryptjs/package.json +47 -0
  215. package/backend-project/node_modules/bcryptjs/scripts/build.js +37 -0
  216. package/backend-project/node_modules/bcryptjs/src/bcrypt/impl.js +669 -0
  217. package/backend-project/node_modules/bcryptjs/src/bcrypt/prng/README.md +5 -0
  218. package/backend-project/node_modules/bcryptjs/src/bcrypt/prng/accum.js +133 -0
  219. package/backend-project/node_modules/bcryptjs/src/bcrypt/prng/isaac.js +140 -0
  220. package/backend-project/node_modules/bcryptjs/src/bcrypt/util/base64.js +115 -0
  221. package/backend-project/node_modules/bcryptjs/src/bcrypt/util.js +33 -0
  222. package/backend-project/node_modules/bcryptjs/src/bcrypt.js +327 -0
  223. package/backend-project/node_modules/bcryptjs/src/bower.json +22 -0
  224. package/backend-project/node_modules/bcryptjs/src/wrap.js +50 -0
  225. package/backend-project/node_modules/bcryptjs/tests/quickbrown.txt +150 -0
  226. package/backend-project/node_modules/bcryptjs/tests/suite.js +197 -0
  227. package/backend-project/node_modules/binary-extensions/binary-extensions.json +263 -0
  228. package/backend-project/node_modules/binary-extensions/binary-extensions.json.d.ts +3 -0
  229. package/backend-project/node_modules/binary-extensions/index.d.ts +14 -0
  230. package/backend-project/node_modules/binary-extensions/index.js +1 -0
  231. package/backend-project/node_modules/binary-extensions/license +10 -0
  232. package/backend-project/node_modules/binary-extensions/package.json +40 -0
  233. package/backend-project/node_modules/binary-extensions/readme.md +25 -0
  234. package/backend-project/node_modules/body-parser/HISTORY.md +686 -0
  235. package/backend-project/node_modules/body-parser/LICENSE +23 -0
  236. package/backend-project/node_modules/body-parser/README.md +476 -0
  237. package/backend-project/node_modules/body-parser/index.js +156 -0
  238. package/backend-project/node_modules/body-parser/lib/read.js +205 -0
  239. package/backend-project/node_modules/body-parser/lib/types/json.js +243 -0
  240. package/backend-project/node_modules/body-parser/lib/types/raw.js +101 -0
  241. package/backend-project/node_modules/body-parser/lib/types/text.js +121 -0
  242. package/backend-project/node_modules/body-parser/lib/types/urlencoded.js +299 -0
  243. package/backend-project/node_modules/body-parser/package.json +55 -0
  244. package/backend-project/node_modules/brace-expansion/LICENSE +23 -0
  245. package/backend-project/node_modules/brace-expansion/README.md +94 -0
  246. package/backend-project/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
  247. package/backend-project/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
  248. package/backend-project/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
  249. package/backend-project/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
  250. package/backend-project/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
  251. package/backend-project/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
  252. package/backend-project/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
  253. package/backend-project/node_modules/brace-expansion/dist/esm/index.js +197 -0
  254. package/backend-project/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
  255. package/backend-project/node_modules/brace-expansion/dist/esm/package.json +3 -0
  256. package/backend-project/node_modules/brace-expansion/package.json +64 -0
  257. package/backend-project/node_modules/braces/LICENSE +21 -0
  258. package/backend-project/node_modules/braces/README.md +586 -0
  259. package/backend-project/node_modules/braces/index.js +170 -0
  260. package/backend-project/node_modules/braces/lib/compile.js +60 -0
  261. package/backend-project/node_modules/braces/lib/constants.js +57 -0
  262. package/backend-project/node_modules/braces/lib/expand.js +113 -0
  263. package/backend-project/node_modules/braces/lib/parse.js +331 -0
  264. package/backend-project/node_modules/braces/lib/stringify.js +32 -0
  265. package/backend-project/node_modules/braces/lib/utils.js +122 -0
  266. package/backend-project/node_modules/braces/package.json +77 -0
  267. package/backend-project/node_modules/bson/LICENSE.md +201 -0
  268. package/backend-project/node_modules/bson/README.md +238 -0
  269. package/backend-project/node_modules/bson/bson.d.ts +1302 -0
  270. package/backend-project/node_modules/bson/etc/prepare.js +19 -0
  271. package/backend-project/node_modules/bson/lib/bson.bundle.js +4149 -0
  272. package/backend-project/node_modules/bson/lib/bson.bundle.js.map +1 -0
  273. package/backend-project/node_modules/bson/lib/bson.cjs +4144 -0
  274. package/backend-project/node_modules/bson/lib/bson.cjs.map +1 -0
  275. package/backend-project/node_modules/bson/lib/bson.mjs +4116 -0
  276. package/backend-project/node_modules/bson/lib/bson.mjs.map +1 -0
  277. package/backend-project/node_modules/bson/lib/bson.rn.cjs +4159 -0
  278. package/backend-project/node_modules/bson/lib/bson.rn.cjs.map +1 -0
  279. package/backend-project/node_modules/bson/package.json +116 -0
  280. package/backend-project/node_modules/bson/src/binary.ts +510 -0
  281. package/backend-project/node_modules/bson/src/bson.ts +250 -0
  282. package/backend-project/node_modules/bson/src/bson_value.ts +18 -0
  283. package/backend-project/node_modules/bson/src/code.ts +69 -0
  284. package/backend-project/node_modules/bson/src/constants.ts +141 -0
  285. package/backend-project/node_modules/bson/src/db_ref.ts +127 -0
  286. package/backend-project/node_modules/bson/src/decimal128.ts +858 -0
  287. package/backend-project/node_modules/bson/src/double.ts +83 -0
  288. package/backend-project/node_modules/bson/src/error.ts +83 -0
  289. package/backend-project/node_modules/bson/src/extended_json.ts +515 -0
  290. package/backend-project/node_modules/bson/src/index.ts +19 -0
  291. package/backend-project/node_modules/bson/src/int_32.ts +70 -0
  292. package/backend-project/node_modules/bson/src/long.ts +1067 -0
  293. package/backend-project/node_modules/bson/src/max_key.ts +36 -0
  294. package/backend-project/node_modules/bson/src/min_key.ts +36 -0
  295. package/backend-project/node_modules/bson/src/objectid.ts +323 -0
  296. package/backend-project/node_modules/bson/src/parser/calculate_size.ts +211 -0
  297. package/backend-project/node_modules/bson/src/parser/deserializer.ts +751 -0
  298. package/backend-project/node_modules/bson/src/parser/serializer.ts +1001 -0
  299. package/backend-project/node_modules/bson/src/parser/utils.ts +29 -0
  300. package/backend-project/node_modules/bson/src/regexp.ts +114 -0
  301. package/backend-project/node_modules/bson/src/symbol.ts +58 -0
  302. package/backend-project/node_modules/bson/src/timestamp.ts +152 -0
  303. package/backend-project/node_modules/bson/src/utils/byte_utils.ts +61 -0
  304. package/backend-project/node_modules/bson/src/utils/node_byte_utils.ts +141 -0
  305. package/backend-project/node_modules/bson/src/utils/web_byte_utils.ts +190 -0
  306. package/backend-project/node_modules/bson/src/validate_utf8.ts +47 -0
  307. package/backend-project/node_modules/bson/vendor/base64/LICENSE-MIT.txt +20 -0
  308. package/backend-project/node_modules/bson/vendor/base64/README.md +112 -0
  309. package/backend-project/node_modules/bson/vendor/base64/base64.js +157 -0
  310. package/backend-project/node_modules/bson/vendor/base64/package.json +43 -0
  311. package/backend-project/node_modules/bson/vendor/text-encoding/LICENSE.md +237 -0
  312. package/backend-project/node_modules/bson/vendor/text-encoding/README.md +111 -0
  313. package/backend-project/node_modules/bson/vendor/text-encoding/index.js +9 -0
  314. package/backend-project/node_modules/bson/vendor/text-encoding/lib/encoding-indexes.js +47 -0
  315. package/backend-project/node_modules/bson/vendor/text-encoding/lib/encoding.js +3301 -0
  316. package/backend-project/node_modules/bson/vendor/text-encoding/package.json +37 -0
  317. package/backend-project/node_modules/buffer-equal-constant-time/.travis.yml +4 -0
  318. package/backend-project/node_modules/buffer-equal-constant-time/LICENSE.txt +12 -0
  319. package/backend-project/node_modules/buffer-equal-constant-time/README.md +50 -0
  320. package/backend-project/node_modules/buffer-equal-constant-time/index.js +41 -0
  321. package/backend-project/node_modules/buffer-equal-constant-time/package.json +21 -0
  322. package/backend-project/node_modules/buffer-equal-constant-time/test.js +42 -0
  323. package/backend-project/node_modules/bytes/History.md +97 -0
  324. package/backend-project/node_modules/bytes/LICENSE +23 -0
  325. package/backend-project/node_modules/bytes/Readme.md +152 -0
  326. package/backend-project/node_modules/bytes/index.js +170 -0
  327. package/backend-project/node_modules/bytes/package.json +42 -0
  328. package/backend-project/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  329. package/backend-project/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  330. package/backend-project/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  331. package/backend-project/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  332. package/backend-project/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  333. package/backend-project/node_modules/call-bind-apply-helpers/README.md +62 -0
  334. package/backend-project/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  335. package/backend-project/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  336. package/backend-project/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  337. package/backend-project/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  338. package/backend-project/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  339. package/backend-project/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  340. package/backend-project/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  341. package/backend-project/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  342. package/backend-project/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  343. package/backend-project/node_modules/call-bind-apply-helpers/index.js +15 -0
  344. package/backend-project/node_modules/call-bind-apply-helpers/package.json +85 -0
  345. package/backend-project/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  346. package/backend-project/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  347. package/backend-project/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  348. package/backend-project/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  349. package/backend-project/node_modules/call-bound/.eslintrc +13 -0
  350. package/backend-project/node_modules/call-bound/.github/FUNDING.yml +12 -0
  351. package/backend-project/node_modules/call-bound/.nycrc +9 -0
  352. package/backend-project/node_modules/call-bound/CHANGELOG.md +42 -0
  353. package/backend-project/node_modules/call-bound/LICENSE +21 -0
  354. package/backend-project/node_modules/call-bound/README.md +53 -0
  355. package/backend-project/node_modules/call-bound/index.d.ts +94 -0
  356. package/backend-project/node_modules/call-bound/index.js +19 -0
  357. package/backend-project/node_modules/call-bound/package.json +99 -0
  358. package/backend-project/node_modules/call-bound/test/index.js +61 -0
  359. package/backend-project/node_modules/call-bound/tsconfig.json +10 -0
  360. package/backend-project/node_modules/chokidar/LICENSE +21 -0
  361. package/backend-project/node_modules/chokidar/README.md +308 -0
  362. package/backend-project/node_modules/chokidar/index.js +973 -0
  363. package/backend-project/node_modules/chokidar/lib/constants.js +66 -0
  364. package/backend-project/node_modules/chokidar/lib/fsevents-handler.js +526 -0
  365. package/backend-project/node_modules/chokidar/lib/nodefs-handler.js +654 -0
  366. package/backend-project/node_modules/chokidar/package.json +70 -0
  367. package/backend-project/node_modules/chokidar/types/index.d.ts +192 -0
  368. package/backend-project/node_modules/content-disposition/HISTORY.md +60 -0
  369. package/backend-project/node_modules/content-disposition/LICENSE +22 -0
  370. package/backend-project/node_modules/content-disposition/README.md +142 -0
  371. package/backend-project/node_modules/content-disposition/index.js +458 -0
  372. package/backend-project/node_modules/content-disposition/package.json +44 -0
  373. package/backend-project/node_modules/content-type/HISTORY.md +29 -0
  374. package/backend-project/node_modules/content-type/LICENSE +22 -0
  375. package/backend-project/node_modules/content-type/README.md +94 -0
  376. package/backend-project/node_modules/content-type/index.js +225 -0
  377. package/backend-project/node_modules/content-type/package.json +42 -0
  378. package/backend-project/node_modules/cookie/LICENSE +24 -0
  379. package/backend-project/node_modules/cookie/README.md +317 -0
  380. package/backend-project/node_modules/cookie/SECURITY.md +25 -0
  381. package/backend-project/node_modules/cookie/index.js +335 -0
  382. package/backend-project/node_modules/cookie/package.json +44 -0
  383. package/backend-project/node_modules/cookie-signature/History.md +42 -0
  384. package/backend-project/node_modules/cookie-signature/Readme.md +42 -0
  385. package/backend-project/node_modules/cookie-signature/index.js +51 -0
  386. package/backend-project/node_modules/cookie-signature/package.json +18 -0
  387. package/backend-project/node_modules/cors/LICENSE +22 -0
  388. package/backend-project/node_modules/cors/README.md +277 -0
  389. package/backend-project/node_modules/cors/lib/index.js +238 -0
  390. package/backend-project/node_modules/cors/package.json +42 -0
  391. package/backend-project/node_modules/debug/.coveralls.yml +1 -0
  392. package/backend-project/node_modules/debug/.eslintrc +11 -0
  393. package/backend-project/node_modules/debug/.travis.yml +14 -0
  394. package/backend-project/node_modules/debug/CHANGELOG.md +362 -0
  395. package/backend-project/node_modules/debug/LICENSE +19 -0
  396. package/backend-project/node_modules/debug/Makefile +50 -0
  397. package/backend-project/node_modules/debug/README.md +312 -0
  398. package/backend-project/node_modules/debug/component.json +19 -0
  399. package/backend-project/node_modules/debug/karma.conf.js +70 -0
  400. package/backend-project/node_modules/debug/node.js +1 -0
  401. package/backend-project/node_modules/debug/package.json +49 -0
  402. package/backend-project/node_modules/debug/src/browser.js +185 -0
  403. package/backend-project/node_modules/debug/src/debug.js +202 -0
  404. package/backend-project/node_modules/debug/src/index.js +10 -0
  405. package/backend-project/node_modules/debug/src/inspector-log.js +15 -0
  406. package/backend-project/node_modules/debug/src/node.js +248 -0
  407. package/backend-project/node_modules/depd/History.md +103 -0
  408. package/backend-project/node_modules/depd/LICENSE +22 -0
  409. package/backend-project/node_modules/depd/Readme.md +280 -0
  410. package/backend-project/node_modules/depd/index.js +538 -0
  411. package/backend-project/node_modules/depd/lib/browser/index.js +77 -0
  412. package/backend-project/node_modules/depd/package.json +45 -0
  413. package/backend-project/node_modules/destroy/LICENSE +23 -0
  414. package/backend-project/node_modules/destroy/README.md +63 -0
  415. package/backend-project/node_modules/destroy/index.js +209 -0
  416. package/backend-project/node_modules/destroy/package.json +48 -0
  417. package/backend-project/node_modules/dotenv/CHANGELOG.md +520 -0
  418. package/backend-project/node_modules/dotenv/LICENSE +23 -0
  419. package/backend-project/node_modules/dotenv/README-es.md +411 -0
  420. package/backend-project/node_modules/dotenv/README.md +645 -0
  421. package/backend-project/node_modules/dotenv/SECURITY.md +1 -0
  422. package/backend-project/node_modules/dotenv/config.d.ts +1 -0
  423. package/backend-project/node_modules/dotenv/config.js +9 -0
  424. package/backend-project/node_modules/dotenv/lib/cli-options.js +17 -0
  425. package/backend-project/node_modules/dotenv/lib/env-options.js +28 -0
  426. package/backend-project/node_modules/dotenv/lib/main.d.ts +162 -0
  427. package/backend-project/node_modules/dotenv/lib/main.js +386 -0
  428. package/backend-project/node_modules/dotenv/package.json +62 -0
  429. package/backend-project/node_modules/dunder-proto/.eslintrc +5 -0
  430. package/backend-project/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  431. package/backend-project/node_modules/dunder-proto/.nycrc +13 -0
  432. package/backend-project/node_modules/dunder-proto/CHANGELOG.md +24 -0
  433. package/backend-project/node_modules/dunder-proto/LICENSE +21 -0
  434. package/backend-project/node_modules/dunder-proto/README.md +54 -0
  435. package/backend-project/node_modules/dunder-proto/get.d.ts +5 -0
  436. package/backend-project/node_modules/dunder-proto/get.js +30 -0
  437. package/backend-project/node_modules/dunder-proto/package.json +76 -0
  438. package/backend-project/node_modules/dunder-proto/set.d.ts +5 -0
  439. package/backend-project/node_modules/dunder-proto/set.js +35 -0
  440. package/backend-project/node_modules/dunder-proto/test/get.js +34 -0
  441. package/backend-project/node_modules/dunder-proto/test/index.js +4 -0
  442. package/backend-project/node_modules/dunder-proto/test/set.js +50 -0
  443. package/backend-project/node_modules/dunder-proto/tsconfig.json +9 -0
  444. package/backend-project/node_modules/ecdsa-sig-formatter/CODEOWNERS +1 -0
  445. package/backend-project/node_modules/ecdsa-sig-formatter/LICENSE +201 -0
  446. package/backend-project/node_modules/ecdsa-sig-formatter/README.md +65 -0
  447. package/backend-project/node_modules/ecdsa-sig-formatter/package.json +46 -0
  448. package/backend-project/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts +17 -0
  449. package/backend-project/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js +187 -0
  450. package/backend-project/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js +23 -0
  451. package/backend-project/node_modules/ee-first/LICENSE +22 -0
  452. package/backend-project/node_modules/ee-first/README.md +80 -0
  453. package/backend-project/node_modules/ee-first/index.js +95 -0
  454. package/backend-project/node_modules/ee-first/package.json +29 -0
  455. package/backend-project/node_modules/encodeurl/LICENSE +22 -0
  456. package/backend-project/node_modules/encodeurl/README.md +109 -0
  457. package/backend-project/node_modules/encodeurl/index.js +60 -0
  458. package/backend-project/node_modules/encodeurl/package.json +40 -0
  459. package/backend-project/node_modules/es-define-property/.eslintrc +13 -0
  460. package/backend-project/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  461. package/backend-project/node_modules/es-define-property/.nycrc +9 -0
  462. package/backend-project/node_modules/es-define-property/CHANGELOG.md +29 -0
  463. package/backend-project/node_modules/es-define-property/LICENSE +21 -0
  464. package/backend-project/node_modules/es-define-property/README.md +49 -0
  465. package/backend-project/node_modules/es-define-property/index.d.ts +3 -0
  466. package/backend-project/node_modules/es-define-property/index.js +14 -0
  467. package/backend-project/node_modules/es-define-property/package.json +81 -0
  468. package/backend-project/node_modules/es-define-property/test/index.js +56 -0
  469. package/backend-project/node_modules/es-define-property/tsconfig.json +10 -0
  470. package/backend-project/node_modules/es-errors/.eslintrc +5 -0
  471. package/backend-project/node_modules/es-errors/.github/FUNDING.yml +12 -0
  472. package/backend-project/node_modules/es-errors/CHANGELOG.md +40 -0
  473. package/backend-project/node_modules/es-errors/LICENSE +21 -0
  474. package/backend-project/node_modules/es-errors/README.md +55 -0
  475. package/backend-project/node_modules/es-errors/eval.d.ts +3 -0
  476. package/backend-project/node_modules/es-errors/eval.js +4 -0
  477. package/backend-project/node_modules/es-errors/index.d.ts +3 -0
  478. package/backend-project/node_modules/es-errors/index.js +4 -0
  479. package/backend-project/node_modules/es-errors/package.json +80 -0
  480. package/backend-project/node_modules/es-errors/range.d.ts +3 -0
  481. package/backend-project/node_modules/es-errors/range.js +4 -0
  482. package/backend-project/node_modules/es-errors/ref.d.ts +3 -0
  483. package/backend-project/node_modules/es-errors/ref.js +4 -0
  484. package/backend-project/node_modules/es-errors/syntax.d.ts +3 -0
  485. package/backend-project/node_modules/es-errors/syntax.js +4 -0
  486. package/backend-project/node_modules/es-errors/test/index.js +19 -0
  487. package/backend-project/node_modules/es-errors/tsconfig.json +49 -0
  488. package/backend-project/node_modules/es-errors/type.d.ts +3 -0
  489. package/backend-project/node_modules/es-errors/type.js +4 -0
  490. package/backend-project/node_modules/es-errors/uri.d.ts +3 -0
  491. package/backend-project/node_modules/es-errors/uri.js +4 -0
  492. package/backend-project/node_modules/es-object-atoms/.eslintrc +16 -0
  493. package/backend-project/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  494. package/backend-project/node_modules/es-object-atoms/CHANGELOG.md +44 -0
  495. package/backend-project/node_modules/es-object-atoms/LICENSE +21 -0
  496. package/backend-project/node_modules/es-object-atoms/README.md +63 -0
  497. package/backend-project/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  498. package/backend-project/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  499. package/backend-project/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  500. package/backend-project/node_modules/es-object-atoms/ToObject.js +10 -0
  501. package/backend-project/node_modules/es-object-atoms/index.d.ts +3 -0
  502. package/backend-project/node_modules/es-object-atoms/index.js +4 -0
  503. package/backend-project/node_modules/es-object-atoms/isObject.d.ts +3 -0
  504. package/backend-project/node_modules/es-object-atoms/isObject.js +6 -0
  505. package/backend-project/node_modules/es-object-atoms/package.json +79 -0
  506. package/backend-project/node_modules/es-object-atoms/test/index.js +38 -0
  507. package/backend-project/node_modules/es-object-atoms/tsconfig.json +7 -0
  508. package/backend-project/node_modules/escape-html/LICENSE +24 -0
  509. package/backend-project/node_modules/escape-html/Readme.md +43 -0
  510. package/backend-project/node_modules/escape-html/index.js +78 -0
  511. package/backend-project/node_modules/escape-html/package.json +24 -0
  512. package/backend-project/node_modules/etag/HISTORY.md +83 -0
  513. package/backend-project/node_modules/etag/LICENSE +22 -0
  514. package/backend-project/node_modules/etag/README.md +159 -0
  515. package/backend-project/node_modules/etag/index.js +131 -0
  516. package/backend-project/node_modules/etag/package.json +47 -0
  517. package/backend-project/node_modules/express/History.md +3676 -0
  518. package/backend-project/node_modules/express/LICENSE +24 -0
  519. package/backend-project/node_modules/express/Readme.md +260 -0
  520. package/backend-project/node_modules/express/index.js +11 -0
  521. package/backend-project/node_modules/express/lib/application.js +661 -0
  522. package/backend-project/node_modules/express/lib/express.js +116 -0
  523. package/backend-project/node_modules/express/lib/middleware/init.js +43 -0
  524. package/backend-project/node_modules/express/lib/middleware/query.js +47 -0
  525. package/backend-project/node_modules/express/lib/request.js +525 -0
  526. package/backend-project/node_modules/express/lib/response.js +1179 -0
  527. package/backend-project/node_modules/express/lib/router/index.js +673 -0
  528. package/backend-project/node_modules/express/lib/router/layer.js +181 -0
  529. package/backend-project/node_modules/express/lib/router/route.js +230 -0
  530. package/backend-project/node_modules/express/lib/utils.js +304 -0
  531. package/backend-project/node_modules/express/lib/view.js +182 -0
  532. package/backend-project/node_modules/express/package.json +102 -0
  533. package/backend-project/node_modules/fill-range/LICENSE +21 -0
  534. package/backend-project/node_modules/fill-range/README.md +237 -0
  535. package/backend-project/node_modules/fill-range/index.js +248 -0
  536. package/backend-project/node_modules/fill-range/package.json +74 -0
  537. package/backend-project/node_modules/finalhandler/HISTORY.md +216 -0
  538. package/backend-project/node_modules/finalhandler/LICENSE +22 -0
  539. package/backend-project/node_modules/finalhandler/README.md +147 -0
  540. package/backend-project/node_modules/finalhandler/SECURITY.md +25 -0
  541. package/backend-project/node_modules/finalhandler/index.js +341 -0
  542. package/backend-project/node_modules/finalhandler/package.json +47 -0
  543. package/backend-project/node_modules/forwarded/HISTORY.md +21 -0
  544. package/backend-project/node_modules/forwarded/LICENSE +22 -0
  545. package/backend-project/node_modules/forwarded/README.md +57 -0
  546. package/backend-project/node_modules/forwarded/index.js +90 -0
  547. package/backend-project/node_modules/forwarded/package.json +45 -0
  548. package/backend-project/node_modules/fresh/HISTORY.md +70 -0
  549. package/backend-project/node_modules/fresh/LICENSE +23 -0
  550. package/backend-project/node_modules/fresh/README.md +119 -0
  551. package/backend-project/node_modules/fresh/index.js +137 -0
  552. package/backend-project/node_modules/fresh/package.json +46 -0
  553. package/backend-project/node_modules/function-bind/.eslintrc +21 -0
  554. package/backend-project/node_modules/function-bind/.github/FUNDING.yml +12 -0
  555. package/backend-project/node_modules/function-bind/.github/SECURITY.md +3 -0
  556. package/backend-project/node_modules/function-bind/.nycrc +13 -0
  557. package/backend-project/node_modules/function-bind/CHANGELOG.md +136 -0
  558. package/backend-project/node_modules/function-bind/LICENSE +20 -0
  559. package/backend-project/node_modules/function-bind/README.md +46 -0
  560. package/backend-project/node_modules/function-bind/implementation.js +84 -0
  561. package/backend-project/node_modules/function-bind/index.js +5 -0
  562. package/backend-project/node_modules/function-bind/package.json +87 -0
  563. package/backend-project/node_modules/function-bind/test/.eslintrc +9 -0
  564. package/backend-project/node_modules/function-bind/test/index.js +252 -0
  565. package/backend-project/node_modules/get-intrinsic/.eslintrc +42 -0
  566. package/backend-project/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  567. package/backend-project/node_modules/get-intrinsic/.nycrc +9 -0
  568. package/backend-project/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  569. package/backend-project/node_modules/get-intrinsic/LICENSE +21 -0
  570. package/backend-project/node_modules/get-intrinsic/README.md +71 -0
  571. package/backend-project/node_modules/get-intrinsic/index.js +378 -0
  572. package/backend-project/node_modules/get-intrinsic/package.json +97 -0
  573. package/backend-project/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  574. package/backend-project/node_modules/get-proto/.eslintrc +10 -0
  575. package/backend-project/node_modules/get-proto/.github/FUNDING.yml +12 -0
  576. package/backend-project/node_modules/get-proto/.nycrc +9 -0
  577. package/backend-project/node_modules/get-proto/CHANGELOG.md +21 -0
  578. package/backend-project/node_modules/get-proto/LICENSE +21 -0
  579. package/backend-project/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  580. package/backend-project/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  581. package/backend-project/node_modules/get-proto/README.md +50 -0
  582. package/backend-project/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  583. package/backend-project/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  584. package/backend-project/node_modules/get-proto/index.d.ts +5 -0
  585. package/backend-project/node_modules/get-proto/index.js +27 -0
  586. package/backend-project/node_modules/get-proto/package.json +81 -0
  587. package/backend-project/node_modules/get-proto/test/index.js +68 -0
  588. package/backend-project/node_modules/get-proto/tsconfig.json +9 -0
  589. package/backend-project/node_modules/glob-parent/CHANGELOG.md +110 -0
  590. package/backend-project/node_modules/glob-parent/LICENSE +15 -0
  591. package/backend-project/node_modules/glob-parent/README.md +137 -0
  592. package/backend-project/node_modules/glob-parent/index.js +42 -0
  593. package/backend-project/node_modules/glob-parent/package.json +48 -0
  594. package/backend-project/node_modules/gopd/.eslintrc +16 -0
  595. package/backend-project/node_modules/gopd/.github/FUNDING.yml +12 -0
  596. package/backend-project/node_modules/gopd/CHANGELOG.md +45 -0
  597. package/backend-project/node_modules/gopd/LICENSE +21 -0
  598. package/backend-project/node_modules/gopd/README.md +40 -0
  599. package/backend-project/node_modules/gopd/gOPD.d.ts +1 -0
  600. package/backend-project/node_modules/gopd/gOPD.js +4 -0
  601. package/backend-project/node_modules/gopd/index.d.ts +5 -0
  602. package/backend-project/node_modules/gopd/index.js +15 -0
  603. package/backend-project/node_modules/gopd/package.json +77 -0
  604. package/backend-project/node_modules/gopd/test/index.js +36 -0
  605. package/backend-project/node_modules/gopd/tsconfig.json +9 -0
  606. package/backend-project/node_modules/has-flag/index.js +8 -0
  607. package/backend-project/node_modules/has-flag/license +9 -0
  608. package/backend-project/node_modules/has-flag/package.json +44 -0
  609. package/backend-project/node_modules/has-flag/readme.md +70 -0
  610. package/backend-project/node_modules/has-symbols/.eslintrc +11 -0
  611. package/backend-project/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  612. package/backend-project/node_modules/has-symbols/.nycrc +9 -0
  613. package/backend-project/node_modules/has-symbols/CHANGELOG.md +91 -0
  614. package/backend-project/node_modules/has-symbols/LICENSE +21 -0
  615. package/backend-project/node_modules/has-symbols/README.md +46 -0
  616. package/backend-project/node_modules/has-symbols/index.d.ts +3 -0
  617. package/backend-project/node_modules/has-symbols/index.js +14 -0
  618. package/backend-project/node_modules/has-symbols/package.json +111 -0
  619. package/backend-project/node_modules/has-symbols/shams.d.ts +3 -0
  620. package/backend-project/node_modules/has-symbols/shams.js +45 -0
  621. package/backend-project/node_modules/has-symbols/test/index.js +22 -0
  622. package/backend-project/node_modules/has-symbols/test/shams/core-js.js +29 -0
  623. package/backend-project/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  624. package/backend-project/node_modules/has-symbols/test/tests.js +58 -0
  625. package/backend-project/node_modules/has-symbols/tsconfig.json +10 -0
  626. package/backend-project/node_modules/hasown/.github/FUNDING.yml +12 -0
  627. package/backend-project/node_modules/hasown/.nycrc +13 -0
  628. package/backend-project/node_modules/hasown/CHANGELOG.md +58 -0
  629. package/backend-project/node_modules/hasown/LICENSE +21 -0
  630. package/backend-project/node_modules/hasown/README.md +40 -0
  631. package/backend-project/node_modules/hasown/eslint.config.mjs +6 -0
  632. package/backend-project/node_modules/hasown/index.d.ts +3 -0
  633. package/backend-project/node_modules/hasown/index.js +8 -0
  634. package/backend-project/node_modules/hasown/package.json +91 -0
  635. package/backend-project/node_modules/hasown/tsconfig.json +6 -0
  636. package/backend-project/node_modules/http-errors/HISTORY.md +186 -0
  637. package/backend-project/node_modules/http-errors/LICENSE +23 -0
  638. package/backend-project/node_modules/http-errors/README.md +169 -0
  639. package/backend-project/node_modules/http-errors/index.js +290 -0
  640. package/backend-project/node_modules/http-errors/package.json +54 -0
  641. package/backend-project/node_modules/iconv-lite/Changelog.md +162 -0
  642. package/backend-project/node_modules/iconv-lite/LICENSE +21 -0
  643. package/backend-project/node_modules/iconv-lite/README.md +156 -0
  644. package/backend-project/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
  645. package/backend-project/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
  646. package/backend-project/node_modules/iconv-lite/encodings/index.js +22 -0
  647. package/backend-project/node_modules/iconv-lite/encodings/internal.js +188 -0
  648. package/backend-project/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  649. package/backend-project/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  650. package/backend-project/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
  651. package/backend-project/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  652. package/backend-project/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  653. package/backend-project/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  654. package/backend-project/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  655. package/backend-project/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  656. package/backend-project/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  657. package/backend-project/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
  658. package/backend-project/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  659. package/backend-project/node_modules/iconv-lite/encodings/utf16.js +177 -0
  660. package/backend-project/node_modules/iconv-lite/encodings/utf7.js +290 -0
  661. package/backend-project/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  662. package/backend-project/node_modules/iconv-lite/lib/extend-node.js +217 -0
  663. package/backend-project/node_modules/iconv-lite/lib/index.d.ts +24 -0
  664. package/backend-project/node_modules/iconv-lite/lib/index.js +153 -0
  665. package/backend-project/node_modules/iconv-lite/lib/streams.js +121 -0
  666. package/backend-project/node_modules/iconv-lite/package.json +46 -0
  667. package/backend-project/node_modules/ignore-by-default/LICENSE +14 -0
  668. package/backend-project/node_modules/ignore-by-default/README.md +26 -0
  669. package/backend-project/node_modules/ignore-by-default/index.js +12 -0
  670. package/backend-project/node_modules/ignore-by-default/package.json +34 -0
  671. package/backend-project/node_modules/inherits/LICENSE +16 -0
  672. package/backend-project/node_modules/inherits/README.md +42 -0
  673. package/backend-project/node_modules/inherits/inherits.js +9 -0
  674. package/backend-project/node_modules/inherits/inherits_browser.js +27 -0
  675. package/backend-project/node_modules/inherits/package.json +29 -0
  676. package/backend-project/node_modules/ip-address/LICENSE +19 -0
  677. package/backend-project/node_modules/ip-address/README.md +278 -0
  678. package/backend-project/node_modules/ip-address/dist/address-error.d.ts +4 -0
  679. package/backend-project/node_modules/ip-address/dist/address-error.js +12 -0
  680. package/backend-project/node_modules/ip-address/dist/address-error.js.map +1 -0
  681. package/backend-project/node_modules/ip-address/dist/common.d.ts +20 -0
  682. package/backend-project/node_modules/ip-address/dist/common.js +67 -0
  683. package/backend-project/node_modules/ip-address/dist/common.js.map +1 -0
  684. package/backend-project/node_modules/ip-address/dist/ip-address.d.ts +7 -0
  685. package/backend-project/node_modules/ip-address/dist/ip-address.js +35 -0
  686. package/backend-project/node_modules/ip-address/dist/ip-address.js.map +1 -0
  687. package/backend-project/node_modules/ip-address/dist/ipv4.d.ts +267 -0
  688. package/backend-project/node_modules/ip-address/dist/ipv4.js +485 -0
  689. package/backend-project/node_modules/ip-address/dist/ipv4.js.map +1 -0
  690. package/backend-project/node_modules/ip-address/dist/ipv6.d.ts +489 -0
  691. package/backend-project/node_modules/ip-address/dist/ipv6.js +1217 -0
  692. package/backend-project/node_modules/ip-address/dist/ipv6.js.map +1 -0
  693. package/backend-project/node_modules/ip-address/dist/v4/constants.d.ts +4 -0
  694. package/backend-project/node_modules/ip-address/dist/v4/constants.js +8 -0
  695. package/backend-project/node_modules/ip-address/dist/v4/constants.js.map +1 -0
  696. package/backend-project/node_modules/ip-address/dist/v6/constants.d.ts +44 -0
  697. package/backend-project/node_modules/ip-address/dist/v6/constants.js +81 -0
  698. package/backend-project/node_modules/ip-address/dist/v6/constants.js.map +1 -0
  699. package/backend-project/node_modules/ip-address/dist/v6/helpers.d.ts +18 -0
  700. package/backend-project/node_modules/ip-address/dist/v6/helpers.js +54 -0
  701. package/backend-project/node_modules/ip-address/dist/v6/helpers.js.map +1 -0
  702. package/backend-project/node_modules/ip-address/dist/v6/regular-expressions.d.ts +5 -0
  703. package/backend-project/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
  704. package/backend-project/node_modules/ip-address/dist/v6/regular-expressions.js.map +1 -0
  705. package/backend-project/node_modules/ip-address/package.json +88 -0
  706. package/backend-project/node_modules/ipaddr.js/LICENSE +19 -0
  707. package/backend-project/node_modules/ipaddr.js/README.md +233 -0
  708. package/backend-project/node_modules/ipaddr.js/ipaddr.min.js +1 -0
  709. package/backend-project/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
  710. package/backend-project/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
  711. package/backend-project/node_modules/ipaddr.js/package.json +35 -0
  712. package/backend-project/node_modules/is-binary-path/index.d.ts +17 -0
  713. package/backend-project/node_modules/is-binary-path/index.js +7 -0
  714. package/backend-project/node_modules/is-binary-path/license +9 -0
  715. package/backend-project/node_modules/is-binary-path/package.json +40 -0
  716. package/backend-project/node_modules/is-binary-path/readme.md +34 -0
  717. package/backend-project/node_modules/is-extglob/LICENSE +21 -0
  718. package/backend-project/node_modules/is-extglob/README.md +107 -0
  719. package/backend-project/node_modules/is-extglob/index.js +20 -0
  720. package/backend-project/node_modules/is-extglob/package.json +69 -0
  721. package/backend-project/node_modules/is-glob/LICENSE +21 -0
  722. package/backend-project/node_modules/is-glob/README.md +206 -0
  723. package/backend-project/node_modules/is-glob/index.js +150 -0
  724. package/backend-project/node_modules/is-glob/package.json +81 -0
  725. package/backend-project/node_modules/is-number/LICENSE +21 -0
  726. package/backend-project/node_modules/is-number/README.md +187 -0
  727. package/backend-project/node_modules/is-number/index.js +18 -0
  728. package/backend-project/node_modules/is-number/package.json +82 -0
  729. package/backend-project/node_modules/jsonwebtoken/LICENSE +21 -0
  730. package/backend-project/node_modules/jsonwebtoken/README.md +396 -0
  731. package/backend-project/node_modules/jsonwebtoken/decode.js +30 -0
  732. package/backend-project/node_modules/jsonwebtoken/index.js +8 -0
  733. package/backend-project/node_modules/jsonwebtoken/lib/JsonWebTokenError.js +14 -0
  734. package/backend-project/node_modules/jsonwebtoken/lib/NotBeforeError.js +13 -0
  735. package/backend-project/node_modules/jsonwebtoken/lib/TokenExpiredError.js +13 -0
  736. package/backend-project/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js +3 -0
  737. package/backend-project/node_modules/jsonwebtoken/lib/psSupported.js +3 -0
  738. package/backend-project/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js +3 -0
  739. package/backend-project/node_modules/jsonwebtoken/lib/timespan.js +18 -0
  740. package/backend-project/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js +66 -0
  741. package/backend-project/node_modules/jsonwebtoken/node_modules/ms/index.js +162 -0
  742. package/backend-project/node_modules/jsonwebtoken/node_modules/ms/license.md +21 -0
  743. package/backend-project/node_modules/jsonwebtoken/node_modules/ms/package.json +38 -0
  744. package/backend-project/node_modules/jsonwebtoken/node_modules/ms/readme.md +59 -0
  745. package/backend-project/node_modules/jsonwebtoken/package.json +70 -0
  746. package/backend-project/node_modules/jsonwebtoken/sign.js +253 -0
  747. package/backend-project/node_modules/jsonwebtoken/verify.js +263 -0
  748. package/backend-project/node_modules/jwa/LICENSE +17 -0
  749. package/backend-project/node_modules/jwa/README.md +150 -0
  750. package/backend-project/node_modules/jwa/index.js +266 -0
  751. package/backend-project/node_modules/jwa/opslevel.yml +6 -0
  752. package/backend-project/node_modules/jwa/package.json +37 -0
  753. package/backend-project/node_modules/jws/CHANGELOG.md +56 -0
  754. package/backend-project/node_modules/jws/LICENSE +17 -0
  755. package/backend-project/node_modules/jws/index.js +22 -0
  756. package/backend-project/node_modules/jws/lib/data-stream.js +55 -0
  757. package/backend-project/node_modules/jws/lib/sign-stream.js +83 -0
  758. package/backend-project/node_modules/jws/lib/tostring.js +10 -0
  759. package/backend-project/node_modules/jws/lib/verify-stream.js +125 -0
  760. package/backend-project/node_modules/jws/opslevel.yml +6 -0
  761. package/backend-project/node_modules/jws/package.json +34 -0
  762. package/backend-project/node_modules/jws/readme.md +255 -0
  763. package/backend-project/node_modules/kareem/LICENSE +202 -0
  764. package/backend-project/node_modules/kareem/README.md +420 -0
  765. package/backend-project/node_modules/kareem/index.js +668 -0
  766. package/backend-project/node_modules/kareem/package.json +31 -0
  767. package/backend-project/node_modules/lodash.includes/LICENSE +47 -0
  768. package/backend-project/node_modules/lodash.includes/README.md +18 -0
  769. package/backend-project/node_modules/lodash.includes/index.js +745 -0
  770. package/backend-project/node_modules/lodash.includes/package.json +17 -0
  771. package/backend-project/node_modules/lodash.isboolean/LICENSE +22 -0
  772. package/backend-project/node_modules/lodash.isboolean/README.md +18 -0
  773. package/backend-project/node_modules/lodash.isboolean/index.js +70 -0
  774. package/backend-project/node_modules/lodash.isboolean/package.json +17 -0
  775. package/backend-project/node_modules/lodash.isinteger/LICENSE +47 -0
  776. package/backend-project/node_modules/lodash.isinteger/README.md +18 -0
  777. package/backend-project/node_modules/lodash.isinteger/index.js +265 -0
  778. package/backend-project/node_modules/lodash.isinteger/package.json +17 -0
  779. package/backend-project/node_modules/lodash.isnumber/LICENSE +22 -0
  780. package/backend-project/node_modules/lodash.isnumber/README.md +18 -0
  781. package/backend-project/node_modules/lodash.isnumber/index.js +79 -0
  782. package/backend-project/node_modules/lodash.isnumber/package.json +17 -0
  783. package/backend-project/node_modules/lodash.isplainobject/LICENSE +47 -0
  784. package/backend-project/node_modules/lodash.isplainobject/README.md +18 -0
  785. package/backend-project/node_modules/lodash.isplainobject/index.js +139 -0
  786. package/backend-project/node_modules/lodash.isplainobject/package.json +17 -0
  787. package/backend-project/node_modules/lodash.isstring/LICENSE +22 -0
  788. package/backend-project/node_modules/lodash.isstring/README.md +18 -0
  789. package/backend-project/node_modules/lodash.isstring/index.js +95 -0
  790. package/backend-project/node_modules/lodash.isstring/package.json +17 -0
  791. package/backend-project/node_modules/lodash.once/LICENSE +47 -0
  792. package/backend-project/node_modules/lodash.once/README.md +18 -0
  793. package/backend-project/node_modules/lodash.once/index.js +294 -0
  794. package/backend-project/node_modules/lodash.once/package.json +17 -0
  795. package/backend-project/node_modules/math-intrinsics/.eslintrc +16 -0
  796. package/backend-project/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  797. package/backend-project/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  798. package/backend-project/node_modules/math-intrinsics/LICENSE +21 -0
  799. package/backend-project/node_modules/math-intrinsics/README.md +50 -0
  800. package/backend-project/node_modules/math-intrinsics/abs.d.ts +1 -0
  801. package/backend-project/node_modules/math-intrinsics/abs.js +4 -0
  802. package/backend-project/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  803. package/backend-project/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  804. package/backend-project/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  805. package/backend-project/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  806. package/backend-project/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  807. package/backend-project/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  808. package/backend-project/node_modules/math-intrinsics/floor.d.ts +1 -0
  809. package/backend-project/node_modules/math-intrinsics/floor.js +4 -0
  810. package/backend-project/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  811. package/backend-project/node_modules/math-intrinsics/isFinite.js +12 -0
  812. package/backend-project/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  813. package/backend-project/node_modules/math-intrinsics/isInteger.js +16 -0
  814. package/backend-project/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  815. package/backend-project/node_modules/math-intrinsics/isNaN.js +6 -0
  816. package/backend-project/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  817. package/backend-project/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  818. package/backend-project/node_modules/math-intrinsics/max.d.ts +1 -0
  819. package/backend-project/node_modules/math-intrinsics/max.js +4 -0
  820. package/backend-project/node_modules/math-intrinsics/min.d.ts +1 -0
  821. package/backend-project/node_modules/math-intrinsics/min.js +4 -0
  822. package/backend-project/node_modules/math-intrinsics/mod.d.ts +3 -0
  823. package/backend-project/node_modules/math-intrinsics/mod.js +9 -0
  824. package/backend-project/node_modules/math-intrinsics/package.json +86 -0
  825. package/backend-project/node_modules/math-intrinsics/pow.d.ts +1 -0
  826. package/backend-project/node_modules/math-intrinsics/pow.js +4 -0
  827. package/backend-project/node_modules/math-intrinsics/round.d.ts +1 -0
  828. package/backend-project/node_modules/math-intrinsics/round.js +4 -0
  829. package/backend-project/node_modules/math-intrinsics/sign.d.ts +3 -0
  830. package/backend-project/node_modules/math-intrinsics/sign.js +11 -0
  831. package/backend-project/node_modules/math-intrinsics/test/index.js +192 -0
  832. package/backend-project/node_modules/math-intrinsics/tsconfig.json +3 -0
  833. package/backend-project/node_modules/media-typer/HISTORY.md +22 -0
  834. package/backend-project/node_modules/media-typer/LICENSE +22 -0
  835. package/backend-project/node_modules/media-typer/README.md +81 -0
  836. package/backend-project/node_modules/media-typer/index.js +270 -0
  837. package/backend-project/node_modules/media-typer/package.json +26 -0
  838. package/backend-project/node_modules/memory-pager/.travis.yml +4 -0
  839. package/backend-project/node_modules/memory-pager/LICENSE +21 -0
  840. package/backend-project/node_modules/memory-pager/README.md +65 -0
  841. package/backend-project/node_modules/memory-pager/index.js +160 -0
  842. package/backend-project/node_modules/memory-pager/package.json +24 -0
  843. package/backend-project/node_modules/memory-pager/test.js +80 -0
  844. package/backend-project/node_modules/merge-descriptors/HISTORY.md +21 -0
  845. package/backend-project/node_modules/merge-descriptors/LICENSE +23 -0
  846. package/backend-project/node_modules/merge-descriptors/README.md +49 -0
  847. package/backend-project/node_modules/merge-descriptors/index.js +60 -0
  848. package/backend-project/node_modules/merge-descriptors/package.json +39 -0
  849. package/backend-project/node_modules/methods/HISTORY.md +29 -0
  850. package/backend-project/node_modules/methods/LICENSE +24 -0
  851. package/backend-project/node_modules/methods/README.md +51 -0
  852. package/backend-project/node_modules/methods/index.js +69 -0
  853. package/backend-project/node_modules/methods/package.json +36 -0
  854. package/backend-project/node_modules/mime/CHANGELOG.md +164 -0
  855. package/backend-project/node_modules/mime/LICENSE +21 -0
  856. package/backend-project/node_modules/mime/README.md +90 -0
  857. package/backend-project/node_modules/mime/cli.js +8 -0
  858. package/backend-project/node_modules/mime/mime.js +108 -0
  859. package/backend-project/node_modules/mime/package.json +44 -0
  860. package/backend-project/node_modules/mime/src/build.js +53 -0
  861. package/backend-project/node_modules/mime/src/test.js +60 -0
  862. package/backend-project/node_modules/mime/types.json +1 -0
  863. package/backend-project/node_modules/mime-db/HISTORY.md +507 -0
  864. package/backend-project/node_modules/mime-db/LICENSE +23 -0
  865. package/backend-project/node_modules/mime-db/README.md +100 -0
  866. package/backend-project/node_modules/mime-db/db.json +8519 -0
  867. package/backend-project/node_modules/mime-db/index.js +12 -0
  868. package/backend-project/node_modules/mime-db/package.json +60 -0
  869. package/backend-project/node_modules/mime-types/HISTORY.md +397 -0
  870. package/backend-project/node_modules/mime-types/LICENSE +23 -0
  871. package/backend-project/node_modules/mime-types/README.md +113 -0
  872. package/backend-project/node_modules/mime-types/index.js +188 -0
  873. package/backend-project/node_modules/mime-types/package.json +44 -0
  874. package/backend-project/node_modules/minimatch/LICENSE.md +55 -0
  875. package/backend-project/node_modules/minimatch/README.md +528 -0
  876. package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
  877. package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
  878. package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  879. package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
  880. package/backend-project/node_modules/minimatch/dist/commonjs/ast.d.ts +22 -0
  881. package/backend-project/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
  882. package/backend-project/node_modules/minimatch/dist/commonjs/ast.js +845 -0
  883. package/backend-project/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
  884. package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
  885. package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
  886. package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
  887. package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
  888. package/backend-project/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
  889. package/backend-project/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
  890. package/backend-project/node_modules/minimatch/dist/commonjs/escape.js +30 -0
  891. package/backend-project/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
  892. package/backend-project/node_modules/minimatch/dist/commonjs/index.d.ts +174 -0
  893. package/backend-project/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
  894. package/backend-project/node_modules/minimatch/dist/commonjs/index.js +1127 -0
  895. package/backend-project/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
  896. package/backend-project/node_modules/minimatch/dist/commonjs/package.json +3 -0
  897. package/backend-project/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
  898. package/backend-project/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
  899. package/backend-project/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
  900. package/backend-project/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
  901. package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
  902. package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
  903. package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  904. package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
  905. package/backend-project/node_modules/minimatch/dist/esm/ast.d.ts +22 -0
  906. package/backend-project/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
  907. package/backend-project/node_modules/minimatch/dist/esm/ast.js +841 -0
  908. package/backend-project/node_modules/minimatch/dist/esm/ast.js.map +1 -0
  909. package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
  910. package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
  911. package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
  912. package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
  913. package/backend-project/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
  914. package/backend-project/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
  915. package/backend-project/node_modules/minimatch/dist/esm/escape.js +26 -0
  916. package/backend-project/node_modules/minimatch/dist/esm/escape.js.map +1 -0
  917. package/backend-project/node_modules/minimatch/dist/esm/index.d.ts +174 -0
  918. package/backend-project/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
  919. package/backend-project/node_modules/minimatch/dist/esm/index.js +1114 -0
  920. package/backend-project/node_modules/minimatch/dist/esm/index.js.map +1 -0
  921. package/backend-project/node_modules/minimatch/dist/esm/package.json +3 -0
  922. package/backend-project/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
  923. package/backend-project/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
  924. package/backend-project/node_modules/minimatch/dist/esm/unescape.js +34 -0
  925. package/backend-project/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
  926. package/backend-project/node_modules/minimatch/package.json +73 -0
  927. package/backend-project/node_modules/mongodb/LICENSE.md +201 -0
  928. package/backend-project/node_modules/mongodb/README.md +310 -0
  929. package/backend-project/node_modules/mongodb/etc/prepare.js +12 -0
  930. package/backend-project/node_modules/mongodb/lib/admin.js +149 -0
  931. package/backend-project/node_modules/mongodb/lib/admin.js.map +1 -0
  932. package/backend-project/node_modules/mongodb/lib/bson.js +61 -0
  933. package/backend-project/node_modules/mongodb/lib/bson.js.map +1 -0
  934. package/backend-project/node_modules/mongodb/lib/bulk/common.js +907 -0
  935. package/backend-project/node_modules/mongodb/lib/bulk/common.js.map +1 -0
  936. package/backend-project/node_modules/mongodb/lib/bulk/ordered.js +67 -0
  937. package/backend-project/node_modules/mongodb/lib/bulk/ordered.js.map +1 -0
  938. package/backend-project/node_modules/mongodb/lib/bulk/unordered.js +92 -0
  939. package/backend-project/node_modules/mongodb/lib/bulk/unordered.js.map +1 -0
  940. package/backend-project/node_modules/mongodb/lib/change_stream.js +397 -0
  941. package/backend-project/node_modules/mongodb/lib/change_stream.js.map +1 -0
  942. package/backend-project/node_modules/mongodb/lib/cmap/auth/auth_provider.js +47 -0
  943. package/backend-project/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map +1 -0
  944. package/backend-project/node_modules/mongodb/lib/cmap/auth/gssapi.js +153 -0
  945. package/backend-project/node_modules/mongodb/lib/cmap/auth/gssapi.js.map +1 -0
  946. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js +177 -0
  947. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map +1 -0
  948. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongocr.js +35 -0
  949. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongocr.js.map +1 -0
  950. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js +227 -0
  951. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map +1 -0
  952. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/aws_service_workflow.js +30 -0
  953. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/aws_service_workflow.js.map +1 -0
  954. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_service_workflow.js +73 -0
  955. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_service_workflow.js.map +1 -0
  956. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_token_cache.js +49 -0
  957. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_token_cache.js.map +1 -0
  958. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/cache.js +55 -0
  959. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/cache.js.map +1 -0
  960. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_lock_cache.js +89 -0
  961. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_lock_cache.js.map +1 -0
  962. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js +204 -0
  963. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map +1 -0
  964. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/service_workflow.js +43 -0
  965. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/service_workflow.js.map +1 -0
  966. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_entry_cache.js +62 -0
  967. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_entry_cache.js.map +1 -0
  968. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js +68 -0
  969. package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js.map +1 -0
  970. package/backend-project/node_modules/mongodb/lib/cmap/auth/plain.js +26 -0
  971. package/backend-project/node_modules/mongodb/lib/cmap/auth/plain.js.map +1 -0
  972. package/backend-project/node_modules/mongodb/lib/cmap/auth/providers.js +24 -0
  973. package/backend-project/node_modules/mongodb/lib/cmap/auth/providers.js.map +1 -0
  974. package/backend-project/node_modules/mongodb/lib/cmap/auth/scram.js +262 -0
  975. package/backend-project/node_modules/mongodb/lib/cmap/auth/scram.js.map +1 -0
  976. package/backend-project/node_modules/mongodb/lib/cmap/auth/x509.js +36 -0
  977. package/backend-project/node_modules/mongodb/lib/cmap/auth/x509.js.map +1 -0
  978. package/backend-project/node_modules/mongodb/lib/cmap/command_monitoring_events.js +251 -0
  979. package/backend-project/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map +1 -0
  980. package/backend-project/node_modules/mongodb/lib/cmap/commands.js +487 -0
  981. package/backend-project/node_modules/mongodb/lib/cmap/commands.js.map +1 -0
  982. package/backend-project/node_modules/mongodb/lib/cmap/connect.js +378 -0
  983. package/backend-project/node_modules/mongodb/lib/cmap/connect.js.map +1 -0
  984. package/backend-project/node_modules/mongodb/lib/cmap/connection.js +492 -0
  985. package/backend-project/node_modules/mongodb/lib/cmap/connection.js.map +1 -0
  986. package/backend-project/node_modules/mongodb/lib/cmap/connection_pool.js +637 -0
  987. package/backend-project/node_modules/mongodb/lib/cmap/connection_pool.js.map +1 -0
  988. package/backend-project/node_modules/mongodb/lib/cmap/connection_pool_events.js +191 -0
  989. package/backend-project/node_modules/mongodb/lib/cmap/connection_pool_events.js.map +1 -0
  990. package/backend-project/node_modules/mongodb/lib/cmap/errors.js +64 -0
  991. package/backend-project/node_modules/mongodb/lib/cmap/errors.js.map +1 -0
  992. package/backend-project/node_modules/mongodb/lib/cmap/handshake/client_metadata.js +173 -0
  993. package/backend-project/node_modules/mongodb/lib/cmap/handshake/client_metadata.js.map +1 -0
  994. package/backend-project/node_modules/mongodb/lib/cmap/message_stream.js +156 -0
  995. package/backend-project/node_modules/mongodb/lib/cmap/message_stream.js.map +1 -0
  996. package/backend-project/node_modules/mongodb/lib/cmap/metrics.js +62 -0
  997. package/backend-project/node_modules/mongodb/lib/cmap/metrics.js.map +1 -0
  998. package/backend-project/node_modules/mongodb/lib/cmap/stream_description.js +51 -0
  999. package/backend-project/node_modules/mongodb/lib/cmap/stream_description.js.map +1 -0
  1000. package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/compression.js +107 -0
  1001. package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map +1 -0
  1002. package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/constants.js +17 -0
  1003. package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map +1 -0
  1004. package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/shared.js +40 -0
  1005. package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map +1 -0
  1006. package/backend-project/node_modules/mongodb/lib/collection.js +629 -0
  1007. package/backend-project/node_modules/mongodb/lib/collection.js.map +1 -0
  1008. package/backend-project/node_modules/mongodb/lib/connection_string.js +1103 -0
  1009. package/backend-project/node_modules/mongodb/lib/connection_string.js.map +1 -0
  1010. package/backend-project/node_modules/mongodb/lib/constants.js +142 -0
  1011. package/backend-project/node_modules/mongodb/lib/constants.js.map +1 -0
  1012. package/backend-project/node_modules/mongodb/lib/cursor/abstract_cursor.js +698 -0
  1013. package/backend-project/node_modules/mongodb/lib/cursor/abstract_cursor.js.map +1 -0
  1014. package/backend-project/node_modules/mongodb/lib/cursor/aggregation_cursor.js +168 -0
  1015. package/backend-project/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map +1 -0
  1016. package/backend-project/node_modules/mongodb/lib/cursor/change_stream_cursor.js +115 -0
  1017. package/backend-project/node_modules/mongodb/lib/cursor/change_stream_cursor.js.map +1 -0
  1018. package/backend-project/node_modules/mongodb/lib/cursor/find_cursor.js +382 -0
  1019. package/backend-project/node_modules/mongodb/lib/cursor/find_cursor.js.map +1 -0
  1020. package/backend-project/node_modules/mongodb/lib/cursor/list_collections_cursor.js +37 -0
  1021. package/backend-project/node_modules/mongodb/lib/cursor/list_collections_cursor.js.map +1 -0
  1022. package/backend-project/node_modules/mongodb/lib/cursor/list_indexes_cursor.js +36 -0
  1023. package/backend-project/node_modules/mongodb/lib/cursor/list_indexes_cursor.js.map +1 -0
  1024. package/backend-project/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js +14 -0
  1025. package/backend-project/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js.map +1 -0
  1026. package/backend-project/node_modules/mongodb/lib/cursor/run_command_cursor.js +94 -0
  1027. package/backend-project/node_modules/mongodb/lib/cursor/run_command_cursor.js.map +1 -0
  1028. package/backend-project/node_modules/mongodb/lib/db.js +379 -0
  1029. package/backend-project/node_modules/mongodb/lib/db.js.map +1 -0
  1030. package/backend-project/node_modules/mongodb/lib/deps.js +87 -0
  1031. package/backend-project/node_modules/mongodb/lib/deps.js.map +1 -0
  1032. package/backend-project/node_modules/mongodb/lib/encrypter.js +103 -0
  1033. package/backend-project/node_modules/mongodb/lib/encrypter.js.map +1 -0
  1034. package/backend-project/node_modules/mongodb/lib/error.js +832 -0
  1035. package/backend-project/node_modules/mongodb/lib/error.js.map +1 -0
  1036. package/backend-project/node_modules/mongodb/lib/explain.js +35 -0
  1037. package/backend-project/node_modules/mongodb/lib/explain.js.map +1 -0
  1038. package/backend-project/node_modules/mongodb/lib/gridfs/download.js +313 -0
  1039. package/backend-project/node_modules/mongodb/lib/gridfs/download.js.map +1 -0
  1040. package/backend-project/node_modules/mongodb/lib/gridfs/index.js +128 -0
  1041. package/backend-project/node_modules/mongodb/lib/gridfs/index.js.map +1 -0
  1042. package/backend-project/node_modules/mongodb/lib/gridfs/upload.js +330 -0
  1043. package/backend-project/node_modules/mongodb/lib/gridfs/upload.js.map +1 -0
  1044. package/backend-project/node_modules/mongodb/lib/index.js +162 -0
  1045. package/backend-project/node_modules/mongodb/lib/index.js.map +1 -0
  1046. package/backend-project/node_modules/mongodb/lib/mongo_client.js +329 -0
  1047. package/backend-project/node_modules/mongodb/lib/mongo_client.js.map +1 -0
  1048. package/backend-project/node_modules/mongodb/lib/mongo_logger.js +360 -0
  1049. package/backend-project/node_modules/mongodb/lib/mongo_logger.js.map +1 -0
  1050. package/backend-project/node_modules/mongodb/lib/mongo_types.js +22 -0
  1051. package/backend-project/node_modules/mongodb/lib/mongo_types.js.map +1 -0
  1052. package/backend-project/node_modules/mongodb/lib/operations/add_user.js +74 -0
  1053. package/backend-project/node_modules/mongodb/lib/operations/add_user.js.map +1 -0
  1054. package/backend-project/node_modules/mongodb/lib/operations/aggregate.js +92 -0
  1055. package/backend-project/node_modules/mongodb/lib/operations/aggregate.js.map +1 -0
  1056. package/backend-project/node_modules/mongodb/lib/operations/bulk_write.js +36 -0
  1057. package/backend-project/node_modules/mongodb/lib/operations/bulk_write.js.map +1 -0
  1058. package/backend-project/node_modules/mongodb/lib/operations/collections.js +32 -0
  1059. package/backend-project/node_modules/mongodb/lib/operations/collections.js.map +1 -0
  1060. package/backend-project/node_modules/mongodb/lib/operations/command.js +88 -0
  1061. package/backend-project/node_modules/mongodb/lib/operations/command.js.map +1 -0
  1062. package/backend-project/node_modules/mongodb/lib/operations/common_functions.js +69 -0
  1063. package/backend-project/node_modules/mongodb/lib/operations/common_functions.js.map +1 -0
  1064. package/backend-project/node_modules/mongodb/lib/operations/count.js +39 -0
  1065. package/backend-project/node_modules/mongodb/lib/operations/count.js.map +1 -0
  1066. package/backend-project/node_modules/mongodb/lib/operations/count_documents.js +37 -0
  1067. package/backend-project/node_modules/mongodb/lib/operations/count_documents.js.map +1 -0
  1068. package/backend-project/node_modules/mongodb/lib/operations/create_collection.js +108 -0
  1069. package/backend-project/node_modules/mongodb/lib/operations/create_collection.js.map +1 -0
  1070. package/backend-project/node_modules/mongodb/lib/operations/delete.js +119 -0
  1071. package/backend-project/node_modules/mongodb/lib/operations/delete.js.map +1 -0
  1072. package/backend-project/node_modules/mongodb/lib/operations/distinct.js +67 -0
  1073. package/backend-project/node_modules/mongodb/lib/operations/distinct.js.map +1 -0
  1074. package/backend-project/node_modules/mongodb/lib/operations/drop.js +82 -0
  1075. package/backend-project/node_modules/mongodb/lib/operations/drop.js.map +1 -0
  1076. package/backend-project/node_modules/mongodb/lib/operations/estimated_document_count.js +38 -0
  1077. package/backend-project/node_modules/mongodb/lib/operations/estimated_document_count.js.map +1 -0
  1078. package/backend-project/node_modules/mongodb/lib/operations/eval.js +55 -0
  1079. package/backend-project/node_modules/mongodb/lib/operations/eval.js.map +1 -0
  1080. package/backend-project/node_modules/mongodb/lib/operations/execute_operation.js +162 -0
  1081. package/backend-project/node_modules/mongodb/lib/operations/execute_operation.js.map +1 -0
  1082. package/backend-project/node_modules/mongodb/lib/operations/find.js +149 -0
  1083. package/backend-project/node_modules/mongodb/lib/operations/find.js.map +1 -0
  1084. package/backend-project/node_modules/mongodb/lib/operations/find_and_modify.js +152 -0
  1085. package/backend-project/node_modules/mongodb/lib/operations/find_and_modify.js.map +1 -0
  1086. package/backend-project/node_modules/mongodb/lib/operations/get_more.js +58 -0
  1087. package/backend-project/node_modules/mongodb/lib/operations/get_more.js.map +1 -0
  1088. package/backend-project/node_modules/mongodb/lib/operations/indexes.js +270 -0
  1089. package/backend-project/node_modules/mongodb/lib/operations/indexes.js.map +1 -0
  1090. package/backend-project/node_modules/mongodb/lib/operations/insert.js +95 -0
  1091. package/backend-project/node_modules/mongodb/lib/operations/insert.js.map +1 -0
  1092. package/backend-project/node_modules/mongodb/lib/operations/is_capped.js +28 -0
  1093. package/backend-project/node_modules/mongodb/lib/operations/is_capped.js.map +1 -0
  1094. package/backend-project/node_modules/mongodb/lib/operations/kill_cursors.js +32 -0
  1095. package/backend-project/node_modules/mongodb/lib/operations/kill_cursors.js.map +1 -0
  1096. package/backend-project/node_modules/mongodb/lib/operations/list_collections.js +47 -0
  1097. package/backend-project/node_modules/mongodb/lib/operations/list_collections.js.map +1 -0
  1098. package/backend-project/node_modules/mongodb/lib/operations/list_databases.js +35 -0
  1099. package/backend-project/node_modules/mongodb/lib/operations/list_databases.js.map +1 -0
  1100. package/backend-project/node_modules/mongodb/lib/operations/operation.js +82 -0
  1101. package/backend-project/node_modules/mongodb/lib/operations/operation.js.map +1 -0
  1102. package/backend-project/node_modules/mongodb/lib/operations/options_operation.js +28 -0
  1103. package/backend-project/node_modules/mongodb/lib/operations/options_operation.js.map +1 -0
  1104. package/backend-project/node_modules/mongodb/lib/operations/profiling_level.js +33 -0
  1105. package/backend-project/node_modules/mongodb/lib/operations/profiling_level.js.map +1 -0
  1106. package/backend-project/node_modules/mongodb/lib/operations/remove_user.js +21 -0
  1107. package/backend-project/node_modules/mongodb/lib/operations/remove_user.js.map +1 -0
  1108. package/backend-project/node_modules/mongodb/lib/operations/rename.js +46 -0
  1109. package/backend-project/node_modules/mongodb/lib/operations/rename.js.map +1 -0
  1110. package/backend-project/node_modules/mongodb/lib/operations/run_command.js +26 -0
  1111. package/backend-project/node_modules/mongodb/lib/operations/run_command.js.map +1 -0
  1112. package/backend-project/node_modules/mongodb/lib/operations/search_indexes/create.js +29 -0
  1113. package/backend-project/node_modules/mongodb/lib/operations/search_indexes/create.js.map +1 -0
  1114. package/backend-project/node_modules/mongodb/lib/operations/search_indexes/drop.js +30 -0
  1115. package/backend-project/node_modules/mongodb/lib/operations/search_indexes/drop.js.map +1 -0
  1116. package/backend-project/node_modules/mongodb/lib/operations/search_indexes/update.js +30 -0
  1117. package/backend-project/node_modules/mongodb/lib/operations/search_indexes/update.js.map +1 -0
  1118. package/backend-project/node_modules/mongodb/lib/operations/set_profiling_level.js +51 -0
  1119. package/backend-project/node_modules/mongodb/lib/operations/set_profiling_level.js.map +1 -0
  1120. package/backend-project/node_modules/mongodb/lib/operations/stats.js +48 -0
  1121. package/backend-project/node_modules/mongodb/lib/operations/stats.js.map +1 -0
  1122. package/backend-project/node_modules/mongodb/lib/operations/update.js +183 -0
  1123. package/backend-project/node_modules/mongodb/lib/operations/update.js.map +1 -0
  1124. package/backend-project/node_modules/mongodb/lib/operations/validate_collection.js +41 -0
  1125. package/backend-project/node_modules/mongodb/lib/operations/validate_collection.js.map +1 -0
  1126. package/backend-project/node_modules/mongodb/lib/read_concern.js +73 -0
  1127. package/backend-project/node_modules/mongodb/lib/read_concern.js.map +1 -0
  1128. package/backend-project/node_modules/mongodb/lib/read_preference.js +195 -0
  1129. package/backend-project/node_modules/mongodb/lib/read_preference.js.map +1 -0
  1130. package/backend-project/node_modules/mongodb/lib/sdam/common.js +56 -0
  1131. package/backend-project/node_modules/mongodb/lib/sdam/common.js.map +1 -0
  1132. package/backend-project/node_modules/mongodb/lib/sdam/events.js +125 -0
  1133. package/backend-project/node_modules/mongodb/lib/sdam/events.js.map +1 -0
  1134. package/backend-project/node_modules/mongodb/lib/sdam/monitor.js +414 -0
  1135. package/backend-project/node_modules/mongodb/lib/sdam/monitor.js.map +1 -0
  1136. package/backend-project/node_modules/mongodb/lib/sdam/server.js +382 -0
  1137. package/backend-project/node_modules/mongodb/lib/sdam/server.js.map +1 -0
  1138. package/backend-project/node_modules/mongodb/lib/sdam/server_description.js +189 -0
  1139. package/backend-project/node_modules/mongodb/lib/sdam/server_description.js.map +1 -0
  1140. package/backend-project/node_modules/mongodb/lib/sdam/server_selection.js +226 -0
  1141. package/backend-project/node_modules/mongodb/lib/sdam/server_selection.js.map +1 -0
  1142. package/backend-project/node_modules/mongodb/lib/sdam/srv_polling.js +103 -0
  1143. package/backend-project/node_modules/mongodb/lib/sdam/srv_polling.js.map +1 -0
  1144. package/backend-project/node_modules/mongodb/lib/sdam/topology.js +621 -0
  1145. package/backend-project/node_modules/mongodb/lib/sdam/topology.js.map +1 -0
  1146. package/backend-project/node_modules/mongodb/lib/sdam/topology_description.js +360 -0
  1147. package/backend-project/node_modules/mongodb/lib/sdam/topology_description.js.map +1 -0
  1148. package/backend-project/node_modules/mongodb/lib/sessions.js +739 -0
  1149. package/backend-project/node_modules/mongodb/lib/sessions.js.map +1 -0
  1150. package/backend-project/node_modules/mongodb/lib/sort.js +97 -0
  1151. package/backend-project/node_modules/mongodb/lib/sort.js.map +1 -0
  1152. package/backend-project/node_modules/mongodb/lib/transactions.js +138 -0
  1153. package/backend-project/node_modules/mongodb/lib/transactions.js.map +1 -0
  1154. package/backend-project/node_modules/mongodb/lib/utils.js +1064 -0
  1155. package/backend-project/node_modules/mongodb/lib/utils.js.map +1 -0
  1156. package/backend-project/node_modules/mongodb/lib/write_concern.js +86 -0
  1157. package/backend-project/node_modules/mongodb/lib/write_concern.js.map +1 -0
  1158. package/backend-project/node_modules/mongodb/mongodb.d.ts +6750 -0
  1159. package/backend-project/node_modules/mongodb/package.json +163 -0
  1160. package/backend-project/node_modules/mongodb/src/admin.ts +192 -0
  1161. package/backend-project/node_modules/mongodb/src/bson.ts +117 -0
  1162. package/backend-project/node_modules/mongodb/src/bulk/common.ts +1338 -0
  1163. package/backend-project/node_modules/mongodb/src/bulk/ordered.ts +83 -0
  1164. package/backend-project/node_modules/mongodb/src/bulk/unordered.ts +116 -0
  1165. package/backend-project/node_modules/mongodb/src/change_stream.ts +973 -0
  1166. package/backend-project/node_modules/mongodb/src/cmap/auth/auth_provider.ts +73 -0
  1167. package/backend-project/node_modules/mongodb/src/cmap/auth/gssapi.ts +204 -0
  1168. package/backend-project/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts +278 -0
  1169. package/backend-project/node_modules/mongodb/src/cmap/auth/mongocr.ts +42 -0
  1170. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts +293 -0
  1171. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/aws_service_workflow.ts +29 -0
  1172. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_service_workflow.ts +86 -0
  1173. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_token_cache.ts +51 -0
  1174. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/cache.ts +63 -0
  1175. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_lock_cache.ts +114 -0
  1176. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_workflow.ts +296 -0
  1177. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/service_workflow.ts +49 -0
  1178. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_entry_cache.ts +77 -0
  1179. package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc.ts +149 -0
  1180. package/backend-project/node_modules/mongodb/src/cmap/auth/plain.ts +25 -0
  1181. package/backend-project/node_modules/mongodb/src/cmap/auth/providers.ts +24 -0
  1182. package/backend-project/node_modules/mongodb/src/cmap/auth/scram.ts +354 -0
  1183. package/backend-project/node_modules/mongodb/src/cmap/auth/x509.ts +47 -0
  1184. package/backend-project/node_modules/mongodb/src/cmap/command_monitoring_events.ts +316 -0
  1185. package/backend-project/node_modules/mongodb/src/cmap/commands.ts +712 -0
  1186. package/backend-project/node_modules/mongodb/src/cmap/connect.ts +503 -0
  1187. package/backend-project/node_modules/mongodb/src/cmap/connection.ts +758 -0
  1188. package/backend-project/node_modules/mongodb/src/cmap/connection_pool.ts +920 -0
  1189. package/backend-project/node_modules/mongodb/src/cmap/connection_pool_events.ts +268 -0
  1190. package/backend-project/node_modules/mongodb/src/cmap/errors.ts +75 -0
  1191. package/backend-project/node_modules/mongodb/src/cmap/handshake/client_metadata.ts +273 -0
  1192. package/backend-project/node_modules/mongodb/src/cmap/message_stream.ts +234 -0
  1193. package/backend-project/node_modules/mongodb/src/cmap/metrics.ts +58 -0
  1194. package/backend-project/node_modules/mongodb/src/cmap/stream_description.ts +76 -0
  1195. package/backend-project/node_modules/mongodb/src/cmap/wire_protocol/compression.ts +126 -0
  1196. package/backend-project/node_modules/mongodb/src/cmap/wire_protocol/constants.ts +13 -0
  1197. package/backend-project/node_modules/mongodb/src/cmap/wire_protocol/shared.ts +53 -0
  1198. package/backend-project/node_modules/mongodb/src/collection.ts +1145 -0
  1199. package/backend-project/node_modules/mongodb/src/connection_string.ts +1315 -0
  1200. package/backend-project/node_modules/mongodb/src/constants.ts +147 -0
  1201. package/backend-project/node_modules/mongodb/src/cursor/abstract_cursor.ts +948 -0
  1202. package/backend-project/node_modules/mongodb/src/cursor/aggregation_cursor.ts +208 -0
  1203. package/backend-project/node_modules/mongodb/src/cursor/change_stream_cursor.ts +194 -0
  1204. package/backend-project/node_modules/mongodb/src/cursor/find_cursor.ts +458 -0
  1205. package/backend-project/node_modules/mongodb/src/cursor/list_collections_cursor.ts +52 -0
  1206. package/backend-project/node_modules/mongodb/src/cursor/list_indexes_cursor.ts +41 -0
  1207. package/backend-project/node_modules/mongodb/src/cursor/list_search_indexes_cursor.ts +20 -0
  1208. package/backend-project/node_modules/mongodb/src/cursor/run_command_cursor.ts +140 -0
  1209. package/backend-project/node_modules/mongodb/src/db.ts +558 -0
  1210. package/backend-project/node_modules/mongodb/src/deps.ts +428 -0
  1211. package/backend-project/node_modules/mongodb/src/encrypter.ts +131 -0
  1212. package/backend-project/node_modules/mongodb/src/error.ts +968 -0
  1213. package/backend-project/node_modules/mongodb/src/explain.ts +52 -0
  1214. package/backend-project/node_modules/mongodb/src/gridfs/download.ts +474 -0
  1215. package/backend-project/node_modules/mongodb/src/gridfs/index.ts +213 -0
  1216. package/backend-project/node_modules/mongodb/src/gridfs/upload.ts +510 -0
  1217. package/backend-project/node_modules/mongodb/src/index.ts +508 -0
  1218. package/backend-project/node_modules/mongodb/src/mongo_client.ts +839 -0
  1219. package/backend-project/node_modules/mongodb/src/mongo_logger.ts +538 -0
  1220. package/backend-project/node_modules/mongodb/src/mongo_types.ts +575 -0
  1221. package/backend-project/node_modules/mongodb/src/operations/add_user.ts +124 -0
  1222. package/backend-project/node_modules/mongodb/src/operations/aggregate.ts +149 -0
  1223. package/backend-project/node_modules/mongodb/src/operations/bulk_write.ts +62 -0
  1224. package/backend-project/node_modules/mongodb/src/operations/collections.ts +50 -0
  1225. package/backend-project/node_modules/mongodb/src/operations/command.ts +177 -0
  1226. package/backend-project/node_modules/mongodb/src/operations/common_functions.ts +105 -0
  1227. package/backend-project/node_modules/mongodb/src/operations/count.ts +68 -0
  1228. package/backend-project/node_modules/mongodb/src/operations/count_documents.ts +57 -0
  1229. package/backend-project/node_modules/mongodb/src/operations/create_collection.ts +217 -0
  1230. package/backend-project/node_modules/mongodb/src/operations/delete.ts +182 -0
  1231. package/backend-project/node_modules/mongodb/src/operations/distinct.ts +90 -0
  1232. package/backend-project/node_modules/mongodb/src/operations/drop.ts +119 -0
  1233. package/backend-project/node_modules/mongodb/src/operations/estimated_document_count.ts +62 -0
  1234. package/backend-project/node_modules/mongodb/src/operations/eval.ts +82 -0
  1235. package/backend-project/node_modules/mongodb/src/operations/execute_operation.ts +270 -0
  1236. package/backend-project/node_modules/mongodb/src/operations/find.ts +271 -0
  1237. package/backend-project/node_modules/mongodb/src/operations/find_and_modify.ts +303 -0
  1238. package/backend-project/node_modules/mongodb/src/operations/get_more.ts +111 -0
  1239. package/backend-project/node_modules/mongodb/src/operations/indexes.ts +526 -0
  1240. package/backend-project/node_modules/mongodb/src/operations/insert.ts +158 -0
  1241. package/backend-project/node_modules/mongodb/src/operations/is_capped.ts +44 -0
  1242. package/backend-project/node_modules/mongodb/src/operations/kill_cursors.ts +62 -0
  1243. package/backend-project/node_modules/mongodb/src/operations/list_collections.ts +99 -0
  1244. package/backend-project/node_modules/mongodb/src/operations/list_databases.ts +66 -0
  1245. package/backend-project/node_modules/mongodb/src/operations/operation.ts +141 -0
  1246. package/backend-project/node_modules/mongodb/src/operations/options_operation.ts +45 -0
  1247. package/backend-project/node_modules/mongodb/src/operations/profiling_level.ts +39 -0
  1248. package/backend-project/node_modules/mongodb/src/operations/remove_user.ts +33 -0
  1249. package/backend-project/node_modules/mongodb/src/operations/rename.ts +67 -0
  1250. package/backend-project/node_modules/mongodb/src/operations/run_command.ts +73 -0
  1251. package/backend-project/node_modules/mongodb/src/operations/search_indexes/create.ts +54 -0
  1252. package/backend-project/node_modules/mongodb/src/operations/search_indexes/drop.ts +39 -0
  1253. package/backend-project/node_modules/mongodb/src/operations/search_indexes/update.ts +40 -0
  1254. package/backend-project/node_modules/mongodb/src/operations/set_profiling_level.ts +74 -0
  1255. package/backend-project/node_modules/mongodb/src/operations/stats.ts +280 -0
  1256. package/backend-project/node_modules/mongodb/src/operations/update.ts +314 -0
  1257. package/backend-project/node_modules/mongodb/src/operations/validate_collection.ts +59 -0
  1258. package/backend-project/node_modules/mongodb/src/read_concern.ts +88 -0
  1259. package/backend-project/node_modules/mongodb/src/read_preference.ts +262 -0
  1260. package/backend-project/node_modules/mongodb/src/sdam/common.ts +79 -0
  1261. package/backend-project/node_modules/mongodb/src/sdam/events.ts +182 -0
  1262. package/backend-project/node_modules/mongodb/src/sdam/monitor.ts +595 -0
  1263. package/backend-project/node_modules/mongodb/src/sdam/server.ts +587 -0
  1264. package/backend-project/node_modules/mongodb/src/sdam/server_description.ts +262 -0
  1265. package/backend-project/node_modules/mongodb/src/sdam/server_selection.ts +324 -0
  1266. package/backend-project/node_modules/mongodb/src/sdam/srv_polling.ts +142 -0
  1267. package/backend-project/node_modules/mongodb/src/sdam/topology.ts +994 -0
  1268. package/backend-project/node_modules/mongodb/src/sdam/topology_description.ts +511 -0
  1269. package/backend-project/node_modules/mongodb/src/sessions.ts +1050 -0
  1270. package/backend-project/node_modules/mongodb/src/sort.ts +132 -0
  1271. package/backend-project/node_modules/mongodb/src/transactions.ts +188 -0
  1272. package/backend-project/node_modules/mongodb/src/utils.ts +1336 -0
  1273. package/backend-project/node_modules/mongodb/src/write_concern.ts +161 -0
  1274. package/backend-project/node_modules/mongodb/tsconfig.json +45 -0
  1275. package/backend-project/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs +6 -0
  1276. package/backend-project/node_modules/mongodb-connection-string-url/LICENSE +192 -0
  1277. package/backend-project/node_modules/mongodb-connection-string-url/README.md +25 -0
  1278. package/backend-project/node_modules/mongodb-connection-string-url/lib/index.d.ts +62 -0
  1279. package/backend-project/node_modules/mongodb-connection-string-url/lib/index.js +213 -0
  1280. package/backend-project/node_modules/mongodb-connection-string-url/lib/index.js.map +1 -0
  1281. package/backend-project/node_modules/mongodb-connection-string-url/lib/redact.d.ts +7 -0
  1282. package/backend-project/node_modules/mongodb-connection-string-url/lib/redact.js +86 -0
  1283. package/backend-project/node_modules/mongodb-connection-string-url/lib/redact.js.map +1 -0
  1284. package/backend-project/node_modules/mongodb-connection-string-url/package.json +62 -0
  1285. package/backend-project/node_modules/mongoose/.claude/settings.local.json +7 -0
  1286. package/backend-project/node_modules/mongoose/LICENSE.md +22 -0
  1287. package/backend-project/node_modules/mongoose/README.md +375 -0
  1288. package/backend-project/node_modules/mongoose/SECURITY.md +1 -0
  1289. package/backend-project/node_modules/mongoose/browser.js +8 -0
  1290. package/backend-project/node_modules/mongoose/dist/browser.umd.js +2 -0
  1291. package/backend-project/node_modules/mongoose/index.js +63 -0
  1292. package/backend-project/node_modules/mongoose/lib/aggregate.js +1199 -0
  1293. package/backend-project/node_modules/mongoose/lib/browser.js +132 -0
  1294. package/backend-project/node_modules/mongoose/lib/browserDocument.js +101 -0
  1295. package/backend-project/node_modules/mongoose/lib/cast/bigint.js +36 -0
  1296. package/backend-project/node_modules/mongoose/lib/cast/boolean.js +32 -0
  1297. package/backend-project/node_modules/mongoose/lib/cast/date.js +41 -0
  1298. package/backend-project/node_modules/mongoose/lib/cast/decimal128.js +39 -0
  1299. package/backend-project/node_modules/mongoose/lib/cast/number.js +42 -0
  1300. package/backend-project/node_modules/mongoose/lib/cast/objectid.js +29 -0
  1301. package/backend-project/node_modules/mongoose/lib/cast/string.js +37 -0
  1302. package/backend-project/node_modules/mongoose/lib/cast.js +443 -0
  1303. package/backend-project/node_modules/mongoose/lib/collection.js +327 -0
  1304. package/backend-project/node_modules/mongoose/lib/connection.js +1477 -0
  1305. package/backend-project/node_modules/mongoose/lib/connectionstate.js +26 -0
  1306. package/backend-project/node_modules/mongoose/lib/cursor/AggregationCursor.js +386 -0
  1307. package/backend-project/node_modules/mongoose/lib/cursor/ChangeStream.js +153 -0
  1308. package/backend-project/node_modules/mongoose/lib/cursor/QueryCursor.js +579 -0
  1309. package/backend-project/node_modules/mongoose/lib/document.js +4830 -0
  1310. package/backend-project/node_modules/mongoose/lib/document_provider.js +30 -0
  1311. package/backend-project/node_modules/mongoose/lib/driver.js +15 -0
  1312. package/backend-project/node_modules/mongoose/lib/drivers/SPEC.md +4 -0
  1313. package/backend-project/node_modules/mongoose/lib/drivers/browser/binary.js +14 -0
  1314. package/backend-project/node_modules/mongoose/lib/drivers/browser/decimal128.js +7 -0
  1315. package/backend-project/node_modules/mongoose/lib/drivers/browser/index.js +12 -0
  1316. package/backend-project/node_modules/mongoose/lib/drivers/browser/objectid.js +29 -0
  1317. package/backend-project/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +461 -0
  1318. package/backend-project/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +409 -0
  1319. package/backend-project/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js +8 -0
  1320. package/backend-project/node_modules/mongoose/lib/error/browserMissingSchema.js +28 -0
  1321. package/backend-project/node_modules/mongoose/lib/error/bulkWriteError.js +41 -0
  1322. package/backend-project/node_modules/mongoose/lib/error/cast.js +159 -0
  1323. package/backend-project/node_modules/mongoose/lib/error/createCollectionsError.js +26 -0
  1324. package/backend-project/node_modules/mongoose/lib/error/divergentArray.js +38 -0
  1325. package/backend-project/node_modules/mongoose/lib/error/eachAsyncMultiError.js +41 -0
  1326. package/backend-project/node_modules/mongoose/lib/error/index.js +227 -0
  1327. package/backend-project/node_modules/mongoose/lib/error/invalidSchemaOption.js +30 -0
  1328. package/backend-project/node_modules/mongoose/lib/error/messages.js +47 -0
  1329. package/backend-project/node_modules/mongoose/lib/error/missingSchema.js +31 -0
  1330. package/backend-project/node_modules/mongoose/lib/error/mongooseError.js +13 -0
  1331. package/backend-project/node_modules/mongoose/lib/error/notFound.js +45 -0
  1332. package/backend-project/node_modules/mongoose/lib/error/objectExpected.js +30 -0
  1333. package/backend-project/node_modules/mongoose/lib/error/objectParameter.js +30 -0
  1334. package/backend-project/node_modules/mongoose/lib/error/overwriteModel.js +30 -0
  1335. package/backend-project/node_modules/mongoose/lib/error/parallelSave.js +30 -0
  1336. package/backend-project/node_modules/mongoose/lib/error/parallelValidate.js +31 -0
  1337. package/backend-project/node_modules/mongoose/lib/error/serverSelection.js +61 -0
  1338. package/backend-project/node_modules/mongoose/lib/error/setOptionError.js +101 -0
  1339. package/backend-project/node_modules/mongoose/lib/error/strict.js +33 -0
  1340. package/backend-project/node_modules/mongoose/lib/error/strictPopulate.js +29 -0
  1341. package/backend-project/node_modules/mongoose/lib/error/syncIndexes.js +30 -0
  1342. package/backend-project/node_modules/mongoose/lib/error/validation.js +103 -0
  1343. package/backend-project/node_modules/mongoose/lib/error/validator.js +99 -0
  1344. package/backend-project/node_modules/mongoose/lib/error/version.js +36 -0
  1345. package/backend-project/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +39 -0
  1346. package/backend-project/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js +50 -0
  1347. package/backend-project/node_modules/mongoose/lib/helpers/arrayDepth.js +33 -0
  1348. package/backend-project/node_modules/mongoose/lib/helpers/clone.js +180 -0
  1349. package/backend-project/node_modules/mongoose/lib/helpers/common.js +127 -0
  1350. package/backend-project/node_modules/mongoose/lib/helpers/cursor/eachAsync.js +225 -0
  1351. package/backend-project/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js +32 -0
  1352. package/backend-project/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js +16 -0
  1353. package/backend-project/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js +12 -0
  1354. package/backend-project/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +29 -0
  1355. package/backend-project/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +28 -0
  1356. package/backend-project/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +27 -0
  1357. package/backend-project/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js +76 -0
  1358. package/backend-project/node_modules/mongoose/lib/helpers/document/applyDefaults.js +128 -0
  1359. package/backend-project/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +35 -0
  1360. package/backend-project/node_modules/mongoose/lib/helpers/document/compile.js +238 -0
  1361. package/backend-project/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js +38 -0
  1362. package/backend-project/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +53 -0
  1363. package/backend-project/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js +35 -0
  1364. package/backend-project/node_modules/mongoose/lib/helpers/each.js +25 -0
  1365. package/backend-project/node_modules/mongoose/lib/helpers/error/combinePathErrors.js +22 -0
  1366. package/backend-project/node_modules/mongoose/lib/helpers/firstKey.js +8 -0
  1367. package/backend-project/node_modules/mongoose/lib/helpers/get.js +65 -0
  1368. package/backend-project/node_modules/mongoose/lib/helpers/getConstructorName.js +16 -0
  1369. package/backend-project/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js +27 -0
  1370. package/backend-project/node_modules/mongoose/lib/helpers/getFunctionName.js +10 -0
  1371. package/backend-project/node_modules/mongoose/lib/helpers/immediate.js +16 -0
  1372. package/backend-project/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js +13 -0
  1373. package/backend-project/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +14 -0
  1374. package/backend-project/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js +59 -0
  1375. package/backend-project/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js +18 -0
  1376. package/backend-project/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +96 -0
  1377. package/backend-project/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js +16 -0
  1378. package/backend-project/node_modules/mongoose/lib/helpers/isAsyncFunction.js +9 -0
  1379. package/backend-project/node_modules/mongoose/lib/helpers/isBsonType.js +16 -0
  1380. package/backend-project/node_modules/mongoose/lib/helpers/isMongooseObject.js +22 -0
  1381. package/backend-project/node_modules/mongoose/lib/helpers/isObject.js +16 -0
  1382. package/backend-project/node_modules/mongoose/lib/helpers/isPOJO.js +12 -0
  1383. package/backend-project/node_modules/mongoose/lib/helpers/isPromise.js +6 -0
  1384. package/backend-project/node_modules/mongoose/lib/helpers/isSimpleValidator.js +22 -0
  1385. package/backend-project/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js +52 -0
  1386. package/backend-project/node_modules/mongoose/lib/helpers/model/applyHooks.js +149 -0
  1387. package/backend-project/node_modules/mongoose/lib/helpers/model/applyMethods.js +70 -0
  1388. package/backend-project/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +71 -0
  1389. package/backend-project/node_modules/mongoose/lib/helpers/model/applyStatics.js +13 -0
  1390. package/backend-project/node_modules/mongoose/lib/helpers/model/castBulkWrite.js +284 -0
  1391. package/backend-project/node_modules/mongoose/lib/helpers/model/discriminator.js +213 -0
  1392. package/backend-project/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js +15 -0
  1393. package/backend-project/node_modules/mongoose/lib/helpers/once.js +12 -0
  1394. package/backend-project/node_modules/mongoose/lib/helpers/parallelLimit.js +55 -0
  1395. package/backend-project/node_modules/mongoose/lib/helpers/path/parentPaths.js +18 -0
  1396. package/backend-project/node_modules/mongoose/lib/helpers/path/setDottedPath.js +33 -0
  1397. package/backend-project/node_modules/mongoose/lib/helpers/pluralize.js +95 -0
  1398. package/backend-project/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js +10 -0
  1399. package/backend-project/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +129 -0
  1400. package/backend-project/node_modules/mongoose/lib/helpers/populate/assignVals.js +344 -0
  1401. package/backend-project/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +97 -0
  1402. package/backend-project/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +758 -0
  1403. package/backend-project/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +229 -0
  1404. package/backend-project/node_modules/mongoose/lib/helpers/populate/getVirtual.js +72 -0
  1405. package/backend-project/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js +7 -0
  1406. package/backend-project/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js +40 -0
  1407. package/backend-project/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js +49 -0
  1408. package/backend-project/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js +68 -0
  1409. package/backend-project/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js +31 -0
  1410. package/backend-project/node_modules/mongoose/lib/helpers/populate/validateRef.js +19 -0
  1411. package/backend-project/node_modules/mongoose/lib/helpers/printJestWarning.js +21 -0
  1412. package/backend-project/node_modules/mongoose/lib/helpers/processConnectionOptions.js +65 -0
  1413. package/backend-project/node_modules/mongoose/lib/helpers/projection/applyProjection.js +77 -0
  1414. package/backend-project/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js +41 -0
  1415. package/backend-project/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js +18 -0
  1416. package/backend-project/node_modules/mongoose/lib/helpers/projection/isExclusive.js +37 -0
  1417. package/backend-project/node_modules/mongoose/lib/helpers/projection/isInclusive.js +39 -0
  1418. package/backend-project/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js +8 -0
  1419. package/backend-project/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +40 -0
  1420. package/backend-project/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js +28 -0
  1421. package/backend-project/node_modules/mongoose/lib/helpers/projection/isSubpath.js +14 -0
  1422. package/backend-project/node_modules/mongoose/lib/helpers/projection/parseProjection.js +33 -0
  1423. package/backend-project/node_modules/mongoose/lib/helpers/promiseOrCallback.js +54 -0
  1424. package/backend-project/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js +29 -0
  1425. package/backend-project/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js +54 -0
  1426. package/backend-project/node_modules/mongoose/lib/helpers/query/cast$expr.js +292 -0
  1427. package/backend-project/node_modules/mongoose/lib/helpers/query/castFilterPath.js +55 -0
  1428. package/backend-project/node_modules/mongoose/lib/helpers/query/castUpdate.js +584 -0
  1429. package/backend-project/node_modules/mongoose/lib/helpers/query/completeMany.js +36 -0
  1430. package/backend-project/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +94 -0
  1431. package/backend-project/node_modules/mongoose/lib/helpers/query/handleImmutable.js +32 -0
  1432. package/backend-project/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js +23 -0
  1433. package/backend-project/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js +23 -0
  1434. package/backend-project/node_modules/mongoose/lib/helpers/query/isOperator.js +14 -0
  1435. package/backend-project/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js +41 -0
  1436. package/backend-project/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js +14 -0
  1437. package/backend-project/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js +62 -0
  1438. package/backend-project/node_modules/mongoose/lib/helpers/query/trusted.js +13 -0
  1439. package/backend-project/node_modules/mongoose/lib/helpers/query/validOps.js +22 -0
  1440. package/backend-project/node_modules/mongoose/lib/helpers/schema/addAutoId.js +7 -0
  1441. package/backend-project/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js +12 -0
  1442. package/backend-project/node_modules/mongoose/lib/helpers/schema/applyPlugins.js +55 -0
  1443. package/backend-project/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +33 -0
  1444. package/backend-project/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js +12 -0
  1445. package/backend-project/node_modules/mongoose/lib/helpers/schema/getIndexes.js +172 -0
  1446. package/backend-project/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js +28 -0
  1447. package/backend-project/node_modules/mongoose/lib/helpers/schema/getPath.js +37 -0
  1448. package/backend-project/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js +32 -0
  1449. package/backend-project/node_modules/mongoose/lib/helpers/schema/handleIdOption.js +20 -0
  1450. package/backend-project/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js +24 -0
  1451. package/backend-project/node_modules/mongoose/lib/helpers/schema/idGetter.js +46 -0
  1452. package/backend-project/node_modules/mongoose/lib/helpers/schema/merge.js +36 -0
  1453. package/backend-project/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +50 -0
  1454. package/backend-project/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +132 -0
  1455. package/backend-project/node_modules/mongoose/lib/helpers/specialProperties.js +3 -0
  1456. package/backend-project/node_modules/mongoose/lib/helpers/symbols.js +20 -0
  1457. package/backend-project/node_modules/mongoose/lib/helpers/timers.js +3 -0
  1458. package/backend-project/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js +26 -0
  1459. package/backend-project/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +110 -0
  1460. package/backend-project/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js +12 -0
  1461. package/backend-project/node_modules/mongoose/lib/helpers/topology/isAtlas.js +31 -0
  1462. package/backend-project/node_modules/mongoose/lib/helpers/topology/isSSLError.js +16 -0
  1463. package/backend-project/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js +193 -0
  1464. package/backend-project/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +131 -0
  1465. package/backend-project/node_modules/mongoose/lib/helpers/update/castArrayFilters.js +109 -0
  1466. package/backend-project/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js +26 -0
  1467. package/backend-project/node_modules/mongoose/lib/helpers/update/modifiedPaths.js +33 -0
  1468. package/backend-project/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js +53 -0
  1469. package/backend-project/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +32 -0
  1470. package/backend-project/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js +27 -0
  1471. package/backend-project/node_modules/mongoose/lib/helpers/updateValidators.js +249 -0
  1472. package/backend-project/node_modules/mongoose/lib/index.js +1300 -0
  1473. package/backend-project/node_modules/mongoose/lib/internal.js +46 -0
  1474. package/backend-project/node_modules/mongoose/lib/model.js +4945 -0
  1475. package/backend-project/node_modules/mongoose/lib/options/PopulateOptions.js +36 -0
  1476. package/backend-project/node_modules/mongoose/lib/options/SchemaArrayOptions.js +78 -0
  1477. package/backend-project/node_modules/mongoose/lib/options/SchemaBufferOptions.js +38 -0
  1478. package/backend-project/node_modules/mongoose/lib/options/SchemaDateOptions.js +71 -0
  1479. package/backend-project/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js +68 -0
  1480. package/backend-project/node_modules/mongoose/lib/options/SchemaMapOptions.js +43 -0
  1481. package/backend-project/node_modules/mongoose/lib/options/SchemaNumberOptions.js +101 -0
  1482. package/backend-project/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js +64 -0
  1483. package/backend-project/node_modules/mongoose/lib/options/SchemaStringOptions.js +138 -0
  1484. package/backend-project/node_modules/mongoose/lib/options/SchemaSubdocumentOptions.js +42 -0
  1485. package/backend-project/node_modules/mongoose/lib/options/SchemaTypeOptions.js +244 -0
  1486. package/backend-project/node_modules/mongoose/lib/options/VirtualOptions.js +164 -0
  1487. package/backend-project/node_modules/mongoose/lib/options/propertyOptions.js +8 -0
  1488. package/backend-project/node_modules/mongoose/lib/options/saveOptions.js +14 -0
  1489. package/backend-project/node_modules/mongoose/lib/options.js +15 -0
  1490. package/backend-project/node_modules/mongoose/lib/plugins/index.js +7 -0
  1491. package/backend-project/node_modules/mongoose/lib/plugins/removeSubdocs.js +35 -0
  1492. package/backend-project/node_modules/mongoose/lib/plugins/saveSubdocs.js +66 -0
  1493. package/backend-project/node_modules/mongoose/lib/plugins/sharding.js +83 -0
  1494. package/backend-project/node_modules/mongoose/lib/plugins/trackTransaction.js +92 -0
  1495. package/backend-project/node_modules/mongoose/lib/plugins/validateBeforeSave.js +51 -0
  1496. package/backend-project/node_modules/mongoose/lib/query.js +5542 -0
  1497. package/backend-project/node_modules/mongoose/lib/queryhelpers.js +403 -0
  1498. package/backend-project/node_modules/mongoose/lib/schema/DocumentArrayElement.js +100 -0
  1499. package/backend-project/node_modules/mongoose/lib/schema/SubdocumentPath.js +397 -0
  1500. package/backend-project/node_modules/mongoose/lib/schema/array.js +686 -0
  1501. package/backend-project/node_modules/mongoose/lib/schema/bigint.js +240 -0
  1502. package/backend-project/node_modules/mongoose/lib/schema/boolean.js +290 -0
  1503. package/backend-project/node_modules/mongoose/lib/schema/buffer.js +290 -0
  1504. package/backend-project/node_modules/mongoose/lib/schema/date.js +426 -0
  1505. package/backend-project/node_modules/mongoose/lib/schema/decimal128.js +228 -0
  1506. package/backend-project/node_modules/mongoose/lib/schema/documentarray.js +616 -0
  1507. package/backend-project/node_modules/mongoose/lib/schema/index.js +28 -0
  1508. package/backend-project/node_modules/mongoose/lib/schema/map.js +84 -0
  1509. package/backend-project/node_modules/mongoose/lib/schema/mixed.js +131 -0
  1510. package/backend-project/node_modules/mongoose/lib/schema/number.js +440 -0
  1511. package/backend-project/node_modules/mongoose/lib/schema/objectid.js +297 -0
  1512. package/backend-project/node_modules/mongoose/lib/schema/operators/bitwise.js +38 -0
  1513. package/backend-project/node_modules/mongoose/lib/schema/operators/exists.js +12 -0
  1514. package/backend-project/node_modules/mongoose/lib/schema/operators/geospatial.js +107 -0
  1515. package/backend-project/node_modules/mongoose/lib/schema/operators/helpers.js +32 -0
  1516. package/backend-project/node_modules/mongoose/lib/schema/operators/text.js +39 -0
  1517. package/backend-project/node_modules/mongoose/lib/schema/operators/type.js +20 -0
  1518. package/backend-project/node_modules/mongoose/lib/schema/string.js +698 -0
  1519. package/backend-project/node_modules/mongoose/lib/schema/symbols.js +5 -0
  1520. package/backend-project/node_modules/mongoose/lib/schema/uuid.js +356 -0
  1521. package/backend-project/node_modules/mongoose/lib/schema.js +2780 -0
  1522. package/backend-project/node_modules/mongoose/lib/schematype.js +1709 -0
  1523. package/backend-project/node_modules/mongoose/lib/statemachine.js +211 -0
  1524. package/backend-project/node_modules/mongoose/lib/types/ArraySubdocument.js +197 -0
  1525. package/backend-project/node_modules/mongoose/lib/types/DocumentArray/index.js +113 -0
  1526. package/backend-project/node_modules/mongoose/lib/types/DocumentArray/isMongooseDocumentArray.js +5 -0
  1527. package/backend-project/node_modules/mongoose/lib/types/DocumentArray/methods/index.js +383 -0
  1528. package/backend-project/node_modules/mongoose/lib/types/array/index.js +119 -0
  1529. package/backend-project/node_modules/mongoose/lib/types/array/isMongooseArray.js +5 -0
  1530. package/backend-project/node_modules/mongoose/lib/types/array/methods/index.js +1031 -0
  1531. package/backend-project/node_modules/mongoose/lib/types/buffer.js +277 -0
  1532. package/backend-project/node_modules/mongoose/lib/types/decimal128.js +13 -0
  1533. package/backend-project/node_modules/mongoose/lib/types/index.js +22 -0
  1534. package/backend-project/node_modules/mongoose/lib/types/map.js +354 -0
  1535. package/backend-project/node_modules/mongoose/lib/types/objectid.js +41 -0
  1536. package/backend-project/node_modules/mongoose/lib/types/subdocument.js +436 -0
  1537. package/backend-project/node_modules/mongoose/lib/types/uuid.js +13 -0
  1538. package/backend-project/node_modules/mongoose/lib/utils.js +988 -0
  1539. package/backend-project/node_modules/mongoose/lib/validoptions.js +38 -0
  1540. package/backend-project/node_modules/mongoose/lib/virtualtype.js +175 -0
  1541. package/backend-project/node_modules/mongoose/node_modules/ms/index.js +162 -0
  1542. package/backend-project/node_modules/mongoose/node_modules/ms/license.md +21 -0
  1543. package/backend-project/node_modules/mongoose/node_modules/ms/package.json +38 -0
  1544. package/backend-project/node_modules/mongoose/node_modules/ms/readme.md +59 -0
  1545. package/backend-project/node_modules/mongoose/package.json +156 -0
  1546. package/backend-project/node_modules/mongoose/startmdb.mjs +19 -0
  1547. package/backend-project/node_modules/mongoose/types/aggregate.d.ts +180 -0
  1548. package/backend-project/node_modules/mongoose/types/augmentations.d.ts +9 -0
  1549. package/backend-project/node_modules/mongoose/types/callback.d.ts +8 -0
  1550. package/backend-project/node_modules/mongoose/types/collection.d.ts +44 -0
  1551. package/backend-project/node_modules/mongoose/types/connection.d.ts +234 -0
  1552. package/backend-project/node_modules/mongoose/types/cursor.d.ts +58 -0
  1553. package/backend-project/node_modules/mongoose/types/document.d.ts +261 -0
  1554. package/backend-project/node_modules/mongoose/types/error.d.ts +134 -0
  1555. package/backend-project/node_modules/mongoose/types/expressions.d.ts +3038 -0
  1556. package/backend-project/node_modules/mongoose/types/helpers.d.ts +32 -0
  1557. package/backend-project/node_modules/mongoose/types/index.d.ts +678 -0
  1558. package/backend-project/node_modules/mongoose/types/indexes.d.ts +89 -0
  1559. package/backend-project/node_modules/mongoose/types/inferschematype.d.ts +230 -0
  1560. package/backend-project/node_modules/mongoose/types/middlewares.d.ts +49 -0
  1561. package/backend-project/node_modules/mongoose/types/models.d.ts +790 -0
  1562. package/backend-project/node_modules/mongoose/types/mongooseoptions.d.ts +219 -0
  1563. package/backend-project/node_modules/mongoose/types/pipelinestage.d.ts +312 -0
  1564. package/backend-project/node_modules/mongoose/types/populate.d.ts +45 -0
  1565. package/backend-project/node_modules/mongoose/types/query.d.ts +781 -0
  1566. package/backend-project/node_modules/mongoose/types/schemaoptions.d.ts +261 -0
  1567. package/backend-project/node_modules/mongoose/types/schematypes.d.ts +490 -0
  1568. package/backend-project/node_modules/mongoose/types/session.d.ts +32 -0
  1569. package/backend-project/node_modules/mongoose/types/types.d.ts +103 -0
  1570. package/backend-project/node_modules/mongoose/types/utility.d.ts +43 -0
  1571. package/backend-project/node_modules/mongoose/types/validation.d.ts +34 -0
  1572. package/backend-project/node_modules/mongoose/types/virtuals.d.ts +14 -0
  1573. package/backend-project/node_modules/mpath/.travis.yml +9 -0
  1574. package/backend-project/node_modules/mpath/History.md +88 -0
  1575. package/backend-project/node_modules/mpath/LICENSE +22 -0
  1576. package/backend-project/node_modules/mpath/README.md +278 -0
  1577. package/backend-project/node_modules/mpath/SECURITY.md +5 -0
  1578. package/backend-project/node_modules/mpath/index.js +3 -0
  1579. package/backend-project/node_modules/mpath/lib/index.js +336 -0
  1580. package/backend-project/node_modules/mpath/lib/stringToParts.js +48 -0
  1581. package/backend-project/node_modules/mpath/package.json +144 -0
  1582. package/backend-project/node_modules/mpath/test/.eslintrc.yml +4 -0
  1583. package/backend-project/node_modules/mpath/test/index.js +1879 -0
  1584. package/backend-project/node_modules/mpath/test/stringToParts.js +30 -0
  1585. package/backend-project/node_modules/mquery/.github/ISSUE_TEMPLATE.md +11 -0
  1586. package/backend-project/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md +9 -0
  1587. package/backend-project/node_modules/mquery/History.md +384 -0
  1588. package/backend-project/node_modules/mquery/LICENSE +22 -0
  1589. package/backend-project/node_modules/mquery/README.md +1247 -0
  1590. package/backend-project/node_modules/mquery/SECURITY.md +1 -0
  1591. package/backend-project/node_modules/mquery/lib/collection/collection.js +45 -0
  1592. package/backend-project/node_modules/mquery/lib/collection/index.js +13 -0
  1593. package/backend-project/node_modules/mquery/lib/collection/node.js +114 -0
  1594. package/backend-project/node_modules/mquery/lib/env.js +22 -0
  1595. package/backend-project/node_modules/mquery/lib/mquery.js +2705 -0
  1596. package/backend-project/node_modules/mquery/lib/permissions.js +78 -0
  1597. package/backend-project/node_modules/mquery/lib/utils.js +297 -0
  1598. package/backend-project/node_modules/mquery/node_modules/debug/LICENSE +20 -0
  1599. package/backend-project/node_modules/mquery/node_modules/debug/README.md +481 -0
  1600. package/backend-project/node_modules/mquery/node_modules/debug/package.json +64 -0
  1601. package/backend-project/node_modules/mquery/node_modules/debug/src/browser.js +272 -0
  1602. package/backend-project/node_modules/mquery/node_modules/debug/src/common.js +292 -0
  1603. package/backend-project/node_modules/mquery/node_modules/debug/src/index.js +10 -0
  1604. package/backend-project/node_modules/mquery/node_modules/debug/src/node.js +263 -0
  1605. package/backend-project/node_modules/mquery/node_modules/ms/index.js +162 -0
  1606. package/backend-project/node_modules/mquery/node_modules/ms/license.md +21 -0
  1607. package/backend-project/node_modules/mquery/node_modules/ms/package.json +38 -0
  1608. package/backend-project/node_modules/mquery/node_modules/ms/readme.md +59 -0
  1609. package/backend-project/node_modules/mquery/package.json +38 -0
  1610. package/backend-project/node_modules/ms/index.js +152 -0
  1611. package/backend-project/node_modules/ms/license.md +21 -0
  1612. package/backend-project/node_modules/ms/package.json +37 -0
  1613. package/backend-project/node_modules/ms/readme.md +51 -0
  1614. package/backend-project/node_modules/negotiator/HISTORY.md +108 -0
  1615. package/backend-project/node_modules/negotiator/LICENSE +24 -0
  1616. package/backend-project/node_modules/negotiator/README.md +203 -0
  1617. package/backend-project/node_modules/negotiator/index.js +82 -0
  1618. package/backend-project/node_modules/negotiator/lib/charset.js +169 -0
  1619. package/backend-project/node_modules/negotiator/lib/encoding.js +184 -0
  1620. package/backend-project/node_modules/negotiator/lib/language.js +179 -0
  1621. package/backend-project/node_modules/negotiator/lib/mediaType.js +294 -0
  1622. package/backend-project/node_modules/negotiator/package.json +42 -0
  1623. package/backend-project/node_modules/nodemon/.prettierrc.json +3 -0
  1624. package/backend-project/node_modules/nodemon/LICENSE +21 -0
  1625. package/backend-project/node_modules/nodemon/README.md +439 -0
  1626. package/backend-project/node_modules/nodemon/bin/nodemon.js +16 -0
  1627. package/backend-project/node_modules/nodemon/bin/windows-kill.exe +0 -0
  1628. package/backend-project/node_modules/nodemon/doc/cli/authors.txt +8 -0
  1629. package/backend-project/node_modules/nodemon/doc/cli/config.txt +44 -0
  1630. package/backend-project/node_modules/nodemon/doc/cli/help.txt +29 -0
  1631. package/backend-project/node_modules/nodemon/doc/cli/logo.txt +20 -0
  1632. package/backend-project/node_modules/nodemon/doc/cli/options.txt +36 -0
  1633. package/backend-project/node_modules/nodemon/doc/cli/topics.txt +8 -0
  1634. package/backend-project/node_modules/nodemon/doc/cli/usage.txt +3 -0
  1635. package/backend-project/node_modules/nodemon/doc/cli/whoami.txt +9 -0
  1636. package/backend-project/node_modules/nodemon/index.d.ts +124 -0
  1637. package/backend-project/node_modules/nodemon/jsconfig.json +7 -0
  1638. package/backend-project/node_modules/nodemon/lib/cli/index.js +49 -0
  1639. package/backend-project/node_modules/nodemon/lib/cli/parse.js +230 -0
  1640. package/backend-project/node_modules/nodemon/lib/config/command.js +43 -0
  1641. package/backend-project/node_modules/nodemon/lib/config/defaults.js +34 -0
  1642. package/backend-project/node_modules/nodemon/lib/config/exec.js +240 -0
  1643. package/backend-project/node_modules/nodemon/lib/config/index.js +93 -0
  1644. package/backend-project/node_modules/nodemon/lib/config/load.js +225 -0
  1645. package/backend-project/node_modules/nodemon/lib/help/index.js +27 -0
  1646. package/backend-project/node_modules/nodemon/lib/index.js +1 -0
  1647. package/backend-project/node_modules/nodemon/lib/monitor/index.js +4 -0
  1648. package/backend-project/node_modules/nodemon/lib/monitor/match.js +288 -0
  1649. package/backend-project/node_modules/nodemon/lib/monitor/run.js +562 -0
  1650. package/backend-project/node_modules/nodemon/lib/monitor/signals.js +34 -0
  1651. package/backend-project/node_modules/nodemon/lib/monitor/watch.js +244 -0
  1652. package/backend-project/node_modules/nodemon/lib/nodemon.js +317 -0
  1653. package/backend-project/node_modules/nodemon/lib/rules/add.js +89 -0
  1654. package/backend-project/node_modules/nodemon/lib/rules/index.js +53 -0
  1655. package/backend-project/node_modules/nodemon/lib/rules/parse.js +43 -0
  1656. package/backend-project/node_modules/nodemon/lib/spawn.js +74 -0
  1657. package/backend-project/node_modules/nodemon/lib/utils/bus.js +44 -0
  1658. package/backend-project/node_modules/nodemon/lib/utils/clone.js +40 -0
  1659. package/backend-project/node_modules/nodemon/lib/utils/colour.js +26 -0
  1660. package/backend-project/node_modules/nodemon/lib/utils/index.js +103 -0
  1661. package/backend-project/node_modules/nodemon/lib/utils/log.js +82 -0
  1662. package/backend-project/node_modules/nodemon/lib/utils/merge.js +47 -0
  1663. package/backend-project/node_modules/nodemon/lib/version.js +100 -0
  1664. package/backend-project/node_modules/nodemon/node_modules/debug/LICENSE +20 -0
  1665. package/backend-project/node_modules/nodemon/node_modules/debug/README.md +481 -0
  1666. package/backend-project/node_modules/nodemon/node_modules/debug/package.json +64 -0
  1667. package/backend-project/node_modules/nodemon/node_modules/debug/src/browser.js +272 -0
  1668. package/backend-project/node_modules/nodemon/node_modules/debug/src/common.js +292 -0
  1669. package/backend-project/node_modules/nodemon/node_modules/debug/src/index.js +10 -0
  1670. package/backend-project/node_modules/nodemon/node_modules/debug/src/node.js +263 -0
  1671. package/backend-project/node_modules/nodemon/node_modules/ms/index.js +162 -0
  1672. package/backend-project/node_modules/nodemon/node_modules/ms/license.md +21 -0
  1673. package/backend-project/node_modules/nodemon/node_modules/ms/package.json +38 -0
  1674. package/backend-project/node_modules/nodemon/node_modules/ms/readme.md +59 -0
  1675. package/backend-project/node_modules/nodemon/package.json +78 -0
  1676. package/backend-project/node_modules/normalize-path/LICENSE +21 -0
  1677. package/backend-project/node_modules/normalize-path/README.md +127 -0
  1678. package/backend-project/node_modules/normalize-path/index.js +35 -0
  1679. package/backend-project/node_modules/normalize-path/package.json +77 -0
  1680. package/backend-project/node_modules/object-assign/index.js +90 -0
  1681. package/backend-project/node_modules/object-assign/license +21 -0
  1682. package/backend-project/node_modules/object-assign/package.json +42 -0
  1683. package/backend-project/node_modules/object-assign/readme.md +61 -0
  1684. package/backend-project/node_modules/object-inspect/.eslintrc +53 -0
  1685. package/backend-project/node_modules/object-inspect/.github/FUNDING.yml +12 -0
  1686. package/backend-project/node_modules/object-inspect/.nycrc +13 -0
  1687. package/backend-project/node_modules/object-inspect/CHANGELOG.md +424 -0
  1688. package/backend-project/node_modules/object-inspect/LICENSE +21 -0
  1689. package/backend-project/node_modules/object-inspect/example/all.js +23 -0
  1690. package/backend-project/node_modules/object-inspect/example/circular.js +6 -0
  1691. package/backend-project/node_modules/object-inspect/example/fn.js +5 -0
  1692. package/backend-project/node_modules/object-inspect/example/inspect.js +10 -0
  1693. package/backend-project/node_modules/object-inspect/index.js +544 -0
  1694. package/backend-project/node_modules/object-inspect/package-support.json +20 -0
  1695. package/backend-project/node_modules/object-inspect/package.json +105 -0
  1696. package/backend-project/node_modules/object-inspect/readme.markdown +84 -0
  1697. package/backend-project/node_modules/object-inspect/test/bigint.js +58 -0
  1698. package/backend-project/node_modules/object-inspect/test/browser/dom.js +15 -0
  1699. package/backend-project/node_modules/object-inspect/test/circular.js +16 -0
  1700. package/backend-project/node_modules/object-inspect/test/deep.js +12 -0
  1701. package/backend-project/node_modules/object-inspect/test/element.js +53 -0
  1702. package/backend-project/node_modules/object-inspect/test/err.js +48 -0
  1703. package/backend-project/node_modules/object-inspect/test/fakes.js +29 -0
  1704. package/backend-project/node_modules/object-inspect/test/fn.js +76 -0
  1705. package/backend-project/node_modules/object-inspect/test/global.js +17 -0
  1706. package/backend-project/node_modules/object-inspect/test/has.js +15 -0
  1707. package/backend-project/node_modules/object-inspect/test/holes.js +15 -0
  1708. package/backend-project/node_modules/object-inspect/test/indent-option.js +271 -0
  1709. package/backend-project/node_modules/object-inspect/test/inspect.js +139 -0
  1710. package/backend-project/node_modules/object-inspect/test/lowbyte.js +12 -0
  1711. package/backend-project/node_modules/object-inspect/test/number.js +58 -0
  1712. package/backend-project/node_modules/object-inspect/test/quoteStyle.js +26 -0
  1713. package/backend-project/node_modules/object-inspect/test/toStringTag.js +40 -0
  1714. package/backend-project/node_modules/object-inspect/test/undef.js +12 -0
  1715. package/backend-project/node_modules/object-inspect/test/values.js +261 -0
  1716. package/backend-project/node_modules/object-inspect/test-core-js.js +26 -0
  1717. package/backend-project/node_modules/object-inspect/util.inspect.js +1 -0
  1718. package/backend-project/node_modules/on-finished/HISTORY.md +98 -0
  1719. package/backend-project/node_modules/on-finished/LICENSE +23 -0
  1720. package/backend-project/node_modules/on-finished/README.md +162 -0
  1721. package/backend-project/node_modules/on-finished/index.js +234 -0
  1722. package/backend-project/node_modules/on-finished/package.json +39 -0
  1723. package/backend-project/node_modules/parseurl/HISTORY.md +58 -0
  1724. package/backend-project/node_modules/parseurl/LICENSE +24 -0
  1725. package/backend-project/node_modules/parseurl/README.md +133 -0
  1726. package/backend-project/node_modules/parseurl/index.js +158 -0
  1727. package/backend-project/node_modules/parseurl/package.json +40 -0
  1728. package/backend-project/node_modules/path-to-regexp/LICENSE +21 -0
  1729. package/backend-project/node_modules/path-to-regexp/Readme.md +35 -0
  1730. package/backend-project/node_modules/path-to-regexp/index.js +158 -0
  1731. package/backend-project/node_modules/path-to-regexp/package.json +30 -0
  1732. package/backend-project/node_modules/picomatch/LICENSE +21 -0
  1733. package/backend-project/node_modules/picomatch/README.md +716 -0
  1734. package/backend-project/node_modules/picomatch/index.js +3 -0
  1735. package/backend-project/node_modules/picomatch/lib/constants.js +184 -0
  1736. package/backend-project/node_modules/picomatch/lib/parse.js +1392 -0
  1737. package/backend-project/node_modules/picomatch/lib/picomatch.js +342 -0
  1738. package/backend-project/node_modules/picomatch/lib/scan.js +391 -0
  1739. package/backend-project/node_modules/picomatch/lib/utils.js +64 -0
  1740. package/backend-project/node_modules/picomatch/package.json +81 -0
  1741. package/backend-project/node_modules/proxy-addr/HISTORY.md +161 -0
  1742. package/backend-project/node_modules/proxy-addr/LICENSE +22 -0
  1743. package/backend-project/node_modules/proxy-addr/README.md +139 -0
  1744. package/backend-project/node_modules/proxy-addr/index.js +327 -0
  1745. package/backend-project/node_modules/proxy-addr/package.json +47 -0
  1746. package/backend-project/node_modules/pstree.remy/.travis.yml +8 -0
  1747. package/backend-project/node_modules/pstree.remy/LICENSE +7 -0
  1748. package/backend-project/node_modules/pstree.remy/README.md +26 -0
  1749. package/backend-project/node_modules/pstree.remy/lib/index.js +37 -0
  1750. package/backend-project/node_modules/pstree.remy/lib/tree.js +37 -0
  1751. package/backend-project/node_modules/pstree.remy/lib/utils.js +53 -0
  1752. package/backend-project/node_modules/pstree.remy/package.json +33 -0
  1753. package/backend-project/node_modules/pstree.remy/tests/fixtures/index.js +13 -0
  1754. package/backend-project/node_modules/pstree.remy/tests/fixtures/out1 +10 -0
  1755. package/backend-project/node_modules/pstree.remy/tests/fixtures/out2 +29 -0
  1756. package/backend-project/node_modules/pstree.remy/tests/index.test.js +51 -0
  1757. package/backend-project/node_modules/punycode/LICENSE-MIT.txt +20 -0
  1758. package/backend-project/node_modules/punycode/README.md +148 -0
  1759. package/backend-project/node_modules/punycode/package.json +58 -0
  1760. package/backend-project/node_modules/punycode/punycode.es6.js +444 -0
  1761. package/backend-project/node_modules/punycode/punycode.js +443 -0
  1762. package/backend-project/node_modules/qs/.editorconfig +46 -0
  1763. package/backend-project/node_modules/qs/.github/FUNDING.yml +12 -0
  1764. package/backend-project/node_modules/qs/.github/SECURITY.md +11 -0
  1765. package/backend-project/node_modules/qs/.github/THREAT_MODEL.md +78 -0
  1766. package/backend-project/node_modules/qs/.nycrc +13 -0
  1767. package/backend-project/node_modules/qs/CHANGELOG.md +822 -0
  1768. package/backend-project/node_modules/qs/LICENSE.md +29 -0
  1769. package/backend-project/node_modules/qs/README.md +758 -0
  1770. package/backend-project/node_modules/qs/dist/qs.js +141 -0
  1771. package/backend-project/node_modules/qs/eslint.config.mjs +57 -0
  1772. package/backend-project/node_modules/qs/lib/formats.js +23 -0
  1773. package/backend-project/node_modules/qs/lib/index.js +11 -0
  1774. package/backend-project/node_modules/qs/lib/parse.js +403 -0
  1775. package/backend-project/node_modules/qs/lib/stringify.js +363 -0
  1776. package/backend-project/node_modules/qs/lib/utils.js +342 -0
  1777. package/backend-project/node_modules/qs/package.json +94 -0
  1778. package/backend-project/node_modules/qs/test/empty-keys-cases.js +267 -0
  1779. package/backend-project/node_modules/qs/test/parse.js +1703 -0
  1780. package/backend-project/node_modules/qs/test/stringify.js +1448 -0
  1781. package/backend-project/node_modules/qs/test/utils.js +432 -0
  1782. package/backend-project/node_modules/range-parser/HISTORY.md +56 -0
  1783. package/backend-project/node_modules/range-parser/LICENSE +23 -0
  1784. package/backend-project/node_modules/range-parser/README.md +84 -0
  1785. package/backend-project/node_modules/range-parser/index.js +162 -0
  1786. package/backend-project/node_modules/range-parser/package.json +44 -0
  1787. package/backend-project/node_modules/raw-body/LICENSE +22 -0
  1788. package/backend-project/node_modules/raw-body/README.md +223 -0
  1789. package/backend-project/node_modules/raw-body/index.d.ts +87 -0
  1790. package/backend-project/node_modules/raw-body/index.js +336 -0
  1791. package/backend-project/node_modules/raw-body/package.json +47 -0
  1792. package/backend-project/node_modules/readdirp/LICENSE +21 -0
  1793. package/backend-project/node_modules/readdirp/README.md +122 -0
  1794. package/backend-project/node_modules/readdirp/index.d.ts +43 -0
  1795. package/backend-project/node_modules/readdirp/index.js +287 -0
  1796. package/backend-project/node_modules/readdirp/package.json +122 -0
  1797. package/backend-project/node_modules/safe-buffer/LICENSE +21 -0
  1798. package/backend-project/node_modules/safe-buffer/README.md +584 -0
  1799. package/backend-project/node_modules/safe-buffer/index.d.ts +187 -0
  1800. package/backend-project/node_modules/safe-buffer/index.js +65 -0
  1801. package/backend-project/node_modules/safe-buffer/package.json +51 -0
  1802. package/backend-project/node_modules/safer-buffer/LICENSE +21 -0
  1803. package/backend-project/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  1804. package/backend-project/node_modules/safer-buffer/Readme.md +156 -0
  1805. package/backend-project/node_modules/safer-buffer/dangerous.js +58 -0
  1806. package/backend-project/node_modules/safer-buffer/package.json +34 -0
  1807. package/backend-project/node_modules/safer-buffer/safer.js +77 -0
  1808. package/backend-project/node_modules/safer-buffer/tests.js +406 -0
  1809. package/backend-project/node_modules/semver/LICENSE +15 -0
  1810. package/backend-project/node_modules/semver/README.md +680 -0
  1811. package/backend-project/node_modules/semver/bin/semver.js +195 -0
  1812. package/backend-project/node_modules/semver/classes/comparator.js +143 -0
  1813. package/backend-project/node_modules/semver/classes/index.js +7 -0
  1814. package/backend-project/node_modules/semver/classes/range.js +564 -0
  1815. package/backend-project/node_modules/semver/classes/semver.js +333 -0
  1816. package/backend-project/node_modules/semver/functions/clean.js +8 -0
  1817. package/backend-project/node_modules/semver/functions/cmp.js +54 -0
  1818. package/backend-project/node_modules/semver/functions/coerce.js +62 -0
  1819. package/backend-project/node_modules/semver/functions/compare-build.js +9 -0
  1820. package/backend-project/node_modules/semver/functions/compare-loose.js +5 -0
  1821. package/backend-project/node_modules/semver/functions/compare.js +7 -0
  1822. package/backend-project/node_modules/semver/functions/diff.js +60 -0
  1823. package/backend-project/node_modules/semver/functions/eq.js +5 -0
  1824. package/backend-project/node_modules/semver/functions/gt.js +5 -0
  1825. package/backend-project/node_modules/semver/functions/gte.js +5 -0
  1826. package/backend-project/node_modules/semver/functions/inc.js +21 -0
  1827. package/backend-project/node_modules/semver/functions/lt.js +5 -0
  1828. package/backend-project/node_modules/semver/functions/lte.js +5 -0
  1829. package/backend-project/node_modules/semver/functions/major.js +5 -0
  1830. package/backend-project/node_modules/semver/functions/minor.js +5 -0
  1831. package/backend-project/node_modules/semver/functions/neq.js +5 -0
  1832. package/backend-project/node_modules/semver/functions/parse.js +18 -0
  1833. package/backend-project/node_modules/semver/functions/patch.js +5 -0
  1834. package/backend-project/node_modules/semver/functions/prerelease.js +8 -0
  1835. package/backend-project/node_modules/semver/functions/rcompare.js +5 -0
  1836. package/backend-project/node_modules/semver/functions/rsort.js +5 -0
  1837. package/backend-project/node_modules/semver/functions/satisfies.js +12 -0
  1838. package/backend-project/node_modules/semver/functions/sort.js +5 -0
  1839. package/backend-project/node_modules/semver/functions/truncate.js +48 -0
  1840. package/backend-project/node_modules/semver/functions/valid.js +8 -0
  1841. package/backend-project/node_modules/semver/index.js +93 -0
  1842. package/backend-project/node_modules/semver/internal/constants.js +37 -0
  1843. package/backend-project/node_modules/semver/internal/debug.js +11 -0
  1844. package/backend-project/node_modules/semver/internal/identifiers.js +29 -0
  1845. package/backend-project/node_modules/semver/internal/lrucache.js +42 -0
  1846. package/backend-project/node_modules/semver/internal/parse-options.js +17 -0
  1847. package/backend-project/node_modules/semver/internal/re.js +223 -0
  1848. package/backend-project/node_modules/semver/package.json +78 -0
  1849. package/backend-project/node_modules/semver/preload.js +4 -0
  1850. package/backend-project/node_modules/semver/range.bnf +17 -0
  1851. package/backend-project/node_modules/semver/ranges/gtr.js +6 -0
  1852. package/backend-project/node_modules/semver/ranges/intersects.js +9 -0
  1853. package/backend-project/node_modules/semver/ranges/ltr.js +6 -0
  1854. package/backend-project/node_modules/semver/ranges/max-satisfying.js +27 -0
  1855. package/backend-project/node_modules/semver/ranges/min-satisfying.js +26 -0
  1856. package/backend-project/node_modules/semver/ranges/min-version.js +63 -0
  1857. package/backend-project/node_modules/semver/ranges/outside.js +82 -0
  1858. package/backend-project/node_modules/semver/ranges/simplify.js +49 -0
  1859. package/backend-project/node_modules/semver/ranges/subset.js +249 -0
  1860. package/backend-project/node_modules/semver/ranges/to-comparators.js +10 -0
  1861. package/backend-project/node_modules/semver/ranges/valid.js +13 -0
  1862. package/backend-project/node_modules/send/HISTORY.md +538 -0
  1863. package/backend-project/node_modules/send/LICENSE +23 -0
  1864. package/backend-project/node_modules/send/README.md +327 -0
  1865. package/backend-project/node_modules/send/SECURITY.md +24 -0
  1866. package/backend-project/node_modules/send/index.js +1142 -0
  1867. package/backend-project/node_modules/send/node_modules/ms/index.js +162 -0
  1868. package/backend-project/node_modules/send/node_modules/ms/license.md +21 -0
  1869. package/backend-project/node_modules/send/node_modules/ms/package.json +38 -0
  1870. package/backend-project/node_modules/send/node_modules/ms/readme.md +59 -0
  1871. package/backend-project/node_modules/send/package.json +62 -0
  1872. package/backend-project/node_modules/serve-static/HISTORY.md +493 -0
  1873. package/backend-project/node_modules/serve-static/LICENSE +25 -0
  1874. package/backend-project/node_modules/serve-static/README.md +257 -0
  1875. package/backend-project/node_modules/serve-static/index.js +209 -0
  1876. package/backend-project/node_modules/serve-static/package.json +42 -0
  1877. package/backend-project/node_modules/setprototypeof/LICENSE +13 -0
  1878. package/backend-project/node_modules/setprototypeof/README.md +31 -0
  1879. package/backend-project/node_modules/setprototypeof/index.d.ts +2 -0
  1880. package/backend-project/node_modules/setprototypeof/index.js +17 -0
  1881. package/backend-project/node_modules/setprototypeof/package.json +38 -0
  1882. package/backend-project/node_modules/setprototypeof/test/index.js +24 -0
  1883. package/backend-project/node_modules/side-channel/.editorconfig +9 -0
  1884. package/backend-project/node_modules/side-channel/.eslintrc +12 -0
  1885. package/backend-project/node_modules/side-channel/.github/FUNDING.yml +12 -0
  1886. package/backend-project/node_modules/side-channel/.nycrc +13 -0
  1887. package/backend-project/node_modules/side-channel/CHANGELOG.md +110 -0
  1888. package/backend-project/node_modules/side-channel/LICENSE +21 -0
  1889. package/backend-project/node_modules/side-channel/README.md +61 -0
  1890. package/backend-project/node_modules/side-channel/index.d.ts +14 -0
  1891. package/backend-project/node_modules/side-channel/index.js +43 -0
  1892. package/backend-project/node_modules/side-channel/package.json +85 -0
  1893. package/backend-project/node_modules/side-channel/test/index.js +104 -0
  1894. package/backend-project/node_modules/side-channel/tsconfig.json +9 -0
  1895. package/backend-project/node_modules/side-channel-list/.editorconfig +9 -0
  1896. package/backend-project/node_modules/side-channel-list/.eslintrc +11 -0
  1897. package/backend-project/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
  1898. package/backend-project/node_modules/side-channel-list/.nycrc +13 -0
  1899. package/backend-project/node_modules/side-channel-list/CHANGELOG.md +36 -0
  1900. package/backend-project/node_modules/side-channel-list/LICENSE +21 -0
  1901. package/backend-project/node_modules/side-channel-list/README.md +62 -0
  1902. package/backend-project/node_modules/side-channel-list/index.d.ts +13 -0
  1903. package/backend-project/node_modules/side-channel-list/index.js +111 -0
  1904. package/backend-project/node_modules/side-channel-list/list.d.ts +14 -0
  1905. package/backend-project/node_modules/side-channel-list/package.json +77 -0
  1906. package/backend-project/node_modules/side-channel-list/test/index.js +154 -0
  1907. package/backend-project/node_modules/side-channel-list/tsconfig.json +9 -0
  1908. package/backend-project/node_modules/side-channel-map/.editorconfig +9 -0
  1909. package/backend-project/node_modules/side-channel-map/.eslintrc +11 -0
  1910. package/backend-project/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
  1911. package/backend-project/node_modules/side-channel-map/.nycrc +13 -0
  1912. package/backend-project/node_modules/side-channel-map/CHANGELOG.md +22 -0
  1913. package/backend-project/node_modules/side-channel-map/LICENSE +21 -0
  1914. package/backend-project/node_modules/side-channel-map/README.md +62 -0
  1915. package/backend-project/node_modules/side-channel-map/index.d.ts +15 -0
  1916. package/backend-project/node_modules/side-channel-map/index.js +68 -0
  1917. package/backend-project/node_modules/side-channel-map/package.json +80 -0
  1918. package/backend-project/node_modules/side-channel-map/test/index.js +114 -0
  1919. package/backend-project/node_modules/side-channel-map/tsconfig.json +9 -0
  1920. package/backend-project/node_modules/side-channel-weakmap/.editorconfig +9 -0
  1921. package/backend-project/node_modules/side-channel-weakmap/.eslintrc +12 -0
  1922. package/backend-project/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
  1923. package/backend-project/node_modules/side-channel-weakmap/.nycrc +13 -0
  1924. package/backend-project/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
  1925. package/backend-project/node_modules/side-channel-weakmap/LICENSE +21 -0
  1926. package/backend-project/node_modules/side-channel-weakmap/README.md +62 -0
  1927. package/backend-project/node_modules/side-channel-weakmap/index.d.ts +15 -0
  1928. package/backend-project/node_modules/side-channel-weakmap/index.js +84 -0
  1929. package/backend-project/node_modules/side-channel-weakmap/package.json +87 -0
  1930. package/backend-project/node_modules/side-channel-weakmap/test/index.js +114 -0
  1931. package/backend-project/node_modules/side-channel-weakmap/tsconfig.json +9 -0
  1932. package/backend-project/node_modules/sift/MIT-LICENSE.txt +20 -0
  1933. package/backend-project/node_modules/sift/README.md +465 -0
  1934. package/backend-project/node_modules/sift/es/index.js +626 -0
  1935. package/backend-project/node_modules/sift/es/index.js.map +1 -0
  1936. package/backend-project/node_modules/sift/es5m/index.js +729 -0
  1937. package/backend-project/node_modules/sift/es5m/index.js.map +1 -0
  1938. package/backend-project/node_modules/sift/index.d.ts +4 -0
  1939. package/backend-project/node_modules/sift/index.js +4 -0
  1940. package/backend-project/node_modules/sift/lib/core.d.ts +120 -0
  1941. package/backend-project/node_modules/sift/lib/index.d.ts +6 -0
  1942. package/backend-project/node_modules/sift/lib/index.js +766 -0
  1943. package/backend-project/node_modules/sift/lib/index.js.map +1 -0
  1944. package/backend-project/node_modules/sift/lib/operations.d.ts +88 -0
  1945. package/backend-project/node_modules/sift/lib/utils.d.ts +9 -0
  1946. package/backend-project/node_modules/sift/package.json +62 -0
  1947. package/backend-project/node_modules/sift/sift.csp.min.js +763 -0
  1948. package/backend-project/node_modules/sift/sift.csp.min.js.map +1 -0
  1949. package/backend-project/node_modules/sift/sift.min.js +16 -0
  1950. package/backend-project/node_modules/sift/sift.min.js.map +1 -0
  1951. package/backend-project/node_modules/sift/src/core.d.ts +120 -0
  1952. package/backend-project/node_modules/sift/src/core.js +267 -0
  1953. package/backend-project/node_modules/sift/src/core.js.map +1 -0
  1954. package/backend-project/node_modules/sift/src/core.ts +481 -0
  1955. package/backend-project/node_modules/sift/src/index.d.ts +6 -0
  1956. package/backend-project/node_modules/sift/src/index.js +38 -0
  1957. package/backend-project/node_modules/sift/src/index.js.map +1 -0
  1958. package/backend-project/node_modules/sift/src/index.ts +54 -0
  1959. package/backend-project/node_modules/sift/src/operations.d.ts +88 -0
  1960. package/backend-project/node_modules/sift/src/operations.js +297 -0
  1961. package/backend-project/node_modules/sift/src/operations.js.map +1 -0
  1962. package/backend-project/node_modules/sift/src/operations.ts +411 -0
  1963. package/backend-project/node_modules/sift/src/utils.d.ts +9 -0
  1964. package/backend-project/node_modules/sift/src/utils.js +70 -0
  1965. package/backend-project/node_modules/sift/src/utils.js.map +1 -0
  1966. package/backend-project/node_modules/sift/src/utils.ts +68 -0
  1967. package/backend-project/node_modules/simple-update-notifier/LICENSE +21 -0
  1968. package/backend-project/node_modules/simple-update-notifier/README.md +82 -0
  1969. package/backend-project/node_modules/simple-update-notifier/build/index.d.ts +13 -0
  1970. package/backend-project/node_modules/simple-update-notifier/build/index.js +210 -0
  1971. package/backend-project/node_modules/simple-update-notifier/package.json +100 -0
  1972. package/backend-project/node_modules/simple-update-notifier/src/borderedText.ts +12 -0
  1973. package/backend-project/node_modules/simple-update-notifier/src/cache.spec.ts +17 -0
  1974. package/backend-project/node_modules/simple-update-notifier/src/cache.ts +44 -0
  1975. package/backend-project/node_modules/simple-update-notifier/src/getDistVersion.spec.ts +35 -0
  1976. package/backend-project/node_modules/simple-update-notifier/src/getDistVersion.ts +29 -0
  1977. package/backend-project/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts +82 -0
  1978. package/backend-project/node_modules/simple-update-notifier/src/hasNewVersion.ts +40 -0
  1979. package/backend-project/node_modules/simple-update-notifier/src/index.spec.ts +27 -0
  1980. package/backend-project/node_modules/simple-update-notifier/src/index.ts +34 -0
  1981. package/backend-project/node_modules/simple-update-notifier/src/isNpmOrYarn.ts +12 -0
  1982. package/backend-project/node_modules/simple-update-notifier/src/types.ts +8 -0
  1983. package/backend-project/node_modules/smart-buffer/.prettierrc.yaml +5 -0
  1984. package/backend-project/node_modules/smart-buffer/.travis.yml +13 -0
  1985. package/backend-project/node_modules/smart-buffer/LICENSE +20 -0
  1986. package/backend-project/node_modules/smart-buffer/README.md +633 -0
  1987. package/backend-project/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
  1988. package/backend-project/node_modules/smart-buffer/build/smartbuffer.js.map +1 -0
  1989. package/backend-project/node_modules/smart-buffer/build/utils.js +108 -0
  1990. package/backend-project/node_modules/smart-buffer/build/utils.js.map +1 -0
  1991. package/backend-project/node_modules/smart-buffer/docs/CHANGELOG.md +70 -0
  1992. package/backend-project/node_modules/smart-buffer/docs/README_v3.md +367 -0
  1993. package/backend-project/node_modules/smart-buffer/docs/ROADMAP.md +0 -0
  1994. package/backend-project/node_modules/smart-buffer/package.json +79 -0
  1995. package/backend-project/node_modules/smart-buffer/typings/smartbuffer.d.ts +755 -0
  1996. package/backend-project/node_modules/smart-buffer/typings/utils.d.ts +66 -0
  1997. package/backend-project/node_modules/socks/.eslintrc.cjs +11 -0
  1998. package/backend-project/node_modules/socks/.prettierrc.yaml +7 -0
  1999. package/backend-project/node_modules/socks/LICENSE +20 -0
  2000. package/backend-project/node_modules/socks/README.md +686 -0
  2001. package/backend-project/node_modules/socks/build/client/socksclient.js +793 -0
  2002. package/backend-project/node_modules/socks/build/client/socksclient.js.map +1 -0
  2003. package/backend-project/node_modules/socks/build/common/constants.js +108 -0
  2004. package/backend-project/node_modules/socks/build/common/constants.js.map +1 -0
  2005. package/backend-project/node_modules/socks/build/common/helpers.js +167 -0
  2006. package/backend-project/node_modules/socks/build/common/helpers.js.map +1 -0
  2007. package/backend-project/node_modules/socks/build/common/receivebuffer.js +43 -0
  2008. package/backend-project/node_modules/socks/build/common/receivebuffer.js.map +1 -0
  2009. package/backend-project/node_modules/socks/build/common/util.js +25 -0
  2010. package/backend-project/node_modules/socks/build/common/util.js.map +1 -0
  2011. package/backend-project/node_modules/socks/build/index.js +18 -0
  2012. package/backend-project/node_modules/socks/build/index.js.map +1 -0
  2013. package/backend-project/node_modules/socks/docs/examples/index.md +17 -0
  2014. package/backend-project/node_modules/socks/docs/examples/javascript/associateExample.md +90 -0
  2015. package/backend-project/node_modules/socks/docs/examples/javascript/bindExample.md +83 -0
  2016. package/backend-project/node_modules/socks/docs/examples/javascript/connectExample.md +258 -0
  2017. package/backend-project/node_modules/socks/docs/examples/typescript/associateExample.md +93 -0
  2018. package/backend-project/node_modules/socks/docs/examples/typescript/bindExample.md +86 -0
  2019. package/backend-project/node_modules/socks/docs/examples/typescript/connectExample.md +265 -0
  2020. package/backend-project/node_modules/socks/docs/index.md +5 -0
  2021. package/backend-project/node_modules/socks/docs/migratingFromV1.md +86 -0
  2022. package/backend-project/node_modules/socks/package.json +58 -0
  2023. package/backend-project/node_modules/socks/typings/client/socksclient.d.ts +162 -0
  2024. package/backend-project/node_modules/socks/typings/common/constants.d.ts +151 -0
  2025. package/backend-project/node_modules/socks/typings/common/helpers.d.ts +17 -0
  2026. package/backend-project/node_modules/socks/typings/common/receivebuffer.d.ts +12 -0
  2027. package/backend-project/node_modules/socks/typings/common/util.d.ts +14 -0
  2028. package/backend-project/node_modules/socks/typings/index.d.ts +1 -0
  2029. package/backend-project/node_modules/sparse-bitfield/.travis.yml +6 -0
  2030. package/backend-project/node_modules/sparse-bitfield/LICENSE +21 -0
  2031. package/backend-project/node_modules/sparse-bitfield/README.md +62 -0
  2032. package/backend-project/node_modules/sparse-bitfield/index.js +95 -0
  2033. package/backend-project/node_modules/sparse-bitfield/package.json +27 -0
  2034. package/backend-project/node_modules/sparse-bitfield/test.js +79 -0
  2035. package/backend-project/node_modules/statuses/HISTORY.md +87 -0
  2036. package/backend-project/node_modules/statuses/LICENSE +23 -0
  2037. package/backend-project/node_modules/statuses/README.md +139 -0
  2038. package/backend-project/node_modules/statuses/codes.json +65 -0
  2039. package/backend-project/node_modules/statuses/index.js +146 -0
  2040. package/backend-project/node_modules/statuses/package.json +49 -0
  2041. package/backend-project/node_modules/supports-color/browser.js +5 -0
  2042. package/backend-project/node_modules/supports-color/index.js +131 -0
  2043. package/backend-project/node_modules/supports-color/license +9 -0
  2044. package/backend-project/node_modules/supports-color/package.json +53 -0
  2045. package/backend-project/node_modules/supports-color/readme.md +66 -0
  2046. package/backend-project/node_modules/to-regex-range/LICENSE +21 -0
  2047. package/backend-project/node_modules/to-regex-range/README.md +305 -0
  2048. package/backend-project/node_modules/to-regex-range/index.js +288 -0
  2049. package/backend-project/node_modules/to-regex-range/package.json +88 -0
  2050. package/backend-project/node_modules/toidentifier/HISTORY.md +9 -0
  2051. package/backend-project/node_modules/toidentifier/LICENSE +21 -0
  2052. package/backend-project/node_modules/toidentifier/README.md +61 -0
  2053. package/backend-project/node_modules/toidentifier/index.js +32 -0
  2054. package/backend-project/node_modules/toidentifier/package.json +38 -0
  2055. package/backend-project/node_modules/touch/LICENSE +15 -0
  2056. package/backend-project/node_modules/touch/README.md +52 -0
  2057. package/backend-project/node_modules/touch/bin/nodetouch.js +112 -0
  2058. package/backend-project/node_modules/touch/index.js +224 -0
  2059. package/backend-project/node_modules/touch/package.json +25 -0
  2060. package/backend-project/node_modules/tr46/LICENSE.md +21 -0
  2061. package/backend-project/node_modules/tr46/README.md +78 -0
  2062. package/backend-project/node_modules/tr46/index.js +298 -0
  2063. package/backend-project/node_modules/tr46/lib/mappingTable.json +1 -0
  2064. package/backend-project/node_modules/tr46/lib/regexes.js +29 -0
  2065. package/backend-project/node_modules/tr46/lib/statusMapping.js +11 -0
  2066. package/backend-project/node_modules/tr46/package.json +47 -0
  2067. package/backend-project/node_modules/type-is/HISTORY.md +259 -0
  2068. package/backend-project/node_modules/type-is/LICENSE +23 -0
  2069. package/backend-project/node_modules/type-is/README.md +170 -0
  2070. package/backend-project/node_modules/type-is/index.js +266 -0
  2071. package/backend-project/node_modules/type-is/package.json +45 -0
  2072. package/backend-project/node_modules/undefsafe/.github/workflows/release.yml +25 -0
  2073. package/backend-project/node_modules/undefsafe/.jscsrc +13 -0
  2074. package/backend-project/node_modules/undefsafe/.jshintrc +16 -0
  2075. package/backend-project/node_modules/undefsafe/.travis.yml +18 -0
  2076. package/backend-project/node_modules/undefsafe/LICENSE +22 -0
  2077. package/backend-project/node_modules/undefsafe/README.md +63 -0
  2078. package/backend-project/node_modules/undefsafe/example.js +14 -0
  2079. package/backend-project/node_modules/undefsafe/lib/undefsafe.js +125 -0
  2080. package/backend-project/node_modules/undefsafe/package.json +34 -0
  2081. package/backend-project/node_modules/undici-types/LICENSE +21 -0
  2082. package/backend-project/node_modules/undici-types/README.md +6 -0
  2083. package/backend-project/node_modules/undici-types/agent.d.ts +32 -0
  2084. package/backend-project/node_modules/undici-types/api.d.ts +43 -0
  2085. package/backend-project/node_modules/undici-types/balanced-pool.d.ts +30 -0
  2086. package/backend-project/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  2087. package/backend-project/node_modules/undici-types/cache.d.ts +36 -0
  2088. package/backend-project/node_modules/undici-types/client-stats.d.ts +15 -0
  2089. package/backend-project/node_modules/undici-types/client.d.ts +123 -0
  2090. package/backend-project/node_modules/undici-types/connector.d.ts +36 -0
  2091. package/backend-project/node_modules/undici-types/content-type.d.ts +21 -0
  2092. package/backend-project/node_modules/undici-types/cookies.d.ts +30 -0
  2093. package/backend-project/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  2094. package/backend-project/node_modules/undici-types/dispatcher.d.ts +279 -0
  2095. package/backend-project/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  2096. package/backend-project/node_modules/undici-types/errors.d.ts +177 -0
  2097. package/backend-project/node_modules/undici-types/eventsource.d.ts +66 -0
  2098. package/backend-project/node_modules/undici-types/fetch.d.ts +211 -0
  2099. package/backend-project/node_modules/undici-types/formdata.d.ts +108 -0
  2100. package/backend-project/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  2101. package/backend-project/node_modules/undici-types/global-origin.d.ts +7 -0
  2102. package/backend-project/node_modules/undici-types/h2c-client.d.ts +73 -0
  2103. package/backend-project/node_modules/undici-types/handlers.d.ts +15 -0
  2104. package/backend-project/node_modules/undici-types/header.d.ts +160 -0
  2105. package/backend-project/node_modules/undici-types/index.d.ts +91 -0
  2106. package/backend-project/node_modules/undici-types/interceptors.d.ts +80 -0
  2107. package/backend-project/node_modules/undici-types/mock-agent.d.ts +68 -0
  2108. package/backend-project/node_modules/undici-types/mock-call-history.d.ts +111 -0
  2109. package/backend-project/node_modules/undici-types/mock-client.d.ts +27 -0
  2110. package/backend-project/node_modules/undici-types/mock-errors.d.ts +12 -0
  2111. package/backend-project/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  2112. package/backend-project/node_modules/undici-types/mock-pool.d.ts +27 -0
  2113. package/backend-project/node_modules/undici-types/package.json +55 -0
  2114. package/backend-project/node_modules/undici-types/patch.d.ts +29 -0
  2115. package/backend-project/node_modules/undici-types/pool-stats.d.ts +19 -0
  2116. package/backend-project/node_modules/undici-types/pool.d.ts +41 -0
  2117. package/backend-project/node_modules/undici-types/proxy-agent.d.ts +29 -0
  2118. package/backend-project/node_modules/undici-types/readable.d.ts +68 -0
  2119. package/backend-project/node_modules/undici-types/retry-agent.d.ts +8 -0
  2120. package/backend-project/node_modules/undici-types/retry-handler.d.ts +125 -0
  2121. package/backend-project/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  2122. package/backend-project/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  2123. package/backend-project/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  2124. package/backend-project/node_modules/undici-types/util.d.ts +18 -0
  2125. package/backend-project/node_modules/undici-types/utility.d.ts +7 -0
  2126. package/backend-project/node_modules/undici-types/webidl.d.ts +347 -0
  2127. package/backend-project/node_modules/undici-types/websocket.d.ts +188 -0
  2128. package/backend-project/node_modules/unpipe/HISTORY.md +4 -0
  2129. package/backend-project/node_modules/unpipe/LICENSE +22 -0
  2130. package/backend-project/node_modules/unpipe/README.md +43 -0
  2131. package/backend-project/node_modules/unpipe/index.js +69 -0
  2132. package/backend-project/node_modules/unpipe/package.json +27 -0
  2133. package/backend-project/node_modules/utils-merge/LICENSE +20 -0
  2134. package/backend-project/node_modules/utils-merge/README.md +34 -0
  2135. package/backend-project/node_modules/utils-merge/index.js +23 -0
  2136. package/backend-project/node_modules/utils-merge/package.json +40 -0
  2137. package/backend-project/node_modules/vary/HISTORY.md +39 -0
  2138. package/backend-project/node_modules/vary/LICENSE +22 -0
  2139. package/backend-project/node_modules/vary/README.md +101 -0
  2140. package/backend-project/node_modules/vary/index.js +149 -0
  2141. package/backend-project/node_modules/vary/package.json +43 -0
  2142. package/backend-project/node_modules/webidl-conversions/LICENSE.md +12 -0
  2143. package/backend-project/node_modules/webidl-conversions/README.md +99 -0
  2144. package/backend-project/node_modules/webidl-conversions/lib/index.js +450 -0
  2145. package/backend-project/node_modules/webidl-conversions/package.json +35 -0
  2146. package/backend-project/node_modules/whatwg-url/LICENSE.txt +21 -0
  2147. package/backend-project/node_modules/whatwg-url/README.md +106 -0
  2148. package/backend-project/node_modules/whatwg-url/index.js +27 -0
  2149. package/backend-project/node_modules/whatwg-url/lib/Function.js +42 -0
  2150. package/backend-project/node_modules/whatwg-url/lib/URL-impl.js +209 -0
  2151. package/backend-project/node_modules/whatwg-url/lib/URL.js +442 -0
  2152. package/backend-project/node_modules/whatwg-url/lib/URLSearchParams-impl.js +130 -0
  2153. package/backend-project/node_modules/whatwg-url/lib/URLSearchParams.js +472 -0
  2154. package/backend-project/node_modules/whatwg-url/lib/VoidFunction.js +26 -0
  2155. package/backend-project/node_modules/whatwg-url/lib/encoding.js +16 -0
  2156. package/backend-project/node_modules/whatwg-url/lib/infra.js +26 -0
  2157. package/backend-project/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
  2158. package/backend-project/node_modules/whatwg-url/lib/url-state-machine.js +1244 -0
  2159. package/backend-project/node_modules/whatwg-url/lib/urlencoded.js +106 -0
  2160. package/backend-project/node_modules/whatwg-url/lib/utils.js +190 -0
  2161. package/backend-project/node_modules/whatwg-url/package.json +58 -0
  2162. package/backend-project/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
  2163. package/backend-project/package-lock.json +1640 -0
  2164. package/backend-project/package.json +29 -0
  2165. package/backend-project/routes/auth.js +8 -0
  2166. package/backend-project/routes/products.js +10 -0
  2167. package/backend-project/routes/reports.js +11 -0
  2168. package/backend-project/routes/transactions.js +12 -0
  2169. package/backend-project/routes/warehouses.js +10 -0
  2170. package/backend-project/server.js +49 -0
  2171. package/bin/stockhub.js +44 -0
  2172. package/frontend-project/package.json +41 -0
  2173. package/frontend-project/postcss.config.js +6 -0
  2174. package/frontend-project/public/index.html +14 -0
  2175. package/frontend-project/src/App.js +59 -0
  2176. package/frontend-project/src/components/Auth/Login.js +116 -0
  2177. package/frontend-project/src/components/Auth/Register.js +142 -0
  2178. package/frontend-project/src/components/Dashboard/Dashboard.js +183 -0
  2179. package/frontend-project/src/components/Layout/Layout.js +162 -0
  2180. package/frontend-project/src/components/Products/Products.js +253 -0
  2181. package/frontend-project/src/components/Reports/Reports.js +312 -0
  2182. package/frontend-project/src/components/Transactions/Transactions.js +310 -0
  2183. package/frontend-project/src/components/Warehouses/Warehouses.js +178 -0
  2184. package/frontend-project/src/index.css +30 -0
  2185. package/frontend-project/src/index.js +11 -0
  2186. package/frontend-project/src/services/api.js +76 -0
  2187. package/frontend-project/tailwind.config.js +19 -0
  2188. package/package.json +49 -0
  2189. package/setup.js +157 -0
@@ -0,0 +1,4149 @@
1
+ var BSON = (function (exports) {
2
+ 'use strict';
3
+
4
+ function isAnyArrayBuffer(value) {
5
+ return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value));
6
+ }
7
+ function isUint8Array(value) {
8
+ return Object.prototype.toString.call(value) === '[object Uint8Array]';
9
+ }
10
+ function isRegExp(d) {
11
+ return Object.prototype.toString.call(d) === '[object RegExp]';
12
+ }
13
+ function isMap(d) {
14
+ return Object.prototype.toString.call(d) === '[object Map]';
15
+ }
16
+ function isDate(d) {
17
+ return Object.prototype.toString.call(d) === '[object Date]';
18
+ }
19
+
20
+ const BSON_MAJOR_VERSION = 5;
21
+ const BSON_INT32_MAX = 0x7fffffff;
22
+ const BSON_INT32_MIN = -0x80000000;
23
+ const BSON_INT64_MAX = Math.pow(2, 63) - 1;
24
+ const BSON_INT64_MIN = -Math.pow(2, 63);
25
+ const JS_INT_MAX = Math.pow(2, 53);
26
+ const JS_INT_MIN = -Math.pow(2, 53);
27
+ const BSON_DATA_NUMBER = 1;
28
+ const BSON_DATA_STRING = 2;
29
+ const BSON_DATA_OBJECT = 3;
30
+ const BSON_DATA_ARRAY = 4;
31
+ const BSON_DATA_BINARY = 5;
32
+ const BSON_DATA_UNDEFINED = 6;
33
+ const BSON_DATA_OID = 7;
34
+ const BSON_DATA_BOOLEAN = 8;
35
+ const BSON_DATA_DATE = 9;
36
+ const BSON_DATA_NULL = 10;
37
+ const BSON_DATA_REGEXP = 11;
38
+ const BSON_DATA_DBPOINTER = 12;
39
+ const BSON_DATA_CODE = 13;
40
+ const BSON_DATA_SYMBOL = 14;
41
+ const BSON_DATA_CODE_W_SCOPE = 15;
42
+ const BSON_DATA_INT = 16;
43
+ const BSON_DATA_TIMESTAMP = 17;
44
+ const BSON_DATA_LONG = 18;
45
+ const BSON_DATA_DECIMAL128 = 19;
46
+ const BSON_DATA_MIN_KEY = 0xff;
47
+ const BSON_DATA_MAX_KEY = 0x7f;
48
+ const BSON_BINARY_SUBTYPE_DEFAULT = 0;
49
+ const BSON_BINARY_SUBTYPE_UUID_NEW = 4;
50
+ const BSONType = Object.freeze({
51
+ double: 1,
52
+ string: 2,
53
+ object: 3,
54
+ array: 4,
55
+ binData: 5,
56
+ undefined: 6,
57
+ objectId: 7,
58
+ bool: 8,
59
+ date: 9,
60
+ null: 10,
61
+ regex: 11,
62
+ dbPointer: 12,
63
+ javascript: 13,
64
+ symbol: 14,
65
+ javascriptWithScope: 15,
66
+ int: 16,
67
+ timestamp: 17,
68
+ long: 18,
69
+ decimal: 19,
70
+ minKey: -1,
71
+ maxKey: 127
72
+ });
73
+
74
+ class BSONError extends Error {
75
+ get bsonError() {
76
+ return true;
77
+ }
78
+ get name() {
79
+ return 'BSONError';
80
+ }
81
+ constructor(message) {
82
+ super(message);
83
+ }
84
+ static isBSONError(value) {
85
+ return (value != null &&
86
+ typeof value === 'object' &&
87
+ 'bsonError' in value &&
88
+ value.bsonError === true &&
89
+ 'name' in value &&
90
+ 'message' in value &&
91
+ 'stack' in value);
92
+ }
93
+ }
94
+ class BSONVersionError extends BSONError {
95
+ get name() {
96
+ return 'BSONVersionError';
97
+ }
98
+ constructor() {
99
+ super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`);
100
+ }
101
+ }
102
+ class BSONRuntimeError extends BSONError {
103
+ get name() {
104
+ return 'BSONRuntimeError';
105
+ }
106
+ constructor(message) {
107
+ super(message);
108
+ }
109
+ }
110
+
111
+ function nodejsMathRandomBytes(byteLength) {
112
+ return nodeJsByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256)));
113
+ }
114
+ const nodejsRandomBytes = (() => {
115
+ try {
116
+ return require('crypto').randomBytes;
117
+ }
118
+ catch {
119
+ return nodejsMathRandomBytes;
120
+ }
121
+ })();
122
+ const nodeJsByteUtils = {
123
+ toLocalBufferType(potentialBuffer) {
124
+ if (Buffer.isBuffer(potentialBuffer)) {
125
+ return potentialBuffer;
126
+ }
127
+ if (ArrayBuffer.isView(potentialBuffer)) {
128
+ return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength);
129
+ }
130
+ const stringTag = potentialBuffer?.[Symbol.toStringTag] ?? Object.prototype.toString.call(potentialBuffer);
131
+ if (stringTag === 'ArrayBuffer' ||
132
+ stringTag === 'SharedArrayBuffer' ||
133
+ stringTag === '[object ArrayBuffer]' ||
134
+ stringTag === '[object SharedArrayBuffer]') {
135
+ return Buffer.from(potentialBuffer);
136
+ }
137
+ throw new BSONError(`Cannot create Buffer from ${String(potentialBuffer)}`);
138
+ },
139
+ allocate(size) {
140
+ return Buffer.alloc(size);
141
+ },
142
+ equals(a, b) {
143
+ return nodeJsByteUtils.toLocalBufferType(a).equals(b);
144
+ },
145
+ fromNumberArray(array) {
146
+ return Buffer.from(array);
147
+ },
148
+ fromBase64(base64) {
149
+ return Buffer.from(base64, 'base64');
150
+ },
151
+ toBase64(buffer) {
152
+ return nodeJsByteUtils.toLocalBufferType(buffer).toString('base64');
153
+ },
154
+ fromISO88591(codePoints) {
155
+ return Buffer.from(codePoints, 'binary');
156
+ },
157
+ toISO88591(buffer) {
158
+ return nodeJsByteUtils.toLocalBufferType(buffer).toString('binary');
159
+ },
160
+ fromHex(hex) {
161
+ return Buffer.from(hex, 'hex');
162
+ },
163
+ toHex(buffer) {
164
+ return nodeJsByteUtils.toLocalBufferType(buffer).toString('hex');
165
+ },
166
+ fromUTF8(text) {
167
+ return Buffer.from(text, 'utf8');
168
+ },
169
+ toUTF8(buffer, start, end) {
170
+ return nodeJsByteUtils.toLocalBufferType(buffer).toString('utf8', start, end);
171
+ },
172
+ utf8ByteLength(input) {
173
+ return Buffer.byteLength(input, 'utf8');
174
+ },
175
+ encodeUTF8Into(buffer, source, byteOffset) {
176
+ return nodeJsByteUtils.toLocalBufferType(buffer).write(source, byteOffset, undefined, 'utf8');
177
+ },
178
+ randomBytes: nodejsRandomBytes
179
+ };
180
+
181
+ function isReactNative() {
182
+ const { navigator } = globalThis;
183
+ return typeof navigator === 'object' && navigator.product === 'ReactNative';
184
+ }
185
+ function webMathRandomBytes(byteLength) {
186
+ if (byteLength < 0) {
187
+ throw new RangeError(`The argument 'byteLength' is invalid. Received ${byteLength}`);
188
+ }
189
+ return webByteUtils.fromNumberArray(Array.from({ length: byteLength }, () => Math.floor(Math.random() * 256)));
190
+ }
191
+ const webRandomBytes = (() => {
192
+ const { crypto } = globalThis;
193
+ if (crypto != null && typeof crypto.getRandomValues === 'function') {
194
+ return (byteLength) => {
195
+ return crypto.getRandomValues(webByteUtils.allocate(byteLength));
196
+ };
197
+ }
198
+ else {
199
+ if (isReactNative()) {
200
+ const { console } = globalThis;
201
+ console?.warn?.('BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.');
202
+ }
203
+ return webMathRandomBytes;
204
+ }
205
+ })();
206
+ const HEX_DIGIT = /(\d|[a-f])/i;
207
+ const webByteUtils = {
208
+ toLocalBufferType(potentialUint8array) {
209
+ const stringTag = potentialUint8array?.[Symbol.toStringTag] ??
210
+ Object.prototype.toString.call(potentialUint8array);
211
+ if (stringTag === 'Uint8Array') {
212
+ return potentialUint8array;
213
+ }
214
+ if (ArrayBuffer.isView(potentialUint8array)) {
215
+ return new Uint8Array(potentialUint8array.buffer.slice(potentialUint8array.byteOffset, potentialUint8array.byteOffset + potentialUint8array.byteLength));
216
+ }
217
+ if (stringTag === 'ArrayBuffer' ||
218
+ stringTag === 'SharedArrayBuffer' ||
219
+ stringTag === '[object ArrayBuffer]' ||
220
+ stringTag === '[object SharedArrayBuffer]') {
221
+ return new Uint8Array(potentialUint8array);
222
+ }
223
+ throw new BSONError(`Cannot make a Uint8Array from ${String(potentialUint8array)}`);
224
+ },
225
+ allocate(size) {
226
+ if (typeof size !== 'number') {
227
+ throw new TypeError(`The "size" argument must be of type number. Received ${String(size)}`);
228
+ }
229
+ return new Uint8Array(size);
230
+ },
231
+ equals(a, b) {
232
+ if (a.byteLength !== b.byteLength) {
233
+ return false;
234
+ }
235
+ for (let i = 0; i < a.byteLength; i++) {
236
+ if (a[i] !== b[i]) {
237
+ return false;
238
+ }
239
+ }
240
+ return true;
241
+ },
242
+ fromNumberArray(array) {
243
+ return Uint8Array.from(array);
244
+ },
245
+ fromBase64(base64) {
246
+ return Uint8Array.from(atob(base64), c => c.charCodeAt(0));
247
+ },
248
+ toBase64(uint8array) {
249
+ return btoa(webByteUtils.toISO88591(uint8array));
250
+ },
251
+ fromISO88591(codePoints) {
252
+ return Uint8Array.from(codePoints, c => c.charCodeAt(0) & 0xff);
253
+ },
254
+ toISO88591(uint8array) {
255
+ return Array.from(Uint16Array.from(uint8array), b => String.fromCharCode(b)).join('');
256
+ },
257
+ fromHex(hex) {
258
+ const evenLengthHex = hex.length % 2 === 0 ? hex : hex.slice(0, hex.length - 1);
259
+ const buffer = [];
260
+ for (let i = 0; i < evenLengthHex.length; i += 2) {
261
+ const firstDigit = evenLengthHex[i];
262
+ const secondDigit = evenLengthHex[i + 1];
263
+ if (!HEX_DIGIT.test(firstDigit)) {
264
+ break;
265
+ }
266
+ if (!HEX_DIGIT.test(secondDigit)) {
267
+ break;
268
+ }
269
+ const hexDigit = Number.parseInt(`${firstDigit}${secondDigit}`, 16);
270
+ buffer.push(hexDigit);
271
+ }
272
+ return Uint8Array.from(buffer);
273
+ },
274
+ toHex(uint8array) {
275
+ return Array.from(uint8array, byte => byte.toString(16).padStart(2, '0')).join('');
276
+ },
277
+ fromUTF8(text) {
278
+ return new TextEncoder().encode(text);
279
+ },
280
+ toUTF8(uint8array, start, end) {
281
+ return new TextDecoder('utf8', { fatal: false }).decode(uint8array.slice(start, end));
282
+ },
283
+ utf8ByteLength(input) {
284
+ return webByteUtils.fromUTF8(input).byteLength;
285
+ },
286
+ encodeUTF8Into(buffer, source, byteOffset) {
287
+ const bytes = webByteUtils.fromUTF8(source);
288
+ buffer.set(bytes, byteOffset);
289
+ return bytes.byteLength;
290
+ },
291
+ randomBytes: webRandomBytes
292
+ };
293
+
294
+ const hasGlobalBuffer = typeof Buffer === 'function' && Buffer.prototype?._isBuffer !== true;
295
+ const ByteUtils = hasGlobalBuffer ? nodeJsByteUtils : webByteUtils;
296
+ class BSONDataView extends DataView {
297
+ static fromUint8Array(input) {
298
+ return new DataView(input.buffer, input.byteOffset, input.byteLength);
299
+ }
300
+ }
301
+
302
+ class BSONValue {
303
+ get [Symbol.for('@@mdb.bson.version')]() {
304
+ return BSON_MAJOR_VERSION;
305
+ }
306
+ }
307
+
308
+ class Binary extends BSONValue {
309
+ get _bsontype() {
310
+ return 'Binary';
311
+ }
312
+ constructor(buffer, subType) {
313
+ super();
314
+ if (!(buffer == null) &&
315
+ !(typeof buffer === 'string') &&
316
+ !ArrayBuffer.isView(buffer) &&
317
+ !(buffer instanceof ArrayBuffer) &&
318
+ !Array.isArray(buffer)) {
319
+ throw new BSONError('Binary can only be constructed from string, Buffer, TypedArray, or Array<number>');
320
+ }
321
+ this.sub_type = subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT;
322
+ if (buffer == null) {
323
+ this.buffer = ByteUtils.allocate(Binary.BUFFER_SIZE);
324
+ this.position = 0;
325
+ }
326
+ else {
327
+ if (typeof buffer === 'string') {
328
+ this.buffer = ByteUtils.fromISO88591(buffer);
329
+ }
330
+ else if (Array.isArray(buffer)) {
331
+ this.buffer = ByteUtils.fromNumberArray(buffer);
332
+ }
333
+ else {
334
+ this.buffer = ByteUtils.toLocalBufferType(buffer);
335
+ }
336
+ this.position = this.buffer.byteLength;
337
+ }
338
+ }
339
+ put(byteValue) {
340
+ if (typeof byteValue === 'string' && byteValue.length !== 1) {
341
+ throw new BSONError('only accepts single character String');
342
+ }
343
+ else if (typeof byteValue !== 'number' && byteValue.length !== 1)
344
+ throw new BSONError('only accepts single character Uint8Array or Array');
345
+ let decodedByte;
346
+ if (typeof byteValue === 'string') {
347
+ decodedByte = byteValue.charCodeAt(0);
348
+ }
349
+ else if (typeof byteValue === 'number') {
350
+ decodedByte = byteValue;
351
+ }
352
+ else {
353
+ decodedByte = byteValue[0];
354
+ }
355
+ if (decodedByte < 0 || decodedByte > 255) {
356
+ throw new BSONError('only accepts number in a valid unsigned byte range 0-255');
357
+ }
358
+ if (this.buffer.byteLength > this.position) {
359
+ this.buffer[this.position++] = decodedByte;
360
+ }
361
+ else {
362
+ const newSpace = ByteUtils.allocate(Binary.BUFFER_SIZE + this.buffer.length);
363
+ newSpace.set(this.buffer, 0);
364
+ this.buffer = newSpace;
365
+ this.buffer[this.position++] = decodedByte;
366
+ }
367
+ }
368
+ write(sequence, offset) {
369
+ offset = typeof offset === 'number' ? offset : this.position;
370
+ if (this.buffer.byteLength < offset + sequence.length) {
371
+ const newSpace = ByteUtils.allocate(this.buffer.byteLength + sequence.length);
372
+ newSpace.set(this.buffer, 0);
373
+ this.buffer = newSpace;
374
+ }
375
+ if (ArrayBuffer.isView(sequence)) {
376
+ this.buffer.set(ByteUtils.toLocalBufferType(sequence), offset);
377
+ this.position =
378
+ offset + sequence.byteLength > this.position ? offset + sequence.length : this.position;
379
+ }
380
+ else if (typeof sequence === 'string') {
381
+ const bytes = ByteUtils.fromISO88591(sequence);
382
+ this.buffer.set(bytes, offset);
383
+ this.position =
384
+ offset + sequence.length > this.position ? offset + sequence.length : this.position;
385
+ }
386
+ }
387
+ read(position, length) {
388
+ length = length && length > 0 ? length : this.position;
389
+ return this.buffer.slice(position, position + length);
390
+ }
391
+ value(asRaw) {
392
+ asRaw = !!asRaw;
393
+ if (asRaw && this.buffer.length === this.position) {
394
+ return this.buffer;
395
+ }
396
+ if (asRaw) {
397
+ return this.buffer.slice(0, this.position);
398
+ }
399
+ return ByteUtils.toISO88591(this.buffer.subarray(0, this.position));
400
+ }
401
+ length() {
402
+ return this.position;
403
+ }
404
+ toJSON() {
405
+ return ByteUtils.toBase64(this.buffer);
406
+ }
407
+ toString(encoding) {
408
+ if (encoding === 'hex')
409
+ return ByteUtils.toHex(this.buffer);
410
+ if (encoding === 'base64')
411
+ return ByteUtils.toBase64(this.buffer);
412
+ if (encoding === 'utf8' || encoding === 'utf-8')
413
+ return ByteUtils.toUTF8(this.buffer, 0, this.buffer.byteLength);
414
+ return ByteUtils.toUTF8(this.buffer, 0, this.buffer.byteLength);
415
+ }
416
+ toExtendedJSON(options) {
417
+ options = options || {};
418
+ const base64String = ByteUtils.toBase64(this.buffer);
419
+ const subType = Number(this.sub_type).toString(16);
420
+ if (options.legacy) {
421
+ return {
422
+ $binary: base64String,
423
+ $type: subType.length === 1 ? '0' + subType : subType
424
+ };
425
+ }
426
+ return {
427
+ $binary: {
428
+ base64: base64String,
429
+ subType: subType.length === 1 ? '0' + subType : subType
430
+ }
431
+ };
432
+ }
433
+ toUUID() {
434
+ if (this.sub_type === Binary.SUBTYPE_UUID) {
435
+ return new UUID(this.buffer.slice(0, this.position));
436
+ }
437
+ throw new BSONError(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${Binary.SUBTYPE_UUID}" is currently supported.`);
438
+ }
439
+ static createFromHexString(hex, subType) {
440
+ return new Binary(ByteUtils.fromHex(hex), subType);
441
+ }
442
+ static createFromBase64(base64, subType) {
443
+ return new Binary(ByteUtils.fromBase64(base64), subType);
444
+ }
445
+ static fromExtendedJSON(doc, options) {
446
+ options = options || {};
447
+ let data;
448
+ let type;
449
+ if ('$binary' in doc) {
450
+ if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) {
451
+ type = doc.$type ? parseInt(doc.$type, 16) : 0;
452
+ data = ByteUtils.fromBase64(doc.$binary);
453
+ }
454
+ else {
455
+ if (typeof doc.$binary !== 'string') {
456
+ type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0;
457
+ data = ByteUtils.fromBase64(doc.$binary.base64);
458
+ }
459
+ }
460
+ }
461
+ else if ('$uuid' in doc) {
462
+ type = 4;
463
+ data = UUID.bytesFromString(doc.$uuid);
464
+ }
465
+ if (!data) {
466
+ throw new BSONError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`);
467
+ }
468
+ return type === BSON_BINARY_SUBTYPE_UUID_NEW ? new UUID(data) : new Binary(data, type);
469
+ }
470
+ [Symbol.for('nodejs.util.inspect.custom')]() {
471
+ return this.inspect();
472
+ }
473
+ inspect() {
474
+ const base64 = ByteUtils.toBase64(this.buffer.subarray(0, this.position));
475
+ return `Binary.createFromBase64("${base64}", ${this.sub_type})`;
476
+ }
477
+ }
478
+ Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0;
479
+ Binary.BUFFER_SIZE = 256;
480
+ Binary.SUBTYPE_DEFAULT = 0;
481
+ Binary.SUBTYPE_FUNCTION = 1;
482
+ Binary.SUBTYPE_BYTE_ARRAY = 2;
483
+ Binary.SUBTYPE_UUID_OLD = 3;
484
+ Binary.SUBTYPE_UUID = 4;
485
+ Binary.SUBTYPE_MD5 = 5;
486
+ Binary.SUBTYPE_ENCRYPTED = 6;
487
+ Binary.SUBTYPE_COLUMN = 7;
488
+ Binary.SUBTYPE_USER_DEFINED = 128;
489
+ const UUID_BYTE_LENGTH = 16;
490
+ const UUID_WITHOUT_DASHES = /^[0-9A-F]{32}$/i;
491
+ const UUID_WITH_DASHES = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;
492
+ class UUID extends Binary {
493
+ constructor(input) {
494
+ let bytes;
495
+ if (input == null) {
496
+ bytes = UUID.generate();
497
+ }
498
+ else if (input instanceof UUID) {
499
+ bytes = ByteUtils.toLocalBufferType(new Uint8Array(input.buffer));
500
+ }
501
+ else if (ArrayBuffer.isView(input) && input.byteLength === UUID_BYTE_LENGTH) {
502
+ bytes = ByteUtils.toLocalBufferType(input);
503
+ }
504
+ else if (typeof input === 'string') {
505
+ bytes = UUID.bytesFromString(input);
506
+ }
507
+ else {
508
+ throw new BSONError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).');
509
+ }
510
+ super(bytes, BSON_BINARY_SUBTYPE_UUID_NEW);
511
+ }
512
+ get id() {
513
+ return this.buffer;
514
+ }
515
+ set id(value) {
516
+ this.buffer = value;
517
+ }
518
+ toHexString(includeDashes = true) {
519
+ if (includeDashes) {
520
+ return [
521
+ ByteUtils.toHex(this.buffer.subarray(0, 4)),
522
+ ByteUtils.toHex(this.buffer.subarray(4, 6)),
523
+ ByteUtils.toHex(this.buffer.subarray(6, 8)),
524
+ ByteUtils.toHex(this.buffer.subarray(8, 10)),
525
+ ByteUtils.toHex(this.buffer.subarray(10, 16))
526
+ ].join('-');
527
+ }
528
+ return ByteUtils.toHex(this.buffer);
529
+ }
530
+ toString(encoding) {
531
+ if (encoding === 'hex')
532
+ return ByteUtils.toHex(this.id);
533
+ if (encoding === 'base64')
534
+ return ByteUtils.toBase64(this.id);
535
+ return this.toHexString();
536
+ }
537
+ toJSON() {
538
+ return this.toHexString();
539
+ }
540
+ equals(otherId) {
541
+ if (!otherId) {
542
+ return false;
543
+ }
544
+ if (otherId instanceof UUID) {
545
+ return ByteUtils.equals(otherId.id, this.id);
546
+ }
547
+ try {
548
+ return ByteUtils.equals(new UUID(otherId).id, this.id);
549
+ }
550
+ catch {
551
+ return false;
552
+ }
553
+ }
554
+ toBinary() {
555
+ return new Binary(this.id, Binary.SUBTYPE_UUID);
556
+ }
557
+ static generate() {
558
+ const bytes = ByteUtils.randomBytes(UUID_BYTE_LENGTH);
559
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
560
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
561
+ return bytes;
562
+ }
563
+ static isValid(input) {
564
+ if (!input) {
565
+ return false;
566
+ }
567
+ if (typeof input === 'string') {
568
+ return UUID.isValidUUIDString(input);
569
+ }
570
+ if (isUint8Array(input)) {
571
+ return input.byteLength === UUID_BYTE_LENGTH;
572
+ }
573
+ return (input._bsontype === 'Binary' &&
574
+ input.sub_type === this.SUBTYPE_UUID &&
575
+ input.buffer.byteLength === 16);
576
+ }
577
+ static createFromHexString(hexString) {
578
+ const buffer = UUID.bytesFromString(hexString);
579
+ return new UUID(buffer);
580
+ }
581
+ static createFromBase64(base64) {
582
+ return new UUID(ByteUtils.fromBase64(base64));
583
+ }
584
+ static bytesFromString(representation) {
585
+ if (!UUID.isValidUUIDString(representation)) {
586
+ throw new BSONError('UUID string representation must be 32 hex digits or canonical hyphenated representation');
587
+ }
588
+ return ByteUtils.fromHex(representation.replace(/-/g, ''));
589
+ }
590
+ static isValidUUIDString(representation) {
591
+ return UUID_WITHOUT_DASHES.test(representation) || UUID_WITH_DASHES.test(representation);
592
+ }
593
+ [Symbol.for('nodejs.util.inspect.custom')]() {
594
+ return this.inspect();
595
+ }
596
+ inspect() {
597
+ return `new UUID("${this.toHexString()}")`;
598
+ }
599
+ }
600
+ UUID.cacheHexString = false;
601
+
602
+ class Code extends BSONValue {
603
+ get _bsontype() {
604
+ return 'Code';
605
+ }
606
+ constructor(code, scope) {
607
+ super();
608
+ this.code = code.toString();
609
+ this.scope = scope ?? null;
610
+ }
611
+ toJSON() {
612
+ if (this.scope != null) {
613
+ return { code: this.code, scope: this.scope };
614
+ }
615
+ return { code: this.code };
616
+ }
617
+ toExtendedJSON() {
618
+ if (this.scope) {
619
+ return { $code: this.code, $scope: this.scope };
620
+ }
621
+ return { $code: this.code };
622
+ }
623
+ static fromExtendedJSON(doc) {
624
+ return new Code(doc.$code, doc.$scope);
625
+ }
626
+ [Symbol.for('nodejs.util.inspect.custom')]() {
627
+ return this.inspect();
628
+ }
629
+ inspect() {
630
+ const codeJson = this.toJSON();
631
+ return `new Code("${String(codeJson.code)}"${codeJson.scope != null ? `, ${JSON.stringify(codeJson.scope)}` : ''})`;
632
+ }
633
+ }
634
+
635
+ function isDBRefLike(value) {
636
+ return (value != null &&
637
+ typeof value === 'object' &&
638
+ '$id' in value &&
639
+ value.$id != null &&
640
+ '$ref' in value &&
641
+ typeof value.$ref === 'string' &&
642
+ (!('$db' in value) || ('$db' in value && typeof value.$db === 'string')));
643
+ }
644
+ class DBRef extends BSONValue {
645
+ get _bsontype() {
646
+ return 'DBRef';
647
+ }
648
+ constructor(collection, oid, db, fields) {
649
+ super();
650
+ const parts = collection.split('.');
651
+ if (parts.length === 2) {
652
+ db = parts.shift();
653
+ collection = parts.shift();
654
+ }
655
+ this.collection = collection;
656
+ this.oid = oid;
657
+ this.db = db;
658
+ this.fields = fields || {};
659
+ }
660
+ get namespace() {
661
+ return this.collection;
662
+ }
663
+ set namespace(value) {
664
+ this.collection = value;
665
+ }
666
+ toJSON() {
667
+ const o = Object.assign({
668
+ $ref: this.collection,
669
+ $id: this.oid
670
+ }, this.fields);
671
+ if (this.db != null)
672
+ o.$db = this.db;
673
+ return o;
674
+ }
675
+ toExtendedJSON(options) {
676
+ options = options || {};
677
+ let o = {
678
+ $ref: this.collection,
679
+ $id: this.oid
680
+ };
681
+ if (options.legacy) {
682
+ return o;
683
+ }
684
+ if (this.db)
685
+ o.$db = this.db;
686
+ o = Object.assign(o, this.fields);
687
+ return o;
688
+ }
689
+ static fromExtendedJSON(doc) {
690
+ const copy = Object.assign({}, doc);
691
+ delete copy.$ref;
692
+ delete copy.$id;
693
+ delete copy.$db;
694
+ return new DBRef(doc.$ref, doc.$id, doc.$db, copy);
695
+ }
696
+ [Symbol.for('nodejs.util.inspect.custom')]() {
697
+ return this.inspect();
698
+ }
699
+ inspect() {
700
+ const oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString();
701
+ return `new DBRef("${this.namespace}", new ObjectId("${String(oid)}")${this.db ? `, "${this.db}"` : ''})`;
702
+ }
703
+ }
704
+
705
+ let wasm = undefined;
706
+ try {
707
+ wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports;
708
+ }
709
+ catch {
710
+ }
711
+ const TWO_PWR_16_DBL = 1 << 16;
712
+ const TWO_PWR_24_DBL = 1 << 24;
713
+ const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
714
+ const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;
715
+ const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;
716
+ const INT_CACHE = {};
717
+ const UINT_CACHE = {};
718
+ const MAX_INT64_STRING_LENGTH = 20;
719
+ const DECIMAL_REG_EX = /^(\+?0|(\+|-)?[1-9][0-9]*)$/;
720
+ class Long extends BSONValue {
721
+ get _bsontype() {
722
+ return 'Long';
723
+ }
724
+ get __isLong__() {
725
+ return true;
726
+ }
727
+ constructor(low = 0, high, unsigned) {
728
+ super();
729
+ if (typeof low === 'bigint') {
730
+ Object.assign(this, Long.fromBigInt(low, !!high));
731
+ }
732
+ else if (typeof low === 'string') {
733
+ Object.assign(this, Long.fromString(low, !!high));
734
+ }
735
+ else {
736
+ this.low = low | 0;
737
+ this.high = high | 0;
738
+ this.unsigned = !!unsigned;
739
+ }
740
+ }
741
+ static fromBits(lowBits, highBits, unsigned) {
742
+ return new Long(lowBits, highBits, unsigned);
743
+ }
744
+ static fromInt(value, unsigned) {
745
+ let obj, cachedObj, cache;
746
+ if (unsigned) {
747
+ value >>>= 0;
748
+ if ((cache = 0 <= value && value < 256)) {
749
+ cachedObj = UINT_CACHE[value];
750
+ if (cachedObj)
751
+ return cachedObj;
752
+ }
753
+ obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true);
754
+ if (cache)
755
+ UINT_CACHE[value] = obj;
756
+ return obj;
757
+ }
758
+ else {
759
+ value |= 0;
760
+ if ((cache = -128 <= value && value < 128)) {
761
+ cachedObj = INT_CACHE[value];
762
+ if (cachedObj)
763
+ return cachedObj;
764
+ }
765
+ obj = Long.fromBits(value, value < 0 ? -1 : 0, false);
766
+ if (cache)
767
+ INT_CACHE[value] = obj;
768
+ return obj;
769
+ }
770
+ }
771
+ static fromNumber(value, unsigned) {
772
+ if (isNaN(value))
773
+ return unsigned ? Long.UZERO : Long.ZERO;
774
+ if (unsigned) {
775
+ if (value < 0)
776
+ return Long.UZERO;
777
+ if (value >= TWO_PWR_64_DBL)
778
+ return Long.MAX_UNSIGNED_VALUE;
779
+ }
780
+ else {
781
+ if (value <= -TWO_PWR_63_DBL)
782
+ return Long.MIN_VALUE;
783
+ if (value + 1 >= TWO_PWR_63_DBL)
784
+ return Long.MAX_VALUE;
785
+ }
786
+ if (value < 0)
787
+ return Long.fromNumber(-value, unsigned).neg();
788
+ return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);
789
+ }
790
+ static fromBigInt(value, unsigned) {
791
+ return Long.fromString(value.toString(), unsigned);
792
+ }
793
+ static fromString(str, unsigned, radix) {
794
+ if (str.length === 0)
795
+ throw new BSONError('empty string');
796
+ if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity')
797
+ return Long.ZERO;
798
+ if (typeof unsigned === 'number') {
799
+ (radix = unsigned), (unsigned = false);
800
+ }
801
+ else {
802
+ unsigned = !!unsigned;
803
+ }
804
+ radix = radix || 10;
805
+ if (radix < 2 || 36 < radix)
806
+ throw new BSONError('radix');
807
+ let p;
808
+ if ((p = str.indexOf('-')) > 0)
809
+ throw new BSONError('interior hyphen');
810
+ else if (p === 0) {
811
+ return Long.fromString(str.substring(1), unsigned, radix).neg();
812
+ }
813
+ const radixToPower = Long.fromNumber(Math.pow(radix, 8));
814
+ let result = Long.ZERO;
815
+ for (let i = 0; i < str.length; i += 8) {
816
+ const size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix);
817
+ if (size < 8) {
818
+ const power = Long.fromNumber(Math.pow(radix, size));
819
+ result = result.mul(power).add(Long.fromNumber(value));
820
+ }
821
+ else {
822
+ result = result.mul(radixToPower);
823
+ result = result.add(Long.fromNumber(value));
824
+ }
825
+ }
826
+ result.unsigned = unsigned;
827
+ return result;
828
+ }
829
+ static fromBytes(bytes, unsigned, le) {
830
+ return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);
831
+ }
832
+ static fromBytesLE(bytes, unsigned) {
833
+ return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned);
834
+ }
835
+ static fromBytesBE(bytes, unsigned) {
836
+ return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned);
837
+ }
838
+ static isLong(value) {
839
+ return (value != null &&
840
+ typeof value === 'object' &&
841
+ '__isLong__' in value &&
842
+ value.__isLong__ === true);
843
+ }
844
+ static fromValue(val, unsigned) {
845
+ if (typeof val === 'number')
846
+ return Long.fromNumber(val, unsigned);
847
+ if (typeof val === 'string')
848
+ return Long.fromString(val, unsigned);
849
+ return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);
850
+ }
851
+ add(addend) {
852
+ if (!Long.isLong(addend))
853
+ addend = Long.fromValue(addend);
854
+ const a48 = this.high >>> 16;
855
+ const a32 = this.high & 0xffff;
856
+ const a16 = this.low >>> 16;
857
+ const a00 = this.low & 0xffff;
858
+ const b48 = addend.high >>> 16;
859
+ const b32 = addend.high & 0xffff;
860
+ const b16 = addend.low >>> 16;
861
+ const b00 = addend.low & 0xffff;
862
+ let c48 = 0, c32 = 0, c16 = 0, c00 = 0;
863
+ c00 += a00 + b00;
864
+ c16 += c00 >>> 16;
865
+ c00 &= 0xffff;
866
+ c16 += a16 + b16;
867
+ c32 += c16 >>> 16;
868
+ c16 &= 0xffff;
869
+ c32 += a32 + b32;
870
+ c48 += c32 >>> 16;
871
+ c32 &= 0xffff;
872
+ c48 += a48 + b48;
873
+ c48 &= 0xffff;
874
+ return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
875
+ }
876
+ and(other) {
877
+ if (!Long.isLong(other))
878
+ other = Long.fromValue(other);
879
+ return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned);
880
+ }
881
+ compare(other) {
882
+ if (!Long.isLong(other))
883
+ other = Long.fromValue(other);
884
+ if (this.eq(other))
885
+ return 0;
886
+ const thisNeg = this.isNegative(), otherNeg = other.isNegative();
887
+ if (thisNeg && !otherNeg)
888
+ return -1;
889
+ if (!thisNeg && otherNeg)
890
+ return 1;
891
+ if (!this.unsigned)
892
+ return this.sub(other).isNegative() ? -1 : 1;
893
+ return other.high >>> 0 > this.high >>> 0 ||
894
+ (other.high === this.high && other.low >>> 0 > this.low >>> 0)
895
+ ? -1
896
+ : 1;
897
+ }
898
+ comp(other) {
899
+ return this.compare(other);
900
+ }
901
+ divide(divisor) {
902
+ if (!Long.isLong(divisor))
903
+ divisor = Long.fromValue(divisor);
904
+ if (divisor.isZero())
905
+ throw new BSONError('division by zero');
906
+ if (wasm) {
907
+ if (!this.unsigned &&
908
+ this.high === -0x80000000 &&
909
+ divisor.low === -1 &&
910
+ divisor.high === -1) {
911
+ return this;
912
+ }
913
+ const low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high);
914
+ return Long.fromBits(low, wasm.get_high(), this.unsigned);
915
+ }
916
+ if (this.isZero())
917
+ return this.unsigned ? Long.UZERO : Long.ZERO;
918
+ let approx, rem, res;
919
+ if (!this.unsigned) {
920
+ if (this.eq(Long.MIN_VALUE)) {
921
+ if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE))
922
+ return Long.MIN_VALUE;
923
+ else if (divisor.eq(Long.MIN_VALUE))
924
+ return Long.ONE;
925
+ else {
926
+ const halfThis = this.shr(1);
927
+ approx = halfThis.div(divisor).shl(1);
928
+ if (approx.eq(Long.ZERO)) {
929
+ return divisor.isNegative() ? Long.ONE : Long.NEG_ONE;
930
+ }
931
+ else {
932
+ rem = this.sub(divisor.mul(approx));
933
+ res = approx.add(rem.div(divisor));
934
+ return res;
935
+ }
936
+ }
937
+ }
938
+ else if (divisor.eq(Long.MIN_VALUE))
939
+ return this.unsigned ? Long.UZERO : Long.ZERO;
940
+ if (this.isNegative()) {
941
+ if (divisor.isNegative())
942
+ return this.neg().div(divisor.neg());
943
+ return this.neg().div(divisor).neg();
944
+ }
945
+ else if (divisor.isNegative())
946
+ return this.div(divisor.neg()).neg();
947
+ res = Long.ZERO;
948
+ }
949
+ else {
950
+ if (!divisor.unsigned)
951
+ divisor = divisor.toUnsigned();
952
+ if (divisor.gt(this))
953
+ return Long.UZERO;
954
+ if (divisor.gt(this.shru(1)))
955
+ return Long.UONE;
956
+ res = Long.UZERO;
957
+ }
958
+ rem = this;
959
+ while (rem.gte(divisor)) {
960
+ approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));
961
+ const log2 = Math.ceil(Math.log(approx) / Math.LN2);
962
+ const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
963
+ let approxRes = Long.fromNumber(approx);
964
+ let approxRem = approxRes.mul(divisor);
965
+ while (approxRem.isNegative() || approxRem.gt(rem)) {
966
+ approx -= delta;
967
+ approxRes = Long.fromNumber(approx, this.unsigned);
968
+ approxRem = approxRes.mul(divisor);
969
+ }
970
+ if (approxRes.isZero())
971
+ approxRes = Long.ONE;
972
+ res = res.add(approxRes);
973
+ rem = rem.sub(approxRem);
974
+ }
975
+ return res;
976
+ }
977
+ div(divisor) {
978
+ return this.divide(divisor);
979
+ }
980
+ equals(other) {
981
+ if (!Long.isLong(other))
982
+ other = Long.fromValue(other);
983
+ if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1)
984
+ return false;
985
+ return this.high === other.high && this.low === other.low;
986
+ }
987
+ eq(other) {
988
+ return this.equals(other);
989
+ }
990
+ getHighBits() {
991
+ return this.high;
992
+ }
993
+ getHighBitsUnsigned() {
994
+ return this.high >>> 0;
995
+ }
996
+ getLowBits() {
997
+ return this.low;
998
+ }
999
+ getLowBitsUnsigned() {
1000
+ return this.low >>> 0;
1001
+ }
1002
+ getNumBitsAbs() {
1003
+ if (this.isNegative()) {
1004
+ return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();
1005
+ }
1006
+ const val = this.high !== 0 ? this.high : this.low;
1007
+ let bit;
1008
+ for (bit = 31; bit > 0; bit--)
1009
+ if ((val & (1 << bit)) !== 0)
1010
+ break;
1011
+ return this.high !== 0 ? bit + 33 : bit + 1;
1012
+ }
1013
+ greaterThan(other) {
1014
+ return this.comp(other) > 0;
1015
+ }
1016
+ gt(other) {
1017
+ return this.greaterThan(other);
1018
+ }
1019
+ greaterThanOrEqual(other) {
1020
+ return this.comp(other) >= 0;
1021
+ }
1022
+ gte(other) {
1023
+ return this.greaterThanOrEqual(other);
1024
+ }
1025
+ ge(other) {
1026
+ return this.greaterThanOrEqual(other);
1027
+ }
1028
+ isEven() {
1029
+ return (this.low & 1) === 0;
1030
+ }
1031
+ isNegative() {
1032
+ return !this.unsigned && this.high < 0;
1033
+ }
1034
+ isOdd() {
1035
+ return (this.low & 1) === 1;
1036
+ }
1037
+ isPositive() {
1038
+ return this.unsigned || this.high >= 0;
1039
+ }
1040
+ isZero() {
1041
+ return this.high === 0 && this.low === 0;
1042
+ }
1043
+ lessThan(other) {
1044
+ return this.comp(other) < 0;
1045
+ }
1046
+ lt(other) {
1047
+ return this.lessThan(other);
1048
+ }
1049
+ lessThanOrEqual(other) {
1050
+ return this.comp(other) <= 0;
1051
+ }
1052
+ lte(other) {
1053
+ return this.lessThanOrEqual(other);
1054
+ }
1055
+ modulo(divisor) {
1056
+ if (!Long.isLong(divisor))
1057
+ divisor = Long.fromValue(divisor);
1058
+ if (wasm) {
1059
+ const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high);
1060
+ return Long.fromBits(low, wasm.get_high(), this.unsigned);
1061
+ }
1062
+ return this.sub(this.div(divisor).mul(divisor));
1063
+ }
1064
+ mod(divisor) {
1065
+ return this.modulo(divisor);
1066
+ }
1067
+ rem(divisor) {
1068
+ return this.modulo(divisor);
1069
+ }
1070
+ multiply(multiplier) {
1071
+ if (this.isZero())
1072
+ return Long.ZERO;
1073
+ if (!Long.isLong(multiplier))
1074
+ multiplier = Long.fromValue(multiplier);
1075
+ if (wasm) {
1076
+ const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high);
1077
+ return Long.fromBits(low, wasm.get_high(), this.unsigned);
1078
+ }
1079
+ if (multiplier.isZero())
1080
+ return Long.ZERO;
1081
+ if (this.eq(Long.MIN_VALUE))
1082
+ return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO;
1083
+ if (multiplier.eq(Long.MIN_VALUE))
1084
+ return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
1085
+ if (this.isNegative()) {
1086
+ if (multiplier.isNegative())
1087
+ return this.neg().mul(multiplier.neg());
1088
+ else
1089
+ return this.neg().mul(multiplier).neg();
1090
+ }
1091
+ else if (multiplier.isNegative())
1092
+ return this.mul(multiplier.neg()).neg();
1093
+ if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24))
1094
+ return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);
1095
+ const a48 = this.high >>> 16;
1096
+ const a32 = this.high & 0xffff;
1097
+ const a16 = this.low >>> 16;
1098
+ const a00 = this.low & 0xffff;
1099
+ const b48 = multiplier.high >>> 16;
1100
+ const b32 = multiplier.high & 0xffff;
1101
+ const b16 = multiplier.low >>> 16;
1102
+ const b00 = multiplier.low & 0xffff;
1103
+ let c48 = 0, c32 = 0, c16 = 0, c00 = 0;
1104
+ c00 += a00 * b00;
1105
+ c16 += c00 >>> 16;
1106
+ c00 &= 0xffff;
1107
+ c16 += a16 * b00;
1108
+ c32 += c16 >>> 16;
1109
+ c16 &= 0xffff;
1110
+ c16 += a00 * b16;
1111
+ c32 += c16 >>> 16;
1112
+ c16 &= 0xffff;
1113
+ c32 += a32 * b00;
1114
+ c48 += c32 >>> 16;
1115
+ c32 &= 0xffff;
1116
+ c32 += a16 * b16;
1117
+ c48 += c32 >>> 16;
1118
+ c32 &= 0xffff;
1119
+ c32 += a00 * b32;
1120
+ c48 += c32 >>> 16;
1121
+ c32 &= 0xffff;
1122
+ c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
1123
+ c48 &= 0xffff;
1124
+ return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);
1125
+ }
1126
+ mul(multiplier) {
1127
+ return this.multiply(multiplier);
1128
+ }
1129
+ negate() {
1130
+ if (!this.unsigned && this.eq(Long.MIN_VALUE))
1131
+ return Long.MIN_VALUE;
1132
+ return this.not().add(Long.ONE);
1133
+ }
1134
+ neg() {
1135
+ return this.negate();
1136
+ }
1137
+ not() {
1138
+ return Long.fromBits(~this.low, ~this.high, this.unsigned);
1139
+ }
1140
+ notEquals(other) {
1141
+ return !this.equals(other);
1142
+ }
1143
+ neq(other) {
1144
+ return this.notEquals(other);
1145
+ }
1146
+ ne(other) {
1147
+ return this.notEquals(other);
1148
+ }
1149
+ or(other) {
1150
+ if (!Long.isLong(other))
1151
+ other = Long.fromValue(other);
1152
+ return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned);
1153
+ }
1154
+ shiftLeft(numBits) {
1155
+ if (Long.isLong(numBits))
1156
+ numBits = numBits.toInt();
1157
+ if ((numBits &= 63) === 0)
1158
+ return this;
1159
+ else if (numBits < 32)
1160
+ return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);
1161
+ else
1162
+ return Long.fromBits(0, this.low << (numBits - 32), this.unsigned);
1163
+ }
1164
+ shl(numBits) {
1165
+ return this.shiftLeft(numBits);
1166
+ }
1167
+ shiftRight(numBits) {
1168
+ if (Long.isLong(numBits))
1169
+ numBits = numBits.toInt();
1170
+ if ((numBits &= 63) === 0)
1171
+ return this;
1172
+ else if (numBits < 32)
1173
+ return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);
1174
+ else
1175
+ return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);
1176
+ }
1177
+ shr(numBits) {
1178
+ return this.shiftRight(numBits);
1179
+ }
1180
+ shiftRightUnsigned(numBits) {
1181
+ if (Long.isLong(numBits))
1182
+ numBits = numBits.toInt();
1183
+ numBits &= 63;
1184
+ if (numBits === 0)
1185
+ return this;
1186
+ else {
1187
+ const high = this.high;
1188
+ if (numBits < 32) {
1189
+ const low = this.low;
1190
+ return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned);
1191
+ }
1192
+ else if (numBits === 32)
1193
+ return Long.fromBits(high, 0, this.unsigned);
1194
+ else
1195
+ return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned);
1196
+ }
1197
+ }
1198
+ shr_u(numBits) {
1199
+ return this.shiftRightUnsigned(numBits);
1200
+ }
1201
+ shru(numBits) {
1202
+ return this.shiftRightUnsigned(numBits);
1203
+ }
1204
+ subtract(subtrahend) {
1205
+ if (!Long.isLong(subtrahend))
1206
+ subtrahend = Long.fromValue(subtrahend);
1207
+ return this.add(subtrahend.neg());
1208
+ }
1209
+ sub(subtrahend) {
1210
+ return this.subtract(subtrahend);
1211
+ }
1212
+ toInt() {
1213
+ return this.unsigned ? this.low >>> 0 : this.low;
1214
+ }
1215
+ toNumber() {
1216
+ if (this.unsigned)
1217
+ return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0);
1218
+ return this.high * TWO_PWR_32_DBL + (this.low >>> 0);
1219
+ }
1220
+ toBigInt() {
1221
+ return BigInt(this.toString());
1222
+ }
1223
+ toBytes(le) {
1224
+ return le ? this.toBytesLE() : this.toBytesBE();
1225
+ }
1226
+ toBytesLE() {
1227
+ const hi = this.high, lo = this.low;
1228
+ return [
1229
+ lo & 0xff,
1230
+ (lo >>> 8) & 0xff,
1231
+ (lo >>> 16) & 0xff,
1232
+ lo >>> 24,
1233
+ hi & 0xff,
1234
+ (hi >>> 8) & 0xff,
1235
+ (hi >>> 16) & 0xff,
1236
+ hi >>> 24
1237
+ ];
1238
+ }
1239
+ toBytesBE() {
1240
+ const hi = this.high, lo = this.low;
1241
+ return [
1242
+ hi >>> 24,
1243
+ (hi >>> 16) & 0xff,
1244
+ (hi >>> 8) & 0xff,
1245
+ hi & 0xff,
1246
+ lo >>> 24,
1247
+ (lo >>> 16) & 0xff,
1248
+ (lo >>> 8) & 0xff,
1249
+ lo & 0xff
1250
+ ];
1251
+ }
1252
+ toSigned() {
1253
+ if (!this.unsigned)
1254
+ return this;
1255
+ return Long.fromBits(this.low, this.high, false);
1256
+ }
1257
+ toString(radix) {
1258
+ radix = radix || 10;
1259
+ if (radix < 2 || 36 < radix)
1260
+ throw new BSONError('radix');
1261
+ if (this.isZero())
1262
+ return '0';
1263
+ if (this.isNegative()) {
1264
+ if (this.eq(Long.MIN_VALUE)) {
1265
+ const radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this);
1266
+ return div.toString(radix) + rem1.toInt().toString(radix);
1267
+ }
1268
+ else
1269
+ return '-' + this.neg().toString(radix);
1270
+ }
1271
+ const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned);
1272
+ let rem = this;
1273
+ let result = '';
1274
+ while (true) {
1275
+ const remDiv = rem.div(radixToPower);
1276
+ const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0;
1277
+ let digits = intval.toString(radix);
1278
+ rem = remDiv;
1279
+ if (rem.isZero()) {
1280
+ return digits + result;
1281
+ }
1282
+ else {
1283
+ while (digits.length < 6)
1284
+ digits = '0' + digits;
1285
+ result = '' + digits + result;
1286
+ }
1287
+ }
1288
+ }
1289
+ toUnsigned() {
1290
+ if (this.unsigned)
1291
+ return this;
1292
+ return Long.fromBits(this.low, this.high, true);
1293
+ }
1294
+ xor(other) {
1295
+ if (!Long.isLong(other))
1296
+ other = Long.fromValue(other);
1297
+ return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);
1298
+ }
1299
+ eqz() {
1300
+ return this.isZero();
1301
+ }
1302
+ le(other) {
1303
+ return this.lessThanOrEqual(other);
1304
+ }
1305
+ toExtendedJSON(options) {
1306
+ if (options && options.relaxed)
1307
+ return this.toNumber();
1308
+ return { $numberLong: this.toString() };
1309
+ }
1310
+ static fromExtendedJSON(doc, options) {
1311
+ const { useBigInt64 = false, relaxed = true } = { ...options };
1312
+ if (doc.$numberLong.length > MAX_INT64_STRING_LENGTH) {
1313
+ throw new BSONError('$numberLong string is too long');
1314
+ }
1315
+ if (!DECIMAL_REG_EX.test(doc.$numberLong)) {
1316
+ throw new BSONError(`$numberLong string "${doc.$numberLong}" is in an invalid format`);
1317
+ }
1318
+ if (useBigInt64) {
1319
+ const bigIntResult = BigInt(doc.$numberLong);
1320
+ return BigInt.asIntN(64, bigIntResult);
1321
+ }
1322
+ const longResult = Long.fromString(doc.$numberLong);
1323
+ if (relaxed) {
1324
+ return longResult.toNumber();
1325
+ }
1326
+ return longResult;
1327
+ }
1328
+ [Symbol.for('nodejs.util.inspect.custom')]() {
1329
+ return this.inspect();
1330
+ }
1331
+ inspect() {
1332
+ return `new Long("${this.toString()}"${this.unsigned ? ', true' : ''})`;
1333
+ }
1334
+ }
1335
+ Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL);
1336
+ Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true);
1337
+ Long.ZERO = Long.fromInt(0);
1338
+ Long.UZERO = Long.fromInt(0, true);
1339
+ Long.ONE = Long.fromInt(1);
1340
+ Long.UONE = Long.fromInt(1, true);
1341
+ Long.NEG_ONE = Long.fromInt(-1);
1342
+ Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false);
1343
+ Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false);
1344
+
1345
+ const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/;
1346
+ const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i;
1347
+ const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i;
1348
+ const EXPONENT_MAX = 6111;
1349
+ const EXPONENT_MIN = -6176;
1350
+ const EXPONENT_BIAS = 6176;
1351
+ const MAX_DIGITS = 34;
1352
+ const NAN_BUFFER = ByteUtils.fromNumberArray([
1353
+ 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1354
+ ].reverse());
1355
+ const INF_NEGATIVE_BUFFER = ByteUtils.fromNumberArray([
1356
+ 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1357
+ ].reverse());
1358
+ const INF_POSITIVE_BUFFER = ByteUtils.fromNumberArray([
1359
+ 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1360
+ ].reverse());
1361
+ const EXPONENT_REGEX = /^([-+])?(\d+)?$/;
1362
+ const COMBINATION_MASK = 0x1f;
1363
+ const EXPONENT_MASK = 0x3fff;
1364
+ const COMBINATION_INFINITY = 30;
1365
+ const COMBINATION_NAN = 31;
1366
+ function isDigit(value) {
1367
+ return !isNaN(parseInt(value, 10));
1368
+ }
1369
+ function divideu128(value) {
1370
+ const DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
1371
+ let _rem = Long.fromNumber(0);
1372
+ if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
1373
+ return { quotient: value, rem: _rem };
1374
+ }
1375
+ for (let i = 0; i <= 3; i++) {
1376
+ _rem = _rem.shiftLeft(32);
1377
+ _rem = _rem.add(new Long(value.parts[i], 0));
1378
+ value.parts[i] = _rem.div(DIVISOR).low;
1379
+ _rem = _rem.modulo(DIVISOR);
1380
+ }
1381
+ return { quotient: value, rem: _rem };
1382
+ }
1383
+ function multiply64x2(left, right) {
1384
+ if (!left && !right) {
1385
+ return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
1386
+ }
1387
+ const leftHigh = left.shiftRightUnsigned(32);
1388
+ const leftLow = new Long(left.getLowBits(), 0);
1389
+ const rightHigh = right.shiftRightUnsigned(32);
1390
+ const rightLow = new Long(right.getLowBits(), 0);
1391
+ let productHigh = leftHigh.multiply(rightHigh);
1392
+ let productMid = leftHigh.multiply(rightLow);
1393
+ const productMid2 = leftLow.multiply(rightHigh);
1394
+ let productLow = leftLow.multiply(rightLow);
1395
+ productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
1396
+ productMid = new Long(productMid.getLowBits(), 0)
1397
+ .add(productMid2)
1398
+ .add(productLow.shiftRightUnsigned(32));
1399
+ productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
1400
+ productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
1401
+ return { high: productHigh, low: productLow };
1402
+ }
1403
+ function lessThan(left, right) {
1404
+ const uhleft = left.high >>> 0;
1405
+ const uhright = right.high >>> 0;
1406
+ if (uhleft < uhright) {
1407
+ return true;
1408
+ }
1409
+ else if (uhleft === uhright) {
1410
+ const ulleft = left.low >>> 0;
1411
+ const ulright = right.low >>> 0;
1412
+ if (ulleft < ulright)
1413
+ return true;
1414
+ }
1415
+ return false;
1416
+ }
1417
+ function invalidErr(string, message) {
1418
+ throw new BSONError(`"${string}" is not a valid Decimal128 string - ${message}`);
1419
+ }
1420
+ class Decimal128 extends BSONValue {
1421
+ get _bsontype() {
1422
+ return 'Decimal128';
1423
+ }
1424
+ constructor(bytes) {
1425
+ super();
1426
+ if (typeof bytes === 'string') {
1427
+ this.bytes = Decimal128.fromString(bytes).bytes;
1428
+ }
1429
+ else if (isUint8Array(bytes)) {
1430
+ if (bytes.byteLength !== 16) {
1431
+ throw new BSONError('Decimal128 must take a Buffer of 16 bytes');
1432
+ }
1433
+ this.bytes = bytes;
1434
+ }
1435
+ else {
1436
+ throw new BSONError('Decimal128 must take a Buffer or string');
1437
+ }
1438
+ }
1439
+ static fromString(representation) {
1440
+ return Decimal128._fromString(representation, { allowRounding: false });
1441
+ }
1442
+ static fromStringWithRounding(representation) {
1443
+ return Decimal128._fromString(representation, { allowRounding: true });
1444
+ }
1445
+ static _fromString(representation, options) {
1446
+ let isNegative = false;
1447
+ let sawSign = false;
1448
+ let sawRadix = false;
1449
+ let foundNonZero = false;
1450
+ let significantDigits = 0;
1451
+ let nDigitsRead = 0;
1452
+ let nDigits = 0;
1453
+ let radixPosition = 0;
1454
+ let firstNonZero = 0;
1455
+ const digits = [0];
1456
+ let nDigitsStored = 0;
1457
+ let digitsInsert = 0;
1458
+ let lastDigit = 0;
1459
+ let exponent = 0;
1460
+ let significandHigh = new Long(0, 0);
1461
+ let significandLow = new Long(0, 0);
1462
+ let biasedExponent = 0;
1463
+ let index = 0;
1464
+ if (representation.length >= 7000) {
1465
+ throw new BSONError('' + representation + ' not a valid Decimal128 string');
1466
+ }
1467
+ const stringMatch = representation.match(PARSE_STRING_REGEXP);
1468
+ const infMatch = representation.match(PARSE_INF_REGEXP);
1469
+ const nanMatch = representation.match(PARSE_NAN_REGEXP);
1470
+ if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) {
1471
+ throw new BSONError('' + representation + ' not a valid Decimal128 string');
1472
+ }
1473
+ if (stringMatch) {
1474
+ const unsignedNumber = stringMatch[2];
1475
+ const e = stringMatch[4];
1476
+ const expSign = stringMatch[5];
1477
+ const expNumber = stringMatch[6];
1478
+ if (e && expNumber === undefined)
1479
+ invalidErr(representation, 'missing exponent power');
1480
+ if (e && unsignedNumber === undefined)
1481
+ invalidErr(representation, 'missing exponent base');
1482
+ if (e === undefined && (expSign || expNumber)) {
1483
+ invalidErr(representation, 'missing e before exponent');
1484
+ }
1485
+ }
1486
+ if (representation[index] === '+' || representation[index] === '-') {
1487
+ sawSign = true;
1488
+ isNegative = representation[index++] === '-';
1489
+ }
1490
+ if (!isDigit(representation[index]) && representation[index] !== '.') {
1491
+ if (representation[index] === 'i' || representation[index] === 'I') {
1492
+ return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER);
1493
+ }
1494
+ else if (representation[index] === 'N') {
1495
+ return new Decimal128(NAN_BUFFER);
1496
+ }
1497
+ }
1498
+ while (isDigit(representation[index]) || representation[index] === '.') {
1499
+ if (representation[index] === '.') {
1500
+ if (sawRadix)
1501
+ invalidErr(representation, 'contains multiple periods');
1502
+ sawRadix = true;
1503
+ index = index + 1;
1504
+ continue;
1505
+ }
1506
+ if (nDigitsStored < MAX_DIGITS) {
1507
+ if (representation[index] !== '0' || foundNonZero) {
1508
+ if (!foundNonZero) {
1509
+ firstNonZero = nDigitsRead;
1510
+ }
1511
+ foundNonZero = true;
1512
+ digits[digitsInsert++] = parseInt(representation[index], 10);
1513
+ nDigitsStored = nDigitsStored + 1;
1514
+ }
1515
+ }
1516
+ if (foundNonZero)
1517
+ nDigits = nDigits + 1;
1518
+ if (sawRadix)
1519
+ radixPosition = radixPosition + 1;
1520
+ nDigitsRead = nDigitsRead + 1;
1521
+ index = index + 1;
1522
+ }
1523
+ if (sawRadix && !nDigitsRead)
1524
+ throw new BSONError('' + representation + ' not a valid Decimal128 string');
1525
+ if (representation[index] === 'e' || representation[index] === 'E') {
1526
+ const match = representation.substr(++index).match(EXPONENT_REGEX);
1527
+ if (!match || !match[2])
1528
+ return new Decimal128(NAN_BUFFER);
1529
+ exponent = parseInt(match[0], 10);
1530
+ index = index + match[0].length;
1531
+ }
1532
+ if (representation[index])
1533
+ return new Decimal128(NAN_BUFFER);
1534
+ if (!nDigitsStored) {
1535
+ digits[0] = 0;
1536
+ nDigits = 1;
1537
+ nDigitsStored = 1;
1538
+ significantDigits = 0;
1539
+ }
1540
+ else {
1541
+ lastDigit = nDigitsStored - 1;
1542
+ significantDigits = nDigits;
1543
+ if (significantDigits !== 1) {
1544
+ while (representation[firstNonZero + significantDigits - 1 + Number(sawSign) + Number(sawRadix)] === '0') {
1545
+ significantDigits = significantDigits - 1;
1546
+ }
1547
+ }
1548
+ }
1549
+ if (exponent <= radixPosition && radixPosition > exponent + (1 << 14)) {
1550
+ exponent = EXPONENT_MIN;
1551
+ }
1552
+ else {
1553
+ exponent = exponent - radixPosition;
1554
+ }
1555
+ while (exponent > EXPONENT_MAX) {
1556
+ lastDigit = lastDigit + 1;
1557
+ if (lastDigit >= MAX_DIGITS) {
1558
+ if (significantDigits === 0) {
1559
+ exponent = EXPONENT_MAX;
1560
+ break;
1561
+ }
1562
+ invalidErr(representation, 'overflow');
1563
+ }
1564
+ exponent = exponent - 1;
1565
+ }
1566
+ if (options.allowRounding) {
1567
+ while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
1568
+ if (lastDigit === 0 && significantDigits < nDigitsStored) {
1569
+ exponent = EXPONENT_MIN;
1570
+ significantDigits = 0;
1571
+ break;
1572
+ }
1573
+ if (nDigitsStored < nDigits) {
1574
+ nDigits = nDigits - 1;
1575
+ }
1576
+ else {
1577
+ lastDigit = lastDigit - 1;
1578
+ }
1579
+ if (exponent < EXPONENT_MAX) {
1580
+ exponent = exponent + 1;
1581
+ }
1582
+ else {
1583
+ const digitsString = digits.join('');
1584
+ if (digitsString.match(/^0+$/)) {
1585
+ exponent = EXPONENT_MAX;
1586
+ break;
1587
+ }
1588
+ invalidErr(representation, 'overflow');
1589
+ }
1590
+ }
1591
+ if (lastDigit + 1 < significantDigits) {
1592
+ let endOfString = nDigitsRead;
1593
+ if (sawRadix) {
1594
+ firstNonZero = firstNonZero + 1;
1595
+ endOfString = endOfString + 1;
1596
+ }
1597
+ if (sawSign) {
1598
+ firstNonZero = firstNonZero + 1;
1599
+ endOfString = endOfString + 1;
1600
+ }
1601
+ const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10);
1602
+ let roundBit = 0;
1603
+ if (roundDigit >= 5) {
1604
+ roundBit = 1;
1605
+ if (roundDigit === 5) {
1606
+ roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0;
1607
+ for (let i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
1608
+ if (parseInt(representation[i], 10)) {
1609
+ roundBit = 1;
1610
+ break;
1611
+ }
1612
+ }
1613
+ }
1614
+ }
1615
+ if (roundBit) {
1616
+ let dIdx = lastDigit;
1617
+ for (; dIdx >= 0; dIdx--) {
1618
+ if (++digits[dIdx] > 9) {
1619
+ digits[dIdx] = 0;
1620
+ if (dIdx === 0) {
1621
+ if (exponent < EXPONENT_MAX) {
1622
+ exponent = exponent + 1;
1623
+ digits[dIdx] = 1;
1624
+ }
1625
+ else {
1626
+ return new Decimal128(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER);
1627
+ }
1628
+ }
1629
+ }
1630
+ else {
1631
+ break;
1632
+ }
1633
+ }
1634
+ }
1635
+ }
1636
+ }
1637
+ else {
1638
+ while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
1639
+ if (lastDigit === 0) {
1640
+ if (significantDigits === 0) {
1641
+ exponent = EXPONENT_MIN;
1642
+ break;
1643
+ }
1644
+ invalidErr(representation, 'exponent underflow');
1645
+ }
1646
+ if (nDigitsStored < nDigits) {
1647
+ if (representation[nDigits - 1 + Number(sawSign) + Number(sawRadix)] !== '0' &&
1648
+ significantDigits !== 0) {
1649
+ invalidErr(representation, 'inexact rounding');
1650
+ }
1651
+ nDigits = nDigits - 1;
1652
+ }
1653
+ else {
1654
+ if (digits[lastDigit] !== 0) {
1655
+ invalidErr(representation, 'inexact rounding');
1656
+ }
1657
+ lastDigit = lastDigit - 1;
1658
+ }
1659
+ if (exponent < EXPONENT_MAX) {
1660
+ exponent = exponent + 1;
1661
+ }
1662
+ else {
1663
+ invalidErr(representation, 'overflow');
1664
+ }
1665
+ }
1666
+ if (lastDigit + 1 < significantDigits) {
1667
+ if (sawRadix) {
1668
+ firstNonZero = firstNonZero + 1;
1669
+ }
1670
+ if (sawSign) {
1671
+ firstNonZero = firstNonZero + 1;
1672
+ }
1673
+ const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10);
1674
+ if (roundDigit !== 0) {
1675
+ invalidErr(representation, 'inexact rounding');
1676
+ }
1677
+ }
1678
+ }
1679
+ significandHigh = Long.fromNumber(0);
1680
+ significandLow = Long.fromNumber(0);
1681
+ if (significantDigits === 0) {
1682
+ significandHigh = Long.fromNumber(0);
1683
+ significandLow = Long.fromNumber(0);
1684
+ }
1685
+ else if (lastDigit < 17) {
1686
+ let dIdx = 0;
1687
+ significandLow = Long.fromNumber(digits[dIdx++]);
1688
+ significandHigh = new Long(0, 0);
1689
+ for (; dIdx <= lastDigit; dIdx++) {
1690
+ significandLow = significandLow.multiply(Long.fromNumber(10));
1691
+ significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
1692
+ }
1693
+ }
1694
+ else {
1695
+ let dIdx = 0;
1696
+ significandHigh = Long.fromNumber(digits[dIdx++]);
1697
+ for (; dIdx <= lastDigit - 17; dIdx++) {
1698
+ significandHigh = significandHigh.multiply(Long.fromNumber(10));
1699
+ significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
1700
+ }
1701
+ significandLow = Long.fromNumber(digits[dIdx++]);
1702
+ for (; dIdx <= lastDigit; dIdx++) {
1703
+ significandLow = significandLow.multiply(Long.fromNumber(10));
1704
+ significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
1705
+ }
1706
+ }
1707
+ const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000'));
1708
+ significand.low = significand.low.add(significandLow);
1709
+ if (lessThan(significand.low, significandLow)) {
1710
+ significand.high = significand.high.add(Long.fromNumber(1));
1711
+ }
1712
+ biasedExponent = exponent + EXPONENT_BIAS;
1713
+ const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
1714
+ if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) {
1715
+ dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
1716
+ dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)));
1717
+ dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
1718
+ }
1719
+ else {
1720
+ dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
1721
+ dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
1722
+ }
1723
+ dec.low = significand.low;
1724
+ if (isNegative) {
1725
+ dec.high = dec.high.or(Long.fromString('9223372036854775808'));
1726
+ }
1727
+ const buffer = ByteUtils.allocate(16);
1728
+ index = 0;
1729
+ buffer[index++] = dec.low.low & 0xff;
1730
+ buffer[index++] = (dec.low.low >> 8) & 0xff;
1731
+ buffer[index++] = (dec.low.low >> 16) & 0xff;
1732
+ buffer[index++] = (dec.low.low >> 24) & 0xff;
1733
+ buffer[index++] = dec.low.high & 0xff;
1734
+ buffer[index++] = (dec.low.high >> 8) & 0xff;
1735
+ buffer[index++] = (dec.low.high >> 16) & 0xff;
1736
+ buffer[index++] = (dec.low.high >> 24) & 0xff;
1737
+ buffer[index++] = dec.high.low & 0xff;
1738
+ buffer[index++] = (dec.high.low >> 8) & 0xff;
1739
+ buffer[index++] = (dec.high.low >> 16) & 0xff;
1740
+ buffer[index++] = (dec.high.low >> 24) & 0xff;
1741
+ buffer[index++] = dec.high.high & 0xff;
1742
+ buffer[index++] = (dec.high.high >> 8) & 0xff;
1743
+ buffer[index++] = (dec.high.high >> 16) & 0xff;
1744
+ buffer[index++] = (dec.high.high >> 24) & 0xff;
1745
+ return new Decimal128(buffer);
1746
+ }
1747
+ toString() {
1748
+ let biased_exponent;
1749
+ let significand_digits = 0;
1750
+ const significand = new Array(36);
1751
+ for (let i = 0; i < significand.length; i++)
1752
+ significand[i] = 0;
1753
+ let index = 0;
1754
+ let is_zero = false;
1755
+ let significand_msb;
1756
+ let significand128 = { parts: [0, 0, 0, 0] };
1757
+ let j, k;
1758
+ const string = [];
1759
+ index = 0;
1760
+ const buffer = this.bytes;
1761
+ const low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
1762
+ const midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
1763
+ const midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
1764
+ const high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
1765
+ index = 0;
1766
+ const dec = {
1767
+ low: new Long(low, midl),
1768
+ high: new Long(midh, high)
1769
+ };
1770
+ if (dec.high.lessThan(Long.ZERO)) {
1771
+ string.push('-');
1772
+ }
1773
+ const combination = (high >> 26) & COMBINATION_MASK;
1774
+ if (combination >> 3 === 3) {
1775
+ if (combination === COMBINATION_INFINITY) {
1776
+ return string.join('') + 'Infinity';
1777
+ }
1778
+ else if (combination === COMBINATION_NAN) {
1779
+ return 'NaN';
1780
+ }
1781
+ else {
1782
+ biased_exponent = (high >> 15) & EXPONENT_MASK;
1783
+ significand_msb = 0x08 + ((high >> 14) & 0x01);
1784
+ }
1785
+ }
1786
+ else {
1787
+ significand_msb = (high >> 14) & 0x07;
1788
+ biased_exponent = (high >> 17) & EXPONENT_MASK;
1789
+ }
1790
+ const exponent = biased_exponent - EXPONENT_BIAS;
1791
+ significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
1792
+ significand128.parts[1] = midh;
1793
+ significand128.parts[2] = midl;
1794
+ significand128.parts[3] = low;
1795
+ if (significand128.parts[0] === 0 &&
1796
+ significand128.parts[1] === 0 &&
1797
+ significand128.parts[2] === 0 &&
1798
+ significand128.parts[3] === 0) {
1799
+ is_zero = true;
1800
+ }
1801
+ else {
1802
+ for (k = 3; k >= 0; k--) {
1803
+ let least_digits = 0;
1804
+ const result = divideu128(significand128);
1805
+ significand128 = result.quotient;
1806
+ least_digits = result.rem.low;
1807
+ if (!least_digits)
1808
+ continue;
1809
+ for (j = 8; j >= 0; j--) {
1810
+ significand[k * 9 + j] = least_digits % 10;
1811
+ least_digits = Math.floor(least_digits / 10);
1812
+ }
1813
+ }
1814
+ }
1815
+ if (is_zero) {
1816
+ significand_digits = 1;
1817
+ significand[index] = 0;
1818
+ }
1819
+ else {
1820
+ significand_digits = 36;
1821
+ while (!significand[index]) {
1822
+ significand_digits = significand_digits - 1;
1823
+ index = index + 1;
1824
+ }
1825
+ }
1826
+ const scientific_exponent = significand_digits - 1 + exponent;
1827
+ if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
1828
+ if (significand_digits > 34) {
1829
+ string.push(`${0}`);
1830
+ if (exponent > 0)
1831
+ string.push(`E+${exponent}`);
1832
+ else if (exponent < 0)
1833
+ string.push(`E${exponent}`);
1834
+ return string.join('');
1835
+ }
1836
+ string.push(`${significand[index++]}`);
1837
+ significand_digits = significand_digits - 1;
1838
+ if (significand_digits) {
1839
+ string.push('.');
1840
+ }
1841
+ for (let i = 0; i < significand_digits; i++) {
1842
+ string.push(`${significand[index++]}`);
1843
+ }
1844
+ string.push('E');
1845
+ if (scientific_exponent > 0) {
1846
+ string.push(`+${scientific_exponent}`);
1847
+ }
1848
+ else {
1849
+ string.push(`${scientific_exponent}`);
1850
+ }
1851
+ }
1852
+ else {
1853
+ if (exponent >= 0) {
1854
+ for (let i = 0; i < significand_digits; i++) {
1855
+ string.push(`${significand[index++]}`);
1856
+ }
1857
+ }
1858
+ else {
1859
+ let radix_position = significand_digits + exponent;
1860
+ if (radix_position > 0) {
1861
+ for (let i = 0; i < radix_position; i++) {
1862
+ string.push(`${significand[index++]}`);
1863
+ }
1864
+ }
1865
+ else {
1866
+ string.push('0');
1867
+ }
1868
+ string.push('.');
1869
+ while (radix_position++ < 0) {
1870
+ string.push('0');
1871
+ }
1872
+ for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
1873
+ string.push(`${significand[index++]}`);
1874
+ }
1875
+ }
1876
+ }
1877
+ return string.join('');
1878
+ }
1879
+ toJSON() {
1880
+ return { $numberDecimal: this.toString() };
1881
+ }
1882
+ toExtendedJSON() {
1883
+ return { $numberDecimal: this.toString() };
1884
+ }
1885
+ static fromExtendedJSON(doc) {
1886
+ return Decimal128.fromString(doc.$numberDecimal);
1887
+ }
1888
+ [Symbol.for('nodejs.util.inspect.custom')]() {
1889
+ return this.inspect();
1890
+ }
1891
+ inspect() {
1892
+ return `new Decimal128("${this.toString()}")`;
1893
+ }
1894
+ }
1895
+
1896
+ class Double extends BSONValue {
1897
+ get _bsontype() {
1898
+ return 'Double';
1899
+ }
1900
+ constructor(value) {
1901
+ super();
1902
+ if (value instanceof Number) {
1903
+ value = value.valueOf();
1904
+ }
1905
+ this.value = +value;
1906
+ }
1907
+ valueOf() {
1908
+ return this.value;
1909
+ }
1910
+ toJSON() {
1911
+ return this.value;
1912
+ }
1913
+ toString(radix) {
1914
+ return this.value.toString(radix);
1915
+ }
1916
+ toExtendedJSON(options) {
1917
+ if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) {
1918
+ return this.value;
1919
+ }
1920
+ if (Object.is(Math.sign(this.value), -0)) {
1921
+ return { $numberDouble: '-0.0' };
1922
+ }
1923
+ return {
1924
+ $numberDouble: Number.isInteger(this.value) ? this.value.toFixed(1) : this.value.toString()
1925
+ };
1926
+ }
1927
+ static fromExtendedJSON(doc, options) {
1928
+ const doubleValue = parseFloat(doc.$numberDouble);
1929
+ return options && options.relaxed ? doubleValue : new Double(doubleValue);
1930
+ }
1931
+ [Symbol.for('nodejs.util.inspect.custom')]() {
1932
+ return this.inspect();
1933
+ }
1934
+ inspect() {
1935
+ const eJSON = this.toExtendedJSON();
1936
+ return `new Double(${eJSON.$numberDouble})`;
1937
+ }
1938
+ }
1939
+
1940
+ class Int32 extends BSONValue {
1941
+ get _bsontype() {
1942
+ return 'Int32';
1943
+ }
1944
+ constructor(value) {
1945
+ super();
1946
+ if (value instanceof Number) {
1947
+ value = value.valueOf();
1948
+ }
1949
+ this.value = +value | 0;
1950
+ }
1951
+ valueOf() {
1952
+ return this.value;
1953
+ }
1954
+ toString(radix) {
1955
+ return this.value.toString(radix);
1956
+ }
1957
+ toJSON() {
1958
+ return this.value;
1959
+ }
1960
+ toExtendedJSON(options) {
1961
+ if (options && (options.relaxed || options.legacy))
1962
+ return this.value;
1963
+ return { $numberInt: this.value.toString() };
1964
+ }
1965
+ static fromExtendedJSON(doc, options) {
1966
+ return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt);
1967
+ }
1968
+ [Symbol.for('nodejs.util.inspect.custom')]() {
1969
+ return this.inspect();
1970
+ }
1971
+ inspect() {
1972
+ return `new Int32(${this.valueOf()})`;
1973
+ }
1974
+ }
1975
+
1976
+ class MaxKey extends BSONValue {
1977
+ get _bsontype() {
1978
+ return 'MaxKey';
1979
+ }
1980
+ toExtendedJSON() {
1981
+ return { $maxKey: 1 };
1982
+ }
1983
+ static fromExtendedJSON() {
1984
+ return new MaxKey();
1985
+ }
1986
+ [Symbol.for('nodejs.util.inspect.custom')]() {
1987
+ return this.inspect();
1988
+ }
1989
+ inspect() {
1990
+ return 'new MaxKey()';
1991
+ }
1992
+ }
1993
+
1994
+ class MinKey extends BSONValue {
1995
+ get _bsontype() {
1996
+ return 'MinKey';
1997
+ }
1998
+ toExtendedJSON() {
1999
+ return { $minKey: 1 };
2000
+ }
2001
+ static fromExtendedJSON() {
2002
+ return new MinKey();
2003
+ }
2004
+ [Symbol.for('nodejs.util.inspect.custom')]() {
2005
+ return this.inspect();
2006
+ }
2007
+ inspect() {
2008
+ return 'new MinKey()';
2009
+ }
2010
+ }
2011
+
2012
+ const checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');
2013
+ let PROCESS_UNIQUE = null;
2014
+ const kId = Symbol('id');
2015
+ class ObjectId extends BSONValue {
2016
+ get _bsontype() {
2017
+ return 'ObjectId';
2018
+ }
2019
+ constructor(inputId) {
2020
+ super();
2021
+ let workingId;
2022
+ if (typeof inputId === 'object' && inputId && 'id' in inputId) {
2023
+ if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) {
2024
+ throw new BSONError('Argument passed in must have an id that is of type string or Buffer');
2025
+ }
2026
+ if ('toHexString' in inputId && typeof inputId.toHexString === 'function') {
2027
+ workingId = ByteUtils.fromHex(inputId.toHexString());
2028
+ }
2029
+ else {
2030
+ workingId = inputId.id;
2031
+ }
2032
+ }
2033
+ else {
2034
+ workingId = inputId;
2035
+ }
2036
+ if (workingId == null || typeof workingId === 'number') {
2037
+ this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined);
2038
+ }
2039
+ else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) {
2040
+ this[kId] = ByteUtils.toLocalBufferType(workingId);
2041
+ }
2042
+ else if (typeof workingId === 'string') {
2043
+ if (workingId.length === 12) {
2044
+ const bytes = ByteUtils.fromUTF8(workingId);
2045
+ if (bytes.byteLength === 12) {
2046
+ this[kId] = bytes;
2047
+ }
2048
+ else {
2049
+ throw new BSONError('Argument passed in must be a string of 12 bytes');
2050
+ }
2051
+ }
2052
+ else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) {
2053
+ this[kId] = ByteUtils.fromHex(workingId);
2054
+ }
2055
+ else {
2056
+ throw new BSONError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer');
2057
+ }
2058
+ }
2059
+ else {
2060
+ throw new BSONError('Argument passed in does not match the accepted types');
2061
+ }
2062
+ if (ObjectId.cacheHexString) {
2063
+ this.__id = ByteUtils.toHex(this.id);
2064
+ }
2065
+ }
2066
+ get id() {
2067
+ return this[kId];
2068
+ }
2069
+ set id(value) {
2070
+ this[kId] = value;
2071
+ if (ObjectId.cacheHexString) {
2072
+ this.__id = ByteUtils.toHex(value);
2073
+ }
2074
+ }
2075
+ toHexString() {
2076
+ if (ObjectId.cacheHexString && this.__id) {
2077
+ return this.__id;
2078
+ }
2079
+ const hexString = ByteUtils.toHex(this.id);
2080
+ if (ObjectId.cacheHexString && !this.__id) {
2081
+ this.__id = hexString;
2082
+ }
2083
+ return hexString;
2084
+ }
2085
+ static getInc() {
2086
+ return (ObjectId.index = (ObjectId.index + 1) % 0xffffff);
2087
+ }
2088
+ static generate(time) {
2089
+ if ('number' !== typeof time) {
2090
+ time = Math.floor(Date.now() / 1000);
2091
+ }
2092
+ const inc = ObjectId.getInc();
2093
+ const buffer = ByteUtils.allocate(12);
2094
+ BSONDataView.fromUint8Array(buffer).setUint32(0, time, false);
2095
+ if (PROCESS_UNIQUE === null) {
2096
+ PROCESS_UNIQUE = ByteUtils.randomBytes(5);
2097
+ }
2098
+ buffer[4] = PROCESS_UNIQUE[0];
2099
+ buffer[5] = PROCESS_UNIQUE[1];
2100
+ buffer[6] = PROCESS_UNIQUE[2];
2101
+ buffer[7] = PROCESS_UNIQUE[3];
2102
+ buffer[8] = PROCESS_UNIQUE[4];
2103
+ buffer[11] = inc & 0xff;
2104
+ buffer[10] = (inc >> 8) & 0xff;
2105
+ buffer[9] = (inc >> 16) & 0xff;
2106
+ return buffer;
2107
+ }
2108
+ toString(encoding) {
2109
+ if (encoding === 'base64')
2110
+ return ByteUtils.toBase64(this.id);
2111
+ if (encoding === 'hex')
2112
+ return this.toHexString();
2113
+ return this.toHexString();
2114
+ }
2115
+ toJSON() {
2116
+ return this.toHexString();
2117
+ }
2118
+ equals(otherId) {
2119
+ if (otherId === undefined || otherId === null) {
2120
+ return false;
2121
+ }
2122
+ if (otherId instanceof ObjectId) {
2123
+ return this[kId][11] === otherId[kId][11] && ByteUtils.equals(this[kId], otherId[kId]);
2124
+ }
2125
+ if (typeof otherId === 'string' &&
2126
+ ObjectId.isValid(otherId) &&
2127
+ otherId.length === 12 &&
2128
+ isUint8Array(this.id)) {
2129
+ return ByteUtils.equals(this.id, ByteUtils.fromISO88591(otherId));
2130
+ }
2131
+ if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) {
2132
+ return otherId.toLowerCase() === this.toHexString();
2133
+ }
2134
+ if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) {
2135
+ return ByteUtils.equals(ByteUtils.fromUTF8(otherId), this.id);
2136
+ }
2137
+ if (typeof otherId === 'object' &&
2138
+ 'toHexString' in otherId &&
2139
+ typeof otherId.toHexString === 'function') {
2140
+ const otherIdString = otherId.toHexString();
2141
+ const thisIdString = this.toHexString().toLowerCase();
2142
+ return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString;
2143
+ }
2144
+ return false;
2145
+ }
2146
+ getTimestamp() {
2147
+ const timestamp = new Date();
2148
+ const time = BSONDataView.fromUint8Array(this.id).getUint32(0, false);
2149
+ timestamp.setTime(Math.floor(time) * 1000);
2150
+ return timestamp;
2151
+ }
2152
+ static createPk() {
2153
+ return new ObjectId();
2154
+ }
2155
+ static createFromTime(time) {
2156
+ const buffer = ByteUtils.fromNumberArray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
2157
+ BSONDataView.fromUint8Array(buffer).setUint32(0, time, false);
2158
+ return new ObjectId(buffer);
2159
+ }
2160
+ static createFromHexString(hexString) {
2161
+ if (hexString?.length !== 24) {
2162
+ throw new BSONError('hex string must be 24 characters');
2163
+ }
2164
+ return new ObjectId(ByteUtils.fromHex(hexString));
2165
+ }
2166
+ static createFromBase64(base64) {
2167
+ if (base64?.length !== 16) {
2168
+ throw new BSONError('base64 string must be 16 characters');
2169
+ }
2170
+ return new ObjectId(ByteUtils.fromBase64(base64));
2171
+ }
2172
+ static isValid(id) {
2173
+ if (id == null)
2174
+ return false;
2175
+ try {
2176
+ new ObjectId(id);
2177
+ return true;
2178
+ }
2179
+ catch {
2180
+ return false;
2181
+ }
2182
+ }
2183
+ toExtendedJSON() {
2184
+ if (this.toHexString)
2185
+ return { $oid: this.toHexString() };
2186
+ return { $oid: this.toString('hex') };
2187
+ }
2188
+ static fromExtendedJSON(doc) {
2189
+ return new ObjectId(doc.$oid);
2190
+ }
2191
+ [Symbol.for('nodejs.util.inspect.custom')]() {
2192
+ return this.inspect();
2193
+ }
2194
+ inspect() {
2195
+ return `new ObjectId("${this.toHexString()}")`;
2196
+ }
2197
+ }
2198
+ ObjectId.index = Math.floor(Math.random() * 0xffffff);
2199
+
2200
+ function internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined) {
2201
+ let totalLength = 4 + 1;
2202
+ if (Array.isArray(object)) {
2203
+ for (let i = 0; i < object.length; i++) {
2204
+ totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined);
2205
+ }
2206
+ }
2207
+ else {
2208
+ if (typeof object?.toBSON === 'function') {
2209
+ object = object.toBSON();
2210
+ }
2211
+ for (const key of Object.keys(object)) {
2212
+ totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
2213
+ }
2214
+ }
2215
+ return totalLength;
2216
+ }
2217
+ function calculateElement(name, value, serializeFunctions = false, isArray = false, ignoreUndefined = false) {
2218
+ if (typeof value?.toBSON === 'function') {
2219
+ value = value.toBSON();
2220
+ }
2221
+ switch (typeof value) {
2222
+ case 'string':
2223
+ return 1 + ByteUtils.utf8ByteLength(name) + 1 + 4 + ByteUtils.utf8ByteLength(value) + 1;
2224
+ case 'number':
2225
+ if (Math.floor(value) === value &&
2226
+ value >= JS_INT_MIN &&
2227
+ value <= JS_INT_MAX) {
2228
+ if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) {
2229
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (4 + 1);
2230
+ }
2231
+ else {
2232
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1);
2233
+ }
2234
+ }
2235
+ else {
2236
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1);
2237
+ }
2238
+ case 'undefined':
2239
+ if (isArray || !ignoreUndefined)
2240
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1;
2241
+ return 0;
2242
+ case 'boolean':
2243
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (1 + 1);
2244
+ case 'object':
2245
+ if (value != null &&
2246
+ typeof value._bsontype === 'string' &&
2247
+ value[Symbol.for('@@mdb.bson.version')] !== BSON_MAJOR_VERSION) {
2248
+ throw new BSONVersionError();
2249
+ }
2250
+ else if (value == null || value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') {
2251
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + 1;
2252
+ }
2253
+ else if (value._bsontype === 'ObjectId') {
2254
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (12 + 1);
2255
+ }
2256
+ else if (value instanceof Date || isDate(value)) {
2257
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1);
2258
+ }
2259
+ else if (ArrayBuffer.isView(value) ||
2260
+ value instanceof ArrayBuffer ||
2261
+ isAnyArrayBuffer(value)) {
2262
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (1 + 4 + 1) + value.byteLength);
2263
+ }
2264
+ else if (value._bsontype === 'Long' ||
2265
+ value._bsontype === 'Double' ||
2266
+ value._bsontype === 'Timestamp') {
2267
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (8 + 1);
2268
+ }
2269
+ else if (value._bsontype === 'Decimal128') {
2270
+ return (name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (16 + 1);
2271
+ }
2272
+ else if (value._bsontype === 'Code') {
2273
+ if (value.scope != null && Object.keys(value.scope).length > 0) {
2274
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2275
+ 1 +
2276
+ 4 +
2277
+ 4 +
2278
+ ByteUtils.utf8ByteLength(value.code.toString()) +
2279
+ 1 +
2280
+ internalCalculateObjectSize(value.scope, serializeFunctions, ignoreUndefined));
2281
+ }
2282
+ else {
2283
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2284
+ 1 +
2285
+ 4 +
2286
+ ByteUtils.utf8ByteLength(value.code.toString()) +
2287
+ 1);
2288
+ }
2289
+ }
2290
+ else if (value._bsontype === 'Binary') {
2291
+ const binary = value;
2292
+ if (binary.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
2293
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2294
+ (binary.position + 1 + 4 + 1 + 4));
2295
+ }
2296
+ else {
2297
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) + (binary.position + 1 + 4 + 1));
2298
+ }
2299
+ }
2300
+ else if (value._bsontype === 'Symbol') {
2301
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2302
+ ByteUtils.utf8ByteLength(value.value) +
2303
+ 4 +
2304
+ 1 +
2305
+ 1);
2306
+ }
2307
+ else if (value._bsontype === 'DBRef') {
2308
+ const ordered_values = Object.assign({
2309
+ $ref: value.collection,
2310
+ $id: value.oid
2311
+ }, value.fields);
2312
+ if (value.db != null) {
2313
+ ordered_values['$db'] = value.db;
2314
+ }
2315
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2316
+ 1 +
2317
+ internalCalculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined));
2318
+ }
2319
+ else if (value instanceof RegExp || isRegExp(value)) {
2320
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2321
+ 1 +
2322
+ ByteUtils.utf8ByteLength(value.source) +
2323
+ 1 +
2324
+ (value.global ? 1 : 0) +
2325
+ (value.ignoreCase ? 1 : 0) +
2326
+ (value.multiline ? 1 : 0) +
2327
+ 1);
2328
+ }
2329
+ else if (value._bsontype === 'BSONRegExp') {
2330
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2331
+ 1 +
2332
+ ByteUtils.utf8ByteLength(value.pattern) +
2333
+ 1 +
2334
+ ByteUtils.utf8ByteLength(value.options) +
2335
+ 1);
2336
+ }
2337
+ else {
2338
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2339
+ internalCalculateObjectSize(value, serializeFunctions, ignoreUndefined) +
2340
+ 1);
2341
+ }
2342
+ case 'function':
2343
+ if (serializeFunctions) {
2344
+ return ((name != null ? ByteUtils.utf8ByteLength(name) + 1 : 0) +
2345
+ 1 +
2346
+ 4 +
2347
+ ByteUtils.utf8ByteLength(value.toString()) +
2348
+ 1);
2349
+ }
2350
+ }
2351
+ return 0;
2352
+ }
2353
+
2354
+ function alphabetize(str) {
2355
+ return str.split('').sort().join('');
2356
+ }
2357
+ class BSONRegExp extends BSONValue {
2358
+ get _bsontype() {
2359
+ return 'BSONRegExp';
2360
+ }
2361
+ constructor(pattern, options) {
2362
+ super();
2363
+ this.pattern = pattern;
2364
+ this.options = alphabetize(options ?? '');
2365
+ if (this.pattern.indexOf('\x00') !== -1) {
2366
+ throw new BSONError(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);
2367
+ }
2368
+ if (this.options.indexOf('\x00') !== -1) {
2369
+ throw new BSONError(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);
2370
+ }
2371
+ for (let i = 0; i < this.options.length; i++) {
2372
+ if (!(this.options[i] === 'i' ||
2373
+ this.options[i] === 'm' ||
2374
+ this.options[i] === 'x' ||
2375
+ this.options[i] === 'l' ||
2376
+ this.options[i] === 's' ||
2377
+ this.options[i] === 'u')) {
2378
+ throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`);
2379
+ }
2380
+ }
2381
+ }
2382
+ static parseOptions(options) {
2383
+ return options ? options.split('').sort().join('') : '';
2384
+ }
2385
+ toExtendedJSON(options) {
2386
+ options = options || {};
2387
+ if (options.legacy) {
2388
+ return { $regex: this.pattern, $options: this.options };
2389
+ }
2390
+ return { $regularExpression: { pattern: this.pattern, options: this.options } };
2391
+ }
2392
+ static fromExtendedJSON(doc) {
2393
+ if ('$regex' in doc) {
2394
+ if (typeof doc.$regex !== 'string') {
2395
+ if (doc.$regex._bsontype === 'BSONRegExp') {
2396
+ return doc;
2397
+ }
2398
+ }
2399
+ else {
2400
+ return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options));
2401
+ }
2402
+ }
2403
+ if ('$regularExpression' in doc) {
2404
+ return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options));
2405
+ }
2406
+ throw new BSONError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`);
2407
+ }
2408
+ [Symbol.for('nodejs.util.inspect.custom')]() {
2409
+ return this.inspect();
2410
+ }
2411
+ inspect() {
2412
+ return `new BSONRegExp(${JSON.stringify(this.pattern)}, ${JSON.stringify(this.options)})`;
2413
+ }
2414
+ }
2415
+
2416
+ class BSONSymbol extends BSONValue {
2417
+ get _bsontype() {
2418
+ return 'BSONSymbol';
2419
+ }
2420
+ constructor(value) {
2421
+ super();
2422
+ this.value = value;
2423
+ }
2424
+ valueOf() {
2425
+ return this.value;
2426
+ }
2427
+ toString() {
2428
+ return this.value;
2429
+ }
2430
+ inspect() {
2431
+ return `new BSONSymbol("${this.value}")`;
2432
+ }
2433
+ toJSON() {
2434
+ return this.value;
2435
+ }
2436
+ toExtendedJSON() {
2437
+ return { $symbol: this.value };
2438
+ }
2439
+ static fromExtendedJSON(doc) {
2440
+ return new BSONSymbol(doc.$symbol);
2441
+ }
2442
+ [Symbol.for('nodejs.util.inspect.custom')]() {
2443
+ return this.inspect();
2444
+ }
2445
+ }
2446
+
2447
+ const LongWithoutOverridesClass = Long;
2448
+ class Timestamp extends LongWithoutOverridesClass {
2449
+ get _bsontype() {
2450
+ return 'Timestamp';
2451
+ }
2452
+ constructor(low) {
2453
+ if (low == null) {
2454
+ super(0, 0, true);
2455
+ }
2456
+ else if (typeof low === 'bigint') {
2457
+ super(low, true);
2458
+ }
2459
+ else if (Long.isLong(low)) {
2460
+ super(low.low, low.high, true);
2461
+ }
2462
+ else if (typeof low === 'object' && 't' in low && 'i' in low) {
2463
+ if (typeof low.t !== 'number' && (typeof low.t !== 'object' || low.t._bsontype !== 'Int32')) {
2464
+ throw new BSONError('Timestamp constructed from { t, i } must provide t as a number');
2465
+ }
2466
+ if (typeof low.i !== 'number' && (typeof low.i !== 'object' || low.i._bsontype !== 'Int32')) {
2467
+ throw new BSONError('Timestamp constructed from { t, i } must provide i as a number');
2468
+ }
2469
+ const t = Number(low.t);
2470
+ const i = Number(low.i);
2471
+ if (t < 0 || Number.isNaN(t)) {
2472
+ throw new BSONError('Timestamp constructed from { t, i } must provide a positive t');
2473
+ }
2474
+ if (i < 0 || Number.isNaN(i)) {
2475
+ throw new BSONError('Timestamp constructed from { t, i } must provide a positive i');
2476
+ }
2477
+ if (t > 4294967295) {
2478
+ throw new BSONError('Timestamp constructed from { t, i } must provide t equal or less than uint32 max');
2479
+ }
2480
+ if (i > 4294967295) {
2481
+ throw new BSONError('Timestamp constructed from { t, i } must provide i equal or less than uint32 max');
2482
+ }
2483
+ super(i, t, true);
2484
+ }
2485
+ else {
2486
+ throw new BSONError('A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }');
2487
+ }
2488
+ }
2489
+ toJSON() {
2490
+ return {
2491
+ $timestamp: this.toString()
2492
+ };
2493
+ }
2494
+ static fromInt(value) {
2495
+ return new Timestamp(Long.fromInt(value, true));
2496
+ }
2497
+ static fromNumber(value) {
2498
+ return new Timestamp(Long.fromNumber(value, true));
2499
+ }
2500
+ static fromBits(lowBits, highBits) {
2501
+ return new Timestamp({ i: lowBits, t: highBits });
2502
+ }
2503
+ static fromString(str, optRadix) {
2504
+ return new Timestamp(Long.fromString(str, true, optRadix));
2505
+ }
2506
+ toExtendedJSON() {
2507
+ return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } };
2508
+ }
2509
+ static fromExtendedJSON(doc) {
2510
+ const i = Long.isLong(doc.$timestamp.i)
2511
+ ? doc.$timestamp.i.getLowBitsUnsigned()
2512
+ : doc.$timestamp.i;
2513
+ const t = Long.isLong(doc.$timestamp.t)
2514
+ ? doc.$timestamp.t.getLowBitsUnsigned()
2515
+ : doc.$timestamp.t;
2516
+ return new Timestamp({ t, i });
2517
+ }
2518
+ [Symbol.for('nodejs.util.inspect.custom')]() {
2519
+ return this.inspect();
2520
+ }
2521
+ inspect() {
2522
+ return `new Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`;
2523
+ }
2524
+ }
2525
+ Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE;
2526
+
2527
+ const FIRST_BIT = 0x80;
2528
+ const FIRST_TWO_BITS = 0xc0;
2529
+ const FIRST_THREE_BITS = 0xe0;
2530
+ const FIRST_FOUR_BITS = 0xf0;
2531
+ const FIRST_FIVE_BITS = 0xf8;
2532
+ const TWO_BIT_CHAR = 0xc0;
2533
+ const THREE_BIT_CHAR = 0xe0;
2534
+ const FOUR_BIT_CHAR = 0xf0;
2535
+ const CONTINUING_CHAR = 0x80;
2536
+ function validateUtf8(bytes, start, end) {
2537
+ let continuation = 0;
2538
+ for (let i = start; i < end; i += 1) {
2539
+ const byte = bytes[i];
2540
+ if (continuation) {
2541
+ if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) {
2542
+ return false;
2543
+ }
2544
+ continuation -= 1;
2545
+ }
2546
+ else if (byte & FIRST_BIT) {
2547
+ if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) {
2548
+ continuation = 1;
2549
+ }
2550
+ else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) {
2551
+ continuation = 2;
2552
+ }
2553
+ else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) {
2554
+ continuation = 3;
2555
+ }
2556
+ else {
2557
+ return false;
2558
+ }
2559
+ }
2560
+ }
2561
+ return !continuation;
2562
+ }
2563
+
2564
+ const JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX);
2565
+ const JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN);
2566
+ function internalDeserialize(buffer, options, isArray) {
2567
+ options = options == null ? {} : options;
2568
+ const index = options && options.index ? options.index : 0;
2569
+ const size = buffer[index] |
2570
+ (buffer[index + 1] << 8) |
2571
+ (buffer[index + 2] << 16) |
2572
+ (buffer[index + 3] << 24);
2573
+ if (size < 5) {
2574
+ throw new BSONError(`bson size must be >= 5, is ${size}`);
2575
+ }
2576
+ if (options.allowObjectSmallerThanBufferSize && buffer.length < size) {
2577
+ throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`);
2578
+ }
2579
+ if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) {
2580
+ throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`);
2581
+ }
2582
+ if (size + index > buffer.byteLength) {
2583
+ throw new BSONError(`(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})`);
2584
+ }
2585
+ if (buffer[index + size - 1] !== 0) {
2586
+ throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
2587
+ }
2588
+ return deserializeObject(buffer, index, options, isArray);
2589
+ }
2590
+ const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/;
2591
+ function deserializeObject(buffer, index, options, isArray = false) {
2592
+ const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
2593
+ const raw = options['raw'] == null ? false : options['raw'];
2594
+ const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false;
2595
+ const promoteBuffers = options.promoteBuffers ?? false;
2596
+ const promoteLongs = options.promoteLongs ?? true;
2597
+ const promoteValues = options.promoteValues ?? true;
2598
+ const useBigInt64 = options.useBigInt64 ?? false;
2599
+ if (useBigInt64 && !promoteValues) {
2600
+ throw new BSONError('Must either request bigint or Long for int64 deserialization');
2601
+ }
2602
+ if (useBigInt64 && !promoteLongs) {
2603
+ throw new BSONError('Must either request bigint or Long for int64 deserialization');
2604
+ }
2605
+ const validation = options.validation == null ? { utf8: true } : options.validation;
2606
+ let globalUTFValidation = true;
2607
+ let validationSetting;
2608
+ const utf8KeysSet = new Set();
2609
+ const utf8ValidatedKeys = validation.utf8;
2610
+ if (typeof utf8ValidatedKeys === 'boolean') {
2611
+ validationSetting = utf8ValidatedKeys;
2612
+ }
2613
+ else {
2614
+ globalUTFValidation = false;
2615
+ const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) {
2616
+ return utf8ValidatedKeys[key];
2617
+ });
2618
+ if (utf8ValidationValues.length === 0) {
2619
+ throw new BSONError('UTF-8 validation setting cannot be empty');
2620
+ }
2621
+ if (typeof utf8ValidationValues[0] !== 'boolean') {
2622
+ throw new BSONError('Invalid UTF-8 validation option, must specify boolean values');
2623
+ }
2624
+ validationSetting = utf8ValidationValues[0];
2625
+ if (!utf8ValidationValues.every(item => item === validationSetting)) {
2626
+ throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false');
2627
+ }
2628
+ }
2629
+ if (!globalUTFValidation) {
2630
+ for (const key of Object.keys(utf8ValidatedKeys)) {
2631
+ utf8KeysSet.add(key);
2632
+ }
2633
+ }
2634
+ const startIndex = index;
2635
+ if (buffer.length < 5)
2636
+ throw new BSONError('corrupt bson message < 5 bytes long');
2637
+ const size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
2638
+ if (size < 5 || size > buffer.length)
2639
+ throw new BSONError('corrupt bson message');
2640
+ const object = isArray ? [] : {};
2641
+ let arrayIndex = 0;
2642
+ const done = false;
2643
+ let isPossibleDBRef = isArray ? false : null;
2644
+ const dataview = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
2645
+ while (!done) {
2646
+ const elementType = buffer[index++];
2647
+ if (elementType === 0)
2648
+ break;
2649
+ let i = index;
2650
+ while (buffer[i] !== 0x00 && i < buffer.length) {
2651
+ i++;
2652
+ }
2653
+ if (i >= buffer.byteLength)
2654
+ throw new BSONError('Bad BSON Document: illegal CString');
2655
+ const name = isArray ? arrayIndex++ : ByteUtils.toUTF8(buffer, index, i);
2656
+ let shouldValidateKey = true;
2657
+ if (globalUTFValidation || utf8KeysSet.has(name)) {
2658
+ shouldValidateKey = validationSetting;
2659
+ }
2660
+ else {
2661
+ shouldValidateKey = !validationSetting;
2662
+ }
2663
+ if (isPossibleDBRef !== false && name[0] === '$') {
2664
+ isPossibleDBRef = allowedDBRefKeys.test(name);
2665
+ }
2666
+ let value;
2667
+ index = i + 1;
2668
+ if (elementType === BSON_DATA_STRING) {
2669
+ const stringSize = buffer[index++] |
2670
+ (buffer[index++] << 8) |
2671
+ (buffer[index++] << 16) |
2672
+ (buffer[index++] << 24);
2673
+ if (stringSize <= 0 ||
2674
+ stringSize > buffer.length - index ||
2675
+ buffer[index + stringSize - 1] !== 0) {
2676
+ throw new BSONError('bad string length in bson');
2677
+ }
2678
+ value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey);
2679
+ index = index + stringSize;
2680
+ }
2681
+ else if (elementType === BSON_DATA_OID) {
2682
+ const oid = ByteUtils.allocate(12);
2683
+ oid.set(buffer.subarray(index, index + 12));
2684
+ value = new ObjectId(oid);
2685
+ index = index + 12;
2686
+ }
2687
+ else if (elementType === BSON_DATA_INT && promoteValues === false) {
2688
+ value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24));
2689
+ }
2690
+ else if (elementType === BSON_DATA_INT) {
2691
+ value =
2692
+ buffer[index++] |
2693
+ (buffer[index++] << 8) |
2694
+ (buffer[index++] << 16) |
2695
+ (buffer[index++] << 24);
2696
+ }
2697
+ else if (elementType === BSON_DATA_NUMBER && promoteValues === false) {
2698
+ value = new Double(dataview.getFloat64(index, true));
2699
+ index = index + 8;
2700
+ }
2701
+ else if (elementType === BSON_DATA_NUMBER) {
2702
+ value = dataview.getFloat64(index, true);
2703
+ index = index + 8;
2704
+ }
2705
+ else if (elementType === BSON_DATA_DATE) {
2706
+ const lowBits = buffer[index++] |
2707
+ (buffer[index++] << 8) |
2708
+ (buffer[index++] << 16) |
2709
+ (buffer[index++] << 24);
2710
+ const highBits = buffer[index++] |
2711
+ (buffer[index++] << 8) |
2712
+ (buffer[index++] << 16) |
2713
+ (buffer[index++] << 24);
2714
+ value = new Date(new Long(lowBits, highBits).toNumber());
2715
+ }
2716
+ else if (elementType === BSON_DATA_BOOLEAN) {
2717
+ if (buffer[index] !== 0 && buffer[index] !== 1)
2718
+ throw new BSONError('illegal boolean type value');
2719
+ value = buffer[index++] === 1;
2720
+ }
2721
+ else if (elementType === BSON_DATA_OBJECT) {
2722
+ const _index = index;
2723
+ const objectSize = buffer[index] |
2724
+ (buffer[index + 1] << 8) |
2725
+ (buffer[index + 2] << 16) |
2726
+ (buffer[index + 3] << 24);
2727
+ if (objectSize <= 0 || objectSize > buffer.length - index)
2728
+ throw new BSONError('bad embedded document length in bson');
2729
+ if (raw) {
2730
+ value = buffer.slice(index, index + objectSize);
2731
+ }
2732
+ else {
2733
+ let objectOptions = options;
2734
+ if (!globalUTFValidation) {
2735
+ objectOptions = { ...options, validation: { utf8: shouldValidateKey } };
2736
+ }
2737
+ value = deserializeObject(buffer, _index, objectOptions, false);
2738
+ }
2739
+ index = index + objectSize;
2740
+ }
2741
+ else if (elementType === BSON_DATA_ARRAY) {
2742
+ const _index = index;
2743
+ const objectSize = buffer[index] |
2744
+ (buffer[index + 1] << 8) |
2745
+ (buffer[index + 2] << 16) |
2746
+ (buffer[index + 3] << 24);
2747
+ let arrayOptions = options;
2748
+ const stopIndex = index + objectSize;
2749
+ if (fieldsAsRaw && fieldsAsRaw[name]) {
2750
+ arrayOptions = { ...options, raw: true };
2751
+ }
2752
+ if (!globalUTFValidation) {
2753
+ arrayOptions = { ...arrayOptions, validation: { utf8: shouldValidateKey } };
2754
+ }
2755
+ value = deserializeObject(buffer, _index, arrayOptions, true);
2756
+ index = index + objectSize;
2757
+ if (buffer[index - 1] !== 0)
2758
+ throw new BSONError('invalid array terminator byte');
2759
+ if (index !== stopIndex)
2760
+ throw new BSONError('corrupted array bson');
2761
+ }
2762
+ else if (elementType === BSON_DATA_UNDEFINED) {
2763
+ value = undefined;
2764
+ }
2765
+ else if (elementType === BSON_DATA_NULL) {
2766
+ value = null;
2767
+ }
2768
+ else if (elementType === BSON_DATA_LONG) {
2769
+ const dataview = BSONDataView.fromUint8Array(buffer.subarray(index, index + 8));
2770
+ const lowBits = buffer[index++] |
2771
+ (buffer[index++] << 8) |
2772
+ (buffer[index++] << 16) |
2773
+ (buffer[index++] << 24);
2774
+ const highBits = buffer[index++] |
2775
+ (buffer[index++] << 8) |
2776
+ (buffer[index++] << 16) |
2777
+ (buffer[index++] << 24);
2778
+ const long = new Long(lowBits, highBits);
2779
+ if (useBigInt64) {
2780
+ value = dataview.getBigInt64(0, true);
2781
+ }
2782
+ else if (promoteLongs && promoteValues === true) {
2783
+ value =
2784
+ long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG)
2785
+ ? long.toNumber()
2786
+ : long;
2787
+ }
2788
+ else {
2789
+ value = long;
2790
+ }
2791
+ }
2792
+ else if (elementType === BSON_DATA_DECIMAL128) {
2793
+ const bytes = ByteUtils.allocate(16);
2794
+ bytes.set(buffer.subarray(index, index + 16), 0);
2795
+ index = index + 16;
2796
+ value = new Decimal128(bytes);
2797
+ }
2798
+ else if (elementType === BSON_DATA_BINARY) {
2799
+ let binarySize = buffer[index++] |
2800
+ (buffer[index++] << 8) |
2801
+ (buffer[index++] << 16) |
2802
+ (buffer[index++] << 24);
2803
+ const totalBinarySize = binarySize;
2804
+ const subType = buffer[index++];
2805
+ if (binarySize < 0)
2806
+ throw new BSONError('Negative binary type element size found');
2807
+ if (binarySize > buffer.byteLength)
2808
+ throw new BSONError('Binary type size larger than document size');
2809
+ if (buffer['slice'] != null) {
2810
+ if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
2811
+ binarySize =
2812
+ buffer[index++] |
2813
+ (buffer[index++] << 8) |
2814
+ (buffer[index++] << 16) |
2815
+ (buffer[index++] << 24);
2816
+ if (binarySize < 0)
2817
+ throw new BSONError('Negative binary type element size found for subtype 0x02');
2818
+ if (binarySize > totalBinarySize - 4)
2819
+ throw new BSONError('Binary type with subtype 0x02 contains too long binary size');
2820
+ if (binarySize < totalBinarySize - 4)
2821
+ throw new BSONError('Binary type with subtype 0x02 contains too short binary size');
2822
+ }
2823
+ if (promoteBuffers && promoteValues) {
2824
+ value = ByteUtils.toLocalBufferType(buffer.slice(index, index + binarySize));
2825
+ }
2826
+ else {
2827
+ value = new Binary(buffer.slice(index, index + binarySize), subType);
2828
+ if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) {
2829
+ value = value.toUUID();
2830
+ }
2831
+ }
2832
+ }
2833
+ else {
2834
+ const _buffer = ByteUtils.allocate(binarySize);
2835
+ if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
2836
+ binarySize =
2837
+ buffer[index++] |
2838
+ (buffer[index++] << 8) |
2839
+ (buffer[index++] << 16) |
2840
+ (buffer[index++] << 24);
2841
+ if (binarySize < 0)
2842
+ throw new BSONError('Negative binary type element size found for subtype 0x02');
2843
+ if (binarySize > totalBinarySize - 4)
2844
+ throw new BSONError('Binary type with subtype 0x02 contains too long binary size');
2845
+ if (binarySize < totalBinarySize - 4)
2846
+ throw new BSONError('Binary type with subtype 0x02 contains too short binary size');
2847
+ }
2848
+ for (i = 0; i < binarySize; i++) {
2849
+ _buffer[i] = buffer[index + i];
2850
+ }
2851
+ if (promoteBuffers && promoteValues) {
2852
+ value = _buffer;
2853
+ }
2854
+ else {
2855
+ value = new Binary(buffer.slice(index, index + binarySize), subType);
2856
+ if (subType === BSON_BINARY_SUBTYPE_UUID_NEW && UUID.isValid(value)) {
2857
+ value = value.toUUID();
2858
+ }
2859
+ }
2860
+ }
2861
+ index = index + binarySize;
2862
+ }
2863
+ else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) {
2864
+ i = index;
2865
+ while (buffer[i] !== 0x00 && i < buffer.length) {
2866
+ i++;
2867
+ }
2868
+ if (i >= buffer.length)
2869
+ throw new BSONError('Bad BSON Document: illegal CString');
2870
+ const source = ByteUtils.toUTF8(buffer, index, i);
2871
+ index = i + 1;
2872
+ i = index;
2873
+ while (buffer[i] !== 0x00 && i < buffer.length) {
2874
+ i++;
2875
+ }
2876
+ if (i >= buffer.length)
2877
+ throw new BSONError('Bad BSON Document: illegal CString');
2878
+ const regExpOptions = ByteUtils.toUTF8(buffer, index, i);
2879
+ index = i + 1;
2880
+ const optionsArray = new Array(regExpOptions.length);
2881
+ for (i = 0; i < regExpOptions.length; i++) {
2882
+ switch (regExpOptions[i]) {
2883
+ case 'm':
2884
+ optionsArray[i] = 'm';
2885
+ break;
2886
+ case 's':
2887
+ optionsArray[i] = 'g';
2888
+ break;
2889
+ case 'i':
2890
+ optionsArray[i] = 'i';
2891
+ break;
2892
+ }
2893
+ }
2894
+ value = new RegExp(source, optionsArray.join(''));
2895
+ }
2896
+ else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) {
2897
+ i = index;
2898
+ while (buffer[i] !== 0x00 && i < buffer.length) {
2899
+ i++;
2900
+ }
2901
+ if (i >= buffer.length)
2902
+ throw new BSONError('Bad BSON Document: illegal CString');
2903
+ const source = ByteUtils.toUTF8(buffer, index, i);
2904
+ index = i + 1;
2905
+ i = index;
2906
+ while (buffer[i] !== 0x00 && i < buffer.length) {
2907
+ i++;
2908
+ }
2909
+ if (i >= buffer.length)
2910
+ throw new BSONError('Bad BSON Document: illegal CString');
2911
+ const regExpOptions = ByteUtils.toUTF8(buffer, index, i);
2912
+ index = i + 1;
2913
+ value = new BSONRegExp(source, regExpOptions);
2914
+ }
2915
+ else if (elementType === BSON_DATA_SYMBOL) {
2916
+ const stringSize = buffer[index++] |
2917
+ (buffer[index++] << 8) |
2918
+ (buffer[index++] << 16) |
2919
+ (buffer[index++] << 24);
2920
+ if (stringSize <= 0 ||
2921
+ stringSize > buffer.length - index ||
2922
+ buffer[index + stringSize - 1] !== 0) {
2923
+ throw new BSONError('bad string length in bson');
2924
+ }
2925
+ const symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey);
2926
+ value = promoteValues ? symbol : new BSONSymbol(symbol);
2927
+ index = index + stringSize;
2928
+ }
2929
+ else if (elementType === BSON_DATA_TIMESTAMP) {
2930
+ const i = buffer[index++] +
2931
+ buffer[index++] * (1 << 8) +
2932
+ buffer[index++] * (1 << 16) +
2933
+ buffer[index++] * (1 << 24);
2934
+ const t = buffer[index++] +
2935
+ buffer[index++] * (1 << 8) +
2936
+ buffer[index++] * (1 << 16) +
2937
+ buffer[index++] * (1 << 24);
2938
+ value = new Timestamp({ i, t });
2939
+ }
2940
+ else if (elementType === BSON_DATA_MIN_KEY) {
2941
+ value = new MinKey();
2942
+ }
2943
+ else if (elementType === BSON_DATA_MAX_KEY) {
2944
+ value = new MaxKey();
2945
+ }
2946
+ else if (elementType === BSON_DATA_CODE) {
2947
+ const stringSize = buffer[index++] |
2948
+ (buffer[index++] << 8) |
2949
+ (buffer[index++] << 16) |
2950
+ (buffer[index++] << 24);
2951
+ if (stringSize <= 0 ||
2952
+ stringSize > buffer.length - index ||
2953
+ buffer[index + stringSize - 1] !== 0) {
2954
+ throw new BSONError('bad string length in bson');
2955
+ }
2956
+ const functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey);
2957
+ value = new Code(functionString);
2958
+ index = index + stringSize;
2959
+ }
2960
+ else if (elementType === BSON_DATA_CODE_W_SCOPE) {
2961
+ const totalSize = buffer[index++] |
2962
+ (buffer[index++] << 8) |
2963
+ (buffer[index++] << 16) |
2964
+ (buffer[index++] << 24);
2965
+ if (totalSize < 4 + 4 + 4 + 1) {
2966
+ throw new BSONError('code_w_scope total size shorter minimum expected length');
2967
+ }
2968
+ const stringSize = buffer[index++] |
2969
+ (buffer[index++] << 8) |
2970
+ (buffer[index++] << 16) |
2971
+ (buffer[index++] << 24);
2972
+ if (stringSize <= 0 ||
2973
+ stringSize > buffer.length - index ||
2974
+ buffer[index + stringSize - 1] !== 0) {
2975
+ throw new BSONError('bad string length in bson');
2976
+ }
2977
+ const functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey);
2978
+ index = index + stringSize;
2979
+ const _index = index;
2980
+ const objectSize = buffer[index] |
2981
+ (buffer[index + 1] << 8) |
2982
+ (buffer[index + 2] << 16) |
2983
+ (buffer[index + 3] << 24);
2984
+ const scopeObject = deserializeObject(buffer, _index, options, false);
2985
+ index = index + objectSize;
2986
+ if (totalSize < 4 + 4 + objectSize + stringSize) {
2987
+ throw new BSONError('code_w_scope total size is too short, truncating scope');
2988
+ }
2989
+ if (totalSize > 4 + 4 + objectSize + stringSize) {
2990
+ throw new BSONError('code_w_scope total size is too long, clips outer document');
2991
+ }
2992
+ value = new Code(functionString, scopeObject);
2993
+ }
2994
+ else if (elementType === BSON_DATA_DBPOINTER) {
2995
+ const stringSize = buffer[index++] |
2996
+ (buffer[index++] << 8) |
2997
+ (buffer[index++] << 16) |
2998
+ (buffer[index++] << 24);
2999
+ if (stringSize <= 0 ||
3000
+ stringSize > buffer.length - index ||
3001
+ buffer[index + stringSize - 1] !== 0)
3002
+ throw new BSONError('bad string length in bson');
3003
+ if (validation != null && validation.utf8) {
3004
+ if (!validateUtf8(buffer, index, index + stringSize - 1)) {
3005
+ throw new BSONError('Invalid UTF-8 string in BSON document');
3006
+ }
3007
+ }
3008
+ const namespace = ByteUtils.toUTF8(buffer, index, index + stringSize - 1);
3009
+ index = index + stringSize;
3010
+ const oidBuffer = ByteUtils.allocate(12);
3011
+ oidBuffer.set(buffer.subarray(index, index + 12), 0);
3012
+ const oid = new ObjectId(oidBuffer);
3013
+ index = index + 12;
3014
+ value = new DBRef(namespace, oid);
3015
+ }
3016
+ else {
3017
+ throw new BSONError(`Detected unknown BSON type ${elementType.toString(16)} for fieldname "${name}"`);
3018
+ }
3019
+ if (name === '__proto__') {
3020
+ Object.defineProperty(object, name, {
3021
+ value,
3022
+ writable: true,
3023
+ enumerable: true,
3024
+ configurable: true
3025
+ });
3026
+ }
3027
+ else {
3028
+ object[name] = value;
3029
+ }
3030
+ }
3031
+ if (size !== index - startIndex) {
3032
+ if (isArray)
3033
+ throw new BSONError('corrupt array bson');
3034
+ throw new BSONError('corrupt object bson');
3035
+ }
3036
+ if (!isPossibleDBRef)
3037
+ return object;
3038
+ if (isDBRefLike(object)) {
3039
+ const copy = Object.assign({}, object);
3040
+ delete copy.$ref;
3041
+ delete copy.$id;
3042
+ delete copy.$db;
3043
+ return new DBRef(object.$ref, object.$id, object.$db, copy);
3044
+ }
3045
+ return object;
3046
+ }
3047
+ function getValidatedString(buffer, start, end, shouldValidateUtf8) {
3048
+ const value = ByteUtils.toUTF8(buffer, start, end);
3049
+ if (shouldValidateUtf8) {
3050
+ for (let i = 0; i < value.length; i++) {
3051
+ if (value.charCodeAt(i) === 0xfffd) {
3052
+ if (!validateUtf8(buffer, start, end)) {
3053
+ throw new BSONError('Invalid UTF-8 string in BSON document');
3054
+ }
3055
+ break;
3056
+ }
3057
+ }
3058
+ }
3059
+ return value;
3060
+ }
3061
+
3062
+ const regexp = /\x00/;
3063
+ const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']);
3064
+ function serializeString(buffer, key, value, index) {
3065
+ buffer[index++] = BSON_DATA_STRING;
3066
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3067
+ index = index + numberOfWrittenBytes + 1;
3068
+ buffer[index - 1] = 0;
3069
+ const size = ByteUtils.encodeUTF8Into(buffer, value, index + 4);
3070
+ buffer[index + 3] = ((size + 1) >> 24) & 0xff;
3071
+ buffer[index + 2] = ((size + 1) >> 16) & 0xff;
3072
+ buffer[index + 1] = ((size + 1) >> 8) & 0xff;
3073
+ buffer[index] = (size + 1) & 0xff;
3074
+ index = index + 4 + size;
3075
+ buffer[index++] = 0;
3076
+ return index;
3077
+ }
3078
+ const NUMBER_SPACE = new DataView(new ArrayBuffer(8), 0, 8);
3079
+ const FOUR_BYTE_VIEW_ON_NUMBER = new Uint8Array(NUMBER_SPACE.buffer, 0, 4);
3080
+ const EIGHT_BYTE_VIEW_ON_NUMBER = new Uint8Array(NUMBER_SPACE.buffer, 0, 8);
3081
+ function serializeNumber(buffer, key, value, index) {
3082
+ const isNegativeZero = Object.is(value, -0);
3083
+ const type = !isNegativeZero &&
3084
+ Number.isSafeInteger(value) &&
3085
+ value <= BSON_INT32_MAX &&
3086
+ value >= BSON_INT32_MIN
3087
+ ? BSON_DATA_INT
3088
+ : BSON_DATA_NUMBER;
3089
+ if (type === BSON_DATA_INT) {
3090
+ NUMBER_SPACE.setInt32(0, value, true);
3091
+ }
3092
+ else {
3093
+ NUMBER_SPACE.setFloat64(0, value, true);
3094
+ }
3095
+ const bytes = type === BSON_DATA_INT ? FOUR_BYTE_VIEW_ON_NUMBER : EIGHT_BYTE_VIEW_ON_NUMBER;
3096
+ buffer[index++] = type;
3097
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3098
+ index = index + numberOfWrittenBytes;
3099
+ buffer[index++] = 0x00;
3100
+ buffer.set(bytes, index);
3101
+ index += bytes.byteLength;
3102
+ return index;
3103
+ }
3104
+ function serializeBigInt(buffer, key, value, index) {
3105
+ buffer[index++] = BSON_DATA_LONG;
3106
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3107
+ index += numberOfWrittenBytes;
3108
+ buffer[index++] = 0;
3109
+ NUMBER_SPACE.setBigInt64(0, value, true);
3110
+ buffer.set(EIGHT_BYTE_VIEW_ON_NUMBER, index);
3111
+ index += EIGHT_BYTE_VIEW_ON_NUMBER.byteLength;
3112
+ return index;
3113
+ }
3114
+ function serializeNull(buffer, key, _, index) {
3115
+ buffer[index++] = BSON_DATA_NULL;
3116
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3117
+ index = index + numberOfWrittenBytes;
3118
+ buffer[index++] = 0;
3119
+ return index;
3120
+ }
3121
+ function serializeBoolean(buffer, key, value, index) {
3122
+ buffer[index++] = BSON_DATA_BOOLEAN;
3123
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3124
+ index = index + numberOfWrittenBytes;
3125
+ buffer[index++] = 0;
3126
+ buffer[index++] = value ? 1 : 0;
3127
+ return index;
3128
+ }
3129
+ function serializeDate(buffer, key, value, index) {
3130
+ buffer[index++] = BSON_DATA_DATE;
3131
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3132
+ index = index + numberOfWrittenBytes;
3133
+ buffer[index++] = 0;
3134
+ const dateInMilis = Long.fromNumber(value.getTime());
3135
+ const lowBits = dateInMilis.getLowBits();
3136
+ const highBits = dateInMilis.getHighBits();
3137
+ buffer[index++] = lowBits & 0xff;
3138
+ buffer[index++] = (lowBits >> 8) & 0xff;
3139
+ buffer[index++] = (lowBits >> 16) & 0xff;
3140
+ buffer[index++] = (lowBits >> 24) & 0xff;
3141
+ buffer[index++] = highBits & 0xff;
3142
+ buffer[index++] = (highBits >> 8) & 0xff;
3143
+ buffer[index++] = (highBits >> 16) & 0xff;
3144
+ buffer[index++] = (highBits >> 24) & 0xff;
3145
+ return index;
3146
+ }
3147
+ function serializeRegExp(buffer, key, value, index) {
3148
+ buffer[index++] = BSON_DATA_REGEXP;
3149
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3150
+ index = index + numberOfWrittenBytes;
3151
+ buffer[index++] = 0;
3152
+ if (value.source && value.source.match(regexp) != null) {
3153
+ throw new BSONError('value ' + value.source + ' must not contain null bytes');
3154
+ }
3155
+ index = index + ByteUtils.encodeUTF8Into(buffer, value.source, index);
3156
+ buffer[index++] = 0x00;
3157
+ if (value.ignoreCase)
3158
+ buffer[index++] = 0x69;
3159
+ if (value.global)
3160
+ buffer[index++] = 0x73;
3161
+ if (value.multiline)
3162
+ buffer[index++] = 0x6d;
3163
+ buffer[index++] = 0x00;
3164
+ return index;
3165
+ }
3166
+ function serializeBSONRegExp(buffer, key, value, index) {
3167
+ buffer[index++] = BSON_DATA_REGEXP;
3168
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3169
+ index = index + numberOfWrittenBytes;
3170
+ buffer[index++] = 0;
3171
+ if (value.pattern.match(regexp) != null) {
3172
+ throw new BSONError('pattern ' + value.pattern + ' must not contain null bytes');
3173
+ }
3174
+ index = index + ByteUtils.encodeUTF8Into(buffer, value.pattern, index);
3175
+ buffer[index++] = 0x00;
3176
+ const sortedOptions = value.options.split('').sort().join('');
3177
+ index = index + ByteUtils.encodeUTF8Into(buffer, sortedOptions, index);
3178
+ buffer[index++] = 0x00;
3179
+ return index;
3180
+ }
3181
+ function serializeMinMax(buffer, key, value, index) {
3182
+ if (value === null) {
3183
+ buffer[index++] = BSON_DATA_NULL;
3184
+ }
3185
+ else if (value._bsontype === 'MinKey') {
3186
+ buffer[index++] = BSON_DATA_MIN_KEY;
3187
+ }
3188
+ else {
3189
+ buffer[index++] = BSON_DATA_MAX_KEY;
3190
+ }
3191
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3192
+ index = index + numberOfWrittenBytes;
3193
+ buffer[index++] = 0;
3194
+ return index;
3195
+ }
3196
+ function serializeObjectId(buffer, key, value, index) {
3197
+ buffer[index++] = BSON_DATA_OID;
3198
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3199
+ index = index + numberOfWrittenBytes;
3200
+ buffer[index++] = 0;
3201
+ if (isUint8Array(value.id)) {
3202
+ buffer.set(value.id.subarray(0, 12), index);
3203
+ }
3204
+ else {
3205
+ throw new BSONError('object [' + JSON.stringify(value) + '] is not a valid ObjectId');
3206
+ }
3207
+ return index + 12;
3208
+ }
3209
+ function serializeBuffer(buffer, key, value, index) {
3210
+ buffer[index++] = BSON_DATA_BINARY;
3211
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3212
+ index = index + numberOfWrittenBytes;
3213
+ buffer[index++] = 0;
3214
+ const size = value.length;
3215
+ buffer[index++] = size & 0xff;
3216
+ buffer[index++] = (size >> 8) & 0xff;
3217
+ buffer[index++] = (size >> 16) & 0xff;
3218
+ buffer[index++] = (size >> 24) & 0xff;
3219
+ buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT;
3220
+ buffer.set(value, index);
3221
+ index = index + size;
3222
+ return index;
3223
+ }
3224
+ function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path) {
3225
+ if (path.has(value)) {
3226
+ throw new BSONError('Cannot convert circular structure to BSON');
3227
+ }
3228
+ path.add(value);
3229
+ buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT;
3230
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3231
+ index = index + numberOfWrittenBytes;
3232
+ buffer[index++] = 0;
3233
+ const endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
3234
+ path.delete(value);
3235
+ return endIndex;
3236
+ }
3237
+ function serializeDecimal128(buffer, key, value, index) {
3238
+ buffer[index++] = BSON_DATA_DECIMAL128;
3239
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3240
+ index = index + numberOfWrittenBytes;
3241
+ buffer[index++] = 0;
3242
+ buffer.set(value.bytes.subarray(0, 16), index);
3243
+ return index + 16;
3244
+ }
3245
+ function serializeLong(buffer, key, value, index) {
3246
+ buffer[index++] =
3247
+ value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP;
3248
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3249
+ index = index + numberOfWrittenBytes;
3250
+ buffer[index++] = 0;
3251
+ const lowBits = value.getLowBits();
3252
+ const highBits = value.getHighBits();
3253
+ buffer[index++] = lowBits & 0xff;
3254
+ buffer[index++] = (lowBits >> 8) & 0xff;
3255
+ buffer[index++] = (lowBits >> 16) & 0xff;
3256
+ buffer[index++] = (lowBits >> 24) & 0xff;
3257
+ buffer[index++] = highBits & 0xff;
3258
+ buffer[index++] = (highBits >> 8) & 0xff;
3259
+ buffer[index++] = (highBits >> 16) & 0xff;
3260
+ buffer[index++] = (highBits >> 24) & 0xff;
3261
+ return index;
3262
+ }
3263
+ function serializeInt32(buffer, key, value, index) {
3264
+ value = value.valueOf();
3265
+ buffer[index++] = BSON_DATA_INT;
3266
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3267
+ index = index + numberOfWrittenBytes;
3268
+ buffer[index++] = 0;
3269
+ buffer[index++] = value & 0xff;
3270
+ buffer[index++] = (value >> 8) & 0xff;
3271
+ buffer[index++] = (value >> 16) & 0xff;
3272
+ buffer[index++] = (value >> 24) & 0xff;
3273
+ return index;
3274
+ }
3275
+ function serializeDouble(buffer, key, value, index) {
3276
+ buffer[index++] = BSON_DATA_NUMBER;
3277
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3278
+ index = index + numberOfWrittenBytes;
3279
+ buffer[index++] = 0;
3280
+ NUMBER_SPACE.setFloat64(0, value.value, true);
3281
+ buffer.set(EIGHT_BYTE_VIEW_ON_NUMBER, index);
3282
+ index = index + 8;
3283
+ return index;
3284
+ }
3285
+ function serializeFunction(buffer, key, value, index) {
3286
+ buffer[index++] = BSON_DATA_CODE;
3287
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3288
+ index = index + numberOfWrittenBytes;
3289
+ buffer[index++] = 0;
3290
+ const functionString = value.toString();
3291
+ const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1;
3292
+ buffer[index] = size & 0xff;
3293
+ buffer[index + 1] = (size >> 8) & 0xff;
3294
+ buffer[index + 2] = (size >> 16) & 0xff;
3295
+ buffer[index + 3] = (size >> 24) & 0xff;
3296
+ index = index + 4 + size - 1;
3297
+ buffer[index++] = 0;
3298
+ return index;
3299
+ }
3300
+ function serializeCode(buffer, key, value, index, checkKeys = false, depth = 0, serializeFunctions = false, ignoreUndefined = true, path) {
3301
+ if (value.scope && typeof value.scope === 'object') {
3302
+ buffer[index++] = BSON_DATA_CODE_W_SCOPE;
3303
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3304
+ index = index + numberOfWrittenBytes;
3305
+ buffer[index++] = 0;
3306
+ let startIndex = index;
3307
+ const functionString = value.code;
3308
+ index = index + 4;
3309
+ const codeSize = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1;
3310
+ buffer[index] = codeSize & 0xff;
3311
+ buffer[index + 1] = (codeSize >> 8) & 0xff;
3312
+ buffer[index + 2] = (codeSize >> 16) & 0xff;
3313
+ buffer[index + 3] = (codeSize >> 24) & 0xff;
3314
+ buffer[index + 4 + codeSize - 1] = 0;
3315
+ index = index + codeSize + 4;
3316
+ const endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
3317
+ index = endIndex - 1;
3318
+ const totalSize = endIndex - startIndex;
3319
+ buffer[startIndex++] = totalSize & 0xff;
3320
+ buffer[startIndex++] = (totalSize >> 8) & 0xff;
3321
+ buffer[startIndex++] = (totalSize >> 16) & 0xff;
3322
+ buffer[startIndex++] = (totalSize >> 24) & 0xff;
3323
+ buffer[index++] = 0;
3324
+ }
3325
+ else {
3326
+ buffer[index++] = BSON_DATA_CODE;
3327
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3328
+ index = index + numberOfWrittenBytes;
3329
+ buffer[index++] = 0;
3330
+ const functionString = value.code.toString();
3331
+ const size = ByteUtils.encodeUTF8Into(buffer, functionString, index + 4) + 1;
3332
+ buffer[index] = size & 0xff;
3333
+ buffer[index + 1] = (size >> 8) & 0xff;
3334
+ buffer[index + 2] = (size >> 16) & 0xff;
3335
+ buffer[index + 3] = (size >> 24) & 0xff;
3336
+ index = index + 4 + size - 1;
3337
+ buffer[index++] = 0;
3338
+ }
3339
+ return index;
3340
+ }
3341
+ function serializeBinary(buffer, key, value, index) {
3342
+ buffer[index++] = BSON_DATA_BINARY;
3343
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3344
+ index = index + numberOfWrittenBytes;
3345
+ buffer[index++] = 0;
3346
+ const data = value.buffer;
3347
+ let size = value.position;
3348
+ if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY)
3349
+ size = size + 4;
3350
+ buffer[index++] = size & 0xff;
3351
+ buffer[index++] = (size >> 8) & 0xff;
3352
+ buffer[index++] = (size >> 16) & 0xff;
3353
+ buffer[index++] = (size >> 24) & 0xff;
3354
+ buffer[index++] = value.sub_type;
3355
+ if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
3356
+ size = size - 4;
3357
+ buffer[index++] = size & 0xff;
3358
+ buffer[index++] = (size >> 8) & 0xff;
3359
+ buffer[index++] = (size >> 16) & 0xff;
3360
+ buffer[index++] = (size >> 24) & 0xff;
3361
+ }
3362
+ buffer.set(data, index);
3363
+ index = index + value.position;
3364
+ return index;
3365
+ }
3366
+ function serializeSymbol(buffer, key, value, index) {
3367
+ buffer[index++] = BSON_DATA_SYMBOL;
3368
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3369
+ index = index + numberOfWrittenBytes;
3370
+ buffer[index++] = 0;
3371
+ const size = ByteUtils.encodeUTF8Into(buffer, value.value, index + 4) + 1;
3372
+ buffer[index] = size & 0xff;
3373
+ buffer[index + 1] = (size >> 8) & 0xff;
3374
+ buffer[index + 2] = (size >> 16) & 0xff;
3375
+ buffer[index + 3] = (size >> 24) & 0xff;
3376
+ index = index + 4 + size - 1;
3377
+ buffer[index++] = 0x00;
3378
+ return index;
3379
+ }
3380
+ function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, path) {
3381
+ buffer[index++] = BSON_DATA_OBJECT;
3382
+ const numberOfWrittenBytes = ByteUtils.encodeUTF8Into(buffer, key, index);
3383
+ index = index + numberOfWrittenBytes;
3384
+ buffer[index++] = 0;
3385
+ let startIndex = index;
3386
+ let output = {
3387
+ $ref: value.collection || value.namespace,
3388
+ $id: value.oid
3389
+ };
3390
+ if (value.db != null) {
3391
+ output.$db = value.db;
3392
+ }
3393
+ output = Object.assign(output, value.fields);
3394
+ const endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions, true, path);
3395
+ const size = endIndex - startIndex;
3396
+ buffer[startIndex++] = size & 0xff;
3397
+ buffer[startIndex++] = (size >> 8) & 0xff;
3398
+ buffer[startIndex++] = (size >> 16) & 0xff;
3399
+ buffer[startIndex++] = (size >> 24) & 0xff;
3400
+ return endIndex;
3401
+ }
3402
+ function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) {
3403
+ if (path == null) {
3404
+ if (object == null) {
3405
+ buffer[0] = 0x05;
3406
+ buffer[1] = 0x00;
3407
+ buffer[2] = 0x00;
3408
+ buffer[3] = 0x00;
3409
+ buffer[4] = 0x00;
3410
+ return 5;
3411
+ }
3412
+ if (Array.isArray(object)) {
3413
+ throw new BSONError('serialize does not support an array as the root input');
3414
+ }
3415
+ if (typeof object !== 'object') {
3416
+ throw new BSONError('serialize does not support non-object as the root input');
3417
+ }
3418
+ else if ('_bsontype' in object && typeof object._bsontype === 'string') {
3419
+ throw new BSONError(`BSON types cannot be serialized as a document`);
3420
+ }
3421
+ else if (isDate(object) ||
3422
+ isRegExp(object) ||
3423
+ isUint8Array(object) ||
3424
+ isAnyArrayBuffer(object)) {
3425
+ throw new BSONError(`date, regexp, typedarray, and arraybuffer cannot be BSON documents`);
3426
+ }
3427
+ path = new Set();
3428
+ }
3429
+ path.add(object);
3430
+ let index = startingIndex + 4;
3431
+ if (Array.isArray(object)) {
3432
+ for (let i = 0; i < object.length; i++) {
3433
+ const key = `${i}`;
3434
+ let value = object[i];
3435
+ if (typeof value?.toBSON === 'function') {
3436
+ value = value.toBSON();
3437
+ }
3438
+ if (typeof value === 'string') {
3439
+ index = serializeString(buffer, key, value, index);
3440
+ }
3441
+ else if (typeof value === 'number') {
3442
+ index = serializeNumber(buffer, key, value, index);
3443
+ }
3444
+ else if (typeof value === 'bigint') {
3445
+ index = serializeBigInt(buffer, key, value, index);
3446
+ }
3447
+ else if (typeof value === 'boolean') {
3448
+ index = serializeBoolean(buffer, key, value, index);
3449
+ }
3450
+ else if (value instanceof Date || isDate(value)) {
3451
+ index = serializeDate(buffer, key, value, index);
3452
+ }
3453
+ else if (value === undefined) {
3454
+ index = serializeNull(buffer, key, value, index);
3455
+ }
3456
+ else if (value === null) {
3457
+ index = serializeNull(buffer, key, value, index);
3458
+ }
3459
+ else if (isUint8Array(value)) {
3460
+ index = serializeBuffer(buffer, key, value, index);
3461
+ }
3462
+ else if (value instanceof RegExp || isRegExp(value)) {
3463
+ index = serializeRegExp(buffer, key, value, index);
3464
+ }
3465
+ else if (typeof value === 'object' && value._bsontype == null) {
3466
+ index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path);
3467
+ }
3468
+ else if (typeof value === 'object' &&
3469
+ value[Symbol.for('@@mdb.bson.version')] !== BSON_MAJOR_VERSION) {
3470
+ throw new BSONVersionError();
3471
+ }
3472
+ else if (value._bsontype === 'ObjectId') {
3473
+ index = serializeObjectId(buffer, key, value, index);
3474
+ }
3475
+ else if (value._bsontype === 'Decimal128') {
3476
+ index = serializeDecimal128(buffer, key, value, index);
3477
+ }
3478
+ else if (value._bsontype === 'Long' || value._bsontype === 'Timestamp') {
3479
+ index = serializeLong(buffer, key, value, index);
3480
+ }
3481
+ else if (value._bsontype === 'Double') {
3482
+ index = serializeDouble(buffer, key, value, index);
3483
+ }
3484
+ else if (typeof value === 'function' && serializeFunctions) {
3485
+ index = serializeFunction(buffer, key, value, index);
3486
+ }
3487
+ else if (value._bsontype === 'Code') {
3488
+ index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path);
3489
+ }
3490
+ else if (value._bsontype === 'Binary') {
3491
+ index = serializeBinary(buffer, key, value, index);
3492
+ }
3493
+ else if (value._bsontype === 'BSONSymbol') {
3494
+ index = serializeSymbol(buffer, key, value, index);
3495
+ }
3496
+ else if (value._bsontype === 'DBRef') {
3497
+ index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, path);
3498
+ }
3499
+ else if (value._bsontype === 'BSONRegExp') {
3500
+ index = serializeBSONRegExp(buffer, key, value, index);
3501
+ }
3502
+ else if (value._bsontype === 'Int32') {
3503
+ index = serializeInt32(buffer, key, value, index);
3504
+ }
3505
+ else if (value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') {
3506
+ index = serializeMinMax(buffer, key, value, index);
3507
+ }
3508
+ else if (typeof value._bsontype !== 'undefined') {
3509
+ throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`);
3510
+ }
3511
+ }
3512
+ }
3513
+ else if (object instanceof Map || isMap(object)) {
3514
+ const iterator = object.entries();
3515
+ let done = false;
3516
+ while (!done) {
3517
+ const entry = iterator.next();
3518
+ done = !!entry.done;
3519
+ if (done)
3520
+ continue;
3521
+ const key = entry.value[0];
3522
+ let value = entry.value[1];
3523
+ if (typeof value?.toBSON === 'function') {
3524
+ value = value.toBSON();
3525
+ }
3526
+ const type = typeof value;
3527
+ if (typeof key === 'string' && !ignoreKeys.has(key)) {
3528
+ if (key.match(regexp) != null) {
3529
+ throw new BSONError('key ' + key + ' must not contain null bytes');
3530
+ }
3531
+ if (checkKeys) {
3532
+ if ('$' === key[0]) {
3533
+ throw new BSONError('key ' + key + " must not start with '$'");
3534
+ }
3535
+ else if (~key.indexOf('.')) {
3536
+ throw new BSONError('key ' + key + " must not contain '.'");
3537
+ }
3538
+ }
3539
+ }
3540
+ if (type === 'string') {
3541
+ index = serializeString(buffer, key, value, index);
3542
+ }
3543
+ else if (type === 'number') {
3544
+ index = serializeNumber(buffer, key, value, index);
3545
+ }
3546
+ else if (type === 'bigint') {
3547
+ index = serializeBigInt(buffer, key, value, index);
3548
+ }
3549
+ else if (type === 'boolean') {
3550
+ index = serializeBoolean(buffer, key, value, index);
3551
+ }
3552
+ else if (value instanceof Date || isDate(value)) {
3553
+ index = serializeDate(buffer, key, value, index);
3554
+ }
3555
+ else if (value === null || (value === undefined && ignoreUndefined === false)) {
3556
+ index = serializeNull(buffer, key, value, index);
3557
+ }
3558
+ else if (isUint8Array(value)) {
3559
+ index = serializeBuffer(buffer, key, value, index);
3560
+ }
3561
+ else if (value instanceof RegExp || isRegExp(value)) {
3562
+ index = serializeRegExp(buffer, key, value, index);
3563
+ }
3564
+ else if (type === 'object' && value._bsontype == null) {
3565
+ index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path);
3566
+ }
3567
+ else if (typeof value === 'object' &&
3568
+ value[Symbol.for('@@mdb.bson.version')] !== BSON_MAJOR_VERSION) {
3569
+ throw new BSONVersionError();
3570
+ }
3571
+ else if (value._bsontype === 'ObjectId') {
3572
+ index = serializeObjectId(buffer, key, value, index);
3573
+ }
3574
+ else if (type === 'object' && value._bsontype === 'Decimal128') {
3575
+ index = serializeDecimal128(buffer, key, value, index);
3576
+ }
3577
+ else if (value._bsontype === 'Long' || value._bsontype === 'Timestamp') {
3578
+ index = serializeLong(buffer, key, value, index);
3579
+ }
3580
+ else if (value._bsontype === 'Double') {
3581
+ index = serializeDouble(buffer, key, value, index);
3582
+ }
3583
+ else if (value._bsontype === 'Code') {
3584
+ index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path);
3585
+ }
3586
+ else if (typeof value === 'function' && serializeFunctions) {
3587
+ index = serializeFunction(buffer, key, value, index);
3588
+ }
3589
+ else if (value._bsontype === 'Binary') {
3590
+ index = serializeBinary(buffer, key, value, index);
3591
+ }
3592
+ else if (value._bsontype === 'BSONSymbol') {
3593
+ index = serializeSymbol(buffer, key, value, index);
3594
+ }
3595
+ else if (value._bsontype === 'DBRef') {
3596
+ index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, path);
3597
+ }
3598
+ else if (value._bsontype === 'BSONRegExp') {
3599
+ index = serializeBSONRegExp(buffer, key, value, index);
3600
+ }
3601
+ else if (value._bsontype === 'Int32') {
3602
+ index = serializeInt32(buffer, key, value, index);
3603
+ }
3604
+ else if (value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') {
3605
+ index = serializeMinMax(buffer, key, value, index);
3606
+ }
3607
+ else if (typeof value._bsontype !== 'undefined') {
3608
+ throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`);
3609
+ }
3610
+ }
3611
+ }
3612
+ else {
3613
+ if (typeof object?.toBSON === 'function') {
3614
+ object = object.toBSON();
3615
+ if (object != null && typeof object !== 'object') {
3616
+ throw new BSONError('toBSON function did not return an object');
3617
+ }
3618
+ }
3619
+ for (const key of Object.keys(object)) {
3620
+ let value = object[key];
3621
+ if (typeof value?.toBSON === 'function') {
3622
+ value = value.toBSON();
3623
+ }
3624
+ const type = typeof value;
3625
+ if (typeof key === 'string' && !ignoreKeys.has(key)) {
3626
+ if (key.match(regexp) != null) {
3627
+ throw new BSONError('key ' + key + ' must not contain null bytes');
3628
+ }
3629
+ if (checkKeys) {
3630
+ if ('$' === key[0]) {
3631
+ throw new BSONError('key ' + key + " must not start with '$'");
3632
+ }
3633
+ else if (~key.indexOf('.')) {
3634
+ throw new BSONError('key ' + key + " must not contain '.'");
3635
+ }
3636
+ }
3637
+ }
3638
+ if (type === 'string') {
3639
+ index = serializeString(buffer, key, value, index);
3640
+ }
3641
+ else if (type === 'number') {
3642
+ index = serializeNumber(buffer, key, value, index);
3643
+ }
3644
+ else if (type === 'bigint') {
3645
+ index = serializeBigInt(buffer, key, value, index);
3646
+ }
3647
+ else if (type === 'boolean') {
3648
+ index = serializeBoolean(buffer, key, value, index);
3649
+ }
3650
+ else if (value instanceof Date || isDate(value)) {
3651
+ index = serializeDate(buffer, key, value, index);
3652
+ }
3653
+ else if (value === undefined) {
3654
+ if (ignoreUndefined === false)
3655
+ index = serializeNull(buffer, key, value, index);
3656
+ }
3657
+ else if (value === null) {
3658
+ index = serializeNull(buffer, key, value, index);
3659
+ }
3660
+ else if (isUint8Array(value)) {
3661
+ index = serializeBuffer(buffer, key, value, index);
3662
+ }
3663
+ else if (value instanceof RegExp || isRegExp(value)) {
3664
+ index = serializeRegExp(buffer, key, value, index);
3665
+ }
3666
+ else if (type === 'object' && value._bsontype == null) {
3667
+ index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path);
3668
+ }
3669
+ else if (typeof value === 'object' &&
3670
+ value[Symbol.for('@@mdb.bson.version')] !== BSON_MAJOR_VERSION) {
3671
+ throw new BSONVersionError();
3672
+ }
3673
+ else if (value._bsontype === 'ObjectId') {
3674
+ index = serializeObjectId(buffer, key, value, index);
3675
+ }
3676
+ else if (type === 'object' && value._bsontype === 'Decimal128') {
3677
+ index = serializeDecimal128(buffer, key, value, index);
3678
+ }
3679
+ else if (value._bsontype === 'Long' || value._bsontype === 'Timestamp') {
3680
+ index = serializeLong(buffer, key, value, index);
3681
+ }
3682
+ else if (value._bsontype === 'Double') {
3683
+ index = serializeDouble(buffer, key, value, index);
3684
+ }
3685
+ else if (value._bsontype === 'Code') {
3686
+ index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, path);
3687
+ }
3688
+ else if (typeof value === 'function' && serializeFunctions) {
3689
+ index = serializeFunction(buffer, key, value, index);
3690
+ }
3691
+ else if (value._bsontype === 'Binary') {
3692
+ index = serializeBinary(buffer, key, value, index);
3693
+ }
3694
+ else if (value._bsontype === 'BSONSymbol') {
3695
+ index = serializeSymbol(buffer, key, value, index);
3696
+ }
3697
+ else if (value._bsontype === 'DBRef') {
3698
+ index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, path);
3699
+ }
3700
+ else if (value._bsontype === 'BSONRegExp') {
3701
+ index = serializeBSONRegExp(buffer, key, value, index);
3702
+ }
3703
+ else if (value._bsontype === 'Int32') {
3704
+ index = serializeInt32(buffer, key, value, index);
3705
+ }
3706
+ else if (value._bsontype === 'MinKey' || value._bsontype === 'MaxKey') {
3707
+ index = serializeMinMax(buffer, key, value, index);
3708
+ }
3709
+ else if (typeof value._bsontype !== 'undefined') {
3710
+ throw new BSONError(`Unrecognized or invalid _bsontype: ${String(value._bsontype)}`);
3711
+ }
3712
+ }
3713
+ }
3714
+ path.delete(object);
3715
+ buffer[index++] = 0x00;
3716
+ const size = index - startingIndex;
3717
+ buffer[startingIndex++] = size & 0xff;
3718
+ buffer[startingIndex++] = (size >> 8) & 0xff;
3719
+ buffer[startingIndex++] = (size >> 16) & 0xff;
3720
+ buffer[startingIndex++] = (size >> 24) & 0xff;
3721
+ return index;
3722
+ }
3723
+
3724
+ function isBSONType(value) {
3725
+ return (value != null &&
3726
+ typeof value === 'object' &&
3727
+ '_bsontype' in value &&
3728
+ typeof value._bsontype === 'string');
3729
+ }
3730
+ const keysToCodecs = {
3731
+ $oid: ObjectId,
3732
+ $binary: Binary,
3733
+ $uuid: Binary,
3734
+ $symbol: BSONSymbol,
3735
+ $numberInt: Int32,
3736
+ $numberDecimal: Decimal128,
3737
+ $numberDouble: Double,
3738
+ $numberLong: Long,
3739
+ $minKey: MinKey,
3740
+ $maxKey: MaxKey,
3741
+ $regex: BSONRegExp,
3742
+ $regularExpression: BSONRegExp,
3743
+ $timestamp: Timestamp
3744
+ };
3745
+ function deserializeValue(value, options = {}) {
3746
+ if (typeof value === 'number') {
3747
+ const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN;
3748
+ const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN;
3749
+ if (options.relaxed || options.legacy) {
3750
+ return value;
3751
+ }
3752
+ if (Number.isInteger(value) && !Object.is(value, -0)) {
3753
+ if (in32BitRange) {
3754
+ return new Int32(value);
3755
+ }
3756
+ if (in64BitRange) {
3757
+ if (options.useBigInt64) {
3758
+ return BigInt(value);
3759
+ }
3760
+ return Long.fromNumber(value);
3761
+ }
3762
+ }
3763
+ return new Double(value);
3764
+ }
3765
+ if (value == null || typeof value !== 'object')
3766
+ return value;
3767
+ if (value.$undefined)
3768
+ return null;
3769
+ const keys = Object.keys(value).filter(k => k.startsWith('$') && value[k] != null);
3770
+ for (let i = 0; i < keys.length; i++) {
3771
+ const c = keysToCodecs[keys[i]];
3772
+ if (c)
3773
+ return c.fromExtendedJSON(value, options);
3774
+ }
3775
+ if (value.$date != null) {
3776
+ const d = value.$date;
3777
+ const date = new Date();
3778
+ if (options.legacy) {
3779
+ if (typeof d === 'number')
3780
+ date.setTime(d);
3781
+ else if (typeof d === 'string')
3782
+ date.setTime(Date.parse(d));
3783
+ else if (typeof d === 'bigint')
3784
+ date.setTime(Number(d));
3785
+ else
3786
+ throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`);
3787
+ }
3788
+ else {
3789
+ if (typeof d === 'string')
3790
+ date.setTime(Date.parse(d));
3791
+ else if (Long.isLong(d))
3792
+ date.setTime(d.toNumber());
3793
+ else if (typeof d === 'number' && options.relaxed)
3794
+ date.setTime(d);
3795
+ else if (typeof d === 'bigint')
3796
+ date.setTime(Number(d));
3797
+ else
3798
+ throw new BSONRuntimeError(`Unrecognized type for EJSON date: ${typeof d}`);
3799
+ }
3800
+ return date;
3801
+ }
3802
+ if (value.$code != null) {
3803
+ const copy = Object.assign({}, value);
3804
+ if (value.$scope) {
3805
+ copy.$scope = deserializeValue(value.$scope);
3806
+ }
3807
+ return Code.fromExtendedJSON(value);
3808
+ }
3809
+ if (isDBRefLike(value) || value.$dbPointer) {
3810
+ const v = value.$ref ? value : value.$dbPointer;
3811
+ if (v instanceof DBRef)
3812
+ return v;
3813
+ const dollarKeys = Object.keys(v).filter(k => k.startsWith('$'));
3814
+ let valid = true;
3815
+ dollarKeys.forEach(k => {
3816
+ if (['$ref', '$id', '$db'].indexOf(k) === -1)
3817
+ valid = false;
3818
+ });
3819
+ if (valid)
3820
+ return DBRef.fromExtendedJSON(v);
3821
+ }
3822
+ return value;
3823
+ }
3824
+ function serializeArray(array, options) {
3825
+ return array.map((v, index) => {
3826
+ options.seenObjects.push({ propertyName: `index ${index}`, obj: null });
3827
+ try {
3828
+ return serializeValue(v, options);
3829
+ }
3830
+ finally {
3831
+ options.seenObjects.pop();
3832
+ }
3833
+ });
3834
+ }
3835
+ function getISOString(date) {
3836
+ const isoStr = date.toISOString();
3837
+ return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z';
3838
+ }
3839
+ function serializeValue(value, options) {
3840
+ if (value instanceof Map || isMap(value)) {
3841
+ const obj = Object.create(null);
3842
+ for (const [k, v] of value) {
3843
+ if (typeof k !== 'string') {
3844
+ throw new BSONError('Can only serialize maps with string keys');
3845
+ }
3846
+ obj[k] = v;
3847
+ }
3848
+ return serializeValue(obj, options);
3849
+ }
3850
+ if ((typeof value === 'object' || typeof value === 'function') && value !== null) {
3851
+ const index = options.seenObjects.findIndex(entry => entry.obj === value);
3852
+ if (index !== -1) {
3853
+ const props = options.seenObjects.map(entry => entry.propertyName);
3854
+ const leadingPart = props
3855
+ .slice(0, index)
3856
+ .map(prop => `${prop} -> `)
3857
+ .join('');
3858
+ const alreadySeen = props[index];
3859
+ const circularPart = ' -> ' +
3860
+ props
3861
+ .slice(index + 1, props.length - 1)
3862
+ .map(prop => `${prop} -> `)
3863
+ .join('');
3864
+ const current = props[props.length - 1];
3865
+ const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2);
3866
+ const dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1);
3867
+ throw new BSONError('Converting circular structure to EJSON:\n' +
3868
+ ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` +
3869
+ ` ${leadingSpace}\\${dashes}/`);
3870
+ }
3871
+ options.seenObjects[options.seenObjects.length - 1].obj = value;
3872
+ }
3873
+ if (Array.isArray(value))
3874
+ return serializeArray(value, options);
3875
+ if (value === undefined)
3876
+ return null;
3877
+ if (value instanceof Date || isDate(value)) {
3878
+ const dateNum = value.getTime(), inRange = dateNum > -1 && dateNum < 253402318800000;
3879
+ if (options.legacy) {
3880
+ return options.relaxed && inRange
3881
+ ? { $date: value.getTime() }
3882
+ : { $date: getISOString(value) };
3883
+ }
3884
+ return options.relaxed && inRange
3885
+ ? { $date: getISOString(value) }
3886
+ : { $date: { $numberLong: value.getTime().toString() } };
3887
+ }
3888
+ if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) {
3889
+ if (Number.isInteger(value) && !Object.is(value, -0)) {
3890
+ if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) {
3891
+ return { $numberInt: value.toString() };
3892
+ }
3893
+ if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) {
3894
+ return { $numberLong: value.toString() };
3895
+ }
3896
+ }
3897
+ return { $numberDouble: Object.is(value, -0) ? '-0.0' : value.toString() };
3898
+ }
3899
+ if (typeof value === 'bigint') {
3900
+ if (!options.relaxed) {
3901
+ return { $numberLong: BigInt.asIntN(64, value).toString() };
3902
+ }
3903
+ return Number(BigInt.asIntN(64, value));
3904
+ }
3905
+ if (value instanceof RegExp || isRegExp(value)) {
3906
+ let flags = value.flags;
3907
+ if (flags === undefined) {
3908
+ const match = value.toString().match(/[gimuy]*$/);
3909
+ if (match) {
3910
+ flags = match[0];
3911
+ }
3912
+ }
3913
+ const rx = new BSONRegExp(value.source, flags);
3914
+ return rx.toExtendedJSON(options);
3915
+ }
3916
+ if (value != null && typeof value === 'object')
3917
+ return serializeDocument(value, options);
3918
+ return value;
3919
+ }
3920
+ const BSON_TYPE_MAPPINGS = {
3921
+ Binary: (o) => new Binary(o.value(), o.sub_type),
3922
+ Code: (o) => new Code(o.code, o.scope),
3923
+ DBRef: (o) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields),
3924
+ Decimal128: (o) => new Decimal128(o.bytes),
3925
+ Double: (o) => new Double(o.value),
3926
+ Int32: (o) => new Int32(o.value),
3927
+ Long: (o) => Long.fromBits(o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_),
3928
+ MaxKey: () => new MaxKey(),
3929
+ MinKey: () => new MinKey(),
3930
+ ObjectId: (o) => new ObjectId(o),
3931
+ BSONRegExp: (o) => new BSONRegExp(o.pattern, o.options),
3932
+ BSONSymbol: (o) => new BSONSymbol(o.value),
3933
+ Timestamp: (o) => Timestamp.fromBits(o.low, o.high)
3934
+ };
3935
+ function serializeDocument(doc, options) {
3936
+ if (doc == null || typeof doc !== 'object')
3937
+ throw new BSONError('not an object instance');
3938
+ const bsontype = doc._bsontype;
3939
+ if (typeof bsontype === 'undefined') {
3940
+ const _doc = {};
3941
+ for (const name of Object.keys(doc)) {
3942
+ options.seenObjects.push({ propertyName: name, obj: null });
3943
+ try {
3944
+ const value = serializeValue(doc[name], options);
3945
+ if (name === '__proto__') {
3946
+ Object.defineProperty(_doc, name, {
3947
+ value,
3948
+ writable: true,
3949
+ enumerable: true,
3950
+ configurable: true
3951
+ });
3952
+ }
3953
+ else {
3954
+ _doc[name] = value;
3955
+ }
3956
+ }
3957
+ finally {
3958
+ options.seenObjects.pop();
3959
+ }
3960
+ }
3961
+ return _doc;
3962
+ }
3963
+ else if (doc != null &&
3964
+ typeof doc === 'object' &&
3965
+ typeof doc._bsontype === 'string' &&
3966
+ doc[Symbol.for('@@mdb.bson.version')] !== BSON_MAJOR_VERSION) {
3967
+ throw new BSONVersionError();
3968
+ }
3969
+ else if (isBSONType(doc)) {
3970
+ let outDoc = doc;
3971
+ if (typeof outDoc.toExtendedJSON !== 'function') {
3972
+ const mapper = BSON_TYPE_MAPPINGS[doc._bsontype];
3973
+ if (!mapper) {
3974
+ throw new BSONError('Unrecognized or invalid _bsontype: ' + doc._bsontype);
3975
+ }
3976
+ outDoc = mapper(outDoc);
3977
+ }
3978
+ if (bsontype === 'Code' && outDoc.scope) {
3979
+ outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options));
3980
+ }
3981
+ else if (bsontype === 'DBRef' && outDoc.oid) {
3982
+ outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options));
3983
+ }
3984
+ return outDoc.toExtendedJSON(options);
3985
+ }
3986
+ else {
3987
+ throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype);
3988
+ }
3989
+ }
3990
+ function parse(text, options) {
3991
+ const ejsonOptions = {
3992
+ useBigInt64: options?.useBigInt64 ?? false,
3993
+ relaxed: options?.relaxed ?? true,
3994
+ legacy: options?.legacy ?? false
3995
+ };
3996
+ return JSON.parse(text, (key, value) => {
3997
+ if (key.indexOf('\x00') !== -1) {
3998
+ throw new BSONError(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}`);
3999
+ }
4000
+ return deserializeValue(value, ejsonOptions);
4001
+ });
4002
+ }
4003
+ function stringify(value, replacer, space, options) {
4004
+ if (space != null && typeof space === 'object') {
4005
+ options = space;
4006
+ space = 0;
4007
+ }
4008
+ if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) {
4009
+ options = replacer;
4010
+ replacer = undefined;
4011
+ space = 0;
4012
+ }
4013
+ const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, {
4014
+ seenObjects: [{ propertyName: '(root)', obj: null }]
4015
+ });
4016
+ const doc = serializeValue(value, serializeOptions);
4017
+ return JSON.stringify(doc, replacer, space);
4018
+ }
4019
+ function EJSONserialize(value, options) {
4020
+ options = options || {};
4021
+ return JSON.parse(stringify(value, options));
4022
+ }
4023
+ function EJSONdeserialize(ejson, options) {
4024
+ options = options || {};
4025
+ return parse(JSON.stringify(ejson), options);
4026
+ }
4027
+ const EJSON = Object.create(null);
4028
+ EJSON.parse = parse;
4029
+ EJSON.stringify = stringify;
4030
+ EJSON.serialize = EJSONserialize;
4031
+ EJSON.deserialize = EJSONdeserialize;
4032
+ Object.freeze(EJSON);
4033
+
4034
+ const MAXSIZE = 1024 * 1024 * 17;
4035
+ let buffer = ByteUtils.allocate(MAXSIZE);
4036
+ function setInternalBufferSize(size) {
4037
+ if (buffer.length < size) {
4038
+ buffer = ByteUtils.allocate(size);
4039
+ }
4040
+ }
4041
+ function serialize(object, options = {}) {
4042
+ const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
4043
+ const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
4044
+ const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
4045
+ const minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE;
4046
+ if (buffer.length < minInternalBufferSize) {
4047
+ buffer = ByteUtils.allocate(minInternalBufferSize);
4048
+ }
4049
+ const serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, null);
4050
+ const finishedBuffer = ByteUtils.allocate(serializationIndex);
4051
+ finishedBuffer.set(buffer.subarray(0, serializationIndex), 0);
4052
+ return finishedBuffer;
4053
+ }
4054
+ function serializeWithBufferAndIndex(object, finalBuffer, options = {}) {
4055
+ const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
4056
+ const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
4057
+ const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
4058
+ const startIndex = typeof options.index === 'number' ? options.index : 0;
4059
+ const serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, null);
4060
+ finalBuffer.set(buffer.subarray(0, serializationIndex), startIndex);
4061
+ return startIndex + serializationIndex - 1;
4062
+ }
4063
+ function deserialize(buffer, options = {}) {
4064
+ return internalDeserialize(ByteUtils.toLocalBufferType(buffer), options);
4065
+ }
4066
+ function calculateObjectSize(object, options = {}) {
4067
+ options = options || {};
4068
+ const serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
4069
+ const ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
4070
+ return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined);
4071
+ }
4072
+ function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) {
4073
+ const internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options);
4074
+ const bufferData = ByteUtils.toLocalBufferType(data);
4075
+ let index = startIndex;
4076
+ for (let i = 0; i < numberOfDocuments; i++) {
4077
+ const size = bufferData[index] |
4078
+ (bufferData[index + 1] << 8) |
4079
+ (bufferData[index + 2] << 16) |
4080
+ (bufferData[index + 3] << 24);
4081
+ internalOptions.index = index;
4082
+ documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions);
4083
+ index = index + size;
4084
+ }
4085
+ return index;
4086
+ }
4087
+
4088
+ var bson = /*#__PURE__*/Object.freeze({
4089
+ __proto__: null,
4090
+ BSONError: BSONError,
4091
+ BSONRegExp: BSONRegExp,
4092
+ BSONRuntimeError: BSONRuntimeError,
4093
+ BSONSymbol: BSONSymbol,
4094
+ BSONType: BSONType,
4095
+ BSONValue: BSONValue,
4096
+ BSONVersionError: BSONVersionError,
4097
+ Binary: Binary,
4098
+ Code: Code,
4099
+ DBRef: DBRef,
4100
+ Decimal128: Decimal128,
4101
+ Double: Double,
4102
+ EJSON: EJSON,
4103
+ Int32: Int32,
4104
+ Long: Long,
4105
+ MaxKey: MaxKey,
4106
+ MinKey: MinKey,
4107
+ ObjectId: ObjectId,
4108
+ Timestamp: Timestamp,
4109
+ UUID: UUID,
4110
+ calculateObjectSize: calculateObjectSize,
4111
+ deserialize: deserialize,
4112
+ deserializeStream: deserializeStream,
4113
+ serialize: serialize,
4114
+ serializeWithBufferAndIndex: serializeWithBufferAndIndex,
4115
+ setInternalBufferSize: setInternalBufferSize
4116
+ });
4117
+
4118
+ exports.BSON = bson;
4119
+ exports.BSONError = BSONError;
4120
+ exports.BSONRegExp = BSONRegExp;
4121
+ exports.BSONRuntimeError = BSONRuntimeError;
4122
+ exports.BSONSymbol = BSONSymbol;
4123
+ exports.BSONType = BSONType;
4124
+ exports.BSONValue = BSONValue;
4125
+ exports.BSONVersionError = BSONVersionError;
4126
+ exports.Binary = Binary;
4127
+ exports.Code = Code;
4128
+ exports.DBRef = DBRef;
4129
+ exports.Decimal128 = Decimal128;
4130
+ exports.Double = Double;
4131
+ exports.EJSON = EJSON;
4132
+ exports.Int32 = Int32;
4133
+ exports.Long = Long;
4134
+ exports.MaxKey = MaxKey;
4135
+ exports.MinKey = MinKey;
4136
+ exports.ObjectId = ObjectId;
4137
+ exports.Timestamp = Timestamp;
4138
+ exports.UUID = UUID;
4139
+ exports.calculateObjectSize = calculateObjectSize;
4140
+ exports.deserialize = deserialize;
4141
+ exports.deserializeStream = deserializeStream;
4142
+ exports.serialize = serialize;
4143
+ exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex;
4144
+ exports.setInternalBufferSize = setInternalBufferSize;
4145
+
4146
+ return exports;
4147
+
4148
+ })({});
4149
+ //# sourceMappingURL=bson.bundle.js.map