jupyter-collaboration-ui 1.1.0b0__tar.gz → 1.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/PKG-INFO +3 -2
  2. jupyter_collaboration_ui-1.1.1/jupyter_collaboration_ui/_version.py +1 -0
  3. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/package.json +6 -6
  4. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/schemas/@jupyter/collaboration-extension/package.json.orig +5 -5
  5. jupyter_collaboration_ui-1.1.1/jupyter_collaboration_ui/labextension/static/240.39449f657b3806f7ddc3.js +1 -0
  6. jupyter_collaboration_ui-1.1.1/jupyter_collaboration_ui/labextension/static/393.9a7a8087d6b9c890c935.js +1 -0
  7. jupyter_collaboration_ui-1.1.1/jupyter_collaboration_ui/labextension/static/842.dc1f0863bd192583d2df.js +1 -0
  8. jupyter_collaboration_ui-1.1.1/jupyter_collaboration_ui/labextension/static/944.11ca1e2ef2d2b459a91b.js +1 -0
  9. jupyter_collaboration_ui-1.1.1/jupyter_collaboration_ui/labextension/static/remoteEntry.7688fdd67e32a0e7b033.js +1 -0
  10. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/static/third-party-licenses.json +3 -3
  11. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/package.json +1 -1
  12. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/collaboratorspanel.tsx +1 -1
  13. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/index.ts +1 -0
  14. jupyter_collaboration_ui-1.1.1/packages/collaboration/src/users-item.tsx +201 -0
  15. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/style/base.css +1 -0
  16. jupyter_collaboration_ui-1.1.1/packages/collaboration/style/users-item.css +20 -0
  17. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/package.json +5 -5
  18. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaborative-drive/package.json +2 -2
  19. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/package.json +3 -3
  20. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/ydrive.ts +2 -1
  21. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/package.json +4 -4
  22. jupyter_collaboration_ui-1.1.0b0/jupyter_collaboration_ui/_version.py +0 -1
  23. jupyter_collaboration_ui-1.1.0b0/jupyter_collaboration_ui/labextension/static/240.5b30415735249ad467b9.js +0 -1
  24. jupyter_collaboration_ui-1.1.0b0/jupyter_collaboration_ui/labextension/static/44.63f3c8213f36b6704bfa.js +0 -1
  25. jupyter_collaboration_ui-1.1.0b0/jupyter_collaboration_ui/labextension/static/842.887c6ef84a14d0e13407.js +0 -1
  26. jupyter_collaboration_ui-1.1.0b0/jupyter_collaboration_ui/labextension/static/944.d2ebc009496c02bb8324.js +0 -1
  27. jupyter_collaboration_ui-1.1.0b0/jupyter_collaboration_ui/labextension/static/remoteEntry.f302ab6125b0d30e77f0.js +0 -1
  28. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/.gitignore +0 -0
  29. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/LICENSE +0 -0
  30. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/README.md +0 -0
  31. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/install.json +0 -0
  32. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/__init__.py +0 -0
  33. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/schemas/@jupyter/collaboration-extension/shared-link.json +0 -0
  34. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/schemas/@jupyter/collaboration-extension/user-menu-bar.json +0 -0
  35. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/static/444.8091aa81c5259b3d4778.js +0 -0
  36. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/static/784.bef63745ca8c3075ff63.js +0 -0
  37. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/static/952.8934cdeb03f9bd1e666f.js +0 -0
  38. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/jupyter_collaboration_ui/labextension/static/style.js +0 -0
  39. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/README.md +0 -0
  40. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/components.tsx +0 -0
  41. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/cursors.ts +0 -0
  42. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/menu.ts +0 -0
  43. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/sharedlink.ts +0 -0
  44. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/tokens.ts +0 -0
  45. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/src/userinfopanel.tsx +0 -0
  46. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/style/index.css +0 -0
  47. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/style/index.js +0 -0
  48. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/style/menu.css +0 -0
  49. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/style/sidepanel.css +0 -0
  50. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration/tsconfig.json +0 -0
  51. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/README.md +0 -0
  52. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/schema/shared-link.json +0 -0
  53. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/schema/user-menu-bar.json +0 -0
  54. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/src/collaboration.ts +0 -0
  55. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/src/index.ts +0 -0
  56. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/src/sharedlink.ts +0 -0
  57. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/style/index.css +0 -0
  58. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/style/index.js +0 -0
  59. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaboration-extension/tsconfig.json +0 -0
  60. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaborative-drive/src/index.ts +0 -0
  61. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaborative-drive/src/tokens.ts +0 -0
  62. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/collaborative-drive/tsconfig.json +0 -0
  63. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/babel.config.js +0 -0
  64. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/jest.config.js +0 -0
  65. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/TimelineSlider.tsx +0 -0
  66. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/__tests__/forkManager.spec.ts +0 -0
  67. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/__tests__/yprovider.spec.ts +0 -0
  68. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/awareness.ts +0 -0
  69. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/component.tsx +0 -0
  70. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/forkManager.ts +0 -0
  71. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/index.ts +0 -0
  72. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/notebookCellExecutor.ts +0 -0
  73. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/requests.ts +0 -0
  74. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/tokens.ts +0 -0
  75. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/src/yprovider.ts +0 -0
  76. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/style/base.css +0 -0
  77. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/style/index.css +0 -0
  78. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/style/index.js +0 -0
  79. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/style/slider.css +0 -0
  80. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/tsconfig.json +0 -0
  81. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider/tsconfig.test.json +0 -0
  82. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/README.md +0 -0
  83. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/src/executor.ts +0 -0
  84. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/src/filebrowser.ts +0 -0
  85. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/src/forkManager.ts +0 -0
  86. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/src/index.ts +0 -0
  87. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/style/index.css +0 -0
  88. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/style/index.js +0 -0
  89. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/packages/docprovider-extension/tsconfig.json +0 -0
  90. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/pyproject.toml +0 -0
  91. {jupyter_collaboration_ui-1.1.0b0 → jupyter_collaboration_ui-1.1.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: jupyter-collaboration-ui
3
- Version: 1.1.0b0
3
+ Version: 1.1.1
4
4
  Summary: JupyterLab/Jupyter Notebook 7+ extension providing user interface integration for real time collaboration
5
5
  Project-URL: Documentation, https://jupyterlab-realtime-collaboration.readthedocs.io/
6
6
  Project-URL: Repository, https://github.com/jupyterlab/jupyter-collaboration
@@ -64,6 +64,7 @@ License: # Licensing terms
64
64
 
65
65
  # Copyright (c) Jupyter Development Team.
66
66
  # Distributed under the terms of the Modified BSD License.
67
+ License-File: LICENSE
67
68
  Classifier: Framework :: Jupyter
68
69
  Classifier: Framework :: Jupyter :: JupyterLab
69
70
  Classifier: Framework :: Jupyter :: JupyterLab :: 4
@@ -0,0 +1 @@
1
+ __version__ = "1.1.1"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/collaboration-extension",
3
- "version": "3.1.0-beta.0",
3
+ "version": "3.1.1",
4
4
  "description": "JupyterLab - Real-Time Collaboration Extension",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,10 +53,10 @@
53
53
  "watch:labextension": "jupyter labextension watch ."
54
54
  },
55
55
  "dependencies": {
56
- "@jupyter/collaboration": "^3.1.0-beta.0",
57
- "@jupyter/collaborative-drive": "^3.1.0-beta.0",
58
- "@jupyter/docprovider": "^3.1.0-beta.0",
59
- "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
56
+ "@jupyter/collaboration": "^3.1.1",
57
+ "@jupyter/collaborative-drive": "^3.1.1",
58
+ "@jupyter/docprovider": "^3.1.1",
59
+ "@jupyter/ydoc": "^2.1.3 || ^3.0.0",
60
60
  "@jupyterlab/application": "^4.2.0",
61
61
  "@jupyterlab/apputils": "^4.2.0",
62
62
  "@jupyterlab/codemirror": "^4.2.0",
@@ -125,7 +125,7 @@
125
125
  }
126
126
  },
127
127
  "_build": {
128
- "load": "static/remoteEntry.f302ab6125b0d30e77f0.js",
128
+ "load": "static/remoteEntry.7688fdd67e32a0e7b033.js",
129
129
  "extension": "./extension",
130
130
  "style": "./style"
131
131
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/collaboration-extension",
3
- "version": "3.1.0-beta.0",
3
+ "version": "3.1.1",
4
4
  "description": "JupyterLab - Real-Time Collaboration Extension",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,10 +53,10 @@
53
53
  "watch:labextension": "jupyter labextension watch ."
54
54
  },
55
55
  "dependencies": {
56
- "@jupyter/collaboration": "^3.1.0-beta.0",
57
- "@jupyter/collaborative-drive": "^3.1.0-beta.0",
58
- "@jupyter/docprovider": "^3.1.0-beta.0",
59
- "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
56
+ "@jupyter/collaboration": "^3.1.1",
57
+ "@jupyter/collaborative-drive": "^3.1.1",
58
+ "@jupyter/docprovider": "^3.1.1",
59
+ "@jupyter/ydoc": "^2.1.3 || ^3.0.0",
60
60
  "@jupyterlab/application": "^4.2.0",
61
61
  "@jupyterlab/apputils": "^4.2.0",
62
62
  "@jupyterlab/codemirror": "^4.2.0",
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[240],{5068:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),s=n(935),i=n.n(s)()(r());i.push([e.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-timelineSliderWrapper .jp-sliderContainer{\n display: flex;\n align-items: center;\n}\n\n.jp-Slider {\n height: 4.5px\n}\n\n#jp-slider-status-bar {\n display: flex;\n}\n\n.jp-timestampDisplay {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n\n.jp-restoreBtnContainer {\n width: 192px;\n}\n\n.jp-ToolbarButtonComponent.jp-restoreBtn {\n cursor: pointer;\n color: var(--jp-layout-color2);\n width: 100%;\n background: var(--jp-accept-color-normal)\n}\n",""]);const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},6758:e=>{e.exports=function(e){return e[1]}},2591:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},i=[],a=0;a<e.length;a++){var c=e[a],l=o.base?c[0]+o.base:c[0],d=s[l]||0,h="".concat(l," ").concat(d);s[l]=d+1;var u=n(h),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var m=r(p,o);o.byIndex=a,t.splice(a,0,{identifier:h,updater:m,references:1})}i.push(h)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=o(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var c=o(e,r),l=0;l<s.length;l++){var d=n(s[l]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=c}}},8128:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},3051:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},1740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},3656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},6240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>K,IForkManagerToken:()=>J,JUPYTER_COLLABORATION_FORK_EVENTS_URI:()=>q,NotebookCellServerExecutor:()=>l,ROOM_FORK_URL:()=>p,TimelineWidget:()=>B,WebSocketAwarenessProvider:()=>r,WebSocketProvider:()=>w,YDrive:()=>k,requestAPI:()=>m,requestDocSession:()=>f,requestDocumentTimeline:()=>v,requestUndoRedo:()=>g});var o=n(3560);class r extends o.WebsocketProvider{constructor(e){super(e.url,e.roomID,e.awareness.doc,{awareness:e.awareness}),this._isDisposed=!1,this._awareness=e.awareness,this._user=e.user,this._user.ready.then((()=>this._onUserChanged(this._user))).catch((e=>console.error(e))),this._user.userChanged.connect(this._onUserChanged,this)}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._user.userChanged.disconnect(this._onUserChanged,this),this._isDisposed=!0,this.destroy())}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}var s=n(9569),i=n(1808),a=n(7695),c=n(7579);class l{constructor(e){var t;this._serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:a.ServerConnection.makeSettings()}async runCell({cell:e,notebook:t,notebookConfig:n,onCellExecuted:o,onCellExecutionScheduled:r,sessionContext:l,sessionDialogs:d,translator:h}){var u,p,m;const f=(h=null!=h?h:c.nullTranslator).load("jupyterlab");switch(e.model.type){case"markdown":e.rendered=!0,e.inputHidden=!1,o({cell:e,success:!0});break;case"code":if(l){if(l.isTerminating){await(0,s.showDialog)({title:f.__("Kernel Terminating"),body:f.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(u=l.session)||void 0===u?void 0:u.path),buttons:[s.Dialog.okButton()]});break}if(l.pendingInput)return await(0,s.showDialog)({title:f.__("Cell not executed due to pending input"),body:f.__("The cell has not been executed to avoid kernel deadlock as there is another pending input! Submit your pending input and try again."),buttons:[s.Dialog.okButton()]}),!1;if(l.hasNoKernel&&await l.startKernel()&&d&&await d.selectKernel(l),l.hasNoKernel)return e.model.sharedModel.transact((()=>{e.model.clearExecution()})),!0;const n=null===(m=null===(p=null==l?void 0:l.session)||void 0===p?void 0:p.kernel)||void 0===m?void 0:m.id,c=i.URLExt.join(this._serverSettings.baseUrl,`api/kernels/${n}/execute`),h=e.model.sharedModel.getId(),v=t.sharedModel.getState("document_id"),g={method:"POST",body:JSON.stringify({cell_id:h,document_id:v})};r({cell:e});let y=!1;try{y=(await a.ServerConnection.makeRequest(c,g,this._serverSettings)).ok}catch(t){if(o({cell:e,success:!1}),e.isDisposed)return!1;throw t}return o({cell:e,success:y}),!0}e.model.sharedModel.transact((()=>{e.model.clearExecution()}),!1)}return Promise.resolve(!0)}}const d="api/collaboration/session",h="api/collaboration/undo_redo",u="api/collaboration/timeline",p="api/collaboration/fork";async function m(e="",t={}){const n=a.ServerConnection.makeSettings(),o=i.URLExt.join(n.baseUrl,e);let r;try{r=await a.ServerConnection.makeRequest(o,t,n)}catch(e){throw new a.ServerConnection.NetworkError(e)}let s=await r.text();if(s.length>0)try{s=JSON.parse(s)}catch(e){console.error("Not a JSON response body.",r)}if(!r.ok)throw new a.ServerConnection.ResponseError(r,s.message||s);return s}async function f(e,t,n){const o=a.ServerConnection.makeSettings(),r=i.URLExt.join(o.baseUrl,d,encodeURIComponent(n)),s={method:"PUT",body:JSON.stringify({format:e,type:t})};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}let l=await c.text();if(l.length>0)try{l=JSON.parse(l)}catch(e){console.log("Not a JSON response body.",c)}if(!c.ok)throw new a.ServerConnection.ResponseError(c,l.message||l);return l}async function v(e,t,n){const o=a.ServerConnection.makeSettings();let r=i.URLExt.join(o.baseUrl,u,n);r=r.concat(`?format=${e}&&type=${t}`);const s={method:"GET"};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}return c}async function g(e,t,n,o){const r=a.ServerConnection.makeSettings();let s=i.URLExt.join(r.baseUrl,h,encodeURIComponent(e));s=s.concat(`?action=${t}&&steps=${n}&&forkRoom=${o}`);const c={method:"PUT"};let l;try{l=await a.ServerConnection.makeRequest(s,c,r)}catch(e){throw new a.ServerConnection.NetworkError(e)}let d=await l.text();if(d.length>0)try{d=JSON.parse(d)}catch(e){console.log("Not a JSON response body.",l)}if(!l.ok)throw new a.ServerConnection.ResponseError(l,d.message||d);return d}var y=n(4602),_=n(7262);class w{constructor(e){this._onConnectionClosed=e=>{1003===e.code&&(console.error("Document provider closed:",e.reason),(0,s.showErrorMessage)(this._trans.__("Document session error"),e.reason,[s.Dialog.okButton()]),this._sharedModel.dispose())},this._onSync=e=>{e&&(this._yWebsocketProvider&&(this._yWebsocketProvider.off("sync",this._onSync),this._sharedModel.ydoc.getMap("state").set("document_id",this._yWebsocketProvider.roomname)),this._ready.resolve())},this._ready=new _.PromiseDelegate,this._isDisposed=!1,this._path=e.path,this._contentType=e.contentType,this._format=e.format,this._serverUrl=e.url,this._sharedModel=e.model,this._awareness=e.model.awareness,this._yWebsocketProvider=null,this._trans=e.translator;const t=e.user;t.ready.then((()=>{this._onUserChanged(t)})).catch((e=>console.error(e))),t.userChanged.connect(this._onUserChanged,this),this._connect().catch((e=>console.warn(e)))}get isDisposed(){return this._isDisposed}get ready(){return this._ready.promise}get contentType(){return this._contentType}get format(){return this._format}dispose(){var e,t,n;this.isDisposed||(this._isDisposed=!0,null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._disconnect(),y.Signal.clearData(this))}async reconnect(){this._disconnect(),this._connect()}async _connect(){const e=await f(this._format,this._contentType,this._path);this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,`${e.format}:${e.type}:${e.fileId}`,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:e.sessionId},awareness:this._awareness}),this._yWebsocketProvider.on("sync",this._onSync),this._yWebsocketProvider.on("connection-close",this._onConnectionClosed)}async connectToForkDoc(e,t){this._disconnect(),this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,e,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:t},awareness:this._awareness})}get wsProvider(){return this._yWebsocketProvider}_disconnect(){var e,t,n;null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._yWebsocketProvider=null}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}const S="true"===i.PageConfig.getOption("disableRTC");class k extends a.Drive{constructor(e,t,n){super({name:"RTC"}),this._onCreate=(e,t)=>{var n,o;if("string"==typeof e.format)try{const r=new w({url:i.URLExt.join(this.serverSettings.wsUrl,"api/collaboration/room"),path:e.path,format:e.format,contentType:e.contentType,model:t,user:this._user,translator:this._trans}),s=((null===(n=this._globalAwareness)||void 0===n?void 0:n.getLocalState())||{}).documents||[];s.includes(e.path)||(s.push(`${this.name}:${e.path}`),null===(o=this._globalAwareness)||void 0===o||o.setLocalStateField("documents",s));const a=`${e.format}:${e.contentType}:${e.path}`;this._providers.set(a,r),t.changed.connect((async(n,o)=>{var r;if(!o.stateChange)return;const s=o.stateChange.filter((e=>"hash"===e.name));if(0===s.length)return;s.length>1&&console.error("Unexpected multiple changes to hash value in a single transaction");const i=s[0],a=null!==(r=t.state.path)&&void 0!==r?r:e.path,c=await this.get(a,{content:!1});this._ydriveFileChanged.emit({type:"save",newValue:{...c,hash:i.newValue},oldValue:{hash:i.oldValue}})})),t.disposed.connect((()=>{var t,n;const o=this._providers.get(a);o&&(o.dispose(),this._providers.delete(a));const r=((null===(t=this._globalAwareness)||void 0===t?void 0:t.getLocalState())||{}).documents||[],s=r.indexOf(`${this.name}:${e.path}`);s>-1&&r.splice(s,1),null===(n=this._globalAwareness)||void 0===n||n.setLocalStateField("documents",r)}))}catch(t){console.error(`Failed to open websocket connection for ${e.path}.\n:${t}`)}},this._ydriveFileChanged=new y.Signal(this),this._user=e,this._trans=t,this._globalAwareness=n,this._providers=new Map,this.sharedModelFactory=new b(this._onCreate),super.fileChanged.connect(((e,t)=>{this._ydriveFileChanged.emit(t)}))}get providers(){return this._providers}dispose(){this.isDisposed||(this._providers.forEach((e=>e.dispose())),this._providers.clear(),super.dispose())}async get(e,t){if(t&&t.format&&t.type){const n=`${t.format}:${t.type}:${e}`,o=this._providers.get(n);if(o){const[n]=await Promise.all([super.get(e,{...t,content:!1}),o.ready]);return{...n,format:t.format}}}return super.get(e,t)}async save(e,t={}){if(t.format&&t.type){const n=`${t.format}:${t.type}:${e}`;if(this._providers.get(n)){const n={type:t.type,format:t.format,content:!1};return this.get(e,n)}}return super.save(e,t)}get fileChanged(){return this._ydriveFileChanged}}class b{constructor(e){this._onCreate=e,this.collaborative=!S,this.documentFactories=new Map}registerDocumentFactory(e,t){if(this.documentFactories.has(e))throw new Error(`The content type ${e} already exists`);this.documentFactories.set(e,t)}createNew(e){if("string"==typeof e.format){if(this.collaborative&&e.collaborative&&this.documentFactories.has(e.contentType)){const t=this.documentFactories.get(e.contentType)(e);return this._onCreate(e,t),t}}else console.warn(`Only defined format are supported; got ${e.format}.`)}}var C=n(3345),T=n.n(C),E=n(2591),x=n.n(E),R=n(1740),U=n.n(R),D=n(8128),$=n.n(D),N=n(855),P=n.n(N),j=n(3051),I=n.n(j),L=n(3656),M=n.n(L),F=n(5068),W={};W.styleTagTransform=M(),W.setAttributes=P(),W.insert=$().bind(null,"head"),W.domAPI=U(),W.insertStyleElement=I(),x()(F.A,W),F.A&&F.A.locals&&F.A.locals;var A=n(6989);const O=({apiURL:e,provider:t,contentType:n,format:o,documentTimelineUrl:r})=>{const[i,a]=(0,C.useState)({roomId:"",timestamps:[],forkRoom:"",sessionId:""}),[c,l]=(0,C.useState)(i.timestamps.length-1),[d,h]=(0,C.useState)(!1),[u,p]=(0,C.useState)(!1),m=(0,C.useRef)(!0),y=(0,C.useRef)(!0),_=(0,C.useRef)(null);function w(e){try{const t=new URL(e).pathname,n=t.lastIndexOf(r);if(-1===n)throw new Error(`API segment "${r}" not found in URL.`);return t.slice(n+r.length)}catch(e){return console.error("Invalid URL or unable to extract filename:",e),""}}return T().createElement("div",{className:"jp-sliderContainer"},T().createElement("div",{onClick:()=>{!async function(r){try{if(m.current){const i=await v(o,n,r);if(!i.ok)throw 404===i.status?new Error("Not found"):503===i.status?new Error("WebSocket closed"):new Error(`Failed to fetch data: ${i.statusText}`);const c=await i.text();let d={roomId:"",timestamps:[],forkRoom:"",sessionId:""};return c&&(s.Notification.warning("Document is now in read-only mode. Changes will not be saved.",{autoClose:2500}),d=JSON.parse(c),a(d),l(d.timestamps.length-1),t.connectToForkDoc(d.forkRoom,d.sessionId),_.current=await f(o,n,w(e))),h(!0),m.current=!1,d}}catch(e){console.error("Error fetching data:",e)}}(w(e))},className:"jp-mod-highlighted",title:"Document Timeline"},T().createElement(A.historyIcon.react,{marginRight:"4px"})),d&&T().createElement("div",{className:"jp-timestampDisplay"},T().createElement("input",{type:"range",min:0,max:i.timestamps.length-1,value:c,onChange:async e=>{const t=parseInt(e.target.value),n=Math.abs(t-c);try{const e=function(e){return e<c?"undo":"redo"}(t);if(l(t),y.current&&(p(!0),y.current=!1),!_.current)return void console.error("Session is not initialized");await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,e,n,i.forkRoom)}catch(e){console.error("Error fetching or applying updates:",e)}},className:"jp-Slider"}),T().createElement("div",null,T().createElement("strong",null,w(e).split("/").pop()," ")," "),u&&T().createElement("div",{className:"jp-restoreBtnContainer"},T().createElement("button",{onClick:async()=>{if(!_.current)return void console.error("Session is not initialized");const e=await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,"restore",0,i.forkRoom);200===e.code?(s.Notification.success(e.status,{autoClose:4e3}),t.reconnect(),h(!1),m.current=!0):s.Notification.error(e.status,{autoClose:4e3})},className:"jp-ToolbarButtonComponent jp-restoreBtn"},"Restore version"," ",(e=>{const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`})(i.timestamps[c])))))};class B extends s.ReactWidget{constructor(e,t,n,o,r){super(),this.apiURL=e,this.provider=t,this.contentType=n,this.format=o,this.documentTimelineUrl=r,this.addClass("jp-timelineSliderWrapper")}render(){return C.createElement(O,{key:this.apiURL,apiURL:this.apiURL,provider:this.provider,contentType:this.contentType,format:this.format,documentTimelineUrl:this.documentTimelineUrl})}updateContent(e,t){this.apiURL=e,this.provider=t,this.contentType=this.provider.contentType,this.format=this.provider.format,this.update()}}const J=new _.Token("@jupyter/docprovider:IForkManagerToken"),q="https://schema.jupyter.org/jupyter_collaboration/fork/v1";class K{constructor(e){this._disposed=!1,this._forkAddedSignal=new y.Signal(this),this._forkDeletedSignal=new y.Signal(this);const{drive:t,eventManager:n}=e;this._drive=t,this._eventManager=n,this._eventManager.stream.connect(this._handleEvent,this)}get isDisposed(){return this._disposed}get forkAdded(){return this._forkAddedSignal}get forkDeleted(){return this._forkDeletedSignal}dispose(){var e;this._disposed||(null===(e=this._eventManager)||void 0===e||e.stream.disconnect(this._handleEvent),this._disposed=!0)}async createFork(e){const{rootId:t,title:n,description:o,synchronize:r}=e,s={method:"PUT",body:JSON.stringify({title:n,description:o,synchronize:r})},a=i.URLExt.join(p,t);return await m(a,s)}async getAllForks(e){const t=i.URLExt.join(p,e);return await m(t,{method:"GET"})}async deleteFork(e){const{forkId:t,merge:n}=e,o=i.URLExt.join(p,t),r=i.URLExt.objectToQueryString({merge:n});await m(`${o}${r}`,{method:"DELETE"})}getProvider(e){const{documentPath:t,format:n,type:o}=e,r=this._drive;if(r){const e=r.name;let s=t;return t.startsWith(e)&&(s=t.slice(e.length+1)),r.providers.get(`${n}:${o}:${s}`)}}_handleEvent(e,t){if(t.schema_id===q)switch(t.action){case"create":this._forkAddedSignal.emit(t);break;case"delete":this._forkDeletedSignal.emit(t)}}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[393],{6393:(e,t,n)=>{n.r(t),n.d(t,{Collaborator:()=>w,CollaboratorsBody:()=>y,CollaboratorsPanel:()=>b,DefaultIconRenderer:()=>q,IUserMenu:()=>s,RendererUserMenu:()=>T,UserInfoBody:()=>$,UserInfoPanel:()=>W,UserMenu:()=>N,UsersItem:()=>J,remoteUserCursors:()=>M,showSharedLinkDialog:()=>F});var r=n(7262);const s=new r.Token("@jupyter/collaboration:IUserMenu");var o=n(9569),a=n(6989),i=n(4602),l=n(5256),c=n(3345),d=n.n(c);const u="jp-CollaboratorsList",h="jp-Collaborator",m="jp-CollaboratorHeader",p="jp-CollaboratorHeaderCollapser",f="jp-ClickableCollaborator",_="jp-CollaboratorIcon",v="jp-CollaboratorFiles",g="jp-CollaboratorFile";class b extends l.Panel{constructor(e,t,n,r){super({}),this._onAwarenessChanged=()=>{const e=this._awareness.getStates(),t=[];e.forEach(((e,n)=>{this._currentUser.isReady&&e.user&&e.user.username!==this._currentUser.identity.username&&t.push(e)})),this._collaboratorsChanged.emit(t)},this._collaboratorsChanged=new i.Signal(this),this._awareness=t,this._currentUser=e,this.addClass("jp-CollaboratorsPanel"),this.addWidget(o.ReactWidget.create(d().createElement(y,{fileopener:n,collaboratorsChanged:this._collaboratorsChanged,docRegistry:r}))),this._awareness.on("change",this._onAwarenessChanged)}}function y(e){const[t,n]=(0,c.useState)([]);return e.collaboratorsChanged.connect(((e,t)=>{n(t)})),d().createElement("div",{className:u},t.map(((t,n)=>d().createElement(w,{collaborator:t,fileopener:e.fileopener,docRegistry:e.docRegistry}))))}function w(e){const[t,n]=(0,c.useState)(!1),{collaborator:r,fileopener:s}=e;let o="";if(r.current){const e=r.current.split(":");o=`${e[1]}:${e[2]}`}const i=r.documents||[],l=i.map((t=>{var n,r;const s=t.split(":"),o=null===(r=null===(n=e.docRegistry)||void 0===n?void 0:n.getFileTypesForPath(s[1]))||void 0===r?void 0:r.filter((e=>void 0!==e.icon)),i=(null==o?void 0:o.length)?o[0].icon:a.fileIcon,l=o?o[0].iconClass:void 0;return{filepath:s[1],filename:s[1].length>40?s[1].slice(0,10).concat("…").concat(s[1].slice(s[1].length-15)):s[1],fileLocation:t,icon:i,iconClass:l}}));return d().createElement("div",{className:h},d().createElement("div",{className:l.length?`${f} ${m}`:m,onClick:i?()=>{l.length&&n(!t)}:void 0},d().createElement(a.LabIcon.resolveReact,{icon:a.caretDownIcon,className:p+(t?" jp-mod-expanded":""),tag:"div"}),d().createElement("div",{className:_,style:{backgroundColor:r.user.color}},d().createElement("span",null,r.user.initials)),d().createElement("span",null,r.user.display_name)),d().createElement("div",{className:`${v} jp-DirListing`,style:t?{}:{display:"none"}},d().createElement("ul",{className:"jp-DirListing-content"},l.map((e=>d().createElement("li",{className:"jp-DirListing-item "+(e.fileLocation===o?`${g} jp-mod-running`:g),key:e.filename,onClick:()=>s(e.fileLocation)},d().createElement(a.LabIcon.resolveReact,{icon:e.icon,iconClass:e.iconClass,tag:"span",className:"jp-DirListing-itemIcon",stylesheet:"listing"}),d().createElement("span",{className:"jp-DirListing-itemText",title:e.filepath},e.filename)))))))}var C=n(195),k=n(5024),j=n(2206);const x=C.Facet.define({combine:e=>e[e.length-1]}),I=k.EditorView.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip .jp-remote-userInfo":{color:"var(--jp-ui-inverse-font-color0)",padding:"0px 2px"}}),E=C.Annotation.define();class L{constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,n]of Object.entries(this.style))e.style[t]=n;return e}eq(e){return this.marker.eq(e.marker)&&r.JSONExt.deepEqual(this.style,e.style)}update(e,t){for(const[t,n]of Object.entries(this.style))e.style[t]=n;return this.marker.update(e,t.marker)}}const R=(0,k.layer)({above:!0,markers(e){const{awareness:t,ytext:n}=e.state.facet(x),r=n.doc,s=[];return t.getStates().forEach(((o,a)=>{var i,l,c;if(a===t.doc.clientID)return;const d=o.cursors;for(const t of null!=d?d:[]){if(!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const a=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,r),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,r);if((null==a?void 0:a.type)!==n||(null==d?void 0:d.type)!==n)return;const u=null===(i=t.primary)||void 0===i||i?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",h=C.EditorSelection.cursor(d.index,d.index>a.index?-1:1);for(const t of k.RectangleMarker.forRange(e,u,h))s.push(new L({borderLeftColor:null!==(c=null===(l=o.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),s},update:(e,t)=>!!e.transactions.find((e=>e.annotation(E))),class:"jp-remote-cursors"}),A=(0,k.hoverTooltip)(((e,t)=>{var n;const{awareness:r,ytext:s}=e.state.facet(x),o=s.doc;for(const[e,a]of r.getStates())if(e!==r.doc.clientID)for(const e of null!==(n=a.cursors)&&void 0!==n?n:[]){if(!(null==e?void 0:e.head))continue;const n=(0,j.createAbsolutePositionFromRelativePosition)(e.head,o);if((null==n?void 0:n.type)===s&&n.index-3<=t&&t<=n.index+3)return{pos:n.index,above:!0,create:()=>{var e,t,n,r;const s=document.createElement("div");return s.classList.add("jp-remote-userInfo"),s.style.backgroundColor=null!==(t=null===(e=a.user)||void 0===e?void 0:e.color)&&void 0!==t?t:"darkgrey",s.textContent=null!==(r=null===(n=a.user)||void 0===n?void 0:n.display_name)&&void 0!==r?r:"Anonymous",{dom:s}}}}return null}),{hideOn:(e,t)=>!!e.annotation(E),hoverTime:0}),D=(0,k.layer)({above:!1,markers(e){const{awareness:t,ytext:n}=e.state.facet(x),r=n.doc,s=[];return t.getStates().forEach(((o,a)=>{var i,l,c;if(a===t.doc.clientID)return;const d=o.cursors;for(const t of null!=d?d:[]){if(null===(i=t.empty)||void 0===i||i||!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const a=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,r),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,r);if((null==a?void 0:a.type)!==n||(null==d?void 0:d.type)!==n)return;const u="jp-remote-selection";for(const t of k.RectangleMarker.forRange(e,u,C.EditorSelection.range(a.index,d.index)))s.push(new L({backgroundColor:null!==(c=null===(l=o.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),s},update:(e,t)=>!!e.transactions.find((e=>e.annotation(E))),class:"jp-remote-selections"}),P=k.ViewPlugin.fromClass(class{constructor(e){this.editorAwareness=e.state.facet(x),this._listener=({added:t,updated:n,removed:r})=>{t.concat(n).concat(r).findIndex((e=>e!==this.editorAwareness.awareness.doc.clientID))>=0&&e.dispatch({annotations:[E.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(e){var t;if(!e.docChanged&&!e.selectionSet)return;const{awareness:n,ytext:s}=this.editorAwareness,o=n.getLocalState();if(o){const a=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=e.state.selection,l=new Array;if(a&&i){for(const e of i.ranges){const t=e===i.main,n=(0,j.createRelativePositionFromTypeIndex)(s,e.anchor),r=(0,j.createRelativePositionFromTypeIndex)(s,e.head);l.push({anchor:n,head:r,primary:t,empty:e.empty})}if(!o.cursors||l.length>0){const e=null===(t=o.cursors)||void 0===t?void 0:t.map((e=>({...e,anchor:(null==e?void 0:e.anchor)?(0,j.createRelativePositionFromJSON)(e.anchor):null,head:(null==e?void 0:e.head)?(0,j.createRelativePositionFromJSON)(e.head):null})));r.JSONExt.deepEqual(l,e)||n.setLocalStateField("cursors",l)}}}}},{provide:()=>[I,R,D,A,(0,k.tooltips)({position:"absolute",parent:document.body})]});function M(e){return[x.of(e),P]}var S=n(4873);class T extends l.MenuBar.Renderer{constructor(e){super(),this._user=e}renderItem(e){const t=this.createItemClass(e),n=this.createItemDataset(e),r=this.createItemARIA(e);return S.h.li({className:t,dataset:n,tabindex:"0",onfocus:e.onfocus,...r},this._createUserIcon(),this.renderLabel(e),this.renderIcon(e))}renderLabel(e){const t=this.formatLabel(e);return S.h.div({className:"lm-MenuBar-itemLabel jp-MenuBar-label"},t)}_createUserIcon(){return this._user.isReady&&this._user.identity.avatar_url?S.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-imageIcon"},S.h.img({src:this._user.identity.avatar_url})):this._user.isReady?S.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon",style:{backgroundColor:this._user.identity.color}},S.h.span({},this._user.identity.initials)):S.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon"},a.userIcon)}}class N extends l.Menu{constructor(e){super(e)}}var U=n(1808),B=n(7579);async function F({translator:e}){const t=(null!=e?e:B.nullTranslator).load("collaboration"),n=U.PageConfig.getToken(),r=new URL(U.URLExt.normalize(U.PageConfig.getUrl({workspace:U.PageConfig.defaultWorkspace})));return(0,o.showDialog)({title:t.__("Share Jupyter Server Link"),body:new H(r.toString(),n,""!==U.PageConfig.getOption("hubUser"),t),buttons:[o.Dialog.cancelButton(),o.Dialog.okButton({label:t.__("Copy Link"),caption:t.__("Copy the link to the Jupyter Server")})]})}class H extends l.Widget{constructor(e,t,n,r){super(),this._url=e,this._token=t,this._behindHub=n,this._trans=r,this._tokenCheckbox=null,this.onTokenChange=e=>{const t=e.target;this.updateContent(null==t?void 0:t.checked)},this._warning=document.createElement("div"),this.populateBody(this.node),this.addClass("jp-shared-link-body")}getValue(){var e;if(!0===(null===(e=this._tokenCheckbox)||void 0===e?void 0:e.checked)){const e=new URL(this._url);return e.searchParams.set("token",this._token),e.toString()}return this._url}onAfterAttach(e){var t;super.onAfterAttach(e),null===(t=this._tokenCheckbox)||void 0===t||t.addEventListener("change",this.onTokenChange)}onBeforeDetach(e){var t;null===(t=this._tokenCheckbox)||void 0===t||t.removeEventListener("change",this.onTokenChange),super.onBeforeDetach(e)}updateContent(e){this._warning.innerHTML="";const t=this.node.querySelector("input[readonly]");if(e){if(t){const e=new URL(this._url);e.searchParams.set("token",this._token.slice(0,5)),t.value=e.toString()+"…"}this._warning.appendChild(document.createElement("h3")).textContent=this._trans.__("Security warning!"),this._warning.insertAdjacentText("beforeend",this._trans.__("Anyone with this link has full access to your notebook server, including all your files!")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("Please be careful who you share it with.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._behindHub?(this._warning.insertAdjacentText("beforeend",this._trans.__("They will be able to access this server AS YOU.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("To revoke access, go to File -> Hub Control Panel, and restart your server."))):this._warning.insertAdjacentText("beforeend",this._trans.__("Currently, there is no way to revoke access other than shutting down your server."))}else t&&(t.value=this._url),this._behindHub?this._warning.insertAdjacentText("beforeend",this._trans.__("Only users with `access:servers` permissions for this server will be able to use this link.")):this._warning.insertAdjacentText("beforeend",this._trans.__("Only authenticated users will be able to use this link."))}populateBody(e){if(e.insertAdjacentHTML("afterbegin",`<input readonly value="${this._url}">`),this._token){const t=e.appendChild(document.createElement("label"));t.insertAdjacentHTML("beforeend",'<input type="checkbox">'),this._tokenCheckbox=t.firstChild,t.insertAdjacentText("beforeend",this._trans.__("Include token in URL")),e.insertAdjacentElement("beforeend",this._warning),this.updateContent(!1)}}}const O=e=>{const{user:t}=e;return c.createElement("div",{className:"jp-UserInfo-Container"},c.createElement("div",{title:t.display_name,className:"jp-UserInfo-Icon",style:{backgroundColor:t.color}},c.createElement("span",null,t.initials)),c.createElement("h3",null,t.display_name))};class W extends l.Panel{constructor(e){super({}),this.addClass("jp-UserInfoPanel"),this._profile=e,this._body=null,this._profile.isReady?(this._body=new $(this._profile.identity),this.addWidget(this._body),this.update()):this._profile.ready.then((()=>{this._body=new $(this._profile.identity),this.addWidget(this._body),this.update()})).catch((e=>console.error(e)))}}class $ extends o.ReactWidget{constructor(e){super(),this._user=e}get user(){return this._user}set user(e){this._user=e,this.update()}render(){return c.createElement(O,{user:this._user})}}class J extends c.Component{constructor(e){var t;super(e),this._awarenessChange=()=>{var e;const t=null===(e=this._model)||void 0===e?void 0:e.sharedModel.awareness.getStates(),n=[];t&&t.forEach(((e,t)=>{e.user&&n.push({userId:t,userData:e.user})})),this.setState((e=>({...e,usersList:n})))},this._model=e.model,this._iconRenderer=null!==(t=e.iconRenderer)&&void 0!==t?t:null,this.state={usersList:[]}}static createWidget(e){return a.ReactWidget.create(c.createElement(J,{...e}))}componentDidMount(){var e;null===(e=this._model)||void 0===e||e.sharedModel.awareness.on("change",this._awarenessChange),this._awarenessChange()}filterDuplicated(e){var t;const n=[],r=new Set;for(const s of e)(null===(t=null==s?void 0:s.userData)||void 0===t?void 0:t.username)&&!r.has(s.userData.username)&&(r.add(s.userData.username),n.push(s));return n}render(){var e;const t=null!==(e=this._iconRenderer)&&void 0!==e?e:q;return c.createElement("div",{className:"jp-toolbar-users-item"},this.filterDuplicated(this.state.usersList).map((e=>{if(this._model&&e.userId!==this._model.sharedModel.awareness.clientID)return t({user:e,model:this._model})})))}}function q(e){let t;const{user:n,model:r,...s}=e,o=(0,a.classes)("lm-MenuBar-itemIcon",e.className||"");return t=n.userData.avatar_url?c.createElement("div",{...s,key:n.userId,title:n.userData.display_name,className:(0,a.classes)(o,"jp-MenuBar-imageIcon")},c.createElement("img",{src:n.userData.avatar_url,alt:""})):c.createElement("div",{...s,key:n.userId,title:n.userData.display_name,className:(0,a.classes)(o,"jp-MenuBar-anonymousIcon"),style:{backgroundColor:n.userData.color}},c.createElement("span",null,n.userData.initials)),t}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[842],{4842:(e,r,a)=>{a.r(r),a.d(r,{default:()=>I});var o=a(9569),t=a(4608),n=a(2691),s=a(8751),i=a(6989),l=a(1808),c=a(7695),d=a(7135),u=a(7579),p=a(5256),m=a(4387),b=a(2206),y=a(7784);const w={id:"@jupyter/collaboration-extension:userMenu",description:"Provide connected user menu.",requires:[],provides:m.IUserMenu,activate:e=>{const{commands:r}=e,{user:a}=e.serviceManager;return new m.UserMenu({commands:r,user:a})}},v={id:"@jupyter/collaboration-extension:user-menu-bar",description:"Add user menu to the interface.",autoStart:!0,requires:[m.IUserMenu,o.IToolbarWidgetRegistry],activate:async(e,r,a)=>{const{user:o}=e.serviceManager,t=new p.MenuBar({forceItemsPosition:{forceX:!1,forceY:!1},renderer:new m.RendererUserMenu(o)});t.id="jp-UserMenu",o.userChanged.connect((()=>t.update())),t.addMenu(r),a.addFactory("TopBar","user-menu",(()=>t))}},g={id:"@jupyter/collaboration-extension:rtcGlobalAwareness",description:"Add global awareness to share working document of users.",requires:[d.IStateDB],provides:n.IGlobalAwareness,activate:(e,r)=>{const{user:a}=e.serviceManager,o=new b.Doc,t=new y.ww(o),n=c.ServerConnection.makeSettings(),i=l.URLExt.join(n.wsUrl,"api/collaboration/room");return new s.WebSocketAwarenessProvider({url:i,roomID:"JupyterLab:globalAwareness",awareness:t,user:a}),r.changed.connect((async()=>{var e,a;const o=(null===(a=null===(e=(await r.toJSON())["layout-restorer:data"])||void 0===e?void 0:e.main)||void 0===a?void 0:a.current)||"";o.match(/^\w+:RTC:/)?t.setLocalStateField("current",o):t.setLocalStateField("current",null)})),t}},h={id:"@jupyter/collaboration-extension:rtcPanel",description:"Add side panel to display all currently connected users.",autoStart:!0,requires:[n.IGlobalAwareness],optional:[u.ITranslator],activate:(e,r,a)=>{const{user:o}=e.serviceManager,t=(null!=a?a:u.nullTranslator).load("jupyter_collaboration"),n=new i.SidePanel({alignment:"justify"});n.id="jp-collaboration-panel",n.title.icon=i.usersIcon,n.title.caption=t.__("Collaboration"),n.addClass("jp-RTCPanel"),e.shell.add(n,"left",{rank:300});const s=new m.UserInfoPanel(o);s.title.label=t.__("User info"),s.title.caption=t.__("User information"),n.addWidget(s);const l=new m.CollaboratorsPanel(o,r,(r=>{e.commands.execute("docmanager:open",{path:r})}),e.docRegistry);l.title.label=t.__("Online Collaborators"),n.addWidget(l)}},_={id:"@jupyter/collaboration-extension:userEditorCursors",description:"Add CodeMirror extension to display remote user cursors and selections.",autoStart:!0,requires:[t.IEditorExtensionRegistry],activate:(e,r)=>{r.addExtension({name:"remote-user-cursors",factory(e){const{awareness:r,ysource:a}=e.model.sharedModel;return t.EditorExtensionRegistry.createImmutableExtension((0,m.remoteUserCursors)({awareness:r,ytext:a}))}})}};var x;!function(e){e.share="collaboration:shared-link"}(x||(x={}));const I=[w,v,g,h,{id:"@jupyter/collaboration-extension:shared-link",autoStart:!0,optional:[o.ICommandPalette,u.ITranslator],activate:async(e,r,a)=>{const{commands:t}=e,n=(null!=a?a:u.nullTranslator).load("collaboration");t.addCommand(x.share,{label:n.__("Generate a Shared Link"),icon:i.shareIcon,execute:async()=>{const e=await(0,m.showSharedLinkDialog)({translator:a});e.button.accept&&e.value&&o.Clipboard.copyToSystem(e.value)}}),r&&r.addItem({command:x.share,category:n.__("Server")})}},_]}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[944],{2078:(n,e,o)=>{o.d(e,{A:()=>u});var r=o(6758),t=o.n(r),a=o(935),i=o.n(a),l=o(9256),p=o(3028),s=o(9921),c=i()(t());c.i(l.A),c.i(p.A),c.i(s.A),c.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-shared-link-body {\n user-select: none;\n}\n",""]);const u=c},9256:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(6758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-MenuBar-label {\n margin-left: 25px;\n}\n\n.jp-MenuBar-anonymousIcon span {\n width: 24px;\n text-align: center;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-MenuBar-anonymousIcon,\n.jp-MenuBar-imageIcon {\n position: absolute;\n top: 1px;\n left: 8px;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n vertical-align: middle;\n border-radius: 100%;\n}\n\n.jp-MenuBar-imageIcon img {\n width: 24px;\n border-radius: 100%;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserMenu-caretDownIcon {\n height: 22px;\n position: relative;\n top: 15%;\n}\n",""]);const l=i},3028:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(6758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/************************************************************\n Main Panel\n*************************************************************/\n\n.jp-RTCPanel {\n min-width: var(--jp-sidebar-min-width) !important;\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n font-size: var(--jp-ui-font-size1);\n}\n\n/************************************************************\n User Info Panel\n*************************************************************/\n.jp-UserInfoPanel {\n display: flex;\n flex-direction: column;\n max-height: 140px;\n padding-top: 3px;\n}\n\n.jp-UserInfo-Container {\n margin: 20px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.jp-UserInfo-Icon {\n margin: auto;\n width: 50px;\n height: 50px;\n border-radius: 50px;\n display: inline-flex;\n align-items: center;\n}\n\n.jp-UserInfo-Icon span {\n margin: auto;\n text-align: center;\n font-size: 25px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info {\n margin: 20px;\n display: inline-flex;\n flex-direction: column;\n}\n\n.jp-UserInfo-Info label {\n font-weight: bold;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info input {\n text-decoration: none;\n border-top: none;\n border-left: none;\n border-right: none;\n border-color: var(--jp-ui-font-color1);\n border-width: 0.5px;\n background-color: transparent;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n/************************************************************\n Collaborators Info Panel\n*************************************************************/\n\n.jp-CollaboratorsPanel {\n overflow-y: auto;\n}\n\n.jp-CollaboratorsList {\n flex-direction: column;\n display: flex;\n z-index: 1000;\n}\n\n.jp-CollaboratorHeader {\n padding: 10px;\n display: flex;\n align-items: center;\n font-size: var(--jp-ui-font-size0);\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorHeader > span {\n padding-left: 7px;\n}\n\n.jp-ClickableCollaborator:hover {\n cursor: pointer;\n background-color: var(--jp-layout-color2);\n fill: var(--jp-ui-font-color0);\n color: var(--jp-ui-font-color0);\n}\n\n.jp-CollaboratorHeaderCollapser {\n transform: rotate(-90deg);\n margin: auto 0;\n height: 16px;\n}\n\n.jp-CollaboratorHeader:not(.jp-ClickableCollaborator) .jp-CollaboratorHeaderCollapser {\n visibility: hidden;\n}\n\n.jp-CollaboratorHeaderCollapser.jp-mod-expanded {\n transform: rotate(0deg);\n}\n\n.jp-CollaboratorIcon {\n border-radius: 100%;\n padding: 2px;\n width: 24px;\n height: 24px;\n display: flex;\n}\n\n.jp-CollaboratorIcon > span {\n text-align: center;\n margin: auto;\n font-size: 12px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorFiles {\n padding-left: 1em;\n margin-top: 0;\n box-shadow: 0 2px 2px -2px rgb(0 0 0 / 24%);\n\n}\n",""]);const l=i},9921:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(6758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-toolbar-users-item {\n flex-grow: 1;\n display: flex;\n flex-direction: row;\n}\n\n.jp-toolbar-users-item .jp-MenuBar-anonymousIcon,\n.jp-toolbar-users-item .jp-MenuBar-imageIcon {\n position: relative;\n left: 0;\n height: 22px;\n width: 22px;\n box-sizing: border-box;\n cursor: default;\n}\n",""]);const l=i},935:n=>{n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var o="",r=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),r&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=n(e),r&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(n,o,r,t,a){"string"==typeof n&&(n=[[null,n,void 0]]);var i={};if(r)for(var l=0;l<this.length;l++){var p=this[l][0];null!=p&&(i[p]=!0)}for(var s=0;s<n.length;s++){var c=[].concat(n[s]);r&&i[c[0]]||(void 0!==a&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),t&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=t):c[4]="".concat(t)),e.push(c))}},e}},6758:n=>{n.exports=function(n){return n[1]}},2591:n=>{var e=[];function o(n){for(var o=-1,r=0;r<e.length;r++)if(e[r].identifier===n){o=r;break}return o}function r(n,r){for(var a={},i=[],l=0;l<n.length;l++){var p=n[l],s=r.base?p[0]+r.base:p[0],c=a[s]||0,u="".concat(s," ").concat(c);a[s]=c+1;var d=o(u),f={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var m=t(f,r);r.byIndex=l,e.splice(l,0,{identifier:u,updater:m,references:1})}i.push(u)}return i}function t(n,e){var o=e.domAPI(e);return o.update(n),function(e){if(e){if(e.css===n.css&&e.media===n.media&&e.sourceMap===n.sourceMap&&e.supports===n.supports&&e.layer===n.layer)return;o.update(n=e)}else o.remove()}}n.exports=function(n,t){var a=r(n=n||[],t=t||{});return function(n){n=n||[];for(var i=0;i<a.length;i++){var l=o(a[i]);e[l].references--}for(var p=r(n,t),s=0;s<a.length;s++){var c=o(a[s]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}a=p}}},8128:n=>{var e={};n.exports=function(n,o){var r=function(n){if(void 0===e[n]){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(n){o=null}e[n]=o}return e[n]}(n);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(o)}},3051:n=>{n.exports=function(n){var e=document.createElement("style");return n.setAttributes(e,n.attributes),n.insert(e,n.options),e}},855:(n,e,o)=>{n.exports=function(n){var e=o.nc;e&&n.setAttribute("nonce",e)}},1740:n=>{n.exports=function(n){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.insertStyleElement(n);return{update:function(o){!function(n,e,o){var r="";o.supports&&(r+="@supports (".concat(o.supports,") {")),o.media&&(r+="@media ".concat(o.media," {"));var t=void 0!==o.layer;t&&(r+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),r+=o.css,t&&(r+="}"),o.media&&(r+="}"),o.supports&&(r+="}");var a=o.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,n,e.options)}(e,n,o)},remove:function(){!function(n){if(null===n.parentNode)return!1;n.parentNode.removeChild(n)}(e)}}}},3656:n=>{n.exports=function(n,e){if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},5944:(n,e,o)=>{var r=o(2591),t=o.n(r),a=o(1740),i=o.n(a),l=o(8128),p=o.n(l),s=o(855),c=o.n(s),u=o(3051),d=o.n(u),f=o(3656),m=o.n(f),v=o(2078),h={};h.styleTagTransform=m(),h.setAttributes=c(),h.insert=p().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=d(),t()(v.A,h),v.A&&v.A.locals&&v.A.locals}}]);
@@ -0,0 +1 @@
1
+ var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,a,n,i,l,u,f,s,d,c,p,h,v,b,m,y,g,j,w,P,S={1998:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(784),t.e(206),t.e(30),t.e(256),t.e(695),t.e(592),t.e(842)]).then((()=>()=>t(4842))),"./extension":()=>Promise.all([t.e(784),t.e(206),t.e(30),t.e(256),t.e(695),t.e(592),t.e(842)]).then((()=>()=>t(4842))),"./style":()=>t.e(944).then((()=>()=>t(5944)))},a=(e,r)=>(t.R=r,r=t.o(o,e)?o[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),n=(e,r)=>{if(t.S){var o="default",a=t.S[o];if(a&&a!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>a,init:()=>n})}},k={};function x(e){var r=k[e];if(void 0!==r)return r.exports;var t=k[e]={id:e,exports:{}};return S[e](t,t.exports,x),t.exports}x.m=S,x.c=k,x.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return x.d(r,{a:r}),r},x.d=(e,r)=>{for(var t in r)x.o(r,t)&&!x.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},x.f={},x.e=e=>Promise.all(Object.keys(x.f).reduce(((r,t)=>(x.f[t](e,r),r)),[])),x.u=e=>e+"."+{240:"39449f657b3806f7ddc3",393:"9a7a8087d6b9c890c935",444:"8091aa81c5259b3d4778",784:"bef63745ca8c3075ff63",842:"dc1f0863bd192583d2df",944:"11ca1e2ef2d2b459a91b",952:"8934cdeb03f9bd1e666f"}[e]+".js?v="+{240:"39449f657b3806f7ddc3",393:"9a7a8087d6b9c890c935",444:"8091aa81c5259b3d4778",784:"bef63745ca8c3075ff63",842:"dc1f0863bd192583d2df",944:"11ca1e2ef2d2b459a91b",952:"8934cdeb03f9bd1e666f"}[e],x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter/collaboration-extension:",x.l=(t,o,a,n)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName("script"),f=0;f<u.length;f++){var s=u[f];if(s.getAttribute("src")==t||s.getAttribute("data-webpack")==r+a){i=s;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,x.nc&&i.setAttribute("nonce",x.nc),i.setAttribute("data-webpack",r+a),i.src=t),e[t]=[o];var d=(r,o)=>{i.onerror=i.onload=null,clearTimeout(c);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(o))),r)return r(o)},c=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},x.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{x.S={};var e={},r={};x.I=(t,o)=>{o||(o=[]);var a=r[t];if(a||(a=r[t]={}),!(o.indexOf(a)>=0)){if(o.push(a),e[t])return e[t];x.o(x.S,t)||(x.S[t]={});var n=x.S[t],i="@jupyter/collaboration-extension",l=(e,r,t,o)=>{var a=n[e]=n[e]||{},l=a[r];(!l||!l.loaded&&(!o!=!l.eager?o:i>l.from))&&(a[r]={get:t,from:i,eager:!!o})},u=[];return"default"===t&&(l("@jupyter/collaboration-extension","3.1.1",(()=>Promise.all([x.e(784),x.e(206),x.e(30),x.e(256),x.e(695),x.e(592),x.e(842)]).then((()=>()=>x(4842))))),l("@jupyter/collaboration","3.1.1",(()=>Promise.all([x.e(206),x.e(262),x.e(30),x.e(312),x.e(256),x.e(393)]).then((()=>()=>x(6393))))),l("@jupyter/collaborative-drive","3.1.1",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider","3.1.1",(()=>Promise.all([x.e(262),x.e(30),x.e(312),x.e(695),x.e(240)]).then((()=>()=>x(6240))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;x.g.importScripts&&(e=x.g.location+"");var r=x.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),x.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),o=t[1]?r(t[1]):[];return t[2]&&(o.length++,o.push.apply(o,r(t[2]))),t[3]&&(o.push([]),o.push.apply(o,r(t[3]))),o},o=(e,r)=>{e=t(e),r=t(r);for(var o=0;;){if(o>=e.length)return o<r.length&&"u"!=(typeof r[o])[0];var a=e[o],n=(typeof a)[0];if(o>=r.length)return"u"==n;var i=r[o],l=(typeof i)[0];if(n!=l)return"o"==n&&"n"==l||"s"==l||"u"==n;if("o"!=n&&"u"!=n&&a!=i)return a<i;o++}},a=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var o=1,n=1;n<e.length;n++)o--,t+="u"==(typeof(l=e[n]))[0]?"-":(o>0?".":"")+(o=2,l);return t}var i=[];for(n=1;n<e.length;n++){var l=e[n];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():a(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},n=(e,r)=>{if(0 in e){r=t(r);var o=e[0],a=o<0;a&&(o=-o-1);for(var i=0,l=1,u=!0;;l++,i++){var f,s,d=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(s=(typeof(f=r[i]))[0]))return!u||("u"==d?l>o&&!a:""==d!=a);if("u"==s){if(!u||"u"!=d)return!1}else if(u)if(d==s)if(l<=o){if(f!=e[l])return!1}else{if(a?f>e[l]:f<e[l])return!1;f!=e[l]&&(u=!1)}else if("s"!=d&&"n"!=d){if(a||l<=o)return!1;u=!1,l--}else{if(l<=o||s<d!=a)return!1;u=!1}else"s"!=d&&"n"!=d&&(u=!1,l--)}}var c=[],p=c.pop.bind(c);for(i=1;i<e.length;i++){var h=e[i];c.push(1==h?p()|p():2==h?p()&p():h?n(h,r):!p())}return!!p()},i=(e,r)=>e&&x.o(e,r),l=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),f=(e,r,t,a)=>{var i=a?u(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!n(t,r)||e&&!o(e,r)?e:r),0))&&i[r]},s=(e,r,t)=>{var a=t?u(e[r]):e[r];return Object.keys(a).reduce(((e,r)=>!e||!a[e].loaded&&o(e,r)?r:e),0)},d=(e,r,t,o)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(o)+")",c=(e,r,t,o,n)=>{var i=e[t];return"No satisfying version ("+a(o)+")"+(n?" for eager consumption":"")+" of shared module "+t+" found in shared scope "+r+".\nAvailable versions: "+Object.keys(i).map((e=>e+" from "+i[e].from)).join(", ")},p=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},b=(e,r,t)=>t?t():((e,r)=>p("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),m=(v=e=>function(r,t,o,a,n){var i=x.I(r);return i&&i.then&&!o?i.then(e.bind(e,r,x.S[r],t,!1,a,n)):e(r,x.S[r],t,o,a,n)})(((e,r,t,o,a,n)=>{if(!i(r,t))return b(e,t,n);var u=f(r,t,a,o);return u?l(u):n?n():void p(c(r,e,t,a,o))})),y=v(((e,r,t,o,a,u)=>{if(!i(r,t))return b(e,t,u);var f=s(r,t,o);return n(a,f)||h(d(r,t,f,a)),l(r[t][f])})),g={},j={2206:()=>y("default","yjs",!1,[1,13,5,40]),1808:()=>y("default","@jupyterlab/coreutils",!1,[1,6,4,0]),6989:()=>y("default","@jupyterlab/ui-components",!1,[1,4,4,0]),7579:()=>y("default","@jupyterlab/translation",!1,[1,4,4,0]),9569:()=>y("default","@jupyterlab/apputils",!1,[1,4,5,0]),5256:()=>y("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",0]),7695:()=>y("default","@jupyterlab/services",!1,[1,7,4,0]),2691:()=>y("default","@jupyter/collaborative-drive",!1,[1,3,1,1],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),4387:()=>y("default","@jupyter/collaboration",!1,[1,3,1,1],(()=>Promise.all([x.e(262),x.e(312),x.e(393)]).then((()=>()=>x(6393))))),4608:()=>y("default","@jupyterlab/codemirror",!1,[1,4,4,0]),7135:()=>y("default","@jupyterlab/statedb",!1,[1,4,4,0]),8751:()=>y("default","@jupyter/docprovider",!1,[1,3,1,1],(()=>Promise.all([x.e(262),x.e(312),x.e(240)]).then((()=>()=>x(6240))))),7262:()=>y("default","@lumino/coreutils",!1,[1,2,0,0]),3345:()=>y("default","react",!1,[1,18,2,0]),4602:()=>y("default","@lumino/signaling",!1,[1,2,0,0]),195:()=>y("default","@codemirror/state",!1,[1,6,2,0]),4873:()=>y("default","@lumino/virtualdom",!1,[1,2,0,0]),5024:()=>y("default","@codemirror/view",!1,[1,6,9,6]),3560:()=>m("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))},w={30:[1808,6989,7579,9569],206:[2206],240:[3560],256:[5256],262:[7262],312:[3345,4602],393:[195,4873,5024],592:[2691,4387,4608,7135,8751],695:[7695]},P={},x.f.consumes=(e,r)=>{x.o(w,e)&&w[e].forEach((e=>{if(x.o(g,e))return r.push(g[e]);if(!P[e]){var t=r=>{g[e]=0,x.m[e]=t=>{delete x.c[e],t.exports=r()}};P[e]=!0;var o=r=>{delete g[e],x.m[e]=t=>{throw delete x.c[e],r}};try{var a=j[e]();a.then?r.push(g[e]=a.then(t).catch(o)):t(a)}catch(e){o(e)}}}))},(()=>{var e={270:0};x.f.j=(r,t)=>{var o=x.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(/^(2(06|56|62)|30|312|592|695)$/.test(r))e[r]=0;else{var a=new Promise(((t,a)=>o=e[r]=[t,a]));t.push(o[2]=a);var n=x.p+x.u(r),i=new Error;x.l(n,(t=>{if(x.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,o[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,a,[n,i,l]=t,u=0;if(n.some((r=>0!==e[r]))){for(o in i)x.o(i,o)&&(x.m[o]=i[o]);l&&l(x)}for(r&&r(t);u<n.length;u++)a=n[u],x.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(1998);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/collaboration-extension"]=E})();
@@ -2,19 +2,19 @@
2
2
  "packages": [
3
3
  {
4
4
  "name": "@jupyter/collaboration",
5
- "versionInfo": "3.1.0-beta.0",
5
+ "versionInfo": "3.1.1",
6
6
  "licenseId": "BSD-3-Clause",
7
7
  "extractedText": ""
8
8
  },
9
9
  {
10
10
  "name": "@jupyter/collaborative-drive",
11
- "versionInfo": "3.1.0-beta.0",
11
+ "versionInfo": "3.1.1",
12
12
  "licenseId": "BSD-3-Clause",
13
13
  "extractedText": ""
14
14
  },
15
15
  {
16
16
  "name": "@jupyter/docprovider",
17
- "versionInfo": "3.1.0-beta.0",
17
+ "versionInfo": "3.1.1",
18
18
  "licenseId": "BSD-3-Clause",
19
19
  "extractedText": ""
20
20
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/collaboration",
3
- "version": "3.1.0-beta.0",
3
+ "version": "3.1.1",
4
4
  "description": "JupyterLab - Real-Time Collaboration Widgets",
5
5
  "homepage": "https://github.com/jupyterlab/jupyter-collaboration",
6
6
  "bugs": {
@@ -166,7 +166,7 @@ export function Collaborator(props: {
166
166
  const fileTypes = props.docRegistry
167
167
  ?.getFileTypesForPath(path[1])
168
168
  ?.filter(ft => ft.icon !== undefined);
169
- const icon = fileTypes ? fileTypes[0].icon! : fileIcon;
169
+ const icon = fileTypes?.length ? fileTypes[0].icon : fileIcon;
170
170
  const iconClass: string | undefined = fileTypes
171
171
  ? fileTypes[0].iconClass
172
172
  : undefined;
@@ -11,3 +11,4 @@ export * from './cursors';
11
11
  export * from './menu';
12
12
  export * from './sharedlink';
13
13
  export * from './userinfopanel';
14
+ export * from './users-item';
@@ -0,0 +1,201 @@
1
+ /*
2
+ * Copyright (c) Jupyter Development Team.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+
6
+ import { DocumentRegistry } from '@jupyterlab/docregistry';
7
+ import { User } from '@jupyterlab/services';
8
+ import { classes, ReactWidget } from '@jupyterlab/ui-components';
9
+ import * as React from 'react';
10
+
11
+ const USERS_ITEM_CLASS = 'jp-toolbar-users-item';
12
+
13
+ /**
14
+ * The namespace for the UsersItem component.
15
+ */
16
+ export namespace UsersItem {
17
+ /**
18
+ * Properties of the component.
19
+ */
20
+ export interface IProps {
21
+ /**
22
+ * The model of the document.
23
+ */
24
+ model: DocumentRegistry.IModel | null;
25
+
26
+ /**
27
+ * A function to display the user icons, optional.
28
+ * This function will overwrite the default one, and can be used to handle event on
29
+ * icons.
30
+ */
31
+ iconRenderer?: (props: UsersItem.IIconRendererProps) => JSX.Element;
32
+ }
33
+
34
+ /**
35
+ * The state of the component.
36
+ */
37
+ export interface IState {
38
+ /**
39
+ * The user list.
40
+ */
41
+ usersList: IUserData[];
42
+ }
43
+
44
+ /**
45
+ * Properties send to the iconRenderer function.
46
+ */
47
+ export interface IIconRendererProps
48
+ extends React.HTMLAttributes<HTMLElement> {
49
+ /**
50
+ * The user.
51
+ */
52
+ user: IUserData;
53
+
54
+ /**
55
+ * The document's model.
56
+ */
57
+ model?: DocumentRegistry.IModel;
58
+ }
59
+
60
+ /**
61
+ * The user data type.
62
+ */
63
+ export type IUserData = {
64
+ /**
65
+ * User id (the client id of the awareness).
66
+ */
67
+ userId: number;
68
+ /**
69
+ * User data.
70
+ */
71
+ userData: User.IIdentity;
72
+ };
73
+ }
74
+
75
+ /**
76
+ * A component displaying the collaborative users of a document.
77
+ */
78
+ export class UsersItem extends React.Component<
79
+ UsersItem.IProps,
80
+ UsersItem.IState
81
+ > {
82
+ constructor(props: UsersItem.IProps) {
83
+ super(props);
84
+ this._model = props.model;
85
+ this._iconRenderer = props.iconRenderer ?? null;
86
+ this.state = { usersList: [] };
87
+ }
88
+
89
+ /**
90
+ * Static method to create a widget.
91
+ */
92
+ static createWidget(options: UsersItem.IProps): ReactWidget {
93
+ return ReactWidget.create(<UsersItem {...options} />);
94
+ }
95
+
96
+ componentDidMount(): void {
97
+ this._model?.sharedModel.awareness.on('change', this._awarenessChange);
98
+ this._awarenessChange();
99
+ }
100
+
101
+ /**
102
+ * Filter out the duplicated users, which can happen temporary on reload.
103
+ */
104
+ private filterDuplicated(
105
+ usersList: UsersItem.IUserData[]
106
+ ): UsersItem.IUserData[] {
107
+ const newList: UsersItem.IUserData[] = [];
108
+ const selected = new Set<string>();
109
+ for (const element of usersList) {
110
+ if (
111
+ element?.userData?.username &&
112
+ !selected.has(element.userData.username)
113
+ ) {
114
+ selected.add(element.userData.username);
115
+ newList.push(element);
116
+ }
117
+ }
118
+ return newList;
119
+ }
120
+
121
+ render(): React.ReactNode {
122
+ const IconRenderer = this._iconRenderer ?? DefaultIconRenderer;
123
+ return (
124
+ <div className={USERS_ITEM_CLASS}>
125
+ {this.filterDuplicated(this.state.usersList).map(user => {
126
+ if (
127
+ this._model &&
128
+ user.userId !== this._model.sharedModel.awareness.clientID
129
+ ) {
130
+ return IconRenderer({ user, model: this._model });
131
+ }
132
+ })}
133
+ </div>
134
+ );
135
+ }
136
+
137
+ /**
138
+ * Triggered when a change occurs in the document awareness, to build again the users list.
139
+ */
140
+ private _awarenessChange = () => {
141
+ const clients = this._model?.sharedModel.awareness.getStates() as Map<
142
+ number,
143
+ User.IIdentity
144
+ >;
145
+
146
+ const users: UsersItem.IUserData[] = [];
147
+ if (clients) {
148
+ clients.forEach((val, key) => {
149
+ if (val.user) {
150
+ users.push({ userId: key, userData: val.user as User.IIdentity });
151
+ }
152
+ });
153
+ }
154
+ this.setState(old => ({ ...old, usersList: users }));
155
+ };
156
+
157
+ private _model: DocumentRegistry.IModel | null;
158
+ private _iconRenderer:
159
+ | ((props: UsersItem.IIconRendererProps) => JSX.Element)
160
+ | null;
161
+ }
162
+
163
+ /**
164
+ * Default renderer for the user icon.
165
+ */
166
+ export function DefaultIconRenderer(
167
+ props: UsersItem.IIconRendererProps
168
+ ): JSX.Element {
169
+ let el: JSX.Element;
170
+
171
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
172
+ const { user, model, ...htmlProps } = props;
173
+
174
+ const iconClasses = classes('lm-MenuBar-itemIcon', props.className || '');
175
+ if (user.userData.avatar_url) {
176
+ el = (
177
+ <div
178
+ {...htmlProps}
179
+ key={user.userId}
180
+ title={user.userData.display_name}
181
+ className={classes(iconClasses, 'jp-MenuBar-imageIcon')}
182
+ >
183
+ <img src={user.userData.avatar_url} alt="" />
184
+ </div>
185
+ );
186
+ } else {
187
+ el = (
188
+ <div
189
+ {...htmlProps}
190
+ key={user.userId}
191
+ title={user.userData.display_name}
192
+ className={classes(iconClasses, 'jp-MenuBar-anonymousIcon')}
193
+ style={{ backgroundColor: user.userData.color }}
194
+ >
195
+ <span>{user.userData.initials}</span>
196
+ </div>
197
+ );
198
+ }
199
+
200
+ return el;
201
+ }
@@ -5,6 +5,7 @@
5
5
 
6
6
  @import url('./menu.css');
7
7
  @import url('./sidepanel.css');
8
+ @import url('./users-item.css');
8
9
 
9
10
  .jp-shared-link-body {
10
11
  user-select: none;
@@ -0,0 +1,20 @@
1
+ /* -----------------------------------------------------------------------------
2
+ | Copyright (c) Jupyter Development Team.
3
+ | Distributed under the terms of the Modified BSD License.
4
+ |---------------------------------------------------------------------------- */
5
+
6
+ .jp-toolbar-users-item {
7
+ flex-grow: 1;
8
+ display: flex;
9
+ flex-direction: row;
10
+ }
11
+
12
+ .jp-toolbar-users-item .jp-MenuBar-anonymousIcon,
13
+ .jp-toolbar-users-item .jp-MenuBar-imageIcon {
14
+ position: relative;
15
+ left: 0;
16
+ height: 22px;
17
+ width: 22px;
18
+ box-sizing: border-box;
19
+ cursor: default;
20
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/collaboration-extension",
3
- "version": "3.1.0-beta.0",
3
+ "version": "3.1.1",
4
4
  "description": "JupyterLab - Real-Time Collaboration Extension",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,10 +53,10 @@
53
53
  "watch:labextension": "jupyter labextension watch ."
54
54
  },
55
55
  "dependencies": {
56
- "@jupyter/collaboration": "^3.1.0-beta.0",
57
- "@jupyter/collaborative-drive": "^3.1.0-beta.0",
58
- "@jupyter/docprovider": "^3.1.0-beta.0",
59
- "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
56
+ "@jupyter/collaboration": "^3.1.1",
57
+ "@jupyter/collaborative-drive": "^3.1.1",
58
+ "@jupyter/docprovider": "^3.1.1",
59
+ "@jupyter/ydoc": "^2.1.3 || ^3.0.0",
60
60
  "@jupyterlab/application": "^4.2.0",
61
61
  "@jupyterlab/apputils": "^4.2.0",
62
62
  "@jupyterlab/codemirror": "^4.2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/collaborative-drive",
3
- "version": "3.1.0-beta.0",
3
+ "version": "3.1.1",
4
4
  "description": "JupyterLab - Collaborative Drive",
5
5
  "homepage": "https://github.com/jupyterlab/jupyter-collaboration",
6
6
  "bugs": {
@@ -37,7 +37,7 @@
37
37
  "watch": "tsc -b --watch"
38
38
  },
39
39
  "dependencies": {
40
- "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
40
+ "@jupyter/ydoc": "^2.1.3 || ^3.0.0",
41
41
  "@jupyterlab/services": "^7.2.0",
42
42
  "@lumino/coreutils": "^2.1.0",
43
43
  "@lumino/disposable": "^2.1.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/docprovider",
3
- "version": "3.1.0-beta.0",
3
+ "version": "3.1.1",
4
4
  "description": "JupyterLab - Document Provider",
5
5
  "homepage": "https://github.com/jupyterlab/jupyter-collaboration",
6
6
  "bugs": {
@@ -41,8 +41,8 @@
41
41
  "watch": "tsc -b --watch"
42
42
  },
43
43
  "dependencies": {
44
- "@jupyter/collaborative-drive": "^3.1.0-beta.0",
45
- "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
44
+ "@jupyter/collaborative-drive": "^3.1.1",
45
+ "@jupyter/ydoc": "^2.1.3 || ^3.0.0",
46
46
  "@jupyterlab/apputils": "^4.2.0",
47
47
  "@jupyterlab/cells": "^4.2.0",
48
48
  "@jupyterlab/coreutils": "^6.2.0",
@@ -206,7 +206,8 @@ export class YDrive extends Drive implements ICollaborativeDrive {
206
206
  // A change in hash signifies that a save occurred on the server-side
207
207
  // (e.g. a collaborator performed the save) - we want to notify the
208
208
  // observers about this change so that they can store the new hash value.
209
- const model = await this.get(options.path, { content: false });
209
+ const newPath = sharedModel.state.path ?? options.path;
210
+ const model = await this.get(newPath as string, { content: false });
210
211
 
211
212
  this._ydriveFileChanged.emit({
212
213
  type: 'save',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/docprovider-extension",
3
- "version": "3.1.0-beta.0",
3
+ "version": "3.1.1",
4
4
  "description": "JupyterLab - Collaborative Shared Models",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,9 +53,9 @@
53
53
  "watch:labextension": "jupyter labextension watch ."
54
54
  },
55
55
  "dependencies": {
56
- "@jupyter/collaborative-drive": "^3.1.0-beta.0",
57
- "@jupyter/docprovider": "^3.1.0-beta.0",
58
- "@jupyter/ydoc": "^2.0.0 || ^3.0.0",
56
+ "@jupyter/collaborative-drive": "^3.1.1",
57
+ "@jupyter/docprovider": "^3.1.1",
58
+ "@jupyter/ydoc": "^2.1.3 || ^3.0.0",
59
59
  "@jupyterlab/application": "^4.2.0",
60
60
  "@jupyterlab/apputils": "^4.2.0",
61
61
  "@jupyterlab/docregistry": "^4.2.0",
@@ -1 +0,0 @@
1
- __version__ = "1.1.0b0"
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[240],{5068:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),s=n(935),i=n.n(s)()(r());i.push([e.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-timelineSliderWrapper .jp-sliderContainer{\n display: flex;\n align-items: center;\n}\n\n.jp-Slider {\n height: 4.5px\n}\n\n#jp-slider-status-bar {\n display: flex;\n}\n\n.jp-timestampDisplay {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n\n.jp-restoreBtnContainer {\n width: 192px;\n}\n\n.jp-ToolbarButtonComponent.jp-restoreBtn {\n cursor: pointer;\n color: var(--jp-layout-color2);\n width: 100%;\n background: var(--jp-accept-color-normal)\n}\n",""]);const a=i},935:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var d=[].concat(e[l]);o&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},6758:e=>{e.exports=function(e){return e[1]}},2591:e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},i=[],a=0;a<e.length;a++){var c=e[a],l=o.base?c[0]+o.base:c[0],d=s[l]||0,h="".concat(l," ").concat(d);s[l]=d+1;var u=n(h),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var m=r(p,o);o.byIndex=a,t.splice(a,0,{identifier:h,updater:m,references:1})}i.push(h)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=o(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var c=o(e,r),l=0;l<s.length;l++){var d=n(s[l]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=c}}},8128:e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},3051:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},855:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},1740:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,r&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},3656:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},6240:(e,t,n)=>{n.r(t),n.d(t,{ForkManager:()=>K,IForkManagerToken:()=>J,JUPYTER_COLLABORATION_FORK_EVENTS_URI:()=>q,NotebookCellServerExecutor:()=>l,ROOM_FORK_URL:()=>p,TimelineWidget:()=>B,WebSocketAwarenessProvider:()=>r,WebSocketProvider:()=>w,YDrive:()=>k,requestAPI:()=>m,requestDocSession:()=>f,requestDocumentTimeline:()=>v,requestUndoRedo:()=>g});var o=n(3560);class r extends o.WebsocketProvider{constructor(e){super(e.url,e.roomID,e.awareness.doc,{awareness:e.awareness}),this._isDisposed=!1,this._awareness=e.awareness,this._user=e.user,this._user.ready.then((()=>this._onUserChanged(this._user))).catch((e=>console.error(e))),this._user.userChanged.connect(this._onUserChanged,this)}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._user.userChanged.disconnect(this._onUserChanged,this),this._isDisposed=!0,this.destroy())}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}var s=n(6501),i=n(314),a=n(9033),c=n(2877);class l{constructor(e){var t;this._serverSettings=null!==(t=e.serverSettings)&&void 0!==t?t:a.ServerConnection.makeSettings()}async runCell({cell:e,notebook:t,notebookConfig:n,onCellExecuted:o,onCellExecutionScheduled:r,sessionContext:l,sessionDialogs:d,translator:h}){var u,p,m;const f=(h=null!=h?h:c.nullTranslator).load("jupyterlab");switch(e.model.type){case"markdown":e.rendered=!0,e.inputHidden=!1,o({cell:e,success:!0});break;case"code":if(l){if(l.isTerminating){await(0,s.showDialog)({title:f.__("Kernel Terminating"),body:f.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",null===(u=l.session)||void 0===u?void 0:u.path),buttons:[s.Dialog.okButton()]});break}if(l.pendingInput)return await(0,s.showDialog)({title:f.__("Cell not executed due to pending input"),body:f.__("The cell has not been executed to avoid kernel deadlock as there is another pending input! Submit your pending input and try again."),buttons:[s.Dialog.okButton()]}),!1;if(l.hasNoKernel&&await l.startKernel()&&d&&await d.selectKernel(l),l.hasNoKernel)return e.model.sharedModel.transact((()=>{e.model.clearExecution()})),!0;const n=null===(m=null===(p=null==l?void 0:l.session)||void 0===p?void 0:p.kernel)||void 0===m?void 0:m.id,c=i.URLExt.join(this._serverSettings.baseUrl,`api/kernels/${n}/execute`),h=e.model.sharedModel.getId(),v=t.sharedModel.getState("document_id"),g={method:"POST",body:JSON.stringify({cell_id:h,document_id:v})};r({cell:e});let y=!1;try{y=(await a.ServerConnection.makeRequest(c,g,this._serverSettings)).ok}catch(t){if(o({cell:e,success:!1}),e.isDisposed)return!1;throw t}return o({cell:e,success:y}),!0}e.model.sharedModel.transact((()=>{e.model.clearExecution()}),!1)}return Promise.resolve(!0)}}const d="api/collaboration/session",h="api/collaboration/undo_redo",u="api/collaboration/timeline",p="api/collaboration/fork";async function m(e="",t={}){const n=a.ServerConnection.makeSettings(),o=i.URLExt.join(n.baseUrl,e);let r;try{r=await a.ServerConnection.makeRequest(o,t,n)}catch(e){throw new a.ServerConnection.NetworkError(e)}let s=await r.text();if(s.length>0)try{s=JSON.parse(s)}catch(e){console.error("Not a JSON response body.",r)}if(!r.ok)throw new a.ServerConnection.ResponseError(r,s.message||s);return s}async function f(e,t,n){const o=a.ServerConnection.makeSettings(),r=i.URLExt.join(o.baseUrl,d,encodeURIComponent(n)),s={method:"PUT",body:JSON.stringify({format:e,type:t})};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}let l=await c.text();if(l.length>0)try{l=JSON.parse(l)}catch(e){console.log("Not a JSON response body.",c)}if(!c.ok)throw new a.ServerConnection.ResponseError(c,l.message||l);return l}async function v(e,t,n){const o=a.ServerConnection.makeSettings();let r=i.URLExt.join(o.baseUrl,u,n);r=r.concat(`?format=${e}&&type=${t}`);const s={method:"GET"};let c;try{c=await a.ServerConnection.makeRequest(r,s,o)}catch(e){throw new a.ServerConnection.NetworkError(e)}return c}async function g(e,t,n,o){const r=a.ServerConnection.makeSettings();let s=i.URLExt.join(r.baseUrl,h,encodeURIComponent(e));s=s.concat(`?action=${t}&&steps=${n}&&forkRoom=${o}`);const c={method:"PUT"};let l;try{l=await a.ServerConnection.makeRequest(s,c,r)}catch(e){throw new a.ServerConnection.NetworkError(e)}let d=await l.text();if(d.length>0)try{d=JSON.parse(d)}catch(e){console.log("Not a JSON response body.",l)}if(!l.ok)throw new a.ServerConnection.ResponseError(l,d.message||d);return d}var y=n(4602),_=n(7262);class w{constructor(e){this._onConnectionClosed=e=>{1003===e.code&&(console.error("Document provider closed:",e.reason),(0,s.showErrorMessage)(this._trans.__("Document session error"),e.reason,[s.Dialog.okButton()]),this._sharedModel.dispose())},this._onSync=e=>{e&&(this._yWebsocketProvider&&(this._yWebsocketProvider.off("sync",this._onSync),this._sharedModel.ydoc.getMap("state").set("document_id",this._yWebsocketProvider.roomname)),this._ready.resolve())},this._ready=new _.PromiseDelegate,this._isDisposed=!1,this._path=e.path,this._contentType=e.contentType,this._format=e.format,this._serverUrl=e.url,this._sharedModel=e.model,this._awareness=e.model.awareness,this._yWebsocketProvider=null,this._trans=e.translator;const t=e.user;t.ready.then((()=>{this._onUserChanged(t)})).catch((e=>console.error(e))),t.userChanged.connect(this._onUserChanged,this),this._connect().catch((e=>console.warn(e)))}get isDisposed(){return this._isDisposed}get ready(){return this._ready.promise}get contentType(){return this._contentType}get format(){return this._format}dispose(){var e,t,n;this.isDisposed||(this._isDisposed=!0,null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._disconnect(),y.Signal.clearData(this))}async reconnect(){this._disconnect(),this._connect()}async _connect(){const e=await f(this._format,this._contentType,this._path);this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,`${e.format}:${e.type}:${e.fileId}`,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:e.sessionId},awareness:this._awareness}),this._yWebsocketProvider.on("sync",this._onSync),this._yWebsocketProvider.on("connection-close",this._onConnectionClosed)}async connectToForkDoc(e,t){this._disconnect(),this._yWebsocketProvider=new o.WebsocketProvider(this._serverUrl,e,this._sharedModel.ydoc,{disableBc:!0,params:{sessionId:t},awareness:this._awareness})}get wsProvider(){return this._yWebsocketProvider}_disconnect(){var e,t,n;null===(e=this._yWebsocketProvider)||void 0===e||e.off("connection-close",this._onConnectionClosed),null===(t=this._yWebsocketProvider)||void 0===t||t.off("sync",this._onSync),null===(n=this._yWebsocketProvider)||void 0===n||n.destroy(),this._yWebsocketProvider=null}_onUserChanged(e){this._awareness.setLocalStateField("user",e.identity)}}const S="true"===i.PageConfig.getOption("disableRTC");class k extends a.Drive{constructor(e,t,n){super({name:"RTC"}),this._onCreate=(e,t)=>{var n,o;if("string"==typeof e.format)try{const r=new w({url:i.URLExt.join(this.serverSettings.wsUrl,"api/collaboration/room"),path:e.path,format:e.format,contentType:e.contentType,model:t,user:this._user,translator:this._trans}),s=((null===(n=this._globalAwareness)||void 0===n?void 0:n.getLocalState())||{}).documents||[];s.includes(e.path)||(s.push(`${this.name}:${e.path}`),null===(o=this._globalAwareness)||void 0===o||o.setLocalStateField("documents",s));const a=`${e.format}:${e.contentType}:${e.path}`;this._providers.set(a,r),t.changed.connect((async(t,n)=>{if(!n.stateChange)return;const o=n.stateChange.filter((e=>"hash"===e.name));if(0===o.length)return;o.length>1&&console.error("Unexpected multiple changes to hash value in a single transaction");const r=o[0],s=await this.get(e.path,{content:!1});this._ydriveFileChanged.emit({type:"save",newValue:{...s,hash:r.newValue},oldValue:{hash:r.oldValue}})})),t.disposed.connect((()=>{var t,n;const o=this._providers.get(a);o&&(o.dispose(),this._providers.delete(a));const r=((null===(t=this._globalAwareness)||void 0===t?void 0:t.getLocalState())||{}).documents||[],s=r.indexOf(`${this.name}:${e.path}`);s>-1&&r.splice(s,1),null===(n=this._globalAwareness)||void 0===n||n.setLocalStateField("documents",r)}))}catch(t){console.error(`Failed to open websocket connection for ${e.path}.\n:${t}`)}},this._ydriveFileChanged=new y.Signal(this),this._user=e,this._trans=t,this._globalAwareness=n,this._providers=new Map,this.sharedModelFactory=new b(this._onCreate),super.fileChanged.connect(((e,t)=>{this._ydriveFileChanged.emit(t)}))}get providers(){return this._providers}dispose(){this.isDisposed||(this._providers.forEach((e=>e.dispose())),this._providers.clear(),super.dispose())}async get(e,t){if(t&&t.format&&t.type){const n=`${t.format}:${t.type}:${e}`,o=this._providers.get(n);if(o){const[n]=await Promise.all([super.get(e,{...t,content:!1}),o.ready]);return{...n,format:t.format}}}return super.get(e,t)}async save(e,t={}){if(t.format&&t.type){const n=`${t.format}:${t.type}:${e}`;if(this._providers.get(n)){const n={type:t.type,format:t.format,content:!1};return this.get(e,n)}}return super.save(e,t)}get fileChanged(){return this._ydriveFileChanged}}class b{constructor(e){this._onCreate=e,this.collaborative=!S,this.documentFactories=new Map}registerDocumentFactory(e,t){if(this.documentFactories.has(e))throw new Error(`The content type ${e} already exists`);this.documentFactories.set(e,t)}createNew(e){if("string"==typeof e.format){if(this.collaborative&&e.collaborative&&this.documentFactories.has(e.contentType)){const t=this.documentFactories.get(e.contentType)(e);return this._onCreate(e,t),t}}else console.warn(`Only defined format are supported; got ${e.format}.`)}}var C=n(3345),T=n.n(C),E=n(2591),x=n.n(E),R=n(1740),U=n.n(R),D=n(8128),$=n.n(D),N=n(855),P=n.n(N),j=n(3051),I=n.n(j),L=n(3656),M=n.n(L),F=n(5068),W={};W.styleTagTransform=M(),W.setAttributes=P(),W.insert=$().bind(null,"head"),W.domAPI=U(),W.insertStyleElement=I(),x()(F.A,W),F.A&&F.A.locals&&F.A.locals;var A=n(7963);const O=({apiURL:e,provider:t,contentType:n,format:o,documentTimelineUrl:r})=>{const[i,a]=(0,C.useState)({roomId:"",timestamps:[],forkRoom:"",sessionId:""}),[c,l]=(0,C.useState)(i.timestamps.length-1),[d,h]=(0,C.useState)(!1),[u,p]=(0,C.useState)(!1),m=(0,C.useRef)(!0),y=(0,C.useRef)(!0),_=(0,C.useRef)(null);function w(e){try{const t=new URL(e).pathname,n=t.lastIndexOf(r);if(-1===n)throw new Error(`API segment "${r}" not found in URL.`);return t.slice(n+r.length)}catch(e){return console.error("Invalid URL or unable to extract filename:",e),""}}return T().createElement("div",{className:"jp-sliderContainer"},T().createElement("div",{onClick:()=>{!async function(r){try{if(m.current){const i=await v(o,n,r);if(!i.ok)throw 404===i.status?new Error("Not found"):503===i.status?new Error("WebSocket closed"):new Error(`Failed to fetch data: ${i.statusText}`);const c=await i.text();let d={roomId:"",timestamps:[],forkRoom:"",sessionId:""};return c&&(s.Notification.warning("Document is now in read-only mode. Changes will not be saved.",{autoClose:2500}),d=JSON.parse(c),a(d),l(d.timestamps.length-1),t.connectToForkDoc(d.forkRoom,d.sessionId),_.current=await f(o,n,w(e))),h(!0),m.current=!1,d}}catch(e){console.error("Error fetching data:",e)}}(w(e))},className:"jp-mod-highlighted",title:"Document Timeline"},T().createElement(A.historyIcon.react,{marginRight:"4px"})),d&&T().createElement("div",{className:"jp-timestampDisplay"},T().createElement("input",{type:"range",min:0,max:i.timestamps.length-1,value:c,onChange:async e=>{const t=parseInt(e.target.value),n=Math.abs(t-c);try{const e=function(e){return e<c?"undo":"redo"}(t);if(l(t),y.current&&(p(!0),y.current=!1),!_.current)return void console.error("Session is not initialized");await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,e,n,i.forkRoom)}catch(e){console.error("Error fetching or applying updates:",e)}},className:"jp-Slider"}),T().createElement("div",null,T().createElement("strong",null,w(e).split("/").pop()," ")," "),u&&T().createElement("div",{className:"jp-restoreBtnContainer"},T().createElement("button",{onClick:async()=>{if(!_.current)return void console.error("Session is not initialized");const e=await g(`${_.current.format}:${_.current.type}:${_.current.fileId}`,"restore",0,i.forkRoom);200===e.code?(s.Notification.success(e.status,{autoClose:4e3}),t.reconnect(),h(!1),m.current=!0):s.Notification.error(e.status,{autoClose:4e3})},className:"jp-ToolbarButtonComponent jp-restoreBtn"},"Restore version"," ",(e=>{const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`})(i.timestamps[c])))))};class B extends s.ReactWidget{constructor(e,t,n,o,r){super(),this.apiURL=e,this.provider=t,this.contentType=n,this.format=o,this.documentTimelineUrl=r,this.addClass("jp-timelineSliderWrapper")}render(){return C.createElement(O,{key:this.apiURL,apiURL:this.apiURL,provider:this.provider,contentType:this.contentType,format:this.format,documentTimelineUrl:this.documentTimelineUrl})}updateContent(e,t){this.apiURL=e,this.provider=t,this.contentType=this.provider.contentType,this.format=this.provider.format,this.update()}}const J=new _.Token("@jupyter/docprovider:IForkManagerToken"),q="https://schema.jupyter.org/jupyter_collaboration/fork/v1";class K{constructor(e){this._disposed=!1,this._forkAddedSignal=new y.Signal(this),this._forkDeletedSignal=new y.Signal(this);const{drive:t,eventManager:n}=e;this._drive=t,this._eventManager=n,this._eventManager.stream.connect(this._handleEvent,this)}get isDisposed(){return this._disposed}get forkAdded(){return this._forkAddedSignal}get forkDeleted(){return this._forkDeletedSignal}dispose(){var e;this._disposed||(null===(e=this._eventManager)||void 0===e||e.stream.disconnect(this._handleEvent),this._disposed=!0)}async createFork(e){const{rootId:t,title:n,description:o,synchronize:r}=e,s={method:"PUT",body:JSON.stringify({title:n,description:o,synchronize:r})},a=i.URLExt.join(p,t);return await m(a,s)}async getAllForks(e){const t=i.URLExt.join(p,e);return await m(t,{method:"GET"})}async deleteFork(e){const{forkId:t,merge:n}=e,o=i.URLExt.join(p,t),r=i.URLExt.objectToQueryString({merge:n});await m(`${o}${r}`,{method:"DELETE"})}getProvider(e){const{documentPath:t,format:n,type:o}=e,r=this._drive;if(r){const e=r.name;let s=t;return t.startsWith(e)&&(s=t.slice(e.length+1)),r.providers.get(`${n}:${o}:${s}`)}}_handleEvent(e,t){if(t.schema_id===q)switch(t.action){case"create":this._forkAddedSignal.emit(t);break;case"delete":this._forkDeletedSignal.emit(t)}}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[44],{2044:(e,t,n)=>{n.r(t),n.d(t,{Collaborator:()=>C,CollaboratorsBody:()=>y,CollaboratorsPanel:()=>g,IUserMenu:()=>r,RendererUserMenu:()=>M,UserInfoBody:()=>$,UserInfoPanel:()=>W,UserMenu:()=>N,remoteUserCursors:()=>S,showSharedLinkDialog:()=>B});var o=n(7262);const r=new o.Token("@jupyter/collaboration:IUserMenu");var s=n(6501),a=n(7963),i=n(4602),l=n(5256),c=n(3345),d=n.n(c);const u="jp-CollaboratorsList",h="jp-Collaborator",p="jp-CollaboratorHeader",m="jp-CollaboratorHeaderCollapser",f="jp-ClickableCollaborator",_="jp-CollaboratorIcon",b="jp-CollaboratorFiles",v="jp-CollaboratorFile";class g extends l.Panel{constructor(e,t,n,o){super({}),this._onAwarenessChanged=()=>{const e=this._awareness.getStates(),t=[];e.forEach(((e,n)=>{this._currentUser.isReady&&e.user&&e.user.username!==this._currentUser.identity.username&&t.push(e)})),this._collaboratorsChanged.emit(t)},this._collaboratorsChanged=new i.Signal(this),this._awareness=t,this._currentUser=e,this.addClass("jp-CollaboratorsPanel"),this.addWidget(s.ReactWidget.create(d().createElement(y,{fileopener:n,collaboratorsChanged:this._collaboratorsChanged,docRegistry:o}))),this._awareness.on("change",this._onAwarenessChanged)}}function y(e){const[t,n]=(0,c.useState)([]);return e.collaboratorsChanged.connect(((e,t)=>{n(t)})),d().createElement("div",{className:u},t.map(((t,n)=>d().createElement(C,{collaborator:t,fileopener:e.fileopener,docRegistry:e.docRegistry}))))}function C(e){const[t,n]=(0,c.useState)(!1),{collaborator:o,fileopener:r}=e;let s="";if(o.current){const e=o.current.split(":");s=`${e[1]}:${e[2]}`}const i=o.documents||[],l=i.map((t=>{var n,o;const r=t.split(":"),s=null===(o=null===(n=e.docRegistry)||void 0===n?void 0:n.getFileTypesForPath(r[1]))||void 0===o?void 0:o.filter((e=>void 0!==e.icon)),i=s?s[0].icon:a.fileIcon,l=s?s[0].iconClass:void 0;return{filepath:r[1],filename:r[1].length>40?r[1].slice(0,10).concat("…").concat(r[1].slice(r[1].length-15)):r[1],fileLocation:t,icon:i,iconClass:l}}));return d().createElement("div",{className:h},d().createElement("div",{className:l.length?`${f} ${p}`:p,onClick:i?()=>{l.length&&n(!t)}:void 0},d().createElement(a.LabIcon.resolveReact,{icon:a.caretDownIcon,className:m+(t?" jp-mod-expanded":""),tag:"div"}),d().createElement("div",{className:_,style:{backgroundColor:o.user.color}},d().createElement("span",null,o.user.initials)),d().createElement("span",null,o.user.display_name)),d().createElement("div",{className:`${b} jp-DirListing`,style:t?{}:{display:"none"}},d().createElement("ul",{className:"jp-DirListing-content"},l.map((e=>d().createElement("li",{className:"jp-DirListing-item "+(e.fileLocation===s?`${v} jp-mod-running`:v),key:e.filename,onClick:()=>r(e.fileLocation)},d().createElement(a.LabIcon.resolveReact,{icon:e.icon,iconClass:e.iconClass,tag:"span",className:"jp-DirListing-itemIcon",stylesheet:"listing"}),d().createElement("span",{className:"jp-DirListing-itemText",title:e.filepath},e.filename)))))))}var k=n(195),w=n(5024),j=n(2206);const x=k.Facet.define({combine:e=>e[e.length-1]}),I=w.EditorView.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip .jp-remote-userInfo":{color:"var(--jp-ui-inverse-font-color0)",padding:"0px 2px"}}),L=k.Annotation.define();class A{constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,n]of Object.entries(this.style))e.style[t]=n;return e}eq(e){return this.marker.eq(e.marker)&&o.JSONExt.deepEqual(this.style,e.style)}update(e,t){for(const[t,n]of Object.entries(this.style))e.style[t]=n;return this.marker.update(e,t.marker)}}const E=(0,w.layer)({above:!0,markers(e){const{awareness:t,ytext:n}=e.state.facet(x),o=n.doc,r=[];return t.getStates().forEach(((s,a)=>{var i,l,c;if(a===t.doc.clientID)return;const d=s.cursors;for(const t of null!=d?d:[]){if(!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const a=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,o),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,o);if((null==a?void 0:a.type)!==n||(null==d?void 0:d.type)!==n)return;const u=null===(i=t.primary)||void 0===i||i?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",h=k.EditorSelection.cursor(d.index,d.index>a.index?-1:1);for(const t of w.RectangleMarker.forRange(e,u,h))r.push(new A({borderLeftColor:null!==(c=null===(l=s.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),r},update:(e,t)=>!!e.transactions.find((e=>e.annotation(L))),class:"jp-remote-cursors"}),R=(0,w.hoverTooltip)(((e,t)=>{var n;const{awareness:o,ytext:r}=e.state.facet(x),s=r.doc;for(const[e,a]of o.getStates())if(e!==o.doc.clientID)for(const e of null!==(n=a.cursors)&&void 0!==n?n:[]){if(!(null==e?void 0:e.head))continue;const n=(0,j.createAbsolutePositionFromRelativePosition)(e.head,s);if((null==n?void 0:n.type)===r&&n.index-3<=t&&t<=n.index+3)return{pos:n.index,above:!0,create:()=>{var e,t,n,o;const r=document.createElement("div");return r.classList.add("jp-remote-userInfo"),r.style.backgroundColor=null!==(t=null===(e=a.user)||void 0===e?void 0:e.color)&&void 0!==t?t:"darkgrey",r.textContent=null!==(o=null===(n=a.user)||void 0===n?void 0:n.display_name)&&void 0!==o?o:"Anonymous",{dom:r}}}}return null}),{hideOn:(e,t)=>!!e.annotation(L),hoverTime:0}),P=(0,w.layer)({above:!1,markers(e){const{awareness:t,ytext:n}=e.state.facet(x),o=n.doc,r=[];return t.getStates().forEach(((s,a)=>{var i,l,c;if(a===t.doc.clientID)return;const d=s.cursors;for(const t of null!=d?d:[]){if(null===(i=t.empty)||void 0===i||i||!(null==t?void 0:t.anchor)||!(null==t?void 0:t.head))return;const a=(0,j.createAbsolutePositionFromRelativePosition)(t.anchor,o),d=(0,j.createAbsolutePositionFromRelativePosition)(t.head,o);if((null==a?void 0:a.type)!==n||(null==d?void 0:d.type)!==n)return;const u="jp-remote-selection";for(const t of w.RectangleMarker.forRange(e,u,k.EditorSelection.range(a.index,d.index)))r.push(new A({backgroundColor:null!==(c=null===(l=s.user)||void 0===l?void 0:l.color)&&void 0!==c?c:"black"},t))}})),r},update:(e,t)=>!!e.transactions.find((e=>e.annotation(L))),class:"jp-remote-selections"}),T=w.ViewPlugin.fromClass(class{constructor(e){this.editorAwareness=e.state.facet(x),this._listener=({added:t,updated:n,removed:o})=>{t.concat(n).concat(o).findIndex((e=>e!==this.editorAwareness.awareness.doc.clientID))>=0&&e.dispatch({annotations:[L.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(e){var t;if(!e.docChanged&&!e.selectionSet)return;const{awareness:n,ytext:r}=this.editorAwareness,s=n.getLocalState();if(s){const a=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=e.state.selection,l=new Array;if(a&&i){for(const e of i.ranges){const t=e===i.main,n=(0,j.createRelativePositionFromTypeIndex)(r,e.anchor),o=(0,j.createRelativePositionFromTypeIndex)(r,e.head);l.push({anchor:n,head:o,primary:t,empty:e.empty})}if(!s.cursors||l.length>0){const e=null===(t=s.cursors)||void 0===t?void 0:t.map((e=>({...e,anchor:(null==e?void 0:e.anchor)?(0,j.createRelativePositionFromJSON)(e.anchor):null,head:(null==e?void 0:e.head)?(0,j.createRelativePositionFromJSON)(e.head):null})));o.JSONExt.deepEqual(l,e)||n.setLocalStateField("cursors",l)}}}}},{provide:()=>[I,E,P,R,(0,w.tooltips)({position:"absolute",parent:document.body})]});function S(e){return[x.of(e),T]}var U=n(4873);class M extends l.MenuBar.Renderer{constructor(e){super(),this._user=e}renderItem(e){const t=this.createItemClass(e),n=this.createItemDataset(e),o=this.createItemARIA(e);return U.h.li({className:t,dataset:n,tabindex:"0",onfocus:e.onfocus,...o},this._createUserIcon(),this.renderLabel(e),this.renderIcon(e))}renderLabel(e){const t=this.formatLabel(e);return U.h.div({className:"lm-MenuBar-itemLabel jp-MenuBar-label"},t)}_createUserIcon(){return this._user.isReady&&this._user.identity.avatar_url?U.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-imageIcon"},U.h.img({src:this._user.identity.avatar_url})):this._user.isReady?U.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon",style:{backgroundColor:this._user.identity.color}},U.h.span({},this._user.identity.initials)):U.h.div({className:"lm-MenuBar-itemIcon jp-MenuBar-anonymousIcon"},a.userIcon)}}class N extends l.Menu{constructor(e){super(e)}}var D=n(314),F=n(2877);async function B({translator:e}){const t=(null!=e?e:F.nullTranslator).load("collaboration"),n=D.PageConfig.getToken(),o=new URL(D.URLExt.normalize(D.PageConfig.getUrl({workspace:D.PageConfig.defaultWorkspace})));return(0,s.showDialog)({title:t.__("Share Jupyter Server Link"),body:new H(o.toString(),n,""!==D.PageConfig.getOption("hubUser"),t),buttons:[s.Dialog.cancelButton(),s.Dialog.okButton({label:t.__("Copy Link"),caption:t.__("Copy the link to the Jupyter Server")})]})}class H extends l.Widget{constructor(e,t,n,o){super(),this._url=e,this._token=t,this._behindHub=n,this._trans=o,this._tokenCheckbox=null,this.onTokenChange=e=>{const t=e.target;this.updateContent(null==t?void 0:t.checked)},this._warning=document.createElement("div"),this.populateBody(this.node),this.addClass("jp-shared-link-body")}getValue(){var e;if(!0===(null===(e=this._tokenCheckbox)||void 0===e?void 0:e.checked)){const e=new URL(this._url);return e.searchParams.set("token",this._token),e.toString()}return this._url}onAfterAttach(e){var t;super.onAfterAttach(e),null===(t=this._tokenCheckbox)||void 0===t||t.addEventListener("change",this.onTokenChange)}onBeforeDetach(e){var t;null===(t=this._tokenCheckbox)||void 0===t||t.removeEventListener("change",this.onTokenChange),super.onBeforeDetach(e)}updateContent(e){this._warning.innerHTML="";const t=this.node.querySelector("input[readonly]");if(e){if(t){const e=new URL(this._url);e.searchParams.set("token",this._token.slice(0,5)),t.value=e.toString()+"…"}this._warning.appendChild(document.createElement("h3")).textContent=this._trans.__("Security warning!"),this._warning.insertAdjacentText("beforeend",this._trans.__("Anyone with this link has full access to your notebook server, including all your files!")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("Please be careful who you share it with.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._behindHub?(this._warning.insertAdjacentText("beforeend",this._trans.__("They will be able to access this server AS YOU.")),this._warning.insertAdjacentHTML("beforeend","<br>"),this._warning.insertAdjacentText("beforeend",this._trans.__("To revoke access, go to File -> Hub Control Panel, and restart your server."))):this._warning.insertAdjacentText("beforeend",this._trans.__("Currently, there is no way to revoke access other than shutting down your server."))}else t&&(t.value=this._url),this._behindHub?this._warning.insertAdjacentText("beforeend",this._trans.__("Only users with `access:servers` permissions for this server will be able to use this link.")):this._warning.insertAdjacentText("beforeend",this._trans.__("Only authenticated users will be able to use this link."))}populateBody(e){if(e.insertAdjacentHTML("afterbegin",`<input readonly value="${this._url}">`),this._token){const t=e.appendChild(document.createElement("label"));t.insertAdjacentHTML("beforeend",'<input type="checkbox">'),this._tokenCheckbox=t.firstChild,t.insertAdjacentText("beforeend",this._trans.__("Include token in URL")),e.insertAdjacentElement("beforeend",this._warning),this.updateContent(!1)}}}const O=e=>{const{user:t}=e;return c.createElement("div",{className:"jp-UserInfo-Container"},c.createElement("div",{title:t.display_name,className:"jp-UserInfo-Icon",style:{backgroundColor:t.color}},c.createElement("span",null,t.initials)),c.createElement("h3",null,t.display_name))};class W extends l.Panel{constructor(e){super({}),this.addClass("jp-UserInfoPanel"),this._profile=e,this._body=null,this._profile.isReady?(this._body=new $(this._profile.identity),this.addWidget(this._body),this.update()):this._profile.ready.then((()=>{this._body=new $(this._profile.identity),this.addWidget(this._body),this.update()})).catch((e=>console.error(e)))}}class $ extends s.ReactWidget{constructor(e){super(),this._user=e}get user(){return this._user}set user(e){this._user=e,this.update()}render(){return c.createElement(O,{user:this._user})}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[842],{4842:(e,r,a)=>{a.r(r),a.d(r,{default:()=>I});var o=a(6501),t=a(7274),n=a(4965),s=a(8627),i=a(7963),l=a(314),c=a(9033),d=a(2809),u=a(2877),p=a(5256),m=a(6619),b=a(2206),y=a(7784);const w={id:"@jupyter/collaboration-extension:userMenu",description:"Provide connected user menu.",requires:[],provides:m.IUserMenu,activate:e=>{const{commands:r}=e,{user:a}=e.serviceManager;return new m.UserMenu({commands:r,user:a})}},v={id:"@jupyter/collaboration-extension:user-menu-bar",description:"Add user menu to the interface.",autoStart:!0,requires:[m.IUserMenu,o.IToolbarWidgetRegistry],activate:async(e,r,a)=>{const{user:o}=e.serviceManager,t=new p.MenuBar({forceItemsPosition:{forceX:!1,forceY:!1},renderer:new m.RendererUserMenu(o)});t.id="jp-UserMenu",o.userChanged.connect((()=>t.update())),t.addMenu(r),a.addFactory("TopBar","user-menu",(()=>t))}},g={id:"@jupyter/collaboration-extension:rtcGlobalAwareness",description:"Add global awareness to share working document of users.",requires:[d.IStateDB],provides:n.IGlobalAwareness,activate:(e,r)=>{const{user:a}=e.serviceManager,o=new b.Doc,t=new y.ww(o),n=c.ServerConnection.makeSettings(),i=l.URLExt.join(n.wsUrl,"api/collaboration/room");return new s.WebSocketAwarenessProvider({url:i,roomID:"JupyterLab:globalAwareness",awareness:t,user:a}),r.changed.connect((async()=>{var e,a;const o=(null===(a=null===(e=(await r.toJSON())["layout-restorer:data"])||void 0===e?void 0:e.main)||void 0===a?void 0:a.current)||"";o.match(/^\w+:RTC:/)?t.setLocalStateField("current",o):t.setLocalStateField("current",null)})),t}},h={id:"@jupyter/collaboration-extension:rtcPanel",description:"Add side panel to display all currently connected users.",autoStart:!0,requires:[n.IGlobalAwareness],optional:[u.ITranslator],activate:(e,r,a)=>{const{user:o}=e.serviceManager,t=(null!=a?a:u.nullTranslator).load("jupyter_collaboration"),n=new i.SidePanel({alignment:"justify"});n.id="jp-collaboration-panel",n.title.icon=i.usersIcon,n.title.caption=t.__("Collaboration"),n.addClass("jp-RTCPanel"),e.shell.add(n,"left",{rank:300});const s=new m.UserInfoPanel(o);s.title.label=t.__("User info"),s.title.caption=t.__("User information"),n.addWidget(s);const l=new m.CollaboratorsPanel(o,r,(r=>{e.commands.execute("docmanager:open",{path:r})}),e.docRegistry);l.title.label=t.__("Online Collaborators"),n.addWidget(l)}},_={id:"@jupyter/collaboration-extension:userEditorCursors",description:"Add CodeMirror extension to display remote user cursors and selections.",autoStart:!0,requires:[t.IEditorExtensionRegistry],activate:(e,r)=>{r.addExtension({name:"remote-user-cursors",factory(e){const{awareness:r,ysource:a}=e.model.sharedModel;return t.EditorExtensionRegistry.createImmutableExtension((0,m.remoteUserCursors)({awareness:r,ytext:a}))}})}};var x;!function(e){e.share="collaboration:shared-link"}(x||(x={}));const I=[w,v,g,h,{id:"@jupyter/collaboration-extension:shared-link",autoStart:!0,optional:[o.ICommandPalette,u.ITranslator],activate:async(e,r,a)=>{const{commands:t}=e,n=(null!=a?a:u.nullTranslator).load("collaboration");t.addCommand(x.share,{label:n.__("Generate a Shared Link"),icon:i.shareIcon,execute:async()=>{const e=await(0,m.showSharedLinkDialog)({translator:a});e.button.accept&&e.value&&o.Clipboard.copyToSystem(e.value)}}),r&&r.addItem({command:x.share,category:n.__("Server")})}},_]}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[]).push([[944],{2078:(n,e,o)=>{o.d(e,{A:()=>s});var r=o(6758),t=o.n(r),a=o(935),i=o.n(a),l=o(9256),p=o(3028),c=i()(t());c.i(l.A),c.i(p.A),c.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-shared-link-body {\n user-select: none;\n}\n",""]);const s=c},9256:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(6758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/* -----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|---------------------------------------------------------------------------- */\n\n.jp-MenuBar-label {\n margin-left: 25px;\n}\n\n.jp-MenuBar-anonymousIcon span {\n width: 24px;\n text-align: center;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-MenuBar-anonymousIcon,\n.jp-MenuBar-imageIcon {\n position: absolute;\n top: 1px;\n left: 8px;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n vertical-align: middle;\n border-radius: 100%;\n}\n\n.jp-MenuBar-imageIcon img {\n width: 24px;\n border-radius: 100%;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserMenu-caretDownIcon {\n height: 22px;\n position: relative;\n top: 15%;\n}\n",""]);const l=i},3028:(n,e,o)=>{o.d(e,{A:()=>l});var r=o(6758),t=o.n(r),a=o(935),i=o.n(a)()(t());i.push([n.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/************************************************************\n Main Panel\n*************************************************************/\n\n.jp-RTCPanel {\n min-width: var(--jp-sidebar-min-width) !important;\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n font-size: var(--jp-ui-font-size1);\n}\n\n/************************************************************\n User Info Panel\n*************************************************************/\n.jp-UserInfoPanel {\n display: flex;\n flex-direction: column;\n max-height: 140px;\n padding-top: 3px;\n}\n\n.jp-UserInfo-Container {\n margin: 20px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.jp-UserInfo-Icon {\n margin: auto;\n width: 50px;\n height: 50px;\n border-radius: 50px;\n display: inline-flex;\n align-items: center;\n}\n\n.jp-UserInfo-Icon span {\n margin: auto;\n text-align: center;\n font-size: 25px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info {\n margin: 20px;\n display: inline-flex;\n flex-direction: column;\n}\n\n.jp-UserInfo-Info label {\n font-weight: bold;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-UserInfo-Info input {\n text-decoration: none;\n border-top: none;\n border-left: none;\n border-right: none;\n border-color: var(--jp-ui-font-color1);\n border-width: 0.5px;\n background-color: transparent;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n/************************************************************\n Collaborators Info Panel\n*************************************************************/\n\n.jp-CollaboratorsPanel {\n overflow-y: auto;\n}\n\n.jp-CollaboratorsList {\n flex-direction: column;\n display: flex;\n z-index: 1000;\n}\n\n.jp-CollaboratorHeader {\n padding: 10px;\n display: flex;\n align-items: center;\n font-size: var(--jp-ui-font-size0);\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorHeader > span {\n padding-left: 7px;\n}\n\n.jp-ClickableCollaborator:hover {\n cursor: pointer;\n background-color: var(--jp-layout-color2);\n fill: var(--jp-ui-font-color0);\n color: var(--jp-ui-font-color0);\n}\n\n.jp-CollaboratorHeaderCollapser {\n transform: rotate(-90deg);\n margin: auto 0;\n height: 16px;\n}\n\n.jp-CollaboratorHeader:not(.jp-ClickableCollaborator) .jp-CollaboratorHeaderCollapser {\n visibility: hidden;\n}\n\n.jp-CollaboratorHeaderCollapser.jp-mod-expanded {\n transform: rotate(0deg);\n}\n\n.jp-CollaboratorIcon {\n border-radius: 100%;\n padding: 2px;\n width: 24px;\n height: 24px;\n display: flex;\n}\n\n.jp-CollaboratorIcon > span {\n text-align: center;\n margin: auto;\n font-size: 12px;\n fill: var(--jp-ui-font-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-CollaboratorFiles {\n padding-left: 1em;\n margin-top: 0;\n box-shadow: 0 2px 2px -2px rgb(0 0 0 / 24%);\n\n}\n",""]);const l=i},935:n=>{n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var o="",r=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),r&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=n(e),r&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o})).join("")},e.i=function(n,o,r,t,a){"string"==typeof n&&(n=[[null,n,void 0]]);var i={};if(r)for(var l=0;l<this.length;l++){var p=this[l][0];null!=p&&(i[p]=!0)}for(var c=0;c<n.length;c++){var s=[].concat(n[c]);r&&i[s[0]]||(void 0!==a&&(void 0===s[5]||(s[1]="@layer".concat(s[5].length>0?" ".concat(s[5]):""," {").concat(s[1],"}")),s[5]=a),o&&(s[2]?(s[1]="@media ".concat(s[2]," {").concat(s[1],"}"),s[2]=o):s[2]=o),t&&(s[4]?(s[1]="@supports (".concat(s[4],") {").concat(s[1],"}"),s[4]=t):s[4]="".concat(t)),e.push(s))}},e}},6758:n=>{n.exports=function(n){return n[1]}},2591:n=>{var e=[];function o(n){for(var o=-1,r=0;r<e.length;r++)if(e[r].identifier===n){o=r;break}return o}function r(n,r){for(var a={},i=[],l=0;l<n.length;l++){var p=n[l],c=r.base?p[0]+r.base:p[0],s=a[c]||0,u="".concat(c," ").concat(s);a[c]=s+1;var d=o(u),f={css:p[1],media:p[2],sourceMap:p[3],supports:p[4],layer:p[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var v=t(f,r);r.byIndex=l,e.splice(l,0,{identifier:u,updater:v,references:1})}i.push(u)}return i}function t(n,e){var o=e.domAPI(e);return o.update(n),function(e){if(e){if(e.css===n.css&&e.media===n.media&&e.sourceMap===n.sourceMap&&e.supports===n.supports&&e.layer===n.layer)return;o.update(n=e)}else o.remove()}}n.exports=function(n,t){var a=r(n=n||[],t=t||{});return function(n){n=n||[];for(var i=0;i<a.length;i++){var l=o(a[i]);e[l].references--}for(var p=r(n,t),c=0;c<a.length;c++){var s=o(a[c]);0===e[s].references&&(e[s].updater(),e.splice(s,1))}a=p}}},8128:n=>{var e={};n.exports=function(n,o){var r=function(n){if(void 0===e[n]){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(n){o=null}e[n]=o}return e[n]}(n);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(o)}},3051:n=>{n.exports=function(n){var e=document.createElement("style");return n.setAttributes(e,n.attributes),n.insert(e,n.options),e}},855:(n,e,o)=>{n.exports=function(n){var e=o.nc;e&&n.setAttribute("nonce",e)}},1740:n=>{n.exports=function(n){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.insertStyleElement(n);return{update:function(o){!function(n,e,o){var r="";o.supports&&(r+="@supports (".concat(o.supports,") {")),o.media&&(r+="@media ".concat(o.media," {"));var t=void 0!==o.layer;t&&(r+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),r+=o.css,t&&(r+="}"),o.media&&(r+="}"),o.supports&&(r+="}");var a=o.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(r,n,e.options)}(e,n,o)},remove:function(){!function(n){if(null===n.parentNode)return!1;n.parentNode.removeChild(n)}(e)}}}},3656:n=>{n.exports=function(n,e){if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},5944:(n,e,o)=>{var r=o(2591),t=o.n(r),a=o(1740),i=o.n(a),l=o(8128),p=o.n(l),c=o(855),s=o.n(c),u=o(3051),d=o.n(u),f=o(3656),v=o.n(f),m=o(2078),h={};h.styleTagTransform=v(),h.setAttributes=s(),h.insert=p().bind(null,"head"),h.domAPI=i(),h.insertStyleElement=d(),t()(m.A,h),m.A&&m.A.locals&&m.A.locals}}]);
@@ -1 +0,0 @@
1
- var _JUPYTERLAB;(()=>{"use strict";var e,r,t,o,a,n,i,l,u,d,s,f,c,p,h,v,b,m,y,g,j,w,P,S={1998:(e,r,t)=>{var o={"./index":()=>Promise.all([t.e(784),t.e(206),t.e(188),t.e(256),t.e(33),t.e(198),t.e(842)]).then((()=>()=>t(4842))),"./extension":()=>Promise.all([t.e(784),t.e(206),t.e(188),t.e(256),t.e(33),t.e(198),t.e(842)]).then((()=>()=>t(4842))),"./style":()=>t.e(944).then((()=>()=>t(5944)))},a=(e,r)=>(t.R=r,r=t.o(o,e)?o[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),n=(e,r)=>{if(t.S){var o="default",a=t.S[o];if(a&&a!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[o]=e,t.I(o,r)}};t.d(r,{get:()=>a,init:()=>n})}},k={};function x(e){var r=k[e];if(void 0!==r)return r.exports;var t=k[e]={id:e,exports:{}};return S[e](t,t.exports,x),t.exports}x.m=S,x.c=k,x.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return x.d(r,{a:r}),r},x.d=(e,r)=>{for(var t in r)x.o(r,t)&&!x.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},x.f={},x.e=e=>Promise.all(Object.keys(x.f).reduce(((r,t)=>(x.f[t](e,r),r)),[])),x.u=e=>e+"."+{44:"63f3c8213f36b6704bfa",240:"5b30415735249ad467b9",444:"8091aa81c5259b3d4778",784:"bef63745ca8c3075ff63",842:"887c6ef84a14d0e13407",944:"d2ebc009496c02bb8324",952:"8934cdeb03f9bd1e666f"}[e]+".js?v="+{44:"63f3c8213f36b6704bfa",240:"5b30415735249ad467b9",444:"8091aa81c5259b3d4778",784:"bef63745ca8c3075ff63",842:"887c6ef84a14d0e13407",944:"d2ebc009496c02bb8324",952:"8934cdeb03f9bd1e666f"}[e],x.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),x.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@jupyter/collaboration-extension:",x.l=(t,o,a,n)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var s=u[d];if(s.getAttribute("src")==t||s.getAttribute("data-webpack")==r+a){i=s;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,x.nc&&i.setAttribute("nonce",x.nc),i.setAttribute("data-webpack",r+a),i.src=t),e[t]=[o];var f=(r,o)=>{i.onerror=i.onload=null,clearTimeout(c);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((e=>e(o))),r)return r(o)},c=setTimeout(f.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=f.bind(null,i.onerror),i.onload=f.bind(null,i.onload),l&&document.head.appendChild(i)}},x.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{x.S={};var e={},r={};x.I=(t,o)=>{o||(o=[]);var a=r[t];if(a||(a=r[t]={}),!(o.indexOf(a)>=0)){if(o.push(a),e[t])return e[t];x.o(x.S,t)||(x.S[t]={});var n=x.S[t],i="@jupyter/collaboration-extension",l=(e,r,t,o)=>{var a=n[e]=n[e]||{},l=a[r];(!l||!l.loaded&&(!o!=!l.eager?o:i>l.from))&&(a[r]={get:t,from:i,eager:!!o})},u=[];return"default"===t&&(l("@jupyter/collaboration-extension","3.1.0-beta.0",(()=>Promise.all([x.e(784),x.e(206),x.e(188),x.e(256),x.e(33),x.e(198),x.e(842)]).then((()=>()=>x(4842))))),l("@jupyter/collaboration","3.1.0-beta.0",(()=>Promise.all([x.e(206),x.e(262),x.e(188),x.e(312),x.e(256),x.e(44)]).then((()=>()=>x(2044))))),l("@jupyter/collaborative-drive","3.1.0-beta.0",(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),l("@jupyter/docprovider","3.1.0-beta.0",(()=>Promise.all([x.e(262),x.e(188),x.e(312),x.e(33),x.e(240)]).then((()=>()=>x(6240))))),l("y-websocket","1.5.4",(()=>Promise.all([x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;x.g.importScripts&&(e=x.g.location+"");var r=x.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),x.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),o=t[1]?r(t[1]):[];return t[2]&&(o.length++,o.push.apply(o,r(t[2]))),t[3]&&(o.push([]),o.push.apply(o,r(t[3]))),o},o=(e,r)=>{e=t(e),r=t(r);for(var o=0;;){if(o>=e.length)return o<r.length&&"u"!=(typeof r[o])[0];var a=e[o],n=(typeof a)[0];if(o>=r.length)return"u"==n;var i=r[o],l=(typeof i)[0];if(n!=l)return"o"==n&&"n"==l||"s"==l||"u"==n;if("o"!=n&&"u"!=n&&a!=i)return a<i;o++}},a=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var o=1,n=1;n<e.length;n++)o--,t+="u"==(typeof(l=e[n]))[0]?"-":(o>0?".":"")+(o=2,l);return t}var i=[];for(n=1;n<e.length;n++){var l=e[n];i.push(0===l?"not("+u()+")":1===l?"("+u()+" || "+u()+")":2===l?i.pop()+" "+i.pop():a(l))}return u();function u(){return i.pop().replace(/^\((.+)\)$/,"$1")}},n=(e,r)=>{if(0 in e){r=t(r);var o=e[0],a=o<0;a&&(o=-o-1);for(var i=0,l=1,u=!0;;l++,i++){var d,s,f=l<e.length?(typeof e[l])[0]:"";if(i>=r.length||"o"==(s=(typeof(d=r[i]))[0]))return!u||("u"==f?l>o&&!a:""==f!=a);if("u"==s){if(!u||"u"!=f)return!1}else if(u)if(f==s)if(l<=o){if(d!=e[l])return!1}else{if(a?d>e[l]:d<e[l])return!1;d!=e[l]&&(u=!1)}else if("s"!=f&&"n"!=f){if(a||l<=o)return!1;u=!1,l--}else{if(l<=o||s<f!=a)return!1;u=!1}else"s"!=f&&"n"!=f&&(u=!1,l--)}}var c=[],p=c.pop.bind(c);for(i=1;i<e.length;i++){var h=e[i];c.push(1==h?p()|p():2==h?p()&p():h?n(h,r):!p())}return!!p()},i=(e,r)=>e&&x.o(e,r),l=e=>(e.loaded=1,e.get()),u=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),d=(e,r,t,a)=>{var i=a?u(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!n(t,r)||e&&!o(e,r)?e:r),0))&&i[r]},s=(e,r,t)=>{var a=t?u(e[r]):e[r];return Object.keys(a).reduce(((e,r)=>!e||!a[e].loaded&&o(e,r)?r:e),0)},f=(e,r,t,o)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+a(o)+")",c=(e,r,t,o,n)=>{var i=e[t];return"No satisfying version ("+a(o)+")"+(n?" for eager consumption":"")+" of shared module "+t+" found in shared scope "+r+".\nAvailable versions: "+Object.keys(i).map((e=>e+" from "+i[e].from)).join(", ")},p=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},b=(e,r,t)=>t?t():((e,r)=>p("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),m=(v=e=>function(r,t,o,a,n){var i=x.I(r);return i&&i.then&&!o?i.then(e.bind(e,r,x.S[r],t,!1,a,n)):e(r,x.S[r],t,o,a,n)})(((e,r,t,o,a,n)=>{if(!i(r,t))return b(e,t,n);var u=d(r,t,a,o);return u?l(u):n?n():void p(c(r,e,t,a,o))})),y=v(((e,r,t,o,a,u)=>{if(!i(r,t))return b(e,t,u);var d=s(r,t,o);return n(a,d)||h(f(r,t,d,a)),l(r[t][d])})),g={},j={2206:()=>y("default","yjs",!1,[1,13,5,40]),314:()=>y("default","@jupyterlab/coreutils",!1,[1,6,3,1]),2877:()=>y("default","@jupyterlab/translation",!1,[1,4,3,1]),6501:()=>y("default","@jupyterlab/apputils",!1,[1,4,4,1]),7963:()=>y("default","@jupyterlab/ui-components",!1,[1,4,3,1]),5256:()=>y("default","@lumino/widgets",!1,[1,2,3,1,,"alpha",0]),9033:()=>y("default","@jupyterlab/services",!1,[1,7,3,1]),2809:()=>y("default","@jupyterlab/statedb",!1,[1,4,3,1]),4965:()=>y("default","@jupyter/collaborative-drive",!1,[1,3,1,0,,"beta",0],(()=>Promise.all([x.e(262),x.e(444)]).then((()=>()=>x(444))))),6619:()=>y("default","@jupyter/collaboration",!1,[1,3,1,0,,"beta",0],(()=>Promise.all([x.e(262),x.e(312),x.e(44)]).then((()=>()=>x(2044))))),7274:()=>y("default","@jupyterlab/codemirror",!1,[1,4,3,1]),8627:()=>y("default","@jupyter/docprovider",!1,[1,3,1,0,,"beta",0],(()=>Promise.all([x.e(262),x.e(312),x.e(240)]).then((()=>()=>x(6240))))),7262:()=>y("default","@lumino/coreutils",!1,[1,2,0,0]),3345:()=>y("default","react",!1,[1,18,2,0]),4602:()=>y("default","@lumino/signaling",!1,[1,2,0,0]),195:()=>y("default","@codemirror/state",!1,[1,6,2,0]),4873:()=>y("default","@lumino/virtualdom",!1,[1,2,0,0]),5024:()=>y("default","@codemirror/view",!1,[1,6,9,6]),3560:()=>m("default","y-websocket",!1,[1,1,3,15],(()=>Promise.all([x.e(784),x.e(952),x.e(206)]).then((()=>()=>x(2952)))))},w={33:[9033],44:[195,4873,5024],188:[314,2877,6501,7963],198:[2809,4965,6619,7274,8627],206:[2206],240:[3560],256:[5256],262:[7262],312:[3345,4602]},P={},x.f.consumes=(e,r)=>{x.o(w,e)&&w[e].forEach((e=>{if(x.o(g,e))return r.push(g[e]);if(!P[e]){var t=r=>{g[e]=0,x.m[e]=t=>{delete x.c[e],t.exports=r()}};P[e]=!0;var o=r=>{delete g[e],x.m[e]=t=>{throw delete x.c[e],r}};try{var a=j[e]();a.then?r.push(g[e]=a.then(t).catch(o)):t(a)}catch(e){o(e)}}}))},(()=>{var e={270:0};x.f.j=(r,t)=>{var o=x.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(/^(2(06|56|62)|188|198|312|33)$/.test(r))e[r]=0;else{var a=new Promise(((t,a)=>o=e[r]=[t,a]));t.push(o[2]=a);var n=x.p+x.u(r),i=new Error;x.l(n,(t=>{if(x.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,o[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,a,[n,i,l]=t,u=0;if(n.some((r=>0!==e[r]))){for(o in i)x.o(i,o)&&(x.m[o]=i[o]);l&&l(x)}for(r&&r(t);u<n.length;u++)a=n[u],x.o(e,a)&&e[a]&&e[a][0](),e[a]=0},t=self.webpackChunk_jupyter_collaboration_extension=self.webpackChunk_jupyter_collaboration_extension||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),x.nc=void 0;var E=x(1998);(_JUPYTERLAB=void 0===_JUPYTERLAB?{}:_JUPYTERLAB)["@jupyter/collaboration-extension"]=E})();