@jupyterlite/xeus 0.1.2 → 0.1.4

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.
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
- # jupyterlite_xeus
1
+ # JupyterLite Xeus
2
2
 
3
3
  [![Github Actions Status](https://github.com/jupyterlite/xeus/workflows/Build/badge.svg)](https://github.com/jupyterlite/xeus/actions/workflows/build.yml)
4
+
4
5
  JupyterLite loader for Xeus kernels
5
6
 
6
7
  ## Requirements
@@ -21,7 +22,7 @@ pip install jupyterlite_xeus
21
22
 
22
23
  #### xeus-python kernel
23
24
 
24
- To create a `xeus-python` kernel with a custom environment, one creates an `environment.yaml` file with `xeus-python` and the desiered dependencies. Here is an example with `numpy` as a additional dependency:
25
+ To load a `xeus-python` kernel with a custom environment, create an `environment.yaml` file with `xeus-python` and the desired dependencies. Here is an example with `numpy` as a additional dependency:
25
26
 
26
27
  ```yaml
27
28
  name: xeus-lite-wasm
@@ -33,7 +34,7 @@ dependencies:
33
34
  - numpy
34
35
  ```
35
36
 
36
- To build the jupyterlite run the following command, where `environment.yaml` is the path to the file you just created
37
+ To build JupyterLite, run the following command where `environment.yaml` is the path to the file you just created
37
38
 
38
39
  ```bash
39
40
  jupyter lite build --XeusAddon.environment_file=some_path/to/environment.yaml
@@ -41,7 +42,7 @@ jupyter lite build --XeusAddon.environment_file=some_path/to/environment.yaml
41
42
 
42
43
  #### xeus-lua / xeus-sqlite / xeus-\<mylang\>
43
44
 
44
- To create a `xeus-lua` or `xeus-sqlite` kernel you can
45
+ To load a `xeus-lua` or `xeus-sqlite` kernel you can
45
46
  do the same as above, just with
46
47
 
47
48
  ```yaml
@@ -56,8 +57,8 @@ dependencies:
56
57
  - xeus-sqlite
57
58
  ```
58
59
 
59
- Note that xeus-sqlite and xeus-lua do not yet support additional dependencies.
60
- To build the jupyterlite, run again:
60
+ Note that `xeus-sqlite` and `xeus-lua` do not support additional dependencies yet.
61
+ To build JupyterLite, run again:
61
62
 
62
63
  ```bash
63
64
  jupyter lite build --XeusAddon.environment_file=environment.yaml
@@ -65,7 +66,7 @@ jupyter lite build --XeusAddon.environment_file=environment.yaml
65
66
 
66
67
  #### Multiple kernels
67
68
 
68
- To create a deployment with multiple kernels, you can just add them to the `environment.yaml` file:
69
+ To create a deployment with multiple kernels, you can simply add them to the `environment.yaml` file:
69
70
 
70
71
  ```yaml
71
72
  name: xeus-lite-wasm
@@ -81,11 +82,11 @@ dependencies:
81
82
 
82
83
  ### From local environment / prefix
83
84
 
84
- When developing a xeus-kernel, it is very usefull to be able to test it in a jupyterlite without having to publish it to emscripten-forge. Therefore you can also use a local environment / prefix to build a jupyterlite with a custom kernel.
85
+ When developing a xeus-kernel, it is very useful to be able to test it in JupyterLite without having to publish the kernel to emscripten-forge. Therefore, you can also use a local environment / prefix to build JupyterLite with a custom kernel.
85
86
 
86
87
  #### Create a local environment / prefix
87
88
 
88
- This workflow usually starts with creating a local conda environment / prefix for `emscripten-wasm32` with all the dependencies you need to build your kernel (here we install dependencies for `xeus-python` )
89
+ This workflow usually starts with creating a local conda environment / prefix for the `emscripten-wasm32` platform with all the dependencies required to build your kernel (here we install dependencies for `xeus-python`).
89
90
 
90
91
  ```bash
91
92
  micromamba create -n xeus-python-dev \
@@ -95,12 +96,12 @@ micromamba create -n xeus-python-dev \
95
96
  --yes \
96
97
  "python>=3.11" pybind11 nlohmann_json pybind11_json numpy pytest \
97
98
  bzip2 sqlite zlib libffi xtl pyjs \
98
- xeus xeus-sqlite xeus-lite
99
+ xeus xeus-lite
99
100
  ```
100
101
 
101
102
  #### Build the kernel
102
103
 
103
- This depends on your kernel but will look something like this:
104
+ This depends on your kernel, but it will look something like this:
104
105
 
105
106
  ```bash
106
107
  # path to your emscripten emsdk
@@ -141,7 +142,7 @@ micromamba activate xeus-lite-host
141
142
  python -m pip install jupyterlite-xeus
142
143
  ```
143
144
 
144
- When running `jupyter lite build` we pass the `prefix` options and point it to the local environment / prefix we just created:
145
+ When running `jupyter lite build`, we pass the `prefix` option and point it to the local environment / prefix we just created:
145
146
 
146
147
  ```bash
147
148
  jupyter lite build --XeusAddon.prefix=$WASM_ENV_PREFIX
@@ -149,7 +150,7 @@ jupyter lite build --XeusAddon.prefix=$WASM_ENV_PREFIX
149
150
 
150
151
  ### Mounting additional files
151
152
 
152
- To copy additional files and directories into the virtual filesytem of the xeus-lite kernels you can use the `--XeusAddon.mount` option.
153
+ To copy additional files and directories into the virtual filesystem of the xeus-lite kernels you can use the `--XeusAddon.mount` option.
153
154
  Each mount is specified as a pair of paths separated by a colon `:`. The first path is the path to the file or directory on the host machine, the second path is the path to the file or directory in the virtual filesystem of the kernel.
154
155
 
155
156
  ```bash
@@ -180,4 +181,4 @@ python -m pip install -e . -v --no-build-isolation
180
181
 
181
182
  ### Packaging the extension
182
183
 
183
- See [RELEASE](RELEASE.md)
184
+ See [RELEASE](RELEASE.md).
@@ -143,6 +143,11 @@ export class WebWorkerKernel {
143
143
  await this._remote.ready();
144
144
  if (options.mountDrive) {
145
145
  await this._remote.mount(driveName, '/drive', PageConfig.getBaseUrl());
146
+ }
147
+ if (await this._remote.isDir('/files')) {
148
+ await this._remote.cd('/files');
149
+ }
150
+ else if (options.mountDrive) {
146
151
  await this._remote.cd(localPath);
147
152
  }
148
153
  }
package/lib/worker.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see worker.js.LICENSE.txt */
2
- define((()=>(()=>{var __webpack_modules__={542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const r=n(521);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new r.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},622:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(542),t),o(n(86),t),o(n(390),t),o(n(458),t),o(n(176),t),o(n(643),t),o(n(846),t),o(n(533),t),o(n(319),t)},86:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},390:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const r=t.split("\n"),o=[];let i=null;for(let t=0;t<r.length;t++){const s=r[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),l=null!=i;if(a||l)if(l)i&&(a?(i.endLine=t-1,o.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const r=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);r!==a&&(i.code=s.substring(r+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,o.push(i),i=null)}}return o}}(t.MarkdownCodeBlocks||(t.MarkdownCodeBlocks={}))},458:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(82),minimist_1=__importDefault(__webpack_require__(562)),url_1=__webpack_require__(319);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&"undefined"!=typeof process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(470);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,r,o;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),l="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,l),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(r=getOption("workspace"))&&void 0!==r?r:PageConfig.defaultWorkspace)));const c=null!==(o=e.treePath)&&void 0!==o?o:getOption("treePath");return c&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(c))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const r=url_1.URLExt.encodeParts(e),o=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,r);return n?o+"?download=true":o}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let r="";return-1!==n&&(r=t.slice(0,n)),e.deferred.some((e=>e===t||r&&e===r))},e.isDisabled=function(t){const n=t.indexOf(":");let r="";return-1!==n&&(r=t.slice(0,n)),e.disabled.some((e=>e===t||r&&e===r))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig=exports.PageConfig||(exports.PageConfig={}))},176:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const r=n(470);!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=r.posix.join(...e);return"."===n?"":t(n)},e.basename=function(e,t){return r.posix.basename(e,t)},e.dirname=function(e){const n=t(r.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return r.posix.extname(e)},e.normalize=function(e){return""===e?"":t(r.posix.normalize(e))},e.resolve=function(...e){return t(r.posix.resolve(...e))},e.relative=function(e,n){return t(r.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(t.PathExt||(t.PathExt={}))},643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const r=n(82);t.signalToPromise=function(e,t){const n=new r.PromiseDelegate;function o(){e.disconnect(i)}function i(e,t){o(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{o(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},846:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,(n=t.Text||(t.Text={})).jsIndexToCharIndex=function(e,t){return e},n.charIndexToJsIndex=function(e,t){return e},n.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,r){return r?r.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},n.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}},533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var r;(r=t.Time||(t.Time={})).formatHuman=function(e){const t=document.documentElement.lang||"en",r=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),o=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(o/e.milliseconds);if(0!==t)return r.format(t,e.name)}return r.format(0,"seconds")},r.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}},319:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const o=n(470),i=r(n(564));!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const r=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=o.posix.join(`${r&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${r}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,r]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(r||"")),e}),{})},e.isLocal=function(e){const{protocol:n}=t(e);return(!n||0!==e.toLowerCase().indexOf(n))&&0!==e.indexOf("/")}}(t.URLExt||(t.URLExt={}))},82:function(e,t){!function(e){"use strict";e.JSONExt=void 0,function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function n(e){return Array.isArray(e)}function r(e,o){if(e===o)return!0;if(t(e)||t(o))return!1;let i=n(e),s=n(o);return i===s&&(i&&s?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;++n)if(!r(e[n],t[n]))return!1;return!0}(e,o):function(e,t){if(e===t)return!0;for(let n in e)if(void 0!==e[n]&&!(n in t))return!1;for(let n in t)if(void 0!==t[n]&&!(n in e))return!1;for(let n in e){let o=e[n],i=t[n];if(void 0!==o||void 0!==i){if(void 0===o||void 0===i)return!1;if(!r(o,i))return!1}}return!0}(e,o))}function o(e){return t(e)?e:n(e)?function(e){let t=new Array(e.length);for(let n=0,r=e.length;n<r;++n)t[n]=o(e[n]);return t}(e):function(e){let t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=o(r))}return t}(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=n,e.isObject=function(e){return!t(e)&&!n(e)},e.deepEqual=r,e.deepCopy=o}(e.JSONExt||(e.JSONExt={}));function t(e){let t=0;for(let n=0,r=e.length;n<r;++n)n%4==0&&(t=4294967295*Math.random()>>>0),e[n]=255&t,t>>>=8}e.Random=void 0,(e.Random||(e.Random={})).getRandomValues=(()=>{const e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:t})(),e.UUID=void 0,(e.UUID||(e.UUID={})).uuid4=function(e){const t=new Uint8Array(16),n=new Array(256);for(let e=0;e<16;++e)n[e]="0"+e.toString(16);for(let e=16;e<256;++e)n[e]=e.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]}}(e.Random.getRandomValues),e.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(e){return-1!==this._types.indexOf(e)}getData(e){let t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){let t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}},e.PromiseDelegate=class{constructor(){this.promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){(0,this._resolve)(e)}reject(e){(0,this._reject)(e)}},e.Token=class{constructor(e,t){this.name=e,this.description=null!=t?t:"",this._tokenStructuralPropertyT=null}}}(t)},521:(e,t,n)=>{"use strict";var r,o,i;n.r(t),n.d(t,{Signal:()=>l,Stream:()=>c}),function(e){function t(e,t,n=0,r=-1){let o,i=e.length;if(0===i)return-1;n=n<0?Math.max(0,n+i):Math.min(n,i-1),o=(r=r<0?Math.max(0,r+i):Math.min(r,i-1))<n?r+1+(i-n):r-n+1;for(let r=0;r<o;++r){let o=(n+r)%i;if(e[o]===t)return o}return-1}function n(e,t,n=-1,r=0){let o,i=e.length;if(0===i)return-1;o=(n=n<0?Math.max(0,n+i):Math.min(n,i-1))<(r=r<0?Math.max(0,r+i):Math.min(r,i-1))?n+1+(i-r):n-r+1;for(let r=0;r<o;++r){let o=(n-r+i)%i;if(e[o]===t)return o}return-1}function r(e,t,n=0,r=-1){let o,i=e.length;if(0===i)return-1;n=n<0?Math.max(0,n+i):Math.min(n,i-1),o=(r=r<0?Math.max(0,r+i):Math.min(r,i-1))<n?r+1+(i-n):r-n+1;for(let r=0;r<o;++r){let o=(n+r)%i;if(t(e[o],o))return o}return-1}function o(e,t,n=-1,r=0){let o,i=e.length;if(0===i)return-1;o=(n=n<0?Math.max(0,n+i):Math.min(n,i-1))<(r=r<0?Math.max(0,r+i):Math.min(r,i-1))?n+1+(i-r):n-r+1;for(let r=0;r<o;++r){let o=(n-r+i)%i;if(t(e[o],o))return o}return-1}function i(e,t=0,n=-1){let r=e.length;if(!(r<=1))for(t=t<0?Math.max(0,t+r):Math.min(t,r-1),n=n<0?Math.max(0,n+r):Math.min(n,r-1);t<n;){let r=e[t],o=e[n];e[t++]=o,e[n--]=r}}function s(e,t){let n=e.length;if(t<0&&(t+=n),t<0||t>=n)return;let r=e[t];for(let r=t+1;r<n;++r)e[r-1]=e[r];return e.length=n-1,r}e.firstIndexOf=t,e.lastIndexOf=n,e.findFirstIndex=r,e.findLastIndex=o,e.findFirstValue=function(e,t,n=0,o=-1){let i=r(e,t,n,o);return-1!==i?e[i]:void 0},e.findLastValue=function(e,t,n=-1,r=0){let i=o(e,t,n,r);return-1!==i?e[i]:void 0},e.lowerBound=function(e,t,n,r=0,o=-1){let i=e.length;if(0===i)return 0;let s=r=r<0?Math.max(0,r+i):Math.min(r,i-1),a=(o=o<0?Math.max(0,o+i):Math.min(o,i-1))-r+1;for(;a>0;){let r=a>>1,o=s+r;n(e[o],t)<0?(s=o+1,a-=r+1):a=r}return s},e.upperBound=function(e,t,n,r=0,o=-1){let i=e.length;if(0===i)return 0;let s=r=r<0?Math.max(0,r+i):Math.min(r,i-1),a=(o=o<0?Math.max(0,o+i):Math.min(o,i-1))-r+1;for(;a>0;){let r=a>>1,o=s+r;n(e[o],t)>0?a=r:(s=o+1,a-=r+1)}return s},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;++r)if(n?!n(e[r],t[r]):e[r]!==t[r])return!1;return!0},e.slice=function(e,t={}){let{start:n,stop:r,step:o}=t;if(void 0===o&&(o=1),0===o)throw new Error("Slice `step` cannot be zero.");let i,s=e.length;void 0===n?n=o<0?s-1:0:n<0?n=Math.max(n+s,o<0?-1:0):n>=s&&(n=o<0?s-1:s),void 0===r?r=o<0?-1:s:r<0?r=Math.max(r+s,o<0?-1:0):r>=s&&(r=o<0?s-1:s),i=o<0&&r>=n||o>0&&n>=r?0:o<0?Math.floor((r-n+1)/o+1):Math.floor((r-n-1)/o+1);let a=[];for(let t=0;t<i;++t)a[t]=e[n+t*o];return a},e.move=function(e,t,n){let r=e.length;if(r<=1)return;if((t=t<0?Math.max(0,t+r):Math.min(t,r-1))===(n=n<0?Math.max(0,n+r):Math.min(n,r-1)))return;let o=e[t],i=t<n?1:-1;for(let r=t;r!==n;r+=i)e[r]=e[r+i];e[n]=o},e.reverse=i,e.rotate=function(e,t,n=0,r=-1){let o=e.length;if(o<=1)return;if((n=n<0?Math.max(0,n+o):Math.min(n,o-1))>=(r=r<0?Math.max(0,r+o):Math.min(r,o-1)))return;let s=r-n+1;if(t>0?t%=s:t<0&&(t=(t%s+s)%s),0===t)return;let a=n+t;i(e,n,a-1),i(e,a,r),i(e,n,r)},e.fill=function(e,t,n=0,r=-1){let o,i=e.length;if(0!==i){n=n<0?Math.max(0,n+i):Math.min(n,i-1),o=(r=r<0?Math.max(0,r+i):Math.min(r,i-1))<n?r+1+(i-n):r-n+1;for(let r=0;r<o;++r)e[(n+r)%i]=t}},e.insert=function(e,t,n){let r=e.length;t=t<0?Math.max(0,t+r):Math.min(t,r);for(let n=r;n>t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=s,e.removeFirstOf=function(e,n,r=0,o=-1){let i=t(e,n,r,o);return-1!==i&&s(e,i),i},e.removeLastOf=function(e,t,r=-1,o=0){let i=n(e,t,r,o);return-1!==i&&s(e,i),i},e.removeAllOf=function(e,t,n=0,r=-1){let o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);let i=0;for(let s=0;s<o;++s)n<=r&&s>=n&&s<=r&&e[s]===t||r<n&&(s<=r||s>=n)&&e[s]===t?i++:i>0&&(e[s-i]=e[s]);return i>0&&(e.length=o-i),i},e.removeFirstWhere=function(e,t,n=0,o=-1){let i,a=r(e,t,n,o);return-1!==a&&(i=s(e,a)),{index:a,value:i}},e.removeLastWhere=function(e,t,n=-1,r=0){let i,a=o(e,t,n,r);return-1!==a&&(i=s(e,a)),{index:a,value:i}},e.removeAllWhere=function(e,t,n=0,r=-1){let o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);let i=0;for(let s=0;s<o;++s)n<=r&&s>=n&&s<=r&&t(e[s],s)||r<n&&(s<=r||s>=n)&&t(e[s],s)?i++:i>0&&(e[s-i]=e[s]);return i>0&&(e.length=o-i),i}}(r||(r={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||e<t&&n<0?0:Math.ceil((t-e)/n)}}(o||(o={})),function(e){function t(e,t,n=0){let r=new Array(t.length);for(let o=0,i=n,s=t.length;o<s;++o,++i){if(i=e.indexOf(t[o],i),-1===i)return null;r[o]=i}return r}e.findIndices=t,e.matchSumOfSquares=function(e,n,r=0){let o=t(e,n,r);if(!o)return null;let i=0;for(let e=0,t=o.length;e<t;++e){let t=o[e]-r;i+=t*t}return{score:i,indices:o}},e.matchSumOfDeltas=function(e,n,r=0){let o=t(e,n,r);if(!o)return null;let i=0,s=r-1;for(let e=0,t=o.length;e<t;++e){let t=o[e];i+=t-s-1,s=t}return{score:i,indices:o}},e.highlight=function(e,t,n){let r=[],o=0,i=0,s=t.length;for(;o<s;){let a=t[o],l=t[o];for(;++o<s&&t[o]===l+1;)l++;i<a&&r.push(e.slice(i,a)),a<l+1&&r.push(n(e.slice(a,l+1))),i=l+1}return i<e.length&&r.push(e.slice(i)),r},e.cmp=function(e,t){return e<t?-1:e>t?1:0}}(i||(i={}));var s,a=n(82);class l{constructor(e){this.sender=e}connect(e,t){return s.connect(this,e,t)}disconnect(e,t){return s.disconnect(this,e,t)}emit(e){s.emit(this,e)}}!function(e){e.disconnectBetween=function(e,t){s.disconnectBetween(e,t)},e.disconnectSender=function(e){s.disconnectSender(e)},e.disconnectReceiver=function(e){s.disconnectReceiver(e)},e.disconnectAll=function(e){s.disconnectAll(e)},e.clearData=function(e){s.disconnectAll(e)},e.getExceptionHandler=function(){return s.exceptionHandler},e.setExceptionHandler=function(e){let t=s.exceptionHandler;return s.exceptionHandler=e,t}}(l||(l={}));class c extends l{constructor(){super(...arguments),this._pending=new a.PromiseDelegate}async*[Symbol.asyncIterator](){let e=this._pending;for(;;)try{const{args:t,next:n}=await e.promise;e=n,yield t}catch(e){return}}emit(e){const t=this._pending,n=this._pending=new a.PromiseDelegate;t.resolve({args:e,next:n}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new a.PromiseDelegate}}!function(e){function t(e){let t=o.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.thisArg||e.slot;e.signal=null,u(i.get(t))}u(t)}}function n(e){let t=i.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,u(o.get(t))}u(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,n){n=n||void 0;let r=o.get(e.sender);if(r||(r=[],o.set(e.sender,r)),l(r,e,t,n))return!1;let s=n||t,a=i.get(s);a||(a=[],i.set(s,a));let c={signal:e,slot:t,thisArg:n};return r.push(c),a.push(c),!0},e.disconnect=function(e,t,n){n=n||void 0;let r=o.get(e.sender);if(!r||0===r.length)return!1;let s=l(r,e,t,n);if(!s)return!1;let a=n||t,c=i.get(a);return s.signal=null,u(r),u(c),!0},e.disconnectBetween=function(e,t){let n=o.get(e);if(!n||0===n.length)return;let r=i.get(t);if(r&&0!==r.length){for(const t of r)t.signal&&t.signal.sender===e&&(t.signal=null);u(n),u(r)}},e.disconnectSender=t,e.disconnectReceiver=n,e.disconnectAll=function(e){t(e),n(e)},e.emit=function(e,t){let n=o.get(e.sender);if(n&&0!==n.length)for(let r=0,o=n.length;r<o;++r){let o=n[r];o.signal===e&&c(o,t)}};const o=new WeakMap,i=new WeakMap,s=new Set,a="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function l(e,t,n,r){return function(e,o){for(const o of e)if((i=o).signal===t&&i.slot===n&&i.thisArg===r)return o;var i}(e)}function c(t,n){let{signal:r,slot:o,thisArg:i}=t;try{o.call(i,r.sender,n)}catch(t){e.exceptionHandler(t)}}function u(e){0===s.size&&a(f),s.add(e)}function f(){s.forEach(h),s.clear()}function h(e){r.removeAllWhere(e,d)}function d(e){return null===e.signal}}(s||(s={}))},562:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,r){r||(r={});var o={bools:{},strings:{},unknownFn:null};"function"==typeof r.unknown&&(o.unknownFn=r.unknown),"boolean"==typeof r.boolean&&r.boolean?o.allBools=!0:[].concat(r.boolean).filter(Boolean).forEach((function(e){o.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return o.bools[e]}))}Object.keys(r.alias||{}).forEach((function(e){i[e]=[].concat(r.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(r.string).filter(Boolean).forEach((function(e){o.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){o.strings[e]=!0}))}));var a=r.default||{},l={_:[]};function c(e,t,r){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var l=t[t.length-1];n(i,l)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[l]||o.bools[l]||"boolean"==typeof i[l]?i[l]=r:Array.isArray(i[l])?i[l].push(r):i[l]=[i[l],r])}function u(e,n,r){if(!r||!o.unknownFn||function(e,t){return o.allBools&&/^--[^=]+$/.test(t)||o.strings[e]||o.bools[e]||i[e]}(e,r)||!1!==o.unknownFn(r)){var s=!o.strings[e]&&t(n)?Number(n):n;c(l,e.split("."),s),(i[e]||[]).forEach((function(e){c(l,e.split("."),s)}))}}Object.keys(o.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var h=0;h<e.length;h++){var d,p,m=e[h];if(/^--.+=/.test(m)){var g=m.match(/^--([^=]+)=([\s\S]*)$/);d=g[1];var _=g[2];o.bools[d]&&(_="false"!==_),u(d,_,m)}else if(/^--no-.+/.test(m))u(d=m.match(/^--no-(.+)/)[1],!1,m);else if(/^--.+/.test(m))d=m.match(/^--(.+)/)[1],void 0===(p=e[h+1])||/^(-|--)[^-]/.test(p)||o.bools[d]||o.allBools||i[d]&&s(d)?/^(true|false)$/.test(p)?(u(d,"true"===p,m),h+=1):u(d,!o.strings[d]||"",m):(u(d,p,m),h+=1);else if(/^-[^-]+/.test(m)){for(var v=m.slice(1,-1).split(""),y=!1,w=0;w<v.length;w++)if("-"!==(p=m.slice(w+2))){if(/[A-Za-z]/.test(v[w])&&"="===p[0]){u(v[w],p.slice(1),m),y=!0;break}if(/[A-Za-z]/.test(v[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){u(v[w],p,m),y=!0;break}if(v[w+1]&&v[w+1].match(/\W/)){u(v[w],m.slice(w+2),m),y=!0;break}u(v[w],!o.strings[v[w]]||"",m)}else u(v[w],p,m);d=m.slice(-1)[0],y||"-"===d||(!e[h+1]||/^(-|--)[^-]/.test(e[h+1])||o.bools[d]||i[d]&&s(d)?e[h+1]&&/^(true|false)$/.test(e[h+1])?(u(d,"true"===e[h+1],m),h+=1):u(d,!o.strings[d]||"",m):(u(d,e[h+1],m),h+=1))}else if(o.unknownFn&&!1===o.unknownFn(m)||l._.push(o.strings._||!t(m)?m:Number(m)),r.stopEarly){l._.push.apply(l._,e.slice(h+1));break}}return Object.keys(a).forEach((function(e){var t,n,r;t=l,n=e.split("."),r=t,n.slice(0,-1).forEach((function(e){r=r[e]||{}})),n[n.length-1]in r||(c(l,e.split("."),a[e]),(i[e]||[]).forEach((function(t){c(l,t.split("."),a[e])})))})),r["--"]?l["--"]=f.slice():f.forEach((function(e){l._.push(e)})),l}},470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",o=0):o=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",o=0,i=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s;i>=0?s=arguments[i]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,o=47===s.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,s=i-o,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var l=n.length-a,c=s<l?s:l,u=-1,f=0;f<=c;++f){if(f===c){if(l>c){if(47===n.charCodeAt(a+f))return n.slice(a+f+1);if(0===f)return n.slice(a+f)}else s>c&&(47===e.charCodeAt(o+f)?u=f:0===f&&(u=0));break}var h=e.charCodeAt(o+f);if(h!==n.charCodeAt(a+f))break;47===h&&(u=f)}var d="";for(f=o+u+1;f<=i;++f)f!==i&&47!==e.charCodeAt(f)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,i=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!s){o=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(c===n.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=l))}return o===i?i=l:-1===i&&(i=e.length),e.slice(o,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){o=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===o&&(i=!1,o=a+1),46===l?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!i){r=a+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),i=47===o;i?(n.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,c=!0,u=e.length-1,f=0;u>=r;--u)if(47!==(o=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!c){a=u+1;break}return-1===s||-1===l||0===f||1===f&&s===l-1&&s===a+1?-1!==l&&(n.base=n.name=0===a&&i?e.slice(1,l):e.slice(a,l)):(0===a&&i?(n.name=e.slice(1,s),n.base=e.slice(1,l)):(n.name=e.slice(a,s),n.base=e.slice(a,l)),n.ext=e.slice(s,l)),a>0?n.dir=e.slice(0,a-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},129:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((r=e[i])||null!=r&&!isNaN(r)||(r=""),i=o(i),r=o(r),null===i||null===r)continue;s.push(i+"="+r)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var i=r(t[1]),s=r(t[2]);null===i||null===s||i in o||(o[i]=s)}return o}},418:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},564:(e,t,n)=>{"use strict";var r=n(418),o=n(129),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var h=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function p(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(e=e||r);if("blob:"===e.protocol)o=new _(unescape(e.pathname),{});else if("string"===i)for(t in o=new _(e,{}),d)delete o[t];else if("object"===i){for(t in e)t in d||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,r=c.exec(e),o=r[1]?r[1].toLowerCase():"",i=!!r[2],a=!!r[3],l=0;return i?a?(n=r[2]+r[3]+r[4],l=r[2].length+r[3].length):(n=r[2]+r[4],l=r[2].length):a?(n=r[3]+r[4],l=r[3].length):n=r[4],"file:"===o?l>=2&&(n=n.slice(2)):m(o)?n=r[4]:o?i&&(n=n.slice(2)):l>=2&&m(t.protocol)&&(n=r[4]),{protocol:o,slashes:i||m(o),slashesCount:l,rest:n}}function _(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof _))return new _(e,t,n);var i,a,l,c,d,v,y=h.slice(),w=typeof t,b=this,x=0;for("object"!==w&&"string"!==w&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),i=!(a=g(e||"",t=p(t))).protocol&&!a.slashes,b.slashes=a.slashes||i&&t.slashes,b.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(b.protocol)))&&(y[3]=[/(.*)/,"pathname"]);x<y.length;x++)"function"!=typeof(c=y[x])?(l=c[0],v=c[1],l!=l?b[v]=e:"string"==typeof l?~(d="@"===l?e.lastIndexOf(l):e.indexOf(l))&&("number"==typeof c[2]?(b[v]=e.slice(0,d),e=e.slice(d+c[2])):(b[v]=e.slice(d),e=e.slice(0,d))):(d=l.exec(e))&&(b[v]=d[1],e=e.slice(0,d.index)),b[v]=b[v]||i&&c[3]&&t[v]||"",c[4]&&(b[v]=b[v].toLowerCase())):e=c(e,b);n&&(b.query=n(b.query)),i&&t.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==t.pathname)&&(b.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(i=!0),n.splice(r,1),s--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(b.pathname,t.pathname)),"/"!==b.pathname.charAt(0)&&m(b.protocol)&&(b.pathname="/"+b.pathname),r(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(~(d=b.auth.indexOf(":"))?(b.username=b.auth.slice(0,d),b.username=encodeURIComponent(decodeURIComponent(b.username)),b.password=b.auth.slice(d+1),b.password=encodeURIComponent(decodeURIComponent(b.password))):b.username=encodeURIComponent(decodeURIComponent(b.auth)),b.auth=b.password?b.username+":"+b.password:b.username),b.origin="file:"!==b.protocol&&m(b.protocol)&&b.host?b.protocol+"//"+b.host:"null",b.href=b.toString()}_.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,l.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var c=0;c<h.length;c++){var u=h[c];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&m(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||m(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&m(n.protocol)&&!r&&"/"!==n.pathname&&(s+="@"),(":"===r[r.length-1]||l.test(n.hostname)&&!n.port)&&(r+=":"),s+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},_.extractProtocol=g,_.location=p,_.trimLeft=f,_.qs=o,e.exports=_}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__);const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.finalizer"),o=Symbol("Comlink.thrown"),i=e=>"object"==typeof e&&null!==e||"function"==typeof e,s=new Map([["proxy",{canHandle:t=>i(t)&&t[e],serialize(e){const{port1:t,port2:n}=new MessageChannel;return a(e,t),[n,[n]]},deserialize:e=>(e.start(),d(e,[],undefined))}],["throw",{canHandle:e=>i(e)&&o in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function a(t,n=globalThis,i=["*"]){n.addEventListener("message",(function s(c){if(!c||!c.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(i,c.origin))return void console.warn(`Invalid origin '${c.origin}' for comlink proxy`);const{id:u,type:f,path:h}=Object.assign({path:[]},c.data),d=(c.data.argumentList||[]).map(_);let p;try{const n=h.slice(0,-1).reduce(((e,t)=>e[t]),t),r=h.reduce(((e,t)=>e[t]),t);switch(f){case"GET":p=r;break;case"SET":n[h.slice(-1)[0]]=_(c.data.value),p=!0;break;case"APPLY":p=r.apply(n,d);break;case"CONSTRUCT":p=function(t){return Object.assign(t,{[e]:!0})}(new r(...d));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;a(t,n),p=function(e,t){return m.set(e,t),e}(e,[e])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[o]:0}}Promise.resolve(p).catch((e=>({value:e,[o]:0}))).then((e=>{const[o,i]=g(e);n.postMessage(Object.assign(Object.assign({},o),{id:u}),i),"RELEASE"===f&&(n.removeEventListener("message",s),l(n),r in t&&"function"==typeof t[r]&&t[r]())})).catch((e=>{const[t,r]=g({value:new TypeError("Unserializable return value"),[o]:0});n.postMessage(Object.assign(Object.assign({},t),{id:u}),r)}))})),n.start&&n.start()}function l(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function c(e){if(e)throw new Error("Proxy has been released and is not useable")}function u(e){return v(e,{type:"RELEASE"}).then((()=>{l(e)}))}const f=new WeakMap,h="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(f.get(e)||0)-1;f.set(e,t),0===t&&u(e)}));function d(e,r=[],o=function(){}){let i=!1;const s=new Proxy(o,{get(t,o){if(c(i),o===n)return()=>{!function(e){h&&h.unregister(e)}(s),u(e),i=!0};if("then"===o){if(0===r.length)return{then:()=>s};const t=v(e,{type:"GET",path:r.map((e=>e.toString()))}).then(_);return t.then.bind(t)}return d(e,[...r,o])},set(t,n,o){c(i);const[s,a]=g(o);return v(e,{type:"SET",path:[...r,n].map((e=>e.toString())),value:s},a).then(_)},apply(n,o,s){c(i);const a=r[r.length-1];if(a===t)return v(e,{type:"ENDPOINT"}).then(_);if("bind"===a)return d(e,r.slice(0,-1));const[l,u]=p(s);return v(e,{type:"APPLY",path:r.map((e=>e.toString())),argumentList:l},u).then(_)},construct(t,n){c(i);const[o,s]=p(n);return v(e,{type:"CONSTRUCT",path:r.map((e=>e.toString())),argumentList:o},s).then(_)}});return function(e,t){const n=(f.get(t)||0)+1;f.set(t,n),h&&h.register(e,t,e)}(s,e),s}function p(e){const t=e.map(g);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const m=new WeakMap;function g(e){for(const[t,n]of s)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},m.get(e)||[]]}function _(e){switch(e.type){case"HANDLER":return s.get(e.name).deserialize(e.value);case"RAW":return e.value}}function v(e,t,n){return new Promise((r=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===o&&(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)}))}const y=new TextEncoder,w=new TextDecoder("utf-8"),b={0:!1,1:!0,2:!0,64:!0,65:!0,66:!0,129:!0,193:!0,514:!0,577:!0,578:!0,705:!0,706:!0,1024:!0,1025:!0,1026:!0,1089:!0,1090:!0,1153:!0,1154:!0,1217:!0,1218:!0,4096:!0,4098:!0};class x{constructor(e){this.fs=e}open(e){const t=this.fs.realPath(e.node);this.fs.FS.isFile(e.node.mode)&&(e.file=this.fs.API.get(t))}close(e){if(!this.fs.FS.isFile(e.node.mode)||!e.file)return;const t=this.fs.realPath(e.node),n=e.flags;let r="string"==typeof n?parseInt(n,10):n;r&=8191;let o=!0;r in b&&(o=b[r]),o&&this.fs.API.put(t,e.file),e.file=void 0}read(e,t,n,r,o){if(r<=0||void 0===e.file||o>=(e.file.data.length||0))return 0;const i=Math.min(e.file.data.length-o,r);return t.set(e.file.data.subarray(o,o+i),n),i}write(e,t,n,r,o){var i;if(r<=0||void 0===e.file)return 0;if(e.node.timestamp=Date.now(),o+r>((null===(i=e.file)||void 0===i?void 0:i.data.length)||0)){const t=e.file.data?e.file.data:new Uint8Array;e.file.data=new Uint8Array(o+r),e.file.data.set(t)}return e.file.data.set(t.subarray(n,n+r),o),r}llseek(e,t,n){let r=t;if(1===n)r+=e.position;else if(2===n&&this.fs.FS.isFile(e.node.mode)){if(void 0===e.file)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM);r+=e.file.data.length}if(r<0)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL);return r}}class E{constructor(e){this.fs=e}getattr(e){return{...this.fs.API.getattr(this.fs.realPath(e)),mode:e.mode,ino:e.id}}setattr(e,t){for(const[n,r]of Object.entries(t))switch(n){case"mode":e.mode=r;break;case"timestamp":e.timestamp=r;break;default:console.warn("setattr",n,"of",r,"on",e,"not yet implemented")}}lookup(e,t){const n=this.fs.PATH.join2(this.fs.realPath(e),t),r=this.fs.API.lookup(n);if(!r.ok)throw this.fs.FS.genericErrors[this.fs.ERRNO_CODES.ENOENT];return this.fs.createNode(e,t,r.mode,0)}mknod(e,t,n,r){const o=this.fs.PATH.join2(this.fs.realPath(e),t);return this.fs.API.mknod(o,n),this.fs.createNode(e,t,n,r)}rename(e,t,n){this.fs.API.rename(e.parent?this.fs.PATH.join2(this.fs.realPath(e.parent),e.name):e.name,this.fs.PATH.join2(this.fs.realPath(t),n)),e.name=n,e.parent=t}unlink(e,t){this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(e),t))}rmdir(e,t){this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(e),t))}readdir(e){return this.fs.API.readdir(this.fs.realPath(e))}symlink(e,t,n){throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM)}readlink(e){throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM)}}class O{constructor(e,t,n,r,o){this._baseUrl=e,this._driveName=t,this._mountpoint=n,this.FS=r,this.ERRNO_CODES=o}request(e){const t=new XMLHttpRequest;t.open("POST",encodeURI(this.endpoint),!1);try{t.send(JSON.stringify(e))}catch(e){console.error(e)}if(t.status>=400)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return JSON.parse(t.responseText)}lookup(e){return this.request({method:"lookup",path:this.normalizePath(e)})}getmode(e){return Number.parseInt(this.request({method:"getmode",path:this.normalizePath(e)}))}mknod(e,t){return this.request({method:"mknod",path:this.normalizePath(e),data:{mode:t}})}rename(e,t){return this.request({method:"rename",path:this.normalizePath(e),data:{newPath:this.normalizePath(t)}})}readdir(e){const t=this.request({method:"readdir",path:this.normalizePath(e)});return t.push("."),t.push(".."),t}rmdir(e){return this.request({method:"rmdir",path:this.normalizePath(e)})}get(e){const t=this.request({method:"get",path:this.normalizePath(e)}),n=t.content,r=t.format;switch(r){case"json":case"text":return{data:y.encode(n),format:r};case"base64":{const e=atob(n),t=e.length,o=new Uint8Array(t);for(let n=0;n<t;n++)o[n]=e.charCodeAt(n);return{data:o,format:r}}default:throw new this.FS.ErrnoError(this.ERRNO_CODES.ENOENT)}}put(e,t){switch(t.format){case"json":case"text":return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:w.decode(t.data)}});case"base64":{let n="";for(let e=0;e<t.data.byteLength;e++)n+=String.fromCharCode(t.data[e]);return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:btoa(n)}})}}}getattr(e){const t=this.request({method:"getattr",path:this.normalizePath(e)});return t.atime=new Date(t.atime),t.mtime=new Date(t.mtime),t.ctime=new Date(t.ctime),t.size=t.size||0,t}normalizePath(e){return e.startsWith(this._mountpoint)&&(e=e.slice(this._mountpoint.length)),this._driveName&&(e=`${this._driveName}:${e}`),e}get endpoint(){return`${this._baseUrl}api/drive`}}class k{constructor(e){this.FS=e.FS,this.PATH=e.PATH,this.ERRNO_CODES=e.ERRNO_CODES,this.API=new O(e.baseUrl,e.driveName,e.mountpoint,this.FS,this.ERRNO_CODES),this.driveName=e.driveName,this.node_ops=new E(this),this.stream_ops=new x(this)}mount(e){return this.createNode(null,e.mountpoint,16895,0)}createNode(e,t,n,r){const o=this.FS;if(!o.isDir(n)&&!o.isFile(n))throw new o.ErrnoError(this.ERRNO_CODES.EINVAL);const i=o.createNode(e,t,n,r);return i.node_ops=this.node_ops,i.stream_ops=this.stream_ops,i}getMode(e){return this.API.getmode(e)}realPath(e){const t=[];let n=e;for(t.push(n.name);n.parent!==n;)n=n.parent,t.push(n.name);return t.reverse(),this.PATH.join.apply(null,t)}}var C=__webpack_require__(622);globalThis.Module={};class P extends E{getNode(e){return e.node?e.node:e}lookup(e,t){return super.lookup(this.getNode(e),t)}getattr(e){return super.getattr(this.getNode(e))}setattr(e,t){super.setattr(this.getNode(e),t)}mknod(e,t,n,r){return super.mknod(this.getNode(e),t,n,r)}rename(e,t,n){super.rename(this.getNode(e),this.getNode(t),n)}rmdir(e,t){super.rmdir(this.getNode(e),t)}readdir(e){return super.readdir(this.getNode(e))}}class R extends k{constructor(e){super(e),this.node_ops=new P(this)}}let M;globalThis.toplevel_promise=null,globalThis.toplevel_promise_py_proxy=null,self.get_stdin=async function(){return new Promise((e=>{M=e}))};class S{constructor(e){this._drive=null,this._resolve=e}async ready(){return await globalThis.ready}mount(e,t,n){const{FS:r,PATH:o,ERRNO_CODES:i}=globalThis.Module;r&&(this._drive=new R({FS:r,PATH:o,ERRNO_CODES:i,baseUrl:n,driveName:e,mountpoint:t}),r.mkdir(t),r.mount(this._drive,{},t),r.chdir(t))}cd(e){e&&globalThis.Module.FS&&globalThis.Module.FS.chdir(e)}async processMessage(e){const t=e.msg.header.msg_type;await this.ready(),null!==globalThis.toplevel_promise&&null!==globalThis.toplevel_promise_py_proxy&&(await globalThis.toplevel_promise,globalThis.toplevel_promise_py_proxy.delete(),globalThis.toplevel_promise_py_proxy=null,globalThis.toplevel_promise=null),"input_reply"===t?M(e.msg):this._raw_xserver.notify_listener(e.msg)}async initialize(e,t){const n=C.URLExt.join(t,e.argv[0]),r=n.replace(".js",".wasm");importScripts(n),globalThis.Module=await createXeusModule({locateFile:e=>e.endsWith(".wasm")?r:e});try{if(await this.waitRunDependency(),void 0!==globalThis.Module.async_init){const n=C.URLExt.join(t,`xeus/kernels/${e.dir}`),r=C.URLExt.join(t,"xeus/kernel_packages"),o=!0;await globalThis.Module.async_init(n,r,o)}await this.waitRunDependency(),this._raw_xkernel=new globalThis.Module.xkernel,this._raw_xserver=this._raw_xkernel.get_server(),this._raw_xkernel||console.error("Failed to start kernel!"),this._raw_xkernel.start()}catch(e){if("number"==typeof e){const t=globalThis.Module.get_exception_message(e);throw console.error(t),new Error(t)}throw console.error(e),e}this._resolve()}async waitRunDependency(){const e=new Promise((e=>{globalThis.Module.monitorRunDependencies=t=>{0===t&&e()}}));return globalThis.Module.addRunDependency("dummy"),globalThis.Module.removeRunDependency("dummy"),e}}globalThis.ready=new Promise((e=>{a(new S(e))}))})(),__webpack_exports__})()));
2
+ define((()=>(()=>{var __webpack_modules__={542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const r=n(521);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new r.Signal(this),e.signal.connect(this._onSignalFired,this),this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,r.Signal.clearData(this))}_onSignalFired(e,t){clearTimeout(this._timer),this._sender=e,this._args=t,this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}},622:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(542),t),o(n(86),t),o(n(390),t),o(n(458),t),o(n(176),t),o(n(643),t),o(n(846),t),o(n(533),t),o(n(319),t)},86:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},390:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownCodeBlocks=void 0,function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e,this.code="",this.endLine=-1}}e.MarkdownCodeBlock=n,e.isMarkdown=function(e){return t.indexOf(e)>-1},e.findMarkdownCodeBlocks=function(t){if(!t||""===t)return[];const r=t.split("\n"),o=[];let i=null;for(let t=0;t<r.length;t++){const s=r[t],a=0===s.indexOf(e.CODE_BLOCK_MARKER),l=null!=i;if(a||l)if(l)i&&(a?(i.endLine=t-1,o.push(i),i=null):i.code+=s+"\n");else{i=new n(t);const r=s.indexOf(e.CODE_BLOCK_MARKER),a=s.lastIndexOf(e.CODE_BLOCK_MARKER);r!==a&&(i.code=s.substring(r+e.CODE_BLOCK_MARKER.length,a),i.endLine=t,o.push(i),i=null)}}return o}}(t.MarkdownCodeBlocks||(t.MarkdownCodeBlocks={}))},458:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PageConfig=void 0;const coreutils_1=__webpack_require__(82),minimist_1=__importDefault(__webpack_require__(562)),url_1=__webpack_require__(319);var PageConfig;(function(PageConfig){function getOption(name){if(configData)return configData[name]||getBodyData(name);configData=Object.create(null);let found=!1;if("undefined"!=typeof document&&document){const e=document.getElementById("jupyter-config-data");e&&(configData=JSON.parse(e.textContent||""),found=!0)}if(!found&&"undefined"!=typeof process&&process.argv)try{const cli=(0,minimist_1.default)(process.argv.slice(2)),path=__webpack_require__(470);let fullPath="";"jupyter-config-data"in cli?fullPath=path.resolve(cli["jupyter-config-data"]):"JUPYTER_CONFIG_DATA"in process.env&&(fullPath=path.resolve(process.env.JUPYTER_CONFIG_DATA)),fullPath&&(configData=eval("require")(fullPath))}catch(e){console.error(e)}if(coreutils_1.JSONExt.isObject(configData))for(const e in configData)"string"!=typeof configData[e]&&(configData[e]=JSON.stringify(configData[e]));else configData=Object.create(null);return configData[name]||getBodyData(name)}function setOption(e,t){const n=getOption(e);return configData[e]=t,n}function getBaseUrl(){return url_1.URLExt.normalize(getOption("baseUrl")||"/")}function getTreeUrl(){return url_1.URLExt.join(getBaseUrl(),getOption("treeUrl"))}function getShareUrl(){return url_1.URLExt.normalize(getOption("shareUrl")||getBaseUrl())}function getTreeShareUrl(){return url_1.URLExt.normalize(url_1.URLExt.join(getShareUrl(),getOption("treeUrl")))}function getUrl(e){var t,n,r,o;let i=e.toShare?getShareUrl():getBaseUrl();const s=null!==(t=e.mode)&&void 0!==t?t:getOption("mode"),a=null!==(n=e.workspace)&&void 0!==n?n:getOption("workspace"),l="single-document"===s?"doc":"lab";i=url_1.URLExt.join(i,l),a!==PageConfig.defaultWorkspace&&(i=url_1.URLExt.join(i,"workspaces",encodeURIComponent(null!==(r=getOption("workspace"))&&void 0!==r?r:PageConfig.defaultWorkspace)));const c=null!==(o=e.treePath)&&void 0!==o?o:getOption("treePath");return c&&(i=url_1.URLExt.join(i,"tree",url_1.URLExt.encodeParts(c))),i}function getWsUrl(e){let t=getOption("wsUrl");if(!t){if(0!==(e=e?url_1.URLExt.normalize(e):getBaseUrl()).indexOf("http"))return"";t="ws"+e.slice(4)}return url_1.URLExt.normalize(t)}function getNBConvertURL({path:e,format:t,download:n}){const r=url_1.URLExt.encodeParts(e),o=url_1.URLExt.join(getBaseUrl(),"nbconvert",t,r);return n?o+"?download=true":o}function getToken(){return getOption("token")||getBodyData("jupyterApiToken")}function getNotebookVersion(){const e=getOption("notebookVersion");return""===e?[0,0,0]:JSON.parse(e)}PageConfig.getOption=getOption,PageConfig.setOption=setOption,PageConfig.getBaseUrl=getBaseUrl,PageConfig.getTreeUrl=getTreeUrl,PageConfig.getShareUrl=getShareUrl,PageConfig.getTreeShareUrl=getTreeShareUrl,PageConfig.getUrl=getUrl,PageConfig.defaultWorkspace="default",PageConfig.getWsUrl=getWsUrl,PageConfig.getNBConvertURL=getNBConvertURL,PageConfig.getToken=getToken,PageConfig.getNotebookVersion=getNotebookVersion;let configData=null,Extension;function getBodyData(e){if("undefined"==typeof document||!document.body)return"";const t=document.body.dataset[e];return void 0===t?"":decodeURIComponent(t)}!function(e){function t(e){try{const t=getOption(e);if(t)return JSON.parse(t)}catch(t){console.warn(`Unable to parse ${e}.`,t)}return[]}e.deferred=t("deferredExtensions"),e.disabled=t("disabledExtensions"),e.isDeferred=function(t){const n=t.indexOf(":");let r="";return-1!==n&&(r=t.slice(0,n)),e.deferred.some((e=>e===t||r&&e===r))},e.isDisabled=function(t){const n=t.indexOf(":");let r="";return-1!==n&&(r=t.slice(0,n)),e.disabled.some((e=>e===t||r&&e===r))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig=exports.PageConfig||(exports.PageConfig={}))},176:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const r=n(470);!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=r.posix.join(...e);return"."===n?"":t(n)},e.basename=function(e,t){return r.posix.basename(e,t)},e.dirname=function(e){const n=t(r.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return r.posix.extname(e)},e.normalize=function(e){return""===e?"":t(r.posix.normalize(e))},e.resolve=function(...e){return t(r.posix.resolve(...e))},e.relative=function(e,n){return t(r.posix.relative(e,n))},e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e},e.removeSlash=t}(t.PathExt||(t.PathExt={}))},643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const r=n(82);t.signalToPromise=function(e,t){const n=new r.PromiseDelegate;function o(){e.disconnect(i)}function i(e,t){o(),n.resolve([e,t])}return e.connect(i),(null!=t?t:0)>0&&setTimeout((()=>{o(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},846:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,(n=t.Text||(t.Text={})).jsIndexToCharIndex=function(e,t){return e},n.charIndexToJsIndex=function(e,t){return e},n.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,r){return r?r.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},n.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}},533:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Time=void 0;const n=[{name:"years",milliseconds:31536e6},{name:"months",milliseconds:2592e6},{name:"days",milliseconds:864e5},{name:"hours",milliseconds:36e5},{name:"minutes",milliseconds:6e4},{name:"seconds",milliseconds:1e3}];var r;(r=t.Time||(t.Time={})).formatHuman=function(e){const t=document.documentElement.lang||"en",r=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),o=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(o/e.milliseconds);if(0!==t)return r.format(t,e.name)}return r.format(0,"seconds")},r.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}},319:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const o=n(470),i=r(n(564));!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,i.default)(e)}function n(...e){let t=(0,i.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,i.default)(e[0],"https:"+e[0]));const r=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,s=o.posix.join(`${r&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${r}${"."===s?"":s}`}e.parse=t,e.getHostName=function(e){return(0,i.default)(e).hostname},e.normalize=function(e){return e&&t(e).toString()},e.join=n,e.encodeParts=function(e){return n(...e.split("/").map(encodeURIComponent))},e.objectToQueryString=function(e){const t=Object.keys(e).filter((e=>e.length>0));return t.length?"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&"):""},e.queryStringToObject=function(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,r]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(r||"")),e}),{})},e.isLocal=function(e){const{protocol:n}=t(e);return(!n||0!==e.toLowerCase().indexOf(n))&&0!==e.indexOf("/")}}(t.URLExt||(t.URLExt={}))},82:function(e,t){!function(e){"use strict";e.JSONExt=void 0,function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function n(e){return Array.isArray(e)}function r(e,o){if(e===o)return!0;if(t(e)||t(o))return!1;let i=n(e),s=n(o);return i===s&&(i&&s?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;++n)if(!r(e[n],t[n]))return!1;return!0}(e,o):function(e,t){if(e===t)return!0;for(let n in e)if(void 0!==e[n]&&!(n in t))return!1;for(let n in t)if(void 0!==t[n]&&!(n in e))return!1;for(let n in e){let o=e[n],i=t[n];if(void 0!==o||void 0!==i){if(void 0===o||void 0===i)return!1;if(!r(o,i))return!1}}return!0}(e,o))}function o(e){return t(e)?e:n(e)?function(e){let t=new Array(e.length);for(let n=0,r=e.length;n<r;++n)t[n]=o(e[n]);return t}(e):function(e){let t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=o(r))}return t}(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=n,e.isObject=function(e){return!t(e)&&!n(e)},e.deepEqual=r,e.deepCopy=o}(e.JSONExt||(e.JSONExt={}));function t(e){let t=0;for(let n=0,r=e.length;n<r;++n)n%4==0&&(t=4294967295*Math.random()>>>0),e[n]=255&t,t>>>=8}e.Random=void 0,(e.Random||(e.Random={})).getRandomValues=(()=>{const e="undefined"!=typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"==typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:t})(),e.UUID=void 0,(e.UUID||(e.UUID={})).uuid4=function(e){const t=new Uint8Array(16),n=new Array(256);for(let e=0;e<16;++e)n[e]="0"+e.toString(16);for(let e=16;e<256;++e)n[e]=e.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]}}(e.Random.getRandomValues),e.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(e){return-1!==this._types.indexOf(e)}getData(e){let t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){let t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}},e.PromiseDelegate=class{constructor(){this.promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}resolve(e){(0,this._resolve)(e)}reject(e){(0,this._reject)(e)}},e.Token=class{constructor(e,t){this.name=e,this.description=null!=t?t:"",this._tokenStructuralPropertyT=null}}}(t)},521:(e,t,n)=>{"use strict";var r,o,i;n.r(t),n.d(t,{Signal:()=>l,Stream:()=>c}),function(e){function t(e,t,n=0,r=-1){let o,i=e.length;if(0===i)return-1;n=n<0?Math.max(0,n+i):Math.min(n,i-1),o=(r=r<0?Math.max(0,r+i):Math.min(r,i-1))<n?r+1+(i-n):r-n+1;for(let r=0;r<o;++r){let o=(n+r)%i;if(e[o]===t)return o}return-1}function n(e,t,n=-1,r=0){let o,i=e.length;if(0===i)return-1;o=(n=n<0?Math.max(0,n+i):Math.min(n,i-1))<(r=r<0?Math.max(0,r+i):Math.min(r,i-1))?n+1+(i-r):n-r+1;for(let r=0;r<o;++r){let o=(n-r+i)%i;if(e[o]===t)return o}return-1}function r(e,t,n=0,r=-1){let o,i=e.length;if(0===i)return-1;n=n<0?Math.max(0,n+i):Math.min(n,i-1),o=(r=r<0?Math.max(0,r+i):Math.min(r,i-1))<n?r+1+(i-n):r-n+1;for(let r=0;r<o;++r){let o=(n+r)%i;if(t(e[o],o))return o}return-1}function o(e,t,n=-1,r=0){let o,i=e.length;if(0===i)return-1;o=(n=n<0?Math.max(0,n+i):Math.min(n,i-1))<(r=r<0?Math.max(0,r+i):Math.min(r,i-1))?n+1+(i-r):n-r+1;for(let r=0;r<o;++r){let o=(n-r+i)%i;if(t(e[o],o))return o}return-1}function i(e,t=0,n=-1){let r=e.length;if(!(r<=1))for(t=t<0?Math.max(0,t+r):Math.min(t,r-1),n=n<0?Math.max(0,n+r):Math.min(n,r-1);t<n;){let r=e[t],o=e[n];e[t++]=o,e[n--]=r}}function s(e,t){let n=e.length;if(t<0&&(t+=n),t<0||t>=n)return;let r=e[t];for(let r=t+1;r<n;++r)e[r-1]=e[r];return e.length=n-1,r}e.firstIndexOf=t,e.lastIndexOf=n,e.findFirstIndex=r,e.findLastIndex=o,e.findFirstValue=function(e,t,n=0,o=-1){let i=r(e,t,n,o);return-1!==i?e[i]:void 0},e.findLastValue=function(e,t,n=-1,r=0){let i=o(e,t,n,r);return-1!==i?e[i]:void 0},e.lowerBound=function(e,t,n,r=0,o=-1){let i=e.length;if(0===i)return 0;let s=r=r<0?Math.max(0,r+i):Math.min(r,i-1),a=(o=o<0?Math.max(0,o+i):Math.min(o,i-1))-r+1;for(;a>0;){let r=a>>1,o=s+r;n(e[o],t)<0?(s=o+1,a-=r+1):a=r}return s},e.upperBound=function(e,t,n,r=0,o=-1){let i=e.length;if(0===i)return 0;let s=r=r<0?Math.max(0,r+i):Math.min(r,i-1),a=(o=o<0?Math.max(0,o+i):Math.min(o,i-1))-r+1;for(;a>0;){let r=a>>1,o=s+r;n(e[o],t)>0?a=r:(s=o+1,a-=r+1)}return s},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;++r)if(n?!n(e[r],t[r]):e[r]!==t[r])return!1;return!0},e.slice=function(e,t={}){let{start:n,stop:r,step:o}=t;if(void 0===o&&(o=1),0===o)throw new Error("Slice `step` cannot be zero.");let i,s=e.length;void 0===n?n=o<0?s-1:0:n<0?n=Math.max(n+s,o<0?-1:0):n>=s&&(n=o<0?s-1:s),void 0===r?r=o<0?-1:s:r<0?r=Math.max(r+s,o<0?-1:0):r>=s&&(r=o<0?s-1:s),i=o<0&&r>=n||o>0&&n>=r?0:o<0?Math.floor((r-n+1)/o+1):Math.floor((r-n-1)/o+1);let a=[];for(let t=0;t<i;++t)a[t]=e[n+t*o];return a},e.move=function(e,t,n){let r=e.length;if(r<=1)return;if((t=t<0?Math.max(0,t+r):Math.min(t,r-1))===(n=n<0?Math.max(0,n+r):Math.min(n,r-1)))return;let o=e[t],i=t<n?1:-1;for(let r=t;r!==n;r+=i)e[r]=e[r+i];e[n]=o},e.reverse=i,e.rotate=function(e,t,n=0,r=-1){let o=e.length;if(o<=1)return;if((n=n<0?Math.max(0,n+o):Math.min(n,o-1))>=(r=r<0?Math.max(0,r+o):Math.min(r,o-1)))return;let s=r-n+1;if(t>0?t%=s:t<0&&(t=(t%s+s)%s),0===t)return;let a=n+t;i(e,n,a-1),i(e,a,r),i(e,n,r)},e.fill=function(e,t,n=0,r=-1){let o,i=e.length;if(0!==i){n=n<0?Math.max(0,n+i):Math.min(n,i-1),o=(r=r<0?Math.max(0,r+i):Math.min(r,i-1))<n?r+1+(i-n):r-n+1;for(let r=0;r<o;++r)e[(n+r)%i]=t}},e.insert=function(e,t,n){let r=e.length;t=t<0?Math.max(0,t+r):Math.min(t,r);for(let n=r;n>t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=s,e.removeFirstOf=function(e,n,r=0,o=-1){let i=t(e,n,r,o);return-1!==i&&s(e,i),i},e.removeLastOf=function(e,t,r=-1,o=0){let i=n(e,t,r,o);return-1!==i&&s(e,i),i},e.removeAllOf=function(e,t,n=0,r=-1){let o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);let i=0;for(let s=0;s<o;++s)n<=r&&s>=n&&s<=r&&e[s]===t||r<n&&(s<=r||s>=n)&&e[s]===t?i++:i>0&&(e[s-i]=e[s]);return i>0&&(e.length=o-i),i},e.removeFirstWhere=function(e,t,n=0,o=-1){let i,a=r(e,t,n,o);return-1!==a&&(i=s(e,a)),{index:a,value:i}},e.removeLastWhere=function(e,t,n=-1,r=0){let i,a=o(e,t,n,r);return-1!==a&&(i=s(e,a)),{index:a,value:i}},e.removeAllWhere=function(e,t,n=0,r=-1){let o=e.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),r=r<0?Math.max(0,r+o):Math.min(r,o-1);let i=0;for(let s=0;s<o;++s)n<=r&&s>=n&&s<=r&&t(e[s],s)||r<n&&(s<=r||s>=n)&&t(e[s],s)?i++:i>0&&(e[s-i]=e[s]);return i>0&&(e.length=o-i),i}}(r||(r={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||e<t&&n<0?0:Math.ceil((t-e)/n)}}(o||(o={})),function(e){function t(e,t,n=0){let r=new Array(t.length);for(let o=0,i=n,s=t.length;o<s;++o,++i){if(i=e.indexOf(t[o],i),-1===i)return null;r[o]=i}return r}e.findIndices=t,e.matchSumOfSquares=function(e,n,r=0){let o=t(e,n,r);if(!o)return null;let i=0;for(let e=0,t=o.length;e<t;++e){let t=o[e]-r;i+=t*t}return{score:i,indices:o}},e.matchSumOfDeltas=function(e,n,r=0){let o=t(e,n,r);if(!o)return null;let i=0,s=r-1;for(let e=0,t=o.length;e<t;++e){let t=o[e];i+=t-s-1,s=t}return{score:i,indices:o}},e.highlight=function(e,t,n){let r=[],o=0,i=0,s=t.length;for(;o<s;){let a=t[o],l=t[o];for(;++o<s&&t[o]===l+1;)l++;i<a&&r.push(e.slice(i,a)),a<l+1&&r.push(n(e.slice(a,l+1))),i=l+1}return i<e.length&&r.push(e.slice(i)),r},e.cmp=function(e,t){return e<t?-1:e>t?1:0}}(i||(i={}));var s,a=n(82);class l{constructor(e){this.sender=e}connect(e,t){return s.connect(this,e,t)}disconnect(e,t){return s.disconnect(this,e,t)}emit(e){s.emit(this,e)}}!function(e){e.disconnectBetween=function(e,t){s.disconnectBetween(e,t)},e.disconnectSender=function(e){s.disconnectSender(e)},e.disconnectReceiver=function(e){s.disconnectReceiver(e)},e.disconnectAll=function(e){s.disconnectAll(e)},e.clearData=function(e){s.disconnectAll(e)},e.getExceptionHandler=function(){return s.exceptionHandler},e.setExceptionHandler=function(e){let t=s.exceptionHandler;return s.exceptionHandler=e,t}}(l||(l={}));class c extends l{constructor(){super(...arguments),this._pending=new a.PromiseDelegate}async*[Symbol.asyncIterator](){let e=this._pending;for(;;)try{const{args:t,next:n}=await e.promise;e=n,yield t}catch(e){return}}emit(e){const t=this._pending,n=this._pending=new a.PromiseDelegate;t.resolve({args:e,next:n}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new a.PromiseDelegate}}!function(e){function t(e){let t=o.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.thisArg||e.slot;e.signal=null,u(i.get(t))}u(t)}}function n(e){let t=i.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,u(o.get(t))}u(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,n){n=n||void 0;let r=o.get(e.sender);if(r||(r=[],o.set(e.sender,r)),l(r,e,t,n))return!1;let s=n||t,a=i.get(s);a||(a=[],i.set(s,a));let c={signal:e,slot:t,thisArg:n};return r.push(c),a.push(c),!0},e.disconnect=function(e,t,n){n=n||void 0;let r=o.get(e.sender);if(!r||0===r.length)return!1;let s=l(r,e,t,n);if(!s)return!1;let a=n||t,c=i.get(a);return s.signal=null,u(r),u(c),!0},e.disconnectBetween=function(e,t){let n=o.get(e);if(!n||0===n.length)return;let r=i.get(t);if(r&&0!==r.length){for(const t of r)t.signal&&t.signal.sender===e&&(t.signal=null);u(n),u(r)}},e.disconnectSender=t,e.disconnectReceiver=n,e.disconnectAll=function(e){t(e),n(e)},e.emit=function(e,t){let n=o.get(e.sender);if(n&&0!==n.length)for(let r=0,o=n.length;r<o;++r){let o=n[r];o.signal===e&&c(o,t)}};const o=new WeakMap,i=new WeakMap,s=new Set,a="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function l(e,t,n,r){return function(e,o){for(const o of e)if((i=o).signal===t&&i.slot===n&&i.thisArg===r)return o;var i}(e)}function c(t,n){let{signal:r,slot:o,thisArg:i}=t;try{o.call(i,r.sender,n)}catch(t){e.exceptionHandler(t)}}function u(e){0===s.size&&a(f),s.add(e)}function f(){s.forEach(h),s.clear()}function h(e){r.removeAllWhere(e,d)}function d(e){return null===e.signal}}(s||(s={}))},562:e=>{"use strict";function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return"constructor"===t&&"function"==typeof e[t]||"__proto__"===t}e.exports=function(e,r){r||(r={});var o={bools:{},strings:{},unknownFn:null};"function"==typeof r.unknown&&(o.unknownFn=r.unknown),"boolean"==typeof r.boolean&&r.boolean?o.allBools=!0:[].concat(r.boolean).filter(Boolean).forEach((function(e){o.bools[e]=!0}));var i={};function s(e){return i[e].some((function(e){return o.bools[e]}))}Object.keys(r.alias||{}).forEach((function(e){i[e]=[].concat(r.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(r.string).filter(Boolean).forEach((function(e){o.strings[e]=!0,i[e]&&[].concat(i[e]).forEach((function(e){o.strings[e]=!0}))}));var a=r.default||{},l={_:[]};function c(e,t,r){for(var i=e,s=0;s<t.length-1;s++){var a=t[s];if(n(i,a))return;void 0===i[a]&&(i[a]={}),i[a]!==Object.prototype&&i[a]!==Number.prototype&&i[a]!==String.prototype||(i[a]={}),i[a]===Array.prototype&&(i[a]=[]),i=i[a]}var l=t[t.length-1];n(i,l)||(i!==Object.prototype&&i!==Number.prototype&&i!==String.prototype||(i={}),i===Array.prototype&&(i=[]),void 0===i[l]||o.bools[l]||"boolean"==typeof i[l]?i[l]=r:Array.isArray(i[l])?i[l].push(r):i[l]=[i[l],r])}function u(e,n,r){if(!r||!o.unknownFn||function(e,t){return o.allBools&&/^--[^=]+$/.test(t)||o.strings[e]||o.bools[e]||i[e]}(e,r)||!1!==o.unknownFn(r)){var s=!o.strings[e]&&t(n)?Number(n):n;c(l,e.split("."),s),(i[e]||[]).forEach((function(e){c(l,e.split("."),s)}))}}Object.keys(o.bools).forEach((function(e){u(e,void 0!==a[e]&&a[e])}));var f=[];-1!==e.indexOf("--")&&(f=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var h=0;h<e.length;h++){var d,p,m=e[h];if(/^--.+=/.test(m)){var g=m.match(/^--([^=]+)=([\s\S]*)$/);d=g[1];var _=g[2];o.bools[d]&&(_="false"!==_),u(d,_,m)}else if(/^--no-.+/.test(m))u(d=m.match(/^--no-(.+)/)[1],!1,m);else if(/^--.+/.test(m))d=m.match(/^--(.+)/)[1],void 0===(p=e[h+1])||/^(-|--)[^-]/.test(p)||o.bools[d]||o.allBools||i[d]&&s(d)?/^(true|false)$/.test(p)?(u(d,"true"===p,m),h+=1):u(d,!o.strings[d]||"",m):(u(d,p,m),h+=1);else if(/^-[^-]+/.test(m)){for(var v=m.slice(1,-1).split(""),y=!1,w=0;w<v.length;w++)if("-"!==(p=m.slice(w+2))){if(/[A-Za-z]/.test(v[w])&&"="===p[0]){u(v[w],p.slice(1),m),y=!0;break}if(/[A-Za-z]/.test(v[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){u(v[w],p,m),y=!0;break}if(v[w+1]&&v[w+1].match(/\W/)){u(v[w],m.slice(w+2),m),y=!0;break}u(v[w],!o.strings[v[w]]||"",m)}else u(v[w],p,m);d=m.slice(-1)[0],y||"-"===d||(!e[h+1]||/^(-|--)[^-]/.test(e[h+1])||o.bools[d]||i[d]&&s(d)?e[h+1]&&/^(true|false)$/.test(e[h+1])?(u(d,"true"===e[h+1],m),h+=1):u(d,!o.strings[d]||"",m):(u(d,e[h+1],m),h+=1))}else if(o.unknownFn&&!1===o.unknownFn(m)||l._.push(o.strings._||!t(m)?m:Number(m)),r.stopEarly){l._.push.apply(l._,e.slice(h+1));break}}return Object.keys(a).forEach((function(e){var t,n,r;t=l,n=e.split("."),r=t,n.slice(0,-1).forEach((function(e){r=r[e]||{}})),n[n.length-1]in r||(c(l,e.split("."),a[e]),(i[e]||[]).forEach((function(t){c(l,t.split("."),a[e])})))})),r["--"]?l["--"]=f.slice():f.forEach((function(e){l._.push(e)})),l}},470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",o=0):o=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",o=0,i=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(i+1,a):r=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var s;i>=0?s=arguments[i]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,o=47===s.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,s=i-o,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var l=n.length-a,c=s<l?s:l,u=-1,f=0;f<=c;++f){if(f===c){if(l>c){if(47===n.charCodeAt(a+f))return n.slice(a+f+1);if(0===f)return n.slice(a+f)}else s>c&&(47===e.charCodeAt(o+f)?u=f:0===f&&(u=0));break}var h=e.charCodeAt(o+f);if(h!==n.charCodeAt(a+f))break;47===h&&(u=f)}var d="";for(f=o+u+1;f<=i;++f)f!==i&&47!==e.charCodeAt(f)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+u):(a+=u,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,i=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!s){o=r+1;break}}else-1===l&&(s=!1,l=r+1),a>=0&&(c===n.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=l))}return o===i?i=l:-1===i&&(i=e.length),e.slice(o,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){o=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===o&&(i=!1,o=a+1),46===l?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!i){r=a+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),i=47===o;i?(n.root="/",r=1):r=0;for(var s=-1,a=0,l=-1,c=!0,u=e.length-1,f=0;u>=r;--u)if(47!==(o=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!c){a=u+1;break}return-1===s||-1===l||0===f||1===f&&s===l-1&&s===a+1?-1!==l&&(n.base=n.name=0===a&&i?e.slice(1,l):e.slice(a,l)):(0===a&&i?(n.name=e.slice(1,s),n.base=e.slice(1,l)):(n.name=e.slice(a,s),n.base=e.slice(a,l)),n.ext=e.slice(s,l)),a>0?n.dir=e.slice(0,a-1):i&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},129:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(n.call(e,i)){if((r=e[i])||null!=r&&!isNaN(r)||(r=""),i=o(i),r=o(r),null===i||null===r)continue;s.push(i+"="+r)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var i=r(t[1]),s=r(t[2]);null===i||null===s||i in o||(o[i]=s)}return o}},418:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},564:(e,t,n)=>{"use strict";var r=n(418),o=n(129),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function f(e){return(e||"").toString().replace(i,"")}var h=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function p(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},o={},i=typeof(e=e||r);if("blob:"===e.protocol)o=new _(unescape(e.pathname),{});else if("string"===i)for(t in o=new _(e,{}),d)delete o[t];else if("object"===i){for(t in e)t in d||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=f(e)).replace(s,""),t=t||{};var n,r=c.exec(e),o=r[1]?r[1].toLowerCase():"",i=!!r[2],a=!!r[3],l=0;return i?a?(n=r[2]+r[3]+r[4],l=r[2].length+r[3].length):(n=r[2]+r[4],l=r[2].length):a?(n=r[3]+r[4],l=r[3].length):n=r[4],"file:"===o?l>=2&&(n=n.slice(2)):m(o)?n=r[4]:o?i&&(n=n.slice(2)):l>=2&&m(t.protocol)&&(n=r[4]),{protocol:o,slashes:i||m(o),slashesCount:l,rest:n}}function _(e,t,n){if(e=(e=f(e)).replace(s,""),!(this instanceof _))return new _(e,t,n);var i,a,l,c,d,v,y=h.slice(),w=typeof t,b=this,x=0;for("object"!==w&&"string"!==w&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),i=!(a=g(e||"",t=p(t))).protocol&&!a.slashes,b.slashes=a.slashes||i&&t.slashes,b.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(b.protocol)))&&(y[3]=[/(.*)/,"pathname"]);x<y.length;x++)"function"!=typeof(c=y[x])?(l=c[0],v=c[1],l!=l?b[v]=e:"string"==typeof l?~(d="@"===l?e.lastIndexOf(l):e.indexOf(l))&&("number"==typeof c[2]?(b[v]=e.slice(0,d),e=e.slice(d+c[2])):(b[v]=e.slice(d),e=e.slice(0,d))):(d=l.exec(e))&&(b[v]=d[1],e=e.slice(0,d.index)),b[v]=b[v]||i&&c[3]&&t[v]||"",c[4]&&(b[v]=b[v].toLowerCase())):e=c(e,b);n&&(b.query=n(b.query)),i&&t.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==t.pathname)&&(b.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(i=!0),n.splice(r,1),s--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(b.pathname,t.pathname)),"/"!==b.pathname.charAt(0)&&m(b.protocol)&&(b.pathname="/"+b.pathname),r(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(~(d=b.auth.indexOf(":"))?(b.username=b.auth.slice(0,d),b.username=encodeURIComponent(decodeURIComponent(b.username)),b.password=b.auth.slice(d+1),b.password=encodeURIComponent(decodeURIComponent(b.password))):b.username=encodeURIComponent(decodeURIComponent(b.auth)),b.auth=b.password?b.username+":"+b.password:b.username),b.origin="file:"!==b.protocol&&m(b.protocol)&&b.host?b.protocol+"//"+b.host:"null",b.href=b.toString()}_.prototype={set:function(e,t,n){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),i[e]=t;break;case"port":i[e]=t,r(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,l.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!n;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;case"username":case"password":i[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(i.username=t.slice(0,a),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=t.slice(a+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(t))}for(var c=0;c<h.length;c++){var u=h[c];u[4]&&(i[u[1]]=i[u[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin="file:"!==i.protocol&&m(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.host,i=n.protocol;i&&":"!==i.charAt(i.length-1)&&(i+=":");var s=i+(n.protocol&&n.slashes||m(n.protocol)?"//":"");return n.username?(s+=n.username,n.password&&(s+=":"+n.password),s+="@"):n.password?(s+=":"+n.password,s+="@"):"file:"!==n.protocol&&m(n.protocol)&&!r&&"/"!==n.pathname&&(s+="@"),(":"===r[r.length-1]||l.test(n.hostname)&&!n.port)&&(r+=":"),s+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(s+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(s+=n.hash),s}},_.extractProtocol=g,_.location=p,_.trimLeft=f,_.qs=o,e.exports=_}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__);const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.finalizer"),o=Symbol("Comlink.thrown"),i=e=>"object"==typeof e&&null!==e||"function"==typeof e,s=new Map([["proxy",{canHandle:t=>i(t)&&t[e],serialize(e){const{port1:t,port2:n}=new MessageChannel;return a(e,t),[n,[n]]},deserialize:e=>(e.start(),d(e,[],undefined))}],["throw",{canHandle:e=>i(e)&&o in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function a(t,n=globalThis,i=["*"]){n.addEventListener("message",(function s(c){if(!c||!c.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(i,c.origin))return void console.warn(`Invalid origin '${c.origin}' for comlink proxy`);const{id:u,type:f,path:h}=Object.assign({path:[]},c.data),d=(c.data.argumentList||[]).map(_);let p;try{const n=h.slice(0,-1).reduce(((e,t)=>e[t]),t),r=h.reduce(((e,t)=>e[t]),t);switch(f){case"GET":p=r;break;case"SET":n[h.slice(-1)[0]]=_(c.data.value),p=!0;break;case"APPLY":p=r.apply(n,d);break;case"CONSTRUCT":p=function(t){return Object.assign(t,{[e]:!0})}(new r(...d));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;a(t,n),p=function(e,t){return m.set(e,t),e}(e,[e])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[o]:0}}Promise.resolve(p).catch((e=>({value:e,[o]:0}))).then((e=>{const[o,i]=g(e);n.postMessage(Object.assign(Object.assign({},o),{id:u}),i),"RELEASE"===f&&(n.removeEventListener("message",s),l(n),r in t&&"function"==typeof t[r]&&t[r]())})).catch((e=>{const[t,r]=g({value:new TypeError("Unserializable return value"),[o]:0});n.postMessage(Object.assign(Object.assign({},t),{id:u}),r)}))})),n.start&&n.start()}function l(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function c(e){if(e)throw new Error("Proxy has been released and is not useable")}function u(e){return v(e,{type:"RELEASE"}).then((()=>{l(e)}))}const f=new WeakMap,h="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(f.get(e)||0)-1;f.set(e,t),0===t&&u(e)}));function d(e,r=[],o=function(){}){let i=!1;const s=new Proxy(o,{get(t,o){if(c(i),o===n)return()=>{!function(e){h&&h.unregister(e)}(s),u(e),i=!0};if("then"===o){if(0===r.length)return{then:()=>s};const t=v(e,{type:"GET",path:r.map((e=>e.toString()))}).then(_);return t.then.bind(t)}return d(e,[...r,o])},set(t,n,o){c(i);const[s,a]=g(o);return v(e,{type:"SET",path:[...r,n].map((e=>e.toString())),value:s},a).then(_)},apply(n,o,s){c(i);const a=r[r.length-1];if(a===t)return v(e,{type:"ENDPOINT"}).then(_);if("bind"===a)return d(e,r.slice(0,-1));const[l,u]=p(s);return v(e,{type:"APPLY",path:r.map((e=>e.toString())),argumentList:l},u).then(_)},construct(t,n){c(i);const[o,s]=p(n);return v(e,{type:"CONSTRUCT",path:r.map((e=>e.toString())),argumentList:o},s).then(_)}});return function(e,t){const n=(f.get(t)||0)+1;f.set(t,n),h&&h.register(e,t,e)}(s,e),s}function p(e){const t=e.map(g);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const m=new WeakMap;function g(e){for(const[t,n]of s)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},m.get(e)||[]]}function _(e){switch(e.type){case"HANDLER":return s.get(e.name).deserialize(e.value);case"RAW":return e.value}}function v(e,t,n){return new Promise((r=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===o&&(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)}))}const y=new TextEncoder,w=new TextDecoder("utf-8"),b={0:!1,1:!0,2:!0,64:!0,65:!0,66:!0,129:!0,193:!0,514:!0,577:!0,578:!0,705:!0,706:!0,1024:!0,1025:!0,1026:!0,1089:!0,1090:!0,1153:!0,1154:!0,1217:!0,1218:!0,4096:!0,4098:!0};class x{constructor(e){this.fs=e}open(e){const t=this.fs.realPath(e.node);this.fs.FS.isFile(e.node.mode)&&(e.file=this.fs.API.get(t))}close(e){if(!this.fs.FS.isFile(e.node.mode)||!e.file)return;const t=this.fs.realPath(e.node),n=e.flags;let r="string"==typeof n?parseInt(n,10):n;r&=8191;let o=!0;r in b&&(o=b[r]),o&&this.fs.API.put(t,e.file),e.file=void 0}read(e,t,n,r,o){if(r<=0||void 0===e.file||o>=(e.file.data.length||0))return 0;const i=Math.min(e.file.data.length-o,r);return t.set(e.file.data.subarray(o,o+i),n),i}write(e,t,n,r,o){var i;if(r<=0||void 0===e.file)return 0;if(e.node.timestamp=Date.now(),o+r>((null===(i=e.file)||void 0===i?void 0:i.data.length)||0)){const t=e.file.data?e.file.data:new Uint8Array;e.file.data=new Uint8Array(o+r),e.file.data.set(t)}return e.file.data.set(t.subarray(n,n+r),o),r}llseek(e,t,n){let r=t;if(1===n)r+=e.position;else if(2===n&&this.fs.FS.isFile(e.node.mode)){if(void 0===e.file)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM);r+=e.file.data.length}if(r<0)throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EINVAL);return r}}class E{constructor(e){this.fs=e}getattr(e){return{...this.fs.API.getattr(this.fs.realPath(e)),mode:e.mode,ino:e.id}}setattr(e,t){for(const[n,r]of Object.entries(t))switch(n){case"mode":e.mode=r;break;case"timestamp":e.timestamp=r;break;default:console.warn("setattr",n,"of",r,"on",e,"not yet implemented")}}lookup(e,t){const n=this.fs.PATH.join2(this.fs.realPath(e),t),r=this.fs.API.lookup(n);if(!r.ok)throw this.fs.FS.genericErrors[this.fs.ERRNO_CODES.ENOENT];return this.fs.createNode(e,t,r.mode,0)}mknod(e,t,n,r){const o=this.fs.PATH.join2(this.fs.realPath(e),t);return this.fs.API.mknod(o,n),this.fs.createNode(e,t,n,r)}rename(e,t,n){this.fs.API.rename(e.parent?this.fs.PATH.join2(this.fs.realPath(e.parent),e.name):e.name,this.fs.PATH.join2(this.fs.realPath(t),n)),e.name=n,e.parent=t}unlink(e,t){this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(e),t))}rmdir(e,t){this.fs.API.rmdir(this.fs.PATH.join2(this.fs.realPath(e),t))}readdir(e){return this.fs.API.readdir(this.fs.realPath(e))}symlink(e,t,n){throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM)}readlink(e){throw new this.fs.FS.ErrnoError(this.fs.ERRNO_CODES.EPERM)}}class O{constructor(e,t,n,r,o){this._baseUrl=e,this._driveName=t,this._mountpoint=n,this.FS=r,this.ERRNO_CODES=o}request(e){const t=new XMLHttpRequest;t.open("POST",encodeURI(this.endpoint),!1);try{t.send(JSON.stringify(e))}catch(e){console.error(e)}if(t.status>=400)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return JSON.parse(t.responseText)}lookup(e){return this.request({method:"lookup",path:this.normalizePath(e)})}getmode(e){return Number.parseInt(this.request({method:"getmode",path:this.normalizePath(e)}))}mknod(e,t){return this.request({method:"mknod",path:this.normalizePath(e),data:{mode:t}})}rename(e,t){return this.request({method:"rename",path:this.normalizePath(e),data:{newPath:this.normalizePath(t)}})}readdir(e){const t=this.request({method:"readdir",path:this.normalizePath(e)});return t.push("."),t.push(".."),t}rmdir(e){return this.request({method:"rmdir",path:this.normalizePath(e)})}get(e){const t=this.request({method:"get",path:this.normalizePath(e)}),n=t.content,r=t.format;switch(r){case"json":case"text":return{data:y.encode(n),format:r};case"base64":{const e=atob(n),t=e.length,o=new Uint8Array(t);for(let n=0;n<t;n++)o[n]=e.charCodeAt(n);return{data:o,format:r}}default:throw new this.FS.ErrnoError(this.ERRNO_CODES.ENOENT)}}put(e,t){switch(t.format){case"json":case"text":return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:w.decode(t.data)}});case"base64":{let n="";for(let e=0;e<t.data.byteLength;e++)n+=String.fromCharCode(t.data[e]);return this.request({method:"put",path:this.normalizePath(e),data:{format:t.format,data:btoa(n)}})}}}getattr(e){const t=this.request({method:"getattr",path:this.normalizePath(e)});return t.atime=new Date(t.atime),t.mtime=new Date(t.mtime),t.ctime=new Date(t.ctime),t.size=t.size||0,t}normalizePath(e){return e.startsWith(this._mountpoint)&&(e=e.slice(this._mountpoint.length)),this._driveName&&(e=`${this._driveName}:${e}`),e}get endpoint(){return`${this._baseUrl}api/drive`}}class k{constructor(e){this.FS=e.FS,this.PATH=e.PATH,this.ERRNO_CODES=e.ERRNO_CODES,this.API=new O(e.baseUrl,e.driveName,e.mountpoint,this.FS,this.ERRNO_CODES),this.driveName=e.driveName,this.node_ops=new E(this),this.stream_ops=new x(this)}mount(e){return this.createNode(null,e.mountpoint,16895,0)}createNode(e,t,n,r){const o=this.FS;if(!o.isDir(n)&&!o.isFile(n))throw new o.ErrnoError(this.ERRNO_CODES.EINVAL);const i=o.createNode(e,t,n,r);return i.node_ops=this.node_ops,i.stream_ops=this.stream_ops,i}getMode(e){return this.API.getmode(e)}realPath(e){const t=[];let n=e;for(t.push(n.name);n.parent!==n;)n=n.parent,t.push(n.name);return t.reverse(),this.PATH.join.apply(null,t)}}var P=__webpack_require__(622);globalThis.Module={};class C extends E{getNode(e){return e.node?e.node:e}lookup(e,t){return super.lookup(this.getNode(e),t)}getattr(e){return super.getattr(this.getNode(e))}setattr(e,t){super.setattr(this.getNode(e),t)}mknod(e,t,n,r){return super.mknod(this.getNode(e),t,n,r)}rename(e,t,n){super.rename(this.getNode(e),this.getNode(t),n)}rmdir(e,t){super.rmdir(this.getNode(e),t)}readdir(e){return super.readdir(this.getNode(e))}}class M extends k{constructor(e){super(e),this.node_ops=new C(this)}}let R;globalThis.toplevel_promise=null,globalThis.toplevel_promise_py_proxy=null,self.get_stdin=async function(){return new Promise((e=>{R=e}))};class S{constructor(e){this._drive=null,this._resolve=e}async ready(){return await globalThis.ready}mount(e,t,n){const{FS:r,PATH:o,ERRNO_CODES:i}=globalThis.Module;r&&(this._drive=new M({FS:r,PATH:o,ERRNO_CODES:i,baseUrl:n,driveName:e,mountpoint:t}),r.mkdir(t),r.mount(this._drive,{},t),r.chdir(t))}cd(e){e&&globalThis.Module.FS&&globalThis.Module.FS.chdir(e)}isDir(e){try{const t=globalThis.Module.FS.lookupPath(e);return globalThis.Module.FS.isDir(t.node.mode)}catch(e){return!1}}async processMessage(e){const t=e.msg.header.msg_type;await this.ready(),null!==globalThis.toplevel_promise&&null!==globalThis.toplevel_promise_py_proxy&&(await globalThis.toplevel_promise,globalThis.toplevel_promise_py_proxy.delete(),globalThis.toplevel_promise_py_proxy=null,globalThis.toplevel_promise=null),"input_reply"===t?R(e.msg):this._raw_xserver.notify_listener(e.msg)}async initialize(e,t){const n=P.URLExt.join(t,e.argv[0]),r=n.replace(".js",".wasm");importScripts(n),globalThis.Module=await createXeusModule({locateFile:e=>e.endsWith(".wasm")?r:e});try{if(await this.waitRunDependency(),void 0!==globalThis.Module.async_init){const n=P.URLExt.join(t,`xeus/kernels/${e.dir}`),r=P.URLExt.join(t,"xeus/kernel_packages"),o=!0;await globalThis.Module.async_init(n,r,o)}await this.waitRunDependency(),this._raw_xkernel=new globalThis.Module.xkernel,this._raw_xserver=this._raw_xkernel.get_server(),this._raw_xkernel||console.error("Failed to start kernel!"),this._raw_xkernel.start()}catch(e){if("number"==typeof e){const t=globalThis.Module.get_exception_message(e);throw console.error(t),new Error(t)}throw console.error(e),e}this._resolve()}async waitRunDependency(){const e=new Promise((e=>{globalThis.Module.monitorRunDependencies=t=>{0===t&&e()}}));return globalThis.Module.addRunDependency("dummy"),globalThis.Module.removeRunDependency("dummy"),e}}globalThis.ready=new Promise((e=>{a(new S(e))}))})(),__webpack_exports__})()));
3
3
  //# sourceMappingURL=worker.js.map