pybiolib 0.2.951__py3-none-any.whl → 1.2.1890__py3-none-any.whl
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.
- biolib/__init__.py +357 -11
- biolib/_data_record/data_record.py +380 -0
- biolib/_index/__init__.py +0 -0
- biolib/_index/index.py +55 -0
- biolib/_index/query_result.py +103 -0
- biolib/_internal/__init__.py +0 -0
- biolib/_internal/add_copilot_prompts.py +58 -0
- biolib/_internal/add_gui_files.py +81 -0
- biolib/_internal/data_record/__init__.py +1 -0
- biolib/_internal/data_record/data_record.py +85 -0
- biolib/_internal/data_record/push_data.py +116 -0
- biolib/_internal/data_record/remote_storage_endpoint.py +43 -0
- biolib/_internal/errors.py +5 -0
- biolib/_internal/file_utils.py +125 -0
- biolib/_internal/fuse_mount/__init__.py +1 -0
- biolib/_internal/fuse_mount/experiment_fuse_mount.py +209 -0
- biolib/_internal/http_client.py +159 -0
- biolib/_internal/lfs/__init__.py +1 -0
- biolib/_internal/lfs/cache.py +51 -0
- biolib/_internal/libs/__init__.py +1 -0
- biolib/_internal/libs/fusepy/__init__.py +1257 -0
- biolib/_internal/push_application.py +488 -0
- biolib/_internal/runtime.py +22 -0
- biolib/_internal/string_utils.py +13 -0
- biolib/_internal/templates/__init__.py +1 -0
- biolib/_internal/templates/copilot_template/.github/instructions/general-app-knowledge.instructions.md +10 -0
- biolib/_internal/templates/copilot_template/.github/instructions/style-general.instructions.md +20 -0
- biolib/_internal/templates/copilot_template/.github/instructions/style-python.instructions.md +16 -0
- biolib/_internal/templates/copilot_template/.github/instructions/style-react-ts.instructions.md +47 -0
- biolib/_internal/templates/copilot_template/.github/prompts/biolib_app_inputs.prompt.md +11 -0
- biolib/_internal/templates/copilot_template/.github/prompts/biolib_onboard_repo.prompt.md +19 -0
- biolib/_internal/templates/copilot_template/.github/prompts/biolib_run_apps.prompt.md +12 -0
- biolib/_internal/templates/dashboard_template/.biolib/config.yml +5 -0
- biolib/_internal/templates/github_workflow_template/.github/workflows/biolib.yml +21 -0
- biolib/_internal/templates/gitignore_template/.gitignore +10 -0
- biolib/_internal/templates/gui_template/.yarnrc.yml +1 -0
- biolib/_internal/templates/gui_template/App.tsx +53 -0
- biolib/_internal/templates/gui_template/Dockerfile +27 -0
- biolib/_internal/templates/gui_template/biolib-sdk.ts +82 -0
- biolib/_internal/templates/gui_template/dev-data/output.json +7 -0
- biolib/_internal/templates/gui_template/index.css +5 -0
- biolib/_internal/templates/gui_template/index.html +13 -0
- biolib/_internal/templates/gui_template/index.tsx +10 -0
- biolib/_internal/templates/gui_template/package.json +27 -0
- biolib/_internal/templates/gui_template/tsconfig.json +24 -0
- biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts +50 -0
- biolib/_internal/templates/gui_template/vite.config.mts +10 -0
- biolib/_internal/templates/init_template/.biolib/config.yml +19 -0
- biolib/_internal/templates/init_template/Dockerfile +14 -0
- biolib/_internal/templates/init_template/requirements.txt +1 -0
- biolib/_internal/templates/init_template/run.py +12 -0
- biolib/_internal/templates/init_template/run.sh +4 -0
- biolib/_internal/templates/templates.py +25 -0
- biolib/_internal/tree_utils.py +106 -0
- biolib/_internal/utils/__init__.py +65 -0
- biolib/_internal/utils/auth.py +46 -0
- biolib/_internal/utils/job_url.py +33 -0
- biolib/_internal/utils/multinode.py +263 -0
- biolib/_runtime/runtime.py +157 -0
- biolib/_session/session.py +44 -0
- biolib/_shared/__init__.py +0 -0
- biolib/_shared/types/__init__.py +74 -0
- biolib/_shared/types/account.py +12 -0
- biolib/_shared/types/account_member.py +8 -0
- biolib/_shared/types/app.py +9 -0
- biolib/_shared/types/data_record.py +40 -0
- biolib/_shared/types/experiment.py +32 -0
- biolib/_shared/types/file_node.py +17 -0
- biolib/_shared/types/push.py +6 -0
- biolib/_shared/types/resource.py +37 -0
- biolib/_shared/types/resource_deploy_key.py +11 -0
- biolib/_shared/types/resource_permission.py +14 -0
- biolib/_shared/types/resource_version.py +19 -0
- biolib/_shared/types/result.py +14 -0
- biolib/_shared/types/typing.py +10 -0
- biolib/_shared/types/user.py +19 -0
- biolib/_shared/utils/__init__.py +7 -0
- biolib/_shared/utils/resource_uri.py +75 -0
- biolib/api/__init__.py +6 -0
- biolib/api/client.py +168 -0
- biolib/app/app.py +252 -49
- biolib/app/search_apps.py +45 -0
- biolib/biolib_api_client/api_client.py +126 -31
- biolib/biolib_api_client/app_types.py +24 -4
- biolib/biolib_api_client/auth.py +31 -8
- biolib/biolib_api_client/biolib_app_api.py +147 -52
- biolib/biolib_api_client/biolib_job_api.py +161 -141
- biolib/biolib_api_client/job_types.py +21 -5
- biolib/biolib_api_client/lfs_types.py +7 -23
- biolib/biolib_api_client/user_state.py +56 -0
- biolib/biolib_binary_format/__init__.py +1 -4
- biolib/biolib_binary_format/file_in_container.py +105 -0
- biolib/biolib_binary_format/module_input.py +24 -7
- biolib/biolib_binary_format/module_output_v2.py +149 -0
- biolib/biolib_binary_format/remote_endpoints.py +34 -0
- biolib/biolib_binary_format/remote_stream_seeker.py +59 -0
- biolib/biolib_binary_format/saved_job.py +3 -2
- biolib/biolib_binary_format/{attestation_document.py → stdout_and_stderr.py} +8 -8
- biolib/biolib_binary_format/system_status_update.py +3 -2
- biolib/biolib_binary_format/utils.py +175 -0
- biolib/biolib_docker_client/__init__.py +11 -2
- biolib/biolib_errors.py +36 -0
- biolib/biolib_logging.py +27 -10
- biolib/cli/__init__.py +38 -0
- biolib/cli/auth.py +46 -0
- biolib/cli/data_record.py +164 -0
- biolib/cli/index.py +32 -0
- biolib/cli/init.py +421 -0
- biolib/cli/lfs.py +101 -0
- biolib/cli/push.py +50 -0
- biolib/cli/run.py +63 -0
- biolib/cli/runtime.py +14 -0
- biolib/cli/sdk.py +16 -0
- biolib/cli/start.py +56 -0
- biolib/compute_node/cloud_utils/cloud_utils.py +110 -161
- biolib/compute_node/job_worker/cache_state.py +66 -88
- biolib/compute_node/job_worker/cache_types.py +1 -6
- biolib/compute_node/job_worker/docker_image_cache.py +112 -37
- biolib/compute_node/job_worker/executors/__init__.py +0 -3
- biolib/compute_node/job_worker/executors/docker_executor.py +532 -199
- biolib/compute_node/job_worker/executors/docker_types.py +9 -1
- biolib/compute_node/job_worker/executors/types.py +19 -9
- biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +30 -0
- biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +3 -5
- biolib/compute_node/job_worker/job_storage.py +108 -0
- biolib/compute_node/job_worker/job_worker.py +397 -212
- biolib/compute_node/job_worker/large_file_system.py +87 -38
- biolib/compute_node/job_worker/network_alloc.py +99 -0
- biolib/compute_node/job_worker/network_buffer.py +240 -0
- biolib/compute_node/job_worker/utilization_reporter_thread.py +197 -0
- biolib/compute_node/job_worker/utils.py +9 -24
- biolib/compute_node/remote_host_proxy.py +400 -98
- biolib/compute_node/utils.py +31 -9
- biolib/compute_node/webserver/compute_node_results_proxy.py +189 -0
- biolib/compute_node/webserver/proxy_utils.py +28 -0
- biolib/compute_node/webserver/webserver.py +130 -44
- biolib/compute_node/webserver/webserver_types.py +2 -6
- biolib/compute_node/webserver/webserver_utils.py +77 -12
- biolib/compute_node/webserver/worker_thread.py +183 -42
- biolib/experiments/__init__.py +0 -0
- biolib/experiments/experiment.py +356 -0
- biolib/jobs/__init__.py +1 -0
- biolib/jobs/job.py +741 -0
- biolib/jobs/job_result.py +185 -0
- biolib/jobs/types.py +50 -0
- biolib/py.typed +0 -0
- biolib/runtime/__init__.py +14 -0
- biolib/sdk/__init__.py +91 -0
- biolib/tables.py +34 -0
- biolib/typing_utils.py +2 -7
- biolib/user/__init__.py +1 -0
- biolib/user/sign_in.py +54 -0
- biolib/utils/__init__.py +162 -0
- biolib/utils/cache_state.py +94 -0
- biolib/utils/multipart_uploader.py +194 -0
- biolib/utils/seq_util.py +150 -0
- biolib/utils/zip/remote_zip.py +640 -0
- pybiolib-1.2.1890.dist-info/METADATA +41 -0
- pybiolib-1.2.1890.dist-info/RECORD +177 -0
- {pybiolib-0.2.951.dist-info → pybiolib-1.2.1890.dist-info}/WHEEL +1 -1
- pybiolib-1.2.1890.dist-info/entry_points.txt +2 -0
- README.md +0 -17
- biolib/app/app_result.py +0 -68
- biolib/app/utils.py +0 -62
- biolib/biolib-js/0-biolib.worker.js +0 -1
- biolib/biolib-js/1-biolib.worker.js +0 -1
- biolib/biolib-js/2-biolib.worker.js +0 -1
- biolib/biolib-js/3-biolib.worker.js +0 -1
- biolib/biolib-js/4-biolib.worker.js +0 -1
- biolib/biolib-js/5-biolib.worker.js +0 -1
- biolib/biolib-js/6-biolib.worker.js +0 -1
- biolib/biolib-js/index.html +0 -10
- biolib/biolib-js/main-biolib.js +0 -1
- biolib/biolib_api_client/biolib_account_api.py +0 -21
- biolib/biolib_api_client/biolib_large_file_system_api.py +0 -108
- biolib/biolib_binary_format/aes_encrypted_package.py +0 -42
- biolib/biolib_binary_format/module_output.py +0 -58
- biolib/biolib_binary_format/rsa_encrypted_aes_package.py +0 -57
- biolib/biolib_push.py +0 -114
- biolib/cli.py +0 -203
- biolib/cli_utils.py +0 -273
- biolib/compute_node/cloud_utils/enclave_parent_types.py +0 -7
- biolib/compute_node/enclave/__init__.py +0 -2
- biolib/compute_node/enclave/enclave_remote_hosts.py +0 -53
- biolib/compute_node/enclave/nitro_secure_module_utils.py +0 -64
- biolib/compute_node/job_worker/executors/base_executor.py +0 -18
- biolib/compute_node/job_worker/executors/pyppeteer_executor.py +0 -173
- biolib/compute_node/job_worker/executors/remote/__init__.py +0 -1
- biolib/compute_node/job_worker/executors/remote/nitro_enclave_utils.py +0 -81
- biolib/compute_node/job_worker/executors/remote/remote_executor.py +0 -51
- biolib/lfs.py +0 -196
- biolib/pyppeteer/.circleci/config.yml +0 -100
- biolib/pyppeteer/.coveragerc +0 -3
- biolib/pyppeteer/.gitignore +0 -89
- biolib/pyppeteer/.pre-commit-config.yaml +0 -28
- biolib/pyppeteer/CHANGES.md +0 -253
- biolib/pyppeteer/CONTRIBUTING.md +0 -26
- biolib/pyppeteer/LICENSE +0 -12
- biolib/pyppeteer/README.md +0 -137
- biolib/pyppeteer/docs/Makefile +0 -177
- biolib/pyppeteer/docs/_static/custom.css +0 -28
- biolib/pyppeteer/docs/_templates/layout.html +0 -10
- biolib/pyppeteer/docs/changes.md +0 -1
- biolib/pyppeteer/docs/conf.py +0 -299
- biolib/pyppeteer/docs/index.md +0 -21
- biolib/pyppeteer/docs/make.bat +0 -242
- biolib/pyppeteer/docs/reference.md +0 -211
- biolib/pyppeteer/docs/server.py +0 -60
- biolib/pyppeteer/poetry.lock +0 -1699
- biolib/pyppeteer/pyppeteer/__init__.py +0 -135
- biolib/pyppeteer/pyppeteer/accessibility.py +0 -286
- biolib/pyppeteer/pyppeteer/browser.py +0 -401
- biolib/pyppeteer/pyppeteer/browser_fetcher.py +0 -194
- biolib/pyppeteer/pyppeteer/command.py +0 -22
- biolib/pyppeteer/pyppeteer/connection/__init__.py +0 -242
- biolib/pyppeteer/pyppeteer/connection/cdpsession.py +0 -101
- biolib/pyppeteer/pyppeteer/coverage.py +0 -346
- biolib/pyppeteer/pyppeteer/device_descriptors.py +0 -787
- biolib/pyppeteer/pyppeteer/dialog.py +0 -79
- biolib/pyppeteer/pyppeteer/domworld.py +0 -597
- biolib/pyppeteer/pyppeteer/emulation_manager.py +0 -53
- biolib/pyppeteer/pyppeteer/errors.py +0 -48
- biolib/pyppeteer/pyppeteer/events.py +0 -63
- biolib/pyppeteer/pyppeteer/execution_context.py +0 -156
- biolib/pyppeteer/pyppeteer/frame/__init__.py +0 -299
- biolib/pyppeteer/pyppeteer/frame/frame_manager.py +0 -306
- biolib/pyppeteer/pyppeteer/helpers.py +0 -245
- biolib/pyppeteer/pyppeteer/input.py +0 -371
- biolib/pyppeteer/pyppeteer/jshandle.py +0 -598
- biolib/pyppeteer/pyppeteer/launcher.py +0 -683
- biolib/pyppeteer/pyppeteer/lifecycle_watcher.py +0 -169
- biolib/pyppeteer/pyppeteer/models/__init__.py +0 -103
- biolib/pyppeteer/pyppeteer/models/_protocol.py +0 -12460
- biolib/pyppeteer/pyppeteer/multimap.py +0 -82
- biolib/pyppeteer/pyppeteer/network_manager.py +0 -678
- biolib/pyppeteer/pyppeteer/options.py +0 -8
- biolib/pyppeteer/pyppeteer/page.py +0 -1728
- biolib/pyppeteer/pyppeteer/pipe_transport.py +0 -59
- biolib/pyppeteer/pyppeteer/target.py +0 -147
- biolib/pyppeteer/pyppeteer/task_queue.py +0 -24
- biolib/pyppeteer/pyppeteer/timeout_settings.py +0 -36
- biolib/pyppeteer/pyppeteer/tracing.py +0 -93
- biolib/pyppeteer/pyppeteer/us_keyboard_layout.py +0 -305
- biolib/pyppeteer/pyppeteer/util.py +0 -18
- biolib/pyppeteer/pyppeteer/websocket_transport.py +0 -47
- biolib/pyppeteer/pyppeteer/worker.py +0 -101
- biolib/pyppeteer/pyproject.toml +0 -97
- biolib/pyppeteer/spell.txt +0 -137
- biolib/pyppeteer/tox.ini +0 -72
- biolib/pyppeteer/utils/generate_protocol_types.py +0 -603
- biolib/start_cli.py +0 -7
- biolib/utils.py +0 -47
- biolib/validators/validate_app_version.py +0 -183
- biolib/validators/validate_argument.py +0 -134
- biolib/validators/validate_module.py +0 -323
- biolib/validators/validate_zip_file.py +0 -40
- biolib/validators/validator_utils.py +0 -103
- pybiolib-0.2.951.dist-info/LICENSE +0 -21
- pybiolib-0.2.951.dist-info/METADATA +0 -61
- pybiolib-0.2.951.dist-info/RECORD +0 -153
- pybiolib-0.2.951.dist-info/entry_points.txt +0 -3
- /LICENSE → /pybiolib-1.2.1890.dist-info/licenses/LICENSE +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=50)}([function(e,t,r){"use strict";var n=r(5),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function f(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:f,isStream:function(e){return a(e)&&f(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)c(arguments[n],r);return t},extend:function(e,t,r){return c(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,r){"use strict";(function(e){var n=r(38),i=r(39),o=r(40);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=a(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|d(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(c(t),e=a(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|d(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return k(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function _(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(f(e,o)===f(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(f(e,o+h)!==f(t,h)){l=!1;break}if(l)return o}return-1}function m(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function w(e,t,r,n){return Y(k(t,e.length-r),e,r,n)}function v(e,t,r,n){return Y(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return v(e,t,r,n)}function S(e,t,r,n){return Y(F(t),e,r,n)}function O(e,t,r,n){return Y(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function B(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,f=e[i],c=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return f(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)_(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?B(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),f=this.slice(n,i),c=e.slice(t,r),l=0;l<a;++l)if(f[l]!==c[l]){o=f[l],s=c[l];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function N(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function x(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=L(e[o]);return i}function M(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function $(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function U(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function P(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return o||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function C(e,t,r,n,o){return o||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):U(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):$(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):$(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):U(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):U(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return C(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return C(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=u.isBuffer(e)?e:k(new u(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var z=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function k(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(4))},function(e,t,r){e.exports=r(49)},function(e,t){e.exports=n;var r=null;try{r=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}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},s={};function a(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=s[e])?n:(r=f(e,(0|e)<0?-1:0,!0),i&&(s[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=f(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function u(e,t){if(isNaN(e))return t?y:b;if(t){if(e<0)return y;if(e>=p)return S}else{if(e<=-g)return O;if(e+1>=g)return E}return e<0?u(-e,t).neg():f(e%d|0,e/d|0,t)}function f(e,t,r){return new n(e,t,r)}n.fromInt=a,n.fromNumber=u,n.fromBits=f;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return b;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=u(c(r,8)),o=b,s=0;s<e.length;s+=8){var a=Math.min(8,e.length-s),f=parseInt(e.substring(s,s+a),r);if(a<8){var h=u(c(r,a));o=o.mul(h).add(u(f))}else o=(o=o.mul(i)).add(u(f))}return o.unsigned=t,o}function h(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?l(e,t):f(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=l,n.fromValue=h;var d=4294967296,p=d*d,g=p/2,_=a(1<<24),b=a(0);n.ZERO=b;var y=a(0,!0);n.UZERO=y;var m=a(1);n.ONE=m;var w=a(1,!0);n.UONE=w;var v=a(-1);n.NEG_ONE=v;var E=f(-1,2147483647,!1);n.MAX_VALUE=E;var S=f(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var O=f(0,-2147483648,!1);n.MIN_VALUE=O;var A=n.prototype;A.toInt=function(){return this.unsigned?this.low>>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},A.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=u(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=u(c(e,6),this.unsigned),o=this,s="";;){var a=o.div(i),f=(o.sub(a.mul(i)).toInt()>>>0).toString(e);if((o=a).isZero())return f+s;for(;f.length<6;)f="0"+f;s=""+f+s}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},A.isZero=function(){return 0===this.high&&0===this.low},A.eqz=A.isZero,A.isNegative=function(){return!this.unsigned&&this.high<0},A.isPositive=function(){return this.unsigned||this.high>=0},A.isOdd=function(){return 1==(1&this.low)},A.isEven=function(){return 0==(1&this.low)},A.equals=function(e){return i(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},A.eq=A.equals,A.notEquals=function(e){return!this.eq(e)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(e){return this.comp(e)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(e){return this.comp(e)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(e){return this.comp(e)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(e){return this.comp(e)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.compare=function(e){if(i(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(m)},A.neg=A.negate,A.add=function(e){i(e)||(e=h(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,c=0,l=0,d=0,p=0;return d+=(p+=o+(65535&e.low))>>>16,l+=(d+=n+u)>>>16,c+=(l+=r+a)>>>16,c+=t+s,f((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},A.subtract=function(e){return i(e)||(e=h(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(e){if(this.isZero())return b;if(i(e)||(e=h(e)),r)return f(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return b;if(this.eq(O))return e.isOdd()?O:b;if(e.eq(O))return this.isOdd()?O:b;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(_)&&e.lt(_))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,a=e.high>>>16,c=65535&e.high,l=e.low>>>16,d=65535&e.low,p=0,g=0,y=0,m=0;return y+=(m+=s*d)>>>16,g+=(y+=o*d)>>>16,y&=65535,g+=(y+=s*l)>>>16,p+=(g+=n*d)>>>16,g&=65535,p+=(g+=o*l)>>>16,g&=65535,p+=(g+=s*c)>>>16,p+=t*d+n*l+o*c+s*a,f((y&=65535)<<16|(m&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},A.mul=A.multiply,A.divide=function(e){if(i(e)||(e=h(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?f((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:b;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return w;o=y}else{if(this.eq(O))return e.eq(m)||e.eq(v)?O:e.eq(O)?m:(t=this.shr(1).div(e).shl(1)).eq(b)?e.isNegative()?m:v:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(O))return this.unsigned?y:b;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=b}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),a=s<=48?1:c(2,s-48),l=u(t),d=l.mul(e);d.isNegative()||d.gt(n);)d=(l=u(t-=a,this.unsigned)).mul(e);l.isZero()&&(l=m),o=o.add(l),n=n.sub(d)}return o},A.div=A.divide,A.modulo=function(e){return i(e)||(e=h(e)),r?f((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return f(~this.low,~this.high,this.unsigned)},A.and=function(e){return i(e)||(e=h(e)),f(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return i(e)||(e=h(e)),f(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return i(e)||(e=h(e)),f(this.low^e.low,this.high^e.high,this.unsigned)},A.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?f(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):f(0,this.low<<e-32,this.unsigned)},A.shl=A.shiftLeft,A.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?f(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):f(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?f(this.low>>>e|t<<32-e,t>>>e,this.unsigned):f(32===e?t:t>>>e-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.toSigned=function(){return this.unsigned?f(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:f(this.low,this.high,!0)},A.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},A.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(0);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(26),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(a=r(10)),a),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(o)})),e.exports=u}).call(this,r(9))},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,f=[],c=!1,l=-1;function h(){c&&u&&(c=!1,u.length?f=u.concat(f):l=-1,f.length&&d())}function d(){if(!c){var e=a(h);c=!0;for(var t=f.length;t;){for(u=f,f=[];++l<t;)u&&u[l].run();l=-1,t=f.length}u=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new p(e,t)),1!==f.length||c||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(0),i=r(27),o=r(29),s=r(6),a=r(30),u=r(33),f=r(34),c=r(11);e.exports=function(e){return new Promise((function(t,r){var l=e.data,h=e.headers;n.isFormData(l)&&delete h["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";h.Authorization="Basic "+btoa(p+":"+g)}var _=a(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),s(_,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?u(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};i(t,r,o),d=null}},d.onabort=function(){d&&(r(c("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){r(c("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(c(t,e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||f(_))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(h[e.xsrfHeaderName]=b)}if("setRequestHeader"in d&&n.forEach(h,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete h[t]:d.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),r(e),d=null)})),l||(l=null),d.send(l)}))}},function(e,t,r){"use strict";var n=r(28);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function f(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=u(void 0,e[i])):r[i]=u(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(o,f),n.forEach(s,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=u(void 0,e[i])):r[i]=u(void 0,t[i])})),n.forEach(a,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var c=i.concat(o).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return n.forEach(l,f),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(45);let i=n.DefaultSerializer;t.registerSerializer=function(e){i=n.extendSerializer(i,e)},t.deserialize=function(e){return i.deserialize(e)},t.serialize=function(e){return i.serialize(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(46);t.isTransferDescriptor=function(e){return e&&"object"==typeof e&&e[n.$transferable]},t.Transfer=function(e,t){if(!t){if(!(r=e)||"object"!=typeof r)throw Error();t=[e]}var r;return{[n.$transferable]:!0,send:e,transferables:t}}},function(e,t,r){e.exports=r(21)},function(module,__webpack_exports__,__webpack_require__){"use strict";(function(global,Buffer){__webpack_require__.d(__webpack_exports__,"a",(function(){return bson_47}));var long__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(3),long__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(long__WEBPACK_IMPORTED_MODULE_0__),buffer__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),buffer__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_1__),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var map=createCommonjsModule((function(e){if(void 0!==commonjsGlobal.Map)e.exports=commonjsGlobal.Map,e.exports.Map=commonjsGlobal.Map;else{var t=function(e){this._keys=[],this._values={};for(var t=0;t<e.length;t++)if(null!=e[t]){var r=e[t],n=r[0],i=r[1];this._keys.push(n),this._values[n]={v:i,i:this._keys.length-1}}};t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(e){var t=this._values[e];return null!=t&&(delete this._values[e],this._keys.splice(t.i,1),!0)},t.prototype.entries=function(){var e=this,t=0;return{next:function(){var r=e._keys[t++];return{value:void 0!==r?[r,e._values[r].v]:void 0,done:void 0===r}}}},t.prototype.forEach=function(e,t){t=t||this;for(var r=0;r<this._keys.length;r++){var n=this._keys[r];e.call(t,this._values[n].v,n,t)}},t.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},t.prototype.has=function(e){return null!=this._values[e]},t.prototype.keys=function(){var e=this,t=0;return{next:function(){var r=e._keys[t++];return{value:void 0!==r?r:void 0,done:void 0===r}}}},t.prototype.set=function(e,t){return this._values[e]?(this._values[e].v=t,this):(this._keys.push(e),this._values[e]={v:t,i:this._keys.length-1},this)},t.prototype.values=function(){var e=this,t=0;return{next:function(){var r=e._keys[t++];return{value:void 0!==r?e._values[r].v:void 0,done:void 0===r}}}},Object.defineProperty(t.prototype,"size",{enumerable:!0,get:function(){return this._keys.length}}),e.exports=t}})),map_1=map.Map;long__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},long__WEBPACK_IMPORTED_MODULE_0___default.a.fromExtendedJSON=function(e,t){var r=long__WEBPACK_IMPORTED_MODULE_0___default.a.fromString(e.$numberLong);return t&&t.relaxed?r.toNumber():r},Object.defineProperty(long__WEBPACK_IMPORTED_MODULE_0___default.a.prototype,"_bsontype",{value:"Long"});var long_1=long__WEBPACK_IMPORTED_MODULE_0___default.a;function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}var Double=function(){function e(t){_classCallCheck(this,e),t instanceof Number&&(t=t.valueOf()),this.value=t}return _createClass(e,[{key:"valueOf",value:function(){return this.value}},{key:"toJSON",value:function(){return this.value}},{key:"toExtendedJSON",value:function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:{$numberDouble:this.value.toString()}}}],[{key:"fromExtendedJSON",value:function(t,r){return r&&r.relaxed?parseFloat(t.$numberDouble):new e(parseFloat(t.$numberDouble))}}]),e}();Object.defineProperty(Double.prototype,"_bsontype",{value:"Double"});var double_1=Double;function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck$1(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$1(e,t,r){return t&&_defineProperties$1(e.prototype,t),r&&_defineProperties$1(e,r),e}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Timestamp=function(e){function t(e,r){var n;return _classCallCheck$1(this,t),n=long_1.isLong(e)?_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e.low,e.high,!0)):_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e,r,!0)),_possibleConstructorReturn(n)}return _inherits(t,e),_createClass$1(t,[{key:"toJSON",value:function(){return{$timestamp:this.toString()}}},{key:"toExtendedJSON",value:function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}}}],[{key:"fromInt",value:function(e){return new t(long_1.fromInt(e,!0))}},{key:"fromNumber",value:function(e){return new t(long_1.fromNumber(e,!0))}},{key:"fromBits",value:function(e,r){return new t(e,r)}},{key:"fromString",value:function(e,r){return new t(long_1.fromString(e,r,!0))}},{key:"fromExtendedJSON",value:function(e){return new t(e.$timestamp.i,e.$timestamp.t)}}]),t}(long_1);Object.defineProperty(Timestamp.prototype,"_bsontype",{value:"Timestamp"}),Timestamp.MAX_VALUE=Timestamp.MAX_UNSIGNED_VALUE;var timestamp=Timestamp,require$$0={};function normalizedFunctionString(e){return e.toString().replace("function(","function (")}function insecureRandomBytes(e){for(var t=new Uint8Array(e),r=0;r<e;++r)t[r]=Math.floor(256*Math.random());return t}var randomBytes=insecureRandomBytes;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues)randomBytes=function(e){return window.crypto.getRandomValues(new Uint8Array(e))};else{try{randomBytes=require$$0.randomBytes}catch(e){}null==randomBytes&&(randomBytes=insecureRandomBytes)}var utils={normalizedFunctionString:normalizedFunctionString,randomBytes:randomBytes};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}"function"==typeof global.setTimeout&&(cachedSetTimeout=setTimeout),"function"==typeof global.clearTimeout&&(cachedClearTimeout=clearTimeout);var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function nextTick(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)}function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding(e){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(e){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance=global.performance||{},performanceNow=performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow||function(){return(new Date).getTime()};function hrtime(e){var t=.001*performanceNow.call(performance),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]}var startTime=new Date;function uptime(){return(new Date-startTime)/1e3}var process={nextTick:nextTick,title:title,browser:browser,env:env,argv:argv,version:version,versions:versions,on:on,addListener:addListener,once:once,off:off,removeListener:removeListener,removeAllListeners:removeAllListeners,emit:emit,binding:binding,cwd:cwd,chdir:chdir,umask:umask,hrtime:hrtime,platform:platform,release:release,config:config,uptime:uptime},inherits;inherits="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e};var inherits$1=inherits;function _typeof$1(e){return(_typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var formatRegExp=/%[sdj%]/g;function format(e){if(!isString(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(inspect(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(formatRegExp,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<i;s=n[++r])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o}function deprecate(e,t){if(isUndefined(global.process))return function(){return deprecate(e,t).apply(this,arguments)};var r=!1;return function(){return r||(console.error(t),r=!0),e.apply(this,arguments)}}var debugs={},debugEnviron;function debuglog(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){debugs[e]=function(){var t=format.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else debugs[e]=function(){};return debugs[e]}function inspect(e,t){var r={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),isBoolean(t)?r.showHidden=t:t&&_extend(r,t),isUndefined(r.showHidden)&&(r.showHidden=!1),isUndefined(r.depth)&&(r.depth=2),isUndefined(r.colors)&&(r.colors=!1),isUndefined(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=stylizeWithColor),formatValue(r,e,r.depth)}function stylizeWithColor(e,t){var r=inspect.styles[t];return r?"["+inspect.colors[r][0]+"m"+e+"["+inspect.colors[r][1]+"m":e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}function formatValue(e,t,r){if(e.customInspect&&t&&isFunction(t.inspect)&&t.inspect!==inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return isString(n)||(n=formatValue(e,n,r)),n}var i=formatPrimitive(e,t);if(i)return i;var o=Object.keys(t),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),isError(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(t);if(0===o.length){if(isFunction(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(isRegExp(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(isDate(t))return e.stylize(Date.prototype.toString.call(t),"date");if(isError(t))return formatError(t)}var u,f="",c=!1,l=["{","}"];(isArray(t)&&(c=!0,l=["[","]"]),isFunction(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return isRegExp(t)&&(f=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(f=" "+Date.prototype.toUTCString.call(t)),isError(t)&&(f=" "+formatError(t)),0!==o.length||c&&0!=t.length?r<0?isRegExp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=c?formatArray(e,t,r,s,o):o.map((function(n){return formatProperty(e,t,r,s,n,c)})),e.seen.pop(),reduceToSingleString(u,f,l)):l[0]+f+l[1]}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return isNumber(t)?e.stylize(""+t,"number"):isBoolean(t)?e.stylize(""+t,"boolean"):isNull(t)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)hasOwnProperty(t,String(s))?o.push(formatProperty(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(formatProperty(e,t,r,n,i,!0))})),o}function formatProperty(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=isNull(r)?formatValue(e,u.value,null):formatValue(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function reduceToSingleString(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"===_typeof$1(e)}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"===_typeof$1(e)&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===_typeof$1(e)||void 0===e}function isBuffer(e){return Buffer.isBuffer(e)}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp$1(){var e=new Date,t=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],t].join(" ")}function log(){console.log("%s - %s",timestamp$1(),format.apply(null,arguments))}function _extend(e,t){if(!t||!isObject(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var util={inherits:inherits$1,_extend:_extend,log:log,isBuffer:isBuffer,isPrimitive:isPrimitive,isFunction:isFunction,isError:isError,isDate:isDate,isObject:isObject,isRegExp:isRegExp,isUndefined:isUndefined,isSymbol:isSymbol,isString:isString,isNumber:isNumber,isNullOrUndefined:isNullOrUndefined,isNull:isNull,isBoolean:isBoolean,isArray:isArray,inspect:inspect,deprecate:deprecate,format:format,debuglog:debuglog};function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$2(e,t,r){return t&&_defineProperties$2(e.prototype,t),r&&_defineProperties$2(e,r),e}var Buffer$1=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,randomBytes$1=utils.randomBytes,deprecate$1=util.deprecate,PROCESS_UNIQUE=randomBytes$1(5),checkForHexRegExp=new RegExp("^[0-9a-fA-F]{24}$"),hasBufferType=!1;try{Buffer$1&&Buffer$1.from&&(hasBufferType=!0)}catch(e){hasBufferType=!1}for(var hexTable=[],_i=0;_i<256;_i++)hexTable[_i]=(_i<=15?"0":"")+_i.toString(16);for(var decodeLookup=[],i=0;i<10;)decodeLookup[48+i]=i++;for(;i<16;)decodeLookup[55+i]=decodeLookup[87+i]=i++;var _Buffer=Buffer$1;function convertToHex(e){return e.toString("hex")}function makeObjectIdError(e,t){var r=e[t];return new TypeError('ObjectId string "'.concat(e,'" contains invalid character "').concat(r,'" with character code (').concat(e.charCodeAt(t),"). All character codes for a non-hex string must be less than 256."))}var ObjectId=function(){function e(t){if(_classCallCheck$2(this,e),t instanceof e)return t;if(null==t||"number"==typeof t)return this.id=e.generate(t),void(e.cacheHexString&&(this.__id=this.toString("hex")));var r=e.isValid(t);if(!r&&null!=t)throw new TypeError("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(r&&"string"==typeof t&&24===t.length&&hasBufferType)return new e(Buffer$1.from(t,"hex"));if(r&&"string"==typeof t&&24===t.length)return e.createFromHexString(t);if(null==t||12!==t.length){if(null!=t&&t.toHexString)return e.createFromHexString(t.toHexString());throw new TypeError("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}this.id=t,e.cacheHexString&&(this.__id=this.toString("hex"))}return _createClass$2(e,[{key:"toHexString",value:function(){if(e.cacheHexString&&this.__id)return this.__id;var t="";if(!this.id||!this.id.length)throw new TypeError("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(this.id instanceof _Buffer)return t=convertToHex(this.id),e.cacheHexString&&(this.__id=t),t;for(var r=0;r<this.id.length;r++){var n=hexTable[this.id.charCodeAt(r)];if("string"!=typeof n)throw makeObjectIdError(this.id,r);t+=n}return e.cacheHexString&&(this.__id=t),t}},{key:"toString",value:function(e){return this.id&&this.id.copy?this.id.toString("string"==typeof e?e:"hex"):this.toHexString()}},{key:"toJSON",value:function(){return this.toHexString()}},{key:"equals",value:function(t){return t instanceof e?this.toString()===t.toString():"string"==typeof t&&e.isValid(t)&&12===t.length&&this.id instanceof _Buffer?t===this.id.toString("binary"):"string"==typeof t&&e.isValid(t)&&24===t.length?t.toLowerCase()===this.toHexString():"string"==typeof t&&e.isValid(t)&&12===t.length?t===this.id:!(null==t||!(t instanceof e||t.toHexString))&&t.toHexString()===this.toHexString()}},{key:"getTimestamp",value:function(){var e=new Date,t=this.id.readUInt32BE(0);return e.setTime(1e3*Math.floor(t)),e}},{key:"toExtendedJSON",value:function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}}],[{key:"getInc",value:function(){return e.index=(e.index+1)%16777215}},{key:"generate",value:function(t){"number"!=typeof t&&(t=~~(Date.now()/1e3));var r=e.getInc(),n=Buffer$1.alloc(12);return n[3]=255&t,n[2]=t>>8&255,n[1]=t>>16&255,n[0]=t>>24&255,n[4]=PROCESS_UNIQUE[0],n[5]=PROCESS_UNIQUE[1],n[6]=PROCESS_UNIQUE[2],n[7]=PROCESS_UNIQUE[3],n[8]=PROCESS_UNIQUE[4],n[11]=255&r,n[10]=r>>8&255,n[9]=r>>16&255,n}},{key:"createPk",value:function(){return new e}},{key:"createFromTime",value:function(t){var r=Buffer$1.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r[3]=255&t,r[2]=t>>8&255,r[1]=t>>16&255,r[0]=t>>24&255,new e(r)}},{key:"createFromHexString",value:function(t){if(void 0===t||null!=t&&24!==t.length)throw new TypeError("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(hasBufferType)return new e(Buffer$1.from(t,"hex"));for(var r=new _Buffer(12),n=0,i=0;i<24;)r[n++]=decodeLookup[t.charCodeAt(i++)]<<4|decodeLookup[t.charCodeAt(i++)];return new e(r)}},{key:"isValid",value:function(t){return null!=t&&("number"==typeof t||("string"==typeof t?12===t.length||24===t.length&&checkForHexRegExp.test(t):t instanceof e||(t instanceof _Buffer&&12===t.length||!!t.toHexString&&(12===t.id.length||24===t.id.length&&checkForHexRegExp.test(t.id)))))}},{key:"fromExtendedJSON",value:function(t){return new e(t.$oid)}}]),e}();ObjectId.get_inc=deprecate$1((function(){return ObjectId.getInc()}),"Please use the static `ObjectId.getInc()` instead"),ObjectId.prototype.get_inc=deprecate$1((function(){return ObjectId.getInc()}),"Please use the static `ObjectId.getInc()` instead"),ObjectId.prototype.getInc=deprecate$1((function(){return ObjectId.getInc()}),"Please use the static `ObjectId.getInc()` instead"),ObjectId.prototype.generate=deprecate$1((function(e){return ObjectId.generate(e)}),"Please use the static `ObjectId.generate(time)` instead"),Object.defineProperty(ObjectId.prototype,"generationTime",{enumerable:!0,get:function(){return this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24},set:function(e){this.id[3]=255&e,this.id[2]=e>>8&255,this.id[1]=e>>16&255,this.id[0]=e>>24&255}}),ObjectId.prototype[util.inspect.custom||"inspect"]=ObjectId.prototype.toString,ObjectId.index=~~(16777215*Math.random()),Object.defineProperty(ObjectId.prototype,"_bsontype",{value:"ObjectID"});var objectid=ObjectId;function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$3(e,t,r){return t&&_defineProperties$3(e.prototype,t),r&&_defineProperties$3(e,r),e}function alphabetize(e){return e.split("").sort().join("")}var BSONRegExp=function(){function e(t,r){_classCallCheck$3(this,e),this.pattern=t||"",this.options=r?alphabetize(r):"";for(var n=0;n<this.options.length;n++)if("i"!==this.options[n]&&"m"!==this.options[n]&&"x"!==this.options[n]&&"l"!==this.options[n]&&"s"!==this.options[n]&&"u"!==this.options[n])throw new Error("The regular expression option [".concat(this.options[n],"] is not supported"))}return _createClass$3(e,[{key:"toExtendedJSON",value:function(e){return(e=e||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}}],[{key:"parseOptions",value:function(e){return e?e.split("").sort().join(""):""}},{key:"fromExtendedJSON",value:function(t){return t.$regex?"BSONRegExp"===t.$regex._bsontype?t:new e(t.$regex,e.parseOptions(t.$options)):new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options))}}]),e}();Object.defineProperty(BSONRegExp.prototype,"_bsontype",{value:"BSONRegExp"});var regexp=BSONRegExp;function _classCallCheck$4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$4(e,t,r){return t&&_defineProperties$4(e.prototype,t),r&&_defineProperties$4(e,r),e}var BSONSymbol=function(){function e(t){_classCallCheck$4(this,e),this.value=t}return _createClass$4(e,[{key:"valueOf",value:function(){return this.value}},{key:"toString",value:function(){return this.value}},{key:"inspect",value:function(){return this.value}},{key:"toJSON",value:function(){return this.value}},{key:"toExtendedJSON",value:function(){return{$symbol:this.value}}}],[{key:"fromExtendedJSON",value:function(t){return new e(t.$symbol)}}]),e}();Object.defineProperty(BSONSymbol.prototype,"_bsontype",{value:"Symbol"});var symbol=BSONSymbol;function _classCallCheck$5(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$5(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$5(e,t,r){return t&&_defineProperties$5(e.prototype,t),r&&_defineProperties$5(e,r),e}var Int32=function(){function e(t){_classCallCheck$5(this,e),t instanceof Number&&(t=t.valueOf()),this.value=t}return _createClass$5(e,[{key:"valueOf",value:function(){return this.value}},{key:"toJSON",value:function(){return this.value}},{key:"toExtendedJSON",value:function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}}}],[{key:"fromExtendedJSON",value:function(t,r){return r&&r.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)}}]),e}();Object.defineProperty(Int32.prototype,"_bsontype",{value:"Int32"});var int_32=Int32;function _classCallCheck$6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$6(e,t,r){return t&&_defineProperties$6(e.prototype,t),r&&_defineProperties$6(e,r),e}var Code=function(){function e(t,r){_classCallCheck$6(this,e),this.code=t,this.scope=r}return _createClass$6(e,[{key:"toJSON",value:function(){return{scope:this.scope,code:this.code}}},{key:"toExtendedJSON",value:function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}}],[{key:"fromExtendedJSON",value:function(t){return new e(t.$code,t.$scope)}}]),e}();Object.defineProperty(Code.prototype,"_bsontype",{value:"Code"});var code=Code,Buffer$2=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,PARSE_STRING_REGEXP=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,PARSE_INF_REGEXP=/^(\+|-)?(Infinity|inf)$/i,PARSE_NAN_REGEXP=/^(\+|-)?NaN$/i,EXPONENT_MAX=6111,EXPONENT_MIN=-6176,EXPONENT_BIAS=6176,MAX_DIGITS=34,NAN_BUFFER=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),INF_NEGATIVE_BUFFER=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),INF_POSITIVE_BUFFER=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),EXPONENT_REGEX=/^([-+])?(\d+)?$/;function isDigit(e){return!isNaN(parseInt(e,10))}function divideu128(e){var t=long_1.fromNumber(1e9),r=long_1.fromNumber(0);if(!(e.parts[0]||e.parts[1]||e.parts[2]||e.parts[3]))return{quotient:e,rem:r};for(var n=0;n<=3;n++)r=(r=r.shiftLeft(32)).add(new long_1(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function multiply64x2(e,t){if(!e&&!t)return{high:long_1.fromNumber(0),low:long_1.fromNumber(0)};var r=e.shiftRightUnsigned(32),n=new long_1(e.getLowBits(),0),i=t.shiftRightUnsigned(32),o=new long_1(t.getLowBits(),0),s=r.multiply(i),a=r.multiply(o),u=n.multiply(i),f=n.multiply(o);return s=s.add(a.shiftRightUnsigned(32)),a=new long_1(a.getLowBits(),0).add(u).add(f.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:f=a.shiftLeft(32).add(new long_1(f.getLowBits(),0))}}function lessThan(e,t){var r=e.high>>>0,n=t.high>>>0;return r<n||r===n&&e.low>>>0<t.low>>>0}function invalidErr(e,t){throw new TypeError('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}function Decimal128(e){this.bytes=e}Decimal128.fromString=function(e){var t,r=!1,n=!1,i=!1,o=0,s=0,a=0,u=0,f=0,c=[0],l=0,h=0,d=0,p=0,g=0,_=0,b=[0,0],y=[0,0],m=0;if(e.length>=7e3)throw new TypeError(e+" not a valid Decimal128 string");var w=e.match(PARSE_STRING_REGEXP),v=e.match(PARSE_INF_REGEXP),E=e.match(PARSE_NAN_REGEXP);if(!w&&!v&&!E||0===e.length)throw new TypeError(e+" not a valid Decimal128 string");if(w){var S=w[2],O=w[4],A=w[5],B=w[6];O&&void 0===B&&invalidErr(e,"missing exponent power"),O&&void 0===S&&invalidErr(e,"missing exponent base"),void 0===O&&(A||B)&&invalidErr(e,"missing e before exponent")}if("+"!==e[m]&&"-"!==e[m]||(r="-"===e[m++]),!isDigit(e[m])&&"."!==e[m]){if("i"===e[m]||"I"===e[m])return new Decimal128(Buffer$2.from(r?INF_NEGATIVE_BUFFER:INF_POSITIVE_BUFFER));if("N"===e[m])return new Decimal128(Buffer$2.from(NAN_BUFFER))}for(;isDigit(e[m])||"."===e[m];)"."!==e[m]?(l<34&&("0"!==e[m]||i)&&(i||(f=s),i=!0,c[h++]=parseInt(e[m],10),l+=1),i&&(a+=1),n&&(u+=1),s+=1,m+=1):(n&&invalidErr(e,"contains multiple periods"),n=!0,m+=1);if(n&&!s)throw new TypeError(e+" not a valid Decimal128 string");if("e"===e[m]||"E"===e[m]){var T=e.substr(++m).match(EXPONENT_REGEX);if(!T||!T[2])return new Decimal128(Buffer$2.from(NAN_BUFFER));g=parseInt(T[0],10),m+=T[0].length}if(e[m])return new Decimal128(Buffer$2.from(NAN_BUFFER));if(d=0,l){if(p=l-1,1!==(o=a))for(;"0"===e[f+o-1];)o-=1}else d=0,p=0,c[0]=0,a=1,l=1,o=0;for(g<=u&&u-g>16384?g=EXPONENT_MIN:g-=u;g>EXPONENT_MAX;){if((p+=1)-d>MAX_DIGITS){if(c.join("").match(/^0+$/)){g=EXPONENT_MAX;break}invalidErr(e,"overflow")}g-=1}for(;g<EXPONENT_MIN||l<a;){if(0===p&&o<l){g=EXPONENT_MIN,o=0;break}if(l<a?a-=1:p-=1,g<EXPONENT_MAX)g+=1;else{if(c.join("").match(/^0+$/)){g=EXPONENT_MAX;break}invalidErr(e,"overflow")}}if(p-d+1<o){var N=s;n&&(f+=1,N+=1),r&&(f+=1,N+=1);var I=parseInt(e[f+p+1],10),x=0;if(I>=5&&(x=1,5===I))for(x=c[p]%2==1,_=f+p+2;_<N;_++)if(parseInt(e[_],10)){x=1;break}if(x)for(var M=p;M>=0;M--)if(++c[M]>9&&(c[M]=0,0===M)){if(!(g<EXPONENT_MAX))return new Decimal128(Buffer$2.from(r?INF_NEGATIVE_BUFFER:INF_POSITIVE_BUFFER));g+=1,c[M]=1}}if(b=long_1.fromNumber(0),y=long_1.fromNumber(0),0===o)b=long_1.fromNumber(0),y=long_1.fromNumber(0);else if(p-d<17){var R=d;for(y=long_1.fromNumber(c[R++]),b=new long_1(0,0);R<=p;R++)y=(y=y.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(c[R]))}else{var D=d;for(b=long_1.fromNumber(c[D++]);D<=p-17;D++)b=(b=b.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(c[D]));for(y=long_1.fromNumber(c[D++]);D<=p;D++)y=(y=y.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(c[D]))}var $=multiply64x2(b,long_1.fromString("100000000000000000"));$.low=$.low.add(y),lessThan($.low,y)&&($.high=$.high.add(long_1.fromNumber(1))),t=g+EXPONENT_BIAS;var U={low:long_1.fromNumber(0),high:long_1.fromNumber(0)};$.high.shiftRightUnsigned(49).and(long_1.fromNumber(1)).equals(long_1.fromNumber(1))?(U.high=U.high.or(long_1.fromNumber(3).shiftLeft(61)),U.high=U.high.or(long_1.fromNumber(t).and(long_1.fromNumber(16383).shiftLeft(47))),U.high=U.high.or($.high.and(long_1.fromNumber(0x7fffffffffff)))):(U.high=U.high.or(long_1.fromNumber(16383&t).shiftLeft(49)),U.high=U.high.or($.high.and(long_1.fromNumber(562949953421311)))),U.low=$.low,r&&(U.high=U.high.or(long_1.fromString("9223372036854775808")));var P=Buffer$2.alloc(16);return m=0,P[m++]=255&U.low.low,P[m++]=U.low.low>>8&255,P[m++]=U.low.low>>16&255,P[m++]=U.low.low>>24&255,P[m++]=255&U.low.high,P[m++]=U.low.high>>8&255,P[m++]=U.low.high>>16&255,P[m++]=U.low.high>>24&255,P[m++]=255&U.high.low,P[m++]=U.high.low>>8&255,P[m++]=U.high.low>>16&255,P[m++]=U.high.low>>24&255,P[m++]=255&U.high.high,P[m++]=U.high.high>>8&255,P[m++]=U.high.high>>16&255,P[m++]=U.high.high>>24&255,new Decimal128(P)};var COMBINATION_MASK=31,EXPONENT_MASK=16383,COMBINATION_INFINITY=30,COMBINATION_NAN=31;Decimal128.prototype.toString=function(){for(var e,t,r,n,i,o,s=0,a=new Array(36),u=0;u<a.length;u++)a[u]=0;var f,c,l,h,d,p=0,g=!1,_={parts:new Array(4)},b=[];p=0;var y=this.bytes;if(n=y[p++]|y[p++]<<8|y[p++]<<16|y[p++]<<24,r=y[p++]|y[p++]<<8|y[p++]<<16|y[p++]<<24,t=y[p++]|y[p++]<<8|y[p++]<<16|y[p++]<<24,e=y[p++]|y[p++]<<8|y[p++]<<16|y[p++]<<24,p=0,{low:new long_1(n,r),high:new long_1(t,e)}.high.lessThan(long_1.ZERO)&&b.push("-"),(i=e>>26&COMBINATION_MASK)>>3==3){if(i===COMBINATION_INFINITY)return b.join("")+"Infinity";if(i===COMBINATION_NAN)return"NaN";o=e>>15&EXPONENT_MASK,l=8+(e>>14&1)}else l=e>>14&7,o=e>>17&EXPONENT_MASK;if(f=o-EXPONENT_BIAS,_.parts[0]=(16383&e)+((15&l)<<14),_.parts[1]=t,_.parts[2]=r,_.parts[3]=n,0===_.parts[0]&&0===_.parts[1]&&0===_.parts[2]&&0===_.parts[3])g=!0;else for(d=3;d>=0;d--){var m=0,w=divideu128(_);if(_=w.quotient,m=w.rem.low)for(h=8;h>=0;h--)a[9*d+h]=m%10,m=Math.floor(m/10)}if(g)s=1,a[p]=0;else for(s=36;!a[p];)s-=1,p+=1;if((c=s-1+f)>=34||c<=-7||f>0){if(s>34)return b.push(0),f>0?b.push("E+"+f):f<0&&b.push("E"+f),b.join("");b.push(a[p++]),(s-=1)&&b.push(".");for(var v=0;v<s;v++)b.push(a[p++]);b.push("E"),c>0?b.push("+"+c):b.push(c)}else if(f>=0)for(var E=0;E<s;E++)b.push(a[p++]);else{var S=s+f;if(S>0)for(var O=0;O<S;O++)b.push(a[p++]);else b.push("0");for(b.push(".");S++<0;)b.push("0");for(var A=0;A<s-Math.max(S-1,0);A++)b.push(a[p++])}return b.join("")},Decimal128.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},Decimal128.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},Decimal128.fromExtendedJSON=function(e){return Decimal128.fromString(e.$numberDecimal)},Object.defineProperty(Decimal128.prototype,"_bsontype",{value:"Decimal128"});var decimal128=Decimal128;function _classCallCheck$7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$7(e,t,r){return t&&_defineProperties$7(e.prototype,t),r&&_defineProperties$7(e,r),e}var MinKey=function(){function e(){_classCallCheck$7(this,e)}return _createClass$7(e,[{key:"toExtendedJSON",value:function(){return{$minKey:1}}}],[{key:"fromExtendedJSON",value:function(){return new e}}]),e}();Object.defineProperty(MinKey.prototype,"_bsontype",{value:"MinKey"});var min_key=MinKey;function _classCallCheck$8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$8(e,t,r){return t&&_defineProperties$8(e.prototype,t),r&&_defineProperties$8(e,r),e}var MaxKey=function(){function e(){_classCallCheck$8(this,e)}return _createClass$8(e,[{key:"toExtendedJSON",value:function(){return{$maxKey:1}}}],[{key:"fromExtendedJSON",value:function(){return new e}}]),e}();Object.defineProperty(MaxKey.prototype,"_bsontype",{value:"MaxKey"});var max_key=MaxKey;function _classCallCheck$9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$9(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$9(e,t,r){return t&&_defineProperties$9(e.prototype,t),r&&_defineProperties$9(e,r),e}var DBRef=function(){function e(t,r,n,i){_classCallCheck$9(this,e);var o=t.split(".");2===o.length&&(n=o.shift(),t=o.shift()),this.collection=t,this.oid=r,this.db=n,this.fields=i||{}}return _createClass$9(e,[{key:"toJSON",value:function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(e.$db=this.db),e}},{key:"toExtendedJSON",value:function(e){e=e||{};var t={$ref:this.collection,$id:this.oid};return e.legacy?t:(this.db&&(t.$db=this.db),t=Object.assign(t,this.fields))}}],[{key:"fromExtendedJSON",value:function(t){var r=Object.assign({},t);return["$ref","$id","$db"].forEach((function(e){return delete r[e]})),new e(t.$ref,t.$id,t.$db,r)}}]),e}();Object.defineProperty(DBRef.prototype,"_bsontype",{value:"DBRef"}),Object.defineProperty(DBRef.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},configurable:!1});var db_ref=DBRef;function _classCallCheck$a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties$a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass$a(e,t,r){return t&&_defineProperties$a(e.prototype,t),r&&_defineProperties$a(e,r),e}var Buffer$3=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,Binary=function(){function e(t,r){if(_classCallCheck$a(this,e),!(null==t||"string"==typeof t||Buffer$3.isBuffer(t)||t instanceof Uint8Array||Array.isArray(t)))throw new TypeError("only String, Buffer, Uint8Array or Array accepted");if(this.sub_type=null==r?BSON_BINARY_SUBTYPE_DEFAULT:r,this.position=0,null==t||t instanceof Number)void 0!==Buffer$3?this.buffer=Buffer$3.alloc(e.BUFFER_SIZE):"undefined"!=typeof Uint8Array?this.buffer=new Uint8Array(new ArrayBuffer(e.BUFFER_SIZE)):this.buffer=new Array(e.BUFFER_SIZE);else{if("string"==typeof t)if(void 0!==Buffer$3)this.buffer=Buffer$3.from(t);else{if("undefined"==typeof Uint8Array&&!Array.isArray(t))throw new TypeError("only String, Buffer, Uint8Array or Array accepted");this.buffer=writeStringToArray(t)}else this.buffer=t;this.position=t.length}}return _createClass$a(e,[{key:"put",value:function(t){if(null!=t.length&&"number"!=typeof t&&1!==t.length)throw new TypeError("only accepts single character String, Uint8Array or Array");if("number"!=typeof t&&t<0||t>255)throw new TypeError("only accepts number in a valid unsigned byte range 0-255");var r=null;if(r="string"==typeof t?t.charCodeAt(0):null!=t.length?t[0]:t,this.buffer.length>this.position)this.buffer[this.position++]=r;else if(void 0!==Buffer$3&&Buffer$3.isBuffer(this.buffer)){var n=Buffer$3.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}else{var i=null;i=isUint8Array(this.buffer)?new Uint8Array(new ArrayBuffer(e.BUFFER_SIZE+this.buffer.length)):new Array(e.BUFFER_SIZE+this.buffer.length);for(var o=0;o<this.buffer.length;o++)i[o]=this.buffer[o];this.buffer=i,this.buffer[this.position++]=r}}},{key:"write",value:function(e,t){if(t="number"==typeof t?t:this.position,this.buffer.length<t+e.length){var r=null;if(void 0!==Buffer$3&&Buffer$3.isBuffer(this.buffer))r=Buffer$3.alloc(this.buffer.length+e.length),this.buffer.copy(r,0,0,this.buffer.length);else if(isUint8Array(this.buffer)){r=new Uint8Array(new ArrayBuffer(this.buffer.length+e.length));for(var n=0;n<this.position;n++)r[n]=this.buffer[n]}this.buffer=r}if(void 0!==Buffer$3&&Buffer$3.isBuffer(e)&&Buffer$3.isBuffer(this.buffer))e.copy(this.buffer,t,0,e.length),this.position=t+e.length>this.position?t+e.length:this.position;else if(void 0!==Buffer$3&&"string"==typeof e&&Buffer$3.isBuffer(this.buffer))this.buffer.write(e,t,"binary"),this.position=t+e.length>this.position?t+e.length:this.position;else if(isUint8Array(e)||Array.isArray(e)&&"string"!=typeof e){for(var i=0;i<e.length;i++)this.buffer[t++]=e[i];this.position=t>this.position?t:this.position}else if("string"==typeof e){for(var o=0;o<e.length;o++)this.buffer[t++]=e.charCodeAt(o);this.position=t>this.position?t:this.position}}},{key:"read",value:function(e,t){if(t=t&&t>0?t:this.position,this.buffer.slice)return this.buffer.slice(e,e+t);for(var r="undefined"!=typeof Uint8Array?new Uint8Array(new ArrayBuffer(t)):new Array(t),n=0;n<t;n++)r[n]=this.buffer[e++];return r}},{key:"value",value:function(e){if((e=null!=e&&e)&&void 0!==Buffer$3&&Buffer$3.isBuffer(this.buffer)&&this.buffer.length===this.position)return this.buffer;if(void 0!==Buffer$3&&Buffer$3.isBuffer(this.buffer))return e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position);if(e){if(null!=this.buffer.slice)return this.buffer.slice(0,this.position);for(var t=isUint8Array(this.buffer)?new Uint8Array(new ArrayBuffer(this.position)):new Array(this.position),r=0;r<this.position;r++)t[r]=this.buffer[r];return t}return convertArraytoUtf8BinaryString(this.buffer,0,this.position)}},{key:"length",value:function(){return this.position}},{key:"toJSON",value:function(){return null!=this.buffer?this.buffer.toString("base64"):""}},{key:"toString",value:function(e){return null!=this.buffer?this.buffer.slice(0,this.position).toString(e):""}},{key:"toExtendedJSON",value:function(e){e=e||{};var t=Buffer$3.isBuffer(this.buffer)?this.buffer.toString("base64"):Buffer$3.from(this.buffer).toString("base64"),r=Number(this.sub_type).toString(16);return e.legacy?{$binary:t,$type:1===r.length?"0"+r:r}:{$binary:{base64:t,subType:1===r.length?"0"+r:r}}}}],[{key:"fromExtendedJSON",value:function(t,r){var n,i;return(r=r||{}).legacy?(i=t.$type?parseInt(t.$type,16):0,n=Buffer$3.from(t.$binary,"base64")):(i=t.$binary.subType?parseInt(t.$binary.subType,16):0,n=Buffer$3.from(t.$binary.base64,"base64")),new e(n,i)}}]),e}(),BSON_BINARY_SUBTYPE_DEFAULT=0;function isUint8Array(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function writeStringToArray(e){for(var t="undefined"!=typeof Uint8Array?new Uint8Array(new ArrayBuffer(e.length)):new Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function convertArraytoUtf8BinaryString(e,t,r){for(var n="",i=t;i<r;i++)n+=String.fromCharCode(e[i]);return n}Binary.BUFFER_SIZE=256,Binary.SUBTYPE_DEFAULT=0,Binary.SUBTYPE_FUNCTION=1,Binary.SUBTYPE_BYTE_ARRAY=2,Binary.SUBTYPE_UUID_OLD=3,Binary.SUBTYPE_UUID=4,Binary.SUBTYPE_MD5=5,Binary.SUBTYPE_USER_DEFINED=128,Object.defineProperty(Binary.prototype,"_bsontype",{value:"Binary"});var binary=Binary,constants={BSON_INT32_MAX:2147483647,BSON_INT32_MIN:-2147483648,BSON_INT64_MAX:Math.pow(2,63)-1,BSON_INT64_MIN:-Math.pow(2,63),JS_INT_MAX:9007199254740992,JS_INT_MIN:-9007199254740992,BSON_DATA_NUMBER:1,BSON_DATA_STRING:2,BSON_DATA_OBJECT:3,BSON_DATA_ARRAY:4,BSON_DATA_BINARY:5,BSON_DATA_UNDEFINED:6,BSON_DATA_OID:7,BSON_DATA_BOOLEAN:8,BSON_DATA_DATE:9,BSON_DATA_NULL:10,BSON_DATA_REGEXP:11,BSON_DATA_DBPOINTER:12,BSON_DATA_CODE:13,BSON_DATA_SYMBOL:14,BSON_DATA_CODE_W_SCOPE:15,BSON_DATA_INT:16,BSON_DATA_TIMESTAMP:17,BSON_DATA_LONG:18,BSON_DATA_DECIMAL128:19,BSON_DATA_MIN_KEY:255,BSON_DATA_MAX_KEY:127,BSON_BINARY_SUBTYPE_DEFAULT:0,BSON_BINARY_SUBTYPE_FUNCTION:1,BSON_BINARY_SUBTYPE_BYTE_ARRAY:2,BSON_BINARY_SUBTYPE_UUID:3,BSON_BINARY_SUBTYPE_MD5:4,BSON_BINARY_SUBTYPE_USER_DEFINED:128};function _typeof$2(e){return(_typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var keysToCodecs={$oid:objectid,$binary:binary,$symbol:symbol,$numberInt:int_32,$numberDecimal:decimal128,$numberDouble:double_1,$numberLong:long_1,$minKey:min_key,$maxKey:max_key,$regex:regexp,$regularExpression:regexp,$timestamp:timestamp};function deserializeValue(e,t,r,n){if("number"==typeof r){if(n.relaxed||n.legacy)return r;if(Math.floor(r)===r){if(r>=BSON_INT32_MIN&&r<=BSON_INT32_MAX)return new int_32(r);if(r>=BSON_INT64_MIN&&r<=BSON_INT64_MAX)return new long_1.fromNumber(r)}return new double_1(r)}if(null==r||"object"!==_typeof$2(r))return r;if(r.$undefined)return null;for(var i=Object.keys(r).filter((function(e){return e.startsWith("$")&&null!=r[e]})),o=0;o<i.length;o++){var s=keysToCodecs[i[o]];if(s)return s.fromExtendedJSON(r,n)}if(null!=r.$date){var a=r.$date,u=new Date;return n.legacy?"number"==typeof a?u.setTime(a):"string"==typeof a&&u.setTime(Date.parse(a)):"string"==typeof a?u.setTime(Date.parse(a)):long_1.isLong(a)?u.setTime(a.toNumber()):"number"==typeof a&&n.relaxed&&u.setTime(a),u}if(null!=r.$code){var f=Object.assign({},r);return r.$scope&&(f.$scope=deserializeValue(e,null,r.$scope)),code.fromExtendedJSON(r)}if(null!=r.$ref||null!=r.$dbPointer){var c=r.$ref?r:r.$dbPointer;if(c instanceof db_ref)return c;var l=Object.keys(c).filter((function(e){return e.startsWith("$")})),h=!0;if(l.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(h=!1)})),h)return db_ref.fromExtendedJSON(c)}return r}function parse(e,t){var r=this;return"boolean"==typeof(t=Object.assign({},{relaxed:!0,legacy:!1},t)).relaxed&&(t.strict=!t.relaxed),"boolean"==typeof t.strict&&(t.relaxed=!t.strict),JSON.parse(e,(function(e,n){return deserializeValue(r,e,n,t)}))}var BSON_INT32_MAX=2147483647,BSON_INT32_MIN=-2147483648,BSON_INT64_MAX=0x8000000000000000,BSON_INT64_MIN=-0x8000000000000000;function stringify(e,t,r,n){null!=r&&"object"===_typeof$2(r)&&(n=r,r=0),null==t||"object"!==_typeof$2(t)||Array.isArray(t)||(n=t,t=null,r=0),n=Object.assign({},{relaxed:!0,legacy:!1},n);var i=Array.isArray(e)?serializeArray(e,n):serializeDocument(e,n);return JSON.stringify(i,t,r)}function serialize(e,t){return t=t||{},JSON.parse(stringify(e,t))}function deserialize(e,t){return t=t||{},parse(JSON.stringify(e),t)}function serializeArray(e,t){return e.map((function(e){return serializeValue(e,t)}))}function getISOString(e){var t=e.toISOString();return 0!==e.getUTCMilliseconds()?t:t.slice(0,-5)+"Z"}function serializeValue(e,t){if(Array.isArray(e))return serializeArray(e,t);if(void 0===e)return null;if(e instanceof Date){var r=e.getTime(),n=r>-1&&r<2534023188e5;return t.legacy?t.relaxed&&n?{$date:e.getTime()}:{$date:getISOString(e)}:t.relaxed&&n?{$date:getISOString(e)}:{$date:{$numberLong:e.getTime().toString()}}}if("number"==typeof e&&!t.relaxed){if(Math.floor(e)===e){var i=e>=BSON_INT64_MIN&&e<=BSON_INT64_MAX;if(e>=BSON_INT32_MIN&&e<=BSON_INT32_MAX)return{$numberInt:e.toString()};if(i)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp){var o=e.flags;return void 0===o&&(o=e.toString().match(/[gimuy]*$/)[0]),new regexp(e.source,o).toExtendedJSON(t)}return null!=e&&"object"===_typeof$2(e)?serializeDocument(e,t):e}var BSON_TYPE_MAPPINGS={Binary:function(e){return new binary(e.value(),e.subtype)},Code:function(e){return new code(e.code,e.scope)},DBRef:function(e){return new db_ref(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new decimal128(e.bytes)},Double:function(e){return new double_1(e.value)},Int32:function(e){return new int_32(e.value)},Long:function(e){return long_1.fromBits(null!=e.low?e.low:e.low_,null!=e.low?e.high:e.high_,null!=e.low?e.unsigned:e.unsigned_)},MaxKey:function(){return new max_key},MinKey:function(){return new min_key},ObjectID:function(e){return new objectid(e)},ObjectId:function(e){return new objectid(e)},BSONRegExp:function(e){return new regexp(e.pattern,e.options)},Symbol:function(e){return new symbol(e.value)},Timestamp:function(e){return timestamp.fromBits(e.low,e.high)}};function serializeDocument(e,t){if(null==e||"object"!==_typeof$2(e))throw new Error("not an object instance");var r=e._bsontype;if(void 0===r){var n={};for(var i in e)n[i]=serializeValue(e[i],t);return n}if("string"==typeof r){var o=e;if("function"!=typeof o.toExtendedJSON){var s=BSON_TYPE_MAPPINGS[r];if(!s)throw new TypeError("Unrecognized or invalid _bsontype: "+r);o=s(o)}return"Code"===r&&o.scope?o=new code(o.code,serializeValue(o.scope,t)):"DBRef"===r&&o.oid&&(o=new db_ref(o.collection,serializeValue(o.oid,t),o.db,o.fields)),o.toExtendedJSON(t)}throw new Error("_bsontype must be a string, but was: "+_typeof$2(r))}var extended_json={parse:parse,deserialize:deserialize,serialize:serialize,stringify:stringify},FIRST_BIT=128,FIRST_TWO_BITS=192,FIRST_THREE_BITS=224,FIRST_FOUR_BITS=240,FIRST_FIVE_BITS=248,TWO_BIT_CHAR=192,THREE_BIT_CHAR=224,FOUR_BIT_CHAR=240,CONTINUING_CHAR=128;function validateUtf8(e,t,r){for(var n=0,i=t;i<r;i+=1){var o=e[i];if(n){if((o&FIRST_TWO_BITS)!==CONTINUING_CHAR)return!1;n-=1}else if(o&FIRST_BIT)if((o&FIRST_THREE_BITS)===TWO_BIT_CHAR)n=1;else if((o&FIRST_FOUR_BITS)===THREE_BIT_CHAR)n=2;else{if((o&FIRST_FIVE_BITS)!==FOUR_BIT_CHAR)return!1;n=3}}return!n}var validateUtf8_1=validateUtf8,validate_utf8={validateUtf8:validateUtf8_1},Buffer$4=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,validateUtf8$1=validate_utf8.validateUtf8,JS_INT_MAX_LONG=long_1.fromNumber(constants.JS_INT_MAX),JS_INT_MIN_LONG=long_1.fromNumber(constants.JS_INT_MIN),functionCache={};function deserialize$1(e,t,r){var n=(t=null==t?{}:t)&&t.index?t.index:0,i=e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24;if(i<5)throw new Error("bson size must be >= 5, is ".concat(i));if(t.allowObjectSmallerThanBufferSize&&e.length<i)throw new Error("buffer length ".concat(e.length," must be >= bson size ").concat(i));if(!t.allowObjectSmallerThanBufferSize&&e.length!==i)throw new Error("buffer length ".concat(e.length," must === bson size ").concat(i));if(i+n>e.length)throw new Error("(bson size ".concat(i," + options.index ").concat(n," must be <= buffer length ").concat(Buffer$4.byteLength(e),")"));if(0!==e[n+i-1])throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return deserializeObject(e,n,t,r)}function deserializeObject(e,t,r,n){var i=null!=r.evalFunctions&&r.evalFunctions,o=null!=r.cacheFunctions&&r.cacheFunctions,s=null!=r.cacheFunctionsCrc32&&r.cacheFunctionsCrc32;if(!s)var a=null;var u=null==r.fieldsAsRaw?null:r.fieldsAsRaw,f=null!=r.raw&&r.raw,c="boolean"==typeof r.bsonRegExp&&r.bsonRegExp,l=null!=r.promoteBuffers&&r.promoteBuffers,h=null==r.promoteLongs||r.promoteLongs,d=null==r.promoteValues||r.promoteValues,p=t;if(e.length<5)throw new Error("corrupt bson message < 5 bytes long");var g=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(g<5||g>e.length)throw new Error("corrupt bson message");for(var _=n?[]:{},b=0;;){var y=e[t++];if(0===y)break;for(var m=t;0!==e[m]&&m<e.length;)m++;if(m>=Buffer$4.byteLength(e))throw new Error("Bad BSON Document: illegal CString");var w=n?b++:e.toString("utf8",t,m);if(t=m+1,y===constants.BSON_DATA_STRING){var v=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(v<=0||v>e.length-t||0!==e[t+v-1])throw new Error("bad string length in bson");if(!validateUtf8$1(e,t,t+v-1))throw new Error("Invalid UTF-8 string in BSON document");var E=e.toString("utf8",t,t+v-1);_[w]=E,t+=v}else if(y===constants.BSON_DATA_OID){var S=Buffer$4.alloc(12);e.copy(S,0,t,t+12),_[w]=new objectid(S),t+=12}else if(y===constants.BSON_DATA_INT&&!1===d)_[w]=new int_32(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24);else if(y===constants.BSON_DATA_INT)_[w]=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;else if(y===constants.BSON_DATA_NUMBER&&!1===d)_[w]=new double_1(e.readDoubleLE(t)),t+=8;else if(y===constants.BSON_DATA_NUMBER)_[w]=e.readDoubleLE(t),t+=8;else if(y===constants.BSON_DATA_DATE){var O=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,A=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;_[w]=new Date(new long_1(O,A).toNumber())}else if(y===constants.BSON_DATA_BOOLEAN){if(0!==e[t]&&1!==e[t])throw new Error("illegal boolean type value");_[w]=1===e[t++]}else if(y===constants.BSON_DATA_OBJECT){var B=t,T=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24;if(T<=0||T>e.length-t)throw new Error("bad embedded document length in bson");_[w]=f?e.slice(t,t+T):deserializeObject(e,B,r,!1),t+=T}else if(y===constants.BSON_DATA_ARRAY){var N=t,I=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,x=r,M=t+I;if(u&&u[w]){for(var R in x={},r)x[R]=r[R];x.raw=!0}if(_[w]=deserializeObject(e,N,x,!0),0!==e[(t+=I)-1])throw new Error("invalid array terminator byte");if(t!==M)throw new Error("corrupted array bson")}else if(y===constants.BSON_DATA_UNDEFINED)_[w]=void 0;else if(y===constants.BSON_DATA_NULL)_[w]=null;else if(y===constants.BSON_DATA_LONG){var D=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,$=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,U=new long_1(D,$);_[w]=h&&!0===d&&U.lessThanOrEqual(JS_INT_MAX_LONG)&&U.greaterThanOrEqual(JS_INT_MIN_LONG)?U.toNumber():U}else if(y===constants.BSON_DATA_DECIMAL128){var P=Buffer$4.alloc(16);e.copy(P,0,t,t+16),t+=16;var j=new decimal128(P);_[w]=j.toObject?j.toObject():j}else if(y===constants.BSON_DATA_BINARY){var C=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,z=C,L=e[t++];if(C<0)throw new Error("Negative binary type element size found");if(C>Buffer$4.byteLength(e))throw new Error("Binary type size larger than document size");if(null!=e.slice){if(L===binary.SUBTYPE_BYTE_ARRAY){if((C=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<0)throw new Error("Negative binary type element size found for subtype 0x02");if(C>z-4)throw new Error("Binary type with subtype 0x02 contains to long binary size");if(C<z-4)throw new Error("Binary type with subtype 0x02 contains to short binary size")}_[w]=l&&d?e.slice(t,t+C):new binary(e.slice(t,t+C),L)}else{var k="undefined"!=typeof Uint8Array?new Uint8Array(new ArrayBuffer(C)):new Array(C);if(L===binary.SUBTYPE_BYTE_ARRAY){if((C=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<0)throw new Error("Negative binary type element size found for subtype 0x02");if(C>z-4)throw new Error("Binary type with subtype 0x02 contains to long binary size");if(C<z-4)throw new Error("Binary type with subtype 0x02 contains to short binary size")}for(m=0;m<C;m++)k[m]=e[t+m];_[w]=l&&d?k:new binary(k,L)}t+=C}else if(y===constants.BSON_DATA_REGEXP&&!1===c){for(m=t;0!==e[m]&&m<e.length;)m++;if(m>=e.length)throw new Error("Bad BSON Document: illegal CString");var F=e.toString("utf8",t,m);for(m=t=m+1;0!==e[m]&&m<e.length;)m++;if(m>=e.length)throw new Error("Bad BSON Document: illegal CString");var Y=e.toString("utf8",t,m);t=m+1;var W=new Array(Y.length);for(m=0;m<Y.length;m++)switch(Y[m]){case"m":W[m]="m";break;case"s":W[m]="g";break;case"i":W[m]="i"}_[w]=new RegExp(F,W.join(""))}else if(y===constants.BSON_DATA_REGEXP&&!0===c){for(m=t;0!==e[m]&&m<e.length;)m++;if(m>=e.length)throw new Error("Bad BSON Document: illegal CString");var q=e.toString("utf8",t,m);for(m=t=m+1;0!==e[m]&&m<e.length;)m++;if(m>=e.length)throw new Error("Bad BSON Document: illegal CString");var H=e.toString("utf8",t,m);t=m+1,_[w]=new regexp(q,H)}else if(y===constants.BSON_DATA_SYMBOL){var J=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(J<=0||J>e.length-t||0!==e[t+J-1])throw new Error("bad string length in bson");_[w]=e.toString("utf8",t,t+J-1),t+=J}else if(y===constants.BSON_DATA_TIMESTAMP){var V=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,X=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;_[w]=new timestamp(V,X)}else if(y===constants.BSON_DATA_MIN_KEY)_[w]=new min_key;else if(y===constants.BSON_DATA_MAX_KEY)_[w]=new max_key;else if(y===constants.BSON_DATA_CODE){var K=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(K<=0||K>e.length-t||0!==e[t+K-1])throw new Error("bad string length in bson");var G=e.toString("utf8",t,t+K-1);if(i)if(o){var Z=s?a(G):G;_[w]=isolateEvalWithHash(functionCache,Z,G,_)}else _[w]=isolateEval(G);else _[w]=new code(G);t+=K}else if(y===constants.BSON_DATA_CODE_W_SCOPE){var Q=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(Q<13)throw new Error("code_w_scope total size shorter minimum expected length");var ee=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(ee<=0||ee>e.length-t||0!==e[t+ee-1])throw new Error("bad string length in bson");var te=e.toString("utf8",t,t+ee-1),re=t+=ee,ne=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,ie=deserializeObject(e,re,r,!1);if(t+=ne,Q<8+ne+ee)throw new Error("code_w_scope total size is to short, truncating scope");if(Q>8+ne+ee)throw new Error("code_w_scope total size is to long, clips outer document");if(i){if(o){var oe=s?a(te):te;_[w]=isolateEvalWithHash(functionCache,oe,te,_)}else _[w]=isolateEval(te);_[w].scope=ie}else _[w]=new code(te,ie)}else{if(y!==constants.BSON_DATA_DBPOINTER)throw new Error("Detected unknown BSON type "+y.toString(16)+' for fieldname "'+w+'", are you using the latest BSON parser?');var se=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(se<=0||se>e.length-t||0!==e[t+se-1])throw new Error("bad string length in bson");if(!validateUtf8$1(e,t,t+se-1))throw new Error("Invalid UTF-8 string in BSON document");var ae=e.toString("utf8",t,t+se-1);t+=se;var ue=Buffer$4.alloc(12);e.copy(ue,0,t,t+12);var fe=new objectid(ue);t+=12,_[w]=new db_ref(ae,fe)}}if(g!==t-p){if(n)throw new Error("corrupt array bson");throw new Error("corrupt object bson")}var ce=Object.keys(_).filter((function(e){return e.startsWith("$")})),le=!0;if(ce.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(le=!1)})),!le)return _;if(null!=_.$id&&null!=_.$ref){var he=Object.assign({},_);return delete he.$ref,delete he.$id,delete he.$db,new db_ref(_.$ref,_.$id,_.$db||null,he)}return _}function isolateEvalWithHash(functionCache,hash,functionString,object){var value=null;return null==functionCache[hash]&&(eval("value = "+functionString),functionCache[hash]=value),functionCache[hash].bind(object)}function isolateEval(functionString){var value=null;return eval("value = "+functionString),value}var deserializer=deserialize$1;function readIEEE754(e,t,r,n,i){var o,s,a="big"===r,u=8*i-n-1,f=(1<<u)-1,c=f>>1,l=-7,h=a?0:i-1,d=a?1:-1,p=e[t+h];for(h+=d,o=p&(1<<-l)-1,p>>=-l,l+=u;l>0;o=256*o+e[t+h],h+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+h],h+=d,l-=8);if(0===o)o=1-c;else{if(o===f)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)}function writeIEEE754(e,t,r,n,i,o){var s,a,u,f="big"===n,c=8*o-i-1,l=(1<<c)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=f?o-1:0,g=f?-1:1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0)),isNaN(t)&&(a=0);i>=8;)e[r+p]=255&a,p+=g,a/=256,i-=8;for(s=s<<i|a,isNaN(t)&&(s+=8),c+=i;c>0;)e[r+p]=255&s,p+=g,s/=256,c-=8;e[r+p-g]|=128*_}var float_parser={readIEEE754:readIEEE754,writeIEEE754:writeIEEE754};function _typeof$3(e){return(_typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Buffer$5=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,writeIEEE754$1=float_parser.writeIEEE754,normalizedFunctionString$1=utils.normalizedFunctionString,regexp$1=/\x00/,ignoreKeys=new Set(["$db","$ref","$id","$clusterTime"]),isDate$1=function(e){return"object"===_typeof$3(e)&&"[object Date]"===Object.prototype.toString.call(e)},isRegExp$1=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)};function serializeString(e,t,r,n,i){e[n++]=constants.BSON_DATA_STRING;var o=i?e.write(t,n,"ascii"):e.write(t,n,"utf8");e[(n=n+o+1)-1]=0;var s=e.write(r,n+4,"utf8");return e[n+3]=s+1>>24&255,e[n+2]=s+1>>16&255,e[n+1]=s+1>>8&255,e[n]=s+1&255,n=n+4+s,e[n++]=0,n}function serializeNumber(e,t,r,n,i){if(Math.floor(r)===r&&r>=constants.JS_INT_MIN&&r<=constants.JS_INT_MAX)if(r>=constants.BSON_INT32_MIN&&r<=constants.BSON_INT32_MAX)e[n++]=constants.BSON_DATA_INT,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=r>>16&255,e[n++]=r>>24&255;else if(r>=constants.JS_INT_MIN&&r<=constants.JS_INT_MAX){e[n++]=constants.BSON_DATA_NUMBER,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,writeIEEE754$1(e,r,n,"little",52,8),n+=8}else{e[n++]=constants.BSON_DATA_LONG,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var o=long_1.fromNumber(r),s=o.getLowBits(),a=o.getHighBits();e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e[n++]=255&a,e[n++]=a>>8&255,e[n++]=a>>16&255,e[n++]=a>>24&255}else e[n++]=constants.BSON_DATA_NUMBER,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,writeIEEE754$1(e,r,n,"little",52,8),n+=8;return n}function serializeNull(e,t,r,n,i){return e[n++]=constants.BSON_DATA_NULL,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,n}function serializeBoolean(e,t,r,n,i){return e[n++]=constants.BSON_DATA_BOOLEAN,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,e[n++]=r?1:0,n}function serializeDate(e,t,r,n,i){e[n++]=constants.BSON_DATA_DATE,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var o=long_1.fromNumber(r.getTime()),s=o.getLowBits(),a=o.getHighBits();return e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e[n++]=255&a,e[n++]=a>>8&255,e[n++]=a>>16&255,e[n++]=a>>24&255,n}function serializeRegExp(e,t,r,n,i){if(e[n++]=constants.BSON_DATA_REGEXP,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,r.source&&null!=r.source.match(regexp$1))throw Error("value "+r.source+" must not contain null bytes");return n+=e.write(r.source,n,"utf8"),e[n++]=0,r.ignoreCase&&(e[n++]=105),r.global&&(e[n++]=115),r.multiline&&(e[n++]=109),e[n++]=0,n}function serializeBSONRegExp(e,t,r,n,i){if(e[n++]=constants.BSON_DATA_REGEXP,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,null!=r.pattern.match(regexp$1))throw Error("pattern "+r.pattern+" must not contain null bytes");return n+=e.write(r.pattern,n,"utf8"),e[n++]=0,n+=e.write(r.options.split("").sort().join(""),n,"utf8"),e[n++]=0,n}function serializeMinMax(e,t,r,n,i){return null===r?e[n++]=constants.BSON_DATA_NULL:"MinKey"===r._bsontype?e[n++]=constants.BSON_DATA_MIN_KEY:e[n++]=constants.BSON_DATA_MAX_KEY,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,n}function serializeObjectId(e,t,r,n,i){if(e[n++]=constants.BSON_DATA_OID,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,"string"==typeof r.id)e.write(r.id,n,"binary");else{if(!r.id||!r.id.copy)throw new TypeError("object ["+JSON.stringify(r)+"] is not a valid ObjectId");r.id.copy(e,n,0,12)}return n+12}function serializeBuffer(e,t,r,n,i){e[n++]=constants.BSON_DATA_BINARY,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var o=r.length;return e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=constants.BSON_BINARY_SUBTYPE_DEFAULT,r.copy(e,n,0,o),n+=o}function serializeObject(e,t,r,n,i,o,s,a,u,f){for(var c=0;c<f.length;c++)if(f[c]===r)throw new Error("cyclic dependency detected");f.push(r),e[n++]=Array.isArray(r)?constants.BSON_DATA_ARRAY:constants.BSON_DATA_OBJECT,n+=u?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var l=serializeInto(e,r,i,n,o+1,s,a,f);return f.pop(),l}function serializeDecimal128(e,t,r,n,i){return e[n++]=constants.BSON_DATA_DECIMAL128,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,r.bytes.copy(e,n,0,16),n+16}function serializeLong(e,t,r,n,i){e[n++]="Long"===r._bsontype?constants.BSON_DATA_LONG:constants.BSON_DATA_TIMESTAMP,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var o=r.getLowBits(),s=r.getHighBits();return e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,n}function serializeInt32(e,t,r,n,i){return e[n++]=constants.BSON_DATA_INT,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=r>>16&255,e[n++]=r>>24&255,n}function serializeDouble(e,t,r,n,i){return e[n++]=constants.BSON_DATA_NUMBER,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0,writeIEEE754$1(e,r.value,n,"little",52,8),n+=8}function serializeFunction(e,t,r,n,i,o,s){e[n++]=constants.BSON_DATA_CODE,n+=s?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var a=normalizedFunctionString$1(r),u=e.write(a,n+4,"utf8")+1;return e[n]=255&u,e[n+1]=u>>8&255,e[n+2]=u>>16&255,e[n+3]=u>>24&255,n=n+4+u-1,e[n++]=0,n}function serializeCode(e,t,r,n,i,o,s,a,u){if(r.scope&&"object"===_typeof$3(r.scope)){e[n++]=constants.BSON_DATA_CODE_W_SCOPE,n+=u?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var f=n,c="string"==typeof r.code?r.code:r.code.toString();n+=4;var l=e.write(c,n+4,"utf8")+1;e[n]=255&l,e[n+1]=l>>8&255,e[n+2]=l>>16&255,e[n+3]=l>>24&255,e[n+4+l-1]=0,n=n+l+4;var h=serializeInto(e,r.scope,i,n,o+1,s,a);n=h-1;var d=h-f;e[f++]=255&d,e[f++]=d>>8&255,e[f++]=d>>16&255,e[f++]=d>>24&255,e[n++]=0}else{e[n++]=constants.BSON_DATA_CODE,n+=u?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var p=r.code.toString(),g=e.write(p,n+4,"utf8")+1;e[n]=255&g,e[n+1]=g>>8&255,e[n+2]=g>>16&255,e[n+3]=g>>24&255,n=n+4+g-1,e[n++]=0}return n}function serializeBinary(e,t,r,n,i){e[n++]=constants.BSON_DATA_BINARY,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var o=r.value(!0),s=r.position;return r.sub_type===binary.SUBTYPE_BYTE_ARRAY&&(s+=4),e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e[n++]=r.sub_type,r.sub_type===binary.SUBTYPE_BYTE_ARRAY&&(s-=4,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255),o.copy(e,n,0,r.position),n+=r.position}function serializeSymbol(e,t,r,n,i){e[n++]=constants.BSON_DATA_SYMBOL,n+=i?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var o=e.write(r.value,n+4,"utf8")+1;return e[n]=255&o,e[n+1]=o>>8&255,e[n+2]=o>>16&255,e[n+3]=o>>24&255,n=n+4+o-1,e[n++]=0,n}function serializeDBRef(e,t,r,n,i,o,s){e[n++]=constants.BSON_DATA_OBJECT,n+=s?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var a,u=n,f={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(f.$db=r.db);var c=(a=serializeInto(e,f=Object.assign(f,r.fields),!1,n,i+1,o))-u;return e[u++]=255&c,e[u++]=c>>8&255,e[u++]=c>>16&255,e[u++]=c>>24&255,a}function serializeInto(e,t,r,n,i,o,s,a){n=n||0,(a=a||[]).push(t);var u=n+4;if(Array.isArray(t))for(var f=0;f<t.length;f++){var c=""+f,l=t[f];if(l&&l.toBSON){if("function"!=typeof l.toBSON)throw new TypeError("toBSON is not a function");l=l.toBSON()}var h=_typeof$3(l);if("string"===h)u=serializeString(e,c,l,u,!0);else if("number"===h)u=serializeNumber(e,c,l,u,!0);else if("boolean"===h)u=serializeBoolean(e,c,l,u,!0);else if(l instanceof Date||isDate$1(l))u=serializeDate(e,c,l,u,!0);else if(void 0===l)u=serializeNull(e,c,l,u,!0);else if(null===l)u=serializeNull(e,c,l,u,!0);else if("ObjectId"===l._bsontype||"ObjectID"===l._bsontype)u=serializeObjectId(e,c,l,u,!0);else if(Buffer$5.isBuffer(l))u=serializeBuffer(e,c,l,u,!0);else if(l instanceof RegExp||isRegExp$1(l))u=serializeRegExp(e,c,l,u,!0);else if("object"===h&&null==l._bsontype)u=serializeObject(e,c,l,u,r,i,o,s,!0,a);else if("object"===h&&"Decimal128"===l._bsontype)u=serializeDecimal128(e,c,l,u,!0);else if("Long"===l._bsontype||"Timestamp"===l._bsontype)u=serializeLong(e,c,l,u,!0);else if("Double"===l._bsontype)u=serializeDouble(e,c,l,u,!0);else if("function"==typeof l&&o)u=serializeFunction(e,c,l,u,r,i,o,!0);else if("Code"===l._bsontype)u=serializeCode(e,c,l,u,r,i,o,s,!0);else if("Binary"===l._bsontype)u=serializeBinary(e,c,l,u,!0);else if("Symbol"===l._bsontype)u=serializeSymbol(e,c,l,u,!0);else if("DBRef"===l._bsontype)u=serializeDBRef(e,c,l,u,i,o,!0);else if("BSONRegExp"===l._bsontype)u=serializeBSONRegExp(e,c,l,u,!0);else if("Int32"===l._bsontype)u=serializeInt32(e,c,l,u,!0);else if("MinKey"===l._bsontype||"MaxKey"===l._bsontype)u=serializeMinMax(e,c,l,u,!0);else if(void 0!==l._bsontype)throw new TypeError("Unrecognized or invalid _bsontype: "+l._bsontype)}else if(t instanceof map)for(var d=t.entries(),p=!1;!p;){var g=d.next();if(!(p=g.done)){var _=g.value[0],b=g.value[1],y=_typeof$3(b);if("string"==typeof _&&!ignoreKeys.has(_)){if(null!=_.match(regexp$1))throw Error("key "+_+" must not contain null bytes");if(r){if("$"===_[0])throw Error("key "+_+" must not start with '$'");if(~_.indexOf("."))throw Error("key "+_+" must not contain '.'")}}if("string"===y)u=serializeString(e,_,b,u);else if("number"===y)u=serializeNumber(e,_,b,u);else if("boolean"===y)u=serializeBoolean(e,_,b,u);else if(b instanceof Date||isDate$1(b))u=serializeDate(e,_,b,u);else if(null===b||void 0===b&&!1===s)u=serializeNull(e,_,b,u);else if("ObjectId"===b._bsontype||"ObjectID"===b._bsontype)u=serializeObjectId(e,_,b,u);else if(Buffer$5.isBuffer(b))u=serializeBuffer(e,_,b,u);else if(b instanceof RegExp||isRegExp$1(b))u=serializeRegExp(e,_,b,u);else if("object"===y&&null==b._bsontype)u=serializeObject(e,_,b,u,r,i,o,s,!1,a);else if("object"===y&&"Decimal128"===b._bsontype)u=serializeDecimal128(e,_,b,u);else if("Long"===b._bsontype||"Timestamp"===b._bsontype)u=serializeLong(e,_,b,u);else if("Double"===b._bsontype)u=serializeDouble(e,_,b,u);else if("Code"===b._bsontype)u=serializeCode(e,_,b,u,r,i,o,s);else if("function"==typeof b&&o)u=serializeFunction(e,_,b,u,r,i,o);else if("Binary"===b._bsontype)u=serializeBinary(e,_,b,u);else if("Symbol"===b._bsontype)u=serializeSymbol(e,_,b,u);else if("DBRef"===b._bsontype)u=serializeDBRef(e,_,b,u,i,o);else if("BSONRegExp"===b._bsontype)u=serializeBSONRegExp(e,_,b,u);else if("Int32"===b._bsontype)u=serializeInt32(e,_,b,u);else if("MinKey"===b._bsontype||"MaxKey"===b._bsontype)u=serializeMinMax(e,_,b,u);else if(void 0!==b._bsontype)throw new TypeError("Unrecognized or invalid _bsontype: "+b._bsontype)}}else{if(t.toBSON){if("function"!=typeof t.toBSON)throw new TypeError("toBSON is not a function");if(null!=(t=t.toBSON())&&"object"!==_typeof$3(t))throw new TypeError("toBSON function did not return an object")}for(var m in t){var w=t[m];if(w&&w.toBSON){if("function"!=typeof w.toBSON)throw new TypeError("toBSON is not a function");w=w.toBSON()}var v=_typeof$3(w);if("string"==typeof m&&!ignoreKeys.has(m)){if(null!=m.match(regexp$1))throw Error("key "+m+" must not contain null bytes");if(r){if("$"===m[0])throw Error("key "+m+" must not start with '$'");if(~m.indexOf("."))throw Error("key "+m+" must not contain '.'")}}if("string"===v)u=serializeString(e,m,w,u);else if("number"===v)u=serializeNumber(e,m,w,u);else if("boolean"===v)u=serializeBoolean(e,m,w,u);else if(w instanceof Date||isDate$1(w))u=serializeDate(e,m,w,u);else if(void 0===w)!1===s&&(u=serializeNull(e,m,w,u));else if(null===w)u=serializeNull(e,m,w,u);else if("ObjectId"===w._bsontype||"ObjectID"===w._bsontype)u=serializeObjectId(e,m,w,u);else if(Buffer$5.isBuffer(w))u=serializeBuffer(e,m,w,u);else if(w instanceof RegExp||isRegExp$1(w))u=serializeRegExp(e,m,w,u);else if("object"===v&&null==w._bsontype)u=serializeObject(e,m,w,u,r,i,o,s,!1,a);else if("object"===v&&"Decimal128"===w._bsontype)u=serializeDecimal128(e,m,w,u);else if("Long"===w._bsontype||"Timestamp"===w._bsontype)u=serializeLong(e,m,w,u);else if("Double"===w._bsontype)u=serializeDouble(e,m,w,u);else if("Code"===w._bsontype)u=serializeCode(e,m,w,u,r,i,o,s);else if("function"==typeof w&&o)u=serializeFunction(e,m,w,u,r,i,o);else if("Binary"===w._bsontype)u=serializeBinary(e,m,w,u);else if("Symbol"===w._bsontype)u=serializeSymbol(e,m,w,u);else if("DBRef"===w._bsontype)u=serializeDBRef(e,m,w,u,i,o);else if("BSONRegExp"===w._bsontype)u=serializeBSONRegExp(e,m,w,u);else if("Int32"===w._bsontype)u=serializeInt32(e,m,w,u);else if("MinKey"===w._bsontype||"MaxKey"===w._bsontype)u=serializeMinMax(e,m,w,u);else if(void 0!==w._bsontype)throw new TypeError("Unrecognized or invalid _bsontype: "+w._bsontype)}}a.pop(),e[u++]=0;var E=u-n;return e[n++]=255&E,e[n++]=E>>8&255,e[n++]=E>>16&255,e[n++]=E>>24&255,u}var serializer=serializeInto;function _typeof$4(e){return(_typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Buffer$6=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,normalizedFunctionString$2=utils.normalizedFunctionString;function isDate$2(e){return"object"===_typeof$4(e)&&"[object Date]"===Object.prototype.toString.call(e)}function calculateObjectSize(e,t,r){var n=5;if(Array.isArray(e))for(var i=0;i<e.length;i++)n+=calculateElement(i.toString(),e[i],t,!0,r);else for(var o in e.toBSON&&(e=e.toBSON()),e)n+=calculateElement(o,e[o],t,!1,r);return n}function calculateElement(e,t,r,n,i){switch(t&&t.toBSON&&(t=t.toBSON()),_typeof$4(t)){case"string":return 1+Buffer$6.byteLength(e,"utf8")+1+4+Buffer$6.byteLength(t,"utf8")+1;case"number":return Math.floor(t)===t&&t>=constants.JS_INT_MIN&&t<=constants.JS_INT_MAX&&t>=constants.BSON_INT32_MIN&&t<=constants.BSON_INT32_MAX?(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+5:(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+9;case"undefined":return n||!i?(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1:0;case"boolean":return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+2;case"object":if(null==t||"MinKey"===t._bsontype||"MaxKey"===t._bsontype)return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1;if("ObjectId"===t._bsontype||"ObjectID"===t._bsontype)return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+13;if(t instanceof Date||isDate$2(t))return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+9;if(void 0!==Buffer$6&&Buffer$6.isBuffer(t))return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+6+t.length;if("Long"===t._bsontype||"Double"===t._bsontype||"Timestamp"===t._bsontype)return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+9;if("Decimal128"===t._bsontype)return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+17;if("Code"===t._bsontype)return null!=t.scope&&Object.keys(t.scope).length>0?(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+4+4+Buffer$6.byteLength(t.code.toString(),"utf8")+1+calculateObjectSize(t.scope,r,i):(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+4+Buffer$6.byteLength(t.code.toString(),"utf8")+1;if("Binary"===t._bsontype)return t.sub_type===binary.SUBTYPE_BYTE_ARRAY?(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+(t.position+1+4+1+4):(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+(t.position+1+4+1);if("Symbol"===t._bsontype)return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+Buffer$6.byteLength(t.value,"utf8")+4+1+1;if("DBRef"===t._bsontype){var o=Object.assign({$ref:t.collection,$id:t.oid},t.fields);return null!=t.db&&(o.$db=t.db),(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+calculateObjectSize(o,r,i)}return t instanceof RegExp||"[object RegExp]"===Object.prototype.toString.call(t)?(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+Buffer$6.byteLength(t.source,"utf8")+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1:"BSONRegExp"===t._bsontype?(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+Buffer$6.byteLength(t.pattern,"utf8")+1+Buffer$6.byteLength(t.options,"utf8")+1:(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+calculateObjectSize(t,r,i)+1;case"function":if(t instanceof RegExp||"[object RegExp]"===Object.prototype.toString.call(t)||"[object RegExp]"===String.call(t))return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+Buffer$6.byteLength(t.source,"utf8")+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1;if(r&&null!=t.scope&&Object.keys(t.scope).length>0)return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+4+4+Buffer$6.byteLength(normalizedFunctionString$2(t),"utf8")+1+calculateObjectSize(t.scope,r,i);if(r)return(null!=e?Buffer$6.byteLength(e,"utf8")+1:0)+1+4+Buffer$6.byteLength(normalizedFunctionString$2(t),"utf8")+1}return 0}var calculate_size=calculateObjectSize,Buffer$7=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,ensure_buffer=function(e){if(e instanceof Buffer$7)return e;if(e instanceof Uint8Array)return Buffer$7.from(e.buffer);throw new TypeError("Must use either Buffer or Uint8Array")},Buffer$8=buffer__WEBPACK_IMPORTED_MODULE_1___default.a.Buffer,MAXSIZE=17825792,buffer$1=Buffer$8.alloc(MAXSIZE);function setInternalBufferSize(e){buffer$1.length<e&&(buffer$1=Buffer$8.alloc(e))}function serialize$1(e,t){var r="boolean"==typeof(t=t||{}).checkKeys&&t.checkKeys,n="boolean"==typeof t.serializeFunctions&&t.serializeFunctions,i="boolean"!=typeof t.ignoreUndefined||t.ignoreUndefined,o="number"==typeof t.minInternalBufferSize?t.minInternalBufferSize:MAXSIZE;buffer$1.length<o&&(buffer$1=Buffer$8.alloc(o));var s=serializer(buffer$1,e,r,0,0,n,i,[]),a=Buffer$8.alloc(s);return buffer$1.copy(a,0,0,a.length),a}function serializeWithBufferAndIndex(e,t,r){var n="boolean"==typeof(r=r||{}).checkKeys&&r.checkKeys,i="boolean"==typeof r.serializeFunctions&&r.serializeFunctions,o="boolean"!=typeof r.ignoreUndefined||r.ignoreUndefined,s="number"==typeof r.index?r.index:0,a=serializer(buffer$1,e,n,0,0,i,o);return buffer$1.copy(t,s,0,a),s+a-1}function deserialize$2(e,t){return e=ensure_buffer(e),deserializer(e,t)}function calculateObjectSize$1(e,t){var r="boolean"==typeof(t=t||{}).serializeFunctions&&t.serializeFunctions,n="boolean"!=typeof t.ignoreUndefined||t.ignoreUndefined;return calculate_size(e,r,n)}function deserializeStream(e,t,r,n,i,o){o=Object.assign({allowObjectSmallerThanBufferSize:!0},o),e=ensure_buffer(e);for(var s=t,a=0;a<r;a++){var u=e[s]|e[s+1]<<8|e[s+2]<<16|e[s+3]<<24;o.index=s,n[i+a]=deserializer(e,o),s+=u}return s}var bson={BSON_INT32_MAX:constants.BSON_INT32_MAX,BSON_INT32_MIN:constants.BSON_INT32_MIN,BSON_INT64_MAX:constants.BSON_INT64_MAX,BSON_INT64_MIN:constants.BSON_INT64_MIN,JS_INT_MAX:constants.JS_INT_MAX,JS_INT_MIN:constants.JS_INT_MIN,BSON_DATA_NUMBER:constants.BSON_DATA_NUMBER,BSON_DATA_STRING:constants.BSON_DATA_STRING,BSON_DATA_OBJECT:constants.BSON_DATA_OBJECT,BSON_DATA_ARRAY:constants.BSON_DATA_ARRAY,BSON_DATA_BINARY:constants.BSON_DATA_BINARY,BSON_DATA_UNDEFINED:constants.BSON_DATA_UNDEFINED,BSON_DATA_OID:constants.BSON_DATA_OID,BSON_DATA_BOOLEAN:constants.BSON_DATA_BOOLEAN,BSON_DATA_DATE:constants.BSON_DATA_DATE,BSON_DATA_NULL:constants.BSON_DATA_NULL,BSON_DATA_REGEXP:constants.BSON_DATA_REGEXP,BSON_DATA_DBPOINTER:constants.BSON_DATA_DBPOINTER,BSON_DATA_CODE:constants.BSON_DATA_CODE,BSON_DATA_SYMBOL:constants.BSON_DATA_SYMBOL,BSON_DATA_CODE_W_SCOPE:constants.BSON_DATA_CODE_W_SCOPE,BSON_DATA_INT:constants.BSON_DATA_INT,BSON_DATA_TIMESTAMP:constants.BSON_DATA_TIMESTAMP,BSON_DATA_LONG:constants.BSON_DATA_LONG,BSON_DATA_DECIMAL128:constants.BSON_DATA_DECIMAL128,BSON_DATA_MIN_KEY:constants.BSON_DATA_MIN_KEY,BSON_DATA_MAX_KEY:constants.BSON_DATA_MAX_KEY,BSON_BINARY_SUBTYPE_DEFAULT:constants.BSON_BINARY_SUBTYPE_DEFAULT,BSON_BINARY_SUBTYPE_FUNCTION:constants.BSON_BINARY_SUBTYPE_FUNCTION,BSON_BINARY_SUBTYPE_BYTE_ARRAY:constants.BSON_BINARY_SUBTYPE_BYTE_ARRAY,BSON_BINARY_SUBTYPE_UUID:constants.BSON_BINARY_SUBTYPE_UUID,BSON_BINARY_SUBTYPE_MD5:constants.BSON_BINARY_SUBTYPE_MD5,BSON_BINARY_SUBTYPE_USER_DEFINED:constants.BSON_BINARY_SUBTYPE_USER_DEFINED,Code:code,Map:map,BSONSymbol:symbol,DBRef:db_ref,Binary:binary,ObjectId:objectid,Long:long_1,Timestamp:timestamp,Double:double_1,Int32:int_32,MinKey:min_key,MaxKey:max_key,BSONRegExp:regexp,Decimal128:decimal128,serialize:serialize$1,serializeWithBufferAndIndex:serializeWithBufferAndIndex,deserialize:deserialize$2,calculateObjectSize:calculateObjectSize$1,deserializeStream:deserializeStream,setInternalBufferSize:setInternalBufferSize,ObjectID:objectid,EJSON:extended_json},bson_1=bson.BSON_INT32_MAX,bson_2=bson.BSON_INT32_MIN,bson_3=bson.BSON_INT64_MAX,bson_4=bson.BSON_INT64_MIN,bson_5=bson.JS_INT_MAX,bson_6=bson.JS_INT_MIN,bson_7=bson.BSON_DATA_NUMBER,bson_8=bson.BSON_DATA_STRING,bson_9=bson.BSON_DATA_OBJECT,bson_10=bson.BSON_DATA_ARRAY,bson_11=bson.BSON_DATA_BINARY,bson_12=bson.BSON_DATA_UNDEFINED,bson_13=bson.BSON_DATA_OID,bson_14=bson.BSON_DATA_BOOLEAN,bson_15=bson.BSON_DATA_DATE,bson_16=bson.BSON_DATA_NULL,bson_17=bson.BSON_DATA_REGEXP,bson_18=bson.BSON_DATA_DBPOINTER,bson_19=bson.BSON_DATA_CODE,bson_20=bson.BSON_DATA_SYMBOL,bson_21=bson.BSON_DATA_CODE_W_SCOPE,bson_22=bson.BSON_DATA_INT,bson_23=bson.BSON_DATA_TIMESTAMP,bson_24=bson.BSON_DATA_LONG,bson_25=bson.BSON_DATA_DECIMAL128,bson_26=bson.BSON_DATA_MIN_KEY,bson_27=bson.BSON_DATA_MAX_KEY,bson_28=bson.BSON_BINARY_SUBTYPE_DEFAULT,bson_29=bson.BSON_BINARY_SUBTYPE_FUNCTION,bson_30=bson.BSON_BINARY_SUBTYPE_BYTE_ARRAY,bson_31=bson.BSON_BINARY_SUBTYPE_UUID,bson_32=bson.BSON_BINARY_SUBTYPE_MD5,bson_33=bson.BSON_BINARY_SUBTYPE_USER_DEFINED,bson_34=bson.Code,bson_35=bson.BSONSymbol,bson_36=bson.DBRef,bson_37=bson.Binary,bson_38=bson.ObjectId,bson_39=bson.Long,bson_40=bson.Timestamp,bson_41=bson.Double,bson_42=bson.Int32,bson_43=bson.MinKey,bson_44=bson.MaxKey,bson_45=bson.BSONRegExp,bson_46=bson.Decimal128,bson_47=bson.serialize,bson_48=bson.serializeWithBufferAndIndex,bson_49=bson.deserialize,bson_50=bson.calculateObjectSize,bson_51=bson.deserializeStream,bson_52=bson.setInternalBufferSize,bson_53=bson.ObjectID,bson_54=bson.EJSON,_unused_webpack_default_export=bson}).call(this,__webpack_require__(4),__webpack_require__(1).Buffer)},function(e,t,r){e.exports=r(41)},function(e,t,r){"use strict";function n(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}r.d(t,"a",(function(){return n}))},function(e,t){function r(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}r.keys=function(){return[]},r.resolve=r,e.exports=r,r.id=20},function(e,t,r){"use strict";var n=r(0),i=r(5),o=r(22),s=r(12);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=a(r(8));u.Axios=o,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(13),u.CancelToken=r(35),u.isCancel=r(7),u.all=function(e){return Promise.all(e)},u.spread=r(36),u.isAxiosError=r(37),e.exports=u,e.exports.default=u},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(23),s=r(24),a=r(12);function u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},u.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=u},function(e,t,r){"use strict";var n=r(0);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,r){"use strict";var n=r(0),i=r(25),o=r(7),s=r(8);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t,r){"use strict";var n=r(0);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(11);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(31),i=r(32);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(0),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(13);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,r){"use strict";t.byteLength=function(e){var t=f(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=f(e),s=n[0],a=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),c=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,u=r-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function f(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,c=-7,l=r?i-1:0,h=r?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+l],l+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=f}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,f=8*o-i-1,c=(1<<f)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=c?(a=0,s=c):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;e[r+d]=255&s,d+=p,s/=256,f-=8);e[r+d-p]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(r(42)),s=r(14),a=r(15),u=r(47),f=i(r(48));var c=r(14);t.registerSerializer=c.registerSerializer;var l=r(15);t.Transfer=l.Transfer;let h=!1;const d=e=>e&&e.type===u.MasterMessageType.run,p=e=>o.default(e)||function(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}(e);function g(e){return a.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function _(e,t){const{payload:r,transferables:n}=g(t),i={type:u.WorkerMessageType.error,uid:e,error:s.serialize(r)};f.default.postMessageToMaster(i,n)}function b(e,t,r){const{payload:n,transferables:i}=g(r),o={type:u.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};f.default.postMessageToMaster(o,i)}function y(e){const t={type:u.WorkerMessageType.uncaughtError,error:s.serialize(e)};f.default.postMessageToMaster(t)}function m(e,t,r){return n(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return _(e,t)}const i=p(n)?"observable":"promise";if(function(e,t){const r={type:u.WorkerMessageType.running,uid:e,resultType:t};f.default.postMessageToMaster(r)}(e,i),p(n))n.subscribe((t=>b(e,!1,s.serialize(t))),(t=>_(e,s.serialize(t))),(()=>b(e,!0)));else try{const t=yield n;b(e,!0,s.serialize(t))}catch(t){_(e,s.serialize(t))}}))}t.expose=function(e){if(!f.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(h)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(h=!0,"function"==typeof e)f.default.subscribeToMasterMessages((t=>{d(t)&&!t.method&&m(t.uid,e,t.args.map(s.deserialize))})),function(){const e={type:u.WorkerMessageType.init,exposed:{type:"function"}};f.default.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${e}`);f.default.subscribeToMasterMessages((t=>{d(t)&&t.method&&m(t.uid,e[t.method],t.args.map(s.deserialize))}));!function(e){const t={type:u.WorkerMessageType.init,exposed:{type:"module",methods:e}};f.default.postMessageToMaster(t)}(Object.keys(e).filter((t=>"function"==typeof e[t])))}},"undefined"!=typeof self&&"function"==typeof self.addEventListener&&f.default.isWorkerRuntime()&&(self.addEventListener("error",(e=>{setTimeout((()=>y(e.error||e)),250)})),self.addEventListener("unhandledrejection",(e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout((()=>y(t)),250)}))),void 0!==e&&"function"==typeof e.on&&f.default.isWorkerRuntime()&&(e.on("uncaughtException",(e=>{setTimeout((()=>y(e)),250)})),e.on("unhandledRejection",(e=>{e&&"string"==typeof e.message&&setTimeout((()=>y(e)),250)})))}).call(this,r(9))},function(e,t,r){"use strict";const n=r(43).default;e.exports=e=>Boolean(e&&e[n]&&e===e[n]())},function(e,t,r){"use strict";r.r(t),function(e,n){var i,o=r(19);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:n;var s=Object(o.a)(i);t.default=s}.call(this,r(4),r(44)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSerializer=function(e,t){const r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,r),serialize:e=>t.serialize(e,n)}};const n={deserialize:e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),serialize:e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack})};t.DefaultSerializer={deserialize(e){return(t=e)&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker?n.deserialize(e):e;var t},serialize:e=>e instanceof Error?n.serialize(e):e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.$errors=Symbol("thread.errors"),t.$events=Symbol("thread.events"),t.$terminate=Symbol("thread.terminate"),t.$transferable=Symbol("thread.transferable"),t.$worker=Symbol("thread.worker")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.run="run"}(t.MasterMessageType||(t.MasterMessageType={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(t.WorkerMessageType||(t.WorkerMessageType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={isWorkerRuntime:function(){return!("undefined"==typeof self||!self.postMessage)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(51);t.Observable=n.Observable;const i=Symbol("observers");class o extends n.Observable{constructor(){super((e=>{this[i]=[...this[i]||[],e];return()=>{this[i]=this[i].filter((t=>t!==e))}})),this[i]=[]}complete(){this[i].forEach((e=>e.complete()))}error(e){this[i].forEach((t=>t.error(e)))}next(e){this[i].forEach((t=>t.next(e)))}}t.Subject=o},function(e,t,r){"use strict";r.r(t);const n=new Function("try{return this===global;}catch(e){return false;}"),i=new Function("try{return typeof importScripts === 'function';}catch(e){return false;}"),o=(new Function("try{return typeof window !== 'undefined';}catch(e){return false;}"),"https://biolib-public-assets.s3-eu-west-1.amazonaws.com"),s="0.0.185-biolib",a="0.1.25",u="0.1.532",f="0.1.60";var c={isDev:!1,pythonExecutorVersion:s,biolibAnalyzerVersion:a,biolibRVersion:u,biolibTensorVersion:f,pythonExecutorUrl:`${o}/pyodide/0.0.185-biolib/`,wasmAnalyzerUrl:`${o}/wasm-analyzer/biolib_wasm_analyzer_v0.1.25.wasm`,wasmBioLibTensorUrl:`${o}/tensor-executor/biolib_tensor_v0.1.60.wasm`,wasmRExecutorUrl:`${o}/r-executor/r_executor_v0.1.532.wasm`};class l extends Error{constructor(e){super(""),this.chainedErrors=[],"string"==typeof e?this.message=e:e&&void 0!==e.message&&(this.message=e.message),this.name="BioLibError",this.date=new Date}static chainErrors(e,t){const r=new l(e);let n;if(t instanceof Error){n=(t.stack?t.stack.toString():"").includes(t.message)?t.stack:`${t.message}: ${t.stack}`}else n=t.toString();return r.message=`${r.message}\n\n${n}`,"string"==typeof e&&"object"==typeof t&&(r.name=t.name),r}toString(){let e=`${this.message}\n`;for(let t=this.chainedErrors.length-1;t>=0;t-=1)e=`${e}\n${this.chainedErrors[t].message}\n`;return e}}class h{constructor(e=(()=>{}),t=(()=>{}),r=(()=>{})){this.functionElemIndex=0,this.cachegetUint8Memory=null,this.cachegetUint32Memory=null,this.cachegetInt32Memory=null,this.WASM_VECTOR_LEN=0,this.cachedTextEncoder=new TextEncoder,this.cachedTextDecoder=new TextDecoder("utf-8"),this.callTask=e,this.notificationMessage=t,this.setProgress=r,this.heap=new Array(32),this.heap.fill(void 0),this.heap.push(void 0,null,!0,!1),this.heap_next=this.heap.length,"function"==typeof this.cachedTextEncoder.encodeInto?this.passStringToWasm=e=>{let t=e.length,r=this.wasm.__wbindgen_malloc(t),n=0;{const t=this.getUint8Memory();for(;n<e.length;n++){const i=e.charCodeAt(n);if(i>127)break;t[r+n]=i}}if(n!==e.length){e=e.slice(n),r=this.wasm.__wbindgen_realloc(r,t,t=n+3*e.length);const i=this.getUint8Memory().subarray(r+n,r+t);n+=this.cachedTextEncoder.encodeInto(e,i).written||0}return this.WASM_VECTOR_LEN=n,r}:this.passStringToWasm=e=>{let t=e.length,r=this.wasm.__wbindgen_malloc(t),n=0;{const t=this.getUint8Memory();for(;n<e.length;n++){const i=e.charCodeAt(n);if(i>127)break;t[r+n]=i}}if(n!==e.length){const i=this.cachedTextEncoder.encode(e.slice(n));r=this.wasm.__wbindgen_realloc(r,t,t=n+i.length),this.getUint8Memory().set(i,r+n),n+=i.length}return this.WASM_VECTOR_LEN=n,r}}addHeapObject(e){this.heap_next===this.heap.length&&this.heap.push(this.heap.length+1);const t=this.heap_next;return this.heap_next=this.heap[t],this.heap[t]=e,t}__wbg_elem_binding0(e,t,r){this.wasm.__wbg_function_table.get(this.functionElemIndex)(e,t,this.addHeapObject(r))}__wbg_elem_binding1(e,t,r,n){this.wasm.__wbg_function_table.get(this.functionElemIndex+19)(e,t,this.addHeapObject(r),this.addHeapObject(n))}getUint8Memory(){return null!==this.cachegetUint8Memory&&this.cachegetUint8Memory.buffer===this.wasm.memory.buffer||(this.cachegetUint8Memory=new Uint8Array(this.wasm.memory.buffer)),this.cachegetUint8Memory}getInt32Memory(){return null!==this.cachegetInt32Memory&&this.cachegetInt32Memory.buffer===this.wasm.memory.buffer||(this.cachegetInt32Memory=new Int32Array(this.wasm.memory.buffer)),this.cachegetInt32Memory}passArray8ToWasm(e){const t=this.wasm.__wbindgen_malloc(1*e.length);return this.getUint8Memory().set(e,t/1),this.WASM_VECTOR_LEN=e.length,t}getObject(e){return this.heap[e]}dropObject(e){e<36||(this.heap[e]=this.heap_next,this.heap_next=e)}takeObject(e){const t=this.getObject(e);return this.dropObject(e),t}compute(e,t){const r=this.wasm.compute(this.passArray8ToWasm(e),this.WASM_VECTOR_LEN,this.passStringToWasm(t),this.WASM_VECTOR_LEN);return this.takeObject(r)}analyze_wasm(e){this.wasm.analyze_wasm(8,this.passArray8ToWasm(e),this.WASM_VECTOR_LEN);const t=this.getInt32Memory(),r=this.getArrayU8FromWasm(t[2],t[3]).slice();return this.wasm.__wbindgen_free(t[2],1*t[3]),r}execute(e,t,r){this.wasm.execute(8,this.passArray8ToWasm(e),this.WASM_VECTOR_LEN,this.passArray8ToWasm(t),this.WASM_VECTOR_LEN,this.passArray8ToWasm(r),this.WASM_VECTOR_LEN);const n=this.getInt32Memory(),i=this.getArrayU8FromWasm(n[2],n[3]).slice();return this.wasm.__wbindgen_free(n[2],1*n[3]),i}execute_onnx(e,t){this.wasm.execute_onnx(8,this.passArray8ToWasm(e),this.WASM_VECTOR_LEN,this.passArray8ToWasm(t),this.WASM_VECTOR_LEN);const r=this.getInt32Memory(),n=this.getArrayU8FromWasm(r[2],r[3]).slice();return this.wasm.__wbindgen_free(r[2],1*r[3]),n}execute_tensorflow(e,t){this.wasm.execute_tensorflow(8,this.passArray8ToWasm(e),this.WASM_VECTOR_LEN,this.passArray8ToWasm(t),this.WASM_VECTOR_LEN);const r=this.getInt32Memory(),n=this.getArrayU8FromWasm(r[2],r[3]).slice();return this.wasm.__wbindgen_free(r[2],1*r[3]),n}test(){this.wasm.test()}getArrayU8FromWasm(e,t){return this.getUint8Memory().subarray(e/1,e/1+t)}getStringFromWasm(e,t){return this.cachedTextDecoder.decode(this.getUint8Memory().subarray(e,e+t))}handleError(e){this.wasm.__wbindgen_exn_store(this.addHeapObject(e))}getUint32Memory(){return null!==this.cachegetUint32Memory&&this.cachegetUint32Memory.buffer===this.wasm.memory.buffer||(this.cachegetUint32Memory=new Uint32Array(this.wasm.memory.buffer)),this.cachegetUint32Memory}init(e,t){let n;void 0!==t&&(this.functionElemIndex=t);const i={wbg:{}};return i.wbg.__wbindgen_object_drop_ref=e=>{this.takeObject(e)},i.wbg.__wbg_notificationMessage_571115224b83327b=(e,t)=>{const r=this.getStringFromWasm(e,t).slice();this.wasm.__wbindgen_free(e,1*t),this.notificationMessage(r)},i.wbg.__wbg_notificationMessage_be8ba3c344310db3=(e,t)=>{const r=this.getStringFromWasm(e,t).slice();this.wasm.__wbindgen_free(e,1*t),this.notificationMessage(r)},i.wbg.__wbindgen_string_new=(e,t)=>{const r=this.getStringFromWasm(e,t);return this.addHeapObject(r)},i.wbg.__wbg_callTask_3dfab99995d3bde8=(e,t,r,n,i,o,s)=>{try{var a=this.callTask(this.getStringFromWasm(t,r),this.getStringFromWasm(n,i),this.getStringFromWasm(o,s)),u=this.passStringToWasm(a,this.wasm.__wbindgen_malloc,this.wasm.__wbindgen_realloc),f=this.WASM_VECTOR_LEN;this.getInt32Memory()[e/4+1]=f,this.getInt32Memory()[e/4+0]=u}finally{this.wasm.__wbindgen_free(n,i),this.wasm.__wbindgen_free(o,s)}},i.wbg.__wbindgen_cb_drop=e=>{const t=this.takeObject(e).original;if(1==t.cnt--)return t.a=0,!0;return!1},i.wbg.__wbg_call_fdde574e8abf6327=(e,t,r)=>{try{const n=this.getObject(e).call(this.getObject(t),this.getObject(r));return this.addHeapObject(n)}catch(e){this.handleError(e)}},i.wbg.__wbg_new_1719c88e1a2035ea=(e,t)=>{const r={a:e,b:t},n=(e,t)=>{const n=r.a;r.a=0;try{return this.__wbg_elem_binding1(n,r.b,e,t)}finally{r.a=n}};try{const e=new Promise(n);return this.addHeapObject(e)}finally{r.a=r.b=0}},i.wbg.__wbg_resolve_bacd3bf49c19a0f8=e=>{const t=Promise.resolve(this.getObject(e));return this.addHeapObject(t)},i.wbg.__wbg_then_3d6c84182dd53850=(e,t)=>{const r=this.getObject(e).then(this.getObject(t));return this.addHeapObject(r)},i.wbg.__wbg_then_0fe88013efbd2711=(e,t,r)=>{const n=this.getObject(e).then(this.getObject(t),this.getObject(r));return this.addHeapObject(n)},i.wbg.__wbg_buffer_d31feadf69cb45fc=e=>{const t=this.getObject(e).buffer;return this.addHeapObject(t)},i.wbg.__wbg_newwithbyteoffsetandlength_bac57664fe087b80=(e,t,r)=>{const n=new Uint8Array(this.getObject(e),t>>>0,r>>>0);return this.addHeapObject(n)},i.wbg.__wbg_length_b6e0c5630f641946=e=>this.getObject(e).length,i.wbg.__wbg_new_ed7079cf157e44d5=e=>{const t=new Uint8Array(this.getObject(e));return this.addHeapObject(t)},i.wbg.__wbg_set_2aae8dbe165bf1a3=(e,t,r)=>{this.getObject(e).set(this.getObject(t),r>>>0)},i.wbg.__wbg_slice_a197b435b0f8d935=(e,t,r)=>{const n=this.getObject(e).slice(t>>>0,r>>>0);return this.addHeapObject(n)},i.wbg.__wbindgen_string_get=(e,t)=>{const r=this.getObject(e);if("string"!=typeof r)return 0;const n=this.passStringToWasm(r);this.getUint32Memory()[t/4]=this.WASM_VECTOR_LEN;return n},i.wbg.__widl_f_log_1_=e=>{console.log(this.getObject(e))},i.wbg.__wbindgen_throw=(e,t)=>{throw new Error(this.getStringFromWasm(e,t))},i.wbg.__wbindgen_memory=()=>{const e=this.wasm.memory;return this.addHeapObject(e)},i.wbg.__wbindgen_closure_wrapper71=(e,t,r)=>{const n={a:e,b:t,cnt:1},i=e=>{n.cnt++;const t=n.a;n.a=0;try{return this.__wbg_elem_binding0(t,n.b,e)}finally{0==--n.cnt?this.wasm.__wbg_function_table.get(this.functionElemIndex+1)(t,n.b):n.a=t}};i.original=n;const o=i;return this.addHeapObject(o)},i.wbg.__wbindgen_closure_wrapper73=(e,t,r)=>{const n={a:e,b:t,cnt:1},i=e=>{n.cnt++;const t=n.a;n.a=0;try{return this.__wbg_elem_binding0(t,n.b,e)}finally{0==--n.cnt?this.wasm.__wbg_function_table.get(this.functionElemIndex+1)(t,n.b):n.a=t}};i.original=n;const o=i;return this.addHeapObject(o)},i.wbg.__wbindgen_closure_wrapper75=(e,t,r)=>{const n={a:e,b:t,cnt:1},i=e=>{n.cnt++;const t=n.a;n.a=0;try{return this.__wbg_elem_binding0(t,n.b,e)}finally{0==--n.cnt?this.wasm.__wbg_function_table.get(this.functionElemIndex+1)(t,n.b):n.a=t}};i.original=n;const o=i;return this.addHeapObject(o)},i.wbg.__wbindgen_closure_wrapper66=(e,t,r)=>{const n={a:e,b:t,cnt:1},i=e=>{n.cnt++;const t=n.a;n.a=0;try{return this.__wbg_elem_binding0(t,n.b,e)}finally{0==--n.cnt?this.wasm.__wbg_function_table.get(this.functionElemIndex+1)(t,n.b):n.a=t}};i.original=n;const o=i;return this.addHeapObject(o)},i.wbg.__wbindgen_closure_wrapper44=(e,t,r)=>{const n={a:e,b:t,cnt:1},i=e=>{n.cnt++;const t=n.a;n.a=0;try{return this.__wbg_elem_binding0(t,n.b,e)}finally{0==--n.cnt?this.wasm.__wbg_function_table.get(this.functionElemIndex+1)(t,n.b):n.a=t}};i.original=n;const o=i;return this.addHeapObject(o)},i.wbg.__wbindgen_closure_wrapper45=(e,t,r)=>{const n={a:e,b:t,cnt:1},i=e=>{n.cnt++;const t=n.a;n.a=0;try{return this.__wbg_elem_binding0(t,n.b,e)}finally{0==--n.cnt?this.wasm.__wbg_function_table.get(this.functionElemIndex+1)(t,n.b):n.a=t}};i.original=n;const o=i;return this.addHeapObject(o)},i.wbg.__wbindgen_closure_wrapper47=(e,t,r)=>{const n={a:e,b:t,cnt:1},i=e=>{n.cnt++;const t=n.a;n.a=0;try{return this.__wbg_elem_binding0(t,n.b,e)}finally{0==--n.cnt?this.wasm.__wbg_function_table.get(this.functionElemIndex+1)(t,n.b):n.a=t}};i.original=n;const o=i;return this.addHeapObject(o)},i["./snippets/rust-6826ff9a52c09b34/setProgress.js"]={setProgress:this.setProgress},i.wbg.__wbg_new_59cb74e423758ede=()=>{var e=new Error;return this.addHeapObject(e)},i.wbg.__wbg_stack_558ba5917b466edd=(e,t)=>{var r=this.getObject(t).stack,n=this.passStringToWasm(r,this.wasm.__wbindgen_malloc,this.wasm.__wbindgen_realloc),i=this.WASM_VECTOR_LEN;this.getInt32Memory()[e/4+1]=i,this.getInt32Memory()[e/4+0]=n},i.wbg.__wbg_error_4bb6c2a97407129a=(e,t)=>{try{console.error(this.getStringFromWasm(e,t))}finally{this.wasm.__wbindgen_free(e,t)}},i.wbg.__wbg_self_1b7a39e3a92c949c=()=>{try{const e=self.self;return this.addHeapObject(e)}catch(e){this.handleError(e)}},i.wbg.__wbg_require_604837428532a733=(e,t)=>{const n=r(20)(this.getStringFromWasm(e,t));return this.addHeapObject(n)},i.wbg.__wbg_crypto_968f1772287e2df0=e=>{const t=this.getObject(e).crypto;return this.addHeapObject(t)},i.wbg.__wbindgen_is_undefined=e=>void 0===this.getObject(e),i.wbg.__wbg_getRandomValues_a3d34b4fee3c2869=e=>{const t=this.getObject(e).getRandomValues;return this.addHeapObject(t)},i.wbg.__wbg_getRandomValues_f5e14ab7ac8e995d=(e,t,r)=>{this.getObject(e).getRandomValues(this.getArrayU8FromWasm(t,r))},i.wbg.__wbg_randomFillSync_d5bd2d655fdf256a=(e,t,r)=>{this.getObject(e).randomFillSync(this.getArrayU8FromWasm(t,r))},n=WebAssembly.instantiate(e,i).then((t=>t instanceof WebAssembly.Instance?{instance:t,module:e}:t)),n.then((({instance:e,module:t})=>(this.wasm=e.exports,this.wasm)))}}var d=r(16),p=r.n(d),g=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class _{constructor(e,t){this.cache=void 0,this.isCacheUnavailable=!1,this.fetchRetryAttempts=3,this.cacheName=e,this.cacheId=`${e}-${t}`,"undefined"==typeof caches&&(this.isCacheUnavailable=!0)}getWithRetry(e,t){return new Promise(((r,n)=>g(this,void 0,void 0,(function*(){for(let i=0;i<this.fetchRetryAttempts;i+=1)try{const n=yield p.a.get(e,t);if(n&&200===n.status)return void r(n);throw`Failed to get file ${e} in ${this.fetchRetryAttempts} tries`}catch(e){i>=this.fetchRetryAttempts-1&&n(e)}}))))}getFileFromUrl(e,t="arraybuffer"){return new Promise(((r,n)=>g(this,void 0,void 0,(function*(){try{let n=yield this.tryGetFileFromCache(e,"arraybuffer");if(!n){n=(yield this.getWithRetry(e,{responseType:"arraybuffer"})).data,yield this.tryPutFileToCache(e,n,"arraybuffer")}return"uint8array"===t&&(n=new Uint8Array(n)),void r(n)}catch(e){n(e)}}))))}getFileFromUrlAsBlob(e,t){return new Promise(((r,n)=>g(this,void 0,void 0,(function*(){try{let n=yield this.tryGetFileFromCache(e,"blob");if(!n){const{data:r}=yield this.getWithRetry(e,{responseType:"blob"});n=new Blob([r],{type:t}),yield this.tryPutFileToCache(e,n,t)}r(n)}catch(e){n(e)}}))))}tryGetFileFromCache(e,t){return new Promise((r=>g(this,void 0,void 0,(function*(){try{let n;const i=yield this.getCache(),o=yield i.match(e);o&&("blob"===t?n=yield o.blob():"arraybuffer"===t&&(n=yield o.arrayBuffer())),r(n)}catch(e){r()}}))))}tryPutFileToCache(e,t,r){return new Promise((n=>g(this,void 0,void 0,(function*(){try{const i={"Content-Type":r};t instanceof ArrayBuffer?(i["Content-Length"]=t.byteLength.toString(),i["Response-Type"]="arraybuffer"):t instanceof Blob&&(i["Content-Length"]=t.size.toString(),i["Response-Type"]="blob");const o=yield this.getCache();yield o.put(e,new Response(t,{headers:i})),n()}catch(e){n()}}))))}getCache(){return new Promise(((e,t)=>g(this,void 0,void 0,(function*(){try{if(this.isCacheUnavailable)return t(new Error("Cache is marked unavailable"));if(!this.cache){const e=yield caches.keys();for(const t of e)t!==this.cacheId&&t.includes(this.cacheName)&&(yield caches.delete(t));this.cache=yield caches.open(this.cacheId)}e(this.cache)}catch(e){console.error("Failed to access cache: ",e),this.isCacheUnavailable=!0,t(e)}}))))}}function b(e){return Array.prototype.map.call(new Uint8Array(e),(e=>`00${e.toString(16)}`.slice(-2))).join("").toUpperCase()}function y(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}var m=r(2),w=r(17);class v{dummyMethod(){Object(w.a)({})}static checkAtomicsAndCreateSharedArray(){if("undefined"==typeof Atomics)throw new l("Synchronous module calls are only supported in browsers that support shared memory.\nConsider using Chrome.");return new WebAssembly.Memory({shared:!0,initial:1,maximum:3e4})}static writeToSharedMemoryBuffer(e,t){const r=e.length+4-t.buffer.byteLength;if(r>0){const e=Math.ceil(r/65536);t.grow(e)}const n=new Int32Array(t.buffer,0,1),i=new Uint8Array(t.buffer,4,e.length);return Atomics.store(n,0,e.length),i.set(e),Atomics.notify(n,0,1),i}static blockAndReadSharedArrayBuffer(e){const t=new Int32Array(e.buffer,0,1);Atomics.wait(t,0,0);const r=Atomics.load(t,0);return Atomics.store(t,0,0),new Uint8Array(e.buffer,4,r)}}const E=/\$(?<argIndex>\d+)/g;function S(e,t){if(!e.startsWith("/"))throw new l(`Attempted to copy ${t} path ${e}. But only absolute paths are supported`);if(e.includes("//"))throw new l(`Attempted to copy ${t} path ${e}. But encountered consecutive slashes in path`);if(e.includes("/.."))throw new l(`Attempted to copy ${t} path ${e}. But encountered unsupported /.. path`)}function O(e,t,r,n,i){const o={},s=(e=>(...t)=>{const{argIndex:r}=t[t.length-1];if(0===r)throw new l("Attempted to copy using argument reference $0 which is invalid");if(r>e.length)throw new l("Attempted to copy using argument reference out of bounds of arguments");return e[r-1]})(t);for(const t of e){const e=t.from_path.replace(E,s);S(e,"from");const a=t.to_path.replace(E,s);S(a,"to");const u=e.endsWith("/"),f=a.endsWith("/");if(u){if(!f)throw new l(`Attempted to copy directory "${e}" to file "${a}"`);for(const{path:t,file:r}of n(e)){o[i?a.concat(t.slice(e.length)):t]=r}}else{const t=r(e);if(t){let r=i?a:e;if(i&&f){const t=e.split("/").pop();t&&(r=r.concat(t))}o[r]=t}else{if(!n(e.concat("/")).next().done)throw new l(`Tried to copy the file ${e} but found directory ${e}/ instead.\nIf you are trying to copy the contents of a directory ensure the path ends with a trailing slash.`)}}}return o}class A extends DataView{getBigUint64(e,t){if("function"==typeof super.getBigUint64)return super.getBigUint64(e,t);const r=BigInt(32),n=BigInt(this.getUint32(0|e,!!t)>>>0),i=BigInt(this.getUint32(4+(0|e)|0,!!t)>>>0);return t?i<<r|n:n<<r|i}setBigUint64(e,t,r){if("function"==typeof super.setBigUint64)return super.setBigUint64(e,t,r);const n=this.bigIntTo64BitByteArray(t);for(let t=0;t<n.length;t+=1){const i=r?n[n.length-1-t]:n[t];this.setUint8(e+t,i)}}bigIntTo64BitByteArray(e){let t=BigInt(e).toString(16);for(t.length%2!=0&&(t="0".concat(t));t.length<16;)t="00".concat(t);const r=t.length/2;if(8!==r)throw new Error("BigInt does not fit in 64 bits");const n=new Uint8Array(r);for(let e=0,i=0;e<r;e+=1,i+=2)n[e]=parseInt(t.slice(i,i+2),16);return n}}class B extends class{constructor(){this.VERSION=1}assertVersionAndType(e){const t=e.getUint8(0),r=e.getUint8(1);if(t!==this.VERSION)throw Error(`Unsupported BioLib Binary Format version: Got ${t} expected ${this.VERSION}`);if(r!==this.TYPE)throw Error(`Unsupported BioLib Binary Format type: Got ${r} expected ${this.TYPE}`)}}{constructor(){super(...arguments),this.textDecoder=new TextDecoder("utf-8",{fatal:!0}),this.textEncoder=new TextEncoder}applyFilesMappings(e,t){this.files=O(e,t,this.getSingleFile.bind(this),this.getFilesInDirectory.bind(this),!0)}filterOnFilesMappings(e,t){this.files=O(e,t,this.getSingleFile.bind(this),this.getFilesInDirectory.bind(this),!1)}*getFilesInDirectory(e){for(const t in this.files)t.startsWith(e)&&(yield{path:t,file:this.files[t]})}getSingleFile(e){return this.files[e]?this.files[e]:null}getFilesSerializedLength(e){let t=0;for(const r in e){const n=e[r];t+=12+this.textEncoder.encode(r).byteLength+n.data.byteLength}return t}serializeFilesIntoByteArray(e,t,r){let n=r;for(const r in e){const i=e[r],o=this.textEncoder.encode(r),s=new A(t.buffer,n,12);s.setUint32(0,o.byteLength),s.setBigUint64(4,BigInt(i.data.byteLength)),n+=12,t.set(o,n),n+=o.byteLength,t.set(i.data,n),n+=i.data.byteLength}}deserializeFiles(e,t,r){const n=new A(e.buffer,e.byteOffset,e.byteLength),i={};let o=t;const s=t+r;for(;o<s;){const t=n.getUint32(o);o+=4;const r=n.getBigUint64(o);o+=8;const s=Number(r),a=e.slice(o,o+t);o+=t;const u=this.textDecoder.decode(a),f=e.slice(o,o+s);i[u]={data:f},o+=s}return i}}class T extends B{constructor(e){super(),this.TYPE=2;const{exit_code:t,files:r,stdout:n,stderr:i}=e instanceof Uint8Array?this.deserialize(e):e;this.exit_code=t,this.files=r,this.stderr=i,this.stdout=n}getAttributes(){return{exit_code:this.exit_code,files:this.files,stderr:this.stderr,stdout:this.stdout}}filterOutUnchangedFiles(e){const t={};for(const r in this.files){const n=this.files[r];e[r]&&y(n.data,e[r].data)||(t[r]=n)}this.files=t}serialize(){const e=this.getFilesSerializedLength(this.files),t=28+this.stdout.length+this.stderr.length+e,r=new Uint8Array(t),n=new A(r.buffer);n.setUint8(0,this.VERSION),n.setUint8(1,this.TYPE),n.setBigUint64(2,BigInt(this.stdout.length)),n.setBigUint64(10,BigInt(this.stderr.length)),n.setBigUint64(18,BigInt(e)),n.setUint16(26,this.exit_code),r.set(this.stdout,28),r.set(this.stderr,28+this.stdout.length);const i=28+this.stdout.length+this.stderr.length;return this.serializeFilesIntoByteArray(this.files,r,i),r}deserialize(e){const t=new A(e.buffer,e.byteOffset,e.byteLength);this.assertVersionAndType(t);const r=Number(t.getBigUint64(2)),n=Number(t.getBigUint64(10)),i=Number(t.getBigUint64(18)),o=28+r+n;return{exit_code:t.getUint16(26),stdout:e.slice(28,28+r),stderr:e.slice(28+r,28+r+n),files:this.deserializeFiles(e,o,i)}}}var N=r(18);class I extends B{constructor(e){if(super(),this.TYPE=3,this.files={},e){const{files:t}=e instanceof Uint8Array?this.deserialize(e):e;this.files=t}}getAttributes(){return{files:this.files}}serialize(e="undefined"!=typeof SharedArrayBuffer){const t=this.getFilesSerializedLength(this.files),r=10+t,n=e?new SharedArrayBuffer(r):new ArrayBuffer(r),i=new Uint8Array(n),o=new A(i.buffer);return o.setUint8(0,this.VERSION),o.setUint8(1,this.TYPE),o.setBigUint64(2,BigInt(t)),this.serializeFilesIntoByteArray(this.files,i,10),i}deserialize(e){const t=new A(e.buffer,e.byteOffset,e.byteLength);this.assertVersionAndType(t);let r=2;const n=Number(t.getBigUint64(r));r+=8;return{files:this.deserializeFiles(e,r,n)}}}class x extends B{constructor(e){super(),this.TYPE=1;const{files:t,stdin:r,parameters:n}=e instanceof Uint8Array?this.deserialize(e):e;this.files=t,this.stdin=r,this.parameters=n}getAttributes(){return{files:this.files,parameters:this.parameters,stdin:this.stdin}}addSourceFiles(e,t){const r=new I(e);r.applyFilesMappings(t,this.parameters);for(const e in r.files)this.files[e]||(this.files[e]=r.files[e])}serialize(){const e=[];let t=0;for(const r of this.parameters){const n=this.textEncoder.encode(r),i=new Uint8Array(2+n.length);new A(i.buffer).setUint16(0,n.length),i.set(n,2),t+=i.length,e.push(i)}const r=this.getFilesSerializedLength(this.files),n=22+this.stdin.length+t+r,i=new Uint8Array(n),o=new A(i.buffer);o.setUint8(0,this.VERSION),o.setUint8(1,this.TYPE),o.setBigUint64(2,BigInt(this.stdin.length)),o.setUint32(10,t),o.setBigUint64(14,BigInt(r)),i.set(this.stdin,22);let s=22+this.stdin.length;for(const t of e)i.set(t,s),s+=t.length;const a=22+this.stdin.length+t;return this.serializeFilesIntoByteArray(this.files,i,a),i}deserialize(e){const t=new A(e.buffer,e.byteOffset,e.byteLength);this.assertVersionAndType(t);let r=2;const n=Number(t.getBigUint64(r));r+=8;const i=t.getUint32(r);r+=4;const o=Number(t.getBigUint64(r));r+=8;const s=e.slice(r,r+n);r+=n;const a=[],u=r+i;for(;r<u;){const n=t.getUint16(r);r+=2;const i=this.textDecoder.decode(e.slice(r,r+n));a.push(i),r+=n}return{stdin:s,parameters:a,files:this.deserializeFiles(e,r,o)}}}var M=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class R{static analyzeWasm(e,t,r){return M(this,void 0,void 0,(function*(){const{module:n,job:i}=t,o=i.app_version.public_id;let s;const a=this.appVersionIdToModuleNameToWasmAnalysis[o];if(a&&a[n.name])s=a[n.name];else{let t;r("Analyzing Wasm binary");try{const r=yield this.biolibAnalyzerFileCache.getFileFromUrl(c.wasmAnalyzerUrl,"uint8array");yield this.rustWasm.init(r),t=yield this.rustWasm.analyze_wasm(e)}catch(e){throw l.chainErrors("Failed to analyze Wasm binary",e)}try{const e=this.textDecoder.decode(t);s=JSON.parse(e)}catch(e){throw l.chainErrors("Failed to parse result from Wasm analyzer",e)}a?this.appVersionIdToModuleNameToWasmAnalysis[o][n.name]=s:this.appVersionIdToModuleNameToWasmAnalysis[o]={[n.name]:s},r("Analysis of binary complete, executing compute job")}return s}))}}R.appVersionIdToModuleNameToWasmAnalysis={},R.biolibAnalyzerFileCache=new _("biolib-wasm-analyzer",c.biolibAnalyzerVersion),R.rustWasm=new h,R.textDecoder=new TextDecoder("utf-8",{fatal:!0});var D=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};(new class extends class{constructor(){this.textDecoder=new TextDecoder("utf8",{fatal:!0}),this.callModuleSubject=new m.Subject,this.remoteRequestSubject=new m.Subject,this.statusUpdateSubject=new m.Subject,this.sleepSubject=new m.Subject,this.appVersionIdToModuleSourceRecord={},this.moduleMetadata=null,this.sharedInputMemory=null,this.sharedOutputMemory=null,this.callModuleAsyncResponseHandler=()=>{},this.baseMethodsToExpose={callModuleObservable:()=>m.Observable.from(this.callModuleSubject),remoteRequestObservable:()=>m.Observable.from(this.remoteRequestSubject),sleepObservable:()=>m.Observable.from(this.sleepSubject),statusUpdateObservable:()=>m.Observable.from(this.statusUpdateSubject),callModuleAsyncResponse:e=>this.callModuleAsyncResponseHandler(e)},this.logMessage=e=>this.statusUpdateSubject.next({message:e}),this.setProgressCompute=e=>this.statusUpdateSubject.next({progressCompute:e}),this.setProgressInitialization=e=>this.statusUpdateSubject.next({progressInitialization:e})}expose(){Object(N.expose)(Object.assign(Object.assign({},this.baseMethodsToExpose),this.methodsExposedToParent))}getSharedOutputMemory(){return this.sharedOutputMemory||(this.sharedOutputMemory=v.checkAtomicsAndCreateSharedArray()),this.sharedOutputMemory}getSharedInputMemory(){return this.sharedInputMemory||(this.sharedInputMemory=v.checkAtomicsAndCreateSharedArray()),this.sharedInputMemory}sleep(e){const t=this.getSharedOutputMemory();try{this.sleepSubject.next({period:e,sharedMemory:t})}catch(e){throw l.chainErrors("Sleep failed",e)}v.blockAndReadSharedArrayBuffer(t)}handleRemoteRequest(e,t,r){if(!e)throw new l("Fetch remote host failed: Url was undefined");if("GET"!==t&&"POST"!==t)throw new l("Fetch remote host failed: HTTP method not supported");this.assertUrlHostIsAllowed(e);try{const n=this.getSharedOutputMemory();this.remoteRequestSubject.next({url:e,method:t,body:r,sharedMemory:n});const i=v.blockAndReadSharedArrayBuffer(n),o=new DataView(i.buffer,i.byteOffset,i.byteLength).getUint16(0),s=new Uint8Array(i.buffer,i.byteOffset+2,i.byteLength-2).slice(),a=this.textDecoder.decode(s);return this.logMessage(`Got response from url ${e}`),{status:o,responseText:a}}catch(e){throw l.chainErrors("Fetch remote host failed",e)}}callModuleBlocking(e,t){try{const{calleeModule:r,callerModule:n}=this.getCalleeAndCallerModules(e),i=this.getSharedOutputMemory(),o=this.getSharedInputMemory(),s=new x(t);s.filterOnFilesMappings(r.input_files_mappings,s.parameters);const a=s.serialize(),u=v.writeToSharedMemoryBuffer(a,o);this.callModuleSubject.next({calleeModule:r,moduleInputDataSerialized:u,outputSharedMemory:i});const f=v.blockAndReadSharedArrayBuffer(i);if(!f)throw new l("No result found");return this.logMessage(`Module ${n.name} got response from module ${e}`),new T(f)}catch(e){throw l.chainErrors("Call module blocking failed",e)}}deserializeInputApplyMappingsAndGetExecutableFile(e,t){const r=new x(t);if(!this.moduleMetadata)throw new l("Module metadata was undefined");const{job:n}=this.moduleMetadata;if(!this.appVersionIdToModuleSourceRecord[n.app_version.public_id]){const{moduleSourceSerialized:e}=this.moduleMetadata;if(!e)throw new l("Module source was undefined");this.appVersionIdToModuleSourceRecord[n.app_version.public_id]=new I(e)}const i=this.appVersionIdToModuleSourceRecord[n.app_version.public_id];r.applyFilesMappings(e.input_files_mappings,r.parameters),r.addSourceFiles(i,e.source_files_mappings);const o=(e.command.startsWith("/")?"":"/").concat(e.command),s=r.files[o];if(!s)throw new Error("Could not find executable file");return r.parameters.length>0?this.logMessage(`Running module '${e.name}' with arguments: ${JSON.stringify(r.parameters)}. Got ${r.stdin.length} bytes of stdin data.`):this.logMessage(`Running module '${e.name}' without arguments. Got ${r.stdin.length} bytes of stdin data.`),r.parameters.unshift(e.name),{moduleInput:r,executableFile:s}}serializeAndHandleOutput(e,t,r){if(!this.moduleMetadata)throw new l("Failed to serializing module output: Module metadata was undefined");const{module:n}=this.moduleMetadata,i=new T(t);i.filterOutUnchangedFiles(e.files),i.applyFilesMappings(n.output_files_mappings,e.parameters);const o=i.serialize();if(!r)return o;v.writeToSharedMemoryBuffer(o,r)}getCalleeAndCallerModules(e){if(!e||"string"!=typeof e)throw new l("Module name was not a string");if(!this.moduleMetadata)throw new l("Module metadata was undefined");const{job:t}=this.moduleMetadata;if(!t.app_version.modules)throw new l("No modules found");const r=t.app_version.modules.find((({name:t})=>t===e));if(!r)throw new l(`Could not find module with name: ${e}`);return{calleeModule:r,callerModule:this.moduleMetadata.module}}assertUrlHostIsAllowed(e){if(!this.moduleMetadata)throw new l("Checking URL host failed: Module metadata was undefined");const t=this.moduleMetadata.job.app_version.remote_hosts.reduce(((e,{hostname:t})=>[...e,t]),[]);if("https://"!==e.substr(0,8))throw new l(`Request musts use HTTPS: '${e}'`);{const r=e.slice(-(e.length-8)).split("/")[0];if(!t.includes(r)){let e=`Post to external data source failed: Requested host (${r}) is not in 'allowed' list. Allowed hosts are:`;for(const r of t)e=`${e}\n'${r}'`;throw new l(e)}}}}{constructor(){super(...arguments),this.textEncoder=new TextEncoder,this.biolibTensorFileCache=new _("biolib-tensor",c.biolibTensorVersion),this.biolibRFileCache=new _("biolib-r",c.biolibRVersion),this.temporaryFiles={},this.rustWasm=new h(this.callModuleBlockingRust.bind(this),this.logMessage.bind(this),this.setProgressCompute.bind(this)),this.methodsExposedToParent={runOnnxModule:this.runOnnxModule.bind(this),runRModule:this.runRModule.bind(this),runRustModule:this.runRustModule.bind(this),runTensorflowModule:this.runTensorflowModule.bind(this)}}runRustModule(e,t,r){return D(this,void 0,void 0,(function*(){this.moduleMetadata=e;const{module:n}=e;if(!n.command)throw new l(`Module ${n.name}: You must set command to the path of a Wasm binary file when using this Rust image`);if("/"!==n.working_directory)throw new l(`Module ${e.module.name}: This Rust image requires working_directory to be set to "/" - please set this under module settings`);const{moduleInput:i,executableFile:o}=this.deserializeInputApplyMappingsAndGetExecutableFile(e.module,t),s=yield R.analyzeWasm(o.data,e,this.logMessage.bind(this));if(null===s.second_element_offset)throw new l("Failed to get Wasm property: second_element_offset");yield this.rustWasm.init(o.data,s.second_element_offset);const a={stdout:yield this.rustWasm.compute(i.stdin,""),exit_code:0,files:{},stderr:new Uint8Array(0)};return this.serializeAndHandleOutput(i,a,r)}))}runRModule(e,t,r){return D(this,void 0,void 0,(function*(){this.moduleMetadata=e;const{module:n}=e;if(!n.command)throw new l(`Module ${n.name}: You must set command to the path of an R bytecode JSON file when using this R image`);if("/"!==n.working_directory)throw new l(`Module ${n.name}: This R image requires working_directory to be set to "/" - please set this under module settings`);const{moduleInput:i,executableFile:o}=this.deserializeInputApplyMappingsAndGetExecutableFile(n,t);this.temporaryFiles=i.files;const s=yield this.biolibRFileCache.getFileFromUrl(c.wasmRExecutorUrl,"uint8array");yield this.rustWasm.init(s);const a=new Uint8Array(0),u=yield this.rustWasm.execute(o.data,i.stdin,a),f=(new TextDecoder).decode(u);let h;try{const e=JSON.parse(f),t=this.textEncoder.encode(e.stdout),r=this.textEncoder.encode(e.stderr);h={exit_code:e.exit_code?e.exit_code:0,stdout:t,stderr:r,files:{}}}catch(e){throw l.chainErrors(`Failed to decode result as JSON: ${f}`,e)}return this.serializeAndHandleOutput(i,h,r)}))}runOnnxModule(e,t,r){return D(this,void 0,void 0,(function*(){const{module:n}=e;if(!n.command)throw new l(`Module ${n.name}: You must set command to the path of an Onnx file when using this Onnx image`);if("/"!==n.working_directory)throw new l(`Module ${n.name}: This Onnx image requires working_directory to be set to "/" - please set this under module settings`);return this.runBioLibTensorModule("execute_onnx",e,t,r)}))}runTensorflowModule(e,t,r){return D(this,void 0,void 0,(function*(){const{module:n}=e;if(!n.command)throw new l(`Module ${n.name}: You must set command to the path of a Tensorflow frozen graph file when using this Tensorflow image`);if("/"!==n.working_directory)throw new l(`Module ${n.name}: This Tensorflow image requires working_directory to be set to "/" - please set this under module settings`);return this.runBioLibTensorModule("execute_tensorflow",e,t,r)}))}runBioLibTensorModule(e,t,r,n){return D(this,void 0,void 0,(function*(){this.moduleMetadata=t;const{moduleInput:i,executableFile:o}=this.deserializeInputApplyMappingsAndGetExecutableFile(t.module,r),s=yield this.biolibTensorFileCache.getFileFromUrl(c.wasmBioLibTensorUrl,"uint8array");yield this.rustWasm.init(s);const a={stdout:yield this.rustWasm[e](o.data,i.stdin),exit_code:0,files:{},stderr:new Uint8Array(0)};return this.serializeAndHandleOutput(i,a,n)}))}callModuleBlockingRust(e,t,r){const n={files:this.temporaryFiles,parameters:JSON.parse(r),stdin:(i=t,new Uint8Array(i.match(/.{1,2}/g).map((e=>parseInt(e,16)))))};var i;const o=this.callModuleBlocking(e,n);return JSON.stringify({stdout_hex:b(o.stdout),stderr_hex:b(o.stdout),exit_code:o.exit_code})}}).expose()},function(e,t,r){"use strict";r.r(t),r.d(t,"filter",(function(){return A})),r.d(t,"flatMap",(function(){return N})),r.d(t,"interval",(function(){return I})),r.d(t,"map",(function(){return M})),r.d(t,"merge",(function(){return R})),r.d(t,"multicast",(function(){return $})),r.d(t,"Observable",(function(){return E})),r.d(t,"scan",(function(){return P})),r.d(t,"Subject",(function(){return D})),r.d(t,"unsubscribe",(function(){return S}));var n=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class i{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then((()=>this._baseObserver.complete())).catch((e=>this._baseObserver.error(e)))}error(e){this._baseObserver.error(e)}schedule(e){const t=Promise.all(this._pendingPromises),r=[],i=e=>r.push(e),o=Promise.resolve().then((()=>n(this,void 0,void 0,(function*(){yield t,yield e(i),this._pendingPromises.delete(o);for(const e of r)this._baseObserver.next(e)})))).catch((e=>{this._pendingPromises.delete(o),this._baseObserver.error(e)}));this._pendingPromises.add(o)}}const o=()=>"function"==typeof Symbol,s=e=>o()&&Boolean(Symbol[e]),a=e=>s(e)?Symbol[e]:"@@"+e;s("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const u=a("iterator"),f=a("observable"),c=a("species");function l(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(e){let t=e.constructor;return void 0!==t&&(t=t[c],null===t&&(t=void 0)),void 0!==t?t:v}function d(e){d.log?d.log(e):setTimeout((()=>{throw e}),0)}function p(e){Promise.resolve().then((()=>{try{e()}catch(e){d(e)}}))}function g(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=l(t,"unsubscribe");e&&e.call(t)}}catch(e){d(e)}}function _(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function b(e,t,r){e._state="running";const n=e._observer;try{const i=n?l(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(_(e),!i)throw r;i.call(n,r);break;case"complete":_(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?g(e):"running"===e._state&&(e._state="ready")}function y(e,t,r){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void p((()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(b(e,r.type,r.value),"closed"===e._state)break}}(e)))):void b(e,t,r)}class m{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new w(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(_(this),g(this))}}class w{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){y(this._subscription,"next",e)}error(e){y(this._subscription,"error",e)}complete(){y(this._subscription,"complete")}}class v{constructor(e){if(!(this instanceof v))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,r){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new m(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n="object"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new v((e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}})))}forEach(e){return new Promise(((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}const i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})}))}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}})))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}})))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const r=h(this),n=arguments.length>1;let i=!1,o=t;return new r((t=>this.subscribe({next(r){const s=!i;if(i=!0,!s||n)try{o=e(o,r)}catch(e){return t.error(e)}else o=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(o),t.complete()}})))}concat(...e){const t=h(this);return new t((r=>{let n,i=0;return function o(s){n=s.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}}))}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=h(this);return new t((r=>{const n=[],i=this.subscribe({next(i){let s;if(e)try{s=e(i)}catch(e){return r.error(e)}else s=i;const a=t.from(s).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(a);e>=0&&n.splice(e,1),o()}});n.push(a)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach((e=>e.unsubscribe())),i.unsubscribe()}}))}[f](){return this}static from(e){const t="function"==typeof this?this:v;if(null==e)throw new TypeError(e+" is not an object");const r=l(e,f);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof v}(n)&&n.constructor===t?n:new t((e=>n.subscribe(e)))}if(s("iterator")){const r=l(e,u);if(r)return new t((t=>{p((()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}}))}))}if(Array.isArray(e))return new t((t=>{p((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}));throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:v)((t=>{p((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}))}static get[c](){return this}}o()&&Object.defineProperty(v,Symbol("extensions"),{value:{symbol:f,hostReportError:d},configurable:!0});var E=v;var S=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()},O=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}u((n=n.apply(e,t||[])).next())}))};var A=function(e){return t=>new E((r=>{const n=new i(r),o=t.subscribe({complete(){n.complete()},error(e){n.error(e)},next(t){n.schedule((r=>O(this,void 0,void 0,(function*(){(yield e(t))&&r(t)}))))}});return()=>S(o)}))};var B=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}u((n=n.apply(e,t||[])).next())}))},T=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}};var N=function(e){return t=>new E((r=>{const n=new i(r),o=t.subscribe({complete(){n.complete()},error(e){n.error(e)},next(t){n.schedule((r=>B(this,void 0,void 0,(function*(){var n,i;const o=yield e(t);if((f=o)&&s("iterator")&&f[Symbol.iterator]||function(e){return e&&s("asyncIterator")&&e[Symbol.asyncIterator]}(o))try{for(var a,u=T(o);!(a=yield u.next()).done;){const e=a.value;r(e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=u.return)&&(yield i.call(u))}finally{if(n)throw n.error}}else o.map((e=>r(e)));var f}))))}});return()=>S(o)}))};function I(e){return new v((t=>{let r=0;const n=setInterval((()=>{t.next(r++)}),e);return()=>clearInterval(n)}))}var x=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}u((n=n.apply(e,t||[])).next())}))};var M=function(e){return t=>new E((r=>{const n=new i(r),o=t.subscribe({complete(){n.complete()},error(e){n.error(e)},next(t){n.schedule((r=>x(this,void 0,void 0,(function*(){const n=yield e(t);r(n)}))))}});return()=>S(o)}))};var R=function(...e){return 0===e.length?v.from([]):new v((t=>{let r=0;const n=e.map((n=>n.subscribe({error(e){t.error(e),i()},next(e){t.next(e)},complete(){++r===e.length&&(t.complete(),i())}}))),i=()=>{n.forEach((e=>S(e)))};return i}))};var D=class extends E{constructor(){super((e=>(this._observers.add(e),()=>this._observers.delete(e)))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}};var $=function(e){const t=new D;let r,n=0;return new E((i=>{r||(r=e.subscribe(t));const o=t.subscribe(i);return n++,()=>{n--,o.unsubscribe(),0===n&&(S(r),r=void 0)}}))},U=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(s,a)}u((n=n.apply(e,t||[])).next())}))};var P=function(e,t){return r=>new E((n=>{let o,s=0;const a=new i(n),u=r.subscribe({complete(){a.complete()},error(e){a.error(e)},next(r){a.schedule((n=>U(this,void 0,void 0,(function*(){const i=0===s?void 0===t?r:t:o;o=yield e(i,r,s++),n(o)}))))}});return()=>S(u)}))}}]);
|