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=49)}([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 l(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:l,isStream:function(e){return a(e)&&l(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(37),i=r(38),o=r(39);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 f(this,e)}return l(this,e,t,r)}function l(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=d(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|h(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):d(e,t);if("Buffer"===t.type&&o(t.data))return d(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 f(e,t){if(c(t),e=a(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|h(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(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 z(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 z(e).length;t=(""+t).toLowerCase(),n=!0}}function _(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 N(this,t,r);case"ascii":return O(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 D(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(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:m(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):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(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 l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(l(e,o)===l(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 f=!0,d=0;d<u;d++)if(l(e,o+d)!==l(t,d)){f=!1;break}if(f)return o}return-1}function b(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(z(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 B(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 N(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,l=e[i],c=null,f=l>239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<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&l)<<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&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}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 l(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 f(null,e)},u.allocUnsafeSlow=function(e){return f(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)y(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)y(this,t,t+3),y(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)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?N(this,0,e):_.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),l=this.slice(n,i),c=e.slice(t,r),f=0;f<a;++f)if(l[f]!==c[f]){o=l[f],s=c[f];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 g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(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 b(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 B(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 O(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 D(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 P(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 M(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 $(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 U(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 k(e,t,r,n,o){return o||U(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function C(e,t,r,n,o){return o||U(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)||P(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)||P(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||P(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||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(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):$(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(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):$(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);P(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);P(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||P(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||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(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):$(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(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):$(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return k(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:z(new u(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(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(j,"")).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(48)},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=l(e,(0|e)<0?-1:0,!0),i&&(s[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=l(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function u(e,t){if(isNaN(e))return t?m:g;if(t){if(e<0)return m;if(e>=p)return S}else{if(e<=-_)return B;if(e+1>=_)return E}return e<0?u(-e,t).neg():l(e%h|0,e/h|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=a,n.fromNumber=u,n.fromBits=l;var c=Math.pow;function f(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;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 f(e.substring(1),t,r).neg();for(var i=u(c(r,8)),o=g,s=0;s<e.length;s+=8){var a=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+a),r);if(a<8){var d=u(c(r,a));o=o.mul(d).add(u(l))}else o=(o=o.mul(i)).add(u(l))}return o.unsigned=t,o}function d(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?f(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=f,n.fromValue=d;var h=4294967296,p=h*h,_=p/2,y=a(1<<24),g=a(0);n.ZERO=g;var m=a(0,!0);n.UZERO=m;var b=a(1);n.ONE=b;var w=a(1,!0);n.UONE=w;var v=a(-1);n.NEG_ONE=v;var E=l(-1,2147483647,!1);n.MAX_VALUE=E;var S=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var B=l(0,-2147483648,!1);n.MIN_VALUE=B;var A=n.prototype;A.toInt=function(){return this.unsigned?this.low>>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(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(B)){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),l=(o.sub(a.mul(i)).toInt()>>>0).toString(e);if((o=a).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+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(B)?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=d(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=d(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(B)?B:this.not().add(b)},A.neg=A.negate,A.add=function(e){i(e)||(e=d(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,f=0,h=0,p=0;return h+=(p+=o+(65535&e.low))>>>16,f+=(h+=n+u)>>>16,c+=(f+=r+a)>>>16,c+=t+s,l((h&=65535)<<16|(p&=65535),(c&=65535)<<16|(f&=65535),this.unsigned)},A.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},A.sub=A.subtract,A.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=d(e)),r)return l(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(B))return e.isOdd()?B:g;if(e.eq(B))return this.isOdd()?B:g;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(y)&&e.lt(y))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,f=e.low>>>16,h=65535&e.low,p=0,_=0,m=0,b=0;return m+=(b+=s*h)>>>16,_+=(m+=o*h)>>>16,m&=65535,_+=(m+=s*f)>>>16,p+=(_+=n*h)>>>16,_&=65535,p+=(_+=o*f)>>>16,_&=65535,p+=(_+=s*c)>>>16,p+=t*h+n*f+o*c+s*a,l((m&=65535)<<16|(b&=65535),(p&=65535)<<16|(_&=65535),this.unsigned)},A.mul=A.multiply,A.divide=function(e){if(i(e)||(e=d(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?l((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?m:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return w;o=m}else{if(this.eq(B))return e.eq(b)||e.eq(v)?B:e.eq(B)?b:(t=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:v:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(B))return this.unsigned?m:g;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=g}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),f=u(t),h=f.mul(e);h.isNegative()||h.gt(n);)h=(f=u(t-=a,this.unsigned)).mul(e);f.isZero()&&(f=b),o=o.add(f),n=n.sub(h)}return o},A.div=A.divide,A.modulo=function(e){return i(e)||(e=d(e)),r?l((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 l(~this.low,~this.high,this.unsigned)},A.and=function(e){return i(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},A.or=function(e){return i(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},A.xor=function(e){return i(e)||(e=d(e)),l(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?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(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?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(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?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:l(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(25),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,l=[],c=!1,f=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&h())}function h(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f<t;)u&&u[f].run();f=-1,t=l.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 _(){}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];l.push(new p(e,t)),1!==l.length||c||a(h)},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=_,i.addListener=_,i.once=_,i.off=_,i.removeListener=_,i.removeAllListeners=_,i.emit=_,i.prependListener=_,i.prependOnceListener=_,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(26),o=r(28),s=r(6),a=r(29),u=r(32),l=r(33),c=r(11);e.exports=function(e){return new Promise((function(t,r){var f=e.data,d=e.headers;n.isFormData(f)&&delete d["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(p+":"+_)}var y=a(e.baseURL,e.url);if(h.open(e.method.toUpperCase(),s(y,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h};i(t,r,o),h=null}},h.onabort=function(){h&&(r(c("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){r(c("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(c(t,e,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var g=(e.withCredentials||l(y))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;g&&(d[e.xsrfHeaderName]=g)}if("setRequestHeader"in h&&n.forEach(d,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete d[t]:h.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),r(e),h=null)})),f||(f=null),h.send(f)}))}},function(e,t,r){"use strict";var n=r(27);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 l(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,l),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),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return n.forEach(f,l),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(44);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(45);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(20)},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,l="",c=!1,f=["{","}"];(isArray(t)&&(c=!0,f=["[","]"]),isFunction(t))&&(l=" [Function"+(t.name?": "+t.name:"")+"]");return isRegExp(t)&&(l=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(l=" "+Date.prototype.toUTCString.call(t)),isError(t)&&(l=" "+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,l,f)):f[0]+l+f[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),l=n.multiply(o);return s=s.add(a.shiftRightUnsigned(32)),a=new long_1(a.getLowBits(),0).add(u).add(l.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:l=a.shiftLeft(32).add(new long_1(l.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,l=0,c=[0],f=0,d=0,h=0,p=0,_=0,y=0,g=[0,0],m=[0,0],b=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],B=w[4],A=w[5],N=w[6];B&&void 0===N&&invalidErr(e,"missing exponent power"),B&&void 0===S&&invalidErr(e,"missing exponent base"),void 0===B&&(A||N)&&invalidErr(e,"missing e before exponent")}if("+"!==e[b]&&"-"!==e[b]||(r="-"===e[b++]),!isDigit(e[b])&&"."!==e[b]){if("i"===e[b]||"I"===e[b])return new Decimal128(Buffer$2.from(r?INF_NEGATIVE_BUFFER:INF_POSITIVE_BUFFER));if("N"===e[b])return new Decimal128(Buffer$2.from(NAN_BUFFER))}for(;isDigit(e[b])||"."===e[b];)"."!==e[b]?(f<34&&("0"!==e[b]||i)&&(i||(l=s),i=!0,c[d++]=parseInt(e[b],10),f+=1),i&&(a+=1),n&&(u+=1),s+=1,b+=1):(n&&invalidErr(e,"contains multiple periods"),n=!0,b+=1);if(n&&!s)throw new TypeError(e+" not a valid Decimal128 string");if("e"===e[b]||"E"===e[b]){var T=e.substr(++b).match(EXPONENT_REGEX);if(!T||!T[2])return new Decimal128(Buffer$2.from(NAN_BUFFER));_=parseInt(T[0],10),b+=T[0].length}if(e[b])return new Decimal128(Buffer$2.from(NAN_BUFFER));if(h=0,f){if(p=f-1,1!==(o=a))for(;"0"===e[l+o-1];)o-=1}else h=0,p=0,c[0]=0,a=1,f=1,o=0;for(_<=u&&u-_>16384?_=EXPONENT_MIN:_-=u;_>EXPONENT_MAX;){if((p+=1)-h>MAX_DIGITS){if(c.join("").match(/^0+$/)){_=EXPONENT_MAX;break}invalidErr(e,"overflow")}_-=1}for(;_<EXPONENT_MIN||f<a;){if(0===p&&o<f){_=EXPONENT_MIN,o=0;break}if(f<a?a-=1:p-=1,_<EXPONENT_MAX)_+=1;else{if(c.join("").match(/^0+$/)){_=EXPONENT_MAX;break}invalidErr(e,"overflow")}}if(p-h+1<o){var O=s;n&&(l+=1,O+=1),r&&(l+=1,O+=1);var I=parseInt(e[l+p+1],10),x=0;if(I>=5&&(x=1,5===I))for(x=c[p]%2==1,y=l+p+2;y<O;y++)if(parseInt(e[y],10)){x=1;break}if(x)for(var D=p;D>=0;D--)if(++c[D]>9&&(c[D]=0,0===D)){if(!(_<EXPONENT_MAX))return new Decimal128(Buffer$2.from(r?INF_NEGATIVE_BUFFER:INF_POSITIVE_BUFFER));_+=1,c[D]=1}}if(g=long_1.fromNumber(0),m=long_1.fromNumber(0),0===o)g=long_1.fromNumber(0),m=long_1.fromNumber(0);else if(p-h<17){var R=h;for(m=long_1.fromNumber(c[R++]),g=new long_1(0,0);R<=p;R++)m=(m=m.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(c[R]))}else{var P=h;for(g=long_1.fromNumber(c[P++]);P<=p-17;P++)g=(g=g.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(c[P]));for(m=long_1.fromNumber(c[P++]);P<=p;P++)m=(m=m.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(c[P]))}var M=multiply64x2(g,long_1.fromString("100000000000000000"));M.low=M.low.add(m),lessThan(M.low,m)&&(M.high=M.high.add(long_1.fromNumber(1))),t=_+EXPONENT_BIAS;var $={low:long_1.fromNumber(0),high:long_1.fromNumber(0)};M.high.shiftRightUnsigned(49).and(long_1.fromNumber(1)).equals(long_1.fromNumber(1))?($.high=$.high.or(long_1.fromNumber(3).shiftLeft(61)),$.high=$.high.or(long_1.fromNumber(t).and(long_1.fromNumber(16383).shiftLeft(47))),$.high=$.high.or(M.high.and(long_1.fromNumber(0x7fffffffffff)))):($.high=$.high.or(long_1.fromNumber(16383&t).shiftLeft(49)),$.high=$.high.or(M.high.and(long_1.fromNumber(562949953421311)))),$.low=M.low,r&&($.high=$.high.or(long_1.fromString("9223372036854775808")));var U=Buffer$2.alloc(16);return b=0,U[b++]=255&$.low.low,U[b++]=$.low.low>>8&255,U[b++]=$.low.low>>16&255,U[b++]=$.low.low>>24&255,U[b++]=255&$.low.high,U[b++]=$.low.high>>8&255,U[b++]=$.low.high>>16&255,U[b++]=$.low.high>>24&255,U[b++]=255&$.high.low,U[b++]=$.high.low>>8&255,U[b++]=$.high.low>>16&255,U[b++]=$.high.low>>24&255,U[b++]=255&$.high.high,U[b++]=$.high.high>>8&255,U[b++]=$.high.high>>16&255,U[b++]=$.high.high>>24&255,new Decimal128(U)};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 l,c,f,d,h,p=0,_=!1,y={parts:new Array(4)},g=[];p=0;var m=this.bytes;if(n=m[p++]|m[p++]<<8|m[p++]<<16|m[p++]<<24,r=m[p++]|m[p++]<<8|m[p++]<<16|m[p++]<<24,t=m[p++]|m[p++]<<8|m[p++]<<16|m[p++]<<24,e=m[p++]|m[p++]<<8|m[p++]<<16|m[p++]<<24,p=0,{low:new long_1(n,r),high:new long_1(t,e)}.high.lessThan(long_1.ZERO)&&g.push("-"),(i=e>>26&COMBINATION_MASK)>>3==3){if(i===COMBINATION_INFINITY)return g.join("")+"Infinity";if(i===COMBINATION_NAN)return"NaN";o=e>>15&EXPONENT_MASK,f=8+(e>>14&1)}else f=e>>14&7,o=e>>17&EXPONENT_MASK;if(l=o-EXPONENT_BIAS,y.parts[0]=(16383&e)+((15&f)<<14),y.parts[1]=t,y.parts[2]=r,y.parts[3]=n,0===y.parts[0]&&0===y.parts[1]&&0===y.parts[2]&&0===y.parts[3])_=!0;else for(h=3;h>=0;h--){var b=0,w=divideu128(y);if(y=w.quotient,b=w.rem.low)for(d=8;d>=0;d--)a[9*h+d]=b%10,b=Math.floor(b/10)}if(_)s=1,a[p]=0;else for(s=36;!a[p];)s-=1,p+=1;if((c=s-1+l)>=34||c<=-7||l>0){if(s>34)return g.push(0),l>0?g.push("E+"+l):l<0&&g.push("E"+l),g.join("");g.push(a[p++]),(s-=1)&&g.push(".");for(var v=0;v<s;v++)g.push(a[p++]);g.push("E"),c>0?g.push("+"+c):g.push(c)}else if(l>=0)for(var E=0;E<s;E++)g.push(a[p++]);else{var S=s+l;if(S>0)for(var B=0;B<S;B++)g.push(a[p++]);else g.push("0");for(g.push(".");S++<0;)g.push("0");for(var A=0;A<s-Math.max(S-1,0);A++)g.push(a[p++])}return g.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 l=Object.assign({},r);return r.$scope&&(l.$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 f=Object.keys(c).filter((function(e){return e.startsWith("$")})),d=!0;if(f.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(d=!1)})),d)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,l=null!=r.raw&&r.raw,c="boolean"==typeof r.bsonRegExp&&r.bsonRegExp,f=null!=r.promoteBuffers&&r.promoteBuffers,d=null==r.promoteLongs||r.promoteLongs,h=null==r.promoteValues||r.promoteValues,p=t;if(e.length<5)throw new Error("corrupt bson message < 5 bytes long");var _=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(_<5||_>e.length)throw new Error("corrupt bson message");for(var y=n?[]:{},g=0;;){var m=e[t++];if(0===m)break;for(var b=t;0!==e[b]&&b<e.length;)b++;if(b>=Buffer$4.byteLength(e))throw new Error("Bad BSON Document: illegal CString");var w=n?g++:e.toString("utf8",t,b);if(t=b+1,m===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);y[w]=E,t+=v}else if(m===constants.BSON_DATA_OID){var S=Buffer$4.alloc(12);e.copy(S,0,t,t+12),y[w]=new objectid(S),t+=12}else if(m===constants.BSON_DATA_INT&&!1===h)y[w]=new int_32(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24);else if(m===constants.BSON_DATA_INT)y[w]=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;else if(m===constants.BSON_DATA_NUMBER&&!1===h)y[w]=new double_1(e.readDoubleLE(t)),t+=8;else if(m===constants.BSON_DATA_NUMBER)y[w]=e.readDoubleLE(t),t+=8;else if(m===constants.BSON_DATA_DATE){var B=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,A=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;y[w]=new Date(new long_1(B,A).toNumber())}else if(m===constants.BSON_DATA_BOOLEAN){if(0!==e[t]&&1!==e[t])throw new Error("illegal boolean type value");y[w]=1===e[t++]}else if(m===constants.BSON_DATA_OBJECT){var N=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");y[w]=l?e.slice(t,t+T):deserializeObject(e,N,r,!1),t+=T}else if(m===constants.BSON_DATA_ARRAY){var O=t,I=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,x=r,D=t+I;if(u&&u[w]){for(var R in x={},r)x[R]=r[R];x.raw=!0}if(y[w]=deserializeObject(e,O,x,!0),0!==e[(t+=I)-1])throw new Error("invalid array terminator byte");if(t!==D)throw new Error("corrupted array bson")}else if(m===constants.BSON_DATA_UNDEFINED)y[w]=void 0;else if(m===constants.BSON_DATA_NULL)y[w]=null;else if(m===constants.BSON_DATA_LONG){var P=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,M=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,$=new long_1(P,M);y[w]=d&&!0===h&&$.lessThanOrEqual(JS_INT_MAX_LONG)&&$.greaterThanOrEqual(JS_INT_MIN_LONG)?$.toNumber():$}else if(m===constants.BSON_DATA_DECIMAL128){var U=Buffer$4.alloc(16);e.copy(U,0,t,t+16),t+=16;var k=new decimal128(U);y[w]=k.toObject?k.toObject():k}else if(m===constants.BSON_DATA_BINARY){var C=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,j=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>j-4)throw new Error("Binary type with subtype 0x02 contains to long binary size");if(C<j-4)throw new Error("Binary type with subtype 0x02 contains to short binary size")}y[w]=f&&h?e.slice(t,t+C):new binary(e.slice(t,t+C),L)}else{var z="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>j-4)throw new Error("Binary type with subtype 0x02 contains to long binary size");if(C<j-4)throw new Error("Binary type with subtype 0x02 contains to short binary size")}for(b=0;b<C;b++)z[b]=e[t+b];y[w]=f&&h?z:new binary(z,L)}t+=C}else if(m===constants.BSON_DATA_REGEXP&&!1===c){for(b=t;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new Error("Bad BSON Document: illegal CString");var F=e.toString("utf8",t,b);for(b=t=b+1;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new Error("Bad BSON Document: illegal CString");var Y=e.toString("utf8",t,b);t=b+1;var q=new Array(Y.length);for(b=0;b<Y.length;b++)switch(Y[b]){case"m":q[b]="m";break;case"s":q[b]="g";break;case"i":q[b]="i"}y[w]=new RegExp(F,q.join(""))}else if(m===constants.BSON_DATA_REGEXP&&!0===c){for(b=t;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new Error("Bad BSON Document: illegal CString");var J=e.toString("utf8",t,b);for(b=t=b+1;0!==e[b]&&b<e.length;)b++;if(b>=e.length)throw new Error("Bad BSON Document: illegal CString");var W=e.toString("utf8",t,b);t=b+1,y[w]=new regexp(J,W)}else if(m===constants.BSON_DATA_SYMBOL){var X=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(X<=0||X>e.length-t||0!==e[t+X-1])throw new Error("bad string length in bson");y[w]=e.toString("utf8",t,t+X-1),t+=X}else if(m===constants.BSON_DATA_TIMESTAMP){var H=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,K=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;y[w]=new timestamp(H,K)}else if(m===constants.BSON_DATA_MIN_KEY)y[w]=new min_key;else if(m===constants.BSON_DATA_MAX_KEY)y[w]=new max_key;else if(m===constants.BSON_DATA_CODE){var G=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(G<=0||G>e.length-t||0!==e[t+G-1])throw new Error("bad string length in bson");var V=e.toString("utf8",t,t+G-1);if(i)if(o){var Z=s?a(V):V;y[w]=isolateEvalWithHash(functionCache,Z,V,y)}else y[w]=isolateEval(V);else y[w]=new code(V);t+=G}else if(m===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;y[w]=isolateEvalWithHash(functionCache,oe,te,y)}else y[w]=isolateEval(te);y[w].scope=ie}else y[w]=new code(te,ie)}else{if(m!==constants.BSON_DATA_DBPOINTER)throw new Error("Detected unknown BSON type "+m.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 le=new objectid(ue);t+=12,y[w]=new db_ref(ae,le)}}if(_!==t-p){if(n)throw new Error("corrupt array bson");throw new Error("corrupt object bson")}var ce=Object.keys(y).filter((function(e){return e.startsWith("$")})),fe=!0;if(ce.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(fe=!1)})),!fe)return y;if(null!=y.$id&&null!=y.$ref){var de=Object.assign({},y);return delete de.$ref,delete de.$id,delete de.$db,new db_ref(y.$ref,y.$id,y.$db||null,de)}return y}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,l=(1<<u)-1,c=l>>1,f=-7,d=a?0:i-1,h=a?1:-1,p=e[t+d];for(d+=h,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+e[t+d],d+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+d],d+=h,f-=8);if(0===o)o=1-c;else{if(o===l)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,l="big"===n,c=8*o-i-1,f=(1<<c)-1,d=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=l?o-1:0,_=l?-1:1,y=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=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=f?(a=0,s=f):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0)),isNaN(t)&&(a=0);i>=8;)e[r+p]=255&a,p+=_,a/=256,i-=8;for(s=s<<i|a,isNaN(t)&&(s+=8),c+=i;c>0;)e[r+p]=255&s,p+=_,s/=256,c-=8;e[r+p-_]|=128*y}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,l){for(var c=0;c<l.length;c++)if(l[c]===r)throw new Error("cyclic dependency detected");l.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 f=serializeInto(e,r,i,n,o+1,s,a,l);return l.pop(),f}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 l=n,c="string"==typeof r.code?r.code:r.code.toString();n+=4;var f=e.write(c,n+4,"utf8")+1;e[n]=255&f,e[n+1]=f>>8&255,e[n+2]=f>>16&255,e[n+3]=f>>24&255,e[n+4+f-1]=0,n=n+f+4;var d=serializeInto(e,r.scope,i,n,o+1,s,a);n=d-1;var h=d-l;e[l++]=255&h,e[l++]=h>>8&255,e[l++]=h>>16&255,e[l++]=h>>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(),_=e.write(p,n+4,"utf8")+1;e[n]=255&_,e[n+1]=_>>8&255,e[n+2]=_>>16&255,e[n+3]=_>>24&255,n=n+4+_-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,l={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(l.$db=r.db);var c=(a=serializeInto(e,l=Object.assign(l,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 l=0;l<t.length;l++){var c=""+l,f=t[l];if(f&&f.toBSON){if("function"!=typeof f.toBSON)throw new TypeError("toBSON is not a function");f=f.toBSON()}var d=_typeof$3(f);if("string"===d)u=serializeString(e,c,f,u,!0);else if("number"===d)u=serializeNumber(e,c,f,u,!0);else if("boolean"===d)u=serializeBoolean(e,c,f,u,!0);else if(f instanceof Date||isDate$1(f))u=serializeDate(e,c,f,u,!0);else if(void 0===f)u=serializeNull(e,c,f,u,!0);else if(null===f)u=serializeNull(e,c,f,u,!0);else if("ObjectId"===f._bsontype||"ObjectID"===f._bsontype)u=serializeObjectId(e,c,f,u,!0);else if(Buffer$5.isBuffer(f))u=serializeBuffer(e,c,f,u,!0);else if(f instanceof RegExp||isRegExp$1(f))u=serializeRegExp(e,c,f,u,!0);else if("object"===d&&null==f._bsontype)u=serializeObject(e,c,f,u,r,i,o,s,!0,a);else if("object"===d&&"Decimal128"===f._bsontype)u=serializeDecimal128(e,c,f,u,!0);else if("Long"===f._bsontype||"Timestamp"===f._bsontype)u=serializeLong(e,c,f,u,!0);else if("Double"===f._bsontype)u=serializeDouble(e,c,f,u,!0);else if("function"==typeof f&&o)u=serializeFunction(e,c,f,u,r,i,o,!0);else if("Code"===f._bsontype)u=serializeCode(e,c,f,u,r,i,o,s,!0);else if("Binary"===f._bsontype)u=serializeBinary(e,c,f,u,!0);else if("Symbol"===f._bsontype)u=serializeSymbol(e,c,f,u,!0);else if("DBRef"===f._bsontype)u=serializeDBRef(e,c,f,u,i,o,!0);else if("BSONRegExp"===f._bsontype)u=serializeBSONRegExp(e,c,f,u,!0);else if("Int32"===f._bsontype)u=serializeInt32(e,c,f,u,!0);else if("MinKey"===f._bsontype||"MaxKey"===f._bsontype)u=serializeMinMax(e,c,f,u,!0);else if(void 0!==f._bsontype)throw new TypeError("Unrecognized or invalid _bsontype: "+f._bsontype)}else if(t instanceof map)for(var h=t.entries(),p=!1;!p;){var _=h.next();if(!(p=_.done)){var y=_.value[0],g=_.value[1],m=_typeof$3(g);if("string"==typeof y&&!ignoreKeys.has(y)){if(null!=y.match(regexp$1))throw Error("key "+y+" must not contain null bytes");if(r){if("$"===y[0])throw Error("key "+y+" must not start with '$'");if(~y.indexOf("."))throw Error("key "+y+" must not contain '.'")}}if("string"===m)u=serializeString(e,y,g,u);else if("number"===m)u=serializeNumber(e,y,g,u);else if("boolean"===m)u=serializeBoolean(e,y,g,u);else if(g instanceof Date||isDate$1(g))u=serializeDate(e,y,g,u);else if(null===g||void 0===g&&!1===s)u=serializeNull(e,y,g,u);else if("ObjectId"===g._bsontype||"ObjectID"===g._bsontype)u=serializeObjectId(e,y,g,u);else if(Buffer$5.isBuffer(g))u=serializeBuffer(e,y,g,u);else if(g instanceof RegExp||isRegExp$1(g))u=serializeRegExp(e,y,g,u);else if("object"===m&&null==g._bsontype)u=serializeObject(e,y,g,u,r,i,o,s,!1,a);else if("object"===m&&"Decimal128"===g._bsontype)u=serializeDecimal128(e,y,g,u);else if("Long"===g._bsontype||"Timestamp"===g._bsontype)u=serializeLong(e,y,g,u);else if("Double"===g._bsontype)u=serializeDouble(e,y,g,u);else if("Code"===g._bsontype)u=serializeCode(e,y,g,u,r,i,o,s);else if("function"==typeof g&&o)u=serializeFunction(e,y,g,u,r,i,o);else if("Binary"===g._bsontype)u=serializeBinary(e,y,g,u);else if("Symbol"===g._bsontype)u=serializeSymbol(e,y,g,u);else if("DBRef"===g._bsontype)u=serializeDBRef(e,y,g,u,i,o);else if("BSONRegExp"===g._bsontype)u=serializeBSONRegExp(e,y,g,u);else if("Int32"===g._bsontype)u=serializeInt32(e,y,g,u);else if("MinKey"===g._bsontype||"MaxKey"===g._bsontype)u=serializeMinMax(e,y,g,u);else if(void 0!==g._bsontype)throw new TypeError("Unrecognized or invalid _bsontype: "+g._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 b in t){var w=t[b];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 b&&!ignoreKeys.has(b)){if(null!=b.match(regexp$1))throw Error("key "+b+" must not contain null bytes");if(r){if("$"===b[0])throw Error("key "+b+" must not start with '$'");if(~b.indexOf("."))throw Error("key "+b+" must not contain '.'")}}if("string"===v)u=serializeString(e,b,w,u);else if("number"===v)u=serializeNumber(e,b,w,u);else if("boolean"===v)u=serializeBoolean(e,b,w,u);else if(w instanceof Date||isDate$1(w))u=serializeDate(e,b,w,u);else if(void 0===w)!1===s&&(u=serializeNull(e,b,w,u));else if(null===w)u=serializeNull(e,b,w,u);else if("ObjectId"===w._bsontype||"ObjectID"===w._bsontype)u=serializeObjectId(e,b,w,u);else if(Buffer$5.isBuffer(w))u=serializeBuffer(e,b,w,u);else if(w instanceof RegExp||isRegExp$1(w))u=serializeRegExp(e,b,w,u);else if("object"===v&&null==w._bsontype)u=serializeObject(e,b,w,u,r,i,o,s,!1,a);else if("object"===v&&"Decimal128"===w._bsontype)u=serializeDecimal128(e,b,w,u);else if("Long"===w._bsontype||"Timestamp"===w._bsontype)u=serializeLong(e,b,w,u);else if("Double"===w._bsontype)u=serializeDouble(e,b,w,u);else if("Code"===w._bsontype)u=serializeCode(e,b,w,u,r,i,o,s);else if("function"==typeof w&&o)u=serializeFunction(e,b,w,u,r,i,o);else if("Binary"===w._bsontype)u=serializeBinary(e,b,w,u);else if("Symbol"===w._bsontype)u=serializeSymbol(e,b,w,u);else if("DBRef"===w._bsontype)u=serializeDBRef(e,b,w,u,i,o);else if("BSONRegExp"===w._bsontype)u=serializeBSONRegExp(e,b,w,u);else if("Int32"===w._bsontype)u=serializeInt32(e,b,w,u);else if("MinKey"===w._bsontype||"MaxKey"===w._bsontype)u=serializeMinMax(e,b,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(40)},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,r){"use strict";var n=r(0),i=r(5),o=r(21),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(34),u.isCancel=r(7),u.all=function(e){return Promise.all(e)},u.spread=r(35),u.isAxiosError=r(36),e.exports=u,e.exports.default=u},function(e,t,r){"use strict";var n=r(0),i=r(6),o=r(22),s=r(23),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(24),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(30),i=r(31);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=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=l(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,f=a>0?s-4:s;for(r=0;r<f;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 l(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,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=l}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?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=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+h]=255&s,h+=p,s/=256,l-=8);e[r+h-p]|=128*_}},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(41)),s=r(14),a=r(15),u=r(46),l=i(r(47));var c=r(14);t.registerSerializer=c.registerSerializer;var f=r(15);t.Transfer=f.Transfer;let d=!1;const h=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 _(e){return a.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function y(e,t){const{payload:r,transferables:n}=_(t),i={type:u.WorkerMessageType.error,uid:e,error:s.serialize(r)};l.default.postMessageToMaster(i,n)}function g(e,t,r){const{payload:n,transferables:i}=_(r),o={type:u.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};l.default.postMessageToMaster(o,i)}function m(e){const t={type:u.WorkerMessageType.uncaughtError,error:s.serialize(e)};l.default.postMessageToMaster(t)}function b(e,t,r){return n(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return y(e,t)}const i=p(n)?"observable":"promise";if(function(e,t){const r={type:u.WorkerMessageType.running,uid:e,resultType:t};l.default.postMessageToMaster(r)}(e,i),p(n))n.subscribe((t=>g(e,!1,s.serialize(t))),(t=>y(e,s.serialize(t))),(()=>g(e,!0)));else try{const t=yield n;g(e,!0,s.serialize(t))}catch(t){y(e,s.serialize(t))}}))}t.expose=function(e){if(!l.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(d)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(d=!0,"function"==typeof e)l.default.subscribeToMasterMessages((t=>{h(t)&&!t.method&&b(t.uid,e,t.args.map(s.deserialize))})),function(){const e={type:u.WorkerMessageType.init,exposed:{type:"function"}};l.default.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${e}`);l.default.subscribeToMasterMessages((t=>{h(t)&&t.method&&b(t.uid,e[t.method],t.args.map(s.deserialize))}));!function(e){const t={type:u.WorkerMessageType.init,exposed:{type:"module",methods:e}};l.default.postMessageToMaster(t)}(Object.keys(e).filter((t=>"function"==typeof e[t])))}},"undefined"!=typeof self&&"function"==typeof self.addEventListener&&l.default.isWorkerRuntime()&&(self.addEventListener("error",(e=>{setTimeout((()=>m(e.error||e)),250)})),self.addEventListener("unhandledrejection",(e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout((()=>m(t)),250)}))),void 0!==e&&"function"==typeof e.on&&l.default.isWorkerRuntime()&&(e.on("uncaughtException",(e=>{setTimeout((()=>m(e)),250)})),e.on("unhandledRejection",(e=>{e&&"string"==typeof e.message&&setTimeout((()=>m(e)),250)})))}).call(this,r(9))},function(e,t,r){"use strict";const n=r(42).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(43)(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(50);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",l="0.1.60";var c={isDev:!1,pythonExecutorVersion:s,biolibAnalyzerVersion:a,biolibRVersion:u,biolibTensorVersion:l,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`},f=r(16),d=r.n(f),h=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 p{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)=>h(this,void 0,void 0,(function*(){for(let i=0;i<this.fetchRetryAttempts;i+=1)try{const n=yield d.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)=>h(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)=>h(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=>h(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=>h(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)=>h(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)}}))))}}var _="\n\n__name__ = \"__main__\"\n\nfrom js import BioLib\n\nimport sys\nimport io\nimport os\nimport subprocess\nimport time\n\n# set working directory according to the module's settings\nif BioLib.working_directory != '/':\n os.makedirs(BioLib.working_directory, exist_ok=True)\n\nos.chdir(BioLib.working_directory)\n\n# try to resolve imports on-the-fly that are located in the working directory\n# this is typically used if an app imports local python files\nsys.path.insert(0, BioLib.working_directory)\nsys.path.insert(1, '/libs-mocked/')\n\n# re-wire stdin/stdout/stderr to local variables\nsys.stdin = io.StringIO(str(BioLib.input_data, 'utf-8'))\nsys.stdout = io.StringIO()\nsys.stderr = io.StringIO()\n\n\ndef mock_time_sleep(period_seconds):\n period_milliseconds = int(period_seconds * 1000)\n BioLib.mock_time_sleep(period_milliseconds) \n \ntime.sleep = mock_time_sleep\n\nclass Popen_mock(object):\n def __init__(self, args, bufsize=-1, executable=None,\n stdin=None, stdout=None, stderr=None,\n preexec_fn=None, close_fds=True,\n shell=False, cwd=None, env=None, universal_newlines=None,\n startupinfo=None, creationflags=0,\n restore_signals=True, start_new_session=False,\n pass_fds=(), *, encoding=None, errors=None, text=None):\n if isinstance(args, str):\n args = list(filter(lambda p: p != \"\", args.split(\" \")))\n if executable is None:\n executable = args[0]\n args_without_executable = args[1:]\n self.executable = executable\n self.stdout = stdout\n self.stderr = stderr\n self.args = args_without_executable\n self.returncode = None\n \n def handle_stream(self, stream, content):\n \"\"\"\n stream: self.stdout or self.stderr\n content: The child process' stdout or stderr (in bytes)\n Function for handling where to write the stdout and stderr streams.\n \"\"\"\n if stream == subprocess.DEVNULL:\n pass\n \n # If stream is a filehandle trying to write bytes\n elif isinstance(stream, io.BufferedWriter):\n stream.write(content)\n stream.close()\n \n # If stream is a filehandle trying to write a string \n elif isinstance(stream, io.TextIOWrapper):\n stream.write(str(content, 'utf-8'))\n stream.close()\n\n else:\n raise Exception(\"Invalid type passed to stdout or stderr arg of subprocess. Passing a filehandle or DEVNULL, PIPE is currently not supported on Biolib\")\n \n\n def communicate(self, stdin):\n data = BioLib.call_module(self.executable, self.args, stdin)\n self.returncode = data.exit_code\n \n # If a destination for stdout has been passed \n if self.stdout:\n self.handle_stream(self.stdout, data.stdout)\n # Don't return stdout if we reroute it to somewhere else\n data.stdout = b''\n \n if self.stderr:\n self.handle_stream(self.stderr, data.stderr)\n # Don't return stderr if we reroute it to somewhere else\n data.stderr = b'' \n \n return bytes(data.stdout), bytes(data.stderr)\n\n def wait(self):\n self.communicate(\"\")\n return self.returncode\n \n def poll(self):\n return self.returncode\n \nclass CompletedProcess_mock(object):\n def __init__(self, args, returncode, stdout=None, stderr=None):\n self.args = args\n self.returncode = returncode\n self.stdout = stdout\n self.stderr = stderr\n \nclass CalledProcessError_mock(subprocess.SubprocessError):\n def __init__(self, returncode, cmd, output=None, stderr=None):\n self.returncode = returncode\n self.cmd = cmd\n self.output = output\n self.stderr = stderr\n\ndef subprocess_check_call_mock(args, stdout=None, stderr=None):\n retcode = subprocess_call_mock(args, stdout, stderr)\n if retcode:\n raise CalledProcessError_mock(retcode, args)\n return 0\n\ndef subprocess_call_mock(args, stdout=None, stderr=None):\n return subprocess.Popen(args, stdout=stdout, stderr=stderr).wait()\n \ndef subprocess_run_mock(args, input=None, stdout=None, stderr=None):\n process = subprocess.Popen(args, stdout=stdout, stderr=stderr)\n stdout, stderr = process.communicate(input)\n return_code = process.poll()\n return CompletedProcess_mock(process.args, return_code, stdout, stderr)\n\nsubprocess.Popen = Popen_mock\nsubprocess.check_call = subprocess_check_call_mock\nsubprocess.call = subprocess_call_mock\nsubprocess.run = subprocess_run_mock\n\ndef system_mock(cmd):\n return subprocess.call(cmd)\n\nos.system = system_mock\n\nclass DomMock():\n id = ''\n\n @staticmethod\n def appendChild(test):\n return ''\n\n\nclass DocumentMock:\n @staticmethod\n def createElement(test):\n return DomMock\n\n @staticmethod\n def createTextNode(test):\n return DomMock\n\n @staticmethod\n def getElementById(test):\n return DomMock\n\n\nclass WindowMock:\n @staticmethod\n def setTimeout(testA, testB):\n return ''\n\nclass ImageDataMock:\n @staticmethod\n def createElement(test):\n return DomMock\n\n\n# Disable calling any JavaScript functions\nclass JsMock():\n document = DocumentMock\n window = WindowMock\n ImageData = ImageDataMock\n BioLib = BioLib\n\n\nsys.setrecursionlimit(1000)\nsys.modules['js'] = JsMock\n\ndef call_module(module_name, arguments, stdin):\n\n if not isinstance(module_name, str):\n raise Exception(f'Expected module_name to be a string but got: {type(module_name)}')\n\n if isinstance(arguments, str):\n arguments = list(filter(lambda p: p != \"\", arguments.split(\" \")))\n\n if not stdin:\n stdin = b''\n\n if not (isinstance(stdin, str) or isinstance(stdin, memoryview) or isinstance(stdin, bytes)):\n raise Exception(f'Expected stdin to be string, bytes, or memoryview but got: {type(stdin)}')\n\n return BioLib.call_module_blocking(module_name, arguments, stdin)\n\nBioLib.call_module = call_module\n\n# Support old syntax, but ignore files and is_blocking\ndef call_task(task_name, stdin, arguments, files, is_blocking):\n output = BioLib.call_module(task_name, arguments, stdin)\n output['exitcode'] = output['exit_code']\n return output\n\nBioLib.call_task = call_task\n\ndef biolib_log(object_to_log):\n BioLib.notification_message(str(object_to_log))\n\nBioLib.log = biolib_log\n\n# this allows argparse to correctly parse the input parameters\nsys.argv = list(BioLib.input_parameters)\n\n";function y(e){let t,r;if(e.endsWith("/"))t=e,r="";else{const n=e.split("/");r=n.pop()||"",t=n.join("/").concat("/")}return{name:r,pathWithoutFilename:t}}function g(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}class m 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 m(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}}const b=/\$(?<argIndex>\d+)/g;function w(e,t){if(!e.startsWith("/"))throw new m(`Attempted to copy ${t} path ${e}. But only absolute paths are supported`);if(e.includes("//"))throw new m(`Attempted to copy ${t} path ${e}. But encountered consecutive slashes in path`);if(e.includes("/.."))throw new m(`Attempted to copy ${t} path ${e}. But encountered unsupported /.. path`)}function v(e,t,r,n,i){const o={},s=(e=>(...t)=>{const{argIndex:r}=t[t.length-1];if(0===r)throw new m("Attempted to copy using argument reference $0 which is invalid");if(r>e.length)throw new m("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(b,s);w(e,"from");const a=t.to_path.replace(b,s);w(a,"to");const u=e.endsWith("/"),l=a.endsWith("/");if(u){if(!l)throw new m(`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&&l){const t=e.split("/").pop();t&&(r=r.concat(t))}o[r]=t}else{if(!n(e.concat("/")).next().done)throw new m(`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 E{static copyFilesAndOverwrite(e,t){try{for(const r in t){const n=t[r],{pathWithoutFilename:i}=y(r),o=i.split("/");let s="/";for(const t of o){if(""===t)continue;let r=!1;const n=e.readdir(s);for(const e of n)if(t===e){r=!0;break}if(s=s.concat(t),r){const t=e.stat(s,!0);if(e.isFile(t.mode))throw new m("Attempted to place folder on top of existing file when copying files")}else e.mkdir(s);s=s.concat("/")}r.endsWith("/")||e.writeFile(r,n.data)}}catch(e){throw m.chainErrors("Failed to copy files to Emscripten FS",e)}}static getFilesFromFS(e,t,r=[],n){return v(t,n,(function(t){try{return{data:e.readFile(t)}}catch(e){if(2===e.errno)return null;throw e}}),(function*t(n){let i=[];try{i=e.readdir(n)}catch(e){if(2===e.errno)return;throw e}if(2===i.length&&i.includes(".")&&i.includes(".."))yield{path:n,file:{data:new Uint8Array(0)}};else for(const o of i){const i=n.concat(o);if(!r.some((e=>i.startsWith(e)))&&".."!==o&&"."!==o)try{const r=e.stat(i,!0);if(e.isFile(r.mode)){const t=e.readFile(i);yield{path:i,file:{data:t}}}else e.isDir(r.mode)&&(yield*t(i.concat("/")))}catch(e){console.debug(`Could not stat "${i}" skipping file`)}}}),!1)}}const S=["atomicwrites","attrs","beautifulsoup4","biopython","bleach","cycler","decorator","distlib","docutils","html5lib","Jinja2","joblib","kiwisolver","MarkupSafe","matplotlib","mne","more-itertools","mpmath","networkx","nltk","nose","numpy","pandas","Pillow","pluggy","py","Pygments","pyparsing","pytest","python-dateutil","pytz","scikit-image","scikit-learn","scipy","seaborn","setuptools","soupsieve","statsmodels","sympy","webencodings","xlrd","requests"],B=["__future__","__main__","_dummy_thread","_thread","abc","aifc","argparse","array","ast","asynchat","asyncio","asyncore","atexit","audioop","base64","bdb","binascii","binhex","bisect","builtins","bz2","cProfile","calendar","cgi","cgitb","chunk","cmath","cmd","code","codecs","codeop","collections","collections.abc","colorsys","compileall","concurrent.futures","configparser","contextlib","contextvars","copy","copyreg","crypt","csv","ctypes","curses","curses.ascii","curses.panel","curses.textpad","dataclasses","datetime","dbm","dbm.dumb","dbm.gnu","dbm.ndbm","decimal","difflib","dis","distutils","distutils.archive_util","distutils.bcppcompiler","distutils.ccompiler","distutils.cmd","distutils.command","distutils.command.bdist","distutils.command.bdist_dumb","distutils.command.bdist_msi","distutils.command.bdist_packager","distutils.command.bdist_rpm","distutils.command.bdist_wininst","distutils.command.build","distutils.command.build_clib","distutils.command.build_ext","distutils.command.build_py","distutils.command.build_scripts","distutils.command.check","distutils.command.clean","distutils.command.config","distutils.command.install","distutils.command.install_data","distutils.command.install_headers","distutils.command.install_lib","distutils.command.install_scripts","distutils.command.register","distutils.command.sdist","distutils.core","distutils.cygwinccompiler","distutils.debug","distutils.dep_util","distutils.dir_util","distutils.dist","distutils.errors","distutils.extension","distutils.fancy_getopt","distutils.file_util","distutils.filelist","distutils.log","distutils.msvccompiler","distutils.spawn","distutils.sysconfig","distutils.text_file","distutils.unixccompiler","distutils.util","distutils.version","doctest","dummy_threading","email","email.charset","email.contentmanager","email.encoders","email.errors","email.generator","email.header","email.headerregistry","email.iterators","email.message","email.mime","email.parser","email.policy","email.utils","encodings.idna","encodings.mbcs","encodings.utf_8_sig","ensurepip","enum","errno","faulthandler","fcntl","filecmp","fileinput","fnmatch","formatter","fractions","ftplib","functools","gc","getopt","getpass","gettext","glob","grp","gzip","hashlib","heapq","hmac","html","html.entities","html.parser","http","http.client","http.cookiejar","http.cookies","http.server","imaplib","imghdr","imp","importlib","importlib.abc","importlib.machinery","importlib.resources","importlib.util","inspect","io","ipaddress","itertools","json","json.tool","keyword","lib2to3","linecache","locale","logging","logging.config","logging.handlers","lzma","macpath","mailbox","mailcap","marshal","math","mimetypes","mmap","modulefinder","msilib","msvcrt","multiprocessing","multiprocessing.connection","multiprocessing.dummy","multiprocessing.managers","multiprocessing.pool","multiprocessing.sharedctypes","netrc","nis","nntplib","numbers","operator","optparse","os","os.path","ossaudiodev","parser","pathlib","pdb","pickle","pickletools","pipes","pkgutil","platform","plistlib","poplib","posix","pprint","profile","pstats","pty","pwd","py_compile","pyclbr","pydoc","queue","quopri","random","re","readline","reprlib","resource","rlcompleter","runpy","sched","secrets","select","selectors","shelve","shlex","shutil","signal","site","smtpd","smtplib","sndhdr","socket","socketserver","spwd","sqlite3","ssl","stat","statistics","string","stringprep","struct","subprocess","sunau","symbol","symtable","sys","sysconfig","syslog","tabnanny","tarfile","telnetlib","tempfile","termios","test","test.support","test.support.script_helper","textwrap","threading","time","timeit","tkinter","tkinter.scrolledtext","tkinter.tix","tkinter.ttk","token","tokenize","trace","traceback","tracemalloc","tty","turtle","turtledemo","types","typing","unicodedata","unittest","unittest.mock","urllib","urllib.error","urllib.parse","urllib.request","urllib.response","urllib.robotparser","uu","uuid","venv","warnings","wave","weakref","webbrowser","winreg","winsound","wsgiref","wsgiref.handlers","wsgiref.headers","wsgiref.simple_server","wsgiref.util","wsgiref.validate","xdrlib","xml","xml.dom","xml.dom.minidom","xml.dom.pulldom","xml.etree.ElementTree","xml.parsers.expat","xml.parsers.expat.errors","xml.parsers.expat.model","xml.sax","xml.sax.handler","xml.sax.saxutils","xml.sax.xmlreader","xmlrpc.client","xmlrpc.server","zipapp","zipfile","zipimport","zlib"];var A=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())}))};self.Module={};class N{constructor(){this.extraPackagesToLoad=[],this.loadedPackageData={},this.loadedPackageNames=[],this.textDecoder=new TextDecoder,this.fileCache=new p("python-executor",c.pythonExecutorVersion)}getEmscriptenFs(){return self.pyodide._module.FS}execute(e){return new Promise(((t,r)=>A(this,void 0,void 0,(function*(){try{const{set_initialization_progress:r,module:n,moduleInput:i}=e.private,{notification_message:o}=e.public;r(1),o("Loading Python Interpreter"),self.BioLib=e.public;const s=this.textDecoder.decode(e.private.code);yield this.loadPyodide();const{packageNames:a}=this.analyzeImports(i.files,_);let u=a;for(;this.extraPackagesToLoad.length>0;){const e=this.extraPackagesToLoad.pop();e&&!u.includes(e)&&u.push(e)}const l=u.includes("requests");l&&(u=u.filter((e=>"requests"!==e))),yield this.loadPackages(u,r,o),r(98),yield self.pyodide.runPython('\n\nfrom urllib.request import AbstractHTTPHandler, build_opener, install_opener\nimport io\n\nclass UrllibResponseMock(io.BufferedIOBase):\n def __init__(self, msg):\n self.code = 200\n self.msg = msg\n\n def info(self):\n return ""\n\n def readable(self):\n return True\n\n def read(self, amt=None):\n if not self.msg:\n return b""\n res = bytes(self.msg, encoding="utf-8")\n self.msg = None\n return res\n\nclass HTTPSHandler(AbstractHTTPHandler):\n\n def __init__(self, debuglevel=0, context=None, check_hostname=None):\n AbstractHTTPHandler.__init__(self, debuglevel)\n\n def https_open(self, req):\n data = BioLib.request(req.full_url, "GET")\n return UrllibResponseMock(data.responseText)\n\ninstall_opener(build_opener(HTTPSHandler()))\n\n'),l&&(yield self.pyodide.runPython('\nimport os\n\nrequest_init_code = """\n\nfrom js import BioLib\nfrom collections import OrderedDict\n\nclass RequestsResponseMock():\n\n def __init__(self, response):\n self.status_code = response.status\n if self.status_code == 200:\n self.ok = True\n self.text = response.responseText\n else:\n self.ok = False\n\n def iter_lines(self, chunk_size, decode_unicode):\n return self.text.splitlines()\n\n\ndef get(url):\n response = BioLib.request(url, "GET")\n return RequestsResponseMock(response)\n \ndef post(url, body):\n response = BioLib.request(url, "POST", body)\n return RequestsResponseMock(response)\n\nclass Session():\n\n def __init__(self):\n self.adapters = OrderedDict()\n return None\n\n def mount(self, prefix, adapter):\n self.adapters[prefix] = adapter\n keys_to_move = [k for k in self.adapters if len(k) < len(prefix)]\n\n for key in keys_to_move:\n self.adapters[key] = self.adapters.pop(key)\n\n def get(self, url, **kwargs):\n kwargs.setdefault(\'allow_redirects\', True)\n return get(url)\n\n"""\n\nretry_init_code = """\n\nDEFAULT_METHOD_WHITELIST = frozenset(\n ["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE"]\n )\n\nDEFAULT_REDIRECT_HEADERS_BLACKLIST = frozenset(["Authorization"])\n\nclass Retry_mock:\n\n def __init__(\n self,\n total=10,\n connect=None,\n read=None,\n redirect=None,\n status=None,\n other=None,\n method_whitelist=DEFAULT_METHOD_WHITELIST,\n status_forcelist=None,\n backoff_factor=0,\n raise_on_redirect=True,\n raise_on_status=True,\n history=None,\n respect_retry_after_header=True,\n remove_headers_on_redirect=DEFAULT_REDIRECT_HEADERS_BLACKLIST,\n ):\n\n self.total = total\n self.connect = connect\n self.read = read\n self.status = status\n self.other = other\n\n if redirect is False or total is False:\n redirect = 0\n raise_on_redirect = False\n\n self.redirect = redirect\n self.status_forcelist = status_forcelist or set()\n self.method_whitelist = method_whitelist\n self.backoff_factor = backoff_factor\n self.raise_on_redirect = raise_on_redirect\n self.raise_on_status = raise_on_status\n self.history = history or tuple()\n self.respect_retry_after_header = respect_retry_after_header\n self.remove_headers_on_redirect = frozenset(\n [h.lower() for h in remove_headers_on_redirect]\n ) \n\n @classmethod\n def from_int(cls, retries, redirect=True, default=None):\n if retries is None:\n retries = default if default is not None else cls.DEFAULT\n\n if isinstance(retries, Retry):\n return retries\n\n redirect = bool(redirect) and None\n new_retries = cls(retries, redirect=redirect)\n return new_retries\n\n\nRetry_mock.DEFAULT = Retry_mock(3)\n\nRetry = Retry_mock\n\n"""\n\nadapters_init_code = """ \n\nDEFAULT_POOLBLOCK = False\nDEFAULT_POOLSIZE = 10\nDEFAULT_RETRIES = 0\nDEFAULT_POOL_TIMEOUT = None\n\nclass Adapters_mock:\n\n def __init__(self, pool_connections=DEFAULT_POOLSIZE,\n pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES,\n pool_block=DEFAULT_POOLBLOCK):\n return None\n\nHTTPAdapter = Adapters_mock\n\n\n"""\n\ndef create_file_and_dir(path, code):\n f = open(path, "a")\n f.write(code)\n f.close()\n\nrequest_lib_path = "/libs-mocked/requests/"\n\nos.makedirs(request_lib_path + "packages/urllib3/util/retry", exist_ok=True)\nos.makedirs(request_lib_path + "adapters", exist_ok=True)\n\ncreate_file_and_dir(request_lib_path + "__init__.py",request_init_code)\ncreate_file_and_dir(request_lib_path + "adapters/__init__.py",adapters_init_code)\ncreate_file_and_dir(request_lib_path + "packages/__init__.py","")\ncreate_file_and_dir(request_lib_path + "packages/urllib3/__init__.py","")\ncreate_file_and_dir(request_lib_path + "packages/urllib3/util/__init__.py","")\ncreate_file_and_dir(request_lib_path + "packages/urllib3/util/retry/__init__.py",retry_init_code)\n\n')),yield self.pyodide.runPython(_);const c=this.getEmscriptenFs();E.copyFilesAndOverwrite(c,i.files),o("Running Python app");let f="",d=0;try{yield self.pyodide.runPython(s)}catch(e){f=e.toString(),d=1}const h=yield self.pyodide.runPython("sys.stdout.getvalue()"),p=(yield self.pyodide.runPython("sys.stderr.getvalue()")).concat(f),y=E.getFilesFromFS(c,n.output_files_mappings,N.SYSTEM_DIRS_TO_SKIP,i.parameters);this.clearExecutionData(),t({exit_code:d,files:y,stdout:N.convertToUIntArray8(h),stderr:N.convertToUIntArray8(p)})}catch(e){this.clearExecutionData(),r(e)}}))))}clearExecutionData(){try{delete self.BioLib,self.Module={},self.pyodide={},this.loadedPackageNames=[]}catch(e){console.error(e)}}static convertToUIntArray8(e){if(!e)return new Uint8Array(0);if(e instanceof Uint8Array)return e;if("string"==typeof e)return(new TextEncoder).encode(e);if(e instanceof Uint8ClampedArray)return new Uint8Array(e);throw new Error(`Unexpected data type of input. Got '${e.constructor.name}'. Expected String or Byte array.`)}analyzeImports(e,t){let r=[],n=[];for(const t in e)if(t.endsWith(".py")){const i=this.textDecoder.decode(e[t].data),o=this.getImportsFromFile(i,r,n);n=o.microPipPackages,r=o.packageNames}const i=this.getImportsFromFile(t,r,n);return n=i.microPipPackages,r=i.packageNames,{packageNames:r,microPipPackages:n}}getImportsFromFile(e,t,r){const n=/^(from (?<importName1>\w*)(\.\w+)? import .*)|(import (?<importName2>\w*)(\.\w+)?( as .*)?)/m;return e.split("\n").forEach((e=>{const r=e.match(n);if(null===r||!r.groups)return;const i=r.groups;let o=i.importName1||i.importName2;void 0!==o?(o=function(e){return"sklearn"===e?"scikit-learn":"skimage"===e?"scikit-image":"PIL"===e?"Pillow":"jinja2"===e?"Jinja2":"markupsafe"===e?"MarkupSafe":"pygments"===e?"Pygments":"attr"===e?"attrs":"bs4"===e?"beautifulsoup4":"Bio"===e?"biopython":"more_itertools"===e?"more-itertools":"dateutil"===e?"python-dateutil":"TiffFile"===e?"tifffile":e}(o),t.includes(o)||B.includes(o)||"js"===o||(S.includes(o)?t.push(o):console.warn(`Module ${o} currently not supported`))):console.warn("Undefined import")})),{packageNames:t,microPipPackages:r}}loadPyodide(){return new Promise(((e,t)=>A(this,void 0,void 0,(function*(){try{self.Module.noImageDecoding=!0,self.Module.noAudioDecoding=!0,self.Module.noWasmDecoding=!0,self.Module.preloadedWasm={},self.Module.getPreloadedPackage=(e,t)=>{const r=this.loadedPackageData[e];return null==r?(console.warn(`The package: ${e} wasn't preloaded`),null):r};const t=`${N.baseURL}pyodide.asm.wasm`,r=yield this.fileCache.getFileFromUrl(t),n=yield WebAssembly.compile(r);self.Module.instantiateWasm=(e,t)=>(WebAssembly.instantiate(n,e).then((e=>t(e))),{}),self.Module.checkABI=function(e){if(e!==parseInt("1",10)){const t=`ABI numbers differ. Expected 1, got ${e}`;throw console.error(t),t}return!0},self.Module.locateFile=e=>N.baseURL.concat(e);const i=new Promise((e=>{self.Module.postRun=()=>{self.Module={},this.fileCache.getFileFromUrl(`${N.baseURL}packages.json`).then((e=>JSON.parse((new TextDecoder).decode(e)))).then((t=>{self.pyodide.globals=self.pyodide.runPython("import sys\nsys.modules['__main__']"),self.pyodide.packages=t,self.pyodide={_module:self.pyodide,checkABI:self.pyodide.checkABI,globals:self.pyodide.globals,pyimport:self.pyodide.pyimport,repr:self.pyodide.repr,runPython:self.pyodide.runPython,runPythonAsync:self.pyodide.runPythonAsync,version:self.pyodide.version,loadPackage:e=>new Promise((t=>A(this,void 0,void 0,(function*(){e.forEach((e=>{this.extraPackagesToLoad.push(e)})),t()}))))},e()}))}})),o=new Promise((e=>{self.Module.monitorRunDependencies=t=>{0===t&&(delete self.Module.monitorRunDependencies,e())}}));Promise.all([i,o]).then((()=>e())),yield this.preloadDataFile(`${N.baseURL}pyodide.asm.data`),yield this.loadScript(`${N.baseURL}pyodide.asm.data.js`),yield this.loadScript(`${N.baseURL}pyodide.asm.js`),self.pyodide=self.pyodide(self.Module)}catch(e){t(e)}}))))}loadPackages(e,t,r){return new Promise(((n,i)=>A(this,void 0,void 0,(function*(){try{if(0===e.length)return void n();const o=self.pyodide._module.packages.dependencies,s=e,a=[];for(;s.length>0;){const e=s.pop();if(null!=e&&!this.loadedPackageNames.includes(e)&&!a.includes(e)){if(!o.hasOwnProperty(e))return void i(`Unknown package '${e}'`);a.push(e),o[e].forEach((e=>{this.loadedPackageNames.includes(e)||a.includes(e)||s.push(e)}))}}if(0===a.length)return void n("No new packages to load");const u=a.length,l=a.join(", ");t&&t(0),r&&r(`Loading dependencies: ${l}`);let c=2*u;self.pyodide._module.monitorRunDependencies=()=>{if(c-=1,c%2==0){const e=(u-c/2)/u*90;t&&t(e)}if(0===c){for(const e in a)this.loadedPackageNames.push(e);delete self.pyodide._module.monitorRunDependencies,r&&r("Initializing dependencies"),this.preloadWasmFiles().then((()=>A(this,void 0,void 0,(function*(){r&&r("Completed initialization of dependencies"),yield self.pyodide.runPython("import importlib as _importlib\n_importlib.invalidate_caches()\n"),n(`Loaded ${l}`)})))).catch((e=>{i(e)}))}};for(const e of a){yield this.preloadDataFile(`${N.baseURL}${e}.data`);try{yield this.loadScript(`${N.baseURL}${e}.js`)}catch(t){console.error(`Couldn't load package from URL ${N.baseURL}${e}.js`);for(let e=0;e<2;e+=1)void 0!==self.pyodide._module.monitorRunDependencies?self.pyodide._module.monitorRunDependencies():console.warn("Undefined function: monitorRunDependencies")}}}catch(e){console.error(e),delete self.pyodide._module.monitorRunDependencies,i(e)}}))))}preloadDataFile(e){return new Promise((t=>A(this,void 0,void 0,(function*(){void 0===this.loadedPackageData[e]&&(this.loadedPackageData[e]=yield this.fileCache.getFileFromUrl(e)),t()}))))}loadScript(e){return A(this,void 0,void 0,(function*(){return new Promise(((t,r)=>A(this,void 0,void 0,(function*(){try{if("undefined"==typeof importScripts)return void r(new Error("Could not load script as the Python Interpreter is not running in a web worker"));const n=yield this.fileCache.getFileFromUrlAsBlob(e,"application/javascript"),i=URL.createObjectURL(n);importScripts(i),t()}catch(e){r(e)}}))))}))}preloadWasmFiles(){return new Promise(((e,t)=>A(this,void 0,void 0,(function*(){const r=self.pyodide._module.FS;try{yield function e(t){return A(this,void 0,void 0,(function*(){let n;try{n=r.readdir(t)}catch(e){return}for(const i of n){if(i.startsWith("."))continue;const n=t.concat(i);i.endsWith(".so")?void 0===self.Module.preloadedWasm[n]&&(self.Module.preloadedWasm[n]=yield self.Module.loadWebAssemblyModule(r.readFile(n),{loadAsync:!0})):r.isDir(r.lookupPath(n).node.mode)&&(yield e(n.concat("/")))}}))}("/"),e()}catch(e){t(e)}}))))}}N.SYSTEM_DIRS_TO_SKIP=["/bin/","/lib/","/libs-mocked/","/dev/","/proc/"],N.baseURL=c.pythonExecutorUrl;var T=r(2),O=r(17);class I{dummyMethod(){Object(O.a)({})}static checkAtomicsAndCreateSharedArray(){if("undefined"==typeof Atomics)throw new m("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)}}class x 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 D 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=v(e,t,this.getSingleFile.bind(this),this.getFilesInDirectory.bind(this),!0)}filterOnFilesMappings(e,t){this.files=v(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 x(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 x(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),l=e.slice(o,o+s);i[u]={data:l},o+=s}return i}}class R extends D{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]&&g(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 x(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 x(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 P=r(18);class M extends D{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 x(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 x(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 $ extends D{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 M(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 x(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 x(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 x(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 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){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 T.Subject,this.remoteRequestSubject=new T.Subject,this.statusUpdateSubject=new T.Subject,this.sleepSubject=new T.Subject,this.appVersionIdToModuleSourceRecord={},this.moduleMetadata=null,this.sharedInputMemory=null,this.sharedOutputMemory=null,this.callModuleAsyncResponseHandler=()=>{},this.baseMethodsToExpose={callModuleObservable:()=>T.Observable.from(this.callModuleSubject),remoteRequestObservable:()=>T.Observable.from(this.remoteRequestSubject),sleepObservable:()=>T.Observable.from(this.sleepSubject),statusUpdateObservable:()=>T.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(P.expose)(Object.assign(Object.assign({},this.baseMethodsToExpose),this.methodsExposedToParent))}getSharedOutputMemory(){return this.sharedOutputMemory||(this.sharedOutputMemory=I.checkAtomicsAndCreateSharedArray()),this.sharedOutputMemory}getSharedInputMemory(){return this.sharedInputMemory||(this.sharedInputMemory=I.checkAtomicsAndCreateSharedArray()),this.sharedInputMemory}sleep(e){const t=this.getSharedOutputMemory();try{this.sleepSubject.next({period:e,sharedMemory:t})}catch(e){throw m.chainErrors("Sleep failed",e)}I.blockAndReadSharedArrayBuffer(t)}handleRemoteRequest(e,t,r){if(!e)throw new m("Fetch remote host failed: Url was undefined");if("GET"!==t&&"POST"!==t)throw new m("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=I.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 m.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 $(t);s.filterOnFilesMappings(r.input_files_mappings,s.parameters);const a=s.serialize(),u=I.writeToSharedMemoryBuffer(a,o);this.callModuleSubject.next({calleeModule:r,moduleInputDataSerialized:u,outputSharedMemory:i});const l=I.blockAndReadSharedArrayBuffer(i);if(!l)throw new m("No result found");return this.logMessage(`Module ${n.name} got response from module ${e}`),new R(l)}catch(e){throw m.chainErrors("Call module blocking failed",e)}}deserializeInputApplyMappingsAndGetExecutableFile(e,t){const r=new $(t);if(!this.moduleMetadata)throw new m("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 m("Module source was undefined");this.appVersionIdToModuleSourceRecord[n.app_version.public_id]=new M(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 m("Failed to serializing module output: Module metadata was undefined");const{module:n}=this.moduleMetadata,i=new R(t);i.filterOutUnchangedFiles(e.files),i.applyFilesMappings(n.output_files_mappings,e.parameters);const o=i.serialize();if(!r)return o;I.writeToSharedMemoryBuffer(o,r)}getCalleeAndCallerModules(e){if(!e||"string"!=typeof e)throw new m("Module name was not a string");if(!this.moduleMetadata)throw new m("Module metadata was undefined");const{job:t}=this.moduleMetadata;if(!t.app_version.modules)throw new m("No modules found");const r=t.app_version.modules.find((({name:t})=>t===e));if(!r)throw new m(`Could not find module with name: ${e}`);return{calleeModule:r,callerModule:this.moduleMetadata.module}}assertUrlHostIsAllowed(e){if(!this.moduleMetadata)throw new m("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 m(`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 m(e)}}}}{constructor(){super(...arguments),this.pythonInterpreter=new N,this.methodsExposedToParent={runPythonModule:this.runPythonModule.bind(this)}}runPythonModule(e,t,r){return U(this,void 0,void 0,(function*(){this.moduleMetadata=e;const{module:n}=this.moduleMetadata;if(!n.command)throw new m(`Module ${n.name}: You must set command to the path of a Python file when using this Python3 image`);if(!n.working_directory)throw new m(`Module ${n.name}: You must set a working directory when using this Python3 image`);const{moduleInput:i,executableFile:o}=this.deserializeInputApplyMappingsAndGetExecutableFile(n,t),s={public:{call_module_blocking:this.callModuleBlockingUsingEmscriptenFS.bind(this),request:this.handleRemoteRequest.bind(this),input_data:i.stdin,input_parameters:i.parameters,mock_time_sleep:this.sleep.bind(this),notification_message:this.logMessage.bind(this),working_directory:n.working_directory,set_execution_progress:this.setProgressCompute.bind(this)},private:{module:n,moduleInput:i,code:o.data,set_initialization_progress:this.setProgressInitialization.bind(this)}},a=yield this.pythonInterpreter.execute(s);return this.serializeAndHandleOutput(i,a,r)}))}callModuleBlockingUsingEmscriptenFS(e,t,r){try{if(!Array.isArray(t))throw new m("Expected parameters to be an array");if(t.some((e=>"string"!=typeof e)))throw new m("Expected parameters to be an array of strings");const{calleeModule:n,callerModule:i}=this.getCalleeAndCallerModules(e),o=N.convertToUIntArray8(r),s=this.pythonInterpreter.getEmscriptenFs(),a=E.getFilesFromFS(s,n.input_files_mappings,N.SYSTEM_DIRS_TO_SKIP,t),u=new $({files:a,stdin:o,parameters:t}).serialize(),l=this.getSharedOutputMemory(),c=this.getSharedInputMemory(),f=I.writeToSharedMemoryBuffer(u,c);this.callModuleSubject.next({calleeModule:n,moduleInputDataSerialized:f,outputSharedMemory:l});const d=I.blockAndReadSharedArrayBuffer(l);if(!d)throw new m("No result found");this.logMessage(`Module ${i.name} got response from module ${e}`);const h=new R(d);return E.copyFilesAndOverwrite(s,h.files),{exit_code:h.exit_code,stderr:h.stderr,stdout:h.stdout}}catch(e){throw m.chainErrors("Call module blocking failed",e)}}}).expose()},function(e,t,r){"use strict";r.r(t),r.d(t,"filter",(function(){return A})),r.d(t,"flatMap",(function(){return O})),r.d(t,"interval",(function(){return I})),r.d(t,"map",(function(){return D})),r.d(t,"merge",(function(){return R})),r.d(t,"multicast",(function(){return M})),r.d(t,"Observable",(function(){return E})),r.d(t,"scan",(function(){return U})),r.d(t,"Subject",(function(){return P})),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"),l=a("observable"),c=a("species");function f(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function d(e){let t=e.constructor;return void 0!==t&&(t=t[c],null===t&&(t=void 0)),void 0!==t?t:v}function h(e){h.log?h.log(e):setTimeout((()=>{throw e}),0)}function p(e){Promise.resolve().then((()=>{try{e()}catch(e){h(e)}}))}function _(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=f(t,"unsubscribe");e&&e.call(t)}}catch(e){h(e)}}function y(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";const n=e._observer;try{const i=n?f(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(y(e),!i)throw r;i.call(n,r);break;case"complete":y(e),i&&i.call(n)}}catch(e){h(e)}"closed"===e._state?_(e):"running"===e._state&&(e._state="ready")}function m(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(g(e,r.type,r.value),"closed"===e._state)break}}(e)))):void g(e,t,r)}class b{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&&(y(this),_(this))}}class w{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){m(this._subscription,"next",e)}error(e){m(this._subscription,"error",e)}complete(){m(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 b(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(d(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(d(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=d(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=d(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=d(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()}}))}[l](){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=f(e,l);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=f(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:l,hostReportError:h},configurable:!0});var E=v;var S=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()},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())}))};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=>B(this,void 0,void 0,(function*(){(yield e(t))&&r(t)}))))}});return()=>S(o)}))};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())}))},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 O=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=>N(this,void 0,void 0,(function*(){var n,i;const o=yield e(t);if((l=o)&&s("iterator")&&l[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 l}))))}});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 D=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 P=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 M=function(e){const t=new P;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)}}))},$=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 U=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=>$(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)}))}}]);
|