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
biolib/biolib-js/main-biolib.js
DELETED
|
@@ -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=80)}([function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return i}));class n 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 n(e);let i;if(t instanceof Error){i=(t.stack?t.stack.toString():"").includes(t.message)?t.stack:`${t.message}: ${t.stack}`}else i=t.toString();return r.message=`${r.message}\n\n${i}`,"string"==typeof e&&"object"==typeof t&&(r.name=t.name),r}toString(){let e=`${this.message}\n`;for(let t=this.chainedErrors.length-1;t>=0;t-=1)e=`${e}\n${this.chainedErrors[t].message}\n`;return e}}class i extends n{constructor(e){super(e),this.name="AppClientError"}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));class n{constructor(e){this.basePath="",this.httpClient=e}post(e){const{url:t,data:r,params:i,shouldAuthenticate:o,shouldSendAsFormData:s,responseType:a}=e,u=n.getAxiosRequestConfig({url:t,shouldAuthenticate:o,params:i,responseType:a}),c=s?n.createFormData(r):r;return this.httpClient.axios.post(this.getFullUrl(t),c,u).then((e=>e.data))}get(e){const{url:t,params:r,shouldAuthenticate:i,responseType:o}=e,s=n.getAxiosRequestConfig({url:t,shouldAuthenticate:i,params:r,responseType:o});return this.httpClient.axios.get(this.getFullUrl(t),s).then((e=>e.data))}patch(e){const{url:t,data:r,params:i,shouldAuthenticate:o,shouldSendAsFormData:s,responseType:a}=e,u=n.getAxiosRequestConfig({url:t,shouldAuthenticate:o,params:i,responseType:a}),c=s?n.createFormData(r):r;return this.httpClient.axios.patch(this.getFullUrl(t),c,u).then((e=>e.data))}delete(e){const{url:t,params:r,shouldAuthenticate:i,responseType:o}=e,s=n.getAxiosRequestConfig({url:t,shouldAuthenticate:i,params:r,responseType:o});return this.httpClient.axios.delete(this.getFullUrl(t),s).then((e=>e.data))}getFullUrl(e){return""!==this.basePath?`${this.basePath}${e}`:e}static getAxiosRequestConfig(e){const{shouldAuthenticate:t,params:r,timeout:n,responseType:i}=e;let o={};return t&&(o={headers:{Authorization:!0}}),r&&(o.params=r),n&&(o.timeout=n),i&&(o.responseType=i),o}static createFormData(e,t,r){const n=t||new FormData;for(const t in e){if(!e.hasOwnProperty(t)||void 0===e[t])continue;const i=r?`${r}[${t}]`:t,o=e[t]instanceof Blob;e[t]instanceof Date?n.append(i,e[t].toISOString()):"object"!=typeof e[t]||o?n.append(i,e[t]):this.createFormData(e[t],n,i)}return n}}},function(e,t,r){e.exports=r(52)},function(e,t,r){"use strict";var n=r(28),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 c(e){return"[object Function]"===i.call(e)}function l(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:c,isStream:function(e){return a(e)&&c(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:l,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++)l(arguments[n],r);return t},extend:function(e,t,r){return l(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";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return s})),r.d(t,"e",(function(){return a}));const n=Symbol("thread.errors"),i=Symbol("thread.events"),o=Symbol("thread.terminate"),s=Symbol("thread.transferable"),a=Symbol("thread.worker")},function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var n=r(15),i=r(0),o=r(16),s=r(9),a=r(2),u=r.n(a),c=r(1),l=r(21),f=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 h extends l.a{setObservables(e){return f(this,void 0,void 0,(function*(){try{e.statusUpdateObservable().subscribe((e=>{if(!this.executeOptions)return void console.error("Subscriber to statusUpdateObservable failed: thread options not set");const{message:t,progressCompute:r,progressInitialization:n}=e;t&&this.executeOptions.utils.addLogMessage(t),n&&this.executeOptions.utils.setProgressInitialization(n),r&&this.executeOptions.utils.setProgressCompute(r)})),e.remoteRequestObservable().subscribe((e=>f(this,void 0,void 0,(function*(){if(this.executeOptions)try{let t,r;switch(e.method){case"GET":{const{data:n,status:i}=yield u.a.get(e.url,{responseType:"arraybuffer"});t=new Uint8Array(n),r=i;break}case"POST":{if(null===e.body||void 0===e.body)throw new i.b("Request body undefined");const n=c.a.createFormData(e.body),{data:o,status:s}=yield u.a.post(e.url,n,{responseType:"arraybuffer"});t=new Uint8Array(o),r=s;break}}const n=new Uint8Array(t.byteLength+2);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint16(0,r),n.set(t,2),o.a.writeToSharedMemoryBuffer(n,e.sharedMemory)}catch(e){}else console.error("Subscriber to remoteRequestObservable failed: thread options not set")})))),e.sleepObservable().subscribe((({period:e,sharedMemory:t})=>f(this,void 0,void 0,(function*(){if(this.executeOptions)try{yield Object(s.b)(e),o.a.writeToSharedMemoryBuffer(new Uint8Array(0),t)}catch(e){this.rejectPromise(e)}else console.error("Subscriber to sleepObservable failed: thread options not set")})))),e.callModuleObservable().subscribe((e=>f(this,void 0,void 0,(function*(){if(!this.executeOptions)return void console.error("Subscriber to callModuleObservable failed: thread options not set");if(!this.workerThread)return void this.rejectPromise(new i.a("Worker thread not available"));const{calleeModule:t,moduleInputDataSerialized:r,outputSharedMemory:o}=e,{utils:s,moduleMetadata:a}=this.executeOptions,u={utils:s,moduleMetadata:Object.assign(Object.assign({},a),{module:t})};try{if(o&&r.buffer instanceof SharedArrayBuffer)yield n.a.runModule(u,r,o);else{const e=yield n.a.runModuleWithoutSharedMemory(u,r);this.workerThread.callModuleAsyncResponse(e)}}catch(e){this.rejectPromise(e)}}))))}catch(e){throw i.a.chainErrors("Failed to set observables on thread",e)}}))}}},function(e,t,r){"use strict";(function(e){var n=r(47),i=r(48),o=r(49);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 c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=a(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|d(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(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(l(t),e=a(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|d(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(n)return F(e).length;t=(""+t).toLowerCase(),n=!0}}function m(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 k(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function _(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:b(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):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(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 c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function y(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 v(e,t,r,n){return Y(F(t,e.length-r),e,r,n)}function w(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 w(e,t,r,n)}function S(e,t,r,n){return Y(L(t),e,r,n)}function A(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 B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=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&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),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 c(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 l(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)g(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)g(this,t,t+3),g(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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):m.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),c=this.slice(n,i),l=e.slice(t,r),f=0;f<a;++f)if(c[f]!==l[f]){o=c[f],s=l[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 _(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return _(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 y(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return w(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 A(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 x(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 N(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 k(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+=M(e[o]);return i}function I(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 C(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 R(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 D(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 z(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 P(e,t,r,n,o){return o||U(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function $(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||C(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||C(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||C(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||C(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||C(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||C(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||C(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||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||C(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||C(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||C(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||C(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||C(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||C(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)||R(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)||R(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||R(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||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(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):z(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(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):z(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);R(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);R(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||R(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||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(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):z(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(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):z(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return $(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return $(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:F(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 M(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(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 L(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(14))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));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})};let i={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 o(e){return i.deserialize(e)}function s(e){return i.serialize(e)}},,function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return 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){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())}))};const i=e=>new Promise((t=>n(void 0,void 0,void 0,(function*(){return setTimeout(t,e)}))));function o(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}},function(e,t,r){"use strict";let n;function i(){return n||(n=function(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return(""+t[0]).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}return"/"}()),n}r.d(t,"a",(function(){return a}));"undefined"!=typeof navigator&&navigator.hardwareConcurrency&&navigator.hardwareConcurrency;const o=e=>/^(file|https?:)?\/\//i.test(e);function s(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}const a="undefined"==typeof Worker?class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}}:class extends Worker{constructor(e,t){"string"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):"string"==typeof e&&!o(e)&&i().match(/^file:\/\//i)&&(e=new URL(e,i().replace(/\/[^\/]+$/,"/")),e=s(`importScripts(${JSON.stringify(e)});`)),"string"==typeof e&&o(e)&&(e=s(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}},function(e,t,r){(function(n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(70)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(20))},function(e,t,r){"use strict";r.d(t,"a",(function(){return q})),r.d(t,"b",(function(){return X}));var n=r(2),i=r.n(n);class o extends Error{constructor(e){var t;super("string"==typeof e?e:e.statusText),this.name="ApiError","object"==typeof e&&(this.status=e.status,this.validationErrors=e.data,400!==e.status&&(this.message=(null===(t=this.validationErrors)||void 0===t?void 0:t.detail)||this.message))}toString(){return`${this.name}: ${this.message}`}static generate(e){if(!e)return new o("Unknown API Error");switch(e.status){case 400:return e.data&&"compute_limit_exceeded_please_signin"in e.data?new d(e):e.data&&"compute_limit_exceeded_please_contact_biolib"in e.data?new p(e):new s(e);case 401:return new a(e);case 403:return new u(e);case 404:return new c(e);case 429:return new h(e);case 500:return new l(e);case 503:return new f(e);default:return new o(e)}}}class s extends o{constructor(e){super(e),this.name="ValidationError";const t=this.validationErrors;t&&(this.message=JSON.stringify(t))}toString(){const e=this.validationErrors;if(e)try{return s.recurseValidationErrors(e)}catch(e){return`${this.name}: ${this.message}`}return`${this.name}: ${this.message}`}static recurseValidationErrors(e){if("string"==typeof e)return e;if(Array.isArray(e)&&0===e.length)return"";if(Array.isArray(e)&&"string"==typeof e[0])return e.join("\n");let t="";if(Array.isArray(e))for(const r of e)t=`${t}${t.endsWith("\n")?"":"\n"}${s.recurseValidationErrors(r)}`;else if("object"==typeof e)for(const r in e){const n=e[r];t=`${t}${t.endsWith("\n")?"":"\n"}${s.recurseValidationErrors(n)}`}return t}}class a extends o{constructor(){super(...arguments),this.name="AuthenticationError"}}class u extends o{constructor(){super(...arguments),this.name="PermissionError"}}class c extends o{constructor(){super(...arguments),this.name="NotFoundError"}}class l extends o{constructor(){super(...arguments),this.name="ServerError"}}class f extends o{constructor(){super(...arguments),this.name="ServerUnavailableError"}}class h extends o{constructor(){super(...arguments),this.name="BioLibServerMaximumAttemptsReached"}}class d extends o{constructor(){super(...arguments),this.name="compute_limit_exceeded_please_signin"}}class p extends o{constructor(){super(...arguments),this.name="compute_limit_exceeded_please_contact_biolib"}}var m=r(25);function g(e){return e instanceof o?Promise.reject(e):function(e){return!!e.isAxiosError&&!e.response}(e)?Promise.reject(new o("Network Error: Lost Connection to Server")):Promise.reject(o.generate(e.response))}var _=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 b{constructor(e){var t;this.interceptRequest=e=>new Promise(((t,r)=>_(this,void 0,void 0,(function*(){var n,i,o;if(null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.Authorization){if(!this.refreshToken)return delete e.headers.Authorization,t(e);if(b.isJwtExpired(this.refreshToken))return r(new a("The session has expired"));if(!this.accessToken||b.isJwtExpired(this.accessToken))try{this.accessToken=yield this.fetchNewAccessToken()}catch(e){return r(new a(null===(o=null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.data)||void 0===o?void 0:o.detail))}e.headers.Authorization=`Bearer ${this.accessToken}`}t(e)})))),this.baseUrl=e.baseURL,this.accessTokenPath=null!==(t=e.accessTokenPath)&&void 0!==t?t:"/api/user/token/refresh/",this.refreshToken=e.refreshToken,this.axios=this.axios=i.a.create({baseURL:this.baseUrl}),this.axios.interceptors.request.use(this.interceptRequest,(e=>Promise.reject(e))),this.axios.interceptors.response.use((e=>e),g)}setRefreshToken(e){this.refreshToken=e}setAccessToken(e){this.accessToken=e}getAccessToken(){if(!this.accessToken)throw new Error("HttpClient: Failed to get access token it was undefined");return this.accessToken}getRefreshToken(){return this.refreshToken}clearTokens(){this.accessToken=void 0,this.refreshToken=void 0}getSingedInUserId(){if(void 0===this.refreshToken)return;const{public_id:e}=m(this.refreshToken);return e}fetchNewAccessToken(){return _(this,void 0,void 0,(function*(){return this.accessToken=yield this.axios.post(this.accessTokenPath,{refresh:this.refreshToken}).then((e=>e.data.access)),this.accessToken}))}static isJwtExpired(e){const{exp:t}=m(e);return 1e3*t-Date.now()<=0}}var y=r(1);class v extends y.a{constructor(){super(...arguments),this.basePath="/api/account"}create(e){return this.post({url:"/",data:e,shouldAuthenticate:!0})}fetch(e){return this.get({url:`/${e}/`,shouldAuthenticate:!0})}fetchMembers(e){return this.get({url:`/${e}/members/`,shouldAuthenticate:!0}).then((({members:e})=>e))}deleteMember(e,t){return this.delete({shouldAuthenticate:!0,url:`/${e}/members/${t}/`})}updateMemberRole(e,t,r){return this.patch({shouldAuthenticate:!0,url:`/${e}/members/${t}/`,data:r})}inviteMember(e,t){return this.post({shouldAuthenticate:!0,url:`/${e}/members/invite/`,data:t})}acceptInvitation(e){return this.post({data:e,shouldAuthenticate:!0,url:"/organization_invitations/"})}leaveOrganization(e){return this.post({data:{},shouldAuthenticate:!0,url:`/${e}/members/leave/`})}update(e,t){return this.patch({data:t,shouldAuthenticate:!0,shouldSendAsFormData:!0,url:`/${e}/`})}fetchRemoteHosts(e,t){return this.get({params:t,url:`/${e}/remote_hosts/`,shouldAuthenticate:!0})}addRemoteHost(e,t){return this.post({data:t,shouldAuthenticate:!0,url:`/${e}/remote_hosts/`})}deleteRemoteHost(e,t){return this.delete({shouldAuthenticate:!0,url:`/${e}/remote_hosts/${t}/`})}createSsoConnection(e,t){return this.post({data:t,shouldAuthenticate:!0,url:`s/${e}/sso_connections/`})}fetchSsoConnections(e){return this.get({shouldAuthenticate:!0,url:`s/${e}/sso_connections/`})}updateSsoConnection(e,t,r){return this.patch({data:r,shouldAuthenticate:!0,url:`s/${e}/sso_connections/${t}/`})}createSsoDomain(e,t,r){return this.post({data:r,shouldAuthenticate:!0,url:`s/${e}/sso_connections/${t}/domains/`})}deleteSsoDomain(e,t,r){return this.delete({shouldAuthenticate:!0,url:`s/${e}/sso_connections/${t}/domains/${r}/`})}}var w=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 E extends y.a{constructor(){super(...arguments),this.basePath="/api"}create(e){return this.post({data:e,shouldAuthenticate:!0,shouldSendAsFormData:!0,url:"/apps/"})}fork(e){return this.post({url:"/apps/",data:e,shouldAuthenticate:!0})}createAppVersion(e){return this.post({data:e,shouldAuthenticate:!0,shouldSendAsFormData:!0,url:"/app_versions/"})}fetchAppVersionById(e,t){return new Promise(((r,n)=>w(this,void 0,void 0,(function*(){try{const i=yield this.get({url:`/app_versions/${e}/`,shouldAuthenticate:!0,params:{license:t}});i?r(i):n(new c(`Could not find appVersion with ID: ${e}`))}catch(t){n(t instanceof o?t:new o(`Failed to fetch appVersion with ID: ${e}`))}}))))}fetchByName(e,t,r){return new Promise(((n,i)=>w(this,void 0,void 0,(function*(){try{const o=(yield this.get({url:"/apps/",params:{account_handle:e,app_name:t,license:r},shouldAuthenticate:!0})).results[0];o?n(o):i(new c(`Could not find ${e}/${t}`))}catch(r){i(r instanceof o?r:new o(`Failed to fetch ${e}/${t}`))}}))))}fetchById(e){return this.get({url:`/apps/${e}/`,shouldAuthenticate:!0})}fetchMultiple(e){return this.get({url:"/apps/",params:e,shouldAuthenticate:!0})}fetchTrending(){return this.get({url:"/trending_apps/"})}update(e,t){return this.patch({data:t,shouldAuthenticate:!0,url:`/apps/${e}/`})}updateAppVersion(e,t){return this.patch({data:t,shouldAuthenticate:!0,url:`/app_versions/${e}`})}deleteApp(e){return this.delete({shouldAuthenticate:!0,url:`/apps/${e}/`})}}class S{constructor(e){this.compileClient=i.a.create({baseURL:`${e}/compile`})}rCode(e){return this.compileClient.post("/r/",e,{responseType:"arraybuffer"}).then((({data:e})=>new Uint8Array(e)))}}class A extends y.a{constructor(){super(...arguments),this.basePath="/api/favorites"}fetch(){return this.get({url:"/",shouldAuthenticate:!0})}add(e){return this.post({url:"/",shouldAuthenticate:!0,data:e})}remove(e){return this.delete({url:`/${e}/`,shouldAuthenticate:!0})}}var B=r(9),O=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){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 T extends y.a{constructor(){super(...arguments),this.basePath="/api/jobs"}create(e){return this.post({url:"/",data:e,shouldAuthenticate:!0})}update(e,t){return this.patch({url:`/${e}/`,data:t,shouldAuthenticate:!0})}createCloudJob(e,t){return O(this,void 0,void 0,(function*(){let r=null;for(let t=0;t<5;t+=1)try{r=yield this.post({data:e,url:"/cloud/",shouldAuthenticate:!0});break}catch(e){if(!(e instanceof f))throw e;yield Object(B.b)(1e3)}if(null===r)throw new h("Reached retry limit for cloud job creation");if(r.is_compute_node_ready){if(null===r.compute_node_info)throw new o("Compute node info was null");return r}t("Cloud: Starting a compute node, this might take up to 2 minutes.");for(let e=0;e<25;e+=1){if(r=yield this.get({url:`/cloud/${r.public_id}/status/`,shouldAuthenticate:!0}),r.is_compute_node_ready){if(null===r.compute_node_info)throw new o("Compute node info was null");return r}t("Cloud: Reserved compute node not ready, retrying..."),yield Object(B.b)(1e4)}throw new h("Reached timeout for compute node initialization")}))}}class x extends y.a{constructor(){super(...arguments),this.basePath="/api/licenses"}create(e){return this.post({url:"/",data:e,shouldAuthenticate:!0})}update(e,t){return this.patch({url:`/${e}/`,data:t,shouldAuthenticate:!0})}fetchCreatedForApp(e){return this.get({url:"/",params:e,shouldAuthenticate:!0})}fetchCreatedByAccount(e){return this.get({url:"/",params:e,shouldAuthenticate:!0})}fetchAssigned(){return this.get({url:"/assigned/",shouldAuthenticate:!0})}}class N extends y.a{constructor(){super(...arguments),this.basePath="/protein-visualizer"}getProfilePicture(e){return this.get({url:`/${e}/`,timeout:1e4}).then((e=>new File([e],"image.png",{type:"image/png"})))}}var k=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 I extends y.a{constructor(){super(...arguments),this.basePath="/api/tags"}fetch(e,t){return this.get({url:`/${e}/`,params:t})}fetchAll(){return this.get({url:"/"})}fetchByTitle(e){return new Promise(((t,r)=>k(this,void 0,void 0,(function*(){try{const r=(yield this.get({url:"/",params:e})).results[0].public_id,n=yield this.fetch(r);t(n)}catch(e){r(e instanceof o?e:new o("Failed to load tag by title"))}}))))}}var C=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class R extends y.a{constructor(){super(...arguments),this.basePath="/api/user"}agreeToTerms(){return this.post({url:"/agree_to_terms/",shouldAuthenticate:!0,data:{}})}changeEmail(e,t){return this.patch({url:`/${e}/`,data:t,shouldAuthenticate:!0})}clearTokens(){this.httpClient.clearTokens()}create(e){return this.post({url:"/",data:e})}fetch(e){const t=e||this.httpClient.getSingedInUserId();if(!t)throw new o("Failed to get user uuid from refreshToken");return this.get({url:`/${t}/`,shouldAuthenticate:!0})}resetPassword(e){return this.post({url:"/password_reset/",data:e})}resetPasswordConfirm(e){return this.post({url:"/password_reset/confirm/",data:e})}signIn(e){return this.post({url:"/token/",data:e}).then((e=>(this.httpClient.setRefreshToken(e.refresh),this.httpClient.setAccessToken(e.access),{refreshToken:e.refresh,accessToken:e.access})))}signInAndFetch(e){return new Promise(((t,r)=>C(this,void 0,void 0,(function*(){try{const{refreshToken:r}=yield this.signIn(e),n=yield this.fetch();t({user:n,refreshToken:r})}catch(e){r(e)}}))))}verifyEmail(e){return this.post({url:"/verify_email/",data:e})}requestVerificationEmail(){return this.get({url:"/verify_email/",shouldAuthenticate:!0})}}var D=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class z extends y.a{constructor(){super(...arguments),this.basePath="/api/sso"}enterpriseGetAuthorizationUrl(e){return this.post({url:"/enterprise/authorization_url/",data:e})}gitHubSignIn(e){return new Promise(((t,r)=>D(this,void 0,void 0,(function*(){try{const r=yield this.post({url:"/github/signin/",data:e});this.httpClient.setRefreshToken(r.refresh_token),this.httpClient.setAccessToken(r.access_token),t(r)}catch(e){r(e)}}))))}}class U{constructor(e){this.apiClient=i.a.create({baseURL:`${e.biolibCdnBaseUrl}/source-file-proxy`}),this.apiClient.interceptors.response.use((e=>e),g)}getFileList(e){return this.apiClient.post("/file-list/",e).then((({data:e})=>e))}getFileContent(e){return this.apiClient.post("/file-content",e,{responseType:"arraybuffer"}).then((({data:e})=>new Uint8Array(e)))}}class P extends y.a{constructor(){super(...arguments),this.basePath="/api/user/api_tokens"}fetchAll(e){return this.get({params:e,url:"/",shouldAuthenticate:!0})}createToken(e){return this.post({data:e,url:"/",shouldAuthenticate:!0})}updateToken(e,t){return this.patch({data:t,url:`/${e}/`,shouldAuthenticate:!0})}deleteToken(e){return this.delete({url:`/${e}/`,shouldAuthenticate:!0})}}var $,j,M,F,L,Y,W=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 J{send(e){return W(this,void 0,void 0,(function*(){yield i.a.post(J.apiUrl,e)}))}}J.apiUrl="https://vqfmyscbod.execute-api.eu-west-1.amazonaws.com/default/websiteContact";class H{constructor(e,t){this.httpClient=new b({baseURL:e,refreshToken:t});let r="https://blbcdn.com";e.includes("staging")?r="https://staging.blbcdn.com":e.includes("localhost")&&(r="http://localhost/blbcdn"),this.account=new v(this.httpClient),this.apiToken=new P(this.httpClient),this.app=new E(this.httpClient),this.compile=new S(e),this.errorReport=new J,this.favorites=new A(this.httpClient),this.job=new T(this.httpClient),this.license=new x(this.httpClient),this.proteinVisualizer=new N(this.httpClient),this.sourceFile=new U({biolibCdnBaseUrl:r}),this.sso=new z(this.httpClient),this.tag=new I(this.httpClient),this.user=new R(this.httpClient)}static fetchFile(e){return i.a.get(e,{responseType:"arraybuffer"}).then((({data:e})=>new Uint8Array(e))).catch((e=>{var t;throw new o(`Fetching file failed: ${null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.statusText}`)}))}}class q{static setConfig(e){this.config=e}static get(){if(!this.instance){if(!this.config)throw new o("Config not set for BioLib API");const{baseUrl:e,refreshToken:t}=this.config;this.instance=new H(e,t)}return this.instance}}!function(e){e.intrinsic="intrinsic",e.admin="admin",e.member="member"}($||($={})),function(e){e.admin="admin",e.member="member"}(j||(j={})),function(e){e.basic="basic",e.enterprise="enterprise"}(M||(M={})),function(e){e.draft="draft",e.public="public"}(F||(F={})),function(e){e.published="published",e.unpublished="unpublished"}(L||(L={})),function(e){e.markdown="markdown",e.text="text"}(Y||(Y={}));var Z,X,K,G;!function(e){e.dropdown="dropdown",e.file="file",e.hidden="hidden",e.number="number",e.radio="radio",e.text="text",e.textFile="text-file",e.toggle="toggle"}(Z||(Z={})),function(e){e.biolibApp="biolib-app",e.biolibCustom="biolib-custom",e.biolibEcr="biolib-ecr"}(X||(X={})),function(e){e.completed="completed",e.failed="failed",e.inProgress="in_progress",e.awaitingInput="awaiting_input",e.clientAborted="client_aborted"}(K||(K={})),function(e){e.active="active",e.revoked="revoked"}(G||(G={}))},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=c(e,(0|e)<0?-1:0,!0),i&&(s[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function u(e,t){if(isNaN(e))return t?b:_;if(t){if(e<0)return b;if(e>=p)return S}else{if(e<=-m)return A;if(e+1>=m)return E}return e<0?u(-e,t).neg():c(e%d|0,e/d|0,t)}function c(e,t,r){return new n(e,t,r)}n.fromInt=a,n.fromNumber=u,n.fromBits=c;var l=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 _;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(l(r,8)),o=_,s=0;s<e.length;s+=8){var a=Math.min(8,e.length-s),c=parseInt(e.substring(s,s+a),r);if(a<8){var h=u(l(r,a));o=o.mul(h).add(u(c))}else o=(o=o.mul(i)).add(u(c))}return o.unsigned=t,o}function h(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?f(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=f,n.fromValue=h;var d=4294967296,p=d*d,m=p/2,g=a(1<<24),_=a(0);n.ZERO=_;var b=a(0,!0);n.UZERO=b;var y=a(1);n.ONE=y;var v=a(1,!0);n.UONE=v;var w=a(-1);n.NEG_ONE=w;var E=c(-1,2147483647,!1);n.MAX_VALUE=E;var S=c(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var A=c(0,-2147483648,!1);n.MIN_VALUE=A;var B=n.prototype;B.toInt=function(){return this.unsigned?this.low>>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(A)){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(l(e,6),this.unsigned),o=this,s="";;){var a=o.div(i),c=(o.sub(a.mul(i)).toInt()>>>0).toString(e);if((o=a).isZero())return c+s;for(;c.length<6;)c="0"+c;s=""+c+s}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?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},B.isZero=function(){return 0===this.high&&0===this.low},B.eqz=B.isZero,B.isNegative=function(){return!this.unsigned&&this.high<0},B.isPositive=function(){return this.unsigned||this.high>=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.equals=function(e){return i(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},B.eq=B.equals,B.notEquals=function(e){return!this.eq(e)},B.neq=B.notEquals,B.ne=B.notEquals,B.lessThan=function(e){return this.comp(e)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(e){return this.comp(e)<=0},B.lte=B.lessThanOrEqual,B.le=B.lessThanOrEqual,B.greaterThan=function(e){return this.comp(e)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(e){return this.comp(e)>=0},B.gte=B.greaterThanOrEqual,B.ge=B.greaterThanOrEqual,B.compare=function(e){if(i(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(y)},B.neg=B.negate,B.add=function(e){i(e)||(e=h(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,l=0,f=0,d=0,p=0;return d+=(p+=o+(65535&e.low))>>>16,f+=(d+=n+u)>>>16,l+=(f+=r+a)>>>16,l+=t+s,c((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(f&=65535),this.unsigned)},B.subtract=function(e){return i(e)||(e=h(e)),this.add(e.neg())},B.sub=B.subtract,B.multiply=function(e){if(this.isZero())return _;if(i(e)||(e=h(e)),r)return c(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return _;if(this.eq(A))return e.isOdd()?A:_;if(e.eq(A))return this.isOdd()?A:_;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(g)&&e.lt(g))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,l=65535&e.high,f=e.low>>>16,d=65535&e.low,p=0,m=0,b=0,y=0;return b+=(y+=s*d)>>>16,m+=(b+=o*d)>>>16,b&=65535,m+=(b+=s*f)>>>16,p+=(m+=n*d)>>>16,m&=65535,p+=(m+=o*f)>>>16,m&=65535,p+=(m+=s*l)>>>16,p+=t*d+n*f+o*l+s*a,c((b&=65535)<<16|(y&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},B.mul=B.multiply,B.divide=function(e){if(i(e)||(e=h(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((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?b:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return v;o=b}else{if(this.eq(A))return e.eq(y)||e.eq(w)?A:e.eq(A)?y:(t=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?y:w:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(A))return this.unsigned?b:_;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=_}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:l(2,s-48),f=u(t),d=f.mul(e);d.isNegative()||d.gt(n);)d=(f=u(t-=a,this.unsigned)).mul(e);f.isZero()&&(f=y),o=o.add(f),n=n.sub(d)}return o},B.div=B.divide,B.modulo=function(e){return i(e)||(e=h(e)),r?c((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))},B.mod=B.modulo,B.rem=B.modulo,B.not=function(){return c(~this.low,~this.high,this.unsigned)},B.and=function(e){return i(e)||(e=h(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},B.or=function(e){return i(e)||(e=h(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},B.xor=function(e){return i(e)||(e=h(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},B.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},B.shl=B.shiftLeft,B.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.shr_u=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},B.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},B.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]},B.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";var n=r(36),i=r(2),o=r.n(i),s=r(24),a=r(0);const u=/\$(?<argIndex>\d+)/g;function c(e,t){if(!e.startsWith("/"))throw new a.b(`Attempted to copy ${t} path ${e}. But only absolute paths are supported`);if(e.includes("//"))throw new a.b(`Attempted to copy ${t} path ${e}. But encountered consecutive slashes in path`);if(e.includes("/.."))throw new a.b(`Attempted to copy ${t} path ${e}. But encountered unsupported /.. path`)}function l(e,t,r,n,i){const o={},s=(e=>(...t)=>{const{argIndex:r}=t[t.length-1];if(0===r)throw new a.b("Attempted to copy using argument reference $0 which is invalid");if(r>e.length)throw new a.b("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(u,s);c(e,"from");const l=t.to_path.replace(u,s);c(l,"to");const f=e.endsWith("/"),h=l.endsWith("/");if(f){if(!h)throw new a.b(`Attempted to copy directory "${e}" to file "${l}"`);for(const{path:t,file:r}of n(e)){o[i?l.concat(t.slice(e.length)):t]=r}}else{const t=r(e);if(t){let r=i?l:e;if(i&&h){const t=e.split("/").pop();t&&(r=r.concat(t))}o[r]=t}else{if(!n(e.concat("/")).next().done)throw new a.b(`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 f 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 h 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=l(e,t,this.getSingleFile.bind(this),this.getFilesInDirectory.bind(this),!0)}filterOnFilesMappings(e,t){this.files=l(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 f(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 f(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),c=e.slice(o,o+s);i[u]={data:c},o+=s}return i}}class d extends h{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 f(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 f(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 p extends h{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 d(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 f(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 f(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 f(e.buffer,e.byteOffset,e.byteLength);this.assertVersionAndType(t);let r=2;const n=Number(t.getBigUint64(r));r+=8;const i=t.getUint32(r);r+=4;const o=Number(t.getBigUint64(r));r+=8;const s=e.slice(r,r+n);r+=n;const a=[],u=r+i;for(;r<u;){const n=t.getUint16(r);r+=2;const i=this.textDecoder.decode(e.slice(r,r+n));a.push(i),r+=n}return{stdin:s,parameters:a,files:this.deserializeFiles(e,r,o)}}}var m=r(9);class g extends h{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]&&Object(m.a)(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 f(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 f(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 _=r(39),b=r(41),y=r(42),v=r(43),w=r(44),E=r(45),S=r(12),A=r(16);const B=`(?:${["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(",">>",">\\&","[&;()|<>]"].join("|")})`,O="|&;()<> \\t",T=`(\\\\['"${O}]|[^\\s'"${O}])+`,x='"((\\\\"|[^"])*?)"',N="'((\\\\'|[^'])*?)'";let k="";for(let e=0;e<4;e+=1)k+=(Math.pow(16,8)*Math.random()).toString(16);function I(e,t,r){return function(e,t={},r={}){const n=new RegExp([`(${B})`,`(${T}|${x}|${N})*`].join("|"),"g");let i=e.match(n);if(!i)return[];i=i.filter(Boolean);let o=!1;return i.map(((e,t)=>{if(o)return;if(RegExp(`^${B}$`).test(e))return{op:e};const n="'",a='"',u="$",c=r.escape||"\\";let l=!1,f=!1,h="",d=!1;for(let r=0,m=e.length;r<m;r+=1){let m=e.charAt(r);if(d=d||!l&&("*"===m||"?"===m),f)h+=m,f=!1;else if(l)m===l?l=!1:l===n?h+=m:m===c?(r+=1,m=e.charAt(r),h+=m===a||m===c||m===u?m:c+m):h+=m===u?p():m;else if(m===a||m===n)l=m;else{if(RegExp(`^${B}$`).test(m))return{op:e};if(RegExp("^#$").test(m))return o=!0,h.length?[h,{comment:e.slice(r+1)+(null==i?void 0:i.slice(t+1).join(" "))}]:[{comment:e.slice(r+1)+(null==i?void 0:i.slice(t+1).join(" "))}];m===c?f=!0:h+=m===u?p():m}function p(){let t,n;if(r+=1,"{"===e.charAt(r)){if(r+=1,"}"===e.charAt(r))throw new Error(`Bad substitution: ${e.substr(r-2,3)}`);if(t=e.indexOf("}",r),t<0)throw new Error(`Bad substitution: ${e.substr(r)}`);n=e.substr(r,t-r),r=t}else/[*@#?$!_\-]/.test(e.charAt(r))?(n=e.charAt(r),r+=1):(t=e.substr(r).match(/[^\w\d_]/),t?(n=e.substr(r,t.index),r+=t.index-1):(n=e.substr(r),r=e.length));return s("",n)}}return d?{op:"glob",pattern:h}:h})).reduce(((e,t)=>void 0===t?e:e.concat(t)),[]);function s(e,r){let n=t[r];return void 0===n&&""!==r?n="":void 0===n&&(n="$"),"object"==typeof n?e+k+JSON.stringify(n)+k:e+n}}(e,t,r).reduce(((e,t)=>{if("object"==typeof t)return e;const r=t.split(RegExp(`(${k}.*?${k})`,"g"));return 1===r.length?e.concat(r[0]):e.concat(r.filter(Boolean).map((e=>RegExp(`^${k}`).test(e)?JSON.parse(e.split(k)[1]):e)))}),[])}var C=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())}))};const R={emscripten:{"1.0.0":_.a},onnx:{"1.0.0":b.a},python3:{"1.0.0":y.a},r:{"1.0.0":v.a},rust:{"1.0.0":w.a},tensorflow:{"1.0.0":E.a}};class D{static setApiClient(e){D.apiClient=e}static runAppVersion(e,t,r,n){return this.apiClient.job.create({app_version_id:e,caller_job:n}).then((e=>this.runJob(e,t,r)))}static runApp(e,t,r,n,i){return this.apiClient.job.create({app:e,app_version_semantic:t,caller_job:i}).then((e=>this.runJob(e,r,n)))}static killRootJob(e){return C(this,void 0,void 0,(function*(){if(!this.jobsDict[e])return;const{executorInstances:t,childJobIds:r}=this.rootJobExecutorWrapperDict[e];for(const e of t)yield e.terminateWorkerThread();for(const e of r)delete this.jobsDict[e];delete this.jobsDict[e],delete this.rootJobExecutorWrapperDict[e]}))}static runJob(e,t,r){return C(this,void 0,void 0,(function*(){const{addLogMessage:n}=r;this.jobsDict[e.public_id]=e;const i=null===e.caller_job;let o=e;if(i)this.rootJobExecutorWrapperDict[e.public_id]={appVersionIdToSerializedModuleSource:{},childJobIds:[],executorInstances:[]};else for(;o.caller_job;){o=this.jobsDict[o.caller_job];break}const s=o.public_id,{app_version:u}=e,c=new p(t);let l;if(c.parameters.length>0?r.addLogMessage(`Running job ${e.public_id} with arguments: ${JSON.stringify(c.parameters)}. Got ${c.stdin.length} bytes of stdin data.`):r.addLogMessage(`Running job without arguments. Got ${c.stdin.length} bytes of stdin data.`),!u.modules||e.custom_compute_node_url){const t=c.serialize(),n=this.getRemoteExecutorInstance(s),i=yield n.executeModule({utils:r,remoteOptions:{job:e,moduleName:"main",biolibApiBaseUrl:this.apiClient.httpClient.baseUrl,refreshToken:this.apiClient.httpClient.getRefreshToken()}},t);if(!(i instanceof Uint8Array))throw new a.a("Cloud job output was undefined");l=i}else{const t=u.modules.find((e=>"main"===e.name));if(!t)throw new a.a('Could not find a module with name "main"');c.filterOnFilesMappings(t.input_files_mappings,c.parameters);const n=c.serialize();l=yield this.runModuleWithoutSharedMemory({utils:r,moduleMetadata:{job:e,rootJobId:s,module:t,moduleSourceSerialized:null}},n)}const f=new g(l);return n(`Job with id ${e.public_id} finished computing`),i&&(yield this.killRootJob(e.public_id)),f}))}static runModuleWithoutSharedMemory(e,t){return C(this,void 0,void 0,(function*(){const r=yield this.runModuleHelper(e,t);if(r instanceof Uint8Array)return r;throw new a.a("Module output was undefined")}))}static runModule(e,t,r){return C(this,void 0,void 0,(function*(){yield this.runModuleHelper(e,t,r)}))}static runModuleHelper(e,t,r){return C(this,void 0,void 0,(function*(){const{moduleMetadata:n,utils:i}=e,{module:o,job:s,rootJobId:u}=n;let c;switch(o.environment){case S.b.biolibEcr:{const e=this.getRemoteExecutorInstance(u);c=yield e.executeModule({utils:i,remoteOptions:{job:s,moduleName:o.name,biolibApiBaseUrl:this.apiClient.httpClient.baseUrl,refreshToken:this.apiClient.httpClient.getRefreshToken()}},t,r);break}case S.b.biolibApp:{const e=new p(t);let r;try{r=I(o.command)}catch(e){throw new Error(`Failed to parse command for module ${o.name}: ${e.message}`)}e.parameters.unshift(...r);const n=yield this.fetchSerializedModuleSource(u,s.app_version,i.addLogMessage),a=new d(n);e.applyFilesMappings(o.input_files_mappings,e.parameters),e.addSourceFiles(a,o.source_files_mappings);c=(yield this.runAppVersion(o.image_uri,e,i,s.public_id)).serialize();break}case S.b.biolibCustom:{const l=this.getLocalExecutorInstance(u,o.image_uri);let f=n.moduleSourceSerialized;f||(f=yield this.fetchSerializedModuleSource(u,s.app_version,i.addLogMessage));try{c=yield l.executeModule(Object.assign(Object.assign({},e),{moduleMetadata:Object.assign(Object.assign({},n),{moduleSourceSerialized:f})}),t,r)}catch(e){throw a.a.chainErrors(`Failed to execute module: ${o.name}`,e)}break}}if(c instanceof Uint8Array){if(void 0===r)return c;A.a.writeToSharedMemoryBuffer(c,r)}}))}static fetchSerializedModuleSource(e,t,r){return C(this,void 0,void 0,(function*(){const{appVersionIdToSerializedModuleSource:i}=this.rootJobExecutorWrapperDict[e];if(i[t.public_id])return i[t.public_id];const{client_side_executable_zip:s}=t;if(!s)throw new a.a("Undefined URL for client side application files");r("Downloading application files");const u=new d;let c;try{c=(yield o.a.get(s,{responseType:"blob"})).data}catch(e){throw new a.a("Failed to download application files")}const l=yield n.loadAsync(c);for(const e in l.files){const t=l.files[e],r=e.split("/");r.shift();const n="/".concat(r.join("/")),i=yield t.async("uint8array");u.files[n]={data:i}}const f=u.serialize();return i[t.public_id]=f,f}))}static getRemoteExecutorInstance(e){const t=this.rootJobExecutorWrapperDict[e].executorInstances;for(const e in t){const r=t[e];if(r instanceof s.a&&!r.isInUse)return r}const r=new s.a;return t.push(r),r}static getLocalExecutorInstance(e,t){const[r,n]=t.split("/");if("biolib"!==r)throw new a.a("Unsupported custom executor");const[i,o]=n.split(":"),s=R[i];if(!s)throw new a.a("Unsupported executor type");const u=s[o];if(!u)throw new a.a("Unsupported executor version");const c=this.rootJobExecutorWrapperDict[e].executorInstances;for(const e in c){const t=c[e];if(t instanceof u&&!t.isInUse)return t}const l=new u;return c.push(l),l}}D.jobsDict={},D.rootJobExecutorWrapperDict={};t.a=D},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(40),i=r(0);class o{dummyMethod(){Object(n.a)({})}static checkAtomicsAndCreateSharedArray(){if("undefined"==typeof Atomics)throw new i.b("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)}}},function(e,t,r){"use strict";const n=()=>"function"==typeof Symbol,i=e=>n()&&Boolean(Symbol[e]),o=e=>i(e)?Symbol[e]:"@@"+e;i("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const s=o("iterator"),a=o("observable"),u=o("species");function c(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function l(e){let t=e.constructor;return void 0!==t&&(t=t[u],null===t&&(t=void 0)),void 0!==t?t:y}function f(e){f.log?f.log(e):setTimeout((()=>{throw e}),0)}function h(e){Promise.resolve().then((()=>{try{e()}catch(e){f(e)}}))}function d(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=c(t,"unsubscribe");e&&e.call(t)}}catch(e){f(e)}}function p(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function m(e,t,r){e._state="running";const n=e._observer;try{const i=n?c(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(p(e),!i)throw r;i.call(n,r);break;case"complete":p(e),i&&i.call(n)}}catch(e){f(e)}"closed"===e._state?d(e):"running"===e._state&&(e._state="ready")}function g(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 h((()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(m(e,r.type,r.value),"closed"===e._state)break}}(e)))):void m(e,t,r)}class _{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new b(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&&(p(this),d(this))}}class b{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){g(this._subscription,"next",e)}error(e){g(this._subscription,"error",e)}complete(){g(this._subscription,"complete")}}class y{constructor(e){if(!(this instanceof y))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 _(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 y((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(l(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(l(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=l(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=l(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=l(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()}}))}[a](){return this}static from(e){const t="function"==typeof this?this:y;if(null==e)throw new TypeError(e+" is not an object");const r=c(e,a);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 y}(n)&&n.constructor===t?n:new t((e=>n.subscribe(e)))}if(i("iterator")){const r=c(e,s);if(r)return new t((t=>{h((()=>{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=>{h((()=>{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:y)((t=>{h((()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}}))}))}static get[u](){return this}}n()&&Object.defineProperty(y,Symbol("extensions"),{value:{symbol:a,hostReportError:f},configurable:!0});t.a=y},function(e,t,r){"use strict";var n;r.d(t,"a",(function(){return n})),function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(n||(n={}))},function(e,t,r){"use strict";var n,i;r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i})),function(e){e.run="run"}(n||(n={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(i||(i={}))},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,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=a(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!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 m(){}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];c.push(new p(e,t)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,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";r.d(t,"a",(function(){return a}));var n=r(22),i=r(23),o=r(0),s=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 a{constructor(){this.isInUse=!1,this.KEEP_THREADS_ALIVE=!0,this.workerThread=null,this.executionPromiseRejectFunction=null,this.executeOptions=null}terminateWorkerThread(){return s(this,void 0,void 0,(function*(){try{this.workerThread&&(yield n.a.terminate(this.workerThread),this.workerThread=null)}catch(e){throw o.a.chainErrors("Failed to clean up thread",e)}}))}executeModule(e,t,r){return new Promise(((n,i)=>s(this,void 0,void 0,(function*(){try{if(this.isInUse=!0,this.executionPromiseRejectFunction=i,this.executeOptions=e,!this.workerThread){const e=this.getWorker();this.workerThread=yield this.startWorkerThread(e)}const o=yield this.executeModuleHelper(this.workerThread,e,t,r);n(o)}catch(e){yield this.terminateWorkerThread(),i(e)}finally{this.executeOptions=null,this.isInUse=!1}}))))}rejectPromise(e){this.executionPromiseRejectFunction?this.executionPromiseRejectFunction(e):console.error("Executor unable to reject error: ",e)}startWorkerThread(e){return s(this,void 0,void 0,(function*(){const t=yield Object(i.a)(e);return yield this.setObservables(t),t}))}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(4);function i(e){throw Error(e)}const o={errors:e=>e[n.a]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:e=>e[n.b]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:e=>e[n.c]()}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return _}));var n=r(11),i=r.n(n),o=r(17),s=r(7),a=r(37),u=r(4),c=r(18),l=r(26),f=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())}))};const h=i()("threads:master:messages"),d=i()("threads:master:spawn"),p=i()("threads:master:thread-utils"),m=void 0!==e&&e.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(e.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function g(e,t,r,n){const i=r.filter((e=>e.type===c.a.internalError)).map((e=>e.error));return Object.assign(e,{[u.a]:i,[u.b]:r,[u.c]:n,[u.e]:t})}function _(e,t){return f(this,void 0,void 0,(function*(){d("Initializing new thread");const r=(yield function(e,t,r){return f(this,void 0,void 0,(function*(){let n;const i=new Promise(((e,i)=>{n=setTimeout((()=>i(Error(r))),t)})),o=yield Promise.race([e,i]);return clearTimeout(n),o}))}(function(e){return new Promise(((t,r)=>{const n=i=>{var o;h("Message from worker before finishing initialization:",i.data),(o=i.data)&&"init"===o.type?(e.removeEventListener("message",n),t(i.data)):(e=>e&&"uncaughtError"===e.type)(i.data)&&(e.removeEventListener("message",n),r(Object(s.a)(i.data.error)))};e.addEventListener("message",n)}))}(e),t&&t.timeout?t.timeout:m,`Timeout: Did not receive an init message from worker after ${m}ms. Make sure the worker calls expose().`)).exposed,{termination:n,terminate:i}=function(e){const[t,r]=Object(a.a)();return{terminate:()=>f(this,void 0,void 0,(function*(){p("Terminating worker"),yield e.terminate(),r()})),termination:t}}(e),u=function(e,t){return new o.a((r=>{const n=e=>{const t={type:c.a.message,data:e.data};r.next(t)},i=e=>{p("Unhandled promise rejection event in thread:",e);const t={type:c.a.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",i),t.then((()=>{const t={type:c.a.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",i),r.next(t),r.complete()}))}))}(e,n);if("function"===r.type){return g(Object(l.a)(e),e,u,i)}if("module"===r.type){return g(Object(l.b)(e,r.methods),e,u,i)}{const e=r.type;throw Error(`Worker init message states unexpected type of expose(): ${e}`)}}))}}).call(this,r(20))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return a}));var n=r(0),i=r(21),o=r(10),s=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 a extends i.a{constructor(){super(...arguments),this.getWorker=()=>new o.a(e)}setObservables(e){return s(this,void 0,void 0,(function*(){try{e.statusUpdateObservable().subscribe((e=>{if(!this.executeOptions)return void console.error("Subscriber to statusUpdateObservable failed: thread options not set");const{message:t,progressCompute:r,progressInitialization:n}=e;t&&this.executeOptions.utils.addLogMessage(t),n&&this.executeOptions.utils.setProgressInitialization(n),r&&this.executeOptions.utils.setProgressCompute(r)}))}catch(e){throw n.a.chainErrors("Failed to set observables on thread",e)}}))}executeModuleHelper(e,t,r,n){return s(this,void 0,void 0,(function*(){return e.runJobRemote(t.remoteOptions,r,n)}))}}}).call(this,r(69))},function(e,t,r){"use strict";var n=r(78);function i(e){this.message=e}i.prototype=new Error,i.prototype.name="InvalidTokenError",e.exports=function(e,t){if("string"!=typeof e)throw new i("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(n(e.split(".")[r]))}catch(e){throw new i("Invalid token specified: "+e.message)}},e.exports.InvalidTokenError=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return w})),r.d(t,"b",(function(){return E}));var n=r(11),i=r.n(n),o=r(17);class s extends o.a{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 a=s;var u=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()};var c=function(e){const t=new a;let r,n=0;return new o.a((i=>{r||(r=e.subscribe(t));const o=t.subscribe(i);return n++,()=>{n--,o.unsubscribe(),0===n&&(u(r),r=void 0)}}))},l=r(7);const f=()=>{},h=e=>e,d=e=>Promise.resolve().then(e);function p(e){throw e}class m extends o.a{constructor(e){super((t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(e){n.error(e)}})),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state="rejected",this.rejection=e;for(const t of this.rejectionCallbacks)d((()=>t(e)))}onCompletion(){this.state="fulfilled";for(const e of this.fulfillmentCallbacks)d((()=>e(this.firstValue)))}then(e,t){const r=e||h,n=t||p;let i=!1;return new Promise(((e,t)=>{const o=r=>{if(!i){i=!0;try{e(n(r))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:o}),"fulfilled"===this.state?e(r(this.firstValue)):"rejected"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push((t=>{try{e(r(t))}catch(e){o(e)}})),void this.rejectionCallbacks.push(o))}))}catch(e){return this.then(void 0,e)}finally(e){const t=e||f;return this.then((e=>(t(),e)),(()=>t()))}static from(e){return function(e){return e&&"function"==typeof e.then}(e)?new m((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>{t.error(e)}))})):super.from(e)}}var g=r(38),_=r(19);const b=i()("threads:master:messages");let y=1;function v(e,t){return new o.a((r=>{let n;const i=o=>{var s;if(b("Message from worker:",o.data),o.data&&o.data.uid===t)if((s=o.data)&&s.type===_.b.running)n=o.data.resultType;else if((e=>e&&e.type===_.b.result)(o.data))"promise"===n?(void 0!==o.data.payload&&r.next(Object(l.a)(o.data.payload)),r.complete(),e.removeEventListener("message",i)):(o.data.payload&&r.next(Object(l.a)(o.data.payload)),o.data.complete&&(r.complete(),e.removeEventListener("message",i)));else if((e=>e&&e.type===_.b.error)(o.data)){const t=Object(l.a)(o.data.error);r.error(t),e.removeEventListener("message",i)}};return e.addEventListener("message",i),()=>e.removeEventListener("message",i)}))}function w(e,t){return(...r)=>{const n=y++,{args:i,transferables:o}=function(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)Object(g.a)(n)?(t.push(Object(l.b)(n.send)),r.push(...n.transferables)):t.push(Object(l.b)(n));return{args:t,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),s={type:_.a.run,uid:n,method:t,args:i};b("Sending command to run function to worker:",s);try{e.postMessage(s,o)}catch(e){return m.from(Promise.reject(e))}return m.from(c(v(e,n)))}}function E(e,t){const r={};for(const n of t)r[n]=w(e,n);return 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(3);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(3),i=r(57),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(32)),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(20))},function(e,t,r){"use strict";var n=r(3),i=r(58),o=r(60),s=r(29),a=r(61),u=r(64),c=r(65),l=r(33);e.exports=function(e){return new Promise((function(t,r){var f=e.data,h=e.headers;n.isFormData(f)&&delete h["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";h.Authorization="Basic "+btoa(p+":"+m)}var g=a(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),s(g,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?u(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};i(t,r,o),d=null}},d.onabort=function(){d&&(r(l("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){r(l("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var _=(e.withCredentials||c(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;_&&(h[e.xsrfHeaderName]=_)}if("setRequestHeader"in d&&n.forEach(h,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete h[t]:d.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),r(e),d=null)})),f||(f=null),d.send(f)}))}},function(e,t,r){"use strict";var n=r(59);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(3);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 c(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,c),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 l=i.concat(o).concat(s).concat(a),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return n.forEach(f,c),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){(function(t,r,n){e.exports=function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,r,n)}return r[s].exports}for(var o=!1,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,s,a,u,c,l=[],f=0,h=e.length,d=h,p="string"!==n.getTypeOf(e);f<e.length;)d=h-f,i=p?(t=e[f++],r=f<h?e[f++]:0,f<h?e[f++]:0):(t=e.charCodeAt(f++),r=f<h?e.charCodeAt(f++):0,f<h?e.charCodeAt(f++):0),s=t>>2,a=(3&t)<<4|r>>4,u=1<d?(15&r)<<2|i>>6:64,c=2<d?63&i:64,l.push(o.charAt(s)+o.charAt(a)+o.charAt(u)+o.charAt(c));return l.join("")},r.decode=function(e){var t,r,n,s,a,u,c=0,l=0,f="data:";if(e.substr(0,f.length)===f)throw new Error("Invalid base64 input, it looks like a data url.");var h,d=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&d--,e.charAt(e.length-2)===o.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=i.uint8array?new Uint8Array(0|d):new Array(0|d);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(s=o.indexOf(e.charAt(c++)))>>4,r=(15&s)<<4|(a=o.indexOf(e.charAt(c++)))>>2,n=(3&a)<<6|(u=o.indexOf(e.charAt(c++))),h[l++]=t,64!==a&&(h[l++]=r),64!==u&&(h[l++]=n);return h}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var n=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/DataLengthProbe"),s=e("./stream/Crc32Probe");function a(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o=e("./stream/DataLengthProbe"),a.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new o("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=i,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^o[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var o=i,s=n+r;e^=-1;for(var a=n;a<s;a++)e=e>>>8^o[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),s=e("./stream/GenericWorker"),a=n?"uint8array":"array";function u(e,t){s.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",o.inherits(u,s),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,e.data),!1)},u.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function i(e,t,r,i,s,l){var f,h,d=e.file,p=e.compression,m=l!==a.utf8encode,g=o.transformTo("string",l(d.name)),_=o.transformTo("string",a.utf8encode(d.name)),b=d.comment,y=o.transformTo("string",l(b)),v=o.transformTo("string",a.utf8encode(b)),w=_.length!==d.name.length,E=v.length!==b.length,S="",A="",B="",O=d.dir,T=d.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var N=0;t&&(N|=8),m||!w&&!E||(N|=2048);var k=0,I=0;O&&(k|=16),"UNIX"===s?(I=798,k|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(d.unixPermissions,O)):(I=20,k|=function(e){return 63&(e||0)}(d.dosPermissions)),f=T.getUTCHours(),f<<=6,f|=T.getUTCMinutes(),f<<=5,f|=T.getUTCSeconds()/2,h=T.getUTCFullYear()-1980,h<<=4,h|=T.getUTCMonth()+1,h<<=5,h|=T.getUTCDate(),w&&(A=n(1,1)+n(u(g),4)+_,S+="up"+n(A.length,2)+A),E&&(B=n(1,1)+n(u(y),4)+v,S+="uc"+n(B.length,2)+B);var C="";return C+="\n\0",C+=n(N,2),C+=p.magic,C+=n(f,2),C+=n(h,2),C+=n(x.crc32,4),C+=n(x.compressedSize,4),C+=n(x.uncompressedSize,4),C+=n(g.length,2),C+=n(S.length,2),{fileRecord:c.LOCAL_FILE_HEADER+C+g+S,dirRecord:c.CENTRAL_FILE_HEADER+n(I,2)+C+n(y.length,2)+"\0\0\0\0"+n(k,4)+n(i,4)+g+S+y}}var o=e("../utils"),s=e("../stream/GenericWorker"),a=e("../utf8"),u=e("../crc32"),c=e("../signature");function l(e,t,r,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(l,s),l.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},l.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,s){var a=o.transformTo("string",s(i));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(a.length,2)+a}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},l.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(e){var t=this._sources;if(!s.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},l.prototype.lock=function(){s.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var o=new i(t.streamFiles,r,t.platform,t.encodeFileName),s=0;try{e.forEach((function(e,r){s++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),a=r.options.compressionOptions||t.compressionOptions||{},u=r.dir,c=r.date;r._compressWorker(i,a).withStreamInfo("file",{name:e,dir:u,date:c,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(o)})),o.entriesCount=s}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.4.0",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var n=e("./utils"),i=e("./external"),o=e("./utf8"),s=(n=e("./utils"),e("./zipEntries")),a=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function c(e){return new i.Promise((function(t,r){var n=e.decompressed.getContentWorker().pipe(new a);n.on("error",(function(e){r(e)})).on("end",(function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new s(t);return r.load(e),r})).then((function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o<n.length;o++)r.push(c(n[o]));return i.Promise.all(r)})).then((function(e){for(var n=e.shift(),i=n.files,o=0;o<i.length;o++){var s=i[o];r.file(s.fileNameStr,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders})}return n.zipComment.length&&(r.comment=n.zipComment),r}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var n=e("readable-stream").Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),r&&r(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,r,n){"use strict";r.exports={isNode:void 0!==t,newBufferFrom:function(e,r){if(t.from&&t.from!==Uint8Array.from)return t.from(e,r);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new t(e,r)},allocBuffer:function(e){if(t.alloc)return t.alloc(e);var r=new t(e);return r.fill(0),r},isBuffer:function(e){return t.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){"use strict";function n(e,t,r){var n,i=o.getTypeOf(t),a=o.extend(r||{},u);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(e=m(e)),a.createFolders&&(n=p(e))&&g.call(this,n,!0);var f="string"===i&&!1===a.binary&&!1===a.base64;r&&void 0!==r.binary||(a.binary=!f),(t instanceof c&&0===t.uncompressedSize||a.dir||!t||0===t.length)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",i="string");var _=null;_=t instanceof c||t instanceof s?t:h.isNode&&h.isStream(t)?new d(e,t):o.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var b=new l(e,_,a);this.files[e]=b}var i=e("./utf8"),o=e("./utils"),s=e("./stream/GenericWorker"),a=e("./stream/StreamHelper"),u=e("./defaults"),c=e("./compressedObject"),l=e("./zipObject"),f=e("./generate"),h=e("./nodejsUtils"),d=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:u.createFolders,e=m(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function _(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)this.files.hasOwnProperty(t)&&(n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n))},filter:function(e){var t=[];return this.forEach((function(r,n){e(r,n)&&t.push(n)})),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(_(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(_(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");o.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=f.generateWorker(this,r,n)}catch(e){(t=new s("error")).error(e)}return new a(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),s=e("./StringReader"),a=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new a(e):i.uint8array?new u(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,r,n){"use strict";var i=e("../utils"),o=e("./ConvertWorker"),s=e("./GenericWorker"),a=e("../base64"),u=e("../support"),c=e("../external"),l=null;if(u.nodestream)try{l=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function f(e,r){return new c.Promise((function(n,o){var s=[],u=e._internalType,c=e._outputType,l=e._mimeType;e.on("data",(function(e,t){s.push(e),r&&r(t)})).on("error",(function(e){s=[],o(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),r);case"base64":return a.encode(t);default:return i.transformTo(e,t)}}(c,function(e,r){var n,i=0,o=null,s=0;for(n=0;n<r.length;n++)s+=r[n].length;switch(e){case"string":return r.join("");case"array":return Array.prototype.concat.apply([],r);case"uint8array":for(o=new Uint8Array(s),n=0;n<r.length;n++)o.set(r[n],i),i+=r[n].length;return o;case"nodebuffer":return t.concat(r);default:throw new Error("concat : unsupported type '"+e+"'")}}(u,s),l);n(e)}catch(e){o(e)}s=[]})).resume()}))}function h(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=t,this._mimeType=r,i.checkSupport(n),this._worker=e.pipe(new o(n)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}h.prototype={accumulate:function(e){return f(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){i.delay(t,arguments,r)})),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:"nodebuffer"!==this._outputType},e)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,r,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=void 0!==t,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(i),n.blob=0===o.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){"use strict";for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),s=e("./stream/GenericWorker"),a=new Array(256),u=0;u<256;u++)a[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function c(){s.call(this,"utf-8 decode"),this.leftOver=null}function l(){s.call(this,"utf-8 encode")}a[254]=a[254]=1,r.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,s,a=e.length,u=0;for(o=0;o<a;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(u):new Array(u),o=s=0;s<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,s=e.length,u=new Array(2*s);for(t=r=0;t<s;)if((i=e[t++])<128)u[r++]=i;else if(4<(o=a[i]))u[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<s;)i=i<<6|63&e[t++],o--;1<o?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(c,s),c.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var s=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}(t),u=t;s!==t.length&&(i.uint8array?(u=t.subarray(0,s),this.leftOver=t.subarray(s,t.length)):(u=t.slice(0,s),this.leftOver=t.slice(s,t.length))),this.push({data:r.utf8decode(u),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,n.inherits(l,s),l.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){"use strict";var n=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),s=e("set-immediate-shim"),a=e("./external");function u(e){return e}function c(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}r.newBlob=function(e,t){r.checkSupport("blob");try{return new Blob([e],{type:t})}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(e),n.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(e,t,r){var n=[],i=0,o=e.length;if(o<=r)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,o)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,o)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function f(e){var t=65536,n=r.getTypeOf(e),i=!0;if("uint8array"===n?i=l.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,n,t)}catch(e){t=Math.floor(t/2)}return l.stringifyByChar(e)}function h(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.applyFromCharCode=f;var d={};d.string={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return d.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,o.allocBuffer(e.length))}},d.array={string:f,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},d.arraybuffer={string:function(e){return f(new Uint8Array(e))},array:function(e){return h(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},d.uint8array={string:f,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return o.newBufferFrom(e)}},d.nodebuffer={string:f,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return d.nodebuffer.uint8array(e).buffer},uint8array:function(e){return h(e,new Uint8Array(e.length))},nodebuffer:u},r.transformTo=function(e,t){if(t=t||"",!e)return t;r.checkSupport(e);var n=r.getTypeOf(t);return d[n][e](t)},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&o.isBuffer(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},r.delay=function(e,t,r){s((function(){e.apply(r||null,t||[])}))},r.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},r.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},r.prepareContent=function(e,t,o,s,u){return a.Promise.resolve(t).then((function(e){return n.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new a.Promise((function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)})):e})).then((function(t){var l=r.getTypeOf(t);return l?("arraybuffer"===l?t=r.transformTo("uint8array",t):"string"===l&&(u?t=i.decode(t):o&&!0!==s&&(t=function(e){return c(e,n.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):a.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),s=e("./zipEntry"),a=(e("./utf8"),e("./support"));function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=a.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),s=e("./crc32"),a=e("./utf8"),u=e("./compressions"),c=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in u)if(u.hasOwnProperty(t)&&u[t].magic===e)return u[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n}},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||s(this.fileName)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||s(this.fileComment)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),s=e("./utf8"),a=e("./compressedObject"),u=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!n&&(t=t.pipe(new s.Utf8EncodeWorker)),!o&&n&&(t=t.pipe(new s.Utf8DecodeWorker))}catch(e){(t=new u("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof a&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new s.Utf8EncodeWorker)),a.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof u?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<c.length;f++)n.prototype[c[f]]=l;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){"use strict";var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,s=new i(l),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var u=new e.MessageChannel;u.port1.onmessage=l,r=function(){u.port2.postMessage(0)}}var c=[];function l(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){"use strict";var n=e("immediate");function i(){}var o={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&d(this,e)}function l(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(e,t,r){n((function(){var n;try{n=t(r)}catch(n){return o.reject(e,n)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)}))}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var s=p((function(){t(i,n)}));"error"===s.status&&n(s.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(i);return this.state!==u?f(r,this.state===a?e:t,this.outcome):this.queue.push(new l(r,e,t)),r},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(h,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=a,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),a=0,u=-1,c=new this(i);++u<r;)l(e[u],u);return c;function l(e,i){t.resolve(e).then((function(e){s[i]=e,++a!==r||n||(n=!0,o.resolve(c,s))}),(function(e){n||(n=!0,o.reject(c,e))}))}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var s,a=-1,u=new this(i);++a<r;)s=e[a],t.resolve(s).then((function(e){n||(n=!0,o.resolve(u,e))}),(function(e){n||(n=!0,o.reject(u,e))}));return u}},{immediate:36}],38:[function(e,t,r){"use strict";var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/messages"),a=e("./zlib/zstream"),u=Object.prototype.toString,c=0,l=-1,f=0,h=8;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({level:l,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==c)throw new Error(s[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==c)throw new Error(s[r]);this._dict_set=!0}}function p(e,t){var r=new d(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}d.prototype.push=function(e,t){var r,s,a=this.strm,l=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new i.Buf8(l),a.next_out=0,a.avail_out=l),1!==(r=n.deflate(a,s))&&r!==c)return this.onEnd(r),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(a.output,a.next_out))):this.onData(i.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==r);return 4===s?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===c):2!==s||(this.onEnd(c),!(a.avail_out=0))},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=d,r.deflate=p,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),s=e("./zlib/constants"),a=e("./zlib/messages"),u=e("./zlib/zstream"),c=e("./zlib/gzheader"),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(e,t){var r,a,u,c,f,h,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(p),d.next_out=0,d.avail_out=p),(r=n.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(h="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===l.call(m)?new Uint8Array(m):m,r=n.inflateSetDictionary(this.strm,h)),r===s.Z_BUF_ERROR&&!0===g&&(r=s.Z_OK,g=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&r!==s.Z_STREAM_END&&(0!==d.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(d.output,d.next_out),c=d.next_out-u,f=o.buf2string(d.output,u),d.next_out=c,d.avail_out=p-c,c&&i.arraySet(d.output,d.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(g=!0)}while((0<d.avail_in||0===d.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(d.avail_out=0))},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=f,r.inflate=h,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.ungzip=h},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,s;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){"use strict";var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function u(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s<t;s++)r+=String.fromCharCode(e[s]);return r}s[254]=s[254]=1,r.string2buf=function(e){var t,r,i,o,s,a=e.length,u=0;for(o=0;o<a;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),o=s=0;s<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[s++]=r:(r<2048?t[s++]=192|r>>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,a=t||e.length,c=new Array(2*a);for(r=n=0;r<a;)if((i=e[r++])<128)c[n++]=i;else if(4<(o=s[i]))c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&r<a;)i=i<<6|63&e[r++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3<r?2e3:r;o=o+(i=i+t[n++]|0)|0,--s;);i%=65521,o%=65521}return i|o<<16|0}},{}],44:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,s=i+r;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,r){"use strict";var n,i=e("../utils/common"),o=e("./trees"),s=e("./adler32"),a=e("./crc32"),u=e("./messages"),c=0,l=4,f=0,h=-2,d=-1,p=4,m=2,g=8,_=9,b=286,y=30,v=19,w=2*b+1,E=15,S=3,A=258,B=A+S+1,O=42,T=113,x=1,N=2,k=3,I=4;function C(e,t){return e.msg=u[t],t}function R(e){return(e<<1)-(4<e?9:0)}function D(e){for(var t=e.length;0<=--t;)e[t]=0}function z(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function U(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,z(e.strm)}function P(e,t){e.pending_buf[e.pending++]=t}function $(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function j(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-B?e.strstart-(e.w_size-B):0,c=e.window,l=e.w_mask,f=e.prev,h=e.strstart+A,d=c[o+s-1],p=c[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(r=t)+s]===p&&c[r+s-1]===d&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<h);if(n=A-(h-o),o=h-A,s<n){if(e.match_start=t,a<=(s=n))break;d=c[o+s-1],p=c[o+s]}}}while((t=f[t&l])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead}function M(e){var t,r,n,o,u,c,l,f,h,d,p=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-B)){for(i.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;n=e.head[--t],e.head[t]=p<=n?n-p:0,--r;);for(t=r=p;n=e.prev[--t],e.prev[t]=p<=n?n-p:0,--r;);o+=p}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,f=e.strstart+e.lookahead,d=void 0,(h=o)<(d=c.avail_in)&&(d=h),r=0===d?0:(c.avail_in-=d,i.arraySet(l,c.input,c.next_in,d,f),1===c.state.wrap?c.adler=s(c.adler,l,d,f):2===c.state.wrap&&(c.adler=a(c.adler,l,d,f)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=S)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+S-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<S)););}while(e.lookahead<B&&0!==e.strm.avail_in)}function F(e,t){for(var r,n;;){if(e.lookahead<B){if(M(e),e.lookahead<B&&t===c)return x;if(0===e.lookahead)break}if(r=0,e.lookahead>=S&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-B&&(e.match_length=j(e,r)),e.match_length>=S)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-S),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=S){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(U(e,!1),0===e.strm.avail_out))return x}return e.insert=e.strstart<S-1?e.strstart:S-1,t===l?(U(e,!0),0===e.strm.avail_out?k:I):e.last_lit&&(U(e,!1),0===e.strm.avail_out)?x:N}function L(e,t){for(var r,n,i;;){if(e.lookahead<B){if(M(e),e.lookahead<B&&t===c)return x;if(0===e.lookahead)break}if(r=0,e.lookahead>=S&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=S-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-B&&(e.match_length=j(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===S&&4096<e.strstart-e.match_start)&&(e.match_length=S-1)),e.prev_length>=S&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-S,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-S),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+S-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=S-1,e.strstart++,n&&(U(e,!1),0===e.strm.avail_out))return x}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&U(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return x}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<S-1?e.strstart:S-1,t===l?(U(e,!0),0===e.strm.avail_out?k:I):e.last_lit&&(U(e,!1),0===e.strm.avail_out)?x:N}function Y(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function W(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*w),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*v+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(E+1),this.heap=new i.Buf16(2*b+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*b+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function J(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=m,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?O:T,e.adler=2===t.wrap?0:1,t.last_flush=c,o._tr_init(t),f):C(e,h)}function H(e){var t=J(e);return t===f&&function(e){e.window_size=2*e.w_size,D(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=S-1,e.match_available=0,e.ins_h=0}(e.state),t}function q(e,t,r,n,o,s){if(!e)return h;var a=1;if(t===d&&(t=6),n<0?(a=0,n=-n):15<n&&(a=2,n-=16),o<1||_<o||r!==g||n<8||15<n||t<0||9<t||s<0||p<s)return C(e,h);8===n&&(n=9);var u=new W;return(e.state=u).strm=e,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+S-1)/S),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=s,u.method=r,H(e)}n=[new Y(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(M(e),0===e.lookahead&&t===c)return x;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,U(e,!1),0===e.strm.avail_out))return x;if(e.strstart-e.block_start>=e.w_size-B&&(U(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===l?(U(e,!0),0===e.strm.avail_out?k:I):(e.strstart>e.block_start&&(U(e,!1),e.strm.avail_out),x)})),new Y(4,4,8,4,F),new Y(4,5,16,8,F),new Y(4,6,32,32,F),new Y(4,4,16,16,L),new Y(8,16,32,32,L),new Y(8,16,128,128,L),new Y(8,32,128,256,L),new Y(32,128,258,1024,L),new Y(32,258,258,4096,L)],r.deflateInit=function(e,t){return q(e,t,g,15,8,0)},r.deflateInit2=q,r.deflateReset=H,r.deflateResetKeep=J,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,f):h},r.deflate=function(e,t){var r,i,s,u;if(!e||!e.state||5<t||t<0)return e?C(e,h):h;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==l)return C(e,0===e.avail_out?-5:h);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===O)if(2===i.wrap)e.adler=0,P(i,31),P(i,139),P(i,8),i.gzhead?(P(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),P(i,255&i.gzhead.time),P(i,i.gzhead.time>>8&255),P(i,i.gzhead.time>>16&255),P(i,i.gzhead.time>>24&255),P(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),P(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(P(i,255&i.gzhead.extra.length),P(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(P(i,0),P(i,0),P(i,0),P(i,0),P(i,0),P(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),P(i,3),i.status=T);else{var d=g+(i.w_bits-8<<4)<<8;d|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(d|=32),d+=31-d%31,i.status=T,$(i,d),0!==i.strstart&&($(i,e.adler>>>16),$(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),z(e),s=i.pending,i.pending!==i.pending_buf_size));)P(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),z(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,P(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),z(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,P(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&z(e),i.pending+2<=i.pending_buf_size&&(P(i,255&e.adler),P(i,e.adler>>8&255),e.adler=0,i.status=T)):i.status=T),0!==i.pending){if(z(e),0===e.avail_out)return i.last_flush=-1,f}else if(0===e.avail_in&&R(t)<=R(r)&&t!==l)return C(e,-5);if(666===i.status&&0!==e.avail_in)return C(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var p=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(M(e),0===e.lookahead)){if(t===c)return x;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(U(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===l?(U(e,!0),0===e.strm.avail_out?k:I):e.last_lit&&(U(e,!1),0===e.strm.avail_out)?x:N}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=A){if(M(e),e.lookahead<=A&&t===c)return x;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=S&&0<e.strstart&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+A;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<s);e.match_length=A-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=S?(r=o._tr_tally(e,1,e.match_length-S),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(U(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===l?(U(e,!0),0===e.strm.avail_out?k:I):e.last_lit&&(U(e,!1),0===e.strm.avail_out)?x:N}(i,t):n[i.level].func(i,t);if(p!==k&&p!==I||(i.status=666),p===x||p===k)return 0===e.avail_out&&(i.last_flush=-1),f;if(p===N&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(D(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),z(e),0===e.avail_out))return i.last_flush=-1,f}return t!==l?f:i.wrap<=0?1:(2===i.wrap?(P(i,255&e.adler),P(i,e.adler>>8&255),P(i,e.adler>>16&255),P(i,e.adler>>24&255),P(i,255&e.total_in),P(i,e.total_in>>8&255),P(i,e.total_in>>16&255),P(i,e.total_in>>24&255)):($(i,e.adler>>>16),$(i,65535&e.adler)),z(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?f:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==O&&69!==t&&73!==t&&91!==t&&103!==t&&t!==T&&666!==t?C(e,h):(e.state=null,t===T?C(e,-3):f):h},r.deflateSetDictionary=function(e,t){var r,n,o,a,u,c,l,d,p=t.length;if(!e||!e.state)return h;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==O||r.lookahead)return h;for(1===a&&(e.adler=s(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===a&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),d=new i.Buf8(r.w_size),i.arraySet(d,t,p-r.w_size,r.w_size,0),t=d,p=r.w_size),u=e.avail_in,c=e.next_in,l=e.input,e.avail_in=p,e.next_in=0,e.input=t,M(r);r.lookahead>=S;){for(n=r.strstart,o=r.lookahead-(S-1);r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+S-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--o;);r.strstart=n,r.lookahead=S-1,M(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=S-1,r.match_available=0,e.next_in=c,e.input=l,e.avail_in=u,r.wrap=a,f},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,o,s,a,u,c,l,f,h,d,p,m,g,_,b,y,v,w,E,S,A,B,O;r=e.state,n=e.next_in,B=e.input,i=n+(e.avail_in-5),o=e.next_out,O=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,m=r.lencode,g=r.distcode,_=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(d+=B[n++]<<p,p+=8,d+=B[n++]<<p,p+=8),y=m[d&_];t:for(;;){if(d>>>=v=y>>>24,p-=v,0==(v=y>>>16&255))O[o++]=65535&y;else{if(!(16&v)){if(0==(64&v)){y=m[(65535&y)+(d&(1<<v)-1)];continue t}if(32&v){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&y,(v&=15)&&(p<v&&(d+=B[n++]<<p,p+=8),w+=d&(1<<v)-1,d>>>=v,p-=v),p<15&&(d+=B[n++]<<p,p+=8,d+=B[n++]<<p,p+=8),y=g[d&b];r:for(;;){if(d>>>=v=y>>>24,p-=v,!(16&(v=y>>>16&255))){if(0==(64&v)){y=g[(65535&y)+(d&(1<<v)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(E=65535&y,p<(v&=15)&&(d+=B[n++]<<p,(p+=8)<v&&(d+=B[n++]<<p,p+=8)),u<(E+=d&(1<<v)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=v,p-=v,(v=o-s)<E){if(l<(v=E-v)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=h,(S=0)===f){if(S+=c-v,v<w){for(w-=v;O[o++]=h[S++],--v;);S=o-E,A=O}}else if(f<v){if(S+=c+f-v,(v-=f)<w){for(w-=v;O[o++]=h[S++],--v;);if(S=0,f<w){for(w-=v=f;O[o++]=h[S++],--v;);S=o-E,A=O}}}else if(S+=f-v,v<w){for(w-=v;O[o++]=h[S++],--v;);S=o-E,A=O}for(;2<w;)O[o++]=A[S++],O[o++]=A[S++],O[o++]=A[S++],w-=3;w&&(O[o++]=A[S++],1<w&&(O[o++]=A[S++]))}else{for(S=o-E;O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],2<(w-=3););w&&(O[o++]=O[S++],1<w&&(O[o++]=O[S++]))}break}}break}}while(n<i&&o<a);n-=w=p>>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<a?a-o+257:257-(o-a),r.hold=d,r.bits=p}},{}],49:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),s=e("./inffast"),a=e("./inftrees"),u=1,c=2,l=0,f=-2,h=1,d=852,p=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=h,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(d),t.distcode=t.distdyn=new n.Buf32(p),t.sane=1,t.back=-1,l):f}function b(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):f}function y(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?f:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,b(e))):f}function v(e,t){var r,n;return e?(n=new g,(e.state=n).window=null,(r=y(e,t))!==l&&(e.state=null),r):f}var w,E,S=!0;function A(e){if(S){var t;for(w=new n.Buf32(512),E=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(u,e.lens,0,288,w,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(c,e.lens,0,32,E,0,e.work,{bits:5}),S=!1}e.lencode=w,e.lenbits=9,e.distcode=E,e.distbits=5}function B(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(o=s.wsize-s.wnext)&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}r.inflateReset=b,r.inflateReset2=y,r.inflateResetKeep=_,r.inflateInit=function(e){return v(e,15)},r.inflateInit2=v,r.inflate=function(e,t){var r,d,p,g,_,b,y,v,w,E,S,O,T,x,N,k,I,C,R,D,z,U,P,$,j=0,M=new n.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return f;12===(r=e.state).mode&&(r.mode=13),_=e.next_out,p=e.output,y=e.avail_out,g=e.next_in,d=e.input,b=e.avail_in,v=r.hold,w=r.bits,E=b,S=y,U=l;e:for(;;)switch(r.mode){case h:if(0===r.wrap){r.mode=13;break}for(;w<16;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(2&r.wrap&&35615===v){M[r.check=0]=255&v,M[1]=v>>>8&255,r.check=o(r.check,M,2,0),w=v=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&v)){e.msg="unknown compression method",r.mode=30;break}if(w-=4,z=8+(15&(v>>>=4)),0===r.wbits)r.wbits=z;else if(z>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<z,e.adler=r.check=1,r.mode=512&v?10:12,w=v=0;break;case 2:for(;w<16;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(r.flags=v,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=v>>8&1),512&r.flags&&(M[0]=255&v,M[1]=v>>>8&255,r.check=o(r.check,M,2,0)),w=v=0,r.mode=3;case 3:for(;w<32;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}r.head&&(r.head.time=v),512&r.flags&&(M[0]=255&v,M[1]=v>>>8&255,M[2]=v>>>16&255,M[3]=v>>>24&255,r.check=o(r.check,M,4,0)),w=v=0,r.mode=4;case 4:for(;w<16;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(M[0]=255&v,M[1]=v>>>8&255,r.check=o(r.check,M,2,0)),w=v=0,r.mode=5;case 5:if(1024&r.flags){for(;w<16;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(M[0]=255&v,M[1]=v>>>8&255,r.check=o(r.check,M,2,0)),w=v=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(b<(O=r.length)&&(O=b),O&&(r.head&&(z=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,d,g,O,z)),512&r.flags&&(r.check=o(r.check,d,O,g)),b-=O,g+=O,r.length-=O),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===b)break e;for(O=0;z=d[g+O++],r.head&&z&&r.length<65536&&(r.head.name+=String.fromCharCode(z)),z&&O<b;);if(512&r.flags&&(r.check=o(r.check,d,O,g)),b-=O,g+=O,z)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===b)break e;for(O=0;z=d[g+O++],r.head&&z&&r.length<65536&&(r.head.comment+=String.fromCharCode(z)),z&&O<b;);if(512&r.flags&&(r.check=o(r.check,d,O,g)),b-=O,g+=O,z)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;w<16;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(v!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}w=v=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;w<32;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}e.adler=r.check=m(v),w=v=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=b,r.hold=v,r.bits=w,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){v>>>=7&w,w-=7&w,r.mode=27;break}for(;w<3;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}switch(r.last=1&v,w-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(A(r),r.mode=20,6!==t)break;v>>>=2,w-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}v>>>=2,w-=2;break;case 14:for(v>>>=7&w,w-=7&w;w<32;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,w=v=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(O=r.length){if(b<O&&(O=b),y<O&&(O=y),0===O)break e;n.arraySet(p,d,g,O,_),b-=O,g+=O,y-=O,_+=O,r.length-=O;break}r.mode=12;break;case 17:for(;w<14;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(r.nlen=257+(31&v),v>>>=5,w-=5,r.ndist=1+(31&v),v>>>=5,w-=5,r.ncode=4+(15&v),v>>>=4,w-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;w<3;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}r.lens[F[r.have++]]=7&v,v>>>=3,w-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},U=a(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,U){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;k=(j=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,I=65535&j,!((N=j>>>24)<=w);){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(I<16)v>>>=N,w-=N,r.lens[r.have++]=I;else{if(16===I){for($=N+2;w<$;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(v>>>=N,w-=N,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}z=r.lens[r.have-1],O=3+(3&v),v>>>=2,w-=2}else if(17===I){for($=N+3;w<$;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}w-=N,z=0,O=3+(7&(v>>>=N)),v>>>=3,w-=3}else{for($=N+7;w<$;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}w-=N,z=0,O=11+(127&(v>>>=N)),v>>>=7,w-=7}if(r.have+O>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;O--;)r.lens[r.have++]=z}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,P={bits:r.lenbits},U=a(u,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,U){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},U=a(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,U){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=b&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=b,r.hold=v,r.bits=w,s(e,S),_=e.next_out,p=e.output,y=e.avail_out,g=e.next_in,d=e.input,b=e.avail_in,v=r.hold,w=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;k=(j=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,I=65535&j,!((N=j>>>24)<=w);){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(k&&0==(240&k)){for(C=N,R=k,D=I;k=(j=r.lencode[D+((v&(1<<C+R)-1)>>C)])>>>16&255,I=65535&j,!(C+(N=j>>>24)<=w);){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}v>>>=C,w-=C,r.back+=C}if(v>>>=N,w-=N,r.back+=N,r.length=I,0===k){r.mode=26;break}if(32&k){r.back=-1,r.mode=12;break}if(64&k){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&k,r.mode=22;case 22:if(r.extra){for($=r.extra;w<$;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}r.length+=v&(1<<r.extra)-1,v>>>=r.extra,w-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;k=(j=r.distcode[v&(1<<r.distbits)-1])>>>16&255,I=65535&j,!((N=j>>>24)<=w);){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(0==(240&k)){for(C=N,R=k,D=I;k=(j=r.distcode[D+((v&(1<<C+R)-1)>>C)])>>>16&255,I=65535&j,!(C+(N=j>>>24)<=w);){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}v>>>=C,w-=C,r.back+=C}if(v>>>=N,w-=N,r.back+=N,64&k){e.msg="invalid distance code",r.mode=30;break}r.offset=I,r.extra=15&k,r.mode=24;case 24:if(r.extra){for($=r.extra;w<$;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}r.offset+=v&(1<<r.extra)-1,v>>>=r.extra,w-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===y)break e;if(O=S-y,r.offset>O){if((O=r.offset-O)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}T=O>r.wnext?(O-=r.wnext,r.wsize-O):r.wnext-O,O>r.length&&(O=r.length),x=r.window}else x=p,T=_-r.offset,O=r.length;for(y<O&&(O=y),y-=O,r.length-=O;p[_++]=x[T++],--O;);0===r.length&&(r.mode=21);break;case 26:if(0===y)break e;p[_++]=r.length,y--,r.mode=21;break;case 27:if(r.wrap){for(;w<32;){if(0===b)break e;b--,v|=d[g++]<<w,w+=8}if(S-=y,e.total_out+=S,r.total+=S,S&&(e.adler=r.check=r.flags?o(r.check,p,S,_-S):i(r.check,p,S,_-S)),S=y,(r.flags?v:m(v))!==r.check){e.msg="incorrect data check",r.mode=30;break}w=v=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;w<32;){if(0===b)break e;b--,v+=d[g++]<<w,w+=8}if(v!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}w=v=0}r.mode=29;case 29:U=1;break e;case 30:U=-3;break e;case 31:return-4;case 32:default:return f}return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=b,r.hold=v,r.bits=w,(r.wsize||S!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&B(e,e.output,e.next_out,S-e.avail_out)?(r.mode=31,-4):(E-=e.avail_in,S-=e.avail_out,e.total_in+=E,e.total_out+=S,r.total+=S,r.wrap&&S&&(e.adler=r.check=r.flags?o(r.check,p,S,e.next_out-S):i(r.check,p,S,e.next_out-S)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==E&&0===S||4===t)&&U===l&&(U=-5),U)},r.inflateEnd=function(e){if(!e||!e.state)return f;var t=e.state;return t.window&&(t.window=null),e.state=null,l},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?f:((r.head=t).done=!1,l):f},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?f:11===r.mode&&i(1,t,n,0)!==r.check?-3:B(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,l):f},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,u,c,l,f,h){var d,p,m,g,_,b,y,v,w,E=h.bits,S=0,A=0,B=0,O=0,T=0,x=0,N=0,k=0,I=0,C=0,R=null,D=0,z=new n.Buf16(16),U=new n.Buf16(16),P=null,$=0;for(S=0;S<=15;S++)z[S]=0;for(A=0;A<u;A++)z[t[r+A]]++;for(T=E,O=15;1<=O&&0===z[O];O--);if(O<T&&(T=O),0===O)return c[l++]=20971520,c[l++]=20971520,h.bits=1,0;for(B=1;B<O&&0===z[B];B++);for(T<B&&(T=B),S=k=1;S<=15;S++)if(k<<=1,(k-=z[S])<0)return-1;if(0<k&&(0===e||1!==O))return-1;for(U[1]=0,S=1;S<15;S++)U[S+1]=U[S]+z[S];for(A=0;A<u;A++)0!==t[r+A]&&(f[U[t[r+A]]++]=A);if(b=0===e?(R=P=f,19):1===e?(R=i,D-=257,P=o,$-=257,256):(R=s,P=a,-1),S=B,_=l,N=A=C=0,m=-1,g=(I=1<<(x=T))-1,1===e&&852<I||2===e&&592<I)return 1;for(;;){for(y=S-N,w=f[A]<b?(v=0,f[A]):f[A]>b?(v=P[$+f[A]],R[D+f[A]]):(v=96,0),d=1<<S-N,B=p=1<<x;c[_+(C>>N)+(p-=d)]=y<<24|v<<16|w|0,0!==p;);for(d=1<<S-1;C&d;)d>>=1;if(0!==d?(C&=d-1,C+=d):C=0,A++,0==--z[S]){if(S===O)break;S=t[r+f[A]]}if(T<S&&(C&g)!==m){for(0===N&&(N=T),_+=B,k=1<<(x=S-N);x+N<O&&!((k-=z[x+N])<=0);)x++,k<<=1;if(I+=1<<x,1===e&&852<I||2===e&&592<I)return 1;c[m=C&g]=T<<24|x<<16|_-l|0}}return 0!==C&&(c[_+C]=S-N<<24|64<<16|0),h.bits=T,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){"use strict";var n=e("../utils/common"),i=0,o=1;function s(e){for(var t=e.length;0<=--t;)e[t]=0}var a=0,u=29,c=256,l=c+1+u,f=30,h=19,d=2*l+1,p=15,m=16,g=7,_=256,b=16,y=17,v=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=new Array(2*(l+2));s(B);var O=new Array(2*f);s(O);var T=new Array(512);s(T);var x=new Array(256);s(x);var N=new Array(u);s(N);var k,I,C,R=new Array(f);function D(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function z(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function U(e){return e<256?T[e]:T[256+(e>>>7)]}function P(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function $(e,t,r){e.bi_valid>m-r?(e.bi_buf|=t<<e.bi_valid&65535,P(e,e.bi_buf),e.bi_buf=t>>m-e.bi_valid,e.bi_valid+=r-m):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function j(e,t,r){$(e,r[2*t],r[2*t+1])}function M(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function F(e,t,r){var n,i,o=new Array(p+1),s=0;for(n=1;n<=p;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=M(o[a]++,a))}}function L(e){var t;for(t=0;t<l;t++)e.dyn_ltree[2*t]=0;for(t=0;t<f;t++)e.dyn_dtree[2*t]=0;for(t=0;t<h;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*_]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Y(e){8<e.bi_valid?P(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function W(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function J(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&W(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!W(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function H(e,t,r){var n,i,o,s,a=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*a]<<8|e.pending_buf[e.d_buf+2*a+1],i=e.pending_buf[e.l_buf+a],a++,0===n?j(e,i,t):(j(e,(o=x[i])+c+1,t),0!==(s=w[o])&&$(e,i-=N[o],s),j(e,o=U(--n),r),0!==(s=E[o])&&$(e,n-=R[o],s)),a<e.last_lit;);j(e,_,t)}function q(e,t){var r,n,i,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,u=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=d,r=0;r<u;r++)0!==o[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=s[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;1<=r;r--)J(e,o,r);for(i=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],J(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,J(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,s,a,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(o=0;o<=p;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<d;r++)g<(o=u[2*u[2*(n=e.heap[r])+1]+1]+1)&&(o=g,_++),u[2*n+1]=o,c<n||(e.bl_count[o]++,s=0,m<=n&&(s=h[n-m]),a=u[2*n],e.opt_len+=a*(o+s),f&&(e.static_len+=a*(l[2*n+1]+s)));if(0!==_){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,_-=2}while(0<_);for(o=g;0!==o;o--)for(n=e.bl_count[o];0!==n;)c<(i=e.heap[--r])||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(e,t),F(o,c,e.bl_count)}function Z(e,t,r){var n,i,o=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<u&&i===s||(a<c?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[2*b]++):a<=10?e.bl_tree[2*y]++:e.bl_tree[2*v]++,o=i,c=(a=0)===s?(u=138,3):i===s?(u=6,3):(u=7,4))}function X(e,t,r){var n,i,o=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<u&&i===s)){if(a<c)for(;j(e,i,e.bl_tree),0!=--a;);else 0!==i?(i!==o&&(j(e,i,e.bl_tree),a--),j(e,b,e.bl_tree),$(e,a-3,2)):a<=10?(j(e,y,e.bl_tree),$(e,a-3,3)):(j(e,v,e.bl_tree),$(e,a-11,7));o=i,c=(a=0)===s?(u=138,3):i===s?(u=6,3):(u=7,4)}}s(R);var K=!1;function G(e,t,r,i){$(e,(a<<1)+(i?1:0),3),function(e,t,r,i){Y(e),i&&(P(e,r),P(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){K||(function(){var e,t,r,n,i,o=new Array(p+1);for(n=r=0;n<u-1;n++)for(N[n]=r,e=0;e<1<<w[n];e++)x[r++]=n;for(x[r-1]=n,n=i=0;n<16;n++)for(R[n]=i,e=0;e<1<<E[n];e++)T[i++]=n;for(i>>=7;n<f;n++)for(R[n]=i<<7,e=0;e<1<<E[n]-7;e++)T[256+i++]=n;for(t=0;t<=p;t++)o[t]=0;for(e=0;e<=143;)B[2*e+1]=8,e++,o[8]++;for(;e<=255;)B[2*e+1]=9,e++,o[9]++;for(;e<=279;)B[2*e+1]=7,e++,o[7]++;for(;e<=287;)B[2*e+1]=8,e++,o[8]++;for(F(B,l+1,o),e=0;e<f;e++)O[2*e+1]=5,O[2*e]=M(e,5);k=new D(B,w,c+1,l,p),I=new D(O,E,0,f,p),C=new D(new Array(0),S,0,h,g)}(),K=!0),e.l_desc=new z(e.dyn_ltree,k),e.d_desc=new z(e.dyn_dtree,I),e.bl_desc=new z(e.bl_tree,C),e.bi_buf=0,e.bi_valid=0,L(e)},r._tr_stored_block=G,r._tr_flush_block=function(e,t,r,n){var s,a,u=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return o;return i}(e)),q(e,e.l_desc),q(e,e.d_desc),u=function(e){var t;for(Z(e,e.dyn_ltree,e.l_desc.max_code),Z(e,e.dyn_dtree,e.d_desc.max_code),q(e,e.bl_desc),t=h-1;3<=t&&0===e.bl_tree[2*A[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),s=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=s&&(s=a)):s=a=r+5,r+4<=s&&-1!==t?G(e,t,r,n):4===e.strategy||a===s?($(e,2+(n?1:0),3),H(e,B,O)):($(e,4+(n?1:0),3),function(e,t,r,n){var i;for($(e,t-257,5),$(e,r-1,5),$(e,n-4,4),i=0;i<n;i++)$(e,e.bl_tree[2*A[i]+1],3);X(e,e.dyn_ltree,t-1),X(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),H(e,e.dyn_ltree,e.dyn_dtree)),L(e),n&&Y(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(x[r]+c+1)]++,e.dyn_dtree[2*U(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){$(e,2,3),j(e,_,B),function(e){16===e.bi_valid?(P(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){"use strict";t.exports="function"==typeof n?n:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}).call(this,r(6).Buffer,r(14),r(50).setImmediate)},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));const n=()=>{};function i(){let e,t=!1,r=n;return[new Promise((n=>{t?n(e):r=n})),n=>{t=!0,e=n,r()}]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(4);function i(e){return e&&"object"==typeof e&&e[n.d]}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(5),i=r(10),o=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){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 s extends n.a{constructor(){super(...arguments),this.getWorker=()=>new i.a(e)}executeModuleHelper(e,t,r,n){return o(this,void 0,void 0,(function*(){return e.runCppModule(t.moduleMetadata,r,n)}))}}}).call(this,r(72))},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__(13),long__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(long__WEBPACK_IMPORTED_MODULE_0__),buffer__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(6),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,c="",l=!1,f=["{","}"];(isArray(t)&&(l=!0,f=["[","]"]),isFunction(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return isRegExp(t)&&(c=" "+RegExp.prototype.toString.call(t)),isDate(t)&&(c=" "+Date.prototype.toUTCString.call(t)),isError(t)&&(c=" "+formatError(t)),0!==o.length||l&&0!=t.length?r<0?isRegExp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=l?formatArray(e,t,r,s,o):o.map((function(n){return formatProperty(e,t,r,s,n,l)})),e.seen.pop(),reduceToSingleString(u,c,f)):f[0]+c+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),c=n.multiply(o);return s=s.add(a.shiftRightUnsigned(32)),a=new long_1(a.getLowBits(),0).add(u).add(c.shiftRightUnsigned(32)),{high:s=s.add(a.shiftRightUnsigned(32)),low:c=a.shiftLeft(32).add(new long_1(c.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,c=0,l=[0],f=0,h=0,d=0,p=0,m=0,g=0,_=[0,0],b=[0,0],y=0;if(e.length>=7e3)throw new TypeError(e+" not a valid Decimal128 string");var v=e.match(PARSE_STRING_REGEXP),w=e.match(PARSE_INF_REGEXP),E=e.match(PARSE_NAN_REGEXP);if(!v&&!w&&!E||0===e.length)throw new TypeError(e+" not a valid Decimal128 string");if(v){var S=v[2],A=v[4],B=v[5],O=v[6];A&&void 0===O&&invalidErr(e,"missing exponent power"),A&&void 0===S&&invalidErr(e,"missing exponent base"),void 0===A&&(B||O)&&invalidErr(e,"missing e before exponent")}if("+"!==e[y]&&"-"!==e[y]||(r="-"===e[y++]),!isDigit(e[y])&&"."!==e[y]){if("i"===e[y]||"I"===e[y])return new Decimal128(Buffer$2.from(r?INF_NEGATIVE_BUFFER:INF_POSITIVE_BUFFER));if("N"===e[y])return new Decimal128(Buffer$2.from(NAN_BUFFER))}for(;isDigit(e[y])||"."===e[y];)"."!==e[y]?(f<34&&("0"!==e[y]||i)&&(i||(c=s),i=!0,l[h++]=parseInt(e[y],10),f+=1),i&&(a+=1),n&&(u+=1),s+=1,y+=1):(n&&invalidErr(e,"contains multiple periods"),n=!0,y+=1);if(n&&!s)throw new TypeError(e+" not a valid Decimal128 string");if("e"===e[y]||"E"===e[y]){var T=e.substr(++y).match(EXPONENT_REGEX);if(!T||!T[2])return new Decimal128(Buffer$2.from(NAN_BUFFER));m=parseInt(T[0],10),y+=T[0].length}if(e[y])return new Decimal128(Buffer$2.from(NAN_BUFFER));if(d=0,f){if(p=f-1,1!==(o=a))for(;"0"===e[c+o-1];)o-=1}else d=0,p=0,l[0]=0,a=1,f=1,o=0;for(m<=u&&u-m>16384?m=EXPONENT_MIN:m-=u;m>EXPONENT_MAX;){if((p+=1)-d>MAX_DIGITS){if(l.join("").match(/^0+$/)){m=EXPONENT_MAX;break}invalidErr(e,"overflow")}m-=1}for(;m<EXPONENT_MIN||f<a;){if(0===p&&o<f){m=EXPONENT_MIN,o=0;break}if(f<a?a-=1:p-=1,m<EXPONENT_MAX)m+=1;else{if(l.join("").match(/^0+$/)){m=EXPONENT_MAX;break}invalidErr(e,"overflow")}}if(p-d+1<o){var x=s;n&&(c+=1,x+=1),r&&(c+=1,x+=1);var N=parseInt(e[c+p+1],10),k=0;if(N>=5&&(k=1,5===N))for(k=l[p]%2==1,g=c+p+2;g<x;g++)if(parseInt(e[g],10)){k=1;break}if(k)for(var I=p;I>=0;I--)if(++l[I]>9&&(l[I]=0,0===I)){if(!(m<EXPONENT_MAX))return new Decimal128(Buffer$2.from(r?INF_NEGATIVE_BUFFER:INF_POSITIVE_BUFFER));m+=1,l[I]=1}}if(_=long_1.fromNumber(0),b=long_1.fromNumber(0),0===o)_=long_1.fromNumber(0),b=long_1.fromNumber(0);else if(p-d<17){var C=d;for(b=long_1.fromNumber(l[C++]),_=new long_1(0,0);C<=p;C++)b=(b=b.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(l[C]))}else{var R=d;for(_=long_1.fromNumber(l[R++]);R<=p-17;R++)_=(_=_.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(l[R]));for(b=long_1.fromNumber(l[R++]);R<=p;R++)b=(b=b.multiply(long_1.fromNumber(10))).add(long_1.fromNumber(l[R]))}var D=multiply64x2(_,long_1.fromString("100000000000000000"));D.low=D.low.add(b),lessThan(D.low,b)&&(D.high=D.high.add(long_1.fromNumber(1))),t=m+EXPONENT_BIAS;var z={low:long_1.fromNumber(0),high:long_1.fromNumber(0)};D.high.shiftRightUnsigned(49).and(long_1.fromNumber(1)).equals(long_1.fromNumber(1))?(z.high=z.high.or(long_1.fromNumber(3).shiftLeft(61)),z.high=z.high.or(long_1.fromNumber(t).and(long_1.fromNumber(16383).shiftLeft(47))),z.high=z.high.or(D.high.and(long_1.fromNumber(0x7fffffffffff)))):(z.high=z.high.or(long_1.fromNumber(16383&t).shiftLeft(49)),z.high=z.high.or(D.high.and(long_1.fromNumber(562949953421311)))),z.low=D.low,r&&(z.high=z.high.or(long_1.fromString("9223372036854775808")));var U=Buffer$2.alloc(16);return y=0,U[y++]=255&z.low.low,U[y++]=z.low.low>>8&255,U[y++]=z.low.low>>16&255,U[y++]=z.low.low>>24&255,U[y++]=255&z.low.high,U[y++]=z.low.high>>8&255,U[y++]=z.low.high>>16&255,U[y++]=z.low.high>>24&255,U[y++]=255&z.high.low,U[y++]=z.high.low>>8&255,U[y++]=z.high.low>>16&255,U[y++]=z.high.low>>24&255,U[y++]=255&z.high.high,U[y++]=z.high.high>>8&255,U[y++]=z.high.high>>16&255,U[y++]=z.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 c,l,f,h,d,p=0,m=!1,g={parts:new Array(4)},_=[];p=0;var b=this.bytes;if(n=b[p++]|b[p++]<<8|b[p++]<<16|b[p++]<<24,r=b[p++]|b[p++]<<8|b[p++]<<16|b[p++]<<24,t=b[p++]|b[p++]<<8|b[p++]<<16|b[p++]<<24,e=b[p++]|b[p++]<<8|b[p++]<<16|b[p++]<<24,p=0,{low:new long_1(n,r),high:new long_1(t,e)}.high.lessThan(long_1.ZERO)&&_.push("-"),(i=e>>26&COMBINATION_MASK)>>3==3){if(i===COMBINATION_INFINITY)return _.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(c=o-EXPONENT_BIAS,g.parts[0]=(16383&e)+((15&f)<<14),g.parts[1]=t,g.parts[2]=r,g.parts[3]=n,0===g.parts[0]&&0===g.parts[1]&&0===g.parts[2]&&0===g.parts[3])m=!0;else for(d=3;d>=0;d--){var y=0,v=divideu128(g);if(g=v.quotient,y=v.rem.low)for(h=8;h>=0;h--)a[9*d+h]=y%10,y=Math.floor(y/10)}if(m)s=1,a[p]=0;else for(s=36;!a[p];)s-=1,p+=1;if((l=s-1+c)>=34||l<=-7||c>0){if(s>34)return _.push(0),c>0?_.push("E+"+c):c<0&&_.push("E"+c),_.join("");_.push(a[p++]),(s-=1)&&_.push(".");for(var w=0;w<s;w++)_.push(a[p++]);_.push("E"),l>0?_.push("+"+l):_.push(l)}else if(c>=0)for(var E=0;E<s;E++)_.push(a[p++]);else{var S=s+c;if(S>0)for(var A=0;A<S;A++)_.push(a[p++]);else _.push("0");for(_.push(".");S++<0;)_.push("0");for(var B=0;B<s-Math.max(S-1,0);B++)_.push(a[p++])}return _.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 c=Object.assign({},r);return r.$scope&&(c.$scope=deserializeValue(e,null,r.$scope)),code.fromExtendedJSON(r)}if(null!=r.$ref||null!=r.$dbPointer){var l=r.$ref?r:r.$dbPointer;if(l instanceof db_ref)return l;var f=Object.keys(l).filter((function(e){return e.startsWith("$")})),h=!0;if(f.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(h=!1)})),h)return db_ref.fromExtendedJSON(l)}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,c=null!=r.raw&&r.raw,l="boolean"==typeof r.bsonRegExp&&r.bsonRegExp,f=null!=r.promoteBuffers&&r.promoteBuffers,h=null==r.promoteLongs||r.promoteLongs,d=null==r.promoteValues||r.promoteValues,p=t;if(e.length<5)throw new Error("corrupt bson message < 5 bytes long");var m=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(m<5||m>e.length)throw new Error("corrupt bson message");for(var g=n?[]:{},_=0;;){var b=e[t++];if(0===b)break;for(var y=t;0!==e[y]&&y<e.length;)y++;if(y>=Buffer$4.byteLength(e))throw new Error("Bad BSON Document: illegal CString");var v=n?_++:e.toString("utf8",t,y);if(t=y+1,b===constants.BSON_DATA_STRING){var w=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(w<=0||w>e.length-t||0!==e[t+w-1])throw new Error("bad string length in bson");if(!validateUtf8$1(e,t,t+w-1))throw new Error("Invalid UTF-8 string in BSON document");var E=e.toString("utf8",t,t+w-1);g[v]=E,t+=w}else if(b===constants.BSON_DATA_OID){var S=Buffer$4.alloc(12);e.copy(S,0,t,t+12),g[v]=new objectid(S),t+=12}else if(b===constants.BSON_DATA_INT&&!1===d)g[v]=new int_32(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24);else if(b===constants.BSON_DATA_INT)g[v]=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;else if(b===constants.BSON_DATA_NUMBER&&!1===d)g[v]=new double_1(e.readDoubleLE(t)),t+=8;else if(b===constants.BSON_DATA_NUMBER)g[v]=e.readDoubleLE(t),t+=8;else if(b===constants.BSON_DATA_DATE){var A=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,B=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;g[v]=new Date(new long_1(A,B).toNumber())}else if(b===constants.BSON_DATA_BOOLEAN){if(0!==e[t]&&1!==e[t])throw new Error("illegal boolean type value");g[v]=1===e[t++]}else if(b===constants.BSON_DATA_OBJECT){var O=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");g[v]=c?e.slice(t,t+T):deserializeObject(e,O,r,!1),t+=T}else if(b===constants.BSON_DATA_ARRAY){var x=t,N=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,k=r,I=t+N;if(u&&u[v]){for(var C in k={},r)k[C]=r[C];k.raw=!0}if(g[v]=deserializeObject(e,x,k,!0),0!==e[(t+=N)-1])throw new Error("invalid array terminator byte");if(t!==I)throw new Error("corrupted array bson")}else if(b===constants.BSON_DATA_UNDEFINED)g[v]=void 0;else if(b===constants.BSON_DATA_NULL)g[v]=null;else if(b===constants.BSON_DATA_LONG){var R=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,D=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,z=new long_1(R,D);g[v]=h&&!0===d&&z.lessThanOrEqual(JS_INT_MAX_LONG)&&z.greaterThanOrEqual(JS_INT_MIN_LONG)?z.toNumber():z}else if(b===constants.BSON_DATA_DECIMAL128){var U=Buffer$4.alloc(16);e.copy(U,0,t,t+16),t+=16;var P=new decimal128(U);g[v]=P.toObject?P.toObject():P}else if(b===constants.BSON_DATA_BINARY){var $=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,j=$,M=e[t++];if($<0)throw new Error("Negative binary type element size found");if($>Buffer$4.byteLength(e))throw new Error("Binary type size larger than document size");if(null!=e.slice){if(M===binary.SUBTYPE_BYTE_ARRAY){if(($=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($>j-4)throw new Error("Binary type with subtype 0x02 contains to long binary size");if($<j-4)throw new Error("Binary type with subtype 0x02 contains to short binary size")}g[v]=f&&d?e.slice(t,t+$):new binary(e.slice(t,t+$),M)}else{var F="undefined"!=typeof Uint8Array?new Uint8Array(new ArrayBuffer($)):new Array($);if(M===binary.SUBTYPE_BYTE_ARRAY){if(($=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($>j-4)throw new Error("Binary type with subtype 0x02 contains to long binary size");if($<j-4)throw new Error("Binary type with subtype 0x02 contains to short binary size")}for(y=0;y<$;y++)F[y]=e[t+y];g[v]=f&&d?F:new binary(F,M)}t+=$}else if(b===constants.BSON_DATA_REGEXP&&!1===l){for(y=t;0!==e[y]&&y<e.length;)y++;if(y>=e.length)throw new Error("Bad BSON Document: illegal CString");var L=e.toString("utf8",t,y);for(y=t=y+1;0!==e[y]&&y<e.length;)y++;if(y>=e.length)throw new Error("Bad BSON Document: illegal CString");var Y=e.toString("utf8",t,y);t=y+1;var W=new Array(Y.length);for(y=0;y<Y.length;y++)switch(Y[y]){case"m":W[y]="m";break;case"s":W[y]="g";break;case"i":W[y]="i"}g[v]=new RegExp(L,W.join(""))}else if(b===constants.BSON_DATA_REGEXP&&!0===l){for(y=t;0!==e[y]&&y<e.length;)y++;if(y>=e.length)throw new Error("Bad BSON Document: illegal CString");var J=e.toString("utf8",t,y);for(y=t=y+1;0!==e[y]&&y<e.length;)y++;if(y>=e.length)throw new Error("Bad BSON Document: illegal CString");var H=e.toString("utf8",t,y);t=y+1,g[v]=new regexp(J,H)}else if(b===constants.BSON_DATA_SYMBOL){var q=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(q<=0||q>e.length-t||0!==e[t+q-1])throw new Error("bad string length in bson");g[v]=e.toString("utf8",t,t+q-1),t+=q}else if(b===constants.BSON_DATA_TIMESTAMP){var Z=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,X=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;g[v]=new timestamp(Z,X)}else if(b===constants.BSON_DATA_MIN_KEY)g[v]=new min_key;else if(b===constants.BSON_DATA_MAX_KEY)g[v]=new max_key;else if(b===constants.BSON_DATA_CODE){var K=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(K<=0||K>e.length-t||0!==e[t+K-1])throw new Error("bad string length in bson");var G=e.toString("utf8",t,t+K-1);if(i)if(o){var V=s?a(G):G;g[v]=isolateEvalWithHash(functionCache,V,G,g)}else g[v]=isolateEval(G);else g[v]=new code(G);t+=K}else if(b===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;g[v]=isolateEvalWithHash(functionCache,oe,te,g)}else g[v]=isolateEval(te);g[v].scope=ie}else g[v]=new code(te,ie)}else{if(b!==constants.BSON_DATA_DBPOINTER)throw new Error("Detected unknown BSON type "+b.toString(16)+' for fieldname "'+v+'", 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 ce=new objectid(ue);t+=12,g[v]=new db_ref(ae,ce)}}if(m!==t-p){if(n)throw new Error("corrupt array bson");throw new Error("corrupt object bson")}var le=Object.keys(g).filter((function(e){return e.startsWith("$")})),fe=!0;if(le.forEach((function(e){-1===["$ref","$id","$db"].indexOf(e)&&(fe=!1)})),!fe)return g;if(null!=g.$id&&null!=g.$ref){var he=Object.assign({},g);return delete he.$ref,delete he.$id,delete he.$db,new db_ref(g.$ref,g.$id,g.$db||null,he)}return g}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,c=(1<<u)-1,l=c>>1,f=-7,h=a?0:i-1,d=a?1:-1,p=e[t+h];for(h+=d,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+e[t+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+h],h+=d,f-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=l}return(p?-1:1)*s*Math.pow(2,o-n)}function writeIEEE754(e,t,r,n,i,o){var s,a,u,c="big"===n,l=8*o-i-1,f=(1<<l)-1,h=f>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=c?o-1:0,m=c?-1:1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0)),isNaN(t)&&(a=0);i>=8;)e[r+p]=255&a,p+=m,a/=256,i-=8;for(s=s<<i|a,isNaN(t)&&(s+=8),l+=i;l>0;)e[r+p]=255&s,p+=m,s/=256,l-=8;e[r+p-m]|=128*g}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,c){for(var l=0;l<c.length;l++)if(c[l]===r)throw new Error("cyclic dependency detected");c.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,c);return c.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 c=n,l="string"==typeof r.code?r.code:r.code.toString();n+=4;var f=e.write(l,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 h=serializeInto(e,r.scope,i,n,o+1,s,a);n=h-1;var d=h-c;e[c++]=255&d,e[c++]=d>>8&255,e[c++]=d>>16&255,e[c++]=d>>24&255,e[n++]=0}else{e[n++]=constants.BSON_DATA_CODE,n+=u?e.write(t,n,"ascii"):e.write(t,n,"utf8"),e[n++]=0;var p=r.code.toString(),m=e.write(p,n+4,"utf8")+1;e[n]=255&m,e[n+1]=m>>8&255,e[n+2]=m>>16&255,e[n+3]=m>>24&255,n=n+4+m-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,c={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(c.$db=r.db);var l=(a=serializeInto(e,c=Object.assign(c,r.fields),!1,n,i+1,o))-u;return e[u++]=255&l,e[u++]=l>>8&255,e[u++]=l>>16&255,e[u++]=l>>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 c=0;c<t.length;c++){var l=""+c,f=t[c];if(f&&f.toBSON){if("function"!=typeof f.toBSON)throw new TypeError("toBSON is not a function");f=f.toBSON()}var h=_typeof$3(f);if("string"===h)u=serializeString(e,l,f,u,!0);else if("number"===h)u=serializeNumber(e,l,f,u,!0);else if("boolean"===h)u=serializeBoolean(e,l,f,u,!0);else if(f instanceof Date||isDate$1(f))u=serializeDate(e,l,f,u,!0);else if(void 0===f)u=serializeNull(e,l,f,u,!0);else if(null===f)u=serializeNull(e,l,f,u,!0);else if("ObjectId"===f._bsontype||"ObjectID"===f._bsontype)u=serializeObjectId(e,l,f,u,!0);else if(Buffer$5.isBuffer(f))u=serializeBuffer(e,l,f,u,!0);else if(f instanceof RegExp||isRegExp$1(f))u=serializeRegExp(e,l,f,u,!0);else if("object"===h&&null==f._bsontype)u=serializeObject(e,l,f,u,r,i,o,s,!0,a);else if("object"===h&&"Decimal128"===f._bsontype)u=serializeDecimal128(e,l,f,u,!0);else if("Long"===f._bsontype||"Timestamp"===f._bsontype)u=serializeLong(e,l,f,u,!0);else if("Double"===f._bsontype)u=serializeDouble(e,l,f,u,!0);else if("function"==typeof f&&o)u=serializeFunction(e,l,f,u,r,i,o,!0);else if("Code"===f._bsontype)u=serializeCode(e,l,f,u,r,i,o,s,!0);else if("Binary"===f._bsontype)u=serializeBinary(e,l,f,u,!0);else if("Symbol"===f._bsontype)u=serializeSymbol(e,l,f,u,!0);else if("DBRef"===f._bsontype)u=serializeDBRef(e,l,f,u,i,o,!0);else if("BSONRegExp"===f._bsontype)u=serializeBSONRegExp(e,l,f,u,!0);else if("Int32"===f._bsontype)u=serializeInt32(e,l,f,u,!0);else if("MinKey"===f._bsontype||"MaxKey"===f._bsontype)u=serializeMinMax(e,l,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 d=t.entries(),p=!1;!p;){var m=d.next();if(!(p=m.done)){var g=m.value[0],_=m.value[1],b=_typeof$3(_);if("string"==typeof g&&!ignoreKeys.has(g)){if(null!=g.match(regexp$1))throw Error("key "+g+" must not contain null bytes");if(r){if("$"===g[0])throw Error("key "+g+" must not start with '$'");if(~g.indexOf("."))throw Error("key "+g+" must not contain '.'")}}if("string"===b)u=serializeString(e,g,_,u);else if("number"===b)u=serializeNumber(e,g,_,u);else if("boolean"===b)u=serializeBoolean(e,g,_,u);else if(_ instanceof Date||isDate$1(_))u=serializeDate(e,g,_,u);else if(null===_||void 0===_&&!1===s)u=serializeNull(e,g,_,u);else if("ObjectId"===_._bsontype||"ObjectID"===_._bsontype)u=serializeObjectId(e,g,_,u);else if(Buffer$5.isBuffer(_))u=serializeBuffer(e,g,_,u);else if(_ instanceof RegExp||isRegExp$1(_))u=serializeRegExp(e,g,_,u);else if("object"===b&&null==_._bsontype)u=serializeObject(e,g,_,u,r,i,o,s,!1,a);else if("object"===b&&"Decimal128"===_._bsontype)u=serializeDecimal128(e,g,_,u);else if("Long"===_._bsontype||"Timestamp"===_._bsontype)u=serializeLong(e,g,_,u);else if("Double"===_._bsontype)u=serializeDouble(e,g,_,u);else if("Code"===_._bsontype)u=serializeCode(e,g,_,u,r,i,o,s);else if("function"==typeof _&&o)u=serializeFunction(e,g,_,u,r,i,o);else if("Binary"===_._bsontype)u=serializeBinary(e,g,_,u);else if("Symbol"===_._bsontype)u=serializeSymbol(e,g,_,u);else if("DBRef"===_._bsontype)u=serializeDBRef(e,g,_,u,i,o);else if("BSONRegExp"===_._bsontype)u=serializeBSONRegExp(e,g,_,u);else if("Int32"===_._bsontype)u=serializeInt32(e,g,_,u);else if("MinKey"===_._bsontype||"MaxKey"===_._bsontype)u=serializeMinMax(e,g,_,u);else if(void 0!==_._bsontype)throw new TypeError("Unrecognized or invalid _bsontype: "+_._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 y in t){var v=t[y];if(v&&v.toBSON){if("function"!=typeof v.toBSON)throw new TypeError("toBSON is not a function");v=v.toBSON()}var w=_typeof$3(v);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"===w)u=serializeString(e,y,v,u);else if("number"===w)u=serializeNumber(e,y,v,u);else if("boolean"===w)u=serializeBoolean(e,y,v,u);else if(v instanceof Date||isDate$1(v))u=serializeDate(e,y,v,u);else if(void 0===v)!1===s&&(u=serializeNull(e,y,v,u));else if(null===v)u=serializeNull(e,y,v,u);else if("ObjectId"===v._bsontype||"ObjectID"===v._bsontype)u=serializeObjectId(e,y,v,u);else if(Buffer$5.isBuffer(v))u=serializeBuffer(e,y,v,u);else if(v instanceof RegExp||isRegExp$1(v))u=serializeRegExp(e,y,v,u);else if("object"===w&&null==v._bsontype)u=serializeObject(e,y,v,u,r,i,o,s,!1,a);else if("object"===w&&"Decimal128"===v._bsontype)u=serializeDecimal128(e,y,v,u);else if("Long"===v._bsontype||"Timestamp"===v._bsontype)u=serializeLong(e,y,v,u);else if("Double"===v._bsontype)u=serializeDouble(e,y,v,u);else if("Code"===v._bsontype)u=serializeCode(e,y,v,u,r,i,o,s);else if("function"==typeof v&&o)u=serializeFunction(e,y,v,u,r,i,o);else if("Binary"===v._bsontype)u=serializeBinary(e,y,v,u);else if("Symbol"===v._bsontype)u=serializeSymbol(e,y,v,u);else if("DBRef"===v._bsontype)u=serializeDBRef(e,y,v,u,i,o);else if("BSONRegExp"===v._bsontype)u=serializeBSONRegExp(e,y,v,u);else if("Int32"===v._bsontype)u=serializeInt32(e,y,v,u);else if("MinKey"===v._bsontype||"MaxKey"===v._bsontype)u=serializeMinMax(e,y,v,u);else if(void 0!==v._bsontype)throw new TypeError("Unrecognized or invalid _bsontype: "+v._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__(14),__webpack_require__(6).Buffer)},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(5),i=r(10),o=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){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 s extends n.a{constructor(){super(...arguments),this.getWorker=()=>new i.a(e)}executeModuleHelper(e,t,r,n){return o(this,void 0,void 0,(function*(){return e.runOnnxModule(t.moduleMetadata,r,n)}))}}}).call(this,r(73))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(5),i=r(10),o=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){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 s extends n.a{constructor(){super(...arguments),this.getWorker=()=>new i.a(e)}executeModuleHelper(e,t,r,n){return o(this,void 0,void 0,(function*(){return e.runPythonModule(t.moduleMetadata,r,n)}))}}}).call(this,r(74))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(5),i=r(10),o=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){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 s extends n.a{constructor(){super(...arguments),this.getWorker=()=>new i.a(e)}executeModuleHelper(e,t,r,n){return o(this,void 0,void 0,(function*(){return e.runRModule(t.moduleMetadata,r,n)}))}}}).call(this,r(75))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(5),i=r(10),o=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){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 s extends n.a{constructor(){super(...arguments),this.getWorker=()=>new i.a(e)}executeModuleHelper(e,t,r,n){return o(this,void 0,void 0,(function*(){return e.runRustModule(t.moduleMetadata,r,n)}))}}}).call(this,r(76))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(5),i=r(10),o=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){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 s extends n.a{constructor(){super(...arguments),this.getWorker=()=>new i.a(e)}executeModuleHelper(e,t,r,n){return o(this,void 0,void 0,(function*(){return e.runTensorflowModule(t.moduleMetadata,r,n)}))}}}).call(this,r(77))},,function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),s=n[0],a=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),l=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[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=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(l(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 c(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 l(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,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):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+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*m}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(51),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(14))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,s,a,u=1,c={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(s+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[u]=i,n(u),u++},h.clearImmediate=d}function d(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(14),r(20))},function(e,t,r){"use strict";var n=r(3),i=r(28),o=r(53),s=r(34);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(31));u.Axios=o,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(35),u.CancelToken=r(66),u.isCancel=r(30),u.all=function(e){return Promise.all(e)},u.spread=r(67),u.isAxiosError=r(68),e.exports=u,e.exports.default=u},function(e,t,r){"use strict";var n=r(3),i=r(29),o=r(54),s=r(55),a=r(34);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(3);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(3),i=r(56),o=r(30),s=r(31);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(3);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(3);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(33);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(3);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(62),i=r(63);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(3),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(3);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(35);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){e.exports=r.p+"3-biolib.worker.js"},function(e,t,r){e.exports=function(e){function t(e){let r,i=null;function o(...e){if(!o.enabled)return;const n=o,i=Number(new Date),s=i-(r||i);n.diff=s,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";a++;const o=t.formatters[i];if("function"==typeof o){const t=e[a];r=o.call(n,t),e.splice(a,1),a--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?t.enabled(e):i,set:e=>{i=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(71),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},function(e,t){var r=1e3,n=60*r,i=60*n,o=24*i,s=7*o,a=365.25*o;function u(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var u=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*s;case"days":case"day":case"d":return u*o;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===c&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return u(e,t,o,"day");if(t>=i)return u(e,t,i,"hour");if(t>=n)return u(e,t,n,"minute");if(t>=r)return u(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){e.exports=r.p+"4-biolib.worker.js"},function(e,t,r){e.exports=r.p+"0-biolib.worker.js"},function(e,t,r){e.exports=r.p+"5-biolib.worker.js"},function(e,t,r){e.exports=r.p+"1-biolib.worker.js"},function(e,t,r){e.exports=r.p+"6-biolib.worker.js"},function(e,t,r){e.exports=r.p+"2-biolib.worker.js"},function(e,t,r){var n=r(79);e.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(n(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return n(t)}}},function(e,t){function r(e){this.message=e}r.prototype=new Error,r.prototype.name="InvalidCharacterError",e.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,o=0,s=0,a="";i=t.charAt(s++);~i&&(n=o%4?64*n+i:i,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return a}},function(e,t,r){"use strict";r.r(t);var n=r(15),i=(r(0),r(12));const o={AppClient:n.a,BioLibSingleton:i.a};window.BioLib=o}]);
|