diff --git a/Untitled b/Untitled deleted file mode 100644 index a6c9bd2..0000000 --- a/Untitled +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see thebe-lite.min.js.LICENSE.txt */ -(()=>{var __webpack_modules__={2918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseManager=void 0;const i=n(544),s=n(2700);t.BaseManager=class{constructor(e){var t;this._isDisposed=!1,this._disposed=new i.Signal(this),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings()}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}get isActive(){return!0}dispose(){this.isDisposed||(this._disposed.emit(void 0),i.Signal.clearData(this))}}},1611:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BuildManager=void 0;const i=n(8920),s=n(2700);t.BuildManager=class{constructor(e={}){var t;this._url="",this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings();const{baseUrl:n,appUrl:r}=this.serverSettings;this._url=i.URLExt.join(n,r,"api/build")}get isAvailable(){return"true"===i.PageConfig.getOption("buildAvailable").toLowerCase()}get shouldCheck(){return"true"===i.PageConfig.getOption("buildCheck").toLowerCase()}getStatus(){const{_url:e,serverSettings:t}=this;return s.ServerConnection.makeRequest(e,{},t).then((e=>{if(200!==e.status)throw new s.ServerConnection.ResponseError(e);return e.json()})).then((e=>{if("string"!=typeof e.status)throw new Error("Invalid data");if("string"!=typeof e.message)throw new Error("Invalid data");return e}))}build(){const{_url:e,serverSettings:t}=this;return s.ServerConnection.makeRequest(e,{method:"POST"},t).then((e=>{if(400===e.status)throw new s.ServerConnection.ResponseError(e,"Build aborted");if(200!==e.status){const t=`Build failed with ${e.status}.\n\n If you are experiencing the build failure after installing an extension (or trying to include previously installed extension after updating JupyterLab) please check the extension repository for new installation instructions as many extensions migrated to the prebuilt extensions system which no longer requires rebuilding JupyterLab (but uses a different installation procedure, typically involving a package manager such as 'pip' or 'conda').\n\n If you specifically intended to install a source extension, please run 'jupyter lab build' on the server for full output.`;throw new s.ServerConnection.ResponseError(e,t)}}))}cancel(){const{_url:e,serverSettings:t}=this;return s.ServerConnection.makeRequest(e,{method:"DELETE"},t).then((e=>{if(204!==e.status)throw new s.ServerConnection.ResponseError(e)}))}}},2677:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigWithDefaults=t.ConfigSection=void 0;const i=n(8920),s=n(6914);(t.ConfigSection||(t.ConfigSection={})).create=function(e){const t=new r(e);return t.load().then((()=>t))};class r{constructor(e){var t;this._url="unknown";const n=this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings();this._url=i.URLExt.join(n.baseUrl,"api/config",encodeURIComponent(e.name))}get data(){return this._data}async load(){const e=await s.ServerConnection.makeRequest(this._url,{},this.serverSettings);if(200!==e.status)throw await s.ServerConnection.ResponseError.create(e);this._data=await e.json()}async update(e){this._data={...this._data,...e};const t={method:"PATCH",body:JSON.stringify(e)},n=await s.ServerConnection.makeRequest(this._url,t,this.serverSettings);if(200!==n.status)throw await s.ServerConnection.ResponseError.create(n);return this._data=await n.json(),this._data}}t.ConfigWithDefaults=class{constructor(e){var t,n;this._className="",this._section=e.section,this._defaults=null!==(t=e.defaults)&&void 0!==t?t:{},this._className=null!==(n=e.className)&&void 0!==n?n:""}get(e){const t=this._classData();return e in t?t[e]:this._defaults[e]}set(e,t){const n={};if(n[e]=t,this._className){const e={};return e[this._className]=n,this._section.update(e)}return this._section.update(n)}_classData(){const e=this._section.data;return this._className&&this._className in e?e[this._className]:e}}},7593:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Drive=t.ContentsManager=t.Contents=void 0;const o=n(8920),a=n(544),l=n(6914),c=r(n(7033));var u,d;(d=t.Contents||(t.Contents={})).validateContentsModel=function(e){c.validateContentsModel(e)},d.validateCheckpointModel=function(e){c.validateCheckpointModel(e)},t.ContentsManager=class{constructor(e={}){var t,n;this._isDisposed=!1,this._additionalDrives=new Map,this._fileChanged=new a.Signal(this);const i=this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:l.ServerConnection.makeSettings();this._defaultDrive=null!==(n=e.defaultDrive)&&void 0!==n?n:new h({serverSettings:i}),this._defaultDrive.fileChanged.connect(this._onFileChanged,this)}get fileChanged(){return this._fileChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}addDrive(e){this._additionalDrives.set(e.name,e),e.fileChanged.connect(this._onFileChanged,this)}getSharedModelFactory(e){var t;const[n]=this._driveForPath(e);return null!==(t=null==n?void 0:n.sharedModelFactory)&&void 0!==t?t:null}localPath(e){const t=e.split("/"),n=t[0].split(":");return 1!==n.length&&this._additionalDrives.has(n[0])?o.PathExt.join(n.slice(1).join(":"),...t.slice(1)):o.PathExt.removeSlash(e)}normalize(e){const t=e.split(":");return 1===t.length?o.PathExt.normalize(e):`${t[0]}:${o.PathExt.normalize(t.slice(1).join(":"))}`}resolvePath(e,t){const n=this.driveName(e),i=this.localPath(e),s=o.PathExt.resolve("/",i,t);return n?`${n}:${s}`:s}driveName(e){const t=e.split("/")[0].split(":");return 1===t.length?"":this._additionalDrives.has(t[0])?t[0]:""}get(e,t){const[n,i]=this._driveForPath(e);return n.get(i,t).then((e=>{const t=[];if("directory"===e.type&&e.content){for(const i of e.content)t.push({...i,path:this._toGlobalPath(n,i.path)});return{...e,path:this._toGlobalPath(n,i),content:t,serverPath:e.path}}return{...e,path:this._toGlobalPath(n,i),serverPath:e.path}}))}getDownloadUrl(e){const[t,n]=this._driveForPath(e);return t.getDownloadUrl(n)}newUntitled(e={}){if(e.path){const t=this.normalize(e.path),[n,i]=this._driveForPath(t);return n.newUntitled({...e,path:i}).then((e=>({...e,path:o.PathExt.join(t,e.name),serverPath:e.path})))}return this._defaultDrive.newUntitled(e)}delete(e){const[t,n]=this._driveForPath(e);return t.delete(n)}rename(e,t){const[n,i]=this._driveForPath(e),[s,r]=this._driveForPath(t);if(n!==s)throw Error("ContentsManager: renaming files must occur within a Drive");return n.rename(i,r).then((e=>({...e,path:this._toGlobalPath(n,r),serverPath:e.path})))}save(e,t={}){const n=this.normalize(e),[i,s]=this._driveForPath(e);return i.save(s,{...t,path:s}).then((e=>({...e,path:n,serverPath:e.path})))}copy(e,t){const[n,i]=this._driveForPath(e),[s,r]=this._driveForPath(t);if(n===s)return n.copy(i,r).then((e=>({...e,path:this._toGlobalPath(n,e.path),serverPath:e.path})));throw Error("Copying files between drives is not currently implemented")}createCheckpoint(e){const[t,n]=this._driveForPath(e);return t.createCheckpoint(n)}listCheckpoints(e){const[t,n]=this._driveForPath(e);return t.listCheckpoints(n)}restoreCheckpoint(e,t){const[n,i]=this._driveForPath(e);return n.restoreCheckpoint(i,t)}deleteCheckpoint(e,t){const[n,i]=this._driveForPath(e);return n.deleteCheckpoint(i,t)}_toGlobalPath(e,t){return e===this._defaultDrive?o.PathExt.removeSlash(t):`${e.name}:${o.PathExt.removeSlash(t)}`}_driveForPath(e){const t=this.driveName(e),n=this.localPath(e);return t?[this._additionalDrives.get(t),n]:[this._defaultDrive,n]}_onFileChanged(e,t){var n,i;if(e===this._defaultDrive)this._fileChanged.emit(t);else{let s=null,r=null;(null===(n=t.newValue)||void 0===n?void 0:n.path)&&(s={...t.newValue,path:this._toGlobalPath(e,t.newValue.path)}),(null===(i=t.oldValue)||void 0===i?void 0:i.path)&&(r={...t.oldValue,path:this._toGlobalPath(e,t.oldValue.path)}),this._fileChanged.emit({type:t.type,newValue:s,oldValue:r})}}};class h{constructor(e={}){var t,n,i;this._isDisposed=!1,this._fileChanged=new a.Signal(this),this.name=null!==(t=e.name)&&void 0!==t?t:"Default",this._apiEndpoint=null!==(n=e.apiEndpoint)&&void 0!==n?n:"api/contents",this.serverSettings=null!==(i=e.serverSettings)&&void 0!==i?i:l.ServerConnection.makeSettings()}get fileChanged(){return this._fileChanged}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,a.Signal.clearData(this))}async get(e,t){let n=this._getUrl(e);if(t){"notebook"===t.type&&delete t.format;const e=t.content?"1":"0",i={...t,content:e};n+=o.URLExt.objectToQueryString(i)}const i=this.serverSettings,s=await l.ServerConnection.makeRequest(n,{},i);if(200!==s.status)throw await l.ServerConnection.ResponseError.create(s);const r=await s.json();return c.validateContentsModel(r),r}getDownloadUrl(e){const t=this.serverSettings.baseUrl;let n=o.URLExt.join(t,"files",o.URLExt.encodeParts(e));const i=document.cookie.match("\\b_xsrf=([^;]*)\\b");if(i){const e=new URL(n);e.searchParams.append("_xsrf",i[1]),n=e.toString()}return Promise.resolve(n)}async newUntitled(e={}){var t;let n="{}";e&&(e.ext&&(e.ext=u.normalizeExtension(e.ext)),n=JSON.stringify(e));const i=this.serverSettings,s=this._getUrl(null!==(t=e.path)&&void 0!==t?t:""),r={method:"POST",body:n},o=await l.ServerConnection.makeRequest(s,r,i);if(201!==o.status)throw await l.ServerConnection.ResponseError.create(o);const a=await o.json();return c.validateContentsModel(a),this._fileChanged.emit({type:"new",oldValue:null,newValue:a}),a}async delete(e){const t=this._getUrl(e),n=this.serverSettings,i=await l.ServerConnection.makeRequest(t,{method:"DELETE"},n);if(204!==i.status)throw await l.ServerConnection.ResponseError.create(i);this._fileChanged.emit({type:"delete",oldValue:{path:e},newValue:null})}async rename(e,t){const n=this.serverSettings,i=this._getUrl(e),s={method:"PATCH",body:JSON.stringify({path:t})},r=await l.ServerConnection.makeRequest(i,s,n);if(200!==r.status)throw await l.ServerConnection.ResponseError.create(r);const o=await r.json();return c.validateContentsModel(o),this._fileChanged.emit({type:"rename",oldValue:{path:e},newValue:o}),o}async save(e,t={}){const n=this.serverSettings,i=this._getUrl(e),s={method:"PUT",body:JSON.stringify(t)},r=await l.ServerConnection.makeRequest(i,s,n);if(200!==r.status&&201!==r.status)throw await l.ServerConnection.ResponseError.create(r);const o=await r.json();return c.validateContentsModel(o),this._fileChanged.emit({type:"save",oldValue:null,newValue:o}),o}async copy(e,t){const n=this.serverSettings,i=this._getUrl(t),s={method:"POST",body:JSON.stringify({copy_from:e})},r=await l.ServerConnection.makeRequest(i,s,n);if(201!==r.status)throw await l.ServerConnection.ResponseError.create(r);const o=await r.json();return c.validateContentsModel(o),this._fileChanged.emit({type:"new",oldValue:null,newValue:o}),o}async createCheckpoint(e){const t=this._getUrl(e,"checkpoints"),n=await l.ServerConnection.makeRequest(t,{method:"POST"},this.serverSettings);if(201!==n.status)throw await l.ServerConnection.ResponseError.create(n);const i=await n.json();return c.validateCheckpointModel(i),i}async listCheckpoints(e){const t=this._getUrl(e,"checkpoints"),n=await l.ServerConnection.makeRequest(t,{},this.serverSettings);if(200!==n.status)throw await l.ServerConnection.ResponseError.create(n);const i=await n.json();if(!Array.isArray(i))throw new Error("Invalid Checkpoint list");for(let e=0;eo.URLExt.encodeParts(e))),n=this.serverSettings.baseUrl;return o.URLExt.join(n,this._apiEndpoint,...t)}}t.Drive=h,function(e){e.normalizeExtension=function(e){return e.length>0&&0!==e.indexOf(".")&&(e=`.${e}`),e}}(u||(u={}))},7033:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateCheckpointModel=t.validateContentsModel=void 0;const i=n(8193);t.validateContentsModel=function(e){(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"path","string"),(0,i.validateProperty)(e,"type","string"),(0,i.validateProperty)(e,"created","string"),(0,i.validateProperty)(e,"last_modified","string"),(0,i.validateProperty)(e,"mimetype","object"),(0,i.validateProperty)(e,"content","object"),(0,i.validateProperty)(e,"format","object")},t.validateCheckpointModel=function(e){(0,i.validateProperty)(e,"id","string"),(0,i.validateProperty)(e,"last_modified","string")}},3354:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManager=void 0;const i=n(8920),s=n(9033),r=n(544),o=n(2700),a="api/events";t.EventManager=class{constructor(e={}){var t;this._socket=null,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:o.ServerConnection.makeSettings(),this._poll=new s.Poll({factory:()=>this._subscribe()}),this._stream=new r.Stream(this),this._poll.start()}get isDisposed(){return this._poll.isDisposed}get stream(){return this._stream}dispose(){if(this.isDisposed)return;this._poll.dispose();const e=this._socket;e&&(this._socket=null,e.onopen=()=>{},e.onerror=()=>{},e.onmessage=()=>{},e.onclose=()=>{},e.close()),r.Signal.clearData(this),this._stream.stop()}async emit(e){const{serverSettings:t}=this,{baseUrl:n,token:s}=t,{makeRequest:r,ResponseError:l}=o.ServerConnection,c=i.URLExt.join(n,a)+(s?`?token=${s}`:""),u={body:JSON.stringify(e),method:"POST"},d=await r(c,u,t);if(204!==d.status)throw new l(d)}_subscribe(){return new Promise(((e,t)=>{if(this.isDisposed)return;const{token:n,WebSocket:s,wsUrl:r}=this.serverSettings,o=i.URLExt.join(r,a,"subscribe")+(n?`?token=${encodeURIComponent(n)}`:""),l=this._socket=new s(o),c=this._stream;l.onclose=()=>t(new Error("EventManager socket closed")),l.onmessage=e=>e.data&&c.emit(JSON.parse(e.data))}))}}},6914:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(2918),t),s(n(2677),t),s(n(7593),t),s(n(3354),t),s(n(582),t),s(n(5312),t),s(n(8463),t),s(n(2700),t),s(n(7054),t),s(n(6052),t),s(n(8235),t),s(n(7523),t),s(n(87),t),s(n(4933),t)},5045:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.CommHandler=void 0;const o=n(4643),a=r(n(1632));class l extends o.DisposableDelegate{constructor(e,t,n,i){super(i),this._target="",this._id="",this._id=t,this._target=e,this._kernel=n}get commId(){return this._id}get targetName(){return this._target}get onClose(){return this._onClose}set onClose(e){this._onClose=e}get onMsg(){return this._onMsg}set onMsg(e){this._onMsg=e}open(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot open");const i=a.createMessage({msgType:"comm_open",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,target_name:this._target,data:null!=e?e:{}},metadata:t,buffers:n});return this._kernel.sendShellMessage(i,!1,!0)}send(e,t,n=[],i=!0){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot send");const s=a.createMessage({msgType:"comm_msg",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:e},metadata:t,buffers:n});return this._kernel.sendShellMessage(s,!1,i)}close(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed)throw new Error("Cannot close");const i=a.createMessage({msgType:"comm_close",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:null!=e?e:{}},metadata:t,buffers:n}),s=this._kernel.sendShellMessage(i,!1,!0),r=this._onClose;return r&&r(a.createMessage({msgType:"comm_close",channel:"iopub",username:this._kernel.username,session:this._kernel.clientId,content:{comm_id:this._id,data:null!=e?e:{}},metadata:t,buffers:n})),this.dispose(),s}}t.CommHandler=l},2094:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelConnection=void 0;const o=n(8920),a=n(5168),l=n(544),c=n(6914),u=n(5045),d=r(n(1632)),h=n(9178),p=n(7411),f=r(n(5537)),m=n(5312),g=r(n(925)),v="_RESTARTING_";class _{constructor(e){var t,n,i,s;this._createSocket=(e=!0)=>{this._errorIfDisposed(),this._clearSocket(),this._updateConnectionStatus("connecting");const t=this.serverSettings,n=o.URLExt.join(t.wsUrl,g.KERNEL_SERVICE_URL,encodeURIComponent(this._id)),i=n.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/,"$1");console.debug(`Starting WebSocket: ${i}`);let s=o.URLExt.join(n,"channels?session_id="+encodeURIComponent(this._clientId));const r=t.token;t.appendToken&&""!==r&&(s+=`&token=${encodeURIComponent(r)}`);const a=e?this._supportedProtocols:[];this._ws=new t.WebSocket(s,a),this._ws.binaryType="arraybuffer";let l=!1;const u=async e=>{var n,i;if(!this._isDisposed){this._reason="",this._model=void 0;try{const n=await g.getKernelModel(this._id,t);this._model=n,"dead"===(null==n?void 0:n.execution_state)?this._updateStatus("dead"):this._onWSClose(e)}catch(t){if(t instanceof c.ServerConnection.NetworkError||503===(null===(n=t.response)||void 0===n?void 0:n.status)||424===(null===(i=t.response)||void 0===i?void 0:i.status)){const t=1e3*y.getRandomIntInclusive(10,30);setTimeout(u,t,e)}else this._reason="Kernel died unexpectedly",this._updateStatus("dead")}}},d=async e=>{l||(l=!0,await u(e))};this._ws.onmessage=this._onWSMessage,this._ws.onopen=this._onWSOpen,this._ws.onclose=d,this._ws.onerror=d},this._onWSOpen=e=>{if(""!==this._ws.protocol&&!this._supportedProtocols.includes(this._ws.protocol))throw console.log("Server selected unknown kernel wire protocol:",this._ws.protocol),this._updateStatus("dead"),new Error(`Unknown kernel wire protocol: ${this._ws.protocol}`);this._selectedProtocol=this._ws.protocol,this._ws.onclose=this._onWSClose,this._ws.onerror=this._onWSClose,this._updateConnectionStatus("connected")},this._onWSMessage=e=>{let t;try{t=(0,p.deserialize)(e.data,this._ws.protocol),f.validateMessage(t)}catch(e){throw e.message=`Kernel message validation error: ${e.message}`,e}this._kernelSession=t.header.session,this._msgChain=this._msgChain.then((()=>this._handleMessage(t))).catch((e=>{e.message.startsWith("Canceled future for ")&&console.error(e)})),this._anyMessage.emit({msg:t,direction:"recv"})},this._onWSClose=e=>{this.isDisposed||this._reconnect()},this._id="",this._name="",this._status="unknown",this._connectionStatus="connecting",this._kernelSession="",this._isDisposed=!1,this._ws=null,this._username="",this._reconnectLimit=7,this._reconnectAttempt=0,this._reconnectTimeout=null,this._supportedProtocols=Object.values(d.supportedKernelWebSocketProtocols),this._selectedProtocol="",this._futures=new Map,this._comms=new Map,this._targetRegistry=Object.create(null),this._info=new a.PromiseDelegate,this._pendingMessages=[],this._statusChanged=new l.Signal(this),this._connectionStatusChanged=new l.Signal(this),this._disposed=new l.Signal(this),this._iopubMessage=new l.Signal(this),this._anyMessage=new l.Signal(this),this._pendingInput=new l.Signal(this),this._unhandledMessage=new l.Signal(this),this._displayIdToParentIds=new Map,this._msgIdToDisplayIds=new Map,this._msgChain=Promise.resolve(),this._hasPendingInput=!1,this._reason="",this._noOp=()=>{},this._name=e.model.name,this._id=e.model.id,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:c.ServerConnection.makeSettings(),this._clientId=null!==(n=e.clientId)&&void 0!==n?n:a.UUID.uuid4(),this._username=null!==(i=e.username)&&void 0!==i?i:"",this.handleComms=null===(s=e.handleComms)||void 0===s||s,this._createSocket()}get disposed(){return this._disposed}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get model(){return this._model||{id:this.id,name:this.name,reason:this._reason}}get anyMessage(){return this._anyMessage}get pendingInput(){return this._pendingInput}get id(){return this._id}get name(){return this._name}get username(){return this._username}get clientId(){return this._clientId}get status(){return this._status}get connectionStatus(){return this._connectionStatus}get isDisposed(){return this._isDisposed}get info(){return this._info.promise}get spec(){return this._specPromise||(this._specPromise=m.KernelSpecAPI.getSpecs(this.serverSettings).then((e=>e.kernelspecs[this._name]))),this._specPromise}clone(e={}){return new _({model:this.model,username:this.username,serverSettings:this.serverSettings,handleComms:!1,...e})}dispose(){this.isDisposed||(this._isDisposed=!0,this._disposed.emit(),this._updateConnectionStatus("disconnected"),this._clearKernelState(),this._pendingMessages=[],this._clearSocket(),l.Signal.clearData(this))}sendShellMessage(e,t=!1,n=!0){return this._sendKernelShellControl(h.KernelShellFutureHandler,e,t,n)}sendControlMessage(e,t=!1,n=!0){return this._sendKernelShellControl(h.KernelControlFutureHandler,e,t,n)}_sendKernelShellControl(e,t,n=!1,i=!0){this._sendMessage(t),this._anyMessage.emit({msg:t,direction:"send"});const s=new e((()=>{const e=t.header.msg_id;this._futures.delete(e);const n=this._msgIdToDisplayIds.get(e);n&&(n.forEach((t=>{const n=this._displayIdToParentIds.get(t);if(n){const i=n.indexOf(e);if(-1===i)return;1===n.length?this._displayIdToParentIds.delete(t):(n.splice(i,1),this._displayIdToParentIds.set(t,n))}})),this._msgIdToDisplayIds.delete(e))}),t,n,i,this);return this._futures.set(t.header.msg_id,s),s}_sendMessage(e,t=!0){if("dead"===this.status)throw new Error("Kernel is dead");if((""===this._kernelSession||this._kernelSession===v)&&d.isInfoRequestMsg(e)){if("connected"===this.connectionStatus)return void this._ws.send((0,p.serialize)(e,this._ws.protocol));throw new Error("Could not send message: status is not connected")}if(t&&this._pendingMessages.length>0)this._pendingMessages.push(e);else if("connected"===this.connectionStatus&&this._kernelSession!==v)this._ws.send((0,p.serialize)(e,this._ws.protocol));else{if(!t)throw new Error("Could not send message");this._pendingMessages.push(e)}}async interrupt(){if(this.hasPendingInput=!1,"dead"===this.status)throw new Error("Kernel is dead");return g.interruptKernel(this.id,this.serverSettings)}async restart(){if("dead"===this.status)throw new Error("Kernel is dead");this._updateStatus("restarting"),this._clearKernelState(),this._kernelSession=v,await g.restartKernel(this.id,this.serverSettings),await this.reconnect(),this.hasPendingInput=!1}reconnect(){this._errorIfDisposed();const e=new a.PromiseDelegate,t=(n,i)=>{"connected"===i?(e.resolve(),this.connectionStatusChanged.disconnect(t,this)):"disconnected"===i&&(e.reject(new Error("Kernel connection disconnected")),this.connectionStatusChanged.disconnect(t,this))};return this.connectionStatusChanged.connect(t,this),this._reconnectAttempt=0,this._reconnect(),e.promise}async shutdown(){"dead"!==this.status&&await g.shutdownKernel(this.id,this.serverSettings),this.handleShutdown()}handleShutdown(){this._updateStatus("dead"),this.dispose()}async requestKernelInfo(){const e=d.createMessage({msgType:"kernel_info_request",channel:"shell",username:this._username,session:this._clientId,content:{}});let t;try{t=await y.handleShellMessage(this,e)}catch(e){if(this.isDisposed)return;throw e}if(this._errorIfDisposed(),t)return void 0===t.content.status&&(t.content.status="ok"),"ok"!==t.content.status?(this._info.reject("Kernel info reply errored"),t):(this._info.resolve(t.content),this._kernelSession=t.header.session,t)}requestComplete(e){const t=d.createMessage({msgType:"complete_request",channel:"shell",username:this._username,session:this._clientId,content:e});return y.handleShellMessage(this,t)}requestInspect(e){const t=d.createMessage({msgType:"inspect_request",channel:"shell",username:this._username,session:this._clientId,content:e});return y.handleShellMessage(this,t)}requestHistory(e){const t=d.createMessage({msgType:"history_request",channel:"shell",username:this._username,session:this._clientId,content:e});return y.handleShellMessage(this,t)}requestExecute(e,t=!0,n){const i=d.createMessage({msgType:"execute_request",channel:"shell",username:this._username,session:this._clientId,content:{silent:!1,store_history:!0,user_expressions:{},allow_stdin:!0,stop_on_error:!1,...e},metadata:n});return this.sendShellMessage(i,!0,t)}requestDebug(e,t=!0){const n=d.createMessage({msgType:"debug_request",channel:"control",username:this._username,session:this._clientId,content:e});return this.sendControlMessage(n,!0,t)}requestIsComplete(e){const t=d.createMessage({msgType:"is_complete_request",channel:"shell",username:this._username,session:this._clientId,content:e});return y.handleShellMessage(this,t)}requestCommInfo(e){const t=d.createMessage({msgType:"comm_info_request",channel:"shell",username:this._username,session:this._clientId,content:e});return y.handleShellMessage(this,t)}sendInputReply(e,t){const n=d.createMessage({msgType:"input_reply",channel:"stdin",username:this._username,session:this._clientId,content:e});n.parent_header=t,this._sendMessage(n),this._anyMessage.emit({msg:n,direction:"send"}),this.hasPendingInput=!1}createComm(e,t=a.UUID.uuid4()){if(!this.handleComms)throw new Error("Comms are disabled on this kernel connection");if(this._comms.has(t))throw new Error("Comm is already created");const n=new u.CommHandler(e,t,this,(()=>{this._unregisterComm(t)}));return this._comms.set(t,n),n}hasComm(e){return this._comms.has(e)}registerCommTarget(e,t){this.handleComms&&(this._targetRegistry[e]=t)}removeCommTarget(e,t){this.handleComms&&(this.isDisposed||this._targetRegistry[e]!==t||delete this._targetRegistry[e])}registerMessageHook(e,t){var n;const i=null===(n=this._futures)||void 0===n?void 0:n.get(e);i&&i.registerMessageHook(t)}removeMessageHook(e,t){var n;const i=null===(n=this._futures)||void 0===n?void 0:n.get(e);i&&i.removeMessageHook(t)}removeInputGuard(){this.hasPendingInput=!1}async _handleDisplayId(e,t){var n,i;const s=t.parent_header.msg_id;let r=this._displayIdToParentIds.get(e);if(r){const e={header:a.JSONExt.deepCopy(t.header),parent_header:a.JSONExt.deepCopy(t.parent_header),metadata:a.JSONExt.deepCopy(t.metadata),content:a.JSONExt.deepCopy(t.content),channel:t.channel,buffers:t.buffers?t.buffers.slice():[]};e.header.msg_type="update_display_data",await Promise.all(r.map((async t=>{const n=this._futures&&this._futures.get(t);n&&await n.handleMsg(e)})))}if("update_display_data"===t.header.msg_type)return!0;r=null!==(n=this._displayIdToParentIds.get(e))&&void 0!==n?n:[],-1===r.indexOf(s)&&r.push(s),this._displayIdToParentIds.set(e,r);const o=null!==(i=this._msgIdToDisplayIds.get(s))&&void 0!==i?i:[];return-1===o.indexOf(s)&&o.push(s),this._msgIdToDisplayIds.set(s,o),!1}_clearSocket(){null!==this._ws&&(this._ws.onopen=this._noOp,this._ws.onclose=this._noOp,this._ws.onerror=this._noOp,this._ws.onmessage=this._noOp,this._ws.close(),this._ws=null)}_updateStatus(e){this._status!==e&&"dead"!==this._status&&(this._status=e,y.logKernelStatus(this),this._statusChanged.emit(e),"dead"===e&&this.dispose())}_sendPending(){for(;"connected"===this.connectionStatus&&this._kernelSession!==v&&this._pendingMessages.length>0;)this._sendMessage(this._pendingMessages[0],!1),this._pendingMessages.shift()}_clearKernelState(){this._kernelSession="",this._pendingMessages=[],this._futures.forEach((e=>{e.dispose()})),this._comms.forEach((e=>{e.dispose()})),this._msgChain=Promise.resolve(),this._futures=new Map,this._comms=new Map,this._displayIdToParentIds.clear(),this._msgIdToDisplayIds.clear()}_assertCurrentMessage(e){if(this._errorIfDisposed(),e.header.session!==this._kernelSession)throw new Error(`Canceling handling of old message: ${e.header.msg_type}`)}async _handleCommOpen(e){this._assertCurrentMessage(e);const t=e.content,n=new u.CommHandler(t.target_name,t.comm_id,this,(()=>{this._unregisterComm(t.comm_id)}));this._comms.set(t.comm_id,n);try{const i=await y.loadObject(t.target_name,t.target_module,this._targetRegistry);await i(n,e)}catch(e){throw n.close(),console.error("Exception opening new comm"),e}}async _handleCommClose(e){this._assertCurrentMessage(e);const t=e.content,n=this._comms.get(t.comm_id);if(!n)return void console.error("Comm not found for comm id "+t.comm_id);this._unregisterComm(n.commId);const i=n.onClose;i&&await i(e),n.dispose()}async _handleCommMsg(e){this._assertCurrentMessage(e);const t=e.content,n=this._comms.get(t.comm_id);if(!n)return;const i=n.onMsg;i&&await i(e)}_unregisterComm(e){this._comms.delete(e)}_updateConnectionStatus(e){if(this._connectionStatus!==e){if(this._connectionStatus=e,"connecting"!==e&&(this._reconnectAttempt=0,clearTimeout(this._reconnectTimeout)),"dead"!==this.status)if("connected"===e){let e=this._kernelSession===v,t=this.requestKernelInfo(),n=!1,i=()=>{n||(n=!0,e&&this._kernelSession===v&&(this._kernelSession=""),clearTimeout(s),this._pendingMessages.length>0&&this._sendPending())};t.then(i);let s=setTimeout(i,3e3)}else this._updateStatus("unknown");this._connectionStatusChanged.emit(e)}}async _handleMessage(e){var t,n;let i=!1;if(e.parent_header&&"iopub"===e.channel&&(d.isDisplayDataMsg(e)||d.isUpdateDisplayDataMsg(e)||d.isExecuteResultMsg(e))){const n=(null!==(t=e.content.transient)&&void 0!==t?t:{}).display_id;n&&(i=await this._handleDisplayId(n,e),this._assertCurrentMessage(e))}if(!i&&e.parent_header){const t=e.parent_header,i=null===(n=this._futures)||void 0===n?void 0:n.get(t.msg_id);if(i)await i.handleMsg(e),this._assertCurrentMessage(e);else{const n=t.session===this.clientId;"iopub"!==e.channel&&n&&this._unhandledMessage.emit(e)}}if("iopub"===e.channel){switch(e.header.msg_type){case"status":{const t=e.content.execution_state;"restarting"===t&&Promise.resolve().then((async()=>{this._updateStatus("autorestarting"),this._clearKernelState(),await this.reconnect()})),this._updateStatus(t);break}case"comm_open":this.handleComms&&await this._handleCommOpen(e);break;case"comm_msg":this.handleComms&&await this._handleCommMsg(e);break;case"comm_close":this.handleComms&&await this._handleCommClose(e)}this.isDisposed||(this._assertCurrentMessage(e),this._iopubMessage.emit(e))}}_reconnect(){if(this._errorIfDisposed(),clearTimeout(this._reconnectTimeout),this._reconnectAttempt{if(t){if("undefined"==typeof requirejs)throw new Error("requirejs not found");requirejs([t],(n=>{void 0===n[e]?s(new Error(`Object '${e}' not found in module '${t}'`)):i(n[e])}),s)}else(null==n?void 0:n[e])?i(n[e]):s(new Error(`Object '${e}' not found in registry`))}))},e.getRandomIntInclusive=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}}(y||(y={}))},9178:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelShellFutureHandler=t.KernelControlFutureHandler=t.KernelFutureHandler=void 0;const o=n(5168),a=n(4643),l=r(n(1632));class c extends a.DisposableDelegate{constructor(e,t,n,i,s){super(e),this._status=0,this._stdin=u.noOp,this._iopub=u.noOp,this._reply=u.noOp,this._done=new o.PromiseDelegate,this._hooks=new u.HookList,this._disposeOnDone=!0,this._msg=t,n||this._setFlag(u.KernelFutureFlag.GotReply),this._disposeOnDone=i,this._kernel=s}get msg(){return this._msg}get done(){return this._done.promise}get onReply(){return this._reply}set onReply(e){this._reply=e}get onIOPub(){return this._iopub}set onIOPub(e){this._iopub=e}get onStdin(){return this._stdin}set onStdin(e){this._stdin=e}registerMessageHook(e){if(this.isDisposed)throw new Error("Kernel future is disposed");this._hooks.add(e)}removeMessageHook(e){this.isDisposed||this._hooks.remove(e)}sendInputReply(e,t){this._kernel.sendInputReply(e,t)}dispose(){this._stdin=u.noOp,this._iopub=u.noOp,this._reply=u.noOp,this._hooks=null,this._testFlag(u.KernelFutureFlag.IsDone)||(this._done.promise.catch((()=>{})),this._done.reject(new Error(`Canceled future for ${this.msg.header.msg_type} message before replies were done`))),super.dispose()}async handleMsg(e){switch(e.channel){case"control":case"shell":e.channel===this.msg.channel&&e.parent_header.msg_id===this.msg.header.msg_id&&await this._handleReply(e);break;case"stdin":await this._handleStdin(e);break;case"iopub":await this._handleIOPub(e)}}async _handleReply(e){const t=this._reply;t&&await t(e),this._replyMsg=e,this._setFlag(u.KernelFutureFlag.GotReply),this._testFlag(u.KernelFutureFlag.GotIdle)&&this._handleDone()}async _handleStdin(e){this._kernel.hasPendingInput=!0;const t=this._stdin;t&&await t(e)}async _handleIOPub(e){const t=await this._hooks.process(e),n=this._iopub;t&&n&&await n(e),l.isStatusMsg(e)&&"idle"===e.content.execution_state&&(this._setFlag(u.KernelFutureFlag.GotIdle),this._testFlag(u.KernelFutureFlag.GotReply)&&this._handleDone())}_handleDone(){this._testFlag(u.KernelFutureFlag.IsDone)||(this._setFlag(u.KernelFutureFlag.IsDone),this._done.resolve(this._replyMsg),this._disposeOnDone&&this.dispose())}_testFlag(e){return 0!=(this._status&e)}_setFlag(e){this._status|=e}}var u;t.KernelFutureHandler=c,t.KernelControlFutureHandler=class extends c{},t.KernelShellFutureHandler=class extends c{},function(e){e.noOp=()=>{};const t="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;let n;e.HookList=class{constructor(){this._hooks=[]}add(e){this.remove(e),this._hooks.push(e)}remove(e){const t=this._hooks.indexOf(e);t>=0&&(this._hooks[t]=null,this._scheduleCompact())}async process(e){await this._processing;const t=new o.PromiseDelegate;let n;this._processing=t.promise;for(let i=this._hooks.length-1;i>=0;i--){const s=this._hooks[i];if(null!==s){try{n=await s(e)}catch(e){n=!0,console.error(e)}if(!1===n)return t.resolve(void 0),!1}}return t.resolve(void 0),!0}_scheduleCompact(){this._compactScheduled||(this._compactScheduled=!0,t((()=>{this._processing=this._processing.then((()=>{this._compactScheduled=!1,this._compact()}))})))}_compact(){let e=0;for(let t=0,n=this._hooks.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2810:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KernelManager=void 0;const i=n(9033),s=n(544),r=n(6914),o=n(2918),a=n(925),l=n(2094);class c extends o.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._kernelConnections=new Set,this._models=new Map,this._runningChanged=new s.Signal(this),this._connectionFailure=new s.Signal(this),this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:KernelManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._models.clear(),this._kernelConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}connectTo(e){var t;const{id:n}=e.model;let i=null===(t=e.handleComms)||void 0===t||t;if(void 0===e.handleComms)for(const e of this._kernelConnections)if(e.id===n&&e.handleComms){i=!1;break}const s=new l.KernelConnection({handleComms:i,...e,serverSettings:this.serverSettings});return this._onStarted(s),this._models.has(n)||this.refreshRunning().catch((()=>{})),s}running(){return this._models.values()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e={},t={}){const n=await(0,a.startNew)(e,this.serverSettings);return this.connectTo({...t,model:n})}async shutdown(e){await(0,a.shutdownKernel)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all([...this._models.keys()].map((e=>(0,a.shutdownKernel)(e,this.serverSettings)))),await this.refreshRunning()}async findById(e){return this._models.has(e)||await this.refreshRunning(),this._models.get(e)}async requestRunning(){var e,t;let n;try{n=await(0,a.listRunning)(this.serverSettings)}catch(n){throw(n instanceof r.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}this.isDisposed||this._models.size===n.length&&n.every((e=>{const t=this._models.get(e.id);return!!t&&t.connections===e.connections&&t.execution_state===e.execution_state&&t.last_activity===e.last_activity&&t.name===e.name&&t.reason===e.reason&&t.traceback===e.traceback}))||(this._models=new Map(n.map((e=>[e.id,e]))),this._kernelConnections.forEach((e=>{this._models.has(e.id)||e.handleShutdown()})),this._runningChanged.emit(n))}_onStarted(e){this._kernelConnections.add(e),e.statusChanged.connect(this._onStatusChanged,this),e.disposed.connect(this._onDisposed,this)}_onDisposed(e){this._kernelConnections.delete(e),this.refreshRunning().catch((()=>{}))}_onStatusChanged(e,t){"dead"===t&&this.refreshRunning().catch((()=>{}))}}t.KernelManager=c,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}async startNew(e={},t={}){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}connectTo(e){throw new Error("Not implemented in no-op Kernel Manager")}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}get ready(){return this.parentReady.then((()=>this._readyPromise))}async requestRunning(){return Promise.resolve()}}}(c=t.KernelManager||(t.KernelManager={}))},1632:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedKernelWebSocketProtocols=t.isInputReplyMsg=t.isInputRequestMsg=t.isDebugReplyMsg=t.isDebugRequestMsg=t.isExecuteReplyMsg=t.isInfoRequestMsg=t.isCommMsgMsg=t.isCommCloseMsg=t.isCommOpenMsg=t.isDebugEventMsg=t.isClearOutputMsg=t.isStatusMsg=t.isErrorMsg=t.isExecuteResultMsg=t.isExecuteInputMsg=t.isUpdateDisplayDataMsg=t.isDisplayDataMsg=t.isStreamMsg=t.createMessage=void 0;const i=n(5168);t.createMessage=function(e){var t,n,s,r,o;return{buffers:null!==(t=e.buffers)&&void 0!==t?t:[],channel:e.channel,content:e.content,header:{date:(new Date).toISOString(),msg_id:null!==(n=e.msgId)&&void 0!==n?n:i.UUID.uuid4(),msg_type:e.msgType,session:e.session,username:null!==(s=e.username)&&void 0!==s?s:"",version:"5.2"},metadata:null!==(r=e.metadata)&&void 0!==r?r:{},parent_header:null!==(o=e.parentHeader)&&void 0!==o?o:{}}},t.isStreamMsg=function(e){return"stream"===e.header.msg_type},t.isDisplayDataMsg=function(e){return"display_data"===e.header.msg_type},t.isUpdateDisplayDataMsg=function(e){return"update_display_data"===e.header.msg_type},t.isExecuteInputMsg=function(e){return"execute_input"===e.header.msg_type},t.isExecuteResultMsg=function(e){return"execute_result"===e.header.msg_type},t.isErrorMsg=function(e){return"error"===e.header.msg_type},t.isStatusMsg=function(e){return"status"===e.header.msg_type},t.isClearOutputMsg=function(e){return"clear_output"===e.header.msg_type},t.isDebugEventMsg=function(e){return"debug_event"===e.header.msg_type},t.isCommOpenMsg=function(e){return"comm_open"===e.header.msg_type},t.isCommCloseMsg=function(e){return"comm_close"===e.header.msg_type},t.isCommMsgMsg=function(e){return"comm_msg"===e.header.msg_type},t.isInfoRequestMsg=function(e){return"kernel_info_request"===e.header.msg_type},t.isExecuteReplyMsg=function(e){return"execute_reply"===e.header.msg_type},t.isDebugRequestMsg=function(e){return"debug_request"===e.header.msg_type},t.isDebugReplyMsg=function(e){return"debug_reply"===e.header.msg_type},t.isInputRequestMsg=function(e){return"input_request"===e.header.msg_type},t.isInputReplyMsg=function(e){return"input_reply"===e.header.msg_type},(t.supportedKernelWebSocketProtocols||(t.supportedKernelWebSocketProtocols={})).v1KernelWebsocketJupyterOrg="v1.kernel.websocket.jupyter.org"},925:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getKernelModel=t.shutdownKernel=t.interruptKernel=t.restartKernel=t.startNew=t.listRunning=t.KERNEL_SERVICE_URL=void 0;const i=n(2700),s=n(8920),r=n(5537);t.KERNEL_SERVICE_URL="api/kernels",t.listRunning=async function(e=i.ServerConnection.makeSettings()){const n=s.URLExt.join(e.baseUrl,t.KERNEL_SERVICE_URL),o=await i.ServerConnection.makeRequest(n,{},e);if(200!==o.status)throw await i.ServerConnection.ResponseError.create(o);const a=await o.json();return(0,r.validateModels)(a),a},t.startNew=async function(e={},n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL),a={method:"POST",body:JSON.stringify(e)},l=await i.ServerConnection.makeRequest(o,a,n);if(201!==l.status)throw await i.ServerConnection.ResponseError.create(l);const c=await l.json();return(0,r.validateModel)(c),c},t.restartKernel=async function(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"restart"),a=await i.ServerConnection.makeRequest(o,{method:"POST"},n);if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();(0,r.validateModel)(l)},t.interruptKernel=async function(e,n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"interrupt"),o=await i.ServerConnection.makeRequest(r,{method:"POST"},n);if(204!==o.status)throw await i.ServerConnection.ResponseError.create(o)},t.shutdownKernel=async function(e,n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e)),o=await i.ServerConnection.makeRequest(r,{method:"DELETE"},n);if(404===o.status){const t=`The kernel "${e}" does not exist on the server`;console.warn(t)}else if(204!==o.status)throw await i.ServerConnection.ResponseError.create(o)},t.getKernelModel=async function(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e)),a=await i.ServerConnection.makeRequest(o,{},n);if(404===a.status)return;if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();return(0,r.validateModel)(l),l}},7411:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=t.serialize=void 0;const o=r(n(1632));var a;t.serialize=function(e,t=""){return t===o.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg?a.serializeV1KernelWebsocketJupyterOrg(e):a.serializeDefault(e)},t.deserialize=function(e,t=""){return t===o.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg?a.deserializeV1KernelWebsocketJupyterOrg(e):a.deserializeDefault(e)},function(e){e.deserializeV1KernelWebsocketJupyterOrg=function(e){let t;const n=new DataView(e),i=Number(n.getBigUint64(0,!0));let s=[];for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateModels=t.validateModel=t.validateMessage=void 0;const i=n(8193),s=["username","version","session","msg_id","msg_type"],r={stream:{name:"string",text:"string"},display_data:{data:"object",metadata:"object"},execute_input:{code:"string",execution_count:"number"},execute_result:{execution_count:"number",data:"object",metadata:"object"},error:{ename:"string",evalue:"string",traceback:"object"},status:{execution_state:["string",["starting","idle","busy","restarting","dead"]]},clear_output:{wait:"boolean"},comm_open:{comm_id:"string",target_name:"string",data:"object"},comm_msg:{comm_id:"string",data:"object"},comm_close:{comm_id:"string"},shutdown_reply:{restart:"boolean"}};function o(e){(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"id","string")}t.validateMessage=function(e){(0,i.validateProperty)(e,"metadata","object"),(0,i.validateProperty)(e,"content","object"),(0,i.validateProperty)(e,"channel","string"),function(e){for(let t=0;to(e)))}},5312:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelSpecAPI=t.KernelSpec=void 0;const a=r(n(523));t.KernelSpec=a;const l=r(n(7352));t.KernelSpecAPI=l,o(n(3973),t)},523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3973:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.KernelSpecManager=void 0;const o=n(5168),a=n(9033),l=n(544),c=r(n(7352)),u=n(2918);class d extends u.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._connectionFailure=new l.Signal(this),this._specs=null,this._specsChanged=new l.Signal(this),this._ready=Promise.all([this.requestSpecs()]).then((e=>{})).catch((e=>{})).then((()=>{this.isDisposed||(this._isReady=!0)})),this._pollSpecs=new a.Poll({auto:!1,factory:()=>this.requestSpecs(),frequency:{interval:61e3,backoff:!0,max:3e5},name:"@jupyterlab/services:KernelSpecManager#specs",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this.ready.then((()=>{this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get specs(){return this._specs}get specsChanged(){return this._specsChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose(),super.dispose()}async refreshSpecs(){await this._pollSpecs.refresh(),await this._pollSpecs.tick}async requestSpecs(){const e=await c.getSpecs(this.serverSettings);this.isDisposed||o.JSONExt.deepEqual(e,this._specs)||(this._specs=e,this._specsChanged.emit(e))}}t.KernelSpecManager=d},7352:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSpecs=void 0;const i=n(2700),s=n(7),r=n(8920);t.getSpecs=async function(e=i.ServerConnection.makeSettings()){const t=r.URLExt.join(e.baseUrl,"api/kernelspecs"),n=await i.ServerConnection.makeRequest(t,{},e);if(200!==n.status)throw await i.ServerConnection.ResponseError.create(n);const o=await n.json();return(0,s.validateSpecModels)(o)}},7:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSpecModels=t.validateSpecModel=void 0;const i=n(8193);function s(e){const t=e.spec;if(!t)throw new Error("Invalid kernel spec");(0,i.validateProperty)(e,"name","string"),(0,i.validateProperty)(e,"resources","object"),(0,i.validateProperty)(t,"language","string"),(0,i.validateProperty)(t,"display_name","string"),(0,i.validateProperty)(t,"argv","array");let n=null;t.hasOwnProperty("metadata")&&((0,i.validateProperty)(t,"metadata","object"),n=t.metadata);let s=null;return t.hasOwnProperty("env")&&((0,i.validateProperty)(t,"env","object"),s=t.env),{name:e.name,resources:e.resources,language:t.language,display_name:t.display_name,argv:t.argv,metadata:n,env:s}}t.validateSpecModel=s,t.validateSpecModels=function(e){if(!e.hasOwnProperty("kernelspecs"))throw new Error("No kernelspecs found");let t=Object.keys(e.kernelspecs);const n=Object.create(null);let i=e.default;for(let i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceManager=void 0;const i=n(544),s=n(1611),r=n(7593),o=n(3354),a=n(582),l=n(5312),c=n(4933),u=n(2700),d=n(7054),h=n(6052),p=n(8235),f=n(7523),m=n(87);t.ServiceManager=class{constructor(e={}){var t,n;this._isDisposed=!1,this._connectionFailure=new i.Signal(this),this._isReady=!1;const g=e.defaultDrive,v=null!==(t=e.serverSettings)&&void 0!==t?t:u.ServerConnection.makeSettings(),_={defaultDrive:g,serverSettings:v,standby:null!==(n=e.standby)&&void 0!==n?n:"when-hidden"};this.serverSettings=v,this.contents=e.contents||new r.ContentsManager(_),this.events=e.events||new o.EventManager(_),this.kernels=e.kernels||new a.KernelManager(_),this.sessions=e.sessions||new d.SessionManager({..._,kernelManager:this.kernels}),this.settings=e.settings||new h.SettingManager(_),this.terminals=e.terminals||new p.TerminalManager(_),this.builder=e.builder||new s.BuildManager(_),this.workspaces=e.workspaces||new m.WorkspaceManager(_),this.nbconvert=e.nbconvert||new c.NbConvertManager(_),this.kernelspecs=e.kernelspecs||new l.KernelSpecManager(_),this.user=e.user||new f.UserManager(_),this.kernelspecs.connectionFailure.connect(this._onConnectionFailure,this),this.sessions.connectionFailure.connect(this._onConnectionFailure,this),this.terminals.connectionFailure.connect(this._onConnectionFailure,this);const y=[this.sessions.ready,this.kernelspecs.ready];this.terminals.isAvailable()&&y.push(this.terminals.ready),this._readyPromise=Promise.all(y).then((()=>{this._isReady=!0}))}get connectionFailure(){return this._connectionFailure}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,i.Signal.clearData(this),this.contents.dispose(),this.events.dispose(),this.sessions.dispose(),this.terminals.dispose())}get isReady(){return this._isReady}get ready(){return this._readyPromise}_onConnectionFailure(e,t){this._connectionFailure.emit(t)}}},4933:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NbConvertManager=void 0;const i=n(8920),s=n(2700),r=n(5168);t.NbConvertManager=class{constructor(e={}){var t;this._exportFormats=null,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:s.ServerConnection.makeSettings()}async fetchExportFormats(){this._requestingFormats=new r.PromiseDelegate,this._exportFormats=null;const e=this.serverSettings.baseUrl,t=i.URLExt.join(e,"api/nbconvert"),{serverSettings:n}=this,o=await s.ServerConnection.makeRequest(t,{},n);if(200!==o.status)throw await s.ServerConnection.ResponseError.create(o);const a=await o.json(),l={};return Object.keys(a).forEach((function(e){const t=a[e].output_mimetype;l[e]={output_mimetype:t}})),this._exportFormats=l,this._requestingFormats.resolve(l),l}async getExportFormats(e=!0){return this._requestingFormats?this._requestingFormats.promise:e||!this._exportFormats?await this.fetchExportFormats():this._exportFormats}}},2700:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerConnection=void 0;const i=n(8920);let s;var r,o;s="undefined"==typeof window?n(2195):WebSocket,function(e){e.makeSettings=function(e){return o.makeSettings(e)},e.makeRequest=function(e,t,n){return o.handleRequest(e,t,n)};class t extends Error{static async create(e){try{const n=await e.json(),{message:i,traceback:s}=n;return s&&console.error(s),new t(e,null!=i?i:t._defaultMessage(e),null!=s?s:"")}catch(n){return console.debug(n),new t(e)}}constructor(e,n=t._defaultMessage(e),i=""){super(n),this.response=e,this.traceback=i}static _defaultMessage(e){return`Invalid response: ${e.status} ${e.statusText}`}}e.ResponseError=t;class n extends TypeError{constructor(e){super(e.message),this.stack=e.stack}}e.NetworkError=n}(r=t.ServerConnection||(t.ServerConnection={})),function(e){e.makeSettings=function(e={}){var t;const n=i.PageConfig.getBaseUrl(),r=i.PageConfig.getWsUrl(),o=i.URLExt.normalize(e.baseUrl)||n;let a=e.wsUrl;return a||o!==n||(a=r),a||0!==o.indexOf("http")||(a="ws"+o.slice(4)),a=null!=a?a:r,{init:{cache:"no-store",credentials:"same-origin"},fetch,Headers,Request,WebSocket:s,token:i.PageConfig.getToken(),appUrl:i.PageConfig.getOption("appUrl"),appendToken:"undefined"==typeof window||"undefined"!=typeof process&&void 0!==(null===(t=null===process||void 0===process?void 0:{})||void 0===t?void 0:t.JEST_WORKER_ID)||i.URLExt.getHostName(n)!==i.URLExt.getHostName(a),...e,baseUrl:o,wsUrl:a}},e.handleRequest=function(e,t,n){var i;if(0!==e.indexOf(n.baseUrl))throw new Error("Can only be used for notebook server requests");"no-store"===(null!==(i=t.cache)&&void 0!==i?i:n.init.cache)&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());const s=new n.Request(e,{...n.init,...t});let o=!1;if(n.token&&(o=!0,s.headers.append("Authorization",`token ${n.token}`)),"undefined"!=typeof document&&(null===document||void 0===document?void 0:document.cookie)){const e=function(e){const t=document.cookie.match("\\b_xsrf=([^;]*)\\b");return null==t?void 0:t[1]}();void 0!==e&&(o=!0,s.headers.append("X-XSRFToken",e))}return!s.headers.has("Content-Type")&&o&&s.headers.set("Content-Type","application/json"),n.fetch.call(null,s).catch((e=>{throw new r.NetworkError(e)}))}}(o||(o={}))},5575:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionConnection=void 0;const i=n(544),s=n(6914),r=n(8351),o=n(5168);t.SessionConnection=class{constructor(e){var t,n,r,a;this._id="",this._path="",this._name="",this._type="",this._kernel=null,this._isDisposed=!1,this._disposed=new i.Signal(this),this._kernelChanged=new i.Signal(this),this._statusChanged=new i.Signal(this),this._connectionStatusChanged=new i.Signal(this),this._pendingInput=new i.Signal(this),this._iopubMessage=new i.Signal(this),this._unhandledMessage=new i.Signal(this),this._anyMessage=new i.Signal(this),this._propertyChanged=new i.Signal(this),this._id=e.model.id,this._name=e.model.name,this._path=e.model.path,this._type=e.model.type,this._username=null!==(t=e.username)&&void 0!==t?t:"",this._clientId=null!==(n=e.clientId)&&void 0!==n?n:o.UUID.uuid4(),this._connectToKernel=e.connectToKernel,this._kernelConnectionOptions=null!==(r=e.kernelConnectionOptions)&&void 0!==r?r:{},this.serverSettings=null!==(a=e.serverSettings)&&void 0!==a?a:s.ServerConnection.makeSettings(),this.setupKernel(e.model.kernel)}get disposed(){return this._disposed}get kernelChanged(){return this._kernelChanged}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get pendingInput(){return this._pendingInput}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get anyMessage(){return this._anyMessage}get propertyChanged(){return this._propertyChanged}get id(){return this._id}get kernel(){return this._kernel}get path(){return this._path}get type(){return this._type}get name(){return this._name}get model(){return{id:this.id,kernel:this.kernel&&{id:this.kernel.id,name:this.kernel.name},path:this._path,type:this._type,name:this._name}}get isDisposed(){return this._isDisposed}update(e){const t=this.model;if(this._path=e.path,this._name=e.name,this._type=e.type,null===this._kernel&&null!==e.kernel||null!==this._kernel&&null===e.kernel||null!==this._kernel&&null!==e.kernel&&this._kernel.id!==e.kernel.id){null!==this._kernel&&this._kernel.dispose();const t=this._kernel||null;this.setupKernel(e.kernel);const n=this._kernel||null;this._kernelChanged.emit({name:"kernel",oldValue:t,newValue:n})}this._handleModelChange(t)}dispose(){if(!this.isDisposed){if(this._isDisposed=!0,this._disposed.emit(),this._kernel){this._kernel.dispose();const e=this._kernel;this._kernel=null;const t=this._kernel;this._kernelChanged.emit({name:"kernel",oldValue:e,newValue:t})}i.Signal.clearData(this)}}async setPath(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({path:e})}async setName(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({name:e})}async setType(e){if(this.isDisposed)throw new Error("Session is disposed");await this._patch({type:e})}async changeKernel(e){if(this.isDisposed)throw new Error("Session is disposed");return await this._patch({kernel:e}),this.kernel}async shutdown(){if(this.isDisposed)throw new Error("Session is disposed");await(0,r.shutdownSession)(this.id,this.serverSettings),this.dispose()}setupKernel(e){if(null===e)return void(this._kernel=null);const t=this._connectToKernel({...this._kernelConnectionOptions,model:e,username:this._username,clientId:this._clientId,serverSettings:this.serverSettings});this._kernel=t,t.statusChanged.connect(this.onKernelStatus,this),t.connectionStatusChanged.connect(this.onKernelConnectionStatus,this),t.pendingInput.connect(this.onPendingInput,this),t.unhandledMessage.connect(this.onUnhandledMessage,this),t.iopubMessage.connect(this.onIOPubMessage,this),t.anyMessage.connect(this.onAnyMessage,this)}onKernelStatus(e,t){this._statusChanged.emit(t)}onKernelConnectionStatus(e,t){this._connectionStatusChanged.emit(t)}onPendingInput(e,t){this._pendingInput.emit(t)}onIOPubMessage(e,t){this._iopubMessage.emit(t)}onUnhandledMessage(e,t){this._unhandledMessage.emit(t)}onAnyMessage(e,t){this._anyMessage.emit(t)}async _patch(e){const t=await(0,r.updateSession)({...e,id:this._id},this.serverSettings);return this.update(t),t}_handleModelChange(e){e.name!==this._name&&this._propertyChanged.emit("name"),e.type!==this._type&&this._propertyChanged.emit("type"),e.path!==this._path&&this._propertyChanged.emit("path")}}},7054:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t},o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.SessionAPI=t.Session=void 0;const a=r(n(658));t.Session=a;const l=r(n(8351));t.SessionAPI=l,o(n(6699),t)},6699:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionManager=void 0;const i=n(9033),s=n(544),r=n(2700),o=n(2918),a=n(5575),l=n(8351);class c extends o.BaseManager{constructor(e){var t;super(e),this._isReady=!1,this._sessionConnections=new Set,this._models=new Map,this._runningChanged=new s.Signal(this),this._connectionFailure=new s.Signal(this),this._connectToKernel=e=>this._kernelManager.connectTo(e),this._kernelManager=e.kernelManager,this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:SessionManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._kernelManager.isActive&&await this._kernelManager.ready,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._models.clear(),this._sessionConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}connectTo(e){const t=new a.SessionConnection({...e,connectToKernel:this._connectToKernel,serverSettings:this.serverSettings});return this._onStarted(t),this._models.has(e.model.id)||this.refreshRunning().catch((()=>{})),t}running(){return this._models.values()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e,t={}){const n=await(0,l.startSession)(e,this.serverSettings);return await this.refreshRunning(),this.connectTo({...t,model:n})}async shutdown(e){await(0,l.shutdownSession)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all([...this._models.keys()].map((e=>(0,l.shutdownSession)(e,this.serverSettings)))),await this.refreshRunning()}async stopIfNeeded(e){try{const t=(await(0,l.listRunning)(this.serverSettings)).filter((t=>t.path===e));if(1===t.length){const e=t[0].id;await this.shutdown(e)}}catch(e){}}async findById(e){return this._models.has(e)||await this.refreshRunning(),this._models.get(e)}async findByPath(e){for(const t of this._models.values())if(t.path===e)return t;await this.refreshRunning();for(const t of this._models.values())if(t.path===e)return t}async requestRunning(){var e,t;let n;try{n=await(0,l.listRunning)(this.serverSettings)}catch(n){throw(n instanceof r.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}this.isDisposed||this._models.size===n.length&&n.every((e=>{var t,n,i,s;const r=this._models.get(e.id);return!!r&&(null===(t=r.kernel)||void 0===t?void 0:t.id)===(null===(n=e.kernel)||void 0===n?void 0:n.id)&&(null===(i=r.kernel)||void 0===i?void 0:i.name)===(null===(s=e.kernel)||void 0===s?void 0:s.name)&&r.name===e.name&&r.path===e.path&&r.type===e.type}))||(this._models=new Map(n.map((e=>[e.id,e]))),this._sessionConnections.forEach((e=>{this._models.has(e.id)?e.update(this._models.get(e.id)):e.dispose()})),this._runningChanged.emit(n))}_onStarted(e){this._sessionConnections.add(e),e.disposed.connect(this._onDisposed,this),e.propertyChanged.connect(this._onChanged,this),e.kernelChanged.connect(this._onChanged,this)}_onDisposed(e){this._sessionConnections.delete(e),this.refreshRunning().catch((()=>{}))}_onChanged(){this.refreshRunning().catch((()=>{}))}}t.SessionManager=c,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}async startNew(e,t={}){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}connectTo(e){throw Error("Not implemented in no-op Session Manager")}get ready(){return this.parentReady.then((()=>this._readyPromise))}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}async requestRunning(){return Promise.resolve()}}}(c=t.SessionManager||(t.SessionManager={}))},8351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateSession=t.startSession=t.getSessionModel=t.shutdownSession=t.getSessionUrl=t.listRunning=t.SESSION_SERVICE_URL=void 0;const i=n(2700),s=n(8920),r=n(8775);function o(e,n){return s.URLExt.join(e,t.SESSION_SERVICE_URL,n)}t.SESSION_SERVICE_URL="api/sessions",t.listRunning=async function(e=i.ServerConnection.makeSettings()){const n=s.URLExt.join(e.baseUrl,t.SESSION_SERVICE_URL),o=await i.ServerConnection.makeRequest(n,{},e);if(200!==o.status)throw await i.ServerConnection.ResponseError.create(o);const a=await o.json();if(!Array.isArray(a))throw new Error("Invalid Session list");return a.forEach((e=>{(0,r.updateLegacySessionModel)(e),(0,r.validateModel)(e)})),a},t.getSessionUrl=o,t.shutdownSession=async function(e,t=i.ServerConnection.makeSettings()){var n;const s=o(t.baseUrl,e),r=await i.ServerConnection.makeRequest(s,{method:"DELETE"},t);if(404===r.status){const t=null!==(n=(await r.json()).message)&&void 0!==n?n:`The session "${e}"" does not exist on the server`;console.warn(t)}else{if(410===r.status)throw new i.ServerConnection.ResponseError(r,"The kernel was deleted but the session was not");if(204!==r.status)throw await i.ServerConnection.ResponseError.create(r)}},t.getSessionModel=async function(e,t=i.ServerConnection.makeSettings()){const n=o(t.baseUrl,e),s=await i.ServerConnection.makeRequest(n,{},t);if(200!==s.status)throw await i.ServerConnection.ResponseError.create(s);const a=await s.json();return(0,r.updateLegacySessionModel)(a),(0,r.validateModel)(a),a},t.startSession=async function(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.SESSION_SERVICE_URL),a={method:"POST",body:JSON.stringify(e)},l=await i.ServerConnection.makeRequest(o,a,n);if(201!==l.status)throw await i.ServerConnection.ResponseError.create(l);const c=await l.json();return(0,r.updateLegacySessionModel)(c),(0,r.validateModel)(c),c},t.updateSession=async function(e,t=i.ServerConnection.makeSettings()){const n=o(t.baseUrl,e.id),s={method:"PATCH",body:JSON.stringify(e)},a=await i.ServerConnection.makeRequest(n,s,t);if(200!==a.status)throw await i.ServerConnection.ResponseError.create(a);const l=await a.json();return(0,r.updateLegacySessionModel)(l),(0,r.validateModel)(l),l}},658:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8775:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateModels=t.updateLegacySessionModel=t.validateModel=void 0;const i=n(5537),s=n(8193);function r(e){(0,s.validateProperty)(e,"id","string"),(0,s.validateProperty)(e,"type","string"),(0,s.validateProperty)(e,"name","string"),(0,s.validateProperty)(e,"path","string"),(0,s.validateProperty)(e,"kernel","object"),(0,i.validateModel)(e.kernel)}t.validateModel=r,t.updateLegacySessionModel=function(e){void 0===e.path&&void 0!==e.notebook&&(e.path=e.notebook.path,e.type="notebook",e.name="")},t.validateModels=function(e){if(!Array.isArray(e))throw new Error("Invalid session list");e.forEach((e=>r(e)))}},6052:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SettingManager=void 0;const i=n(8920),s=n(4116),r=n(2700);class o extends s.DataConnector{constructor(e={}){var t;super(),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings()}async fetch(e){if(!e)throw new Error("Plugin `id` parameter is required for settings fetch.");const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:s,ResponseError:o}=r.ServerConnection,l=n+i,c=a.url(l,e),u=await s(c,{},t);if(200!==u.status)throw await o.create(u);return u.json()}async list(e){var t,n,i,s;const{serverSettings:o}=this,{baseUrl:l,appUrl:c}=o,{makeRequest:u,ResponseError:d}=r.ServerConnection,h=l+c,p=a.url(h,"","ids"===e),f=await u(p,{},o);if(200!==f.status)throw new d(f);const m=await f.json(),g=null!==(n=null===(t=null==m?void 0:m.settings)||void 0===t?void 0:t.map((e=>e.id)))&&void 0!==n?n:[];let v=[];return e||(v=null!==(s=null===(i=null==m?void 0:m.settings)||void 0===i?void 0:i.map((e=>(e.data={composite:{},user:{}},e))))&&void 0!==s?s:[]),{ids:g,values:v}}async save(e,t){const{serverSettings:n}=this,{baseUrl:i,appUrl:s}=n,{makeRequest:o,ResponseError:l}=r.ServerConnection,c=i+s,u=a.url(c,e),d={body:JSON.stringify({raw:t}),method:"PUT"},h=await o(u,d,n);if(204!==h.status)throw new l(h)}}var a;t.SettingManager=o,function(e){e.url=function(e,t,n){const s=n?i.URLExt.objectToQueryString({ids_only:!0}):"";return`${i.URLExt.join(e,"api/settings",t)}${s}`}}(a||(a={}))},2195:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=WebSocket},5478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalConnection=void 0;const i=n(8920),s=n(5168),r=n(544),o=n(6914),a=n(4020);class l{constructor(e){var t;this._createSocket=()=>{this._errorIfDisposed(),this._clearSocket(),this._updateConnectionStatus("connecting");const e=this._name,t=this.serverSettings;let n=i.URLExt.join(t.wsUrl,"terminals","websocket",encodeURIComponent(e));const s=t.token;t.appendToken&&""!==s&&(n+=`?token=${encodeURIComponent(s)}`),this._ws=new t.WebSocket(n),this._ws.onmessage=this._onWSMessage,this._ws.onclose=this._onWSClose,this._ws.onerror=this._onWSClose},this._onWSMessage=e=>{if(this._isDisposed)return;const t=JSON.parse(e.data);"disconnect"===t[0]&&this.dispose(),"connecting"!==this._connectionStatus?this._messageReceived.emit({type:t[0],content:t.slice(1)}):"setup"===t[0]&&this._updateConnectionStatus("connected")},this._onWSClose=e=>{console.warn(`Terminal websocket closed: ${e.code}`),this.isDisposed||this._reconnect()},this._connectionStatus="connecting",this._connectionStatusChanged=new r.Signal(this),this._isDisposed=!1,this._disposed=new r.Signal(this),this._messageReceived=new r.Signal(this),this._reconnectTimeout=null,this._ws=null,this._noOp=()=>{},this._reconnectLimit=7,this._reconnectAttempt=0,this._pendingMessages=[],this._name=e.model.name,this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:o.ServerConnection.makeSettings(),this._createSocket()}get disposed(){return this._disposed}get messageReceived(){return this._messageReceived}get name(){return this._name}get model(){return{name:this._name}}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposed.emit(),this._updateConnectionStatus("disconnected"),this._clearSocket(),r.Signal.clearData(this))}send(e){this._sendMessage(e)}_sendMessage(e,t=!0){if(!this._isDisposed&&e.content)if("connected"===this.connectionStatus&&this._ws){const t=[e.type,...e.content];this._ws.send(JSON.stringify(t))}else{if(!t)throw new Error(`Could not send message: ${JSON.stringify(e)}`);this._pendingMessages.push(e)}}_sendPending(){for(;"connected"===this.connectionStatus&&this._pendingMessages.length>0;)this._sendMessage(this._pendingMessages[0],!1),this._pendingMessages.shift()}reconnect(){this._errorIfDisposed();const e=new s.PromiseDelegate,t=(n,i)=>{"connected"===i?(e.resolve(),this.connectionStatusChanged.disconnect(t,this)):"disconnected"===i&&(e.reject(new Error("Terminal connection disconnected")),this.connectionStatusChanged.disconnect(t,this))};return this.connectionStatusChanged.connect(t,this),this._reconnectAttempt=0,this._reconnect(),e.promise}_reconnect(){if(this._errorIfDisposed(),clearTimeout(this._reconnectTimeout),this._reconnectAttempt{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TerminalManager=void 0;const i=n(9033),s=n(544),r=n(6914),o=n(2918),a=n(4020),l=n(5478);class c extends o.BaseManager{constructor(e={}){var t;if(super(e),this._isReady=!1,this._names=[],this._terminalConnections=new Set,this._runningChanged=new s.Signal(this),this._connectionFailure=new s.Signal(this),!this.isAvailable())return this._ready=Promise.reject("Terminals unavailable"),void this._ready.catch((e=>{}));this._pollModels=new i.Poll({auto:!1,factory:()=>this.requestRunning(),frequency:{interval:1e4,backoff:!0,max:3e5},name:"@jupyterlab/services:TerminalManager#models",standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this._ready=(async()=>{await this._pollModels.start(),await this._pollModels.tick,this._isReady=!0})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){this.isDisposed||(this._names.length=0,this._terminalConnections.forEach((e=>e.dispose())),this._pollModels.dispose(),super.dispose())}isAvailable(){return(0,a.isAvailable)()}connectTo(e){const t=new l.TerminalConnection({...e,serverSettings:this.serverSettings});return this._onStarted(t),this._names.includes(e.model.name)||this.refreshRunning().catch((()=>{})),t}running(){return this._models[Symbol.iterator]()}async refreshRunning(){await this._pollModels.refresh(),await this._pollModels.tick}async startNew(e){const t=await(0,a.startNew)(this.serverSettings,null==e?void 0:e.name,null==e?void 0:e.cwd);return await this.refreshRunning(),this.connectTo({model:t})}async shutdown(e){await(0,a.shutdownTerminal)(e,this.serverSettings),await this.refreshRunning()}async shutdownAll(){await this.refreshRunning(),await Promise.all(this._names.map((e=>(0,a.shutdownTerminal)(e,this.serverSettings)))),await this.refreshRunning()}async requestRunning(){var e,t;let n;try{n=await(0,a.listRunning)(this.serverSettings)}catch(n){throw(n instanceof r.ServerConnection.NetworkError||503===(null===(e=n.response)||void 0===e?void 0:e.status)||424===(null===(t=n.response)||void 0===t?void 0:t.status))&&this._connectionFailure.emit(n),n}if(this.isDisposed)return;const i=n.map((({name:e})=>e)).sort();i!==this._names&&(this._names=i,this._terminalConnections.forEach((e=>{i.includes(e.name)||e.dispose()})),this._runningChanged.emit(this._models))}_onStarted(e){this._terminalConnections.add(e),e.disposed.connect(this._onDisposed,this)}_onDisposed(e){this._terminalConnections.delete(e),this.refreshRunning().catch((()=>{}))}get _models(){return this._names.map((e=>({name:e})))}}t.TerminalManager=c,function(e){e.NoopManager=class extends e{constructor(){super(...arguments),this._readyPromise=new Promise((()=>{}))}get isActive(){return!1}get parentReady(){return super.ready}get ready(){return this.parentReady.then((()=>this._readyPromise))}async startNew(e){return Promise.reject(new Error("Not implemented in no-op Terminal Manager"))}connectTo(e){throw Error("Not implemented in no-op Terminal Manager")}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Terminal Manager"))}async requestRunning(){return Promise.resolve()}}}(c=t.TerminalManager||(t.TerminalManager={}))},4020:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shutdownTerminal=t.listRunning=t.startNew=t.isAvailable=t.TERMINAL_SERVICE_URL=void 0;const i=n(8920),s=n(2700);function r(){return"true"===String(i.PageConfig.getOption("terminalsAvailable")).toLowerCase()}var o;t.TERMINAL_SERVICE_URL="api/terminals",t.isAvailable=r,t.startNew=async function(e=s.ServerConnection.makeSettings(),n,r){o.errorIfNotAvailable();const a=i.URLExt.join(e.baseUrl,t.TERMINAL_SERVICE_URL),l={method:"POST",body:JSON.stringify({name:n,cwd:r})},c=await s.ServerConnection.makeRequest(a,l,e);if(200!==c.status)throw await s.ServerConnection.ResponseError.create(c);return await c.json()},t.listRunning=async function(e=s.ServerConnection.makeSettings()){o.errorIfNotAvailable();const n=i.URLExt.join(e.baseUrl,t.TERMINAL_SERVICE_URL),r=await s.ServerConnection.makeRequest(n,{},e);if(200!==r.status)throw await s.ServerConnection.ResponseError.create(r);const a=await r.json();if(!Array.isArray(a))throw new Error("Invalid terminal list");return a},t.shutdownTerminal=async function(e,n=s.ServerConnection.makeSettings()){var r;o.errorIfNotAvailable();const a=i.URLExt.join(n.baseUrl,t.TERMINAL_SERVICE_URL,e),l=await s.ServerConnection.makeRequest(a,{method:"DELETE"},n);if(404===l.status){const t=null!==(r=(await l.json()).message)&&void 0!==r?r:`The terminal session "${e}"" does not exist on the server`;console.warn(t)}else if(204!==l.status)throw await s.ServerConnection.ResponseError.create(l)},function(e){e.errorIfNotAvailable=function(){if(!r())throw new Error("Terminals Unavailable")}}(o||(o={}))},4468:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAvailable=void 0;const i=n(4020);Object.defineProperty(t,"isAvailable",{enumerable:!0,get:function(){return i.isAvailable}})},7523:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UserManager=void 0;const i=n(8920),s=n(5168),r=n(9033),o=n(544),a=n(2700),l=n(2918),c="@jupyterlab/services:UserManager#user";class u extends l.BaseManager{constructor(e={}){var t;super(e),this._isReady=!1,this._userChanged=new o.Signal(this),this._connectionFailure=new o.Signal(this),this._ready=this.requestUser().then((()=>{this.isDisposed||(this._isReady=!0)})).catch((e=>new Promise((()=>{})))),this._pollSpecs=new r.Poll({auto:!1,factory:()=>this.requestUser(),frequency:{interval:61e3,backoff:!0,max:3e5},name:c,standby:null!==(t=e.standby)&&void 0!==t?t:"when-hidden"}),this.ready.then((()=>{this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get identity(){return this._identity}get permissions(){return this._permissions}get userChanged(){return this._userChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose(),super.dispose()}async refreshUser(){await this._pollSpecs.refresh(),await this._pollSpecs.tick}async requestUser(){if(this.isDisposed)return;const{baseUrl:e}=this.serverSettings,{makeRequest:t,ResponseError:n}=a.ServerConnection,r=i.URLExt.join(e,"api/me"),o=await t(r,{},this.serverSettings);if(200!==o.status)throw await n.create(o);const l={identity:this._identity,permissions:this._permissions},u=await o.json(),h=u.identity,{localStorage:p}=window,f=p.getItem(c);if(f&&(!h.initials||!h.color)){const e=JSON.parse(f);h.initials=h.initials||e.initials||h.name.substring(0,1),h.color=h.color||e.color||d.getRandomColor()}s.JSONExt.deepEqual(u,l)||(this._identity=h,this._permissions=u.permissions,p.setItem(c,JSON.stringify(h)),this._userChanged.emit(u))}}var d;t.UserManager=u,function(e){const t=["var(--jp-collaborator-color1)","var(--jp-collaborator-color2)","var(--jp-collaborator-color3)","var(--jp-collaborator-color4)","var(--jp-collaborator-color5)","var(--jp-collaborator-color6)","var(--jp-collaborator-color7)"];e.getRandomColor=()=>t[Math.floor(Math.random()*t.length)]}(d||(d={}))},8193:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateProperty=void 0,t.validateProperty=function(e,t,n,i=[]){if(!e.hasOwnProperty(t))throw Error(`Missing property '${t}'`);const s=e[t];if(void 0!==n){let e=!0;switch(n){case"array":e=Array.isArray(s);break;case"object":e=void 0!==s;break;default:e=typeof s===n}if(!e)throw new Error(`Property '${t}' is not of type '${n}'`);if(i.length>0){let e=!0;switch(n){case"string":case"number":case"boolean":e=i.includes(s);break;default:e=i.findIndex((e=>e===s))>=0}if(!e)throw new Error(`Property '${t}' is not one of the valid values ${JSON.stringify(i)}`)}}}},87:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceManager=void 0;const i=n(8920),s=n(4116),r=n(2700);class o extends s.DataConnector{constructor(e={}){var t;super(),this.serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:r.ServerConnection.makeSettings()}async fetch(e){const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:s,ResponseError:o}=r.ServerConnection,l=n+i,c=a.url(l,e),u=await s(c,{},t);if(200!==u.status)throw await o.create(u);return u.json()}async list(){const{serverSettings:e}=this,{baseUrl:t,appUrl:n}=e,{makeRequest:i,ResponseError:s}=r.ServerConnection,o=t+n,l=a.url(o,""),c=await i(l,{},e);if(200!==c.status)throw await s.create(c);return(await c.json()).workspaces}async remove(e){const{serverSettings:t}=this,{baseUrl:n,appUrl:i}=t,{makeRequest:s,ResponseError:o}=r.ServerConnection,l=n+i,c=a.url(l,e),u=await s(c,{method:"DELETE"},t);if(204!==u.status)throw await o.create(u)}async save(e,t){const{serverSettings:n}=this,{baseUrl:i,appUrl:s}=n,{makeRequest:o,ResponseError:l}=r.ServerConnection,c=i+s,u=a.url(c,e),d={body:JSON.stringify(t),method:"PUT"},h=await o(u,d,n);if(204!==h.status)throw await l.create(h)}}var a;t.WorkspaceManager=o,function(e){e.url=function(e,t){return i.URLExt.join(e,"api/workspaces",t)}}(a||(a={}))},5619:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const i=n(544);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new i.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,i.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)}}},8920:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(5619),t),s(n(8769),t),s(n(4612),t),s(n(9230),t),s(n(7034),t),s(n(902),t),s(n(6400),t),s(n(1718),t),s(n(8305),t)},8769:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4612:(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 i=t.split("\n"),s=[];let r=null;for(let t=0;te===t||i&&e===i))},e.isDisabled=function(t){const n=t.indexOf(":");let i="";return-1!==n&&(i=t.slice(0,n)),e.disabled.some((e=>e===t||i&&e===i))}}(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig=exports.PageConfig||(exports.PageConfig={}))},7034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathExt=void 0;const i=n(1023);!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=i.posix.join(...e);return"."===n?"":t(n)},e.basename=function(e,t){return i.posix.basename(e,t)},e.dirname=function(e){const n=t(i.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return i.posix.extname(e)},e.normalize=function(e){return""===e?"":t(i.posix.normalize(e))},e.resolve=function(...e){return t(i.posix.resolve(...e))},e.relative=function(e,n){return t(i.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={}))},902:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const i=n(5168);t.signalToPromise=function(e,t){const n=new i.PromiseDelegate;function s(){e.disconnect(r)}function r(e,t){s(),n.resolve([e,t])}return e.connect(r),(null!=t?t:0)>0&&setTimeout((()=>{s(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},6400:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){const t="𝐚".length>1;e.jsIndexToCharIndex=function(e,n){if(t)return e;let i=e;for(let t=0;t+1=55296&&e<=56319){const e=n.charCodeAt(t+1);e>=56320&&e<=57343&&(i--,t++)}}return i},e.charIndexToJsIndex=function(e,n){if(t)return e;let i=e;for(let e=0;e+1=55296&&t<=56319){const t=n.charCodeAt(e+1);t>=56320&&t<=57343&&(i++,e++)}}return i},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,i){return i?i.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(t.Text||(t.Text={}))},1718:(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 i;(i=t.Time||(t.Time={})).formatHuman=function(e){const t=document.documentElement.lang||"en",i=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),s=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(s/e.milliseconds);if(0!==t)return i.format(t,e.name)}return i.format(0,"seconds")},i.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}},8305:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const s=n(1023),r=i(n(4846));!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,r.default)(e)}function n(...e){let t=(0,r.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,r.default)(e[0],"https:"+e[0]));const i=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,o=s.posix.join(`${i&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${i}${"."===o?"":o}`}e.parse=t,e.getHostName=function(e){return(0,r.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,i]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(i||"")),e}),{})},e.isLocal=function(e){const{protocol:n}=t(e);return(!n||0!==e.toLowerCase().indexOf(n))&&0!==e.indexOf("/")}}(t.URLExt||(t.URLExt={}))},2845:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataConnector=void 0,t.DataConnector=class{async list(e){throw new Error("DataConnector#list method has not been implemented.")}async remove(e){throw new Error("DataConnector#remove method has not been implemented.")}async save(e,t){throw new Error("DataConnector#save method has not been implemented.")}}},4116:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(2845),t),s(n(3288),t),s(n(4803),t),s(n(6165),t),s(n(9329),t)},3288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RestorablePool=void 0;const i=n(5168),s=n(2571),r=n(544);var o;t.RestorablePool=class{constructor(e){this._added=new r.Signal(this),this._current=null,this._currentChanged=new r.Signal(this),this._hasRestored=!1,this._isDisposed=!1,this._objects=new Set,this._restore=null,this._restored=new i.PromiseDelegate,this._updated=new r.Signal(this),this.namespace=e.namespace}get added(){return this._added}get current(){return this._current}set current(e){this._current!==e&&null!==e&&this._objects.has(e)&&(this._current=e,this._currentChanged.emit(this._current))}get currentChanged(){return this._currentChanged}get isDisposed(){return this._isDisposed}get restored(){return this._restored.promise}get size(){return this._objects.size}get updated(){return this._updated}async add(e){var t,n;if(e.isDisposed){const t="A disposed object cannot be added.";throw console.warn(t,e),new Error(t)}if(this._objects.has(e)){const t="This object already exists in the pool.";throw console.warn(t,e),new Error(t)}if(this._objects.add(e),e.disposed.connect(this._onInstanceDisposed,this),!o.injectedProperty.get(e)){if(this._restore){const{connector:i}=this._restore,s=this._restore.name(e);if(s){const r=`${this.namespace}:${s}`,a=null===(n=(t=this._restore).args)||void 0===n?void 0:n.call(t,e);o.nameProperty.set(e,r),await i.save(r,{data:a})}}this._added.emit(e)}}dispose(){this.isDisposed||(this._current=null,this._isDisposed=!0,this._objects.clear(),r.Signal.clearData(this))}find(e){const t=this._objects.values();for(const n of t)if(e(n))return n}forEach(e){this._objects.forEach(e)}filter(e){const t=[];return this.forEach((n=>{e(n)&&t.push(n)})),t}inject(e){return o.injectedProperty.set(e,!0),this.add(e)}has(e){return this._objects.has(e)}async restore(e){if(this._hasRestored)throw new Error("This pool has already been restored.");this._hasRestored=!0;const{command:t,connector:n,registry:i,when:s}=e,r=this.namespace,o=s?[n.list(r)].concat(s):[n.list(r)];this._restore=e;const[a]=await Promise.all(o),l=await Promise.all(a.ids.map((async(e,s)=>{const r=a.values[s],o=r&&r.data;return void 0===o?n.remove(e):i.execute(t,o).catch((()=>n.remove(e)))})));return this._restored.resolve(),l}async save(e){var t,n;const i=o.injectedProperty.get(e);if(!this._restore||!this.has(e)||i)return;const{connector:s}=this._restore,r=this._restore.name(e),a=o.nameProperty.get(e),l=r?`${this.namespace}:${r}`:"";if(a&&a!==l&&await s.remove(a),o.nameProperty.set(e,l),l){const i=null===(n=(t=this._restore).args)||void 0===n?void 0:n.call(t,e);await s.save(l,{data:i})}a!==l&&this._updated.emit(e)}_onInstanceDisposed(e){if(this._objects.delete(e),e===this._current&&(this._current=null,this._currentChanged.emit(this._current)),o.injectedProperty.get(e))return;if(!this._restore)return;const{connector:t}=this._restore,n=o.nameProperty.get(e);n&&t.remove(n)}},function(e){e.injectedProperty=new s.AttachedProperty({name:"injected",create:()=>!1}),e.nameProperty=new s.AttachedProperty({name:"name",create:()=>""})}(o||(o={}))},6165:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateDB=void 0;const i=n(544);class s{constructor(e={}){this._changed=new i.Signal(this);const{connector:t,transform:n}=e;this._connector=t||new s.Connector,this._ready=n?n.then((e=>{const{contents:t,type:n}=e;switch(n){case"cancel":default:return;case"clear":return this._clear();case"merge":return this._merge(t||{});case"overwrite":return this._overwrite(t||{})}})):Promise.resolve(void 0)}get changed(){return this._changed}async clear(){await this._ready,await this._clear()}async fetch(e){return await this._ready,this._fetch(e)}async list(e){return await this._ready,this._list(e)}async remove(e){await this._ready,await this._remove(e),this._changed.emit({id:e,type:"remove"})}async save(e,t){await this._ready,await this._save(e,t),this._changed.emit({id:e,type:"save"})}async toJSON(){await this._ready;const{ids:e,values:t}=await this._list();return t.reduce(((t,n,i)=>(t[e[i]]=n,t)),{})}async _clear(){await Promise.all((await this._list()).ids.map((e=>this._remove(e))))}async _fetch(e){const t=await this._connector.fetch(e);if(t)return JSON.parse(t).v}async _list(e=""){const{ids:t,values:n}=await this._connector.list(e);return{ids:t,values:n.map((e=>JSON.parse(e).v))}}async _merge(e){await Promise.all(Object.keys(e).map((t=>e[t]&&this._save(t,e[t]))))}async _overwrite(e){await this._clear(),await this._merge(e)}async _remove(e){return this._connector.remove(e)}async _save(e,t){return this._connector.save(e,JSON.stringify({v:t}))}}t.StateDB=s,function(e){e.Connector=class{constructor(){this._storage={}}async fetch(e){return this._storage[e]}async list(e=""){return Object.keys(this._storage).reduce(((t,n)=>(""!==e&&e!==n.split(":")[0]||(t.ids.push(n),t.values.push(this._storage[n])),t)),{ids:[],values:[]})}async remove(e){delete this._storage[e]}async save(e,t){this._storage[e]=t}}}(s=t.StateDB||(t.StateDB={}))},9329:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStateDB=void 0;const i=n(5168);t.IStateDB=new i.Token("@jupyterlab/coreutils:IStateDB",'A service for the JupyterLab state database.\n Use this if you want to store data that will persist across page loads.\n See "state database" for more information.')},5168: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 i(e,s){if(e===s)return!0;if(t(e)||t(s))return!1;let r=n(e),o=n(s);return r===o&&(r&&o?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n>>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)},4643:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DisposableDelegate:()=>s,DisposableSet:()=>o,ObservableDisposableDelegate:()=>r,ObservableDisposableSet:()=>a});var i=n(544);class s{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class r extends s{constructor(){super(...arguments),this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),i.Signal.clearData(this))}}class o{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((e=>{e.dispose()})),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(o||(o={}));class a extends o{constructor(){super(...arguments),this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),i.Signal.clearData(this))}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(a||(a={}))},9033:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Debouncer:()=>l,Poll:()=>o,RateLimiter:()=>a,Throttler:()=>c});var i,s=n(5168),r=n(544);class o{constructor(e){var t;this._disposed=new r.Signal(this),this._lingered=0,this._tick=new s.PromiseDelegate,this._ticked=new r.Signal(this),this._factory=e.factory,this._linger=null!==(t=e.linger)&&void 0!==t?t:i.DEFAULT_LINGER,this._standby=e.standby||i.DEFAULT_STANDBY,this._state={...i.DEFAULT_STATE,timestamp:(new Date).getTime()};const n=e.frequency||{},o=Math.max(n.interval||0,n.max||0,i.DEFAULT_FREQUENCY.max);this.frequency={...i.DEFAULT_FREQUENCY,...n,max:o},this.name=e.name||i.DEFAULT_NAME,"auto"in e&&!e.auto||setTimeout((()=>this.start()))}get disposed(){return this._disposed}get frequency(){return this._frequency}set frequency(e){if(this.isDisposed||s.JSONExt.deepEqual(e,this.frequency||{}))return;let{backoff:t,interval:n,max:i}=e;if(n=Math.round(n),i=Math.round(i),"number"==typeof t&&t<1)throw new Error("Poll backoff growth factor must be at least 1");if((n<0||n>i)&&n!==o.NEVER)throw new Error("Poll interval must be between 0 and max");if(i>o.MAX_INTERVAL&&i!==o.NEVER)throw new Error(`Max interval must be less than ${o.MAX_INTERVAL}`);this._frequency={backoff:t,interval:n,max:i}}get isDisposed(){return"disposed"===this.state.phase}get standby(){return this._standby}set standby(e){this.isDisposed||this.standby===e||(this._standby=e)}get state(){return this._state}get tick(){return this._tick.promise}get ticked(){return this._ticked}async*[Symbol.asyncIterator](){for(;!this.isDisposed;)yield this.state,await this.tick.catch((()=>{}))}dispose(){this.isDisposed||(this._state={...i.DISPOSED_STATE,timestamp:(new Date).getTime()},this._tick.promise.catch((e=>{})),this._tick.reject(new Error(`Poll (${this.name}) is disposed.`)),this._disposed.emit(void 0),r.Signal.clearData(this))}refresh(){return this.schedule({cancel:({phase:e})=>"refreshed"===e,interval:o.IMMEDIATE,phase:"refreshed"})}async schedule(e={}){if(this.isDisposed)return;if(e.cancel&&e.cancel(this.state))return;const t=this._tick,n=new s.PromiseDelegate,i={interval:this.frequency.interval,payload:null,phase:"standby",timestamp:(new Date).getTime(),...e};this._state=i,this._tick=n,clearTimeout(this._timeout),this._ticked.emit(this.state),t.resolve(this),await t.promise,i.interval!==o.NEVER?this._timeout=setTimeout((()=>{this.isDisposed||this.tick!==n.promise||this._execute()}),i.interval):this._timeout=void 0}start(){return this.schedule({cancel:({phase:e})=>"constructed"!==e&&"standby"!==e&&"stopped"!==e,interval:o.IMMEDIATE,phase:"started"})}stop(){return this.schedule({cancel:({phase:e})=>"stopped"===e,interval:o.NEVER,phase:"stopped"})}get hidden(){return i.hidden}_execute(){let e="function"==typeof this.standby?this.standby():this.standby;if("never"===e?e=!1:"when-hidden"===e&&(this.hidden?e=++this._lingered>this._linger:(this._lingered=0,e=!1)),e)return void this.schedule();const t=this.tick;this._factory(this.state).then((e=>{this.isDisposed||this.tick!==t||this.schedule({payload:e,phase:"rejected"===this.state.phase?"reconnected":"resolved"})})).catch((e=>{this.isDisposed||this.tick!==t||this.schedule({interval:i.sleep(this.frequency,this.state),payload:e,phase:"rejected"})}))}}!function(e){e.IMMEDIATE=0,e.MAX_INTERVAL=2147483647,e.NEVER=1/0}(o||(o={})),function(e){e.DEFAULT_BACKOFF=3,e.DEFAULT_FREQUENCY={backoff:!0,interval:1e3,max:3e4},e.DEFAULT_LINGER=1,e.DEFAULT_NAME="unknown",e.DEFAULT_STANDBY="when-hidden",e.DEFAULT_STATE={interval:o.NEVER,payload:null,phase:"constructed",timestamp:new Date(0).getTime()},e.DISPOSED_STATE={interval:o.NEVER,payload:null,phase:"disposed",timestamp:new Date(0).getTime()},e.sleep=function(t,n){const{backoff:i,interval:s,max:r}=t;if(s===o.NEVER)return s;const a=!0===i?e.DEFAULT_BACKOFF:!1===i?1:i,l=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e}(s,n.interval*a);return Math.min(r,l)},e.hidden="undefined"!=typeof document&&(document.addEventListener("visibilitychange",(()=>{e.hidden="hidden"===document.visibilityState})),document.addEventListener("pagehide",(()=>{e.hidden="hidden"===document.visibilityState})),"hidden"===document.visibilityState)}(i||(i={}));class a{constructor(e,t=500){this.args=void 0,this.payload=null,this.limit=t,this.poll=new o({auto:!1,factory:async()=>{const{args:t}=this;return this.args=void 0,e(...t)},frequency:{backoff:!1,interval:o.NEVER,max:o.NEVER},standby:"never"}),this.payload=new s.PromiseDelegate,this.poll.ticked.connect(((e,t)=>{const{payload:n}=this;return"resolved"===t.phase?(this.payload=new s.PromiseDelegate,void n.resolve(t.payload)):"rejected"===t.phase||"stopped"===t.phase?(this.payload=new s.PromiseDelegate,n.promise.catch((e=>{})),void n.reject(t.payload)):void 0}),this)}get isDisposed(){return null===this.payload}dispose(){this.isDisposed||(this.args=void 0,this.payload=null,this.poll.dispose())}async stop(){return this.poll.stop()}}class l extends a{invoke(...e){return this.args=e,this.poll.schedule({interval:this.limit,phase:"invoked"}),this.payload.promise}}class c extends a{constructor(e,t){super(e,"number"==typeof t?t:t&&t.limit),this._trailing=!1,"number"!=typeof t&&t&&"trailing"===t.edge&&(this._trailing=!0),this._interval=this._trailing?this.limit:o.IMMEDIATE}invoke(...e){const t="invoked"!==this.poll.state.phase;return(t||this._trailing)&&(this.args=e),t&&this.poll.schedule({interval:this._interval,phase:"invoked"}),this.payload.promise}}},2571:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachedProperty:()=>i});class i{constructor(e){this._pid=s.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,n=s.ensureMap(e);return t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e),t}set(e,t){let n,i=s.ensureMap(e);n=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e);let r=this._coerceValue(e,t);this._maybeNotify(e,n,i[this._pid]=r)}coerce(e){let t,n=s.ensureMap(e);t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);let i=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=i)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){let n=this._coerce;return n?n(e,t):t}_compareValue(e,t){let n=this._compare;return n?n(e,t):e===t}_maybeNotify(e,t,n){let i=this._changed;i&&!this._compareValue(t,n)&&i(e,t,n)}}var s;!function(e){e.clearData=function(e){s.ownerData.delete(e)}}(i||(i={})),function(e){e.ownerData=new WeakMap,e.nextPID=(()=>{let e=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${e++}`})(),e.ensureMap=function(t){let n=e.ownerData.get(t);return n||(n=Object.create(null),e.ownerData.set(t,n),n)}}(s||(s={}))},544:(e,t,n)=>{"use strict";var i,s,r;n.r(t),n.d(t,{Signal:()=>l,Stream:()=>c}),function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(r||(r={}));var o,a=n(5168);class l{constructor(e){this.sender=e}connect(e,t){return o.connect(this,e,t)}disconnect(e,t){return o.disconnect(this,e,t)}emit(e){o.emit(this,e)}}!function(e){e.disconnectBetween=function(e,t){o.disconnectBetween(e,t)},e.disconnectSender=function(e){o.disconnectSender(e)},e.disconnectReceiver=function(e){o.disconnectReceiver(e)},e.disconnectAll=function(e){o.disconnectAll(e)},e.clearData=function(e){o.disconnectAll(e)},e.getExceptionHandler=function(){return o.exceptionHandler},e.setExceptionHandler=function(e){let t=o.exceptionHandler;return o.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=s.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(r.get(t))}u(t)}}function n(e){let t=r.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(s.get(t))}u(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,n){n=n||void 0;let i=s.get(e.sender);if(i||(i=[],s.set(e.sender,i)),l(i,e,t,n))return!1;let o=n||t,a=r.get(o);a||(a=[],r.set(o,a));let c={signal:e,slot:t,thisArg:n};return i.push(c),a.push(c),!0},e.disconnect=function(e,t,n){n=n||void 0;let i=s.get(e.sender);if(!i||0===i.length)return!1;let o=l(i,e,t,n);if(!o)return!1;let a=n||t,c=r.get(a);return o.signal=null,u(i),u(c),!0},e.disconnectBetween=function(e,t){let n=s.get(e);if(!n||0===n.length)return;let i=r.get(t);if(i&&0!==i.length){for(const t of i)t.signal&&t.signal.sender===e&&(t.signal=null);u(n),u(i)}},e.disconnectSender=t,e.disconnectReceiver=n,e.disconnectAll=function(e){t(e),n(e)},e.emit=function(e,t){let n=s.get(e.sender);if(n&&0!==n.length)for(let i=0,s=n.length;i>>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)},6111:function(e){e.exports=function(){"use strict";function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e((function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)})),n=e((function(e){var t=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=t)})),i=(n.version,function(e){return"object"==typeof e?null!==e:"function"==typeof e}),s=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e},r=function(e){try{return!!e()}catch(e){return!0}},o=!r((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),a=t.document,l=i(a)&&i(a.createElement),c=!o&&!r((function(){return 7!=Object.defineProperty((e="div",l?a.createElement(e):{}),"a",{get:function(){return 7}}).a;var e})),u=Object.defineProperty,d={f:o?Object.defineProperty:function(e,t,n){if(s(e),t=function(e,t){if(!i(e))return e;var n,s;if(t&&"function"==typeof(n=e.toString)&&!i(s=n.call(e)))return s;if("function"==typeof(n=e.valueOf)&&!i(s=n.call(e)))return s;if(!t&&"function"==typeof(n=e.toString)&&!i(s=n.call(e)))return s;throw TypeError("Can't convert object to primitive value")}(t,!0),s(n),c)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},h=o?function(e,t,n){return d.f(e,t,function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}(1,n))}:function(e,t,n){return e[t]=n,e},p={}.hasOwnProperty,f=function(e,t){return p.call(e,t)},m=0,g=Math.random(),v=e((function(e){var i="__core-js_shared__",s=t[i]||(t[i]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),_=v("native-function-to-string",Function.toString),y=e((function(e){var i=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++m+g).toString(36))}("src"),s="toString",r=(""+_).split(s);n.inspectSource=function(e){return _.call(e)},(e.exports=function(e,n,s,o){var a="function"==typeof s;a&&(f(s,"name")||h(s,"name",n)),e[n]!==s&&(a&&(f(s,i)||h(s,i,e[n]?""+e[n]:r.join(String(n)))),e===t?e[n]=s:o?e[n]?e[n]=s:h(e,n,s):(delete e[n],h(e,n,s)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[i]||_.call(this)}))})),b=function(e,t,n){if(function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!")}(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,s){return e.call(t,n,i,s)}}return function(){return e.apply(t,arguments)}},w="prototype",D=function(e,i,s){var r,o,a,l,c=e&D.F,u=e&D.G,d=e&D.S,p=e&D.P,f=e&D.B,m=u?t:d?t[i]||(t[i]={}):(t[i]||{})[w],g=u?n:n[i]||(n[i]={}),v=g[w]||(g[w]={});for(r in u&&(s=i),s)a=((o=!c&&m&&void 0!==m[r])?m:s)[r],l=f&&o?b(a,t):p&&"function"==typeof a?b(Function.call,a):a,m&&y(m,r,a,e&D.U),g[r]!=a&&h(g,r,l),p&&v[r]!=a&&(v[r]=a)};t.core=n,D.F=1,D.G=2,D.S=4,D.P=8,D.B=16,D.W=32,D.U=64,D.R=128;var x=D,C=Math.ceil,E=Math.floor,S=function(e){return isNaN(e=+e)?0:(e>0?E:C)(e)},A=(!1,function(e,t){var n,i,s=String(function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}(e)),r=S(t),o=s.length;return r<0||r>=o?void 0:(n=s.charCodeAt(r))<55296||n>56319||r+1===o||(i=s.charCodeAt(r+1))<56320||i>57343?n:i-56320+(n-55296<<10)+65536});x(x.P,"String",{codePointAt:function(e){return A(this,e)}}),n.String.codePointAt;var k=Math.max,M=Math.min,F=String.fromCharCode,I=String.fromCodePoint;x(x.S+x.F*(!!I&&1!=I.length),"String",{fromCodePoint:function(e){for(var t,n=arguments,i=[],s=arguments.length,r=0;s>r;){if(t=+n[r++],a=1114111,((o=S(o=t))<0?k(o+a,0):M(o,a))!==t)throw RangeError(t+" is not a valid code point");i.push(t<65536?F(t):F(55296+((t-=65536)>>10),t%1024+56320))}var o,a;return i.join("")}}),n.String.fromCodePoint;var O,P,B,R,T,L,j,N,z,U,q,W,H,K,$={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},V={isSpaceSeparator:function(e){return"string"==typeof e&&$.Space_Separator.test(e)},isIdStartChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||$.ID_Start.test(e))},isIdContinueChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||"‌"===e||"‍"===e||$.ID_Continue.test(e))},isDigit:function(e){return"string"==typeof e&&/[0-9]/.test(e)},isHexDigit:function(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}};function J(e,t,n){var i=e[t];if(null!=i&&"object"==typeof i)if(Array.isArray(i))for(var s=0;s0;){var n=Y();if(!V.isHexDigit(n))throw re(X());e+=X()}return String.fromCodePoint(parseInt(e,16))}var ne={start:function(){if("eof"===j.type)throw oe();ie()},beforePropertyName:function(){switch(j.type){case"identifier":case"string":return N=j.value,void(P="afterPropertyName");case"punctuator":return void se();case"eof":throw oe()}},afterPropertyName:function(){if("eof"===j.type)throw oe();P="beforePropertyValue"},beforePropertyValue:function(){if("eof"===j.type)throw oe();ie()},beforeArrayValue:function(){if("eof"===j.type)throw oe();"punctuator"!==j.type||"]"!==j.value?ie():se()},afterPropertyValue:function(){if("eof"===j.type)throw oe();switch(j.value){case",":return void(P="beforePropertyName");case"}":se()}},afterArrayValue:function(){if("eof"===j.type)throw oe();switch(j.value){case",":return void(P="beforeArrayValue");case"]":se()}},end:function(){}};function ie(){var e;switch(j.type){case"punctuator":switch(j.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=j.value}if(void 0===z)z=e;else{var t=B[B.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,N,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)B.push(e),P=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{var n=B[B.length-1];P=null==n?"end":Array.isArray(n)?"afterArrayValue":"afterPropertyValue"}}function se(){B.pop();var e=B[B.length-1];P=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function re(e){return ce(void 0===e?"JSON5: invalid end of input at "+T+":"+L:"JSON5: invalid character '"+le(e)+"' at "+T+":"+L)}function oe(){return ce("JSON5: invalid end of input at "+T+":"+L)}function ae(){return ce("JSON5: invalid identifier character at "+T+":"+(L-=5))}function le(e){var t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){var n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function ce(e){var t=new SyntaxError(e);return t.lineNumber=T,t.columnNumber=L,t}return{parse:function(e,t){O=String(e),P="start",B=[],R=0,T=1,L=0,j=void 0,N=void 0,z=void 0;do{j=G(),ne[P]()}while("eof"!==j.type);return"function"==typeof t?J({"":z},"",t):z},stringify:function(e,t,n){var i,s,r,o=[],a="",l="";if(null==t||"object"!=typeof t||Array.isArray(t)||(n=t.space,r=t.quote,t=t.replacer),"function"==typeof t)s=t;else if(Array.isArray(t)){i=[];for(var c=0,u=t;c0&&(n=Math.min(10,Math.floor(n)),l=" ".substr(0,n)):"string"==typeof n&&(l=n.substr(0,10)),p("",{"":e});function p(e,t){var n=t[e];switch(null!=n&&("function"==typeof n.toJSON5?n=n.toJSON5(e):"function"==typeof n.toJSON&&(n=n.toJSON(e))),s&&(n=s.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof n?f(n):"number"==typeof n?String(n):"object"==typeof n?Array.isArray(n)?function(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=l;for(var n,i=[],s=0;s=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=l;for(var n,s,r=[],c=0,u=i||Object.keys(e);c{e.exports=function e(t,n,i){function s(o,a){if(!n[o]){if(!t[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return s(t[o][1][e]||e)}),c,c.exports,e,t,n,i)}return n[o].exports}for(var r=void 0,o=0;o=43)}})).catch((function(){return!1}))}(e).then((function(e){return h=e}))}function y(e){var t=p[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function b(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var n=p[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function D(e,t){return new o((function(n,i){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);y(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var o=s.open.apply(s,r);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),i(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},n(t),b(e)}}))}function x(e){return D(e,!1)}function C(e){return D(e,!0)}function E(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),i=e.versione.db.version;if(i&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),s||n){if(n){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function S(e){return r([v(atob(e.data))],{type:e.type})}function A(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,n=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return l(n,e,e),n}function M(e,t,n,i){void 0===i&&(i=1);try{var s=e.db.transaction(e.storeName,t);n(null,s)}catch(s){if(i>0&&(!e.db||"InvalidStateError"===s.name||"NotFoundError"===s.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===s.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),C(e)})).then((function(){return function(e){y(e);for(var t=p[e.name],n=t.forages,i=0;i>4,u[l++]=(15&i)<<4|s>>2,u[l++]=(3&s)<<6|63&r;return c}function Y(e){var t,n=new Uint8Array(e),i="";for(t=0;t>2],i+=I[(3&n[t])<<4|n[t+1]>>4],i+=I[(15&n[t+1])<<2|n[t+2]>>6],i+=I[63&n[t+2]];return n.length%3==2?i=i.substring(0,i.length-1)+"=":n.length%3==1&&(i=i.substring(0,i.length-2)+"=="),i}var X={serialize:function(e,t){var n="";if(e&&(n=J.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===J.call(e.buffer))){var i,s=B;e instanceof ArrayBuffer?(i=e,s+=T):(i=e.buffer,"[object Int8Array]"===n?s+=j:"[object Uint8Array]"===n?s+=N:"[object Uint8ClampedArray]"===n?s+=z:"[object Int16Array]"===n?s+=U:"[object Uint16Array]"===n?s+=W:"[object Int32Array]"===n?s+=q:"[object Uint32Array]"===n?s+=H:"[object Float32Array]"===n?s+=K:"[object Float64Array]"===n?s+=$:t(new Error("Failed to get type for BinaryArray"))),t(s+Y(i))}else if("[object Blob]"===n){var r=new FileReader;r.onload=function(){var n=O+e.type+"~"+Y(this.result);t(B+L+n)},r.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,R)!==B)return JSON.parse(e);var t,n=e.substring(V),i=e.substring(R,V);if(i===L&&P.test(n)){var s=n.match(P);t=s[1],n=n.substring(s[0].length)}var o=G(n);switch(i){case T:return o;case L:return r([o],{type:t});case j:return new Int8Array(o);case N:return new Uint8Array(o);case z:return new Uint8ClampedArray(o);case U:return new Int16Array(o);case W:return new Uint16Array(o);case q:return new Int32Array(o);case H:return new Uint32Array(o);case K:return new Float32Array(o);case $:return new Float64Array(o);default:throw new Error("Unkown type: "+i)}},stringToBuffer:G,bufferToString:Y};function Z(e,t,n,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,i)}function Q(e,t,n,i,s,r){e.executeSql(n,i,s,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?r(e,o):Z(e,t,(function(){e.executeSql(n,i,s,r)}),r)}),r):r(e,o)}),r)}function ee(e,t,n,i){var s=this;e=c(e);var r=new o((function(r,o){s.ready().then((function(){void 0===t&&(t=null);var a=t,l=s._dbInfo;l.serializer.serialize(t,(function(t,c){c?o(c):l.db.transaction((function(n){Q(n,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){r(a)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(i>0)return void r(ee.apply(s,[e,a,n,i-1]));o(t)}}))}))})).catch(o)}));return a(r,n),r}var te={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var i in e)n[i]="string"!=typeof e[i]?e[i].toString():e[i];var s=new o((function(e,i){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return i(e)}n.db.transaction((function(s){Z(s,n,(function(){t._dbInfo=n,e()}),(function(e,t){i(t)}))}),i)}));return n.serializer=X,s},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,i=new o((function(t,i){n.ready().then((function(){var s=n._dbInfo;s.db.transaction((function(n){Q(n,s,"SELECT * FROM "+s.storeName,[],(function(n,i){for(var r=i.rows,o=r.length,a=0;a '__WebKitDatabaseInfoTable__'",[],(function(n,i){for(var s=[],r=0;r0}var se={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=ne(e,this._defaultConfig),ie()?(this._dbInfo=t,t.serializer=X,o.resolve()):o.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,i=n.ready().then((function(){for(var t=n._dbInfo,i=t.keyPrefix,s=i.length,r=localStorage.length,o=1,a=0;a=0;n--){var i=localStorage.key(n);0===i.indexOf(e)&&localStorage.removeItem(i)}}));return a(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return a(t,e),t},key:function(e,t){var n=this,i=n.ready().then((function(){var t,i=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(i.keyPrefix.length)),t}));return a(i,t),i},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,i=[],s=0;s=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),a(i,t),i}},re=function(e,t){for(var n=e.length,i=0;i{"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,i){i||(i={});var s={bools:{},strings:{},unknownFn:null};"function"==typeof i.unknown&&(s.unknownFn=i.unknown),"boolean"==typeof i.boolean&&i.boolean?s.allBools=!0:[].concat(i.boolean).filter(Boolean).forEach((function(e){s.bools[e]=!0}));var r={};function o(e){return r[e].some((function(e){return s.bools[e]}))}Object.keys(i.alias||{}).forEach((function(e){r[e]=[].concat(i.alias[e]),r[e].forEach((function(t){r[t]=[e].concat(r[e].filter((function(e){return t!==e})))}))})),[].concat(i.string).filter(Boolean).forEach((function(e){s.strings[e]=!0,r[e]&&[].concat(r[e]).forEach((function(e){s.strings[e]=!0}))}));var a=i.default||{},l={_:[]};function c(e,t,i){for(var r=e,o=0;o=2&&(n=n.slice(2)):v(s)?n=i[4]:s?r&&(n=n.slice(2)):a>=2&&v(t.protocol)&&(n=i[4]),{protocol:s,slashes:r||v(s),slashesCount:a,rest:n}}function y(e,t,n){if(e=(e=p(e)).replace(l,""),!(this instanceof y))return new y(e,t,n);var s,r,o,c,u,h,m=f.slice(),b=typeof t,w=this,D=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=a.parse),s=!(r=_(e||"",t=g(t))).protocol&&!r.slashes,w.slashes=r.slashes||s&&t.slashes,w.protocol=r.protocol||t.protocol||"",e=r.rest,("file:"===r.protocol&&(2!==r.slashesCount||d.test(e))||!r.slashes&&(r.protocol||r.slashesCount<2||!v(w.protocol)))&&(m[3]=[/(.*)/,"pathname"]);D=0?e.slice(0,t):e}C.prototype.addEventListener=function(e,t){"function"==typeof t&&(Array.isArray(this.listeners[e])||(this.listeners[e]=[]),0===function(e,t){void 0===e&&(e=[]);var n=[];return e.forEach((function(e){t(e)&&n.push(e)})),n}(this.listeners[e],(function(e){return e===t})).length&&this.listeners[e].push(t))},C.prototype.removeEventListener=function(e,t){var n=this.listeners[e];this.listeners[e]=x(n,(function(e){return e===t}))},C.prototype.dispatchEvent=function(e){for(var t=this,n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var s=e.type,r=this.listeners[s];return!!Array.isArray(r)&&(r.forEach((function(i){n.length>0?i.apply(t,n):i.call(t,e)})),!0)};var S=function(){this.urlMap={}};S.prototype.attachWebSocket=function(e,t){var n=E(t),i=this.urlMap[n];if(i&&i.server&&-1===i.websockets.indexOf(e))return i.websockets.push(e),i.server},S.prototype.addMembershipToRoom=function(e,t){var n=this.urlMap[E(e.url)];n&&n.server&&-1!==n.websockets.indexOf(e)&&(n.roomMemberships[t]||(n.roomMemberships[t]=[]),n.roomMemberships[t].push(e))},S.prototype.attachServer=function(e,t){var n=E(t);if(!this.urlMap[n])return this.urlMap[n]={server:e,websockets:[],roomMemberships:{}},e},S.prototype.serverLookup=function(e){var t=E(e),n=this.urlMap[t];if(n)return n.server},S.prototype.websocketsLookup=function(e,t,n){var i,s=E(e),r=this.urlMap[s];return i=r?r.websockets:[],t&&(i=r.roomMemberships[t]||[]),n?i.filter((function(e){return e!==n})):i},S.prototype.removeServer=function(e){delete this.urlMap[E(e)]},S.prototype.removeWebSocket=function(e,t){var n=E(t),i=this.urlMap[n];i&&(i.websockets=x(i.websockets,(function(t){return t===e})))},S.prototype.removeMembershipFromRoom=function(e,t){var n=this.urlMap[E(e.url)],i=n.roomMemberships[t];n&&null!==i&&(n.roomMemberships[t]=x(i,(function(t){return t===e})))};var A=new S,k={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,UNSUPPORTED_DATA:1007,POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,MISSING_EXTENSION:1010,INTERNAL_ERROR:1011,SERVICE_RESTART:1012,TRY_AGAIN_LATER:1013,TLS_HANDSHAKE:1015},M={CONSTRUCTOR_ERROR:"Failed to construct 'WebSocket':",CLOSE_ERROR:"Failed to execute 'close' on 'WebSocket':",EVENT:{CONSTRUCT:"Failed to construct 'Event':",MESSAGE:"Failed to construct 'MessageEvent':",CLOSE:"Failed to construct 'CloseEvent':"}},F=function(){};F.prototype.stopPropagation=function(){},F.prototype.stopImmediatePropagation=function(){},F.prototype.initEvent=function(e,t,n){void 0===e&&(e="undefined"),void 0===t&&(t=!1),void 0===n&&(n=!1),this.type=""+e,this.bubbles=Boolean(t),this.cancelable=Boolean(n)};var I=function(e){function t(t,n){if(void 0===n&&(n={}),e.call(this),!t)throw new TypeError(M.EVENT_ERROR+" 1 argument required, but only 0 present.");if("object"!=typeof n)throw new TypeError(M.EVENT_ERROR+" parameter 2 ('eventInitDict') is not an object.");var i=n.bubbles,s=n.cancelable;this.type=""+t,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=!!s&&Boolean(s),this.cancelBubble=!1,this.bubbles=!!i&&Boolean(i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(F),O=function(e){function t(t,n){if(void 0===n&&(n={}),e.call(this),!t)throw new TypeError(M.EVENT.MESSAGE+" 1 argument required, but only 0 present.");if("object"!=typeof n)throw new TypeError(M.EVENT.MESSAGE+" parameter 2 ('eventInitDict') is not an object");var i=n.bubbles,s=n.cancelable,r=n.data,o=n.origin,a=n.lastEventId,l=n.ports;this.type=""+t,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=!!s&&Boolean(s),this.canncelBubble=!1,this.bubbles=!!i&&Boolean(i),this.origin=""+o,this.ports=void 0===l?null:l,this.data=void 0===r?null:r,this.lastEventId=""+(a||"")}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(F),P=function(e){function t(t,n){if(void 0===n&&(n={}),e.call(this),!t)throw new TypeError(M.EVENT.CLOSE+" 1 argument required, but only 0 present.");if("object"!=typeof n)throw new TypeError(M.EVENT.CLOSE+" parameter 2 ('eventInitDict') is not an object");var i=n.bubbles,s=n.cancelable,r=n.code,o=n.reason,a=n.wasClean;this.type=""+t,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=!!s&&Boolean(s),this.cancelBubble=!1,this.bubbles=!!i&&Boolean(i),this.code="number"==typeof r?parseInt(r,10):0,this.reason=""+(o||""),this.wasClean=!!a&&Boolean(a)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(F);function B(e){var t=e.type,n=e.target,i=new I(t);return n&&(i.target=n,i.srcElement=n,i.currentTarget=n),i}function R(e){var t=e.type,n=e.origin,i=e.data,s=e.target,r=new O(t,{data:i,origin:n});return s&&(r.target=s,r.srcElement=s,r.currentTarget=s),r}function T(e){var t=e.code,n=e.reason,i=e.type,s=e.target,r=e.wasClean;r||(r=t===k.CLOSE_NORMAL||t===k.CLOSE_NO_STATUS);var o=new P(i,{code:t,reason:n,wasClean:r});return s&&(o.target=s,o.srcElement=s,o.currentTarget=s),o}function L(e,t,n){e.readyState=U.CLOSING;var i=A.serverLookup(e.url),s=T({type:"close",target:e.target,code:t,reason:n});w((function(){A.removeWebSocket(e,e.url),e.readyState=U.CLOSED,e.dispatchEvent(s),i&&i.dispatchEvent(s,i)}),e)}function j(e){return"[object Blob]"===Object.prototype.toString.call(e)||e instanceof ArrayBuffer||(e=String(e)),e}var N=new WeakMap;function z(e){if(N.has(e))return N.get(e);var t=new Proxy(e,{get:function(n,i){if("close"===i)return function(e){void 0===e&&(e={});var n=e.code||k.CLOSE_NORMAL,i=e.reason||"";L(t,n,i)};if("send"===i)return function(t){t=j(t),e.dispatchEvent(R({type:"message",data:t,origin:this.url,target:e}))};var s=function(e){return"message"===e?"server::"+e:e};return"on"===i?function(t,n){e.addEventListener(s(t),n)}:"off"===i?function(t,n){e.removeEventListener(s(t),n)}:"target"===i?e:n[i]}});return N.set(e,t),t}var U=function(e){function t(n,i){e.call(this),this._onopen=null,this._onmessage=null,this._onerror=null,this._onclose=null,this.url=function(e){var t=new b(e),n=t.pathname,i=t.protocol,s=t.hash;if(!e)throw new TypeError(M.CONSTRUCTOR_ERROR+" 1 argument required, but only 0 present.");if(n||(t.pathname="/"),""===i)throw new SyntaxError(M.CONSTRUCTOR_ERROR+" The URL '"+t.toString()+"' is invalid.");if("ws:"!==i&&"wss:"!==i)throw new SyntaxError(M.CONSTRUCTOR_ERROR+" The URL's scheme must be either 'ws' or 'wss'. '"+i+"' is not allowed.");if(""!==s)throw new SyntaxError(M.CONSTRUCTOR_ERROR+" The URL contains a fragment identifier ('"+s+"'). Fragment identifiers are not allowed in WebSocket URLs.");return t.toString()}(n),i=function(e){if(void 0===e&&(e=[]),!Array.isArray(e)&&"string"!=typeof e)throw new SyntaxError(M.CONSTRUCTOR_ERROR+" The subprotocol '"+e.toString()+"' is invalid.");"string"==typeof e&&(e=[e]);var t=e.map((function(e){return{count:1,protocol:e}})).reduce((function(e,t){return e[t.protocol]=(e[t.protocol]||0)+t.count,e}),{}),n=Object.keys(t).filter((function(e){return t[e]>1}));if(n.length>0)throw new SyntaxError(M.CONSTRUCTOR_ERROR+" The subprotocol '"+n[0]+"' is duplicated.");return e}(i),this.protocol=i[0]||"",this.binaryType="blob",this.readyState=t.CONNECTING;var s=z(this),r=A.attachWebSocket(s,this.url);w((function(){if(r)if(r.options.verifyClient&&"function"==typeof r.options.verifyClient&&!r.options.verifyClient())this.readyState=t.CLOSED,D("error","WebSocket connection to '"+this.url+"' failed: HTTP Authentication failed; no valid credentials available"),A.removeWebSocket(s,this.url),this.dispatchEvent(B({type:"error",target:this})),this.dispatchEvent(T({type:"close",target:this,code:k.CLOSE_NORMAL}));else{if(r.options.selectProtocol&&"function"==typeof r.options.selectProtocol){var e=r.options.selectProtocol(i),n=""!==e,o=-1!==i.indexOf(e);if(n&&!o)return this.readyState=t.CLOSED,D("error","WebSocket connection to '"+this.url+"' failed: Invalid Sub-Protocol"),A.removeWebSocket(s,this.url),this.dispatchEvent(B({type:"error",target:this})),void this.dispatchEvent(T({type:"close",target:this,code:k.CLOSE_NORMAL}));this.protocol=e}this.readyState=t.OPEN,this.dispatchEvent(B({type:"open",target:this})),r.dispatchEvent(B({type:"connection"}),s)}else this.readyState=t.CLOSED,this.dispatchEvent(B({type:"error",target:this})),this.dispatchEvent(T({type:"close",target:this,code:k.CLOSE_NORMAL})),D("error","WebSocket connection to '"+this.url+"' failed")}),this)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={onopen:{},onmessage:{},onclose:{},onerror:{}};return n.onopen.get=function(){return this._onopen},n.onmessage.get=function(){return this._onmessage},n.onclose.get=function(){return this._onclose},n.onerror.get=function(){return this._onerror},n.onopen.set=function(e){this.removeEventListener("open",this._onopen),this._onopen=e,this.addEventListener("open",e)},n.onmessage.set=function(e){this.removeEventListener("message",this._onmessage),this._onmessage=e,this.addEventListener("message",e)},n.onclose.set=function(e){this.removeEventListener("close",this._onclose),this._onclose=e,this.addEventListener("close",e)},n.onerror.set=function(e){this.removeEventListener("error",this._onerror),this._onerror=e,this.addEventListener("error",e)},t.prototype.send=function(e){var n=this;if(this.readyState===t.CLOSING||this.readyState===t.CLOSED)throw new Error("WebSocket is already in CLOSING or CLOSED state");var i=R({type:"server::message",origin:this.url,data:j(e)}),s=A.serverLookup(this.url);s&&w((function(){n.dispatchEvent(i,e)}),s)},t.prototype.close=function(e,n){if(void 0!==e&&("number"!=typeof e||1e3!==e&&(e<3e3||e>4999)))throw new TypeError(M.CLOSE_ERROR+" The code must be either 1000, or between 3000 and 4999. "+e+" is neither.");if(void 0!==n&&(i=n,s=encodeURIComponent(i).match(/%[89ABab]/g),i.length+(s?s.length:0)>123))throw new SyntaxError(M.CLOSE_ERROR+" The message must not be greater than 123 bytes.");var i,s;if(this.readyState!==t.CLOSING&&this.readyState!==t.CLOSED){var r=z(this);this.readyState===t.CONNECTING?function(e,t,n){e.readyState=U.CLOSING;var i=A.serverLookup(e.url),s=T({type:"close",target:e.target,code:t,reason:n,wasClean:!1}),r=B({type:"error",target:e.target});w((function(){A.removeWebSocket(e,e.url),e.readyState=U.CLOSED,e.dispatchEvent(r),e.dispatchEvent(s),i&&i.dispatchEvent(s,i)}),e)}(r,e||k.CLOSE_ABNORMAL,n):L(r,e||k.CLOSE_NO_STATUS,n)}},Object.defineProperties(t.prototype,n),t}(C);U.CONNECTING=0,U.prototype.CONNECTING=U.CONNECTING,U.OPEN=1,U.prototype.OPEN=U.OPEN,U.CLOSING=2,U.prototype.CLOSING=U.CLOSING,U.CLOSED=3,U.prototype.CLOSED=U.CLOSED;var q=function(e){function t(n,i){var s=this;void 0===n&&(n="socket.io"),void 0===i&&(i=""),e.call(this),this.binaryType="blob";var r=new b(n);r.pathname||(r.pathname="/"),this.url=r.toString(),this.readyState=t.CONNECTING,this.protocol="",this.target=this,"string"==typeof i||"object"==typeof i&&null!==i?this.protocol=i:Array.isArray(i)&&i.length>0&&(this.protocol=i[0]);var o=A.attachWebSocket(this,this.url);w((function(){o?(this.readyState=t.OPEN,o.dispatchEvent(B({type:"connection"}),o,this),o.dispatchEvent(B({type:"connect"}),o,this),this.dispatchEvent(B({type:"connect",target:this}))):(this.readyState=t.CLOSED,this.dispatchEvent(B({type:"error",target:this})),this.dispatchEvent(T({type:"close",target:this,code:k.CLOSE_NORMAL})),D("error","Socket.io connection to '"+this.url+"' failed"))}),this),this.addEventListener("close",(function(e){s.dispatchEvent(T({type:"disconnect",target:e.target,code:e.code}))}))}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={broadcast:{}};return t.prototype.close=function(){if(this.readyState===t.OPEN){var e=A.serverLookup(this.url);return A.removeWebSocket(this,this.url),this.readyState=t.CLOSED,this.dispatchEvent(T({type:"close",target:this,code:k.CLOSE_NORMAL})),e&&e.dispatchEvent(T({type:"disconnect",target:this,code:k.CLOSE_NORMAL}),e),this}},t.prototype.disconnect=function(){return this.close()},t.prototype.emit=function(e){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];if(this.readyState!==t.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var s=R({type:e,origin:this.url,data:n}),r=A.serverLookup(this.url);return r&&r.dispatchEvent.apply(r,[s].concat(n)),this},t.prototype.send=function(e){return this.emit("message",e),this},n.broadcast.get=function(){if(this.readyState!==t.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var e=this,n=A.serverLookup(this.url);if(!n)throw new Error("SocketIO can not find a server at the specified URL ("+this.url+")");return{emit:function(t,i){return n.emit(t,i,{websockets:A.websocketsLookup(e.url,null,e)}),e},to:function(t){return n.to(t,e)},in:function(t){return n.in(t,e)}}},t.prototype.on=function(e,t){return this.addEventListener(e,t),this},t.prototype.off=function(e,t){this.removeEventListener(e,t)},t.prototype.hasListeners=function(e){var t=this.listeners[e];return!!Array.isArray(t)&&!!t.length},t.prototype.join=function(e){A.addMembershipToRoom(this,e)},t.prototype.leave=function(e){A.removeMembershipFromRoom(this,e)},t.prototype.to=function(e){return this.broadcast.to(e)},t.prototype.in=function(){return this.to.apply(null,arguments)},t.prototype.dispatchEvent=function(e){for(var t=this,n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var s=e.type,r=this.listeners[s];if(!Array.isArray(r))return!1;r.forEach((function(i){n.length>0?i.apply(t,n):i.call(t,e.data?e.data:e)}))},Object.defineProperties(t.prototype,n),t}(C);q.CONNECTING=0,q.OPEN=1,q.CLOSING=2,q.CLOSED=3;var W=function(e,t){return new q(e,t)};W.connect=function(e,t){return W(e,t)};function H(){return"undefined"!=typeof window?window:"object"==typeof process&&"object"==typeof n.g?n.g:this}var K={mock:!0,verifyClient:null,selectProtocol:null},$=function(e){function t(t,n){void 0===n&&(n=K),e.call(this);var i=new b(t);if(i.pathname||(i.pathname="/"),this.url=i.toString(),this.originalWebSocket=null,!A.attachServer(this,this.url))throw this.dispatchEvent(B({type:"error"})),new Error("A mock server is already listening on this url");this.options=Object.assign({},K,n),this.options.mock&&this.mockWebsocket()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.mockWebsocket=function(){var e=H();this.originalWebSocket=e.WebSocket,e.WebSocket=U},t.prototype.restoreWebsocket=function(){var e=H();null!==this.originalWebSocket&&(e.WebSocket=this.originalWebSocket),this.originalWebSocket=null},t.prototype.stop=function(e){void 0===e&&(e=function(){}),this.options.mock&&this.restoreWebsocket(),A.removeServer(this.url),"function"==typeof e&&e()},t.prototype.on=function(e,t){this.addEventListener(e,t)},t.prototype.off=function(e,t){this.removeEventListener(e,t)},t.prototype.close=function(e){void 0===e&&(e={});var t=e.code,n=e.reason,i=e.wasClean,s=A.websocketsLookup(this.url);A.removeServer(this.url),s.forEach((function(e){e.readyState=U.CLOSED,e.dispatchEvent(T({type:"close",target:e.target,code:t||k.CLOSE_NORMAL,reason:n||"",wasClean:i}))})),this.dispatchEvent(T({type:"close"}),this)},t.prototype.emit=function(e,t,n){var i=this;void 0===n&&(n={});var s,r=n.websockets;r||(r=A.websocketsLookup(this.url)),"object"!=typeof n||arguments.length>3?(t=Array.prototype.slice.call(arguments,1,arguments.length),s=t.map((function(e){return j(e)}))):s=j(t),r.forEach((function(n){var r=n instanceof q?t:s;Array.isArray(r)?n.dispatchEvent.apply(n,[R({type:e,data:r,origin:i.url,target:n.target})].concat(r)):n.dispatchEvent(R({type:e,data:r,origin:i.url,target:n.target}))}))},t.prototype.clients=function(){return A.websocketsLookup(this.url)},t.prototype.to=function(e,t,n){var i=this;void 0===n&&(n=[]);var s=this,r=n.concat(A.websocketsLookup(this.url,e,t)).reduce((function(e,t){return e.indexOf(t)>-1?e:e.concat(t)}),[]);return{to:function(e,t){return i.to.call(i,e,t,r)},emit:function(e,t){s.emit(e,t,{websockets:r})}}},t.prototype.in=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return this.to.apply(null,e)},t.prototype.simulate=function(e){var t=A.websocketsLookup(this.url);"error"===e&&t.forEach((function(e){e.readyState=U.CLOSED,e.dispatchEvent(B({type:"error",target:e.target}))}))},t}(C);$.of=function(e){return new $(e)};var V=$,J=U,G=W;e.Server=V,e.WebSocket=J,e.SocketIO=G,Object.defineProperty(e,"__esModule",{value:!0})}(t)},1023: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,i="",s=0,r=-1,o=0,a=0;a<=e.length;++a){if(a2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",s=0):s=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),r=a,o=0;continue}}else if(2===i.length||1===i.length){i="",s=0,r=a,o=0;continue}t&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+="/"+e.slice(r+1,a):i=e.slice(r+1,a),s=a-r-1;r=a,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var i={resolve:function(){for(var e,i="",s=!1,r=arguments.length-1;r>=-1&&!s;r--){var o;r>=0?o=arguments[r]:(void 0===e&&(e=process.cwd()),o=e),t(o),0!==o.length&&(i=o+"/"+i,s=47===o.charCodeAt(0))}return i=n(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var i=47===e.charCodeAt(0),s=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!i)).length||i||(e="."),e.length>0&&s&&(e+="/"),i?"/"+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;n0&&(void 0===e?e=s:e+="/"+s)}return void 0===e?".":i.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=i.resolve(e))===(n=i.resolve(n)))return"";for(var s=1;sc){if(47===n.charCodeAt(a+d))return n.slice(a+d+1);if(0===d)return n.slice(a+d)}else o>c&&(47===e.charCodeAt(s+d)?u=d:0===d&&(u=0));break}var h=e.charCodeAt(s+d);if(h!==n.charCodeAt(a+d))break;47===h&&(u=d)}var p="";for(d=s+u+1;d<=r;++d)d!==r&&47!==e.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+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),i=47===n,s=-1,r=!0,o=e.length-1;o>=1;--o)if(47===(n=e.charCodeAt(o))){if(!r){s=o;break}}else r=!1;return-1===s?i?"/":".":i&&1===s?"//":e.slice(0,s)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var i,s=0,r=-1,o=!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(i=e.length-1;i>=0;--i){var c=e.charCodeAt(i);if(47===c){if(!o){s=i+1;break}}else-1===l&&(o=!1,l=i+1),a>=0&&(c===n.charCodeAt(a)?-1==--a&&(r=i):(a=-1,r=l))}return s===r?r=l:-1===r&&(r=e.length),e.slice(s,r)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!o){s=i+1;break}}else-1===r&&(o=!1,r=i+1);return-1===r?"":e.slice(s,r)},extname:function(e){t(e);for(var n=-1,i=0,s=-1,r=!0,o=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===s&&(r=!1,s=a+1),46===l?-1===n?n=a:1!==o&&(o=1):-1!==n&&(o=-1);else if(!r){i=a+1;break}}return-1===n||-1===s||0===o||1===o&&n===s-1&&n===i+1?"":e.slice(n,s)},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,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+"/"+i:i}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var i,s=e.charCodeAt(0),r=47===s;r?(n.root="/",i=1):i=0;for(var o=-1,a=0,l=-1,c=!0,u=e.length-1,d=0;u>=i;--u)if(47!==(s=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===s?-1===o?o=u:1!==d&&(d=1):-1!==o&&(d=-1);else if(!c){a=u+1;break}return-1===o||-1===l||0===d||1===d&&o===l-1&&o===a+1?-1!==l&&(n.base=n.name=0===a&&r?e.slice(1,l):e.slice(a,l)):(0===a&&r?(n.name=e.slice(1,o),n.base=e.slice(1,l)):(n.name=e.slice(a,o),n.base=e.slice(a,l)),n.ext=e.slice(o,l)),a>0?n.dir=e.slice(0,a-1):r&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i},7375:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function i(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function s(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var i,r,o=[];for(r in"string"!=typeof t&&(t="?"),e)if(n.call(e,r)){if((i=e[r])||null!=i&&!isNaN(i)||(i=""),r=s(r),i=s(i),null===r||null===i)continue;o.push(r+"="+i)}return o.length?t+o.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,s={};t=n.exec(e);){var r=i(t[1]),o=i(t[2]);null===r||null===o||r in s||(s[r]=o)}return s}},7245: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}},1920:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupThebeLite=t.startJupyterLiteServer=void 0;const i=n(5163),s=n(315);function r(){var e;window.thebeLite=Object.assign(null!==(e=window.thebeLite)&&void 0!==e?e:{},{startJupyterLiteServer:s.startJupyterLiteServer})}Object.defineProperty(t,"startJupyterLiteServer",{enumerable:!0,get:function(){return s.startJupyterLiteServer}}),t.setupThebeLite=r,"undefined"!=typeof window&&(console.debug("window is defined, setting up thebe-lite"),r(),console.debug("window.thebeLite",window.thebeLite)),i.__exportStar(n(3173),t)},315:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startJupyterLiteServer=void 0;const i=n(5163),s=n(9622),r=n(3800),o=[Promise.resolve().then((()=>i.__importStar(n(9671))))];function*a(e){let t;t=Object.prototype.hasOwnProperty.call(e,"__esModule")?e.default:e;const n=Array.isArray(t)?t:[t];for(const e of n)yield e}t.startJupyterLiteServer=function(e){return i.__awaiter(this,void 0,void 0,(function*(){s.PageConfig.getOption(""),(null==e?void 0:e.litePluginSettings)&&s.PageConfig.setOption("litePluginSettings",JSON.stringify(e.litePluginSettings));const t=[];(yield Promise.all(o)).forEach((e=>{for(const n of a(e))t.push(n)}));const l=[Promise.resolve().then((()=>i.__importStar(n(4957))))];[].forEach((e=>{e.liteExtension&&l.push(function(e,t){return i.__awaiter(this,void 0,void 0,(function*(){try{return(yield window._JUPYTERLAB[e].get(t))()}catch(n){throw console.warn(`Failed to create module: package: ${e}; module: ${t}`),n}}))}(e.name,e.extension))})),(yield Promise.allSettled(l)).forEach((e=>{if("fulfilled"===e.status)for(const n of a(e.value))t.push(n);else console.error(e.reason)}));const c=new r.JupyterLiteServer({});c.registerPluginModules(t),yield c.start();const{serviceManager:u}=c;return yield u.ready,u}))}},3173:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5163:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__assign:()=>r,__asyncDelegator:()=>w,__asyncGenerator:()=>b,__asyncValues:()=>D,__await:()=>y,__awaiter:()=>u,__classPrivateFieldGet:()=>A,__classPrivateFieldSet:()=>k,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>p,__extends:()=>s,__generator:()=>d,__importDefault:()=>S,__importStar:()=>E,__makeTemplateObject:()=>x,__metadata:()=>c,__param:()=>l,__read:()=>m,__rest:()=>o,__spread:()=>g,__spreadArray:()=>_,__spreadArrays:()=>v,__values:()=>f});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function l(e,t){return function(n,i){t(n,i,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,i){return new(n||(n=Promise))((function(s,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}function d(e,t){var n,i,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,i=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,r=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(e){s={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function g(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(n=s[e](t)).value instanceof y?Promise.resolve(n.value.v).then(l,c):u(r[0][2],n)}catch(e){u(r[0][3],e)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),r.shift(),r.length&&a(r[0][0],r[0][1])}}function w(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,s){t[i]=e[i]?function(t){return(n=!n)?{value:y(e[i](t)),done:"return"===i}:s?s(t):t}:s}}function D(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,s){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,s,(t=e[n](t)).done,t.value)}))}}}function x(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var C=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&h(t,e,n);return C(t,e),t}function S(e){return e&&e.__esModule?e:{default:e}}function A(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function k(e,t,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,n):s?s.value=n:t.set(e,n),n}},4846:(e,t,n)=>{"use strict";var i=n(7245),s=n(7375),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\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 d(e){return(e||"").toString().replace(r,"")}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]],p={hash:1,query:1};function f(e){var t,i=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},r=typeof(e=e||i);if("blob:"===e.protocol)s=new v(unescape(e.pathname),{});else if("string"===r)for(t in s=new v(e,{}),p)delete s[t];else if("object"===r){for(t in e)t in p||(s[t]=e[t]);void 0===s.slashes&&(s.slashes=a.test(e.href))}return s}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=d(e)).replace(o,""),t=t||{};var n,i=c.exec(e),s=i[1]?i[1].toLowerCase():"",r=!!i[2],a=!!i[3],l=0;return r?a?(n=i[2]+i[3]+i[4],l=i[2].length+i[3].length):(n=i[2]+i[4],l=i[2].length):a?(n=i[3]+i[4],l=i[3].length):n=i[4],"file:"===s?l>=2&&(n=n.slice(2)):m(s)?n=i[4]:s?r&&(n=n.slice(2)):l>=2&&m(t.protocol)&&(n=i[4]),{protocol:s,slashes:r||m(s),slashesCount:l,rest:n}}function v(e,t,n){if(e=(e=d(e)).replace(o,""),!(this instanceof v))return new v(e,t,n);var r,a,l,c,p,_,y=h.slice(),b=typeof t,w=this,D=0;for("object"!==b&&"string"!==b&&(n=t,t=null),n&&"function"!=typeof n&&(n=s.parse),r=!(a=g(e||"",t=f(t))).protocol&&!a.slashes,w.slashes=a.slashes||r&&t.slashes,w.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(w.protocol)))&&(y[3]=[/(.*)/,"pathname"]);D{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActivityMonitor=void 0;const i=n(4016);t.ActivityMonitor=class{constructor(e){this._timer=-1,this._timeout=-1,this._isDisposed=!1,this._activityStopped=new i.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,i.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)}}},9622:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),s(n(7542),t),s(n(2086),t),s(n(7390),t),s(n(9458),t),s(n(176),t),s(n(2643),t),s(n(7846),t),s(n(2533),t),s(n(7319),t)},2086:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7390:(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 i=t.split("\n"),s=[];let r=null;for(let t=0;te===t||i&&e===i))},e.isDisabled=function(t){const n=t.indexOf(":");let i="";return-1!==n&&(i=t.slice(0,n)),e.disabled.some((e=>e===t||i&&e===i))}}(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 i=n(1023);!function(e){function t(e){return 0===e.indexOf("/")&&(e=e.slice(1)),e}e.join=function(...e){const n=i.posix.join(...e);return"."===n?"":t(n)},e.basename=function(e,t){return i.posix.basename(e,t)},e.dirname=function(e){const n=t(i.posix.dirname(e));return"."===n?"":n},e.extname=function(e){return i.posix.extname(e)},e.normalize=function(e){return""===e?"":t(i.posix.normalize(e))},e.resolve=function(...e){return t(i.posix.resolve(...e))},e.relative=function(e,n){return t(i.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={}))},2643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalToPromise=void 0;const i=n(5082);t.signalToPromise=function(e,t){const n=new i.PromiseDelegate;function s(){e.disconnect(r)}function r(e,t){s(),n.resolve([e,t])}return e.connect(r),(null!=t?t:0)>0&&setTimeout((()=>{s(),n.reject(`Signal not emitted within ${t} ms.`)}),t),n.promise}},7846:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,function(e){const t="𝐚".length>1;e.jsIndexToCharIndex=function(e,n){if(t)return e;let i=e;for(let t=0;t+1=55296&&e<=56319){const e=n.charCodeAt(t+1);e>=56320&&e<=57343&&(i--,t++)}}return i},e.charIndexToJsIndex=function(e,n){if(t)return e;let i=e;for(let e=0;e+1=55296&&t<=56319){const t=n.charCodeAt(e+1);t>=56320&&t<=57343&&(i++,e++)}}return i},e.camelCase=function(e,t=!1){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,i){return i?i.toUpperCase():t?n.toUpperCase():n.toLowerCase()}))},e.titleCase=function(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}}(t.Text||(t.Text={}))},2533:(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 i;(i=t.Time||(t.Time={})).formatHuman=function(e){const t=document.documentElement.lang||"en",i=new Intl.RelativeTimeFormat(t,{numeric:"auto"}),s=new Date(e).getTime()-Date.now();for(let e of n){const t=Math.ceil(s/e.milliseconds);if(0!==t)return i.format(t,e.name)}return i.format(0,"seconds")},i.format=function(e){const t=document.documentElement.lang||"en";return new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"}).format(new Date(e))}},7319:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.URLExt=void 0;const s=n(1023),r=i(n(4846));!function(e){function t(e){if("undefined"!=typeof document&&document){const t=document.createElement("a");return t.href=e,t}return(0,r.default)(e)}function n(...e){let t=(0,r.default)(e[0],{});const n=""===t.protocol&&t.slashes;n&&(t=(0,r.default)(e[0],"https:"+e[0]));const i=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`,o=s.posix.join(`${i&&"/"!==t.pathname[0]?"/":""}${t.pathname}`,...e.slice(1));return`${i}${"."===o?"":o}`}e.parse=t,e.getHostName=function(e){return(0,r.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,i]=t.split("=");return n.length>0&&(e[n]=decodeURIComponent(i||"")),e}),{})},e.isLocal=function(e){const{protocol:n}=t(e);return(!n||0!==e.toLowerCase().indexOf(n))&&0!==e.indexOf("/")}}(t.URLExt||(t.URLExt={}))},5182:(e,t,n)=>{"use strict";n.d(t,{HB:()=>c,Hv:()=>a,dC:()=>u,vJ:()=>l});var i=n(9622),s=n(3893),r=n.n(s),o=n(5082);const a=new o.Token("@jupyterlite/contents:IContents");var l,c;!function(e){e.JSON="application/json",e.PLAIN_TEXT="text/plain",e.OCTET_STREAM="octet/stream"}(l||(l={})),function(e){const t=JSON.parse(i.PageConfig.getOption("fileTypes")||"{}");e.getType=function(e,n=null){e=e.toLowerCase();for(const n of Object.values(t))for(const t of n.extensions||[])if(t===e&&n.mimeTypes&&n.mimeTypes.length)return n.mimeTypes[0];return r().getType(e)||n||l.OCTET_STREAM},e.hasFormat=function(e,n){e=e.toLowerCase();for(const i of Object.values(t))if(i.fileFormat===n)for(const t of i.extensions||[])if(t===e)return!0;return!1}}(c||(c={}));const u=new o.Token("@jupyterlite/contents:IBroadcastChannelWrapper")},9842:(e,t,n)=>{"use strict";n.d(t,{Ll:()=>s,qP:()=>o,vM:()=>r});var i=n(5082);const s=new i.Token("@jupyterlite/kernel:IKernels"),r="javascript",o=new i.Token("@jupyterlite/kernel:IKernelSpecs")},4957:(e,t,n)=>{"use strict";n.r(t),n.d(t,{KERNEL_SETTINGS_SCHEMA:()=>l,default:()=>h});var i=n(9622),s=n(4374),r=n(9842),o=n(5182);const a=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"https://jupyterlite-pyodide-kernel.readthedocs.org/en/latest/reference/schema/settings-v0.html#","title":"Pyodide Kernel Settings Schema v0","description":"Pyodide-specific configuration values. Will be defined in another location in the future.","type":"object","properties":{"pyodideUrl":{"description":"The path to the main pyodide.js entry point","type":"string","default":"https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js","format":"uri"},"disablePyPIFallback":{"description":"Disable the piplite behavior of falling back to https://pypi.org/pypi/","default":false,"type":"boolean"},"pipliteUrls":{"description":"Paths to PyPI-compatible API endpoints for wheels. If ending in ``all.json``, assumed to be an aggregate, keyed by package name, with relative paths","type":"array","items":{"type":"string"},"default":[],"format":"uri"}}}');var l=n.t(a,2),c=n(1173);const u=`data:image/svg+xml;base64,${btoa(n.n(c)())}`,d="@jupyterlite/pyodide-kernel-extension:kernel",h=[{id:d,autoStart:!0,requires:[r.qP],optional:[s.f,o.dC],activate:(e,t,s,r)=>{const o=JSON.parse(i.PageConfig.getOption("litePluginSettings")||"{}")[d]||{},a=o.pyodideUrl||"https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js",l=i.URLExt.parse(a).href,c=o.pipliteWheelUrl?i.URLExt.parse(o.pipliteWheelUrl).href:void 0,h=(o.pipliteUrls||[]).map((e=>i.URLExt.parse(e).href)),p=!!o.disablePyPIFallback;t.register({spec:{name:"python",display_name:"Python (Pyodide)",language:"python",argv:[],resources:{"logo-32x32":u,"logo-64x64":u}},create:async e=>{const{PyodideKernel:t}=await Promise.all([n.e(296),n.e(510)]).then(n.bind(n,144)),i=!(!(null==s?void 0:s.enabled)||!(null==r?void 0:r.enabled));return i?console.info("Pyodide contents will be synced with Jupyter Contents"):console.warn("Pyodide contents will NOT be synced with Jupyter Contents"),new t({...e,pyodideUrl:l,pipliteWheelUrl:c,pipliteUrls:h,disablePyPIFallback:p,mountDrive:i})}})}}]},9671:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Q});var i=n(9622),s=n(5182),r=n(5082);const o="JupyterLite Storage";class a{constructor(e){this.reduceBytesToString=(e,t)=>e+String.fromCharCode(t),this._serverContents=new Map,this._storageName=o,this._storageDrivers=null,this._localforage=e.localforage,this._storageName=e.storageName||o,this._storageDrivers=e.storageDrivers||null,this._ready=new r.PromiseDelegate}async initialize(){await this.initStorage(),this._ready.resolve(void 0)}async initStorage(){this._storage=this.createDefaultStorage(),this._counters=this.createDefaultCounters(),this._checkpoints=this.createDefaultCheckpoints()}get ready(){return this._ready.promise}get storage(){return this.ready.then((()=>this._storage))}get counters(){return this.ready.then((()=>this._counters))}get checkpoints(){return this.ready.then((()=>this._checkpoints))}get defaultStorageOptions(){const e=this._storageDrivers&&this._storageDrivers.length?this._storageDrivers:null;return{version:1,name:this._storageName,...e?{driver:e}:{}}}createDefaultStorage(){return this._localforage.createInstance({description:"Offline Storage for Notebooks and Files",storeName:"files",...this.defaultStorageOptions})}createDefaultCounters(){return this._localforage.createInstance({description:"Store the current file suffix counters",storeName:"counters",...this.defaultStorageOptions})}createDefaultCheckpoints(){return this._localforage.createInstance({description:"Offline Storage for Checkpoints",storeName:"checkpoints",...this.defaultStorageOptions})}async newUntitled(e){var t,n,r;const o=null!==(t=null==e?void 0:e.path)&&void 0!==t?t:"",a=null!==(n=null==e?void 0:e.type)&&void 0!==n?n:"notebook",c=(new Date).toISOString();let u=i.PathExt.dirname(o);const d=i.PathExt.basename(o),h=i.PathExt.extname(o),p=await this.get(u);let f,m="";switch(o&&!h&&p?(u=`${o}/`,m=""):u&&d?(u=`${u}/`,m=d):(u="",m=o),a){case"directory":m=`Untitled Folder${await this._incrementCounter("directory")||""}`,f={name:m,path:`${u}${m}`,last_modified:c,created:c,format:"json",mimetype:"",content:null,size:0,writable:!0,type:"directory"};break;case"notebook":{const e=await this._incrementCounter("notebook");m=m||`Untitled${e||""}.ipynb`,f={name:m,path:`${u}${m}`,last_modified:c,created:c,format:"json",mimetype:s.vJ.JSON,content:l.EMPTY_NB,size:JSON.stringify(l.EMPTY_NB).length,writable:!0,type:"notebook"};break}default:{const t=null!==(r=null==e?void 0:e.ext)&&void 0!==r?r:".txt",n=await this._incrementCounter("file"),i=s.HB.getType(t)||s.vJ.OCTET_STREAM;let o;o=s.HB.hasFormat(t,"text")||-1!==i.indexOf("text")?"text":-1!==t.indexOf("json")||-1!==t.indexOf("ipynb")?"json":"base64",m=m||`untitled${n||""}${t}`,f={name:m,path:`${u}${m}`,last_modified:c,created:c,format:o,mimetype:i,content:"",size:0,writable:!0,type:"file"};break}}const g=f.path;return await(await this.storage).setItem(g,f),f}async copy(e,t){let n=i.PathExt.basename(e);for(t=""===t?"":`${t.slice(1)}/`;await this.get(`${t}${n}`,{content:!0});){const e=i.PathExt.extname(n),t=n.replace(e,"");n=`${t} (copy)${e}`}const s=`${t}${n}`;let r=await this.get(e,{content:!0});if(!r)throw Error(`Could not find file with path ${e}`);return r={...r,name:n,path:s},await(await this.storage).setItem(s,r),r}async get(e,t){if(""===(e=decodeURIComponent(e.replace(/^\//,""))))return await this._getFolder(e);const n=await this.storage,r=await n.getItem(e),o=await this._getServerContents(e,t),a=r||o;if(!a)return null;if(!(null==t?void 0:t.content))return{size:0,...a,content:null};if("directory"===a.type){const t=new Map;await n.iterate(((n,i)=>{i===`${e}/${n.name}`&&t.set(n.name,n)}));const r=o?o.content:Array.from((await this._getServerDirectory(e)).values());for(const e of r)t.has(e.name)||t.set(e.name,e);const l=[...t.values()];return{name:i.PathExt.basename(e),path:e,last_modified:a.last_modified,created:a.created,format:"json",mimetype:s.vJ.JSON,content:l,size:0,writable:!0,type:"directory"}}return a}async rename(e,t){const n=decodeURIComponent(e),s=await this.get(n,{content:!0});if(!s)throw Error(`Could not find file with path ${n}`);const r=(new Date).toISOString(),o=i.PathExt.basename(t),a={...s,name:o,path:t,last_modified:r},l=await this.storage;if(await l.setItem(t,a),await l.removeItem(n),await(await this.checkpoints).removeItem(n),"directory"===s.type){let n;for(n of s.content)await this.rename(i.URLExt.join(e,n.name),i.URLExt.join(t,n.name))}return a}async save(e,t={}){var n;e=decodeURIComponent(e);const r=i.PathExt.extname(null!==(n=t.name)&&void 0!==n?n:""),o=t.chunk,a=!!o&&(o>1||-1===o);let l=await this.get(e,{content:a});if(l||(l=await this.newUntitled({path:e,ext:r,type:"file"})),!l)return null;const c=l.content,u=(new Date).toISOString();if(l={...l,...t,last_modified:u},t.content&&"base64"===t.format){const e=!o||-1===o;if(".ipynb"===r){const n=this._handleChunk(t.content,c,a);l={...l,content:e?JSON.parse(n):n,format:"json",type:"notebook",size:n.length}}else if(s.HB.hasFormat(r,"json")){const n=this._handleChunk(t.content,c,a);l={...l,content:e?JSON.parse(n):n,format:"json",type:"file",size:n.length}}else if(s.HB.hasFormat(r,"text")){const e=this._handleChunk(t.content,c,a);l={...l,content:e,format:"text",type:"file",size:e.length}}else{const e=t.content;l={...l,content:e,size:atob(e).length}}}return await(await this.storage).setItem(e,l),l}async delete(e){const t=`${e=decodeURIComponent(e)}/`,n=(await(await this.storage).keys()).filter((n=>n===e||n.startsWith(t)));await Promise.all(n.map(this.forgetPath,this))}async forgetPath(e){await Promise.all([(await this.storage).removeItem(e),(await this.checkpoints).removeItem(e)])}async createCheckpoint(e){var t;const n=await this.checkpoints;e=decodeURIComponent(e);const i=await this.get(e,{content:!0});if(!i)throw Error(`Could not find file with path ${e}`);const s=(null!==(t=await n.getItem(e))&&void 0!==t?t:[]).filter(Boolean);return s.push(i),s.length>5&&s.splice(0,s.length-5),await n.setItem(e,s),{id:""+(s.length-1),last_modified:i.last_modified}}async listCheckpoints(e){return(await(await this.checkpoints).getItem(e)||[]).filter(Boolean).map(this.normalizeCheckpoint,this)}normalizeCheckpoint(e,t){return{id:t.toString(),last_modified:e.last_modified}}async restoreCheckpoint(e,t){e=decodeURIComponent(e);const n=(await(await this.checkpoints).getItem(e)||[])[parseInt(t)];await(await this.storage).setItem(e,n)}async deleteCheckpoint(e,t){e=decodeURIComponent(e);const n=await(await this.checkpoints).getItem(e)||[],i=parseInt(t);n.splice(i,1),await(await this.checkpoints).setItem(e,n)}_handleChunk(e,t,n){const i=decodeURIComponent(escape(atob(e)));return n?t+i:i}async _getFolder(e){const t=new Map,n=await this.storage;await n.iterate(((e,n)=>{n.includes("/")||t.set(e.path,e)}));for(const n of(await this._getServerDirectory(e)).values())t.has(n.path)||t.set(n.path,n);return e&&0===t.size?null:{name:"",path:e,last_modified:new Date(0).toISOString(),created:new Date(0).toISOString(),format:"json",mimetype:s.vJ.JSON,content:Array.from(t.values()),size:0,writable:!0,type:"directory"}}async _getServerContents(e,t){const n=i.PathExt.basename(e);let r=(await this._getServerDirectory(i.URLExt.join(e,".."))).get(n);if(!r)return null;if(r=r||{name:n,path:e,last_modified:new Date(0).toISOString(),created:new Date(0).toISOString(),format:"text",mimetype:s.vJ.PLAIN_TEXT,type:"file",writable:!0,size:0,content:""},null==t?void 0:t.content)if("directory"===r.type){const t=await this._getServerDirectory(e);r={...r,content:Array.from(t.values())}}else{const t=i.URLExt.join(i.PageConfig.getBaseUrl(),"files",e),o=await fetch(t);if(!o.ok)return null;const a=r.mimetype||o.headers.get("Content-Type"),l=i.PathExt.extname(n);if("notebook"===r.type||s.HB.hasFormat(l,"json")||-1!==(null==a?void 0:a.indexOf("json"))||e.match(/\.(ipynb|[^/]*json[^/]*)$/)){const e=await o.text();r={...r,content:JSON.parse(e),format:"json",mimetype:r.mimetype||s.vJ.JSON,size:e.length}}else if(s.HB.hasFormat(l,"text")||-1!==a.indexOf("text")){const e=await o.text();r={...r,content:e,format:"text",mimetype:a||s.vJ.PLAIN_TEXT,size:e.length}}else{const e=await o.arrayBuffer(),t=new Uint8Array(e);r={...r,content:btoa(t.reduce(this.reduceBytesToString,"")),format:"base64",mimetype:a||s.vJ.OCTET_STREAM,size:t.length}}}return r}async _getServerDirectory(e){const t=this._serverContents.get(e)||new Map;if(!this._serverContents.has(e)){const n=i.URLExt.join(i.PageConfig.getBaseUrl(),"api/contents",e,"all.json");try{const e=await fetch(n),i=JSON.parse(await e.text());for(const e of i.content)t.set(e.name,e)}catch(e){console.warn(`don't worry, about ${e}... nothing's broken. If there had been a\n file at ${n}, you might see some more files.`)}this._serverContents.set(e,t)}return t}async _incrementCounter(e){var t;const n=await this.counters,i=(null!==(t=await n.getItem(e))&&void 0!==t?t:-1)+1;return await n.setItem(e,i),i}}var l;!function(e){e.EMPTY_NB={metadata:{orig_nbformat:4},nbformat_minor:4,nbformat:4,cells:[]}}(l||(l={}));const c=16895;new TextEncoder,new TextDecoder("utf-8");class u{constructor(e){this.isDisposed=!1,this._onMessage=async e=>{if(!this._channel)return;const{_contents:t}=this,n=e.data,s=null==n?void 0:n.path;if("broadcast.ts"!==(null==n?void 0:n.receiver))return;let r,o=null;switch(null==n?void 0:n.method){case"readdir":r=await t.get(s,{content:!0}),o=[],"directory"===r.type&&r.content&&(o=r.content.map((e=>e.name)));break;case"rmdir":await t.delete(s);break;case"rename":await t.rename(s,n.data.newPath);break;case"getmode":r=await t.get(s),o="directory"===r.type?c:33206;break;case"lookup":try{r=await t.get(s),o={ok:!0,mode:"directory"===r.type?c:33206}}catch(e){o={ok:!1}}break;case"mknod":r=await t.newUntitled({path:i.PathExt.dirname(s),type:Number.parseInt(n.data.mode)===c?"directory":"file",ext:i.PathExt.extname(s)}),await t.rename(r.path,s);break;case"getattr":{r=await t.get(s);const e=new Date(0).toISOString();o={dev:1,nlink:1,uid:0,gid:0,rdev:0,size:r.size||0,blksize:4096,blocks:Math.ceil(r.size||0),atime:r.last_modified||e,mtime:r.last_modified||e,ctime:r.created||e,timestamp:0};break}case"get":if(r=await t.get(s,{content:!0}),"directory"===r.type)break;o={content:"json"===r.format?JSON.stringify(r.content):r.content,format:r.format};break;case"put":await t.save(s,{content:"json"===n.data.format?JSON.parse(n.data.data):n.data.data,type:"file",format:n.data.format});break;default:o=null}this._channel.postMessage(o)},this._channel=null,this._enabled=!1,this._contents=e.contents}get enabled(){return this._enabled}enable(){this._channel?console.warn("BroadcastChannel already created and enabled"):(this._channel=new BroadcastChannel("/api/drive.v1"),this._channel.addEventListener("message",this._onMessage),this._enabled=!0)}disable(){this._channel&&(this._channel.removeEventListener("message",this._onMessage),this._channel=null),this._enabled=!1}dispose(){this.isDisposed||(this.disable(),this.isDisposed=!0)}}var d,h=n(9842),p=n(4016);class f{constructor(e={}){if(this._map=new Map,this._changed=new p.Signal(this),this._isDisposed=!1,this._itemCmp=e.itemCmp||d.itemCmp,e.values)for(const t in e.values)this._map.set(t,e.values[t])}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const n=this._map.get(e);if(void 0===t)throw Error("Cannot set an undefined value, use remove");const i=this._itemCmp;return void 0!==n&&i(n,t)||(this._map.set(e,t),this._changed.emit({type:n?"change":"add",key:e,oldValue:n,newValue:t})),n}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];return this._map.forEach(((t,n)=>{e.push(n)})),e}values(){const e=[];return this._map.forEach(((t,n)=>{e.push(t)})),e}delete(e){const t=this._map.get(e);return this._map.delete(e)&&this._changed.emit({type:"remove",key:e,oldValue:t,newValue:void 0}),t}clear(){const e=this.keys();for(let t=0;tthis._queue.push({resolve:e,reject:t})));return e||this._dispatch(),t}runExclusive(e){return y(this,void 0,void 0,(function*(){const[t,n]=yield this.acquire();try{return yield e(t)}finally{n()}}))}waitForUnlock(){return y(this,void 0,void 0,(function*(){return this.isLocked()?new Promise((e=>this._waiters.push({resolve:e}))):Promise.resolve()}))}isLocked(){return this._value<=0}release(){if(this._maxConcurrency>1)throw new Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){const e=this._currentReleaser;this._currentReleaser=void 0,e()}}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatch(){const e=this._queue.shift();if(!e)return;let t=!1;this._currentReleaser=()=>{t||(t=!0,this._value++,this._resolveWaiters(),this._dispatch())},e.resolve([this._value--,this._currentReleaser])}_resolveWaiters(){this._waiters.forEach((e=>e.resolve())),this._waiters=[]}}class w{constructor(e){this._semaphore=new b(1,e)}acquire(){return e=this,t=void 0,i=function*(){const[,e]=yield this._semaphore.acquire();return e},new((n=void 0)||(n=Promise))((function(s,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}));var e,t,n,i}runExclusive(e){return this._semaphore.runExclusive((()=>e()))}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const D=g.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg;class x{constructor(e){this._kernels=new f,this._clients=new f,this._kernelClients=new f;const{kernelspecs:t}=e;this._kernelspecs=t}async startNew(e){const{id:t,name:n,location:i}=e,s=this._kernelspecs.factories.get(n);if(!s)return{id:t,name:n};const o=new w,a=(e,t,n)=>{var i;const s=this._kernels.get(e);if(!s)throw Error(`No kernel ${e}`);this._clients.set(t,n),null===(i=this._kernelClients.get(e))||void 0===i||i.add(t),n.on("message",(async e=>{let t;if(e instanceof ArrayBuffer)e=new Uint8Array(e).buffer,t=(0,m.deserialize)(e,D);else{if("string"!=typeof e)return;{const n=(new TextEncoder).encode(e);t=(0,m.deserialize)(n.buffer,D)}}"input_reply"===t.header.msg_type?s.handleMessage(t):(async e=>{await o.runExclusive((async()=>{await s.ready,await s.handleMessage(e)}))})(t)}));const r=()=>{var n;this._clients.delete(t),null===(n=this._kernelClients.get(e))||void 0===n||n.delete(t)};s.disposed.connect(r),n.onclose=r},l=null!=t?t:r.UUID.uuid4(),c=`${x.WS_BASE_URL}api/kernels/${l}/channels`,u=this._kernels.get(l);if(u)return{id:u.id,name:u.name};const d=await s({id:l,sendMessage:e=>{const t=e.header.session,n=this._clients.get(t);if(!n)return void console.warn(`Trying to send message on removed socket for kernel ${l}`);const i=(0,m.serialize)(e,D);if("iopub"!==e.channel)n.send(i);else{const e=this._kernelClients.get(l);null==e||e.forEach((e=>{var t;null===(t=this._clients.get(e))||void 0===t||t.send(i)}))}},name:n,location:i});this._kernels.set(l,d),this._kernelClients.set(l,new Set);const h=new v.Server(c,{mock:!1,selectProtocol:()=>D});return h.on("connection",(e=>{var t;const n=null!==(t=new URL(e.url).searchParams.get("session_id"))&&void 0!==t?t:"";a(l,n,e)})),h.on("close",(()=>{this._clients.keys().forEach((e=>{var t;const n=this._clients.get(e);(null==n?void 0:n.readyState)===WebSocket.CLOSED&&(this._clients.delete(e),null===(t=this._kernelClients.get(l))||void 0===t||t.delete(e))}))})),d.disposed.connect((()=>{h.close(),this._kernels.delete(l),this._kernelClients.delete(l)})),{id:d.id,name:d.name}}async restart(e){const t=this._kernels.get(e);if(!t)throw Error(`Kernel ${e} does not exist`);const{id:n,name:i,location:s}=t;return t.dispose(),this.startNew({id:n,name:i,location:s})}async list(){return[...this._kernels.values()].map((e=>({id:e.id,name:e.name})))}async shutdown(e){var t;null===(t=this._kernels.delete(e))||void 0===t||t.dispose()}async get(e){return this._kernels.get(e)}}!function(e){e.WS_BASE_URL=i.PageConfig.getBaseUrl().replace(/^http/,"ws")}(x||(x={}));class C{constructor(){this._specs=new Map,this._factories=new Map}get specs(){return 0===this._specs.size?null:{default:this.defaultKernelName,kernelspecs:Object.fromEntries(this._specs)}}get defaultKernelName(){let e=i.PageConfig.getOption("defaultKernelName");if(!e&&this._specs.size){const t=Array.from(this._specs.keys());t.sort(),e=t[0]}return e||h.vM}get factories(){return this._factories}register(e){const{spec:t,create:n}=e;this._specs.set(t.name,t),this._factories.set(t.name,n)}}const E="third-party-licenses.json",S=new r.Token("@jupyterlite/licenses:ILicenses"),A=Object.freeze({packages:[]});class k{async get(){return{bundles:{...await this._getFederated(),[this.appName]:await this._getAppLicenses()}}}get appName(){return i.PageConfig.getOption("appName")||"JupyterLite"}get appLicensesUrl(){return i.URLExt.join(i.PageConfig.getBaseUrl(),"build",E)}get labExtensionsUrl(){return i.PageConfig.getOption("fullLabextensionsUrl")}async _getAppLicenses(){let e=A;try{e=(await fetch(this.appLicensesUrl)).json()}catch(e){console.warn("Could not resolve licenses for",this.appName)}return e}async _getFederated(){const e={};let t;try{t=JSON.parse(i.PageConfig.getOption("federated_extensions"))}catch{return e}const n=[];for(const i of t)n.push(this._getOneFederated(i,e));try{await Promise.all(n)}catch(e){console.warn("Error resolving licenses",e)}return e}async _getOneFederated(e,t){try{const n=i.URLExt.join(this.labExtensionsUrl,e.name,"static",E),s=await fetch(n);t[e.name]=await s.json()}catch{console.warn("Could not resolve licenses for",e),t[e.name]=A}}}var M=n(4374),F=n(3570);const I=new r.Token("@jupyterlite/session:ISessions");var O=n(5259);class P{constructor(e){this._sessions=[],this._kernels=e.kernels}async get(e){const t=this._sessions.find((t=>t.id===e));if(!t)throw Error(`Session ${e} not found`);return t}async list(){return this._sessions}async patch(e){const{id:t,path:n,name:s,kernel:o}=e,a=this._sessions.findIndex((e=>e.id===t)),l=this._sessions[a];if(!l)throw Error(`Session ${t} not found`);const c={...l,path:null!=n?n:l.path,name:null!=s?s:l.name};if(o)if(o.id){const e=this._sessions.find((e=>{var t;return(null===(t=e.kernel)||void 0===t?void 0:t.id)===(null==o?void 0:o.id)}));e&&(c.kernel=e.kernel)}else if(o.name){const e=await this._kernels.startNew({id:r.UUID.uuid4(),name:o.name,location:i.PathExt.dirname(c.path)});e&&(c.kernel=e),this._handleKernelShutdown({kernelId:e.id,sessionId:l.id})}return this._sessions[a]=c,c}async startNew(e){var t,n,s,o;const{path:a,name:l}=e,c=this._sessions.find((e=>e.name===l));if(c)return c;const u=null!==(n=null===(t=e.kernel)||void 0===t?void 0:t.name)&&void 0!==n?n:"",d=null!==(s=e.id)&&void 0!==s?s:r.UUID.uuid4(),h=null!==(o=e.name)&&void 0!==o?o:e.path,p=i.PathExt.dirname(e.name)||i.PathExt.dirname(e.path),f=h.includes(":")?h.split(":")[0]:"",m=p.includes(f)?p:`${f}:${p}`,g=await this._kernels.startNew({id:d,name:u,location:m}),v={id:d,path:a,name:null!=l?l:a,type:"notebook",kernel:{id:g.id,name:g.name}};return this._sessions.push(v),this._handleKernelShutdown({kernelId:d,sessionId:v.id}),v}async shutdown(e){var t;const n=this._sessions.find((t=>t.id===e));if(!n)throw Error(`Session ${e} not found`);const i=null===(t=n.kernel)||void 0===t?void 0:t.id;i&&await this._kernels.shutdown(i),O.RO.removeFirstOf(this._sessions,n)}async _handleKernelShutdown({kernelId:e,sessionId:t}){const n=await this._kernels.get(e);n&&n.disposed.connect((()=>{this.shutdown(t)}))}}const B=new r.Token("@jupyterlite/settings:ISettings");var R=n(6111);const T="JupyterLite Storage";class L{constructor(e){this._storageName=T,this._storageDrivers=null,this._localforage=e.localforage,this._storageName=e.storageName||T,this._storageDrivers=e.storageDrivers||null,this._ready=new r.PromiseDelegate}get ready(){return this._ready.promise}get storage(){return this.ready.then((()=>this._storage))}async initialize(){await this.initStorage(),this._ready.resolve(void 0)}async initStorage(){this._storage=this.defaultSettingsStorage()}get defaultStorageOptions(){var e;const t=(null===(e=this._storageDrivers)||void 0===e?void 0:e.length)?this._storageDrivers:null;return{version:1,name:this._storageName,...t?{driver:t}:{}}}defaultSettingsStorage(){return this._localforage.createInstance({description:"Offline Storage for Settings",storeName:"settings",...this.defaultStorageOptions})}async get(e){return(await this.getAll()).settings.find((t=>t.id===e))}async getAll(){const[e,t]=await Promise.all([this._getAll("all.json"),this._getAll("all_federated.json")]),n=e.concat(t),i=await this.storage;return{settings:await Promise.all(n.map((async e=>{var t;const{id:n}=e,s=null!==(t=await i.getItem(n))&&void 0!==t?t:e.raw;return{...j.override(e),raw:s,settings:R.parse(s)}})))}}async save(e,t){await(await this.storage).setItem(e,t)}async _getAll(e){var t;const n=null!==(t=i.PageConfig.getOption("settingsUrl"))&&void 0!==t?t:"/";return await(await fetch(i.URLExt.join(n,e))).json()}}var j;!function(e){const t=JSON.parse(i.PageConfig.getOption("settingsOverrides")||"{}");e.override=function(e){if(t[e.id]){e.schema.properties||(e.schema.properties={});for(const[n,i]of Object.entries(t[e.id]||{}))e.schema.properties[n].default=i}return e}}(j||(j={}));const N=new r.Token("@jupyterlite/translation:ITranslation");class z{constructor(){this._prevLocale=""}async get(e){const t=i.URLExt.join(i.PageConfig.getBaseUrl(),`api/translations/${e}.json`);try{const n=await fetch(t),i=JSON.parse(await n.text());if("all"!==this._prevLocale&&"all"===e){const e=this._prevLocale;i.data[e].displayName=i.data[e].nativeName,"en"!==e&&(i.data.en.displayName=`${i.data.en.nativeName} (default)`)}return this._prevLocale=e,i}catch(t){return e?{data:{},message:`Language pack '${e}' not installed!`}:{data:{en:{displayName:"English",nativeName:"English"}},message:""}}}}const U=new r.Token("@jupyterlite/localforge:ILocalForage");var q=n(1976),W=n.n(q),H=n(5486),K=n.n(H);const $={id:"@jupyterlite/server-extension:localforage",autoStart:!0,provides:U,activate:e=>({localforage:K()})},V={id:"@jupyterlite/server-extension:localforage-memory-storage",autoStart:!0,requires:[U],activate:async(e,t)=>{JSON.parse(i.PageConfig.getOption("enableMemoryStorage")||"false")&&(console.warn("Memory storage fallback enabled: contents and settings may not be saved"),await async function(e){return await e.defineDriver(W())}(t.localforage))}},J={id:"@jupyterlite/server-extension:contents",requires:[U],autoStart:!0,provides:s.Hv,activate:(e,t)=>{const n=i.PageConfig.getOption("contentsStorageName"),s=JSON.parse(i.PageConfig.getOption("contentsStorageDrivers")||"null"),{localforage:r}=t,o=new a({storageName:n,storageDrivers:s,localforage:r});return e.started.then((()=>o.initialize().catch(console.warn))),o}},G={id:"@jupyterlite/server-extension:contents-routes",autoStart:!0,requires:[s.Hv],activate:(e,t)=>{e.router.get("/api/contents/(.+)/checkpoints",(async(e,n)=>{const i=await t.listCheckpoints(n);return new Response(JSON.stringify(i))})),e.router.post("/api/contents/(.+)/checkpoints/(.*)",(async(e,n,i)=>{const s=await t.restoreCheckpoint(n,i);return new Response(JSON.stringify(s),{status:204})})),e.router.post("/api/contents/(.+)/checkpoints",(async(e,n)=>{const i=await t.createCheckpoint(n);return new Response(JSON.stringify(i),{status:201})})),e.router.delete("/api/contents/(.+)/checkpoints/(.*)",(async(e,n,i)=>{const s=await t.deleteCheckpoint(n,i);return new Response(JSON.stringify(s),{status:204})})),e.router.get("/api/contents(.*)",(async(e,n)=>{var i;const s={content:"1"===(null===(i=e.query)||void 0===i?void 0:i.content)},r=await t.get(n,s);return r?new Response(JSON.stringify(r)):new Response(null,{status:404})})),e.router.post("/api/contents(.*)",(async(e,n)=>{const i=e.body,s=null==i?void 0:i.copy_from;let r;return r=s?await t.copy(s,n):await t.newUntitled(i),r?new Response(JSON.stringify(r),{status:201}):new Response(null,{status:400})})),e.router.patch("/api/contents(.*)",(async(e,n)=>{var i,s;const r=null!==(s=null===(i=e.body)||void 0===i?void 0:i.path)&&void 0!==s?s:"";n="/"===n[0]?n.slice(1):n;const o=await t.rename(n,r);return new Response(JSON.stringify(o))})),e.router.put("/api/contents/(.+)",(async(e,n)=>{const i=e.body,s=await t.save(n,i);return new Response(JSON.stringify(s))})),e.router.delete("/api/contents/(.+)",(async(e,n)=>(await t.delete(n),new Response(null,{status:204}))))}},Y={id:"@jupyterlite/server-extension:service-worker",autoStart:!0,provides:M.f,activate:e=>new F.Z},X={id:"@jupyterlite/server-extension:settings",autoStart:!0,requires:[U],provides:B,activate:(e,t)=>{const n=i.PageConfig.getOption("settingsStorageName"),s=JSON.parse(i.PageConfig.getOption("settingsStorageDrivers")||"null"),{localforage:r}=t,o=new L({storageName:n,storageDrivers:s,localforage:r});return e.started.then((()=>o.initialize().catch(console.warn))),o}},Z={id:"@jupyterlite/server-extension:settings-routes",autoStart:!0,requires:[B],activate:(e,t)=>{const n="/api/settings/((?:@([^/]+?)[/])?([^/]+?):([^:]+))$";e.router.get(n,(async(e,n)=>{const i=await t.get(n);return new Response(JSON.stringify(i))})),e.router.put(n,(async(e,n)=>{const i=e.body,{raw:s}=i;return await t.save(n,s),new Response(null,{status:204})})),e.router.get("/api/settings",(async e=>{const n=await t.getAll();return new Response(JSON.stringify(n))}))}},Q=[J,G,{id:"@jupyterlite/server-extension:emscripten-filesystem",autoStart:!0,optional:[M.f],provides:s.dC,activate:(e,t)=>{const{contents:n}=e.serviceManager,i=new u({contents:n}),s="Kernel filesystem and JupyterLite contents";function r(e,t){t&&console.warn(t),e&&console.warn(e),t||e?console.warn(`${s} will NOT be synced`):console.info(`${s} will be synced`)}return t?t.ready.then((()=>{i.enable(),r()})).catch((e=>{r("JupyterLite ServiceWorker failed to become available",e)})):r("JupyterLite ServiceWorker not available"),i}},{id:"@jupyterlite/server-extension:kernels",autoStart:!0,provides:h.Ll,requires:[h.qP],activate:(e,t)=>new x({kernelspecs:t})},{id:"@jupyterlite/server-extension:kernels-routes",autoStart:!0,requires:[h.Ll],activate:(e,t)=>{e.router.get("/api/kernels",(async e=>{const n=await t.list();return new Response(JSON.stringify(n))})),e.router.post("/api/kernels/(.*)/restart",(async(e,n)=>{const i=await t.restart(n);return new Response(JSON.stringify(i))})),e.router.delete("/api/kernels/(.*)",(async(e,n)=>{const i=await t.shutdown(n);return new Response(JSON.stringify(i),{status:204})}))}},{id:"@jupyterlite/server-extension:kernelspec",autoStart:!0,provides:h.qP,activate:e=>new C},{id:"@jupyterlite/server-extension:kernelspec-routes",autoStart:!0,requires:[h.qP],activate:(e,t)=>{e.router.get("/api/kernelspecs",(async e=>{const{specs:n}=t;if(!n)return new Response(null);const i={},s=n.kernelspecs;Object.keys(s).forEach((e=>{const t=s[e],{resources:n}=null!=t?t:{};i[e]={name:e,spec:t,resources:n}}));const r={default:n.default,kernelspecs:i};return new Response(JSON.stringify(r))}))}},{id:"@jupyterlite/server-extension:licenses",autoStart:!0,provides:S,activate:e=>new k},{id:"@jupyterlite/server-extension:licenses-routes",autoStart:!0,requires:[S],activate(e,t){e.router.get("/api/licenses",(async e=>{const n=await t.get();return new Response(JSON.stringify(n))}))}},V,$,{id:"@jupyterlite/server-extension:lsp-routes",autoStart:!0,activate:e=>{e.router.get("/lsp/status",(async e=>new Response(JSON.stringify({version:2,sessions:{},specs:{}}))))}},{id:"@jupyterlite/server-extension:nbconvert-routes",autoStart:!0,activate:e=>{e.router.get("/api/nbconvert",(async e=>new Response(JSON.stringify({}))))}},Y,{id:"@jupyterlite/server-extension:sessions",autoStart:!0,provides:I,requires:[h.Ll],activate:(e,t)=>new P({kernels:t})},{id:"@jupyterlite/server-extension:sessions-routes",autoStart:!0,requires:[I],activate:(e,t)=>{e.router.get("/api/sessions/(.+)",(async(e,n)=>{const i=await t.get(n);return new Response(JSON.stringify(i),{status:200})})),e.router.get("/api/sessions",(async e=>{const n=await t.list();return new Response(JSON.stringify(n),{status:200})})),e.router.patch("/api/sessions(.*)",(async(e,n)=>{const i=e.body,s=await t.patch(i);return new Response(JSON.stringify(s),{status:200})})),e.router.delete("/api/sessions/(.+)",(async(e,n)=>(await t.shutdown(n),new Response(null,{status:204})))),e.router.post("/api/sessions",(async e=>{const n=e.body,i=await t.startNew(n);return new Response(JSON.stringify(i),{status:201})}))}},X,Z,{id:"@jupyterlite/server-extension:translation",autoStart:!0,provides:N,activate:e=>{const t=new z;return e.router.get("/api/translations/?(.*)",(async(e,n)=>{"default"===n&&(n="en");const i=await t.get(n||"all");return new Response(JSON.stringify(i))})),t}},{id:"@jupyterlite/server-extension:translation-routes",autoStart:!0,requires:[N],activate:(e,t)=>{e.router.get("/api/translations/?(.*)",(async(e,n)=>{const i=await t.get(n||"all");return new Response(JSON.stringify(i))}))}}]},3800:(e,t,n)=>{"use strict";n.r(t),n.d(t,{IServiceWorkerManager:()=>ct.f,JupyterLiteServer:()=>lt,Router:()=>ot,ServiceWorkerManager:()=>ut.Z,WORKER_NAME:()=>ct.o});var i,s,r,o,a,l,c,u=n(6914),d=n(5259),h=n(5082),p=n(4016);class f{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class m{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((e=>{e.dispose()})),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(m||(m={}));class g extends m{constructor(){super(...arguments),this._disposed=new p.Signal(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),p.Signal.clearData(this))}}function v(){return b.keyboardLayout}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(g||(g={})),function(e){e.copyText=function(e){const t=document.body,n=i=>{i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")}}(i||(i={})),(c=s||(s={})).boxSizing=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,i=parseFloat(t.borderLeftWidth)||0,s=parseFloat(t.borderRightWidth)||0,r=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,c=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:s,borderBottom:r,paddingTop:o,paddingLeft:a,paddingRight:l,paddingBottom:c,horizontalSum:i+a+l+s,verticalSum:n+o+c+r}},c.sizeLimits=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,i=parseFloat(t.minHeight)||0,s=parseFloat(t.maxWidth)||1/0,r=parseFloat(t.maxHeight)||1/0;return s=Math.max(n,s),r=Math.max(i,r),{minWidth:n,minHeight:i,maxWidth:s,maxHeight:r}},c.hitTest=function(e,t,n){let i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&n=n.bottom||(i.topn.bottom&&i.height>=n.height?e.scrollTop-=n.top-i.top:(i.topn.height||i.bottom>n.bottom&&i.height{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this,n=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return-1!==Array.prototype.indexOf.call(n,t)}})(),e.calculateSingle=function(e){let c=0,u=0,d=0;function h(t){let n=e.match(t);return null!==n&&(e=e.slice(n[0].length),!0)}for(e=(e=e.split(",",1)[0]).replace(l," $1 ");e.length>0;)if(h(t))c++;else if(h(n))u++;else if(h(i))u++;else if(h(r))d++;else if(h(o))u++;else if(h(s))d++;else if(!h(a))return 0;return c=Math.min(c,255),u=Math.min(u,255),d=Math.min(d,255),c<<16|u<<8|d};const t=/^#[^\s\+>~#\.\[:]+/,n=/^\.[^\s\+>~#\.\[:]+/,i=/^\[[^\]]+\]/,s=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,a=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(a||(a={}));class _{constructor(e,t,n=[]){this.name=e,this._codes=t,this._keys=_.extractKeys(t),this._modifierKeys=_.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}!function(e){e.extractKeys=function(e){let t=Object.create(null);for(let n in e)t[e[n]]=!0;return t},e.convertToKeySet=function(e){let t=Object(null);for(let n=0,i=e.length;n{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})}))}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=h.JSONExt.emptyObject){var n;let i=this._commands.get(e);return Promise.resolve(null!==(n=null==i?void 0:i.describedBy.call(void 0,t))&&void 0!==n?n:{args:null})}label(e,t=h.JSONExt.emptyObject){var n;let i=this._commands.get(e);return null!==(n=null==i?void 0:i.label.call(void 0,t))&&void 0!==n?n:""}mnemonic(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.mnemonic.call(void 0,t):-1}icon(e,t=h.JSONExt.emptyObject){var n;return null===(n=this._commands.get(e))||void 0===n?void 0:n.icon.call(void 0,t)}iconClass(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconClass.call(void 0,t):""}iconLabel(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconLabel.call(void 0,t):""}caption(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.caption.call(void 0,t):""}usage(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.usage.call(void 0,t):""}className(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.className.call(void 0,t):""}dataset(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.dataset.call(void 0,t):{}}isEnabled(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isEnabled.call(void 0,t)}isToggled(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggled.call(void 0,t)}isToggleable(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggleable}isVisible(e,t=h.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isVisible.call(void 0,t)}execute(e,t=h.JSONExt.emptyObject){let n,i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));try{n=i.execute.call(void 0,t)}catch(e){n=Promise.reject(e)}let s=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:s}),s}addKeyBinding(e){let t=w.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new f((()=>{d.RO.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})}))}processKeydownEvent(e){if(this._replaying||E.isModifierKeyPressed(e))return;let t=E.keystrokeForKeydownEvent(e);if(!t)return this._replayKeydownEvents(),void this._clearPendingState();this._keystrokes.push(t);let{exact:n,partial:i}=w.matchKeyBinding(this._keyBindings,this._keystrokes,e);return n||i?(e.preventDefault(),e.stopPropagation(),n&&!i?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),this._keydownEvents.push(e),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),w.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(w.replayKeyEvent),this._replaying=!1)}_executeKeyBinding(e){let{command:t,args:n}=e,i={_luminoEvent:{type:"keybinding",keys:e.keys},...n};if(this.hasCommand(t)&&this.isEnabled(t,i))this.execute(t,i);else{let n=this.hasCommand(t)?"enabled":"registered",i=`Cannot execute key binding '${e.keys.join(", ")}':`,s=`command '${t}' is not ${n}.`;console.warn(`${i} ${s}`)}}_clearPendingState(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}function*S(){}function A(e,t){let n=0;for(const i of e)if(t(i,n++))return i}!function(e){function t(e){let t="",n=!1,i=!1,s=!1,o=!1;for(let a of e.split(/\s+/))"Accel"===a?r.IS_MAC?i=!0:s=!0:"Alt"===a?n=!0:"Cmd"===a?i=!0:"Ctrl"===a?s=!0:"Shift"===a?o=!0:a.length>0&&(t=a);return{cmd:i,ctrl:s,alt:n,shift:o,key:t}}function n(e){let n="",i=t(e);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&r.IS_MAC&&(n+="Cmd "),n+i.key}e.parseKeystroke=t,e.normalizeKeystroke=n,e.normalizeKeys=function(e){let t;return t=r.IS_WIN?e.winKeys||e.keys:r.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys,t.map(n)},e.formatKeystroke=function(e){return"string"==typeof e?n(e):e.map(n).join(", ");function n(e){let n=[],i=r.IS_MAC?" ":"+",s=t(e);return s.ctrl&&n.push("Ctrl"),s.alt&&n.push("Alt"),s.shift&&n.push("Shift"),r.IS_MAC&&s.cmd&&n.push("Cmd"),n.push(s.key),n.map(w.formatKey).join(i)}},e.isModifierKeyPressed=function(e){let t=v(),n=t.keyForKeydownEvent(e);return t.isModifierKey(n)},e.keystrokeForKeydownEvent=function(e){let t=v(),n=t.keyForKeydownEvent(e);if(!n||t.isModifierKey(n))return"";let i=[];return e.ctrlKey&&i.push("Ctrl"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),e.metaKey&&r.IS_MAC&&i.push("Cmd"),i.push(n),i.join(" ")}}(E||(E={})),function(e){e.CHORD_TIMEOUT=1e3,e.createCommand=function(e){return{execute:e.execute,describedBy:d("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},(()=>({args:null}))),label:d(e.label,i),mnemonic:d(e.mnemonic,s),icon:d(e.icon,u),iconClass:d(e.iconClass,i),iconLabel:d(e.iconLabel,i),caption:d(e.caption,i),usage:d(e.usage,i),className:d(e.className,i),dataset:d(e.dataset,c),isEnabled:e.isEnabled||a,isToggled:e.isToggled||l,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||a}},e.createKeyBinding=function(e){return{keys:E.normalizeKeys(e),selector:p(e),command:e.command,args:e.args||h.JSONExt.emptyObject}},e.matchKeyBinding=function(e,t,n){let i=null,s=!1,r=1/0,a=0;for(let l=0,c=e.length;lr)continue;let h=o.calculateSpecificity(c.selector);(!i||d=a)&&(i=c,r=d,a=h)}return{exact:i,partial:s}},e.replayKeyEvent=function(e){e.target.dispatchEvent(function(e){let t=document.createEvent("Event"),n=e.bubbles||!0,i=e.cancelable||!0;return t.initEvent(e.type||"keydown",n,i),t.key=e.key||"",t.keyCode=e.keyCode||0,t.which=e.keyCode||0,t.ctrlKey=e.ctrlKey||!1,t.altKey=e.altKey||!1,t.shiftKey=e.shiftKey||!1,t.metaKey=e.metaKey||!1,t.view=e.view||window,t}(e))},e.formatKey=function(e){return r.IS_MAC?t.hasOwnProperty(e)?t[e]:e:n.hasOwnProperty(e)?n[e]:e};const t={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},n={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},i=()=>"",s=()=>-1,a=()=>!0,l=()=>!1,c=()=>({}),u=()=>{};function d(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function p(e){if(-1!==e.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${e.selector}`);if(!o.isValid(e.selector))throw new Error(`Invalid selector: ${e.selector}`);return e.selector}function f(e,t){if(e.lengtht.length?2:1}function m(e,t){let n=t.target,i=t.currentTarget;for(let t=0;null!==n;n=n.parentElement,++t){if(n.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(o.matches(n,e))return t;if(n===i)return-1}return-1}}(w||(w={})),function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(D||(D={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(C||(C={}));var k,M,F,I,O,P,B,R,T,L,j,N=n(8743);!function(e){e.copyText=function(e){const t=document.body,n=i=>{i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",e),t.removeEventListener("copy",n,!0)};t.addEventListener("copy",n,!0),document.execCommand("copy")}}(k||(k={})),function(e){e.boxSizing=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.borderTopWidth)||0,i=parseFloat(t.borderLeftWidth)||0,s=parseFloat(t.borderRightWidth)||0,r=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,c=parseFloat(t.paddingBottom)||0;return{borderTop:n,borderLeft:i,borderRight:s,borderBottom:r,paddingTop:o,paddingLeft:a,paddingRight:l,paddingBottom:c,horizontalSum:i+a+l+s,verticalSum:n+o+c+r}},e.sizeLimits=function(e){let t=window.getComputedStyle(e),n=parseFloat(t.minWidth)||0,i=parseFloat(t.minHeight)||0,s=parseFloat(t.maxWidth)||1/0,r=parseFloat(t.maxHeight)||1/0;return s=Math.max(n,s),r=Math.max(i,r),{minWidth:n,minHeight:i,maxWidth:s,maxHeight:r}},e.hitTest=function(e,t,n){let i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&n=n.bottom||(i.topn.bottom&&i.height>=n.height?e.scrollTop-=n.top-i.top:(i.topn.height||i.bottom>n.bottom&&i.height{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this,n=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return-1!==Array.prototype.indexOf.call(n,t)}})(),e.calculateSingle=function(e){let c=0,u=0,d=0;function h(t){let n=e.match(t);return null!==n&&(e=e.slice(n[0].length),!0)}for(e=(e=e.split(",",1)[0]).replace(l," $1 ");e.length>0;)if(h(t))c++;else if(h(n))u++;else if(h(i))u++;else if(h(r))d++;else if(h(o))u++;else if(h(s))d++;else if(!h(a))return 0;return c=Math.min(c,255),u=Math.min(u,255),d=Math.min(d,255),c<<16|u<<8|d};const t=/^#[^\s\+>~#\.\[:]+/,n=/^\.[^\s\+>~#\.\[:]+/,i=/^\[[^\]]+\]/,s=/^[^\s\+>~#\.\[:]+/,r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,o=/^:[^\s\+>~#\.\[:]+/,a=/^[\s\+>~\*]+/,l=/:not\(([^\)]+)\)/g}(O||(O={}));class z{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(const t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new P.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new P.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof P.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new P.LinkedListNode(this,e),i=t,s=i.prev;return n.next=i,n.prev=s,i.prev=n,s.next=n,this._size++,n}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof P.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new P.LinkedListNode(this,e),i=t,s=i.next;return n.next=s,n.prev=i,i.next=n,s.prev=n,this._size++,n}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof P.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}}!function(e){e.from=function(t){let n=new e;return n.assign(t),n}}(z||(z={})),function(e){e.LinkedListNode=class{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}}}(P||(P={}));class U{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}}class q extends U{get isConflatable(){return!0}conflate(e){return!0}}!function(e){let t=null;const n=(i=Promise.resolve(),e=>{let t=!1;return i.then((()=>!t&&e())),()=>{t=!0}});var i;function s(e,t){let n=o.get(e);if(!n||0===n.length)return void u(e,t);let i=function(e,t){let n=0;for(const i of e)if(!1===t(i,n++))return!1;return!0}(function*(e){if("function"==typeof e.retro)yield*e.retro();else for(let t=e.length-1;t>-1;t--)yield e[t]}(n),(n=>!n||function(e,t,n){let i=!0;try{i="function"==typeof e?e(t,n):e.messageHook(t,n)}catch(e){l(e)}return i}(n,e,t)));i&&u(e,t)}e.sendMessage=s,e.postMessage=function(e,t){t.isConflatable&&function(n,i){for(const i of n)if((s=i).handler===e&&s.msg&&s.msg.type===t.type&&s.msg.isConflatable&&s.msg.conflate(t))return!0;var s;return!1}(r)||d(e,t)},e.installMessageHook=function(e,t){let n=o.get(e);n&&-1!==n.indexOf(t)||(n?n.push(t):o.set(e,[t]))},e.removeMessageHook=function(e,t){let n=o.get(e);if(!n)return;let i=n.indexOf(t);-1!==i&&(n[i]=null,p(n))},e.clearData=function(e){let t=o.get(e);t&&t.length>0&&(D.fill(t,null),p(t));for(const t of r)t.handler===e&&(t.handler=null,t.msg=null)},e.flush=function(){c||null===t||(t(),t=null,c=!0,h(),c=!1)},e.getExceptionHandler=function(){return l},e.setExceptionHandler=function(e){let t=l;return l=e,t};const r=new z,o=new WeakMap,a=new Set;let l=e=>{console.error(e)},c=!1;function u(e,t){try{e.processMessage(t)}catch(e){l(e)}}function d(e,i){r.addLast({handler:e,msg:i}),null===t&&(t=n(h))}function h(){if(t=null,r.isEmpty)return;let e={handler:null,msg:null};for(r.addLast(e);;){let t=r.removeFirst();if(t===e)return;t.handler&&t.msg&&s(t.handler,t.msg)}}function p(e){0===a.size&&n(f),a.add(e)}function f(){a.forEach(m),a.clear()}function m(e){D.removeAllWhere(e,g)}function g(e){return null===e}}(B||(B={}));class W{constructor(e){this._pid=R.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t,n=R.ensureMap(e);return t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e),t}set(e,t){let n,i=R.ensureMap(e);n=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e);let s=this._coerceValue(e,t);this._maybeNotify(e,n,i[this._pid]=s)}coerce(e){let t,n=R.ensureMap(e);t=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(e);let i=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=i)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){let n=this._coerce;return n?n(e,t):t}_compareValue(e,t){let n=this._compare;return n?n(e,t):e===t}_maybeNotify(e,t,n){let i=this._changed;i&&!this._compareValue(t,n)&&i(e,t,n)}}!function(e){e.clearData=function(e){R.ownerData.delete(e)}}(W||(W={})),function(e){e.ownerData=new WeakMap,e.nextPID=(()=>{let e=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${e++}`})(),e.ensureMap=function(t){let n=e.ownerData.get(t);return n||(n=Object.create(null),e.ownerData.set(t,n),n)}}(R||(R={}));class H{constructor(e){this.sender=e}connect(e,t){return T.connect(this,e,t)}disconnect(e,t){return T.disconnect(this,e,t)}emit(e){T.emit(this,e)}}(j=H||(H={})).disconnectBetween=function(e,t){T.disconnectBetween(e,t)},j.disconnectSender=function(e){T.disconnectSender(e)},j.disconnectReceiver=function(e){T.disconnectReceiver(e)},j.disconnectAll=function(e){T.disconnectAll(e)},j.clearData=function(e){T.disconnectAll(e)},j.getExceptionHandler=function(){return T.exceptionHandler},j.setExceptionHandler=function(e){let t=T.exceptionHandler;return T.exceptionHandler=e,t};class K extends(null){constructor(){super(...arguments),this._pending=new 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 PromiseDelegate;t.resolve({args:e,next:n}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new PromiseDelegate}}!function(e){function t(e){let t=i.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,c(s.get(t))}c(t)}}function n(e){let t=s.get(e);if(t&&0!==t.length){for(const e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,c(i.get(t))}c(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,n){n=n||void 0;let r=i.get(e.sender);if(r||(r=[],i.set(e.sender,r)),a(r,e,t,n))return!1;let o=n||t,l=s.get(o);l||(l=[],s.set(o,l));let c={signal:e,slot:t,thisArg:n};return r.push(c),l.push(c),!0},e.disconnect=function(e,t,n){n=n||void 0;let r=i.get(e.sender);if(!r||0===r.length)return!1;let o=a(r,e,t,n);if(!o)return!1;let l=n||t,u=s.get(l);return o.signal=null,c(r),c(u),!0},e.disconnectBetween=function(e,t){let n=i.get(e);if(!n||0===n.length)return;let r=s.get(t);if(r&&0!==r.length){for(const t of r)t.signal&&t.signal.sender===e&&(t.signal=null);c(n),c(r)}},e.disconnectSender=t,e.disconnectReceiver=n,e.disconnectAll=function(e){t(e),n(e)},e.emit=function(e,t){let n=i.get(e.sender);if(n&&0!==n.length)for(let i=0,s=n.length;ie.signal===t&&e.slot===n&&e.thisArg===i))}function l(t,n){let{signal:i,slot:s,thisArg:r}=t;try{s.call(r,i.sender,n)}catch(t){e.exceptionHandler(t)}}function c(e){0===r.size&&o(u),r.add(e)}function u(){r.forEach(d),r.clear()}function d(e){D.removeAllWhere(e,h)}function h(e){return null===e.signal}}(T||(T={}));class ${constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}}class V{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach((e=>{e.dispose()})),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(V||(V={}));class J extends V{constructor(){super(...arguments),this._disposed=new H(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),H.clearData(this))}}!function(e){e.from=function(t){let n=new e;for(const e of t)n.add(e);return n}}(J||(J={}));class G{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:e,edge:t,distance:n}=this._scrollTarget,i=L.SCROLL_EDGE_SIZE-n,s=Math.pow(i/L.SCROLL_EDGE_SIZE,2),r=Math.max(1,Math.round(s*L.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=r;break;case"left":e.scrollLeft-=r;break;case"right":e.scrollLeft+=r;break;case"bottom":e.scrollTop+=r}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});L.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise((e=>{this._resolve=e}));let n=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(n),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){this.dragImage&&(this.dragImage.style.transform=`translate(${e}px, ${t}px)`)}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0!==e.button)return;if(this._updateCurrentTarget(e),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction)return L.dispatchDragLeave(this,this._currentTarget,null,e),void this._finalize("none");let t=L.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=L.findScrollTarget(e);(this._scrollTarget||t)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,n=this._currentTarget,i=this._currentElement,s=L.findElementBehindBackdrop(e,this.document);this._currentElement=s,s!==i&&s!==n&&L.dispatchDragExit(this,n,s,e),s!==i&&s!==n&&(n=L.dispatchDragEnter(this,s,n,e)),n!==t&&(this._currentTarget=n,L.dispatchDragLeave(this,t,n,e));let r=L.dispatchDragOver(this,n,e);this._setDropAction(r)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let n=this.dragImage.style;n.pointerEvents="none",n.position="fixed",n.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=L.validateAction(e,this.supportedActions),!this._override||this._dropAction!==e)switch(e){case"none":this._dropAction=e,this._override=G.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=G.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=G.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=G.overrideCursor("move",this.document)}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}}function Y(){return Q.keyboardLayout}!function(e){class t extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});const{drag:n}=t;this.dropAction="none",this.mimeData=n.mimeData,this.proposedAction=n.proposedAction,this.supportedActions=n.supportedActions,this.source=n.source}}e.Event=t,e.overrideCursor=function(e,t=document){return L.overrideCursor(e,t)}}(G||(G={})),function(e){function t(t,s=document){if(t){if(n&&t==n.event)return n.element;e.cursorBackdrop.style.zIndex="-1000";const i=s.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",n={event:t,element:i},i}{const t=e.cursorBackdrop.style.transform;if(i&&t===i.transform)return i.element;const n=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";const r=s.elementFromPoint(n.left+n.width/2,n.top+n.height/2);return e.cursorBackdrop.style.zIndex="",i={transform:t,element:r},r}}e.SCROLL_EDGE_SIZE=20,e.validateAction=function(e,t){return s[e]&r[t]?e:"none"},e.findElementBehindBackdrop=t;let n=null,i=null;e.findScrollTarget=function(n){let i=n.clientX,s=n.clientY,r=t(n);for(;r;r=r.parentElement){if(!r.hasAttribute("data-lm-dragscroll"))continue;let t=0,n=0;r===document.body&&(t=window.pageXOffset,n=window.pageYOffset);let o=r.getBoundingClientRect(),a=o.top+n,l=o.left+t,c=l+o.width,u=a+o.height;if(i=c||s=u)continue;let d,h=i-l+1,p=s-a+1,f=c-i,m=u-s,g=Math.min(h,p,f,m);if(g>e.SCROLL_EDGE_SIZE)continue;switch(g){case m:d="bottom";break;case p:d="top";break;case f:d="right";break;case h:d="left";break;default:throw"unreachable"}let v,_=r.scrollWidth-r.clientWidth,y=r.scrollHeight-r.clientHeight;switch(d){case"top":v=y>0&&r.scrollTop>0;break;case"left":v=_>0&&r.scrollLeft>0;break;case"right":v=_>0&&r.scrollLeft<_;break;case"bottom":v=y>0&&r.scrollTop{i===u&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",o,!0),e.cursorBackdrop.removeEventListener("scroll",a,!0),s.removeChild(e.cursorBackdrop))}))};const c=500;let u=0;e.cursorBackdrop=function(){const e=document.createElement("div");return e.classList.add("lm-cursor-backdrop"),e}()}(L||(L={}));class X{constructor(e,t,n=[]){this.name=e,this._codes=t,this._keys=X.extractKeys(t),this._modifierKeys=X.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}!function(e){e.extractKeys=function(e){let t=Object.create(null);for(let n in e)t[e[n]]=!0;return t},e.convertToKeySet=function(e){let t=Object(null);for(let n=0,i=e.length;n{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})}))}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw new Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=N.JSONExt.emptyObject){var n;let i=this._commands.get(e);return Promise.resolve(null!==(n=null==i?void 0:i.describedBy.call(void 0,t))&&void 0!==n?n:{args:null})}label(e,t=N.JSONExt.emptyObject){var n;let i=this._commands.get(e);return null!==(n=null==i?void 0:i.label.call(void 0,t))&&void 0!==n?n:""}mnemonic(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.mnemonic.call(void 0,t):-1}icon(e,t=N.JSONExt.emptyObject){var n;return null===(n=this._commands.get(e))||void 0===n?void 0:n.icon.call(void 0,t)}iconClass(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconClass.call(void 0,t):""}iconLabel(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconLabel.call(void 0,t):""}caption(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.caption.call(void 0,t):""}usage(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.usage.call(void 0,t):""}className(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.className.call(void 0,t):""}dataset(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.dataset.call(void 0,t):{}}isEnabled(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isEnabled.call(void 0,t)}isToggled(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggled.call(void 0,t)}isToggleable(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isToggleable}isVisible(e,t=N.JSONExt.emptyObject){let n=this._commands.get(e);return!!n&&n.isVisible.call(void 0,t)}execute(e,t=N.JSONExt.emptyObject){let n,i=this._commands.get(e);if(!i)return Promise.reject(new Error(`Command '${e}' not registered.`));try{n=i.execute.call(void 0,t)}catch(e){n=Promise.reject(e)}let s=Promise.resolve(n);return this._commandExecuted.emit({id:e,args:t,result:s}),s}addKeyBinding(e){let t=ee.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new $((()=>{D.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})}))}processKeydownEvent(e){if(this._replaying||ae.isModifierKeyPressed(e))return;let t=ae.keystrokeForKeydownEvent(e);if(!t)return this._replayKeydownEvents(),void this._clearPendingState();this._keystrokes.push(t);let{exact:n,partial:i}=ee.matchKeyBinding(this._keyBindings,this._keystrokes,e);return n||i?(e.preventDefault(),e.stopPropagation(),n&&!i?(this._executeKeyBinding(n),void this._clearPendingState()):(n&&(this._exactKeyMatch=n),this._keydownEvents.push(e),void this._startTimer())):(this._replayKeydownEvents(),void this._clearPendingState())}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),ee.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(ee.replayKeyEvent),this._replaying=!1)}_executeKeyBinding(e){let{command:t,args:n}=e,i={_luminoEvent:{type:"keybinding",keys:e.keys},...n};if(this.hasCommand(t)&&this.isEnabled(t,i))this.execute(t,i);else{let n=this.hasCommand(t)?"enabled":"registered",i=`Cannot execute key binding '${e.keys.join(", ")}':`,s=`command '${t}' is not ${n}.`;console.warn(`${i} ${s}`)}}_clearPendingState(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}}!function(e){function t(e){let t="",n=!1,i=!1,s=!1,r=!1;for(let o of e.split(/\s+/))"Accel"===o?F.IS_MAC?i=!0:s=!0:"Alt"===o?n=!0:"Cmd"===o?i=!0:"Ctrl"===o?s=!0:"Shift"===o?r=!0:o.length>0&&(t=o);return{cmd:i,ctrl:s,alt:n,shift:r,key:t}}function n(e){let n="",i=t(e);return i.ctrl&&(n+="Ctrl "),i.alt&&(n+="Alt "),i.shift&&(n+="Shift "),i.cmd&&F.IS_MAC&&(n+="Cmd "),n+i.key}e.parseKeystroke=t,e.normalizeKeystroke=n,e.normalizeKeys=function(e){let t;return t=F.IS_WIN?e.winKeys||e.keys:F.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys,t.map(n)},e.formatKeystroke=function(e){return"string"==typeof e?n(e):e.map(n).join(", ");function n(e){let n=[],i=F.IS_MAC?" ":"+",s=t(e);return s.ctrl&&n.push("Ctrl"),s.alt&&n.push("Alt"),s.shift&&n.push("Shift"),F.IS_MAC&&s.cmd&&n.push("Cmd"),n.push(s.key),n.map(ee.formatKey).join(i)}},e.isModifierKeyPressed=function(e){let t=Y(),n=t.keyForKeydownEvent(e);return t.isModifierKey(n)},e.keystrokeForKeydownEvent=function(e){let t=Y(),n=t.keyForKeydownEvent(e);if(!n||t.isModifierKey(n))return"";let i=[];return e.ctrlKey&&i.push("Ctrl"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),e.metaKey&&F.IS_MAC&&i.push("Cmd"),i.push(n),i.join(" ")}}(ae||(ae={})),function(e){e.CHORD_TIMEOUT=1e3,e.createCommand=function(e){return{execute:e.execute,describedBy:c("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},(()=>({args:null}))),label:c(e.label,i),mnemonic:c(e.mnemonic,s),icon:c(e.icon,l),iconClass:c(e.iconClass,i),iconLabel:c(e.iconLabel,i),caption:c(e.caption,i),usage:c(e.usage,i),className:c(e.className,i),dataset:c(e.dataset,a),isEnabled:e.isEnabled||r,isToggled:e.isToggled||o,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||r}},e.createKeyBinding=function(e){return{keys:ae.normalizeKeys(e),selector:u(e),command:e.command,args:e.args||N.JSONExt.emptyObject}},e.matchKeyBinding=function(e,t,n){let i=null,s=!1,r=1/0,o=0;for(let a=0,l=e.length;ar)continue;let p=I.calculateSpecificity(l.selector);(!i||u=o)&&(i=l,r=u,o=p)}return{exact:i,partial:s}},e.replayKeyEvent=function(e){e.target.dispatchEvent(function(e){let t=document.createEvent("Event"),n=e.bubbles||!0,i=e.cancelable||!0;return t.initEvent(e.type||"keydown",n,i),t.key=e.key||"",t.keyCode=e.keyCode||0,t.which=e.keyCode||0,t.ctrlKey=e.ctrlKey||!1,t.altKey=e.altKey||!1,t.shiftKey=e.shiftKey||!1,t.metaKey=e.metaKey||!1,t.view=e.view||window,t}(e))},e.formatKey=function(e){return F.IS_MAC?t.hasOwnProperty(e)?t[e]:e:n.hasOwnProperty(e)?n[e]:e};const t={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},n={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},i=()=>"",s=()=>-1,r=()=>!0,o=()=>!1,a=()=>({}),l=()=>{};function c(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function u(e){if(-1!==e.selector.indexOf(","))throw new Error(`Selector cannot contain commas: ${e.selector}`);if(!I.isValid(e.selector))throw new Error(`Invalid selector: ${e.selector}`);return e.selector}function d(e,t){if(e.lengtht.length?2:1}function h(e,t){let n=t.target,i=t.currentTarget;for(let t=0;null!==n;n=n.parentElement,++t){if(n.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(I.matches(n,e))return t;if(n===i)return-1}return-1}}(ee||(ee={}));class le{constructor(e){this.type="text",this.content=e}}class ce{constructor(e,t,n,i){this.type="element",this.tag=e,this.attrs=t,this.children=n,this.renderer=i}}function ue(e){let t,n={},i=[];for(let e=1,r=arguments.length;e=i;--r){const i=t[r],o=s?e.lastChild:e.childNodes[r];"text"===i.type||(i.renderer&&i.renderer.unrender?i.renderer.unrender(o,{attrs:i.attrs,children:i.children}):n(o,i.children,0,!1)),s&&e.removeChild(o)}}e.hostMap=new WeakMap,e.asContentArray=function(e){return e?e instanceof Array?e:[e]:[]},e.createDOMNode=t,e.updateContent=function e(i,r,o){if(r===o)return;let a=function(e,t){let n=e.firstChild,i=Object.create(null);for(let e of t)"element"===e.type&&e.attrs.key&&(i[e.attrs.key]={vNode:e,element:n}),n=n.nextSibling;return i}(i,r),l=r.slice(),c=i.firstChild,u=o.length;for(let n=0;n=l.length){t(o[n],i);continue}let r=l[n],u=o[n];if(r===u){c=c.nextSibling;continue}if("text"===r.type&&"text"===u.type){c.textContent!==u.content&&(c.textContent=u.content),c=c.nextSibling;continue}if("text"===r.type||"text"===u.type){D.insert(l,n,u),t(u,i,c);continue}if(!r.renderer!=!u.renderer){D.insert(l,n,u),t(u,i,c);continue}let d=u.attrs.key;if(d&&d in a){let e=a[d];e.vNode!==r&&(D.move(l,l.indexOf(e.vNode,n+1),n),i.insertBefore(e.element,c),r=e.vNode,c=e.element)}if(r===u){c=c.nextSibling;continue}let h=r.attrs.key;h&&h!==d?(D.insert(l,n,u),t(u,i,c)):r.tag===u.tag?(s(c,r.attrs,u.attrs),u.renderer?u.renderer.render(c,{attrs:u.attrs,children:u.children}):e(c,r.children,u.children),c=c.nextSibling):(D.insert(l,n,u),t(u,i,c))}n(i,l,u,!0)};const i={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function s(e,t,n){if(t===n)return;let s;for(s in t)s in i||s in n||("on"===s.substr(0,2)?e[s]=null:e.removeAttribute(s));for(s in n)s in i||t[s]===n[s]||("on"===s.substr(0,2)?e[s]=n[s]:e.setAttribute(s,n[s]));t.className!==n.className&&(void 0!==n.className?e.setAttribute("class",n.className):e.removeAttribute("class")),t.htmlFor!==n.htmlFor&&(void 0!==n.htmlFor?e.setAttribute("for",n.htmlFor):e.removeAttribute("for")),t.dataset!==n.dataset&&function(e,t,n){for(let i in t)i in n||e.removeAttribute(`data-${i}`);for(let i in n)t[i]!==n[i]&&e.setAttribute(`data-${i}`,n[i])}(e,t.dataset||{},n.dataset||{}),t.style!==n.style&&function(e,t,n){let i,s=e.style;for(i in t)i in n||(s[i]="");for(i in n)t[i]!==n[i]&&(s[i]=n[i])}(e,t.style||{},n.style||{})}}(ne||(ne={}));class de{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}}!function(e){e.calc=function(e,t){let n=e.length;if(0===n)return t;let i=0,s=0,r=0,o=0,a=0;for(let t=0;t0&&(o+=n.stretch,a++)}if(t===r)return 0;if(t<=i){for(let t=0;t=s){for(let t=0;t0&&i>l;){let t=i,s=o;for(let r=0;r0&&i>l;){let t=i/c;for(let s=0;s0&&i>l;){let t=i,s=o;for(let r=0;r=n.maxSize?(i-=n.maxSize-n.size,o-=n.stretch,n.size=n.maxSize,n.done=!0,c--,a--):(i-=l,n.size+=l)}}for(;c>0&&i>l;){let t=i/c;for(let s=0;s=n.maxSize?(i-=n.maxSize-n.size,n.size=n.maxSize,n.done=!0,c--):(i-=t,n.size+=t))}}}return 0},e.adjust=function(e,t,n){0!==e.length&&0!==n&&(n>0?function(e,t,n){let i=0;for(let n=0;n<=t;++n){let t=e[n];i+=t.maxSize-t.size}let s=0;for(let n=t+1,i=e.length;n=0&&r>0;--n){let t=e[n],i=t.maxSize-t.size;i>=r?(t.sizeHint=t.size+r,r=0):(t.sizeHint=t.size+i,r-=i)}let o=n;for(let n=t+1,i=e.length;n0;++n){let t=e[n],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,n):function(e,t,n){let i=0;for(let n=t+1,s=e.length;n0;++n){let t=e[n],i=t.maxSize-t.size;i>=r?(t.sizeHint=t.size+r,r=0):(t.sizeHint=t.size+i,r-=i)}let o=n;for(let n=t;n>=0&&o>0;--n){let t=e[n],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,-n))}}(ie||(ie={}));class he{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new H(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,H.clearData(this))}}class pe{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new H(this),this._hiddenMode=pe.HiddenMode.Display,this.node=se.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(pe.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&pe.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),H.clearData(this),B.clearData(this),W.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(pe.Flag.IsDisposed)}get isAttached(){return this.testFlag(pe.Flag.IsAttached)}get isHidden(){return this.testFlag(pe.Flag.IsHidden)}get isVisible(){return this.testFlag(pe.Flag.IsVisible)}get title(){return se.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==pe.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let e=new pe.ChildMessage("child-removed",this);B.sendMessage(this._parent,e)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let e=new pe.ChildMessage("child-added",this);B.sendMessage(this._parent,e)}this.isDisposed||B.sendMessage(this,pe.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(pe.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){B.postMessage(this,pe.Msg.UpdateRequest)}fit(){B.postMessage(this,pe.Msg.FitRequest)}activate(){B.postMessage(this,pe.Msg.ActivateRequest)}close(){B.sendMessage(this,pe.Msg.CloseRequest)}show(){if(this.testFlag(pe.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||B.sendMessage(this,pe.Msg.BeforeShow),this.clearFlag(pe.Flag.IsHidden),this._toggleHidden(!1),!this.isAttached||this.parent&&!this.parent.isVisible||B.sendMessage(this,pe.Msg.AfterShow),this.parent)){let e=new pe.ChildMessage("child-shown",this);B.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(pe.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||B.sendMessage(this,pe.Msg.BeforeHide),this.setFlag(pe.Flag.IsHidden),this._toggleHidden(!0),!this.isAttached||this.parent&&!this.parent.isVisible||B.sendMessage(this,pe.Msg.AfterHide),this.parent)){let e=new pe.ChildMessage("child-hidden",this);B.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return 0!=(this._flags&e)}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(pe.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(pe.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(pe.Flag.IsVisible),this.setFlag(pe.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(pe.Flag.IsVisible),this.clearFlag(pe.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&pe.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case pe.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case pe.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case pe.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1"}else switch(this._hiddenMode){case pe.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case pe.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case pe.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex=""}}}!function(e){var t,n,i;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",t[t.ContentVisibility=2]="ContentVisibility",(n=e.Flag||(e.Flag={}))[n.IsDisposed=1]="IsDisposed",n[n.IsAttached=2]="IsAttached",n[n.IsHidden=4]="IsHidden",n[n.IsVisible=8]="IsVisible",n[n.DisallowLayout=16]="DisallowLayout",(i=e.Msg||(e.Msg={})).BeforeShow=new U("before-show"),i.AfterShow=new U("after-show"),i.BeforeHide=new U("before-hide"),i.AfterHide=new U("after-hide"),i.BeforeAttach=new U("before-attach"),i.AfterAttach=new U("after-attach"),i.BeforeDetach=new U("before-detach"),i.AfterDetach=new U("after-detach"),i.ParentChanged=new U("parent-changed"),i.UpdateRequest=new q("update-request"),i.FitRequest=new q("fit-request"),i.ActivateRequest=new q("activate-request"),i.CloseRequest=new q("close-request"),e.ChildMessage=class extends U{constructor(e,t){super(e),this.child=t}};class s extends U{constructor(e,t){super("resize"),this.width=e,this.height=t}}e.ResizeMessage=s,function(e){e.UnknownSize=new e(-1,-1)}(s=e.ResizeMessage||(e.ResizeMessage={})),e.attach=function(t,n,i=null){if(t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw new Error("Widget is already attached.");if(!n.isConnected)throw new Error("Host is not attached.");B.sendMessage(t,e.Msg.BeforeAttach),n.insertBefore(t.node,i),B.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw new Error("Widget is not attached.");B.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),B.sendMessage(t,e.Msg.AfterDetach)}}(pe||(pe={})),function(e){e.titleProperty=new W({name:"title",create:e=>new he({owner:e})}),e.createNode=function(e){return e.node||document.createElement(e.tag||"div")}}(se||(se={}));class fe{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,H.clearData(this),W.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(const e of this)e.parent=this.parent}onResize(e){for(const e of this)B.sendMessage(e,pe.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(const e of this)B.sendMessage(e,pe.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(const t of this)B.sendMessage(t,e)}onAfterAttach(e){for(const t of this)B.sendMessage(t,e)}onBeforeDetach(e){for(const t of this)B.sendMessage(t,e)}onAfterDetach(e){for(const t of this)B.sendMessage(t,e)}onBeforeShow(e){for(const t of this)t.isHidden||B.sendMessage(t,e)}onAfterShow(e){for(const t of this)t.isHidden||B.sendMessage(t,e)}onBeforeHide(e){for(const t of this)t.isHidden||B.sendMessage(t,e)}onAfterHide(e){for(const t of this)t.isHidden||B.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}!function(e){e.getHorizontalAlignment=function(e){return re.horizontalAlignmentProperty.get(e)},e.setHorizontalAlignment=function(e,t){re.horizontalAlignmentProperty.set(e,t)},e.getVerticalAlignment=function(e){return re.verticalAlignmentProperty.get(e)},e.setVerticalAlignment=function(e,t){re.verticalAlignmentProperty.set(e,t)}}(fe||(fe={}));class me{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=M.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,n,i){let s=Math.max(this._minWidth,Math.min(n,this._maxWidth)),r=Math.max(this._minHeight,Math.min(i,this._maxHeight));if(s"center",changed:t}),e.verticalAlignmentProperty=new W({name:"verticalAlignment",create:()=>"top",changed:t})}(re||(re={}));class ge extends fe{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let n=this._widgets.indexOf(t),i=Math.max(0,Math.min(e,this._widgets.length));if(-1===n)return D.insert(this._widgets,i,t),void(this.parent&&this.attachWidget(i,t));i===this._widgets.length&&i--,n!==i&&(D.move(this._widgets,n,i),this.parent&&this.moveWidget(n,i,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=D.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(const t of this)this.attachWidget(e++,t)}attachWidget(e,t){let n=this.parent.node.children[e];this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,n),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterAttach)}moveWidget(e,t,n){this.parent.isAttached&&B.sendMessage(n,pe.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&B.sendMessage(n,pe.Msg.AfterDetach);let i=this.parent.node.children[t];this.parent.isAttached&&B.sendMessage(n,pe.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,i),this.parent.isAttached&&B.sendMessage(n,pe.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterDetach)}}!function(e){e.clampDimension=function(e){return Math.max(0,Math.floor(e))}}(oe||(oe={}));var ve,_e,ye,be,we,De,xe,Ce,Ee,Se,Ae=oe;class ke extends ge{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,void 0!==e.orientation&&(this._orientation=e.orientation),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=oe.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=oe.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map((e=>e.size))}relativeSizes(){return ve.normalize(this._sizers.map((e=>e.size)))}setRelativeSizes(e,t=!0){let n=this._sizers.length,i=e.slice(0,n);for(;i.length0&&(e.sizeHint=e.size);ie.adjust(this._sizers,e,n),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let n=new me(t),i=ve.createHandle(this.renderer),s=ve.averageSize(this._sizers),r=ve.createSizer(s);D.insert(this._items,e,n),D.insert(this._sizers,e,r),D.insert(this._handles,e,i),this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(i),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){D.move(this._items,e,t),D.move(this._sizers,e,t),D.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let n=D.removeAt(this._items,e),i=D.removeAt(this._handles,e);D.removeAt(this._sizers,e),this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(i),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,n,i,s,r,o){const a=this._items[e];if(a.isHidden)return;let l=this._handles[e].style;t?(n+=this.widgetOffset,a.update(n,i,o,s),n+=o,l.top=`${i}px`,l.left=`${n}px`,l.width=`${this._spacing}px`,l.height=`${s}px`):(i+=this.widgetOffset,a.update(n,i,r,o),i+=o,l.top=`${i}px`,l.left=`${n}px`,l.width=`${r}px`,l.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let n=0,i=this._items.length;n0&&(r.sizeHint=r.size),t.isHidden?(r.minSize=0,r.maxSize=0):(t.fit(),r.stretch=ke.getStretch(t.widget),n?(r.minSize=t.minWidth,r.maxSize=t.maxWidth,i+=t.minWidth,s=Math.max(s,t.minHeight)):(r.minSize=t.minHeight,r.maxSize=t.maxHeight,s+=t.minHeight,i=Math.max(i,t.minWidth)))}let r=this._box=M.boxSizing(this.parent.node);i+=r.horizontalSum,s+=r.verticalSum;let o=this.parent.node.style;o.minWidth=`${i}px`,o.minHeight=`${s}px`,this._dirty=!0,this.parent.parent&&B.sendMessage(this.parent.parent,pe.Msg.FitRequest),this._dirty&&B.sendMessage(this.parent,pe.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let n=0;for(let e=0,t=this._items.length;e0){let e;if(e=c?Math.max(0,r-this._fixed):Math.max(0,o-this._fixed),this._hasNormedSizes){for(let t of this._sizers)t.sizeHint*=e;this._hasNormedSizes=!1}let t=ie.calc(this._sizers,e);if(t>0)switch(this._alignment){case"start":break;case"center":a=0,l=t/2;break;case"end":a=0,l=t;break;case"justify":a=t/n,l=0;break;default:throw"unreachable"}}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:function(e){e.parent&&e.parent.layout instanceof ke&&e.parent.fit()}}),e.createSizer=function(e){let t=new de;return t.sizeHint=Math.floor(e),t},e.createHandle=function(e){let t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t},e.averageSize=function(e){return e.reduce(((e,t)=>e+t.size),0)/e.length||0},e.normalize=function(e){let t=e.length;if(0===t)return[];let n=e.reduce(((e,t)=>e+Math.abs(t)),0);return 0===n?e.map((e=>1/t)):e.map((e=>e/n))}}(ve||(ve={}));class Me extends ke{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=Ae.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){const n=this._titles[e],i=n.classList.contains("lm-mod-expanded"),s=_e.createTitle(this.renderer,t.title,i);this._titles[e]=s,this.parent.node.replaceChild(s,n)}insertWidget(e,t){t.id||(t.id=`id-${N.UUID.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){const n=_e.createTitle(this.renderer,t.title);D.insert(this._titles,e,n),this.parent.node.appendChild(n),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",n.id),super.attachWidget(e,t)}moveWidget(e,t,n){D.move(this._titles,e,t),super.moveWidget(e,t,n)}detachWidget(e,t){const n=D.removeAt(this._titles,e);this.parent.node.removeChild(n),super.detachWidget(e,t)}updateItemPosition(e,t,n,i,s,r,o){const a=this._titles[e].style;a.top=`${i}px`,a.left=`${n}px`,a.height=`${this.widgetOffset}px`,a.width=t?`${s}px`:`${r}px`,super.updateItemPosition(e,t,n,i,s,r,o)}}!function(e){e.createTitle=function(e,t,n=!0){const i=e.createSectionTitle(t);return i.style.position="absolute",i.style.contain="strict",i.setAttribute("aria-label",`${t.label} Section`),i.setAttribute("aria-expanded",n?"true":"false"),i.setAttribute("aria-controls",t.owner.id),n&&i.classList.add("lm-mod-expanded"),i}}(_e||(_e={}));class Fe extends pe{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=ye.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}!function(e){e.createLayout=function(e){return e.layout||new ge}}(ye||(ye={}));class Ie extends Fe{constructor(e={}){super({layout:be.createLayout(e)}),this._handleMoved=new H(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;let t,n=this.layout,i=D.findFirstIndex(n.handles,(t=>t.contains(e.target)));if(-1===i)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let s=n.handles[i],r=s.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-r.left:e.clientY-r.top;let o=window.getComputedStyle(s),a=G.overrideCursor(o.cursor);this._pressData={index:i,delta:t,override:a}}_evtPointerMove(e){let t;e.preventDefault(),e.stopPropagation();let n=this.layout,i=this.node.getBoundingClientRect();t="horizontal"===n.orientation?e.clientX-i.left-this._pressData.delta:e.clientY-i.top-this._pressData.delta,n.moveHandle(this._pressData.index,t)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}}!function(e){class t{createHandle(){let e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t,e.getStretch=function(e){return ke.getStretch(e)},e.setStretch=function(e,t){ke.setStretch(e,t)}}(Ie||(Ie={})),function(e){e.createLayout=function(e){return e.layout||new ke({renderer:e.renderer||Ie.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})}}(be||(be={}));class Oe extends Ie{constructor(e={}){super({...e,layout:we.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new H(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){const t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=D.findFirstIndex(this.widgets,(t=>t.contains(e.owner)));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){const t=this.layout,n=t.widgets[e];if(!n)return;const i=n.isHidden,s=t.absoluteSizes(),r=(i?-1:1)*this.spacing,o=s.reduce(((e,t)=>e+t));let a=[...s];if(i){const t=this._widgetSizesCache.get(n);if(!t)return;a[e]+=t;const i=a.map((e=>e-t>0)).lastIndexOf(!0);-1===i?a.forEach(((n,i)=>{i!==e&&(a[i]-=s[i]/o*(t-r))})):a[i]-=t-r}else{const t=s[e];this._widgetSizesCache.set(n,t),a[e]=0;const i=a.map((e=>e>0)).lastIndexOf(!0);if(-1===i)return;a[i]=s[i]+t+r}return a.map((e=>e/(o+r)))}_evtClick(e){const t=e.target;if(t){const n=D.findFirstIndex(this.titles,(e=>e.contains(t)));n>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(n))}}_eventKeyDown(e){if(e.defaultPrevented)return;const t=e.target;let n=!1;if(t){const i=D.findFirstIndex(this.titles,(e=>e.contains(t)));if(i>=0){const s=e.keyCode.toString();if(e.key.match(/Space|Enter/)||s.match(/13|32/))t.click(),n=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||s.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||s.match(/38|40/)){const t=e.key.match(/ArrowLeft|ArrowUp/)||s.match(/37|38/)?-1:1,r=this.titles.length,o=(i+r+t)%r;this.titles[o].focus(),n=!0}else"End"===e.key||"35"===s?(this.titles[this.titles.length-1].focus(),n=!0):"Home"!==e.key&&"36"!==s||(this.titles[0].focus(),n=!0)}n&&e.preventDefault()}}_toggleExpansion(e){const t=this.titles[e],n=this.layout.widgets[e],i=this._computeWidgetSize(e);i&&this.setRelativeSizes(i,!1),n.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),n.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),n.hide()),this._expansionToggled.emit(e)}}!function(e){class t extends Ie.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++t._nInstance}createCollapseIcon(e){return document.createElement("span")}createSectionTitle(e){const t=document.createElement("h3");t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName;for(const n in e.dataset)t.dataset[n]=e.dataset[n];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";const n=t.appendChild(document.createElement("span"));return n.className="lm-AccordionPanel-titleLabel",n.textContent=e.label,n.title=e.caption||e.label,t}createTitleKey(e){let t=this._titleKeys.get(e);return void 0===t&&(t=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(e,t)),t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t}(Oe||(Oe={})),function(e){e.createLayout=function(e){return e.layout||new Me({renderer:e.renderer||Oe.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing,titleSpace:e.titleSpace})}}(we||(we={}));class Pe extends ge{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==e.direction&&(this._direction=e.direction),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=Ae.clampDimension(e.spacing))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=Ae.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){D.insert(this._items,e,new me(t)),D.insert(this._sizers,e,new de),this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){D.move(this._items,e,t),D.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let n=D.removeAt(this._items,e);D.removeAt(this._sizers,e),this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let t=0,n=this._items.length;t0)switch(this._alignment){case"start":break;case"center":l=0,c=i/2;break;case"end":l=0,c=i;break;case"justify":l=i/n,c=0;break;default:throw"unreachable"}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.sizeBasisProperty=new W({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:t}),e.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e},e.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(De||(De={}));class Be extends Fe{constructor(e={}){super({layout:xe.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}!function(e){e.getStretch=function(e){return Pe.getStretch(e)},e.setStretch=function(e,t){Pe.setStretch(e,t)},e.getSizeBasis=function(e){return Pe.getSizeBasis(e)},e.setSizeBasis=function(e,t){Pe.setSizeBasis(e,t)}}(Be||(Be={})),function(e){e.createLayout=function(e){return e.layout||new Pe(e)}}(xe||(xe={}));class Re extends pe{constructor(e){super({node:Ce.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(pe.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||Re.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=Ce.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){const t=e.map((e=>Ce.createItem(this.commands,e)));return t.forEach((e=>this._items.push(e))),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){D.removeAt(this._items,e)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){this._results=null,""!==this.inputNode.value?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let e=this.inputNode;e.focus(),e.select()}}onUpdateRequest(e){if(this.isHidden)return;let t=this.inputNode.value,n=this.contentNode,i=this._results;if(i||(i=this._results=Ce.search(this._items,t),this._activeIndex=t?D.findFirstIndex(i,Ce.canActivate):-1),!t&&0===i.length)return void te.render(null,n);if(t&&0===i.length){let e=this.renderer.renderEmptyMessage({query:t});return void te.render(e,n)}let s=this.renderer,r=this._activeIndex,o=new Array(i.length);for(let e=0,t=i.length;e=i.length)n.scrollTop=0;else{let e=n.children[r];M.scrollIntoViewIfNeeded(n,e)}}_evtClick(e){if(0!==e.button)return;if(e.target.classList.contains("lm-close-icon"))return this.inputNode.value="",void this.refresh();let t=D.findFirstIndex(this.contentNode.children,(t=>t.contains(e.target)));-1!==t&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,n=ee-t)),c=r.slice(0,l),u=r.slice(l);for(let e=0,t=u.length;en.command===e&&N.JSONExt.deepEqual(n.args,t)))||null}}}(Ce||(Ce={}));class Te extends pe{constructor(e){super({node:Ee.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new H(this),this._menuRequested=new H(this),this.addClass("lm-Menu"),this.setFlag(pe.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||Te.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),-1===e||Ee.canActivate(this._items[e])||(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,n=t{this.activeIndex=e}})}te.render(r,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(13===t)return void this.triggerActiveItem();if(27===t)return void this.close();if(37===t)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===t)return void this.activatePreviousItem();if(39===t){let e=this.activeItem;return void(e&&"submenu"===e.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next"))}if(40===t)return void this.activateNextItem();let n=Y().keyForKeydownEvent(e);if(!n)return;let i=this._activeIndex+1,s=Ee.findMnemonic(this._items,n,i);-1===s.index||s.multiple?-1!==s.index?this.activeIndex=s.index:-1!==s.auto&&(this.activeIndex=s.auto):(this.activeIndex=s.index,this.triggerActiveItem())}_evtMouseUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=D.findFirstIndex(this.contentNode.children,(t=>M.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex)return this._cancelOpenTimer(),void this._cancelCloseTimer();-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let n=this.activeItem;n&&"submenu"===n.type&&n.submenu&&this._startOpenTimer()}_evtMouseEnter(e){for(let e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu)return void(this.activeIndex=-1);let{clientX:t,clientY:n}=e;M.hitTest(this._childMenu.node,t,n)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtMouseDown(e){this._parentMenu||(Ee.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||"submenu"!==t.type||!t.submenu)return void this._closeChildMenu();let n=t.submenu;if(n===this._childMenu)return;Te.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,B.sendMessage(this,pe.Msg.UpdateRequest);let i=this.contentNode.children[this._activeIndex];Ee.openSubmenu(n,i),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout((()=>{this._openTimerID=0,this._openChildMenu()}),Ee.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout((()=>{this._closeTimerID=0,this._closeChildMenu()}),Ee.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Ee.saveWindowData()}}!function(e){class t{renderItem(e){let t=this.createItemClass(e),n=this.createItemDataset(e),i=this.createItemARIA(e);return ue.li({className:t,dataset:n,tabindex:"0",onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))}renderIcon(e){let t=this.createIconClass(e);return ue.div({className:t},e.item.icon,e.item.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return ue.div({className:"lm-Menu-itemLabel"},t)}renderShortcut(e){let t=this.formatShortcut(e);return ue.div({className:"lm-Menu-itemShortcut"},t)}renderSubmenu(e){return ue.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(e){let t="lm-Menu-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.item.isVisible||(t+=" lm-mod-hidden"),e.active&&(t+=" lm-mod-active"),e.collapsed&&(t+=" lm-mod-collapsed");let n=e.item.className;return n&&(t+=` ${n}`),t}createItemDataset(e){let t,{type:n,command:i,dataset:s}=e.item;return t="command"===n?{...s,type:n,command:i}:{...s,type:n},t}createIconClass(e){let t="lm-Menu-itemIcon",n=e.item.iconClass;return n?`${t} ${n}`:t}createItemARIA(e){let t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",e.item.isEnabled||(t["aria-disabled"]="true");break;default:e.item.isEnabled||(t["aria-disabled"]="true"),t.role="menuitem"}return t}formatLabel(e){let{label:t,mnemonic:n}=e.item;if(n<0||n>=t.length)return t;let i=t.slice(0,n),s=t.slice(n+1),r=t[n];return[i,ue.span({className:"lm-Menu-itemMnemonic"},r),s]}formatShortcut(e){let t=e.item.keyBinding;return t?ae.formatKeystroke(t.keys):null}}e.Renderer=t,e.defaultRenderer=new t}(Te||(Te={})),function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;let t=null,n=0;function i(){return n>0?(n--,t):r()}function s(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}function r(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}e.saveWindowData=function(){t=r(),n++},e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},e.canActivate=s,e.createItem=function(e,t){return new o(e.commands,t)},e.hitTestMenus=function(e,t,n){for(let i=e;i;i=i.childMenu)if(M.hitTest(i.node,t,n))return!0;return!1},e.computeCollapsed=function(e){let t=new Array(e.length);D.fill(t,!1);let n=0,i=e.length;for(;n=0;--s){let n=e[s];if(n.isVisible){if("separator"!==n.type)break;t[s]=!0}}let r=!1;for(;++na+c&&(t=a+c-f),!r&&n+m>l+u&&(n>l+u?n=l+u-m:n-=m),p.transform=`translate(${Math.max(0,t)}px, ${Math.max(0,n)}px`,p.opacity="1"},e.openSubmenu=function(t,n){const s=i();let r=s.pageXOffset,o=s.pageYOffset,a=s.clientWidth,l=s.clientHeight;B.sendMessage(t,pe.Msg.UpdateRequest);let c=l,u=t.node,d=u.style;d.opacity="0",d.maxHeight=`${c}px`,pe.attach(t,document.body);let{width:h,height:p}=u.getBoundingClientRect(),f=M.boxSizing(t.node),m=n.getBoundingClientRect(),g=m.right-e.SUBMENU_OVERLAP;g+h>r+a&&(g=m.left+e.SUBMENU_OVERLAP-h);let v=m.top-f.borderTop-f.paddingTop;v+p>o+l&&(v=m.bottom+f.borderBottom+f.paddingBottom-p),d.transform=`translate(${Math.max(0,g)}px, ${Math.max(0,v)}px`,d.opacity="1"},e.findMnemonic=function(e,t,n){let i=-1,r=-1,o=!1,a=t.toUpperCase();for(let t=0,l=e.length;t=0&&hn.command===e&&N.JSONExt.deepEqual(n.args,t)))||null}return null}}}(Ee||(Ee={}));class Le{constructor(e){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;const{groupByTarget:t,sortBySelector:n,...i}=e;this.menu=new Te(i),this._groupByTarget=!1!==t,this._sortBySelector=!1!==n}addItem(e){let t=Se.createItem(e,this._idTick++);return this._items.push(t),new $((()=>{D.removeFirstOf(this._items,t)}))}open(e){if(Te.saveWindowData(),this.menu.clearItems(),0===this._items.length)return!1;let t=Se.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);if(!t||0===t.length)return!1;for(const e of t)this.menu.addItem(e);return this.menu.open(e.clientX,e.clientY),!0}}!function(e){function t(e,t){let n=e.rank,i=t.rank;return n!==i?n=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,n=this._titles[t]||null,i=e,s=this._titles[i]||null;this._currentIndex=i,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:i,currentTitle:s})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let n=ze.asTitle(t),i=this._titles.indexOf(n),s=Math.max(0,Math.min(e,this._titles.length));return-1===i?(D.insert(this._titles,s,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,n),n):(s===this._titles.length&&s--,i===s||(D.move(this._titles,i,s),this.update(),this._adjustCurrentForMove(i,s)),n)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=D.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(0===this._titles.length)return;this._releaseMouse();for(let e of this._titles)e.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),-1!==e&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let n=this._titles,i=this.renderer,s=this.currentTitle,r=new Array(n.length);const o=null!==(t=this._getCurrentTabindex())&&void 0!==t?t:this._currentIndex>-1?this._currentIndex:0;for(let e=0,t=n.length;eM.hitTest(t,e.clientX,e.clientY)));if(-1===n)return;let i=this.titles[n],s=t[n].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(e.target)){let e=i.label||"",t=s.innerHTML;s.innerHTML="";let n=document.createElement("input");n.classList.add("lm-TabBar-tabInput"),n.value=e,s.appendChild(n);let r=()=>{n.removeEventListener("blur",r),s.innerHTML=t,this.node.addEventListener("keydown",this)};n.addEventListener("dblclick",(e=>e.stopPropagation())),n.addEventListener("blur",r),n.addEventListener("keydown",(e=>{"Enter"===e.key?(""!==n.value&&(i.label=i.caption=n.value),r()):"Escape"===e.key&&r()})),this.node.removeEventListener("keydown",this),n.select(),n.focus(),s.children.length>0&&s.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse())}_evtKeyDown(e){var t,n,i;if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE)if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){const t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{const n=D.findFirstIndex(this.contentNode.children,(e=>e.contains(t)));n>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=n)}}else if(je.includes(e.key)){const s=[...this.contentNode.children];if(this.addButtonEnabled&&s.push(this.addButtonNode),s.length<=1)return;e.preventDefault(),e.stopPropagation();let r,o=s.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?r=null!==(t=s[o+1])&&void 0!==t?t:s[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?r=null!==(n=s[o-1])&&void 0!==n?n:s[s.length-1]:"Home"===e.key?r=s[0]:"End"===e.key&&(r=s[s.length-1]),r&&(null===(i=s[o])||void 0===i||i.setAttribute("tabindex","-1"),null==r||r.setAttribute("tabindex","0"),r.focus())}}_evtPointerDown(e){if(0!==e.button&&1!==e.button)return;if(this._dragData)return;if(e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),n=this.contentNode.children,i=D.findFirstIndex(n,(t=>M.hitTest(t,e.clientX,e.clientY)));if(-1===i&&!t)return;if(e.preventDefault(),e.stopPropagation(),this._dragData={tab:n[i],index:i,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===e.button||t)return;let s=n[i].querySelector(this.renderer.closeIconSelector);s&&s.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===i?this.currentIndex=-1:this.currentIndex=i,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let n=this.contentNode.children;if(t.dragActive||ze.dragExceeded(t,e)){if(!t.dragActive){let e=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=e.width,t.tabPressPos=t.pressX-e.left):(t.tabPos=t.tab.offsetTop,t.tabSize=e.height,t.tabPressPos=t.pressY-e.top),t.tabPressOffset={x:t.pressX-e.left,y:t.pressY-e.top},t.tabLayout=ze.snapTabLayout(n,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=G.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&ze.detachExceeded(t,e)){t.detachRequested=!0;let i=t.index,s=e.clientX,r=e.clientY,o=n[i],a=this._titles[i];if(this._tabDetachRequested.emit({index:i,title:a,tab:o,clientX:s,clientY:r,offset:t.tabPressOffset}),t.dragAborted)return}ze.layoutTabs(n,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;const t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target))return void this._addRequested.emit(void 0);let n=this.contentNode.children,i=D.findFirstIndex(n,(t=>M.hitTest(t,e.clientX,e.clientY)));if(i!==t.index)return;let s=this._titles[i];if(!s.closable)return;if(1===e.button)return void this._tabCloseRequested.emit({index:i,title:s});let r=n[i].querySelector(this.renderer.closeIconSelector);return r&&r.contains(e.target)?void this._tabCloseRequested.emit({index:i,title:s}):void 0}if(0!==e.button)return;ze.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let n=ze.parseTransitionDuration(t.tab);setTimeout((()=>{if(t.dragAborted)return;this._dragData=null,ze.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let e=t.index,n=t.targetIndex;-1!==n&&e!==n&&(D.move(this._titles,e,n),this._adjustCurrentForMove(e,n),this._tabMoved.emit({fromIndex:e,toIndex:n,title:this._titles[n]}),B.sendMessage(this,pe.Msg.UpdateRequest))}),n)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(ze.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let n=this.currentTitle,i=this._currentIndex,s=this.insertBehavior;if("select-tab"===s||"select-tab-if-needed"===s&&-1===i)return this._currentIndex=e,this._previousTitle=n,void this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:e,currentTitle:t});i>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let n=this._currentIndex,i=this.removeBehavior;if(n===e){if(0===this._titles.length)return this._currentIndex=-1,void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});if("select-tab-after"===i)return this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-tab-before"===i)return this._currentIndex=Math.max(0,e-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});if("select-previous-tab"===i)return this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),void this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}else n>e&&this._currentIndex--}_onTitleChanged(e){this.update()}}var ze,Ue,qe,We,He,Ke,$e,Ve,Je,Ge,Ye,Xe;!function(e){class t{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++t._nInstance}renderTab(e){let t=e.title.caption,n=this.createTabKey(e),i=n,s=this.createTabStyle(e),r=this.createTabClass(e),o=this.createTabDataset(e),a=this.createTabARIA(e);return e.title.closable?ue.li({id:i,key:n,className:r,title:t,style:s,dataset:o,...a},this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e)):ue.li({id:i,key:n,className:r,title:t,style:s,dataset:o,...a},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){const{title:t}=e;let n=this.createIconClass(e);return ue.div({className:n},t.icon,t.iconLabel)}renderLabel(e){return ue.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return ue.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){let t=this._tabKeys.get(e.title);return void 0===t&&(t=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(e.title,t)),t}createTabStyle(e){return{zIndex:`${e.zIndex}`}}createTabClass(e){let t="lm-TabBar-tab";return e.title.className&&(t+=` ${e.title.className}`),e.title.closable&&(t+=" lm-mod-closable"),e.current&&(t+=" lm-mod-current"),t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:`${null!==(t=e.tabIndex)&&void 0!==t?t:"-1"}`}}createIconClass(e){let t="lm-TabBar-tabIcon",n=e.title.iconClass;return n?`${t} ${n}`:t}}t._nInstance=0,e.Renderer=t,e.defaultRenderer=new t,e.addButtonSelector=".lm-TabBar-addButton"}(Ne||(Ne={})),function(e){e.DRAG_THRESHOLD=5,e.DETACH_THRESHOLD=20,e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");t.setAttribute("role","tablist"),t.className="lm-TabBar-content",e.appendChild(t);let n=document.createElement("div");return n.className="lm-TabBar-addButton lm-mod-hidden",n.setAttribute("tabindex","-1"),n.setAttribute("role","button"),e.appendChild(n),e},e.asTitle=function(e){return e instanceof he?e:new he(e)},e.parseTransitionDuration=function(e){let t=window.getComputedStyle(e);return 1e3*(parseFloat(t.transitionDuration)||0)},e.snapTabLayout=function(e,t){let n=new Array(e.length);for(let i=0,s=e.length;i=e.DRAG_THRESHOLD||s>=e.DRAG_THRESHOLD},e.detachExceeded=function(t,n){let i=t.contentRect;return n.clientX=i.right+e.DETACH_THRESHOLD||n.clientY=i.bottom+e.DETACH_THRESHOLD},e.layoutTabs=function(e,t,n,i){let s,r,o,a;"horizontal"===i?(s=t.pressX,r=n.clientX-t.contentRect.left,o=n.clientX,a=t.contentRect.width):(s=t.pressY,r=n.clientY-t.contentRect.top,o=n.clientY,a=t.contentRect.height);let l=t.index,c=r-t.tabPressPos,u=c+t.tabSize;for(let n=0,r=e.length;n>1);if(nt.index&&u>h)r=-t.tabSize-d.margin+"px",l=Math.max(l,n);else if(n===t.index){let e=o-s,n=a-(t.tabPos+t.tabSize);r=`${Math.max(-t.tabPos,Math.min(e,n))}px`}else r="";"horizontal"===i?e[n].style.left=r:e[n].style.top=r}t.targetIndex=l},e.finalizeTabPosition=function(e,t){let n,i;if(n="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)i=0;else if(e.targetIndex>e.index){let t=e.tabLayout[e.targetIndex];i=t.pos+t.size-e.tabSize-e.tabPos}else i=e.tabLayout[e.targetIndex].pos-e.tabPos;let s=n-(e.tabPos+e.tabSize),r=Math.max(-e.tabPos,Math.min(i,s));"horizontal"===t?e.tab.style.left=`${r}px`:e.tab.style.top=`${r}px`},e.resetTabPositions=function(e,t){for(const n of e)"horizontal"===t?n.style.left="":n.style.top=""}}(ze||(ze={}));class Ze extends fe{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=Ae.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:pe.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach((e=>{e.dispose()})),this._box=null,this._root=null,this._items.clear();for(const t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(const e of this.tabBars())if(e.titles.length>1)for(const t of e.titles)t.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=Ae.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():S()}widgets(){return this._root?this._root.iterUserWidgets():S()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():S()}tabBars(){return this._root?this._root.iterTabBars():S()}handles(){return this._root?this._root.iterHandles():S()}moveHandle(e,t,n){let i=e.classList.contains("lm-mod-hidden");if(!this._root||i)return;let s,r=this._root.findSplitNode(e);r&&(s="horizontal"===r.node.orientation?t-e.offsetLeft:n-e.offsetTop,0!==s&&(r.node.holdSizes(),ie.adjust(r.node.sizers,r.index,s),this.parent&&this.parent.update()))}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t,n=new Set;t=e.main?Ue.normalizeAreaConfig(e.main,n):null;let i=this.widgets(),s=this.tabBars(),r=this.handles();this._root=null;for(const e of i)n.has(e)||(e.parent=null);for(const e of s)e.dispose();for(const e of r)e.parentNode&&e.parentNode.removeChild(e);for(const e of n)e.parent=this.parent;this._root=t?Ue.realizeAreaConfig(t,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):null,this.parent&&(n.forEach((e=>{this.attachWidget(e)})),this.parent.fit())}addWidget(e,t={}){let n=t.ref||null,i=t.mode||"tab-after",s=null;if(this._root&&n&&(s=this._root.findTabNode(n)),n&&!s)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,i){case"tab-after":this._insertTab(e,n,s,!0);break;case"tab-before":this._insertTab(e,n,s,!1);break;case"split-top":this._insertSplit(e,n,s,"vertical",!1);break;case"split-left":this._insertSplit(e,n,s,"horizontal",!1);break;case"split-right":this._insertSplit(e,n,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,n,s,"vertical",!0);break;case"merge-top":this._insertSplit(e,n,s,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,n,s,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,n,s,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,n,s,"vertical",!0,!0)}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=M.boxSizing(this.parent.node));let n=this.parent.node.getBoundingClientRect(),i=e-n.left-this._box.borderLeft,s=t-n.top-this._box.borderTop,r=this._root.hitTestTabNodes(i,s);if(!r)return null;let{tabBar:o,top:a,left:l,width:c,height:u}=r,d=this._box.borderLeft+this._box.borderRight,h=this._box.borderTop+this._box.borderBottom;return{tabBar:o,x:i,y:s,top:a,left:l,right:n.width-d-(l+c),bottom:n.height-h-(a+u),width:c,height:u}}init(){super.init();for(const e of this)this.attachWidget(e);for(const e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new me(e)),this.parent.isAttached&&B.sendMessage(e,pe.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&B.sendMessage(e,pe.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&B.sendMessage(e,pe.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&B.sendMessage(e,pe.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(Ue.removeAria(e),t.tabBar.titles.length>1)return t.tabBar.removeTab(e.title),void(this._hiddenMode===pe.HiddenMode.Scale&&1==t.tabBar.titles.length&&(t.tabBar.titles[0].owner.hiddenMode=pe.HiddenMode.Display));if(t.tabBar.dispose(),this._root===t)return void(this._root=null);this._root.holdAllSizes();let n=t.parent;t.parent=null;let i=D.removeFirstOf(n.children,t),s=D.removeAt(n.handles,i);if(D.removeAt(n.sizers,i),s.parentNode&&s.parentNode.removeChild(s),n.children.length>1)return void n.syncHandles();let r=n.parent;n.parent=null;let o=n.children[0],a=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,a.parentNode&&a.parentNode.removeChild(a),this._root===n)return o.parent=null,void(this._root=o);let l=r,c=l.children.indexOf(n);if(o instanceof Ue.TabLayoutNode)return o.parent=l,void(l.children[c]=o);let u=D.removeAt(l.handles,c);D.removeAt(l.children,c),D.removeAt(l.sizers,c),u.parentNode&&u.parentNode.removeChild(u);for(let e=0,t=o.children.length;e=n.length)&&(i=0),{type:"tab-area",widgets:n,currentIndex:i}}(t,n):function(t,n){let i=t.orientation,s=[],r=[];for(let o=0,a=t.children.length;o{let l=s(i,n,r),c=t(e.sizes[a]),u=n.createHandle();o.children.push(l),o.handles.push(u),o.sizers.push(c),l.parent=o})),o.syncHandles(),o.normalizeSizes(),o}(r,o,a),l};class n{constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let t=new de,n=new de;t.stretch=0,n.stretch=1,this.tabBar=e,this.sizers=[t,n]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(const e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){let e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return-1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e=this._left+this._width||t=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map((e=>e.owner)),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(e,t){let n=0,i=0,s=t.get(this.tabBar),r=this.tabBar.currentTitle,o=r?t.get(r.owner):void 0,[a,l]=this.sizers;return s&&s.fit(),o&&o.fit(),s&&!s.isHidden?(n=Math.max(n,s.minWidth),i+=s.minHeight,a.minSize=s.minHeight,a.maxSize=s.maxHeight):(a.minSize=0,a.maxSize=0),o&&!o.isHidden?(n=Math.max(n,o.minWidth),i+=o.minHeight,l.minSize=o.minHeight,l.maxSize=1/0):(l.minSize=0,l.maxSize=1/0),{minWidth:n,minHeight:i,maxWidth:1/0,maxHeight:1/0}}update(e,t,n,i,s,r){this._top=t,this._left=e,this._width=n,this._height=i;let o=r.get(this.tabBar),a=this.tabBar.currentTitle,l=a?r.get(a.owner):void 0;if(ie.calc(this.sizers,i),o&&!o.isHidden){let i=this.sizers[0].size;o.update(e,t,n,i),t+=i}if(l&&!l.isHidden){let i=this.sizers[1].size;l.update(e,t,n,i)}}}e.TabLayoutNode=n;class i{constructor(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}*iterAllWidgets(){for(const e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(const e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(const e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(const e of this.children)yield*e.iterTabBars()}*iterHandles(){yield*this.handles;for(const e of this.children)yield*e.iterHandles()}findTabNode(e){for(let t=0,n=this.children.length;te.createConfig())),sizes:t}}syncHandles(){this.handles.forEach(((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")}))}holdSizes(){for(const e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(const e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){let e=this.sizers.length;if(0===e)return;this.holdSizes();let t=this.sizers.reduce(((e,t)=>e+t.sizeHint),0);if(0===t)for(const t of this.sizers)t.size=t.sizeHint=1/e;else for(const e of this.sizers)e.size=e.sizeHint/=t;this.normalized=!0}createNormalizedSizes(){let e=this.sizers.length;if(0===e)return[];let t=this.sizers.map((e=>e.size)),n=t.reduce(((e,t)=>e+t),0);if(0===n)for(let n=t.length-1;n>-1;n--)t[n]=1/e;else for(let e=t.length-1;e>-1;e--)t[e]/=n;return t}fit(e,t){let n="horizontal"===this.orientation,i=Math.max(0,this.children.length-1)*e,s=n?i:0,r=n?0:i;for(let i=0,o=this.children.length;ithis._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new Ze({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new Qe.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(const e of t.tabBars())e.show();break;case"single-document":t.restoreLayout(qe.createSingleDocumentConfig(this));break;default:throw"unreachable"}B.postMessage(this,qe.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=A(this.tabBars(),(t=>-1!==t.titles.indexOf(e.title)));if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(F.IS_EDGE||F.IS_IE)&&B.flush(),B.postMessage(this,qe.LayoutModified)}addWidget(e,t={}){"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),B.postMessage(this,qe.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){qe.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){qe.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),B.postMessage(this,qe.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),"none"===e.proposedAction)return void(e.dropAction="none");let{clientX:t,clientY:n}=e,{zone:i,target:s}=qe.findDropTarget(this,t,n,this._edges);if(this._tabsConstrained&&e.source!==this||"invalid"===i)return void(e.dropAction="none");let r=e.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof r)return void(e.dropAction="none");let o=r();if(!(o instanceof pe))return void(e.dropAction="none");if(o.contains(this))return void(e.dropAction="none");let a=s?qe.getDropRef(s.tabBar):null;switch(i){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:a});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:a});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:a});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:a});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:a});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(o)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),B.postMessage(this,qe.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,n=e.target,i=A(t.handles(),(e=>e.contains(n)));if(!i)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let s=i.getBoundingClientRect(),r=e.clientX-s.left,o=e.clientY-s.top,a=window.getComputedStyle(i),l=G.overrideCursor(a.cursor,this._document);this._pressData={handle:i,deltaX:r,deltaY:o,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),n=e.clientX-t.left-this._pressData.deltaX,i=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,i)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),B.postMessage(this,qe.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let n,i,s,r,{zone:o,target:a}=qe.findDropTarget(this,e,t,this._edges);if("invalid"===o)return this.overlay.hide(100),o;let l=M.boxSizing(this.node),c=this.node.getBoundingClientRect();switch(o){case"root-all":n=l.paddingTop,i=l.paddingLeft,s=l.paddingRight,r=l.paddingBottom;break;case"root-top":n=l.paddingTop,i=l.paddingLeft,s=l.paddingRight,r=c.height*qe.GOLDEN_RATIO;break;case"root-left":n=l.paddingTop,i=l.paddingLeft,s=c.width*qe.GOLDEN_RATIO,r=l.paddingBottom;break;case"root-right":n=l.paddingTop,i=c.width*qe.GOLDEN_RATIO,s=l.paddingRight,r=l.paddingBottom;break;case"root-bottom":n=c.height*qe.GOLDEN_RATIO,i=l.paddingLeft,s=l.paddingRight,r=l.paddingBottom;break;case"widget-all":n=a.top,i=a.left,s=a.right,r=a.bottom;break;case"widget-top":n=a.top,i=a.left,s=a.right,r=a.bottom+a.height/2;break;case"widget-left":n=a.top,i=a.left,s=a.right+a.width/2,r=a.bottom;break;case"widget-right":n=a.top,i=a.left+a.width/2,s=a.right,r=a.bottom;break;case"widget-bottom":n=a.top+a.height/2,i=a.left,s=a.right,r=a.bottom;break;case"widget-tab":{const e=a.tabBar.node.getBoundingClientRect().height;n=a.top,i=a.left,s=a.right,r=a.bottom+a.height-e;break}default:throw"unreachable"}return this.overlay.show({top:n,left:i,right:s,bottom:r}),o}_createTabBar(){let e=this._renderer.createTabBar(this._document);return qe.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){B.postMessage(this,qe.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:n,currentTitle:i}=t;n&&n.owner.hide(),i&&i.owner.show(),(F.IS_EDGE||F.IS_IE)&&B.flush(),B.postMessage(this,qe.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:n,tab:i,clientX:s,clientY:r,offset:o}=t,a=new N.MimeData;a.setData("application/vnd.lumino.widget-factory",(()=>n.owner));let l=i.cloneNode(!0);o&&(l.style.top=`-${o.y}px`,l.style.left=`-${o.x}px`),this._drag=new G({document:this._document,mimeData:a,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),i.classList.add("lm-mod-hidden"),this._drag.start(s,r).then((()=>{this._drag=null,i.classList.remove("lm-mod-hidden")}))}}!function(e){e.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(e){let t=this.node.style;t.top=`${e.top}px`,t.left=`${e.left}px`,t.right=`${e.right}px`,t.bottom=`${e.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(e){if(!this._hidden)return e<=0?(clearTimeout(this._timer),this._timer=-1,this._hidden=!0,void this.node.classList.add("lm-mod-hidden")):void(-1===this._timer&&(this._timer=window.setTimeout((()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")}),e)))}};class t{createTabBar(e){let t=new Ne({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){let e=document.createElement("div");return e.className="lm-DockPanel-handle",e}}e.Renderer=t,e.defaultRenderer=new t}(Qe||(Qe={})),function(e){e.GOLDEN_RATIO=.618,e.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},e.LayoutModified=new q("layout-modified"),e.isGeneratedTabBarProperty=new W({name:"isGeneratedTabBar",create:()=>!1}),e.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};let t=Array.from(e.widgets()),n=e.selectedWidgets().next().value,i=n?t.indexOf(n):-1;return{main:{type:"tab-area",widgets:t,currentIndex:i}}},e.findDropTarget=function(e,t,n,i){if(!M.hitTest(e.node,t,n))return{zone:"invalid",target:null};let s=e.layout;if(s.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){let s=e.node.getBoundingClientRect(),r=t-s.left+1,o=n-s.top+1,a=s.right-t,l=s.bottom-n;switch(Math.min(o,a,l,r)){case o:if(od&&l>d&&a>h&&c>h)return{zone:"widget-all",target:r};switch(o/=d,a/=h,l/=d,c/=h,Math.min(o,a,l,c)){case o:u="widget-left";break;case a:u="widget-top";break;case l:u="widget-right";break;case c:u="widget-bottom";break;default:throw"unreachable"}return{zone:u,target:r}},e.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner}}(qe||(qe={}));class et extends fe{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new de],this._columnSizers=[new de],this._box=null,void 0!==e.rowCount&&We.reallocSizers(this._rowSizers,e.rowCount),void 0!==e.columnCount&&We.reallocSizers(this._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(this._rowSpacing=We.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(this._columnSpacing=We.clampValue(e.columnSpacing))}dispose(){for(const e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(We.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(We.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=We.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=We.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let n=this._rowSizers[e];n&&(t=We.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let n=this._columnSizers[e];n&&(t=We.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(const e of this._items)yield e.widget}addWidget(e){-1===D.findFirstIndex(this._items,(t=>t.widget===e))&&(this._items.push(new me(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=D.findFirstIndex(this._items,(t=>t.widget===e));if(-1===t)return;let n=D.removeAt(this._items,t);this.parent&&this.detachWidget(e),n.dispose()}init(){super.init();for(const e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&B.sendMessage(e,pe.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&B.sendMessage(e,pe.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&B.sendMessage(e,pe.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&B.sendMessage(e,pe.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let e=0,t=this.rowCount;e!e.isHidden));for(let t=0,n=e.length;t({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(e){e.parent&&e.parent.layout instanceof et&&e.parent.fit()}}),e.normalizeConfig=function(e){return{row:Math.max(0,Math.floor(e.row||0)),column:Math.max(0,Math.floor(e.column||0)),rowSpan:Math.max(1,Math.floor(e.rowSpan||0)),columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},e.clampValue=function(e){return Math.max(0,Math.floor(e))},e.rowSpanCmp=function(t,n){let i=e.cellConfigProperty.get(t.widget),s=e.cellConfigProperty.get(n.widget);return i.rowSpan-s.rowSpan},e.columnSpanCmp=function(t,n){let i=e.cellConfigProperty.get(t.widget),s=e.cellConfigProperty.get(n.widget);return i.columnSpan-s.columnSpan},e.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.lengtht&&(e.length=t)},e.distributeMin=function(e,t,n,i){if(n=i)return;let r=(i-s)/(n-t+1);for(let i=t;i<=n;++i)e[i].minSize+=r}}(We||(We={}));class tt extends pe{constructor(e={}){super({node:He.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(pe.Flag.DisallowLayout),this.renderer=e.renderer||tt.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&0===this._menus[e].items.length&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,n=!0){this._closeChildMenu();let i=this._menus.indexOf(t),s=Math.max(0,Math.min(e,this._menus.length));if(-1===i)return D.insert(this._menus,s,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),void(n&&this.update());s===this._menus.length&&s--,i!==s&&(D.move(this._menus,i,s),n&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let n=D.removeAt(this._menus,e);n&&(n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(0!==this._menus.length){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let n=this._menus,i=this.renderer,s=this._activeIndex,r=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:n.length,a=0,l=!1;o=null!==this._overflowMenu?o-1:o;let c=new Array(o);for(let e=0;e{this._tabFocusIndex=e,this.activeIndex=e}}),a+=this._menuItemSizes[e],n[e].title.label===this._overflowMenuOptions.title&&(l=!0,o--);if(this._overflowMenuOptions.isVisible)if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){const e=null!==(t=this._overflowMenuOptions.title)&&void 0!==t?t:"...";this._overflowMenu=new Te({commands:new ae}),this._overflowMenu.title.label=e,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let e=n.length-2;e>=o;e--){const t=this.menus[e];t.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:t}),this.removeMenu(t,!1)}c[o]=i.renderItem({title:this._overflowMenu.title,active:o===s&&0!==n[o].items.length,tabbable:o===r,disabled:0===n[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}else if(null!==this._overflowMenu){let e=this._overflowMenu.items,t=this.node.offsetWidth,s=this._overflowMenu.items.length;for(let l=0;lthis._menuItemSizes[s]){let t=e[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(o,t,!1),c[o]=i.renderItem({title:t.title,active:!1,tabbable:o===r,disabled:0===n[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),c.pop(),this._overflowMenu=null,this._overflowIndex=-1)}te.render(c,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;const e=this.contentNode.childNodes;let t=this.node.offsetWidth,n=0,i=-1,s=e.length;if(0==this._menuItemSizes.length)for(let r=0;rt&&-1===i&&(i=r)}else for(let e=0;et){i=e;break}this._overflowIndex=i}_evtKeyDown(e){let t=e.keyCode;if(9===t)return void(this.activeIndex=-1);if(e.preventDefault(),e.stopPropagation(),13===t||32===t||38===t||40===t){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;return void this.openActiveMenu()}if(27===t)return this._closeChildMenu(),void this._focusItemAt(this.activeIndex);if(37===t||39===t){let e=37===t?-1:1,n=this._tabFocusIndex+e,i=this._menus.length;for(let t=0;tM.hitTest(t,e.clientX,e.clientY)));if(-1!==t){if(0===e.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();const n=this._positionForMenu(t);Te.saveWindowData(),this.activeIndex=t,this._openChildMenu(n)}}else this._closeChildMenu()}_evtMouseMove(e){let t=D.findFirstIndex(this.contentNode.children,(t=>M.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex)return;if(-1===t&&this._childMenu)return;const n=t>=0&&this._childMenu?this._positionForMenu(t):null;Te.saveWindowData(),this.activeIndex=t,n&&this._openChildMenu(n)}_positionForMenu(e){let t=this.contentNode.children[e],{left:n,bottom:i}=t.getBoundingClientRect();return{top:i,left:n}}_evtFocusOut(e){this._childMenu||this.node.contains(e.relatedTarget)||(this.activeIndex=-1)}_focusItemAt(e){const t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t)return void this._closeChildMenu();let n=this._childMenu;if(n===t)return;this._childMenu=t,n?n.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,B.sendMessage(this,pe.Msg.UpdateRequest);let{left:i,top:s}=e;void 0!==i&&void 0!==s||({left:i,top:s}=this._positionForMenu(this._activeIndex)),n||this.addClass("lm-mod-active"),t.items.length>0&&t.open(i,s,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let n=this._activeIndex,i=this._menus.length;switch(t){case"next":this.activeIndex=n===i-1?0:n+1;break;case"previous":this.activeIndex=0===n?i-1:n-1}this.openActiveMenu()}_onTitleChanged(){this.update()}}!function(e){class t{renderItem(e){let t=this.createItemClass(e),n=this.createItemDataset(e),i=this.createItemARIA(e);return ue.li({className:t,dataset:n,...e.disabled?{}:{tabindex:e.tabbable?"0":"-1"},onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let t=this.createIconClass(e);return ue.div({className:t},e.title.icon,e.title.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return ue.div({className:"lm-MenuBar-itemLabel"},t)}createItemClass(e){let t="lm-MenuBar-item";return e.title.className&&(t+=` ${e.title.className}`),e.active&&!e.disabled&&(t+=" lm-mod-active"),t}createItemDataset(e){return e.title.dataset}createItemARIA(e){return{role:"menuitem","aria-haspopup":"true","aria-disabled":e.disabled?"true":"false"}}createIconClass(e){let t="lm-MenuBar-itemIcon",n=e.title.iconClass;return n?`${t} ${n}`:t}formatLabel(e){let{label:t,mnemonic:n}=e.title;if(n<0||n>=t.length)return t;let i=t.slice(0,n),s=t.slice(n+1),r=t[n];return[i,ue.span({className:"lm-MenuBar-itemMnemonic"},r),s]}}e.Renderer=t,e.defaultRenderer=new t}(tt||(tt={})),function(e){e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-MenuBar-content",e.appendChild(t),t.setAttribute("role","menubar"),e},e.findMnemonic=function(e,t,n){let i=-1,s=-1,r=!1,o=t.toUpperCase();for(let t=0,a=e.length;t=0&&u1&&this.widgets.forEach((e=>{e.hiddenMode=this._hiddenMode})))}dispose(){for(const e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===pe.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=pe.HiddenMode.Scale),t.hiddenMode=pe.HiddenMode.Scale):t.hiddenMode=pe.HiddenMode.Display,D.insert(this._items,e,new me(t)),this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){D.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let n=D.removeAt(this._items,e);this.parent.isAttached&&B.sendMessage(t,pe.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&B.sendMessage(t,pe.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===pe.HiddenMode.Scale&&(t.hiddenMode=pe.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=pe.HiddenMode.Display)),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let n=0,i=this._items.length;n=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(Je||(Je={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(Ye||(Ye={}));class st{constructor(e){this._delegate=new h.PromiseDelegate,this._plugins=new Map,this._services=new Map,this._started=!1,this._bubblingKeydown=!1,this.commands=new E,this.contextMenu=new Le({commands:this.commands,renderer:e.contextMenuRenderer}),this.shell=e.shell}get started(){return this._delegate.promise}getPluginDescription(e){var t,n;return null!==(n=null===(t=this._plugins.get(e))||void 0===t?void 0:t.description)&&void 0!==n?n:""}hasPlugin(e){return this._plugins.has(e)}isPluginActivated(e){var t,n;return null!==(n=null===(t=this._plugins.get(e))||void 0===t?void 0:t.activated)&&void 0!==n&&n}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(e){if(this._plugins.has(e.id))throw new TypeError(`Plugin '${e.id}' is already registered.`);const t=Xe.createPluginData(e);Xe.ensureNoCycle(t,this._plugins,this._services),t.provides&&this._services.set(t.provides,t.id),this._plugins.set(t.id,t)}registerPlugins(e){for(const t of e)this.registerPlugin(t)}deregisterPlugin(e,t){const n=this._plugins.get(e);if(n){if(n.activated&&!t)throw new Error(`Plugin '${e}' is still active.`);this._plugins.delete(e)}}async activatePlugin(e){const t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(t.activated)return;if(t.promise)return t.promise;const n=t.requires.map((e=>this.resolveRequiredService(e))),i=t.optional.map((e=>this.resolveOptionalService(e)));return t.promise=Promise.all([...n,...i]).then((e=>t.activate.apply(void 0,[this,...e]))).then((e=>{t.service=e,t.activated=!0,t.promise=null})).catch((e=>{throw t.promise=null,e})),t.promise}async deactivatePlugin(e){const t=this._plugins.get(e);if(!t)throw new ReferenceError(`Plugin '${e}' is not registered.`);if(!t.activated)return[];if(!t.deactivate)throw new TypeError(`Plugin '${e}'#deactivate() method missing`);const n=Xe.findDependents(e,this._plugins,this._services),i=n.map((e=>this._plugins.get(e)));for(const t of i)if(!t.deactivate)throw new TypeError(`Plugin ${t.id}#deactivate() method missing (depends on ${e})`);for(const e of i){const t=[...e.requires,...e.optional].map((e=>{const t=this._services.get(e);return t?this._plugins.get(t).service:null}));await e.deactivate(this,...t),e.service=null,e.activated=!1}return n.pop(),n}async resolveRequiredService(e){const t=this._services.get(e);if(!t)throw new TypeError(`No provider for: ${e.name}.`);const n=this._plugins.get(t);return n.activated||await this.activatePlugin(t),n.service}async resolveOptionalService(e){const t=this._services.get(e);if(!t)return null;const n=this._plugins.get(t);if(!n.activated)try{await this.activatePlugin(t)}catch(e){return console.error(e),null}return n.service}start(e={}){if(this._started)return this._delegate.promise;this._started=!0,this._bubblingKeydown=e.bubblingKeydown||!1;const t=e.hostID||"",n=Xe.collectStartupPlugins(this._plugins,e).map((e=>this.activatePlugin(e).catch((t=>{console.error(`Plugin '${e}' failed to activate.`),console.error(t)}))));return Promise.all(n).then((()=>{this.attachShell(t),this.addEventListeners(),this._delegate.resolve()})),this._delegate.promise}get deferredPlugins(){return Array.from(this._plugins).filter((([e,t])=>"defer"===t.autoStart)).map((([e,t])=>e))}async activateDeferredPlugins(){const e=this.deferredPlugins.filter((e=>this._plugins.get(e).autoStart)).map((e=>this.activatePlugin(e)));await Promise.all(e)}handleEvent(e){switch(e.type){case"resize":this.evtResize(e);break;case"keydown":this.evtKeydown(e);break;case"contextmenu":this.evtContextMenu(e)}}attachShell(e){pe.attach(this.shell,e&&document.getElementById(e)||document.body)}addEventListeners(){document.addEventListener("contextmenu",this),document.addEventListener("keydown",this,!this._bubblingKeydown),window.addEventListener("resize",this)}evtKeydown(e){this.commands.processKeydownEvent(e)}evtContextMenu(e){e.shiftKey||this.contextMenu.open(e)&&(e.preventDefault(),e.stopPropagation())}evtResize(e){this.shell.update()}}!function(e){e.createPluginData=function(e){var t,n,i,s;return{id:e.id,description:null!==(t=e.description)&&void 0!==t?t:"",service:null,promise:null,activated:!1,activate:e.activate,deactivate:null!==(n=e.deactivate)&&void 0!==n?n:null,provides:null!==(i=e.provides)&&void 0!==i?i:null,autoStart:null!==(s=e.autoStart)&&void 0!==s&&s,requires:e.requires?e.requires.slice():[],optional:e.optional?e.optional.slice():[]}},e.ensureNoCycle=function(e,t,n){const i=[...e.requires,...e.optional],s=i=>{if(i===e.provides)return!0;const o=n.get(i);if(!o)return!1;const a=t.get(o),l=[...a.requires,...a.optional];return 0!==l.length&&(r.push(o),!!l.some(s)||(r.pop(),!1))};if(!e.provides||0===i.length)return;const r=[e.id];if(i.some(s))throw new ReferenceError(`Cycle detected: ${r.join(" -> ")}.`)},e.findDependents=function(e,t,n){const i=new Array,s=e=>{const s=t.get(e),r=[...s.requires,...s.optional];i.push(...r.reduce(((t,i)=>{const s=n.get(i);return s&&t.push([e,s]),t}),[]))};for(const e of t.keys())s(e);const r=i.filter((t=>t[1]===e));let o=0;for(;r.length>o;){const e=r.length,t=new Set(r.map((e=>e[0])));for(const e of t)i.filter((t=>t[1]===e)).forEach((e=>{r.includes(e)||r.push(e)}));o=e}const a=function(e){let t=[],n=new Set,i=new Map;for(const t of e)s(t);for(const[e]of i)r(e);return t;function s(e){let[t,n]=e,s=i.get(n);s?s.push(t):i.set(n,[t])}function r(e){if(n.has(e))return;n.add(e);let s=i.get(e);if(s)for(const e of s)r(e);t.push(e)}}(r),l=a.findIndex((t=>t===e));return-1===l?[e]:a.slice(0,l+1)},e.collectStartupPlugins=function(e,t){const n=new Set;for(const t of e.keys())!0===e.get(t).autoStart&&n.add(t);if(t.startPlugins)for(const e of t.startPlugins)n.add(e);if(t.ignorePlugins)for(const e of t.ignorePlugins)n.delete(e);return Array.from(n)}}(Xe||(Xe={}));var rt=n(9988);class ot{constructor(){this._routes=[]}get(e,t){this._add("GET",e,t)}put(e,t){this._add("PUT",e,t)}post(e,t){this._add("POST",e,t)}patch(e,t){this._add("PATCH",e,t)}delete(e,t){this._add("DELETE",e,t)}async route(e){const t=new URL(e.url),{method:n}=e,{pathname:i}=t;for(const s of this._routes){if(s.method!==n)continue;const r=i.match(s.pattern);if(!r)continue;const o=r.slice(1);let a;if("PATCH"===s.method||"PUT"===s.method||"POST"===s.method)try{a=JSON.parse(await e.text())}catch{a=void 0}return s.callback.call(null,{pathname:i,body:a,query:Object.fromEntries(t.searchParams)},...o)}throw new Error("Cannot route "+e.method+" "+e.url)}_add(e,t,n){"string"==typeof t&&(t=new RegExp(t)),this._routes.push({method:e,pattern:t,callback:n})}}class at{constructor(e){this._stream=new p.Stream(this),this._serverSettings=e.serverSettings}async emit(e){}dispose(){}get isDisposed(){return!0}get stream(){return this._stream}get serverSettings(){return this._serverSettings}}class lt extends st{constructor(e){var t;super(e),this.name="JupyterLite Server",this.namespace=this.name,this.version="unknown",this._router=new ot;const n={...u.ServerConnection.makeSettings(),WebSocket:rt.WebSocket,fetch:null!==(t=this.fetch.bind(this))&&void 0!==t?t:void 0};this._serviceManager=new u.ServiceManager({standby:"never",serverSettings:n,events:new at({serverSettings:n})})}get router(){return this._router}get serviceManager(){return this._serviceManager}async fetch(e,t){if(!(e instanceof Request))throw Error("Request info is not a Request");return this._router.route(e)}attachShell(e){}evtResize(e){}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}var ct=n(4374),ut=n(3570)},3570:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(5082),s=n(4016),r=n(9622),o=n(4374);class a{constructor(e){var t;this._registration=null,this._registrationChanged=new s.Signal(this),this._ready=new i.PromiseDelegate;const n=null!==(t=null==e?void 0:e.workerUrl)&&void 0!==t?t:r.URLExt.join(r.PageConfig.getBaseUrl(),o.o);this.initialize(n).catch(console.warn)}get registrationChanged(){return this._registrationChanged}get enabled(){return null!==this._registration}get ready(){return this._ready.promise}async initialize(e){const{serviceWorker:t}=navigator;let n=null;if(t?t.controller&&(n=await t.getRegistration(t.controller.scriptURL)||null,console.info("JupyterLite ServiceWorker was already registered")):console.warn("ServiceWorkers not supported in this browser"),!n&&t)try{console.info("Registering new JupyterLite ServiceWorker",e),n=await t.register(e),console.info("JupyterLite ServiceWorker was sucessfully registered")}catch(e){console.warn(e),console.warn(`JupyterLite ServiceWorker registration unexpectedly failed: ${e}`)}this.setRegistration(n),n?this._ready.resolve(void 0):this._ready.reject(void 0)}setRegistration(e){this._registration=e,this._registrationChanged.emit(this._registration)}}},4374:(e,t,n)=>{"use strict";n.d(t,{f:()=>r,o:()=>o});var i=n(5082);const s=n.p+"service-worker.js",r=new i.Token("@jupyterlite/server-extension:IServiceWorkerManager"),o=`${s}`.split("/").slice(-1)[0]},5259:(e,t,n)=>{"use strict";var i,s,r;function o(e,t){let n=0;for(const i of e)if(t(i,n++))return i}n.d(t,{RO:()=>i,sE:()=>o}),function(e){function t(e,t,n=0,i=-1){let s,r=e.length;if(0===r)return-1;n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))=n)return;let i=e[t];for(let i=t+1;i0;){let i=a>>1,s=o+i;n(e[s],t)<0?(o=s+1,a-=i+1):a=i}return o},e.upperBound=function(e,t,n,i=0,s=-1){let r=e.length;if(0===r)return 0;let o=i=i<0?Math.max(0,i+r):Math.min(i,r-1),a=(s=s<0?Math.max(0,s+r):Math.min(s,r-1))-i+1;for(;a>0;){let i=a>>1,s=o+i;n(e[s],t)>0?a=i:(o=s+1,a-=i+1)}return o},e.shallowEqual=function(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i=o&&(n=s<0?o-1:o),void 0===i?i=s<0?-1:o:i<0?i=Math.max(i+o,s<0?-1:0):i>=o&&(i=s<0?o-1:o),r=s<0&&i>=n||s>0&&n>=i?0:s<0?Math.floor((i-n+1)/s+1):Math.floor((i-n-1)/s+1);let a=[];for(let t=0;t=(i=i<0?Math.max(0,i+s):Math.min(i,s-1)))return;let o=i-n+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let a=n+t;r(e,n,a-1),r(e,a,i),r(e,n,i)},e.fill=function(e,t,n=0,i=-1){let s,r=e.length;if(0!==r){n=n<0?Math.max(0,n+r):Math.min(n,r-1),s=(i=i<0?Math.max(0,i+r):Math.min(i,r-1))t;--n)e[n]=e[n-1];e[t]=n},e.removeAt=o,e.removeFirstOf=function(e,n,i=0,s=-1){let r=t(e,n,i,s);return-1!==r&&o(e,r),r},e.removeLastOf=function(e,t,i=-1,s=0){let r=n(e,t,i,s);return-1!==r&&o(e,r),r},e.removeAllOf=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&e[o]===t||i=n)&&e[o]===t?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r},e.removeFirstWhere=function(e,t,n=0,s=-1){let r,a=i(e,t,n,s);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeLastWhere=function(e,t,n=-1,i=0){let r,a=s(e,t,n,i);return-1!==a&&(r=o(e,a)),{index:a,value:r}},e.removeAllWhere=function(e,t,n=0,i=-1){let s=e.length;if(0===s)return 0;n=n<0?Math.max(0,n+s):Math.min(n,s-1),i=i<0?Math.max(0,i+s):Math.min(i,s-1);let r=0;for(let o=0;o=n&&o<=i&&t(e[o],o)||i=n)&&t(e[o],o)?r++:r>0&&(e[o-r]=e[o]);return r>0&&(e.length=s-r),r}}(i||(i={})),function(e){e.rangeLength=function(e,t,n){return 0===n?1/0:e>t&&n>0||et?1:0}}(r||(r={}))},5082: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 i(e,s){if(e===s)return!0;if(t(e)||t(s))return!1;let r=n(e),o=n(s);return r===o&&(r&&o?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n>>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)},4016:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Signal:()=>o,Stream:()=>a});var i,s=n(5259),r=n(5082);class o{constructor(e){this.sender=e}connect(e,t){return i.connect(this,e,t)}disconnect(e,t){return i.disconnect(this,e,t)}emit(e){i.emit(this,e)}}!function(e){e.disconnectBetween=function(e,t){i.disconnectBetween(e,t)},e.disconnectSender=function(e){i.disconnectSender(e)},e.disconnectReceiver=function(e){i.disconnectReceiver(e)},e.disconnectAll=function(e){i.disconnectAll(e)},e.clearData=function(e){i.disconnectAll(e)},e.getExceptionHandler=function(){return i.exceptionHandler},e.setExceptionHandler=function(e){let t=i.exceptionHandler;return i.exceptionHandler=e,t}}(o||(o={}));class a extends o{constructor(){super(...arguments),this._pending=new r.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 r.PromiseDelegate;t.resolve({args:e,next:n}),super.emit(e)}stop(){this._pending.promise.catch((()=>{})),this._pending.reject("stop"),this._pending=new r.PromiseDelegate}}!function(e){function t(e){let t=i.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(r.get(t))}u(t)}}function n(e){let t=r.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(i.get(t))}u(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,n){n=n||void 0;let s=i.get(e.sender);if(s||(s=[],i.set(e.sender,s)),l(s,e,t,n))return!1;let o=n||t,a=r.get(o);a||(a=[],r.set(o,a));let c={signal:e,slot:t,thisArg:n};return s.push(c),a.push(c),!0},e.disconnect=function(e,t,n){n=n||void 0;let s=i.get(e.sender);if(!s||0===s.length)return!1;let o=l(s,e,t,n);if(!o)return!1;let a=n||t,c=r.get(a);return o.signal=null,u(s),u(c),!0},e.disconnectBetween=function(e,t){let n=i.get(e);if(!n||0===n.length)return;let s=r.get(t);if(s&&0!==s.length){for(const t of s)t.signal&&t.signal.sender===e&&(t.signal=null);u(n),u(s)}},e.disconnectSender=t,e.disconnectReceiver=n,e.disconnectAll=function(e){t(e),n(e)},e.emit=function(e,t){let n=i.get(e.sender);if(n&&0!==n.length)for(let i=0,s=n.length;ie.signal===t&&e.slot===n&&e.thisArg===i))}function c(t,n){let{signal:i,slot:s,thisArg:r}=t;try{s.call(r,i.sender,n)}catch(t){e.exceptionHandler(t)}}function u(e){0===o.size&&a(d),o.add(e)}function d(){o.forEach(h),o.clear()}function h(e){s.RO.removeAllWhere(e,p)}function p(e){return null===e.signal}}(i||(i={}))},9146:e=>{"use strict";function t(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e{"use strict";let i=n(9146);e.exports=new i(n(4415),n(3014))},3014:e=>{e.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},4415:e=>{e.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},1173:e=>{e.exports={}}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;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__.m=__webpack_modules__,__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var s=2&t&&e;"object"==typeof s&&!~leafPrototypes.indexOf(s);s=getProto(s))Object.getOwnPropertyNames(s).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,__webpack_require__.d(n,i),n},__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__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((t,n)=>(__webpack_require__.f[n](e,t),t)),[])),__webpack_require__.u=e=>e+".thebe-lite.min.js",__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),inProgress={},dataWebpackPrefix="thebe-lite:",__webpack_require__.l=(e,t,n,i)=>{if(inProgress[e])inProgress[e].push(t);else{var s,r;if(void 0!==n)for(var o=document.getElementsByTagName("script"),a=0;a{s.onerror=s.onload=null,clearTimeout(u);var i=inProgress[e];if(delete inProgress[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(n))),t)return t(n)},u=setTimeout(c.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=c.bind(null,s.onerror),s.onload=c.bind(null,s.onload),r&&document.head.appendChild(s)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{__webpack_require__.b=document.baseURI||self.location.href;var e={143:0};__webpack_require__.f.j=(t,n)=>{var i=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var s=new Promise(((n,s)=>i=e[t]=[n,s]));n.push(i[2]=s);var r=__webpack_require__.p+__webpack_require__.u(t),o=new Error;__webpack_require__.l(r,(n=>{if(__webpack_require__.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+s+": "+r+")",o.name="ChunkLoadError",o.type=s,o.request=r,i[1](o)}}),"chunk-"+t,t)}};var t=(t,n)=>{var i,s,[r,o,a]=n,l=0;if(r.some((t=>0!==e[t]))){for(i in o)__webpack_require__.o(o,i)&&(__webpack_require__.m[i]=o[i]);a&&a(__webpack_require__)}for(t&&t(n);lIntroduction: Two strands of computationGoogle Colab is a freely available platform for programming with Python that requires no local installation and provides decent compute resources (memory and processing power).

To use this document in Colab, follow the steps below (or watch this short video):

    -
  1. Click the rocket icon in the upper-right corner of this page.

  2. +
  3. Click the rocket icon in the upper-right corner of this page.

  4. Select the Google Colab option.

  5. A new tab should open in your browser, displaying the content of this page but in the Colab interface.

  6. -
  7. Click the option Save a copy of Drive to create your own copy of the document (so that you can preserve any changes you make as well as the output from your interactions).

  8. -
  9. The Colab version of the document is backed by a running instance of the Python kernel, meaning that you can run the code and see the results in the Colab interface. To run any of the code sections, click the play icon to the left of that section, as in the image below.

  10. -
  11. The logic of a programming language like Python is strictly linear. Running code sections out of order, or skipping a code section, will often result in errors, which will appear below the code section that triggered the error, in lieu of the expected output. If you start to encounter unexpected errors, go to the Colab menu at the top of the browser window and select Kernel - Restart Kernel. Then run each of the code sections in order, starting from the top of the document.

  12. +
  13. Within that tab, click the button Copy to Drive from the menu at the top to create your own copy of the document (so that you can preserve any changes you make as well as the output from your interactions).

  14. +
+Button with the text "Copy to Drive" and the Google Drive symbol +
    +
  1. The Colab version of the document is backed by a running instance of the Python kernel (the program that runs Python progams), meaning that you can run the code and see the results in the Colab interface. To run any of the code sections, click the play icon to the left of that section, as in the image below.

  2. +
+Python code with play button icon to the left; red arrow pointing to the play button. +
    +
  1. The logic of a programming language like Python is strictly linear. Running code sections out of order, or skipping a code section, will often result in errors, which will appear below the code section that triggered the error, in lieu of the expected output. If you start to encounter unexpected errors, go to the Colab menu at the top of the browser window and select Runtime - Restart Session. Then run each of the code sections in order, starting from the top of the document.

Note that the Reading the code sections, as well as footnotes and references, have been ommitted from the Colab version of this document in order to make the latter easier to use. So you may want to toggle back and forth between the two versions. (I apologize for that inconvenience – it’s a technical limitation I have not had time to address.)

@@ -473,9 +479,9 @@

Baby steps in Python -

In the encoding specified by the Python language, the equals sign (=) is an instruction that loosely translates to: “Store this value (on the right side) somewhere in memory, and give that location in memory the provided label (on the left side).” The following image presents one way of imagining what happens in response to this code (with the caveat that, ultimately, the letters and numbers are represented by their binary encoding).

-

[image here]

-

By running the previous line of code, we have created a variable called answer_to_everything. We can use the variable to retrieve its value (for use in other parts of our program). Run the code below to see some output.

+

In the encoding specified by the Python language, the equals sign (=) is an instruction that loosely translates to: “Store this value (on the right side) somewhere in memory, and give that location in memory the provided name (on the left side).” The following image presents one way of imagining what happens in response to this code (with the caveat that, ultimately, the letters and numbers are represented by their binary encoding).

+
Shows the words "answer to everything" in one box, with an arrow pointing to a box in the middle, from which another arrow points to the number 42 in the third box. The first box is labeled "name," the second "variable," and the third, "value." +

By running the previous line of code, we have created a variable, which maps the name answer_to_everything to the value 42. We can use the variable to retrieve its value (for use in other parts of our program). Run the code below to see some output.

print(answer_to_everything)
@@ -499,7 +505,7 @@ 

Baby steps in Python

-

A misspelled variable causes Python to abort its computation. Imagine if conversation ground to a halt whenever one of the parties mispronounced a word or used a malapropism!

+

A misspelled variable name causes Python to abort its computation. Imagine if conversation ground to a halt whenever one of the parties mispronounced a word or used a malapropism!

I tend to say that Python is extremely literal. But of course, this is merely an analogy, and a loose one. There is no room for metaphor in programming languages, at least, not as far as the computation itself is concerned. The operation of a language like Python is determined by the algorithms used to implement it. Given the same input and the same conditions of operation, a given Python program should produce the same output every time. (If it does not, that’s usually considered a bug.)

@@ -741,12 +747,12 @@

Language as a drunken walk

More tedious counting#

One way to construct such an analysis is as follows: represent your sample of text as a continuous string of characters. (As we’ve seen, that’s easy to do in Python.) Then “glue” it to another string, representing the same text, but with every character shifted to the left by one position. For example, the first several characters of the first sentence from Gargantua and Pantagruel would look like this:

-

[image]

-

With the exception of the dangling left-most and right-most characters, you now have a pair of strings that yield, for each position, a pair of characters.

-

[image with highlighting]

+The text "Most noble and illust" is shown twice, one two consecutive lines, with each letter surrounded by a box. The second line is shifted to the left one character, so that the "M" of the first line appears above the "o" of the second line, etc. +

With the exception of the dangling left-most and right-most characters, you now have a pair of strings that yield, for each position, a pair of characters. In the image below, the first few successive pairs are shown, along with the position of each pair of characters with respect to the “glued” strings.

+A table with the letters "h," a space, "o," "e," and "i" along the top (column headers), and "t," space, "c," "w," "s," and "g" along the left-hand side (row labels), and numbers in the cells of the table.

These pairs are called bigrams. But in order to construct a Markov chain, we’re not just counting bigrams. Rather, we want to create what’s called a transition table: a table where we can look up a given character – the letter e, say – and then for any other character that can follow e, find the frequency with which it occurs in that position (i.e., following an e). If a given character never follows another character, its bigram doesn’t exist in the table.

-

Below are shown the most common bigrams in such a transition table created on the basis of Gargantua and Pantagruel.

-

[image]

+

Below are shown some of the most common bigrams in such a transition table created on the basis of Gargantua and Pantagruel.

+The text "Most noble and illust" is shown as above, with the addition of alternating yellow and blue highlighting to identify pairs of letters, and numbers along the bottom, starting at 0.

Preparing the text#

@@ -980,9 +986,9 @@

Automatic writing#

More adept Ouija-board users can be simulated by increasing the size of our n-grams. As Shannon’s article demonstrates, the approximation to the English lexicon increases by moving from bigrams to trigrams – such that frequencies are calculated in terms of the occurrence of a given letter immediately after a pair of letters.

So instead of a table like this:

-

[image]

-

we have this:

-

[image]

+A table with the letters "h," a space, "o," "e," and "i" along the top (column headers), and "t," space, "c," "w," "s," and "g" along the left-hand side (row labels), and numbers in the cells of the table. +

we have this (where the h, b, and w in the row labels are all preceded by the space character):

+A table with the letters "e," "a," space, "i," "o" along the top (column headers), and "th," space "h", space "b"," "er," and space "w" along the left-hand side (row labels), and numbers in the cells of the table.

Note, however, that throughout these experiments, the level of approximation to any particular understanding of “the English lexicon” depends on the nature of the data from which we derive our frequencies. Urquhart’s translation of Rabelais, dating from the 16th Century, has a rather distinctive vocabulary, as you might expect, even with the modernized spelling and grammar of the Project Gutenberg edition.

The code below defines some interactive controls to make our experiments easier to manipulate. Run both sections of code to create the controls.

@@ -997,7 +1003,7 @@

More silly walksmax=max_value, description='Set value of n:') -def create_update_function(ttable, text, transition_function, slider): +def create_update_function(text, transition_function, slider): ''' returns a callback function for use in updating the provided transition table with ngrams from text, given slider.value, as well as an output widget for displaying the output of the callback @@ -1005,12 +1011,12 @@

More silly walksoutput = widgets.Output() def on_update(change): with output: - nonlocal ttable + global ttable ttable = transition_function(create_ngrams(text, slider.value)) print(f'Updated! Value of n is now {slider.value}.') return on_update, output -def create_generate_function(ttable, sample_function, slider): +def create_generate_function(sample_function, slider): ''' returns a callback function for use in generating new random samples from the provided trasition table. ''' @@ -1033,10 +1039,11 @@

More silly walks
-
ngram_slider = create_slider()
-update_callback, update_output = create_update_function(g_ttable, g_text_norm, create_transition_table, ngram_slider)
+
ttable = g_ttable
+ngram_slider = create_slider()
+update_callback, update_output = create_update_function(g_text_norm, create_transition_table, ngram_slider)
 update_button = create_button("Update table", update_callback)
-generate_callback, generate_output = create_generate_function(g_ttable, create_sample, ngram_slider)
+generate_callback, generate_output = create_generate_function(create_sample, ngram_slider)
 generate_button = create_button("New sample", generate_callback)
 display(ngram_slider, update_button, update_output, generate_button, generate_output)
 
@@ -1105,11 +1112,11 @@

A Rabelaisian chatbot
-
g_ttable_w = create_ttable_words(create_ngrams(g_text_words))
+
ttable = create_ttable_words(create_ngrams(g_text_words))
 ngram_slider_w = create_slider()
-update_callback_w, update_output_w = create_update_function(g_ttable_w, g_text_words, create_ttable_words, ngrams_slider_w)
+update_callback_w, update_output_w = create_update_function(g_text_words, create_ttable_words, ngram_slider_w)
 update_button_w = create_button("Update table", update_callback_w)
-generate_callback_w, generate_output_w = create_generate_function(g_ttable_w, create_sample_words)
+generate_callback_w, generate_output_w = create_generate_function(create_sample_words, ngram_slider_w)
 generate_button_w = create_button("New sample", generate_callback_w)
 display(ngram_slider_w, update_button_w, update_output_w, generate_button_w, generate_output_w)
 
diff --git a/searchindex.js b/searchindex.js index 517435e..538adb5 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["reading_writing_machines"], "filenames": ["reading_writing_machines.ipynb"], "titles": ["Reading Machines"], "terms": {"revolv": 0, "around": 0, "effort": 0, "autom": 0, "human": 0, "labor": 0, "And": 0, "develop": 0, "lovelac": [], "ture": 0, "beyond": [], "domin": 0, "concern": 0, "ha": 0, "been": 0, "specif": [], "refin": [], "algorithm": 0, "method": 0, "reduc": 0, "complex": 0, "calcul": 0, "other": 0, "oper": 0, "explicit": 0, "formal": 0, "rule": 0, "could": 0, "principl": [], "implement": 0, "rigor": 0, "precis": 0, "pure": 0, "mechan": 0, "eventu": [], "electron": 0, "mean": 0, "But": 0, "understand": 0, "form": 0, "gener": 0, "consider": 0, "onli": 0, "get": 0, "so": 0, "far": 0, "In": 0, "fact": 0, "when": 0, "come": 0, "larg": 0, "model": 0, "have": 0, "captiv": 0, "public": 0, "imagin": 0, "order": 0, "sens": 0, "unreason": 0, "effect": 0, "we": 0, "must": 0, "attend": 0, "anoth": 0, "one": 0, "which": 0, "though": 0, "bound": 0, "up": 0, "first": 0, "manifest": 0, "distinct": 0, "pressur": 0, "cite": 0, "instead": 0, "logic": 0, "mathemat": 0, "proof": 0, "draw": 0, "tradit": 0, "think": 0, "about": 0, "data": 0, "probabl": 0, "prescript": 0, "action": 0, "aim": 0, "descript": 0, "predict": 0, "non": 0, "aspect": 0, "world": 0, "kei": 0, "moment": 0, "light": 0, "later": 0, "remain": 0, "work": 0, "statist": 0, "structur": 0, "print": 0, "english": 0, "note": 0, "vs": [], "interact": 0, "reproduc": 0, "coupl": 0, "experi": 0, "report": 0, "hi": 0, "famou": 0, "articl": 0, "hope": 0, "pull": 0, "curtain": 0, "bit": 0, "what": 0, "seem": 0, "mani": 0, "evid": 0, "ghost": 0, "demystifi": [], "find": 0, "haunt": 0, "mayb": 0, "doesn": 0, "t": 0, "happen": 0, "where": 0, "assum": 0, "materi": 0, "follow": 0, "inspir": 0, "my": 0, "lydia": 0, "liu": 0, "freudian": 0, "robot": 0, "few": 0, "m": 0, "awar": 0, "deal": 0, "depth": 0, "allow": 0, "analyz": 0, "manipul": 0, "origin": 0, "deploi": 0, "without": 0, "benefit": 0, "like": 0, "ani": 0, "modern": 0, "progam": 0, "rel": 0, "trivial": 0, "ve": 0, "also": 0, "chosen": 0, "particular": 0, "format": 0, "web": 0, "base": 0, "expos": [], "perform": 0, "certainli": 0, "would": 0, "possibl": 0, "creat": 0, "seamless": 0, "app": 0, "conceal": 0, "all": 0, "end": 0, "user": 0, "appeal": 0, "becaus": 0, "thei": 0, "foster": 0, "impress": 0, "some": 0, "magic": 0, "take": 0, "place": 0, "behind": 0, "scene": 0, "part": 0, "disrupt": 0, "through": 0, "exampl": 0, "remaind": [], "you": 0, "ll": 0, "passag": [], "exposit": 0, "interspers": [], "block": [], "most": 0, "case": 0, "just": 0, "need": 0, "click": 0, "button": 0, "run": 0, "see": 0, "demonstr": 0, "prose": 0, "expound": [], "howev": 0, "want": 0, "section": 0, "skip": 0, "except": 0, "otherwis": 0, "instruct": 0, "caus": 0, "error": 0, "If": 0, "an": 0, "refresh": [], "page": 0, "onc": 0, "start": 0, "top": 0, "intend": 0, "prior": 0, "knowledg": [], "those": 0, "interest": 0, "deeper": [], "level": 0, "expand": [], "provid": 0, "syntax": 0, "each": 0, "necessari": 0, "might": 0, "learn": 0, "alreadi": 0, "know": 0, "befor": 0, "delv": 0, "let": 0, "clarifi": 0, "terminolog": 0, "below": 0, "goe": 0, "littl": 0, "detail": 0, "ar": 0, "than": 0, "rest": 0, "That": 0, "motiv": 0, "contrast": 0, "between": 0, "1": 0, "0": 0, "themselv": 0, "abstract": 0, "conveni": 0, "digit": 0, "seri": 0, "puls": 0, "switch": 0, "either": 0, "off": 0, "10": 0, "flip": 0, "time": 0, "everi": 0, "represent": 0, "everyth": 0, "can": 0, "ultim": 0, "binari": 0, "effici": 0, "addit": 0, "layer": 0, "basic": 0, "By": 0, "virtu": 0, "smartphon": 0, "familiar": 0, "concept": 0, "interfac": 0, "instanti": 0, "prescrib": 0, "devic": 0, "accomplish": 0, "well": 0, "defin": 0, "task": 0, "These": 0, "down": 0, "result": 0, "translat": 0, "It": 0, "further": 0, "process": 0, "singl": 0, "line": 0, "won": 0, "output": 0, "okai": 0, "answer_to_everyth": 0, "42": 0, "specifi": 0, "equal": 0, "sign": 0, "loos": 0, "store": 0, "valu": 0, "right": 0, "side": 0, "somewher": 0, "memori": 0, "give": 0, "locat": 0, "label": 0, "left": 0, "imag": 0, "present": 0, "wai": 0, "respons": 0, "caveat": 0, "letter": 0, "here": 0, "previou": 0, "variabl": 0, "call": 0, "retriev": 0, "its": 0, "function": 0, "command": 0, "displai": 0, "screen": 0, "term": 0, "context": 0, "refer": 0, "element": 0, "name": 0, "parenthes": 0, "enclos": 0, "argument": 0, "itself": 0, "previous": 0, "perfectli": 0, "arbitrari": 0, "saussurean": 0, "invent": 0, "design": 0, "drew": 0, "convent": 0, "found": 0, "point": 0, "noth": 0, "transpar": 0, "doe": 0, "least": 0, "speak": 0, "foreign": 0, "deduc": 0, "much": 0, "word": 0, "look": 0, "sound": 0, "unlik": 0, "natur": 0, "even": 0, "minor": 0, "deviat": 0, "usual": 0, "bring": 0, "whole": 0, "crash": 0, "halt": 0, "should": 0, "messag": 0, "answer_to_everythin": 0, "misspel": 0, "abort": 0, "convers": 0, "ground": 0, "whenev": 0, "parti": 0, "mispronounc": 0, "malaprop": 0, "sai": 0, "extrem": 0, "liter": 0, "cours": 0, "mere": 0, "analog": 0, "There": 0, "room": 0, "metaphor": 0, "determin": 0, "given": 0, "same": 0, "input": 0, "condit": 0, "produc": 0, "consid": 0, "bug": 0, "while": 0, "depend": 0, "too": 0, "As": 0, "engin": 0, "bell": 0, "lab": 0, "transmiss": 0, "involv": 0, "rather": 0, "factor": 0, "influenc": 0, "luxuri": 0, "insist": 0, "programm": 0, "fidel": 0, "exactli": 0, "written": 0, "forget": 0, "instanc": 0, "talk": 0, "phone": 0, "via": 0, "zoom": 0, "etc": 0, "hassl": 0, "had": 0, "strict": 0, "fault": 0, "intoler": 0, "To": 0, "type": 0, "am": 0, "among": 0, "illumin": 0, "relev": 0, "turn": 0, "briefli": 0, "a_text": 0, "nobl": 0, "illustri": 0, "drinker": 0, "thrice": 0, "preciou": 0, "pockifi": 0, "blade": 0, "none": 0, "els": 0, "dedic": 0, "alcibiad": 0, "dialogu": 0, "plato": 0, "entitl": 0, "banquet": 0, "whilst": 0, "he": 0, "forth": 0, "prais": 0, "schoolmast": 0, "socrat": 0, "question": 0, "princ": 0, "philosoph": 0, "amongst": 0, "discours": 0, "purpos": 0, "said": 0, "resembl": 0, "silen": 0, "abov": 0, "new": 0, "assign": 0, "string": 0, "sentenc": 0, "francoi": 0, "rabelai": 0, "earli": 0, "novel": 0, "gargantua": 0, "pantagruel": 0, "anyth": 0, "treat": 0, "numer": 0, "quotat": 0, "mark": 0, "doubl": 0, "One": 0, "problem": 0, "veri": 0, "sequenc": 0, "charact": 0, "recogn": 0, "alphabet": 0, "punctuat": 0, "perspect": 0, "essenti": 0, "access": 0, "suppli": 0, "posit": 0, "5": 0, "11": 0, "50": 0, "divid": 0, "piec": 0, "occur": 0, "white": 0, "return": 0, "list": 0, "construct": 0, "smaller": 0, "split": 0, "correspond": 0, "individu": 0, "realli": 0, "neither": 0, "nor": 0, "fair": 0, "approach": 0, "inform": 0, "ideal": 0, "research": 0, "western": 0, "europ": 0, "unit": 0, "state": 0, "decad": 0, "bertrand": 0, "russel": 0, "mathematician": 0, "david": 0, "hilbert": 0, "sought": 0, "unifi": 0, "scientif": 0, "disciplin": 0, "goal": 0, "identifi": 0, "core": 0, "axiom": 0, "thought": 0, "express": 0, "zero": 0, "uncertainti": 0, "ambigu": 0, "plagu": 0, "tool": 0, "within": 0, "alan": 0, "becom": 0, "On": 0, "face": 0, "easi": 0, "conclus": 0, "sinc": 0, "bottom": 0, "implicitli": 0, "challeng": 0, "assumpt": 0, "resort": 0, "quantifi": 0, "out": 0, "began": 0, "observ": 0, "pattern": 0, "Of": 0, "insight": 0, "begin": 0, "predat": 0, "him": 0, "specul": 0, "featur": 0, "practic": 0, "urgenc": 0, "longer": 0, "cryptograph": 0, "commun": 0, "polit": 0, "militari": 0, "9th": 0, "centuri": 0, "ce": 0, "arab": 0, "al": 0, "kindi": 0, "compos": 0, "cryptographi": 0, "describ": 0, "frequenc": 0, "alongsid": 0, "typic": 0, "credit": 0, "surviv": 0, "analysi": 0, "direct": 0, "precursor": 0, "popular": 0, "domain": 0, "closer": 0, "heart": 0, "humanist": 0, "russian": 0, "andrei": 0, "markov": 0, "1913": 0, "address": 0, "academi": 0, "scienc": 0, "aleksandr": 0, "pushkin": 0, "evegnii": 0, "onegin": 0, "occurr": 0, "conson": 0, "vowel": 0, "chapter": 0, "vers": 0, "todai": 0, "improv": 0, "isol": 0, "co": 0, "articul": 0, "sequenti": 0, "power": 0, "lend": 0, "chain": 0, "shortli": 0, "illustr": 0, "feel": 0, "suffici": 0, "length": 0, "urquhart": 0, "gargantu": 0, "everyman": 0, "librari": 0, "edit": 0, "clock": 0, "respect": 0, "823": 0, "decent": 0, "sampl": 0, "were": 0, "himself": 0, "proce": 0, "sheet": 0, "paper": 0, "go": 0, "besid": 0, "your": 0, "encount": 0, "fortun": 0, "avail": 0, "ourselv": 0, "download": 0, "project": 0, "gutenberg": 0, "save": 0, "file": 0, "Then": 0, "properti": 0, "iter": 0, "over": 0, "them": 0, "urllib": 0, "request": 0, "import": 0, "urlretriev": 0, "http": 0, "www": 0, "org": 0, "cach": 0, "epub": 0, "1200": 0, "pg1200": 0, "txt": 0, "open": 0, "f": 0, "g_text": 0, "statement": 0, "load": 0, "extern": 0, "e": 0, "wasn": 0, "session": 0, "recogniz": 0, "organ": 0, "easili": 0, "reusabl": 0, "sourc": 0, "build": 0, "re": 0, "visibl": 0, "fetch": 0, "url": 0, "pair": 0, "second": 0, "next": 0, "indic": 0, "indent": 0, "content": 0, "henceforth": 0, "entireti": 0, "For": 0, "durat": 0, "close": 0, "browser": 0, "tab": 0, "lose": 0, "insid": 0, "algebra": 0, "stand": 0, "appear": 0, "acquir": 0, "worth": 0, "reiter": 0, "choic": 0, "tri": 0, "suggest": 0, "stylist": 0, "easier": 0, "len": 0, "version": 0, "2": 0, "million": 0, "initi": 0, "exercis": 0, "map": 0, "g_charact": 0, "reveal": 0, "often": 0, "curli": 0, "brace": 0, "outermost": 0, "dictionari": 0, "sort": 0, "contain": 0, "g_characters_": 0, "consist": 0, "integ": 0, "empti": 0, "loop": 0, "hold": 0, "keyword": 0, "current": 0, "under": 0, "check": 0, "whether": 0, "solv": 0, "x": 0, "equat": 0, "associ": 0, "increment": 0, "hash": 0, "add": 0, "talli": 0, "standard": 0, "latin": 0, "script": 0, "symbol": 0, "n": 0, "break": 0, "commonli": 0, "align": 0, "studi": 0, "textual": 0, "corpora": 0, "item": 0, "lambda": 0, "revers": 0, "true": 0, "last": 0, "sacrific": 0, "clariti": 0, "breviti": 0, "refrain": 0, "simpler": 0, "fundament": 0, "built": 0, "option": 0, "descend": 0, "squar": 0, "bracket": 0, "now": 0, "At": 0, "li": 0, "notion": 0, "perhap": 0, "easiest": 0, "compar": 0, "select": 0, "weight": 0, "accord": 0, "abcdefghijklmnopqrstuvwxyz": 0, "join": 0, "k": 0, "roll": 0, "26": 0, "die": 0, "trial": 0, "simplic": 0, "sake": 0, "remov": 0, "lowercas": 0, "accent": 0, "g_alpha_char": 0, "c": 0, "notic": 0, "extent": 0, "dice": 0, "both": 0, "still": 0, "expect": 0, "hide": 0, "evenli": 0, "size": 0, "readabl": 0, "separ": 0, "parallel": 0, "account": 0, "final": 0, "presenc": 0, "suppl": 0, "tell": 0, "innov": 0, "realiz": 0, "delimit": 0, "fail": 0, "boundari": 0, "includ": 0, "g_shannon_char": 0, "mai": 0, "averag": 0, "haven": 0, "actual": 0, "exclus": 0, "unpack": 0, "equival": 0, "bag": 0, "scrabbl": 0, "tile": 0, "amount": 0, "z": 0, "repeat": 0, "record": 0, "put": 0, "theori": 0, "intuit": 0, "util": 0, "limit": 0, "better": 0, "approxim": 0, "larger": 0, "behavior": 0, "aggreg": 0, "dwell": 0, "latent": 0, "speech": 0, "syntact": 0, "classic": 0, "entiti": 0, "discuss": 0, "claim": 0, "therein": 0, "underli": 0, "onto": 0, "grammat": 0, "chomskian": 0, "grammar": 0, "latter": 0, "paradigm": 0, "search": 0, "treatment": 0, "phenomena": 0, "biolog": 0, "popul": 0, "financi": 0, "market": 0, "weather": 0, "system": 0, "taken": 0, "simpli": 0, "plai": 0, "arriv": 0, "remot": 0, "attempt": 0, "made": 0, "held": 0, "valid": 0, "faculti": 0, "best": 0, "someth": 0, "emot": 0, "german": 0, "inn": 0, "1948": 0, "semant": 0, "irrelev": 0, "devis": 0, "exclud": 0, "vengeanc": 0, "special": 0, "immedi": 0, "convention": 0, "explain": 0, "person": 0, "who": 0, "drink": 0, "stumbl": 0, "situat": 0, "abl": 0, "try": 0, "fall": 0, "distanc": 0, "lot": 0, "physic": 0, "show": 0, "continu": 0, "seen": 0, "glue": 0, "shift": 0, "sever": 0, "With": 0, "dangl": 0, "yield": 0, "highlight": 0, "bigram": 0, "transit": 0, "never": 0, "exist": 0, "shown": 0, "common": 0, "basi": 0, "simplifi": 0, "extra": 0, "convert": 0, "aesthet": 0, "presuppos": 0, "accompani": 0, "clean": 0, "def": 0, "normalize_text": 0, "contigu": 0, "text_low": 0, "lower": 0, "replac": 0, "text_norm": 0, "char": 0, "g_text_norm": 0, "1000": 0, "bulk": 0, "procedur": 0, "normal": 0, "b": 0, "ensur": 0, "don": 0, "multipl": 0, "belong": 0, "techniqu": 0, "help": 0, "000": 0, "isn": 0, "perfect": 0, "trust": 0, "disappear": 0, "french": 0, "proper": 0, "noun": 0, "smooth": 0, "create_ngram": 0, "paramet": 0, "higher": 0, "combin": 0, "three": 0, "success": 0, "trigram": 0, "quadgram": 0, "ngram": 0, "greater": 0, "tupl": 0, "text_arrai": 0, "rang": 0, "last_index": 0, "append": 0, "zip": 0, "cryptic": 0, "transform": 0, "copi": 0, "lop": 0, "3": 0, "slice": 0, "portion": 0, "antepenulim": 0, "penultim": 0, "third": 0, "reflect": 0, "group": 0, "occupi": 0, "visual": 0, "small": 0, "collect": 0, "nest": 0, "subcollect": 0, "window": 0, "move": 0, "create_transition_t": 0, "counter": 0, "outer": 0, "nth": 0, "ttabl": 0, "gram": 0, "thu": 0, "hand": 0, "alwai": 0, "matter": 0, "certain": 0, "th": 0, "o": 0, "whatev": 0, "definit": 0, "after": 0, "g_ttabl": 0, "significantli": 0, "bigger": 0, "frequent": 0, "h": 0, "fairli": 0, "panda": 0, "finish": 0, "pd": 0, "set_opt": 0, "datafram": 0, "from_dict": 0, "orient": 0, "index": 0, "row": 0, "column": 0, "across": 0, "idea": 0, "choos": 0, "fill": 0, "big": 0, "cell": 0, "nan": 0, "null": 0, "chracter": 0, "4": 0, "create_sampl": 0, "100": 0, "default": 0, "starting_char": 0, "first_char": 0, "last_char": 0, "l": 0, "generated_text": 0, "_": 0, "next_char": 0, "randomli": 0, "updat": 0, "throughout": 0, "keep": 0, "track": 0, "deriv": 0, "full": 0, "nonsens": 0, "being": 0, "agre": 0, "pinpoint": 0, "remind": 0, "me": 0, "outcom": 0, "ouija": 0, "board": 0, "almost": 0, "emerg": 0, "pool": 0, "subconsci": 0, "sink": 0, "murk": 0, "adept": 0, "simul": 0, "increas": 0, "lexicon": 0, "date": 0, "16th": 0, "vocabulari": 0, "spell": 0, "control": 0, "ipywidget": 0, "widget": 0, "ipython": 0, "create_slid": 0, "min_valu": 0, "max_valu": 0, "intslid": 0, "min": 0, "max": 0, "create_update_funct": 0, "transition_funct": 0, "slider": 0, "callback": 0, "on_upd": 0, "chang": 0, "nonloc": 0, "create_generate_funct": 0, "sample_funct": 0, "trasit": 0, "on_gener": 0, "create_button": 0, "handler": 0, "on_click": 0, "ngram_slid": 0, "update_callback": 0, "update_output": 0, "update_button": 0, "generate_callback": 0, "generate_output": 0, "generate_button": 0, "recreat": 0, "bundl": 0, "html": 0, "alogorithm": 0, "modifi": 0, "compel": 0, "fun": 0, "glimmer": 0, "entir": 0, "orgin": 0, "token": 0, "emploi": 0, "similar": 0, "sophist": 0, "suffic": 0, "g_text_word": 0, "took": 0, "create_ttable_word": 0, "create_sample_word": 0, "starting_word": 0, "first_word": 0, "last_word": 0, "next_word": 0, "g_ttable_w": 0, "ngram_slider_w": 0, "update_callback_w": 0, "update_output_w": 0, "ngrams_slider_w": 0, "update_button_w": 0, "generate_callback_w": 0, "generate_output_w": 0, "generate_button_w": 0, "variou": 0, "appar": 0, "disclos": 0, "THE": 0, "head": 0, "AND": 0, "IN": 0, "frontal": 0, "attack": 0, "ON": 0, "writer": 0, "THAT": 0, "OF": 0, "IS": 0, "therefor": 0, "FOR": 0, "whoever": 0, "told": 0, "unexpect": 0, "suspici": 0, "fortuit": 0, "mention": 0, "got": 0, "didn": 0, "fudg": 0, "endur": 0, "charm": 0, "propens": 0, "uncanni": 0, "stretch": 0, "aris": 0, "proport": 0, "uniqu": 0, "match": 0, "clear": 0, "plainli": 0, "measur": 0, "novelti": 0, "percentag": 0, "40": 0, "less": 0, "half": 0, "constitut": 0, "phrase": 0, "spontan": 0, "utter": 0, "hard": 0, "answer": 0, "computation": 0, "obvious": 0, "pick": 0, "untruss": 0, "estim": 0, "num_uniqu": 0, "text_sampl": 0, "ngrams_sampl": 0, "this_num": 0, "sum": 0, "exact": 0, "score": 0, "total": 0, "doubt": 0, "quit": 0, "leap": 0, "rudimentari": 0, "artif": 0, "pois": 0, "deep": 0, "neural": 0, "network": 0, "chap": 0, "vastli": 0, "complic": 0, "mathamemat": 0, "train": 0, "unimagin": 0, "immens": 0, "yet": 0, "real": 0, "latest": 0, "capac": 0, "overlap": 0, "relat": 0, "g": 0, "captur": 0, "paragraph": 0, "sheer": 0, "lead": 0, "abil": 0, "mimic": 0, "genr": 0, "high": 0, "degre": 0, "gtp": 0, "led": 0, "critic": 0, "stochast": 0, "parrot": 0, "difficulti": 0, "safeguard": 0, "against": 0, "hate": 0, "fake": 0, "fals": 0, "citat": 0, "prove": 0, "technic": 0, "myself": 0, "decorum": 0, "character": 0, "meant": 0, "fashion": 0, "discurs": 0, "recal": 0, "conscious": 0, "worri": 0, "correctli": 0, "unintention": 0, "plagiar": 0, "essai": 0, "thesi": 0, "great": 0, "startl": 0, "nonetheless": 0, "imput": 0, "consciou": 0, "inclin": 0, "lacan": 0, "famous": 0, "apt": 0, "psych": 0, "debat": 0, "catch": 0, "glimps": 0, "humbl": 0, "markovian": 0, "riot": 0, "wander": 0, "lexic": 0, "pleasur": 0, "offer": 0, "habit": 0, "spirit": 0, "Not": 0, "deu": 0, "ex": 0, "machina": 0, "technolog": 0, "alien": 0, "oppress": 0, "borrow": 0, "bakhtin": 0, "carnivalesqu": 0, "mirror": 0, "freedom": 0, "restraint": 0, "affirm": 0, "momentari": 0, "invers": 0, "prevail": 0, "thing": 0, "repositori": 0, "act": 0, "ilk": [], "test": [], "trope": [], "fiction": [], "topic": [], "seriou": [], "chiefli": [], "scientist": [], "ubiqitu": [], "pastim": [], "regularli": [], "internet": [], "particip": [], "disconcert": [], "listen": [], "propos": [], "phenomenolog": [], "benchmark": [], "successfulli": [], "reliabl": [], "fool": [], "interlocutor": [], "grant": [], "presumpt": [], "spring": [], "arguabl": [], "celebr": [], "contemporari": [], "1940": [], "noteworthi": [], "frame": 0, "regardless": [], "signific": [], "introduc": [], "underpin": [], "swath": [], "telecommun": [], "infrastructur": [], "pave": [], "satur": [], "mediascap": [], "although": [], "proven": [], "medium": [], "guid": [], "intellectu": [], "activ": [], "panopli": [], "departur": [], "lai": [], "resourc": 0, "scholarli": [], "esqu": [], "framework": [], "wherein": [], "primari": [], "hearken": [], "probabilist": [], "couldn": [], "siri": [], "regard": [], "tread": [], "necessarili": [], "sure": [], "promin": [], "booster": [], "narr": 0, "thi": 0, "central": 0, "role": 0, "chat": 0, "gpt": 0, "us": 0, "claud": 0, "shannon": 0, "document": 0, "back": 0, "notebook": 0, "support": 0, "ralei": 0, "rhee": 0, "cultiv": 0, "participatori": 0, "embodi": 0, "expertis": 0, "rhetor": 0, "preval": 0, "mixtur": 0, "expositori": 0, "complement": 0, "Such": 0, "evok": 0, "empir": 0, "warrant": 0, "from": 0, "author": 0, "experiment": 0, "protocol": 0, "reader": 0, "oppos": 0, "spoke": 0, "praxi": 0, "mind": 0, "accordingli": 0, "book": 0, "annnot": 0, "annot": 0, "exposur": 0, "introductori": 0, "titl": 0, "encourag": 0, "execut": 0, "enumer": 0, "altern": 0, "vari": 0, "clearli": 0, "assess": 0, "googl": 0, "colaboratori": 0, "servic": 0, "colab": 0, "freeli": 0, "platform": 0, "requir": 0, "local": 0, "instal": 0, "watch": 0, "short": 0, "video": 0, "rocket": 0, "icon": 0, "upper": 0, "corner": 0, "drive": 0, "own": 0, "preserv": 0, "kernel": 0, "strictli": 0, "linear": 0, "trigger": 0, "lieu": 0, "menu": 0, "restart": 0, "footnot": 0, "ommit": 0, "toggl": 0, "apolog": 0, "inconveni": 0, "tend": 0, "again": 0, "conceptu": 0, "precipt": 0, "philosophi": 0, "philolog": 0, "valenc": 0, "binder": 0, "hardli": 0, "free": 0, "writ": 0, "apart": 0, "concret": 0, "serv": 0, "leve": 0, "social": 0, "wholli": 0, "inadequ": 0, "pose": 0, "circul": 0, "wide": 0, "recent": 0, "year": 0, "capabl": 0, "dataset": 0, "especi": 0, "mathematic": 0, "melani": 0, "walsh": 0, "onlin": 0, "cultur": 0, "analyt": 0, "lesson": 0, "historian": 0, "websit": 0, "tutori": 0, "jstor": 0, "constel": 0, "impli": 0, "artifici": 0, "prolifer": 0, "increasingli": 0, "focus": 0, "dispens": 0, "idiom": 0, "upsurg": 0, "prompt": 0, "impos": 0, "burden": 0, "mediat": 0, "upon": 0, "advisedli": 0, "scare": 0, "quot": 0, "cleaner": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"read": 0, "machin": 0, "explor": 0, "linguist": 0, "unconsci": 0, "ai": 0, "introduct": 0, "two": 0, "strand": 0, "comput": 0, "how": 0, "us": [], "thi": [], "document": [], "kind": 0, "code": 0, "program": 0, "s": 0, "babi": 0, "step": 0, "python": 0, "encod": 0, "text": 0, "repres": 0, "languag": 0, "chanc": 0, "The": 0, "long": 0, "histori": 0, "A": 0, "spate": 0, "tediou": 0, "count": 0, "random": 0, "write": 0, "differ": 0, "space": 0, "make": 0, "law": 0, "abid": 0, "number": 0, "drunken": 0, "walk": 0, "more": 0, "prepar": 0, "set": 0, "tabl": 0, "automat": 0, "silli": 0, "rabelaisian": 0, "chatbot": 0, "wa": 0, "our": 0, "did": 0, "i": 0, "do": 0, "carniv": 0, "intellig": 0, "from": [], "claud": [], "shannon": [], "chat": [], "gpt": [], "back": [], "again": []}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinxcontrib.bibtex": 9, "sphinx": 56}}) \ No newline at end of file +Search.setIndex({"docnames": ["reading_writing_machines"], "filenames": ["reading_writing_machines.ipynb"], "titles": ["Reading Machines"], "terms": {"revolv": 0, "around": 0, "effort": 0, "autom": 0, "human": 0, "labor": 0, "And": 0, "develop": 0, "lovelac": [], "ture": 0, "beyond": [], "domin": 0, "concern": 0, "ha": 0, "been": 0, "specif": [], "refin": [], "algorithm": 0, "method": 0, "reduc": 0, "complex": 0, "calcul": 0, "other": 0, "oper": 0, "explicit": 0, "formal": 0, "rule": 0, "could": 0, "principl": [], "implement": 0, "rigor": 0, "precis": 0, "pure": 0, "mechan": 0, "eventu": [], "electron": 0, "mean": 0, "But": 0, "understand": 0, "form": 0, "gener": 0, "consider": 0, "onli": 0, "get": 0, "so": 0, "far": 0, "In": 0, "fact": 0, "when": 0, "come": 0, "larg": 0, "model": 0, "have": 0, "captiv": 0, "public": 0, "imagin": 0, "order": 0, "sens": 0, "unreason": 0, "effect": 0, "we": 0, "must": 0, "attend": 0, "anoth": 0, "one": 0, "which": 0, "though": 0, "bound": 0, "up": 0, "first": 0, "manifest": 0, "distinct": 0, "pressur": 0, "cite": 0, "instead": 0, "logic": 0, "mathemat": 0, "proof": 0, "draw": 0, "tradit": 0, "think": 0, "about": 0, "data": 0, "probabl": 0, "prescript": 0, "action": 0, "aim": 0, "descript": 0, "predict": 0, "non": 0, "aspect": 0, "world": 0, "kei": 0, "moment": 0, "light": 0, "later": 0, "remain": 0, "work": 0, "statist": 0, "structur": 0, "print": 0, "english": 0, "note": 0, "vs": [], "interact": 0, "reproduc": 0, "coupl": 0, "experi": 0, "report": 0, "hi": 0, "famou": 0, "articl": 0, "hope": 0, "pull": 0, "curtain": 0, "bit": 0, "what": 0, "seem": 0, "mani": 0, "evid": 0, "ghost": 0, "demystifi": [], "find": 0, "haunt": 0, "mayb": 0, "doesn": 0, "t": 0, "happen": 0, "where": 0, "assum": 0, "materi": 0, "follow": 0, "inspir": 0, "my": 0, "lydia": 0, "liu": 0, "freudian": 0, "robot": 0, "few": 0, "m": 0, "awar": 0, "deal": 0, "depth": 0, "allow": 0, "analyz": 0, "manipul": 0, "origin": 0, "deploi": 0, "without": 0, "benefit": 0, "like": 0, "ani": 0, "modern": 0, "progam": 0, "rel": 0, "trivial": 0, "ve": 0, "also": 0, "chosen": 0, "particular": 0, "format": 0, "web": 0, "base": 0, "expos": [], "perform": 0, "certainli": 0, "would": 0, "possibl": 0, "creat": 0, "seamless": 0, "app": 0, "conceal": 0, "all": 0, "end": 0, "user": 0, "appeal": 0, "becaus": 0, "thei": 0, "foster": 0, "impress": 0, "some": 0, "magic": 0, "take": 0, "place": 0, "behind": 0, "scene": 0, "part": 0, "disrupt": 0, "through": 0, "exampl": 0, "remaind": [], "you": 0, "ll": 0, "passag": [], "exposit": 0, "interspers": [], "block": [], "most": 0, "case": 0, "just": 0, "need": 0, "click": 0, "button": 0, "run": 0, "see": 0, "demonstr": 0, "prose": 0, "expound": [], "howev": 0, "want": 0, "section": 0, "skip": 0, "except": 0, "otherwis": 0, "instruct": 0, "caus": 0, "error": 0, "If": 0, "an": 0, "refresh": [], "page": 0, "onc": 0, "start": 0, "top": 0, "intend": 0, "prior": 0, "knowledg": [], "those": 0, "interest": 0, "deeper": [], "level": 0, "expand": [], "provid": 0, "syntax": 0, "each": 0, "necessari": 0, "might": 0, "learn": 0, "alreadi": 0, "know": 0, "befor": 0, "delv": 0, "let": 0, "clarifi": 0, "terminolog": 0, "below": 0, "goe": 0, "littl": 0, "detail": 0, "ar": 0, "than": 0, "rest": 0, "That": 0, "motiv": 0, "contrast": 0, "between": 0, "1": 0, "0": 0, "themselv": 0, "abstract": 0, "conveni": 0, "digit": 0, "seri": 0, "puls": 0, "switch": 0, "either": 0, "off": 0, "10": 0, "flip": 0, "time": 0, "everi": 0, "represent": 0, "everyth": 0, "can": 0, "ultim": 0, "binari": 0, "effici": 0, "addit": 0, "layer": 0, "basic": 0, "By": 0, "virtu": 0, "smartphon": 0, "familiar": 0, "concept": 0, "interfac": 0, "instanti": 0, "prescrib": 0, "devic": 0, "accomplish": 0, "well": 0, "defin": 0, "task": 0, "These": 0, "down": 0, "result": 0, "translat": 0, "It": 0, "further": 0, "process": 0, "singl": 0, "line": 0, "won": 0, "output": 0, "okai": 0, "answer_to_everyth": 0, "42": 0, "specifi": 0, "equal": 0, "sign": 0, "loos": 0, "store": 0, "valu": 0, "right": 0, "side": 0, "somewher": 0, "memori": 0, "give": 0, "locat": 0, "label": 0, "left": 0, "imag": 0, "present": 0, "wai": 0, "respons": 0, "caveat": 0, "letter": 0, "here": 0, "previou": 0, "variabl": 0, "call": 0, "retriev": 0, "its": 0, "function": 0, "command": 0, "displai": 0, "screen": 0, "term": 0, "context": 0, "refer": 0, "element": 0, "name": 0, "parenthes": 0, "enclos": 0, "argument": 0, "itself": 0, "previous": 0, "perfectli": 0, "arbitrari": 0, "saussurean": 0, "invent": 0, "design": 0, "drew": 0, "convent": 0, "found": 0, "point": 0, "noth": 0, "transpar": 0, "doe": 0, "least": 0, "speak": 0, "foreign": 0, "deduc": 0, "much": 0, "word": 0, "look": 0, "sound": 0, "unlik": 0, "natur": 0, "even": 0, "minor": 0, "deviat": 0, "usual": 0, "bring": 0, "whole": 0, "crash": 0, "halt": 0, "should": 0, "messag": 0, "answer_to_everythin": 0, "misspel": 0, "abort": 0, "convers": 0, "ground": 0, "whenev": 0, "parti": 0, "mispronounc": 0, "malaprop": 0, "sai": 0, "extrem": 0, "liter": 0, "cours": 0, "mere": 0, "analog": 0, "There": 0, "room": 0, "metaphor": 0, "determin": 0, "given": 0, "same": 0, "input": 0, "condit": 0, "produc": 0, "consid": 0, "bug": 0, "while": 0, "depend": 0, "too": 0, "As": 0, "engin": 0, "bell": 0, "lab": 0, "transmiss": 0, "involv": 0, "rather": 0, "factor": 0, "influenc": 0, "luxuri": 0, "insist": 0, "programm": 0, "fidel": 0, "exactli": 0, "written": 0, "forget": 0, "instanc": 0, "talk": 0, "phone": 0, "via": 0, "zoom": 0, "etc": 0, "hassl": 0, "had": 0, "strict": 0, "fault": 0, "intoler": 0, "To": 0, "type": 0, "am": 0, "among": 0, "illumin": 0, "relev": 0, "turn": 0, "briefli": 0, "a_text": 0, "nobl": 0, "illustri": 0, "drinker": 0, "thrice": 0, "preciou": 0, "pockifi": 0, "blade": 0, "none": 0, "els": 0, "dedic": 0, "alcibiad": 0, "dialogu": 0, "plato": 0, "entitl": 0, "banquet": 0, "whilst": 0, "he": 0, "forth": 0, "prais": 0, "schoolmast": 0, "socrat": 0, "question": 0, "princ": 0, "philosoph": 0, "amongst": 0, "discours": 0, "purpos": 0, "said": 0, "resembl": 0, "silen": 0, "abov": 0, "new": 0, "assign": 0, "string": 0, "sentenc": 0, "francoi": 0, "rabelai": 0, "earli": 0, "novel": 0, "gargantua": 0, "pantagruel": 0, "anyth": 0, "treat": 0, "numer": 0, "quotat": 0, "mark": 0, "doubl": 0, "One": 0, "problem": 0, "veri": 0, "sequenc": 0, "charact": 0, "recogn": 0, "alphabet": 0, "punctuat": 0, "perspect": 0, "essenti": 0, "access": 0, "suppli": 0, "posit": 0, "5": 0, "11": 0, "50": 0, "divid": 0, "piec": 0, "occur": 0, "white": 0, "return": 0, "list": 0, "construct": 0, "smaller": 0, "split": 0, "correspond": 0, "individu": 0, "realli": 0, "neither": 0, "nor": 0, "fair": 0, "approach": 0, "inform": 0, "ideal": 0, "research": 0, "western": 0, "europ": 0, "unit": 0, "state": 0, "decad": 0, "bertrand": 0, "russel": 0, "mathematician": 0, "david": 0, "hilbert": 0, "sought": 0, "unifi": 0, "scientif": 0, "disciplin": 0, "goal": 0, "identifi": 0, "core": 0, "axiom": 0, "thought": 0, "express": 0, "zero": 0, "uncertainti": 0, "ambigu": 0, "plagu": 0, "tool": 0, "within": 0, "alan": 0, "becom": 0, "On": 0, "face": 0, "easi": 0, "conclus": 0, "sinc": 0, "bottom": 0, "implicitli": 0, "challeng": 0, "assumpt": 0, "resort": 0, "quantifi": 0, "out": 0, "began": 0, "observ": 0, "pattern": 0, "Of": 0, "insight": 0, "begin": 0, "predat": 0, "him": 0, "specul": 0, "featur": 0, "practic": 0, "urgenc": 0, "longer": 0, "cryptograph": 0, "commun": 0, "polit": 0, "militari": 0, "9th": 0, "centuri": 0, "ce": 0, "arab": 0, "al": 0, "kindi": 0, "compos": 0, "cryptographi": 0, "describ": 0, "frequenc": 0, "alongsid": 0, "typic": 0, "credit": 0, "surviv": 0, "analysi": 0, "direct": 0, "precursor": 0, "popular": 0, "domain": 0, "closer": 0, "heart": 0, "humanist": 0, "russian": 0, "andrei": 0, "markov": 0, "1913": 0, "address": 0, "academi": 0, "scienc": 0, "aleksandr": 0, "pushkin": 0, "evegnii": 0, "onegin": 0, "occurr": 0, "conson": 0, "vowel": 0, "chapter": 0, "vers": 0, "todai": 0, "improv": 0, "isol": 0, "co": 0, "articul": 0, "sequenti": 0, "power": 0, "lend": 0, "chain": 0, "shortli": 0, "illustr": 0, "feel": 0, "suffici": 0, "length": 0, "urquhart": 0, "gargantu": 0, "everyman": 0, "librari": 0, "edit": 0, "clock": 0, "respect": 0, "823": 0, "decent": 0, "sampl": 0, "were": 0, "himself": 0, "proce": 0, "sheet": 0, "paper": 0, "go": 0, "besid": 0, "your": 0, "encount": 0, "fortun": 0, "avail": 0, "ourselv": 0, "download": 0, "project": 0, "gutenberg": 0, "save": 0, "file": 0, "Then": 0, "properti": 0, "iter": 0, "over": 0, "them": 0, "urllib": 0, "request": 0, "import": 0, "urlretriev": 0, "http": 0, "www": 0, "org": 0, "cach": 0, "epub": 0, "1200": 0, "pg1200": 0, "txt": 0, "open": 0, "f": 0, "g_text": 0, "statement": 0, "load": 0, "extern": 0, "e": 0, "wasn": 0, "session": 0, "recogniz": 0, "organ": 0, "easili": 0, "reusabl": 0, "sourc": 0, "build": 0, "re": 0, "visibl": 0, "fetch": 0, "url": 0, "pair": 0, "second": 0, "next": 0, "indic": 0, "indent": 0, "content": 0, "henceforth": 0, "entireti": 0, "For": 0, "durat": 0, "close": 0, "browser": 0, "tab": 0, "lose": 0, "insid": 0, "algebra": 0, "stand": 0, "appear": 0, "acquir": 0, "worth": 0, "reiter": 0, "choic": 0, "tri": 0, "suggest": 0, "stylist": 0, "easier": 0, "len": 0, "version": 0, "2": 0, "million": 0, "initi": 0, "exercis": 0, "map": 0, "g_charact": 0, "reveal": 0, "often": 0, "curli": 0, "brace": 0, "outermost": 0, "dictionari": 0, "sort": 0, "contain": 0, "g_characters_": 0, "consist": 0, "integ": 0, "empti": 0, "loop": 0, "hold": 0, "keyword": 0, "current": 0, "under": 0, "check": 0, "whether": 0, "solv": 0, "x": 0, "equat": 0, "associ": 0, "increment": 0, "hash": 0, "add": 0, "talli": 0, "standard": 0, "latin": 0, "script": 0, "symbol": 0, "n": 0, "break": 0, "commonli": 0, "align": 0, "studi": 0, "textual": 0, "corpora": 0, "item": 0, "lambda": 0, "revers": 0, "true": 0, "last": 0, "sacrific": 0, "clariti": 0, "breviti": 0, "refrain": 0, "simpler": 0, "fundament": 0, "built": 0, "option": 0, "descend": 0, "squar": 0, "bracket": 0, "now": 0, "At": 0, "li": 0, "notion": 0, "perhap": 0, "easiest": 0, "compar": 0, "select": 0, "weight": 0, "accord": 0, "abcdefghijklmnopqrstuvwxyz": 0, "join": 0, "k": 0, "roll": 0, "26": 0, "die": 0, "trial": 0, "simplic": 0, "sake": 0, "remov": 0, "lowercas": 0, "accent": 0, "g_alpha_char": 0, "c": 0, "notic": 0, "extent": 0, "dice": 0, "both": 0, "still": 0, "expect": 0, "hide": 0, "evenli": 0, "size": 0, "readabl": 0, "separ": 0, "parallel": 0, "account": 0, "final": 0, "presenc": 0, "suppl": 0, "tell": 0, "innov": 0, "realiz": 0, "delimit": 0, "fail": 0, "boundari": 0, "includ": 0, "g_shannon_char": 0, "mai": 0, "averag": 0, "haven": 0, "actual": 0, "exclus": 0, "unpack": 0, "equival": 0, "bag": 0, "scrabbl": 0, "tile": 0, "amount": 0, "z": 0, "repeat": 0, "record": 0, "put": 0, "theori": 0, "intuit": 0, "util": 0, "limit": 0, "better": 0, "approxim": 0, "larger": 0, "behavior": 0, "aggreg": 0, "dwell": 0, "latent": 0, "speech": 0, "syntact": 0, "classic": 0, "entiti": 0, "discuss": 0, "claim": 0, "therein": 0, "underli": 0, "onto": 0, "grammat": 0, "chomskian": 0, "grammar": 0, "latter": 0, "paradigm": 0, "search": 0, "treatment": 0, "phenomena": 0, "biolog": 0, "popul": 0, "financi": 0, "market": 0, "weather": 0, "system": 0, "taken": 0, "simpli": 0, "plai": 0, "arriv": 0, "remot": 0, "attempt": 0, "made": 0, "held": 0, "valid": 0, "faculti": 0, "best": 0, "someth": 0, "emot": 0, "german": 0, "inn": 0, "1948": 0, "semant": 0, "irrelev": 0, "devis": 0, "exclud": 0, "vengeanc": 0, "special": 0, "immedi": 0, "convention": 0, "explain": 0, "person": 0, "who": 0, "drink": 0, "stumbl": 0, "situat": 0, "abl": 0, "try": 0, "fall": 0, "distanc": 0, "lot": 0, "physic": 0, "show": 0, "continu": 0, "seen": 0, "glue": 0, "shift": 0, "sever": 0, "With": 0, "dangl": 0, "yield": 0, "highlight": [], "bigram": 0, "transit": 0, "never": 0, "exist": 0, "shown": 0, "common": 0, "basi": 0, "simplifi": 0, "extra": 0, "convert": 0, "aesthet": 0, "presuppos": 0, "accompani": 0, "clean": 0, "def": 0, "normalize_text": 0, "contigu": 0, "text_low": 0, "lower": 0, "replac": 0, "text_norm": 0, "char": 0, "g_text_norm": 0, "1000": 0, "bulk": 0, "procedur": 0, "normal": 0, "b": 0, "ensur": 0, "don": 0, "multipl": 0, "belong": 0, "techniqu": 0, "help": 0, "000": 0, "isn": 0, "perfect": 0, "trust": 0, "disappear": 0, "french": 0, "proper": 0, "noun": 0, "smooth": 0, "create_ngram": 0, "paramet": 0, "higher": 0, "combin": 0, "three": 0, "success": 0, "trigram": 0, "quadgram": 0, "ngram": 0, "greater": 0, "tupl": 0, "text_arrai": 0, "rang": 0, "last_index": 0, "append": 0, "zip": 0, "cryptic": 0, "transform": 0, "copi": 0, "lop": 0, "3": 0, "slice": 0, "portion": 0, "antepenulim": 0, "penultim": 0, "third": 0, "reflect": 0, "group": 0, "occupi": 0, "visual": 0, "small": 0, "collect": 0, "nest": 0, "subcollect": 0, "window": 0, "move": 0, "create_transition_t": 0, "counter": 0, "outer": 0, "nth": 0, "ttabl": 0, "gram": 0, "thu": 0, "hand": 0, "alwai": 0, "matter": 0, "certain": 0, "th": 0, "o": 0, "whatev": 0, "definit": 0, "after": 0, "g_ttabl": 0, "significantli": 0, "bigger": 0, "frequent": 0, "h": 0, "fairli": 0, "panda": 0, "finish": 0, "pd": 0, "set_opt": 0, "datafram": 0, "from_dict": 0, "orient": 0, "index": 0, "row": 0, "column": 0, "across": 0, "idea": 0, "choos": 0, "fill": 0, "big": 0, "cell": 0, "nan": 0, "null": 0, "chracter": 0, "4": 0, "create_sampl": 0, "100": 0, "default": 0, "starting_char": 0, "first_char": 0, "last_char": 0, "l": 0, "generated_text": 0, "_": 0, "next_char": 0, "randomli": 0, "updat": 0, "throughout": 0, "keep": 0, "track": 0, "deriv": 0, "full": 0, "nonsens": 0, "being": 0, "agre": 0, "pinpoint": 0, "remind": 0, "me": 0, "outcom": 0, "ouija": 0, "board": 0, "almost": 0, "emerg": 0, "pool": 0, "subconsci": 0, "sink": 0, "murk": 0, "adept": 0, "simul": 0, "increas": 0, "lexicon": 0, "date": 0, "16th": 0, "vocabulari": 0, "spell": 0, "control": 0, "ipywidget": 0, "widget": 0, "ipython": 0, "create_slid": 0, "min_valu": 0, "max_valu": 0, "intslid": 0, "min": 0, "max": 0, "create_update_funct": 0, "transition_funct": 0, "slider": 0, "callback": 0, "on_upd": 0, "chang": 0, "nonloc": [], "create_generate_funct": 0, "sample_funct": 0, "trasit": 0, "on_gener": 0, "create_button": 0, "handler": 0, "on_click": 0, "ngram_slid": 0, "update_callback": 0, "update_output": 0, "update_button": 0, "generate_callback": 0, "generate_output": 0, "generate_button": 0, "recreat": 0, "bundl": 0, "html": 0, "alogorithm": 0, "modifi": 0, "compel": 0, "fun": 0, "glimmer": 0, "entir": 0, "orgin": 0, "token": 0, "emploi": 0, "similar": 0, "sophist": 0, "suffic": 0, "g_text_word": 0, "took": 0, "create_ttable_word": 0, "create_sample_word": 0, "starting_word": 0, "first_word": 0, "last_word": 0, "next_word": 0, "g_ttable_w": [], "ngram_slider_w": 0, "update_callback_w": 0, "update_output_w": 0, "ngrams_slider_w": [], "update_button_w": 0, "generate_callback_w": 0, "generate_output_w": 0, "generate_button_w": 0, "variou": 0, "appar": 0, "disclos": 0, "THE": 0, "head": 0, "AND": 0, "IN": 0, "frontal": 0, "attack": 0, "ON": 0, "writer": 0, "THAT": 0, "OF": 0, "IS": 0, "therefor": 0, "FOR": 0, "whoever": 0, "told": 0, "unexpect": 0, "suspici": 0, "fortuit": 0, "mention": 0, "got": 0, "didn": 0, "fudg": 0, "endur": 0, "charm": 0, "propens": 0, "uncanni": 0, "stretch": 0, "aris": 0, "proport": 0, "uniqu": 0, "match": 0, "clear": 0, "plainli": 0, "measur": 0, "novelti": 0, "percentag": 0, "40": 0, "less": 0, "half": 0, "constitut": 0, "phrase": 0, "spontan": 0, "utter": 0, "hard": 0, "answer": 0, "computation": 0, "obvious": 0, "pick": 0, "untruss": 0, "estim": 0, "num_uniqu": 0, "text_sampl": 0, "ngrams_sampl": 0, "this_num": 0, "sum": 0, "exact": 0, "score": 0, "total": 0, "doubt": 0, "quit": 0, "leap": 0, "rudimentari": 0, "artif": 0, "pois": 0, "deep": 0, "neural": 0, "network": 0, "chap": 0, "vastli": 0, "complic": 0, "mathamemat": 0, "train": 0, "unimagin": 0, "immens": 0, "yet": 0, "real": 0, "latest": 0, "capac": 0, "overlap": 0, "relat": 0, "g": 0, "captur": 0, "paragraph": 0, "sheer": 0, "lead": 0, "abil": 0, "mimic": 0, "genr": 0, "high": 0, "degre": 0, "gtp": 0, "led": 0, "critic": 0, "stochast": 0, "parrot": 0, "difficulti": 0, "safeguard": 0, "against": 0, "hate": 0, "fake": 0, "fals": 0, "citat": 0, "prove": 0, "technic": 0, "myself": 0, "decorum": 0, "character": 0, "meant": 0, "fashion": 0, "discurs": 0, "recal": 0, "conscious": 0, "worri": 0, "correctli": 0, "unintention": 0, "plagiar": 0, "essai": 0, "thesi": 0, "great": 0, "startl": 0, "nonetheless": 0, "imput": 0, "consciou": 0, "inclin": 0, "lacan": 0, "famous": 0, "apt": 0, "psych": 0, "debat": 0, "catch": 0, "glimps": 0, "humbl": 0, "markovian": 0, "riot": 0, "wander": 0, "lexic": 0, "pleasur": 0, "offer": 0, "habit": 0, "spirit": 0, "Not": 0, "deu": 0, "ex": 0, "machina": 0, "technolog": 0, "alien": 0, "oppress": 0, "borrow": 0, "bakhtin": 0, "carnivalesqu": 0, "mirror": 0, "freedom": 0, "restraint": 0, "affirm": 0, "momentari": 0, "invers": 0, "prevail": 0, "thing": 0, "repositori": 0, "act": 0, "ilk": [], "test": [], "trope": [], "fiction": [], "topic": [], "seriou": [], "chiefli": [], "scientist": [], "ubiqitu": [], "pastim": [], "regularli": [], "internet": [], "particip": [], "disconcert": [], "listen": [], "propos": [], "phenomenolog": [], "benchmark": [], "successfulli": [], "reliabl": [], "fool": [], "interlocutor": [], "grant": [], "presumpt": [], "spring": [], "arguabl": [], "celebr": [], "contemporari": [], "1940": [], "noteworthi": [], "frame": 0, "regardless": [], "signific": [], "introduc": [], "underpin": [], "swath": [], "telecommun": [], "infrastructur": [], "pave": [], "satur": [], "mediascap": [], "although": [], "proven": [], "medium": [], "guid": [], "intellectu": [], "activ": [], "panopli": [], "departur": [], "lai": [], "resourc": 0, "scholarli": [], "esqu": [], "framework": [], "wherein": [], "primari": [], "hearken": [], "probabilist": [], "couldn": [], "siri": [], "regard": [], "tread": [], "necessarili": [], "sure": [], "promin": [], "booster": [], "narr": 0, "thi": 0, "central": 0, "role": 0, "chat": 0, "gpt": 0, "us": 0, "claud": 0, "shannon": 0, "document": 0, "back": 0, "notebook": 0, "support": 0, "ralei": 0, "rhee": 0, "cultiv": 0, "participatori": 0, "embodi": 0, "expertis": 0, "rhetor": 0, "preval": 0, "mixtur": 0, "expositori": 0, "complement": 0, "Such": 0, "evok": 0, "empir": 0, "warrant": 0, "from": 0, "author": 0, "experiment": 0, "protocol": 0, "reader": 0, "oppos": 0, "spoke": 0, "praxi": 0, "mind": 0, "accordingli": 0, "book": 0, "annnot": 0, "annot": 0, "exposur": 0, "introductori": 0, "titl": 0, "encourag": 0, "execut": 0, "enumer": 0, "altern": 0, "vari": 0, "clearli": 0, "assess": 0, "googl": 0, "colaboratori": 0, "servic": 0, "colab": 0, "freeli": 0, "platform": 0, "requir": 0, "local": 0, "instal": 0, "watch": 0, "short": 0, "video": 0, "rocket": 0, "icon": 0, "upper": 0, "corner": 0, "drive": 0, "own": 0, "preserv": 0, "kernel": 0, "strictli": 0, "linear": 0, "trigger": 0, "lieu": 0, "menu": 0, "restart": 0, "footnot": 0, "ommit": 0, "toggl": 0, "apolog": 0, "inconveni": 0, "tend": 0, "again": 0, "conceptu": 0, "precipt": 0, "philosophi": 0, "philolog": 0, "valenc": 0, "binder": 0, "hardli": 0, "free": 0, "writ": 0, "apart": 0, "concret": 0, "serv": 0, "leve": 0, "social": 0, "wholli": 0, "inadequ": 0, "pose": 0, "circul": 0, "wide": 0, "recent": 0, "year": 0, "capabl": 0, "dataset": 0, "especi": 0, "mathematic": 0, "melani": 0, "walsh": 0, "onlin": 0, "cultur": 0, "analyt": 0, "lesson": 0, "historian": 0, "websit": 0, "tutori": 0, "jstor": 0, "constel": 0, "impli": 0, "artifici": 0, "prolifer": 0, "increasingli": 0, "focus": 0, "dispens": 0, "idiom": 0, "upsurg": 0, "prompt": 0, "impos": 0, "burden": 0, "mediat": 0, "upon": 0, "advisedli": 0, "scare": 0, "quot": 0, "cleaner": 0, "runtim": 0, "along": 0, "glu": 0, "w": 0, "preced": 0, "global": 0}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"read": 0, "machin": 0, "explor": 0, "linguist": 0, "unconsci": 0, "ai": 0, "introduct": 0, "two": 0, "strand": 0, "comput": 0, "how": 0, "us": [], "thi": [], "document": [], "kind": 0, "code": 0, "program": 0, "s": 0, "babi": 0, "step": 0, "python": 0, "encod": 0, "text": 0, "repres": 0, "languag": 0, "chanc": 0, "The": 0, "long": 0, "histori": 0, "A": 0, "spate": 0, "tediou": 0, "count": 0, "random": 0, "write": 0, "differ": 0, "space": 0, "make": 0, "law": 0, "abid": 0, "number": 0, "drunken": 0, "walk": 0, "more": 0, "prepar": 0, "set": 0, "tabl": 0, "automat": 0, "silli": 0, "rabelaisian": 0, "chatbot": 0, "wa": 0, "our": 0, "did": 0, "i": 0, "do": 0, "carniv": 0, "intellig": 0, "from": [], "claud": [], "shannon": [], "chat": [], "gpt": [], "back": [], "again": []}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinxcontrib.bibtex": 9, "sphinx": 56}}) \ No newline at end of file