notebook 7.3.0a0__py3-none-any.whl → 7.3.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of notebook might be problematic. Click here for more details.

Files changed (183) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/113.bundle.js +1 -1
  3. notebook/static/1198.bundle.js +1 -1
  4. notebook/static/1226.bundle.js +1 -1
  5. notebook/static/131.bundle.js +1 -1
  6. notebook/static/134.bundle.js +1 -1
  7. notebook/static/1408.bundle.js +1 -1
  8. notebook/static/1496.bundle.js +1 -1
  9. notebook/static/1584.bundle.js +1 -1
  10. notebook/static/1647.bundle.js +1 -1
  11. notebook/static/1650.bundle.js +1 -1
  12. notebook/static/1684.bundle.js +1 -1
  13. notebook/static/1809.bundle.js +1 -1
  14. notebook/static/1827.bundle.js +1 -1
  15. notebook/static/1833.bundle.js +1 -1
  16. notebook/static/1958.bundle.js +1 -1
  17. notebook/static/1962.bundle.js +1 -1
  18. notebook/static/2007.bundle.js +1 -1
  19. notebook/static/2065.bundle.js +1 -1
  20. notebook/static/2088.bundle.js +1 -1
  21. notebook/static/2089.bundle.js +1 -1
  22. notebook/static/2122.bundle.js +1 -1
  23. notebook/static/2167.bundle.js +1 -1
  24. notebook/static/2184.bundle.js +1 -1
  25. notebook/static/2311.bundle.js +1 -1
  26. notebook/static/2401.bundle.js +1 -1
  27. notebook/static/2479.bundle.js +1 -1
  28. notebook/static/2489.bundle.js +1 -1
  29. notebook/static/2607.bundle.js +1 -1
  30. notebook/static/2615.bundle.js +1 -1
  31. notebook/static/2636.bundle.js +1 -1
  32. notebook/static/2924.bundle.js +1 -1
  33. notebook/static/2944.bundle.js +1 -1
  34. notebook/static/{2323.bundle.js → 3030.bundle.js} +1 -1
  35. notebook/static/3129.bundle.js +1 -1
  36. notebook/static/3146.bundle.js +1 -1
  37. notebook/static/3187.bundle.js +1 -1
  38. notebook/static/3213.bundle.js +1 -1
  39. notebook/static/3340.bundle.js +1 -1
  40. notebook/static/3360.bundle.js +1 -1
  41. notebook/static/3466.bundle.js +1 -1
  42. notebook/static/3512.bundle.js +1 -1
  43. notebook/static/3676.bundle.js +1 -1
  44. notebook/static/3680.bundle.js +1 -1
  45. notebook/static/374.bundle.js +1 -1
  46. notebook/static/3768.bundle.js +1 -1
  47. notebook/static/377.bundle.js +1 -1
  48. notebook/static/3863.bundle.js +1 -1
  49. notebook/static/3881.bundle.js +1 -1
  50. notebook/static/4042.bundle.js +1 -1
  51. notebook/static/4058.bundle.js +1 -1
  52. notebook/static/4212.bundle.js +1 -1
  53. notebook/static/4382.bundle.js +1 -1
  54. notebook/static/4526.bundle.js +1 -1
  55. notebook/static/4588.bundle.js +1 -1
  56. notebook/static/4645.bundle.js +1 -1
  57. notebook/static/4811.bundle.js +1 -1
  58. notebook/static/4837.bundle.js +1 -1
  59. notebook/static/5099.bundle.js +1 -1
  60. notebook/static/5135.bundle.js +1 -1
  61. notebook/static/5254.bundle.js +1 -1
  62. notebook/static/5261.bundle.js +1 -1
  63. notebook/static/5313.bundle.js +1 -1
  64. notebook/static/5325.bundle.js +1 -1
  65. notebook/static/5346.bundle.js +1 -1
  66. notebook/static/5426.bundle.js +1 -1
  67. notebook/static/545.bundle.js +1 -1
  68. notebook/static/5573.bundle.js +1 -1
  69. notebook/static/5601.bundle.js +1 -1
  70. notebook/static/5733.bundle.js +1 -1
  71. notebook/static/5828.bundle.js +1 -1
  72. notebook/static/5850.bundle.js +1 -1
  73. notebook/static/5912.bundle.js +1 -1
  74. notebook/static/5921.bundle.js +1 -1
  75. notebook/static/6017.bundle.js +1 -1
  76. notebook/static/6139.bundle.js +1 -1
  77. notebook/static/62.bundle.js +1 -1
  78. notebook/static/6271.bundle.js +1 -1
  79. notebook/static/6318.bundle.js +1 -1
  80. notebook/static/6345.bundle.js +1 -1
  81. notebook/static/6604.bundle.js +1 -1
  82. notebook/static/6621.bundle.js +1 -1
  83. notebook/static/6627.bundle.js +1 -1
  84. notebook/static/6748.bundle.js +1 -1
  85. notebook/static/677.bundle.js +1 -1
  86. notebook/static/6815.bundle.js +1 -1
  87. notebook/static/6853.bundle.js +1 -1
  88. notebook/static/6893.bundle.js +1 -1
  89. notebook/static/6898.bundle.js +1 -1
  90. notebook/static/690.bundle.js +1 -1
  91. notebook/static/6962.bundle.js +1 -1
  92. notebook/static/6999.bundle.js +1 -1
  93. notebook/static/7226.bundle.js +1 -1
  94. notebook/static/7252.bundle.js +1 -1
  95. notebook/static/7302.bundle.js +1 -1
  96. notebook/static/7369.bundle.js +1 -1
  97. notebook/static/7386.bundle.js +1 -1
  98. notebook/static/7391.bundle.js +1 -1
  99. notebook/static/7450.bundle.js +1 -1
  100. notebook/static/7506.bundle.js +2 -2
  101. notebook/static/7543.bundle.js +1 -1
  102. notebook/static/755.bundle.js +1 -1
  103. notebook/static/7603.bundle.js +1 -1
  104. notebook/static/7639.bundle.js +1 -1
  105. notebook/static/7655.bundle.js +1 -1
  106. notebook/static/{4427.bundle.js → 7674.bundle.js} +1 -1
  107. notebook/static/7684.bundle.js +1 -1
  108. notebook/static/7812.bundle.js +1 -1
  109. notebook/static/7819.bundle.js +1 -1
  110. notebook/static/7854.bundle.js +1 -1
  111. notebook/static/7900.bundle.js +1 -1
  112. notebook/static/7906.bundle.js +1 -1
  113. notebook/static/7995.bundle.js +1 -1
  114. notebook/static/8054.bundle.js +1 -1
  115. notebook/static/8285.bundle.js +1 -1
  116. notebook/static/8471.bundle.js +1 -1
  117. notebook/static/8579.bundle.js +1 -1
  118. notebook/static/8633.bundle.js +1 -1
  119. notebook/static/8771.bundle.js +1 -1
  120. notebook/static/8781.bundle.js +1 -1
  121. notebook/static/8875.bundle.js +1 -1
  122. notebook/static/8907.bundle.js +1 -1
  123. notebook/static/8928.bundle.js +1 -1
  124. notebook/static/893.bundle.js +1 -1
  125. notebook/static/901.bundle.js +1 -1
  126. notebook/static/9068.bundle.js +1 -1
  127. notebook/static/9136.bundle.js +1 -1
  128. notebook/static/9151.bundle.js +1 -1
  129. notebook/static/9161.bundle.js +1 -1
  130. notebook/static/9268.bundle.js +1 -1
  131. notebook/static/9335.bundle.js +1 -1
  132. notebook/static/9341.bundle.js +1 -1
  133. notebook/static/9380.bundle.js +1 -1
  134. notebook/static/9605.bundle.js +1 -1
  135. notebook/static/9638.bundle.js +1 -1
  136. notebook/static/9680.bundle.js +1 -1
  137. notebook/static/9685.bundle.js +1 -1
  138. notebook/static/9752.bundle.js +1 -1
  139. notebook/static/9821.bundle.js +1 -1
  140. notebook/static/9852.bundle.js +1 -1
  141. notebook/static/bundle.js +1 -1
  142. notebook/static/third-party-licenses.json +104 -104
  143. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  144. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  145. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  146. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  147. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  148. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  149. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  150. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.45e1d3167710e94c3d26.js +1 -0
  151. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/646.57a345a80ce9f0e64830.js → notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/600.25341cef1598f2727482.js +1 -1
  152. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.b94c92715d631efb4a8f.js +1 -0
  153. notebook-7.3.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.8ca922abea871b34db72.js +1 -0
  154. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  155. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/METADATA +2 -2
  156. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/RECORD +179 -180
  157. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/WHEEL +1 -1
  158. notebook/static/9092.bundle.js +0 -1
  159. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.6d49b092e49dc147dc54.js +0 -1
  160. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.7bcc163b9139ecb2b25b.js +0 -1
  161. notebook-7.3.0a0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.9381fdb35e72f41d8af1.js +0 -1
  162. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  163. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  164. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  165. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  166. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  167. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  168. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  169. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  170. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  171. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  172. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  173. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  174. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  175. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  176. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  177. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  178. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  179. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  180. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  181. {notebook-7.3.0a0.data → notebook-7.3.0a1.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  182. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/entry_points.txt +0 -0
  183. {notebook-7.3.0a0.dist-info → notebook-7.3.0a1.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5099],{25099:(e,t,a)=>{a.r(t),a.d(t,{default:()=>re,toggleHeader:()=>ae});var n=a(94535),o=a(72703),s=a(65848),i=a(89150),r=a(36199),l=a(70858),c=a(95291),d=a(20998),u=a(2549),m=a(97934),p=a(1101);const h="help:open",g="https://jupyterlab.readthedocs.io/en/latest/privacy_policies.html";async function b(e,t={}){const a=p.ServerConnection.makeSettings(),n=s.URLExt.join(a.baseUrl,e);let o;try{o=await p.ServerConnection.makeRequest(n,t,a)}catch(e){throw new p.ServerConnection.NetworkError(e)}const i=await o.json();if(!o.ok)throw new p.ServerConnection.ResponseError(o,i.message);return i}const f={id:"@jupyterlab/apputils-extension:announcements",description:"Add the announcement feature. It will fetch news on the internet and check for application updates.",autoStart:!0,optional:[i.ISettingRegistry,l.ITranslator],activate:(e,t,a)=>{var n;const s=f.id.replace(/[^\w]/g,"");Promise.all([e.restored,null!==(n=null==t?void 0:t.load("@jupyterlab/apputils-extension:notification"))&&void 0!==n?n:Promise.resolve(null),p.ConfigSection.create({name:s})]).then((async([t,n,s])=>{const i=(null!=a?a:l.nullTranslator).load("jupyterlab");if(o.Notification.manager.changed.connect(((e,t)=>{var a;if("removed"!==t.type)return;const{id:n,tags:o}=null!==(a=t.notification.options.data)&&void 0!==a?a:{};if((null!=o?o:[]).some((e=>["news","update"].includes(e)))&&n){const e={};e[n]={seen:!0,dismissed:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}})),"none"===(null==n?void 0:n.get("fetchNews").composite)){const t=o.Notification.emit(i.__("Would you like to get notified about official Jupyter news?"),"default",{autoClose:!1,actions:[{label:i.__("Open privacy policy"),caption:g,callback:t=>{t.preventDefault(),e.commands.hasCommand(h)?e.commands.execute(h,{text:i.__("Privacy policies"),url:g}):window.open(g,"_blank","noreferrer")},displayType:"link"},{label:i.__("Yes"),callback:()=>{o.Notification.dismiss(t),s.update({}).then((()=>r())).catch((e=>{console.error(`Failed to get the news:\n${e}`)})),null==n||n.set("fetchNews","true").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}},{label:i.__("No"),callback:()=>{o.Notification.dismiss(t),null==n||n.set("fetchNews","false").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}}]})}else await r();async function r(){var e,t,a,r;if("true"===(null!==(e=null==n?void 0:n.get("fetchNews").composite)&&void 0!==e?e:"false"))try{const e=await b("/lab/api/news");for(const{link:a,message:n,type:r,options:l}of e.news){const e=l.data.id,c=null!==(t=s.data[e])&&void 0!==t?t:{seen:!1,dismissed:!1};if(!c.dismissed){if(l.actions=[{label:i.__("Hide"),caption:i.__("Never show this notification again."),callback:()=>{const t={};t[e]={seen:!0,dismissed:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}}],2===(null==a?void 0:a.length)&&l.actions.push({label:a[0],caption:a[1],callback:()=>{window.open(a[1],"_blank","noreferrer")},displayType:"link"}),!c.seen){l.autoClose=5e3;const t={};t[e]={seen:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}o.Notification.emit(n,r,l)}}}catch(e){console.log("Failed to get the announcements.",e)}if(null===(a=null==n?void 0:n.get("checkForUpdates").composite)||void 0===a||a){const e=await b("/lab/api/update");if(e.notification){const{link:t,message:a,type:l,options:c}=e.notification,d=c.data.id,u=null!==(r=s.data[d])&&void 0!==r?r:{seen:!1,dismissed:!1};if(!u.dismissed){let e;if(c.actions=[{label:i.__("Do not check for updates"),caption:i.__("If pressed, you will not be prompted if a new JupyterLab version is found."),callback:()=>{null==n||n.set("checkForUpdates",!1).then((()=>{o.Notification.dismiss(e)})).catch((e=>{console.error("Failed to set the `checkForUpdates` setting.",e)}))}}],2===(null==t?void 0:t.length)&&c.actions.push({label:t[0],caption:t[1],callback:()=>{window.open(t[1],"_blank","noreferrer")},displayType:"link"}),!u.seen){c.autoClose=5e3;const e={};e[d]={seen:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}e=o.Notification.emit(a,l,c)}}}}}))}};var y,v=a(58515),_=a(63485),w=a(78156),k=a(37634);function C(e){const{manager:t,onClose:a,trans:n}=e,[o,s]=w.useState([]),[i,r]=w.useState(null);return w.useEffect((()=>{async function e(){s(await Promise.all(t.notifications.map((async e=>Object.freeze({...e})))))}return o.length!==t.count&&e(),t.changed.connect(e),()=>{t.changed.disconnect(e)}}),[t]),w.useEffect((()=>{E.getIcons().then((e=>{r(e)})).catch((e=>{console.error(`Failed to get react-toastify icons:\n${e}`)}))}),[]),w.createElement(c.UseSignal,{signal:t.changed},(()=>w.createElement(w.Fragment,null,w.createElement("h2",{className:"jp-Notification-Header jp-Toolbar"},w.createElement("span",{className:"jp-Toolbar-item"},t.count>0?n._n("%1 notification","%1 notifications",t.count):n.__("No notifications")),w.createElement("span",{className:"jp-Toolbar-item jp-Toolbar-spacer"}),w.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:()=>{t.dismiss()},icon:c.deleteIcon,tooltip:n.__("Dismiss all notifications"),enabled:t.count>0}),w.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:a,icon:c.closeIcon,tooltip:n.__("Hide notifications")})),w.createElement("ol",{className:"jp-Notification-List"},o.map((e=>{var a;const{id:o,message:s,type:r,options:l}=e,d="in-progress"===r?"default":r,u=()=>{t.dismiss(o)},m="default"===r?null:"in-progress"===r?null!==(a=null==i?void 0:i.spinner)&&void 0!==a?a:null:i&&i[r];return w.createElement("li",{className:"jp-Notification-List-Item",key:e.id,onClick:e=>{e.stopPropagation()}},w.createElement("div",{className:`Toastify__toast Toastify__toast-theme--light Toastify__toast--${d} jp-Notification-Toast-${d}`},w.createElement("div",{className:"Toastify__toast-body"},m&&w.createElement("div",{className:"Toastify__toast-icon"},m({theme:"light",type:d})),w.createElement("div",null,E.createContent(s,u,l.actions))),w.createElement(E.CloseButton,{close:u,closeIcon:c.deleteIcon.react,title:n.__("Dismiss notification"),closeIconMargin:!0})))}))))))}!function(e){e.dismiss="apputils:dismiss-notification",e.display="apputils:display-notifications",e.notify="apputils:notify",e.update="apputils:update-notification"}(y||(y={}));class S extends c.VDomModel{constructor(e){super(),this.manager=e,this._highlight=!1,this._listOpened=!1,this._doNotDisturbMode=!1,this._count=e.count,this.manager.changed.connect(this.onNotificationChanged,this)}get count(){return this._count}get doNotDisturbMode(){return this._doNotDisturbMode}set doNotDisturbMode(e){this._doNotDisturbMode=e}get highlight(){return this._highlight}get listOpened(){return this._listOpened}set listOpened(e){this._listOpened=e,(this._listOpened||this._highlight)&&(this._highlight=!1),this.stateChanged.emit()}onNotificationChanged(e,t){this._count=this.manager.count;const{autoClose:a}=t.notification.options,n=this.doNotDisturbMode||"number"==typeof a&&a<=0;!this._listOpened&&"removed"!==t.type&&n&&(this._highlight=!0),this.stateChanged.emit()}}function T(e){return w.createElement(v.GroupItem,{spacing:4,onClick:()=>{e.onClick()},title:e.count>0?e.trans._n("%1 notification","%1 notifications",e.count):e.trans.__("No notifications")},w.createElement(v.TextItem,{className:"jp-Notification-Status-Text",source:`${e.count}`}),w.createElement(c.bellIcon.react,{top:"2px",stylesheet:"statusBar"}))}const j={id:"@jupyterlab/apputils-extension:notification",description:"Add the notification center and its status indicator.",autoStart:!0,optional:[v.IStatusBar,i.ISettingRegistry,l.ITranslator],activate:(e,t,a,n)=>{E.translator=null!=n?n:l.nullTranslator;const s=E.translator.load("jupyterlab"),i=new S(o.Notification.manager);i.doNotDisturbMode=!1,a&&Promise.all([a.load(j.id),e.restored]).then((([e])=>{const t=()=>{i.doNotDisturbMode=e.get("doNotDisturbMode").composite};t(),e.changed.connect(t)})),e.commands.addCommand(y.notify,{label:s.__("Emit a notification"),caption:s.__("Notification is described by {message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{var a;const{message:n,type:s}=t,i=null!==(a=t.options)&&void 0!==a?a:{};return o.Notification.manager.notify(n,null!=s?s:"default",{...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.update,{label:s.__("Update a notification"),caption:s.__("Notification is described by {id: string, message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{const{id:a,message:n,type:s,...i}=t;return o.Notification.manager.update({id:a,message:n,type:null!=s?s:"default",...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.dismiss,{label:s.__("Dismiss a notification"),execute:e=>{const{id:t}=e;o.Notification.manager.dismiss(t)}});let r=null;i.listOpened=!1;const d=o.ReactWidget.create(w.createElement(C,{manager:o.Notification.manager,onClose:()=>{null==r||r.dispose()},trans:s}));d.addClass("jp-Notification-Center"),o.Notification.manager.changed.connect((async function(e,t){var a;if(i.doNotDisturbMode||null!==r&&!r.isDisposed)return;const{message:n,type:o,options:s,id:l}=t.notification;if(!("number"==typeof s.autoClose&&s.autoClose<=0))switch(t.type){case"added":await E.createToast(l,n,o,s);break;case"updated":{const t=await E.toast(),i=s.actions,r=null!==(a=s.autoClose)&&void 0!==a?a:!(i&&i.length>0)&&null;if(t.isActive(l)){const a=()=>{t.dismiss(l),e.dismiss(l)};t.update(l,{type:"in-progress"===o?null:o,isLoading:"in-progress"===o,autoClose:r,render:E.createContent(n,a,s.actions)})}else await E.createToast(l,n,o,s)}break;case"removed":await E.toast().then((e=>{e.dismiss(l)}))}}));const u=()=>{r?(r.dispose(),r=null):(r=(0,v.showPopup)({body:d,anchor:m,align:"right",hasDynamicSize:!0,startHidden:!0}),E.toast().then((e=>{e.dismiss()})).catch((e=>{console.error(`Failed to dismiss all toasts:\n${e}`)})).finally((()=>{null==r||r.launch(),d.node.focus(),null==r||r.disposed.connect((()=>{i.listOpened=!1,r=null}))}))),i.listOpened=null!==r};e.commands.addCommand(y.display,{label:s.__("Show Notifications"),execute:u});const m=o.ReactWidget.create(w.createElement(c.UseSignal,{signal:i.stateChanged},(()=>(i.highlight||r&&!r.isDisposed?m.addClass("jp-mod-selected"):m.removeClass("jp-mod-selected"),w.createElement(T,{count:i.count,highlight:i.highlight,trans:s,onClick:u})))));m.addClass("jp-Notification-Status"),t?t.registerStatusItem(j.id,{item:m,align:"right",rank:-1}):(m.node.style.position="fixed",m.node.style.bottom="0",m.node.style.right="10px",_.Widget.attach(m,document.body),m.show())}};var E;!function(e){e.translator=l.nullTranslator;let t=null;function n(e){var t;return w.createElement("button",{className:"jp-Button jp-mod-minimal jp-Notification-Toast-Close"+(e.closeIconMargin?" jp-Notification-Toast-Close-Margin":""),title:null!==(t=e.title)&&void 0!==t?t:"",onClick:e.close},w.createElement(e.closeIcon,{className:"jp-icon-hover",tag:"span"}))}function s(t){const a=e.translator.load("jupyterlab");return w.createElement(n,{close:t.closeToast,closeIcon:c.closeIcon.react,title:a.__("Hide notification")})}e.CloseButton=n;let i=null;async function r(){if(null===i?i=new d.PromiseDelegate:await i.promise,null===t){t=await a.e(53).then(a.t.bind(a,60053,23));const e=document.body.appendChild(document.createElement("div"));e.id="react-toastify-container",(0,k.s)(e).render(w.createElement(t.ToastContainer,{draggable:!1,closeOnClick:!1,hideProgressBar:!0,newestOnTop:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,position:"bottom-right",className:"jp-toastContainer",transition:t.Slide,closeButton:s})),i.resolve()}return t.toast}e.toast=r,e.getIcons=async function(){return null===t&&await r(),t.Icons};const u={accent:"jp-mod-accept",link:"jp-mod-link",warn:"jp-mod-warn",default:""};function m({action:e,closeToast:t}){var a,n;const o=["jp-toast-button",u[null!==(a=e.displayType)&&void 0!==a?a:"default"]].join(" ");return w.createElement(c.Button,{title:null!==(n=e.caption)&&void 0!==n?n:e.label,className:o,onClick:a=>{e.callback(a),a.defaultPrevented||t()},small:!0},e.label)}function p(e,t,a){var n;const o=e.length>140?e.slice(0,140)+"…":e;return w.createElement(w.Fragment,null,w.createElement("div",{className:"jp-toast-message"},o.split("\n").map(((e,t)=>w.createElement(w.Fragment,{key:`part-${t}`},t>0?w.createElement("br",null):null,e)))),(null!==(n=null==a?void 0:a.length)&&void 0!==n?n:0)>0&&w.createElement("div",{className:"jp-toast-buttonBar"},w.createElement("div",{className:"jp-toast-spacer"}),a.map(((e,a)=>w.createElement(m,{key:"button-"+a,action:e,closeToast:t})))))}e.createContent=p,e.createToast=async function(e,t,a,n={}){const{actions:s,autoClose:i,data:l}=n;return(await r())((({closeToast:a})=>p(t,(()=>{a&&a(),o.Notification.manager.dismiss(e)}),s)),{autoClose:null!=i?i:!(s&&s.length>0)&&void 0,data:l,className:`jp-Notification-Toast-${a}`,toastId:e,type:"in-progress"===a?null:a,isLoading:"in-progress"===a})}}(E||(E={}));var I,x,N=a(33625),P=a(16934);!function(e){e.activate="apputils:activate-command-palette"}(I||(I={}));class D{constructor(e,t){this.translator=t||l.nullTranslator;const a=this.translator.load("jupyterlab");this._palette=e,this._palette.title.label="",this._palette.title.caption=a.__("Command Palette")}set placeholder(e){this._palette.inputNode.placeholder=e}get placeholder(){return this._palette.inputNode.placeholder}activate(){this._palette.activate()}addItem(e){const t=this._palette.addItem(e);return new u.DisposableDelegate((()=>{this._palette.removeItem(t)}))}}!function(e){e.activate=function(t,a,n){const{commands:s,shell:i}=t,r=a.load("jupyterlab"),l=x.createPalette(t,a),c=new o.ModalCommandPalette({commandPalette:l});let d=!1;if(l.node.setAttribute("role","region"),l.node.setAttribute("aria-label",r.__("Command Palette Section")),i.add(l,"left",{rank:300,type:"Command Palette"}),n){const e=n.load("@jupyterlab/apputils-extension:palette"),a=e=>{const t=e.get("modal").composite;d&&!t?(l.parent=null,c.detach(),i.add(l,"left",{rank:300,type:"Command Palette"})):!d&&t&&(l.parent=null,c.palette=l,l.show(),c.attach()),d=t};Promise.all([e,t.restored]).then((([e])=>{a(e),e.changed.connect((e=>{a(e)}))})).catch((e=>{console.error(e.message)}))}const u=()=>{const e=(0,N.find)(t.commands.keyBindings,(e=>e.command===I.activate));if(e){const t=e.keys.map(P.CommandRegistry.formatKeystroke).join(", ");l.title.caption=r.__("Commands (%1)",t)}else l.title.caption=r.__("Commands")};return u(),t.commands.keyBindingChanged.connect((()=>{u()})),s.addCommand(I.activate,{execute:()=>{d?c.activate():i.activateById(l.id)},label:r.__("Activate Command Palette")}),l.inputNode.placeholder=r.__("SEARCH"),new e(l,a)},e.restore=function(e,t,a){const n=x.createPalette(e,a);t.add(n,"command-palette")}}(D||(D={})),function(e){let t;e.createPalette=function(e,a){if(!t){t=new _.CommandPalette({commands:e.commands,renderer:c.CommandPaletteSvg.defaultRenderer}),t.id="command-palette",t.title.icon=c.paletteIcon;const n=a.load("jupyterlab");t.title.label=n.__("Commands")}return t}}(x||(x={}));class F extends r.DataConnector{constructor(e){super(),this._throttlers=Object.create(null),this._connector=e}fetch(e){const t=this._throttlers;return e in t||(t[e]=new m.Throttler((()=>this._connector.fetch(e)),100)),t[e].invoke()}async list(e="all"){const{isDisabled:t}=s.PageConfig.Extension,{ids:a,values:n}=await this._connector.list("ids"===e?"ids":void 0);return"all"===e?{ids:a,values:n}:"ids"===e?{ids:a}:{ids:a.filter((e=>!t(e))),values:n.filter((({id:e})=>!t(e)))}}async save(e,t){await this._connector.save(e,t)}}const R={id:"@jupyterlab/apputils-extension:settings",description:"Provides the setting registry.",activate:async e=>{const{isDisabled:t}=s.PageConfig.Extension,a=new F(e.serviceManager.settings),n=new i.SettingRegistry({connector:a,plugins:(await a.list("active")).values.filter((t=>e.hasPlugin(t.id)))});return e.restored.then((async()=>{(await a.list("ids")).ids.forEach((async a=>{if(e.hasPlugin(a)&&!t(a)&&!(a in n.plugins))try{await n.load(a)}catch(t){console.warn(`Settings failed to load for (${a})`,t),e.isPluginActivated(a)||console.warn(`If 'jupyter.lab.transform=true' in the plugin schema, this may happen if {autoStart: false} in (${a}) or if it is one of the deferredExtensions in page config.`)}}))})),n},autoStart:!0,provides:i.ISettingRegistry},A={id:"@jupyterlab/apputils-extension:kernel-status",description:"Provides the kernel status indicator model.",autoStart:!0,requires:[v.IStatusBar],provides:o.IKernelStatusModel,optional:[o.ISessionContextDialogs,l.ITranslator,n.ILabShell],activate:(e,t,a,n,s)=>{const i=null!=n?n:l.nullTranslator,r=null!=a?a:new o.SessionContextDialogs({translator:i}),c=async()=>{d.model.sessionContext&&await r.selectKernel(d.model.sessionContext)},d=new o.KernelStatus({onClick:c,onKeyDown:async e=>{if("Enter"===e.key||"Spacebar"===e.key||" "===e.key)return e.preventDefault(),e.stopPropagation(),c()}},i),u=new Set;function m(e,t){var a;const{oldValue:n,newValue:o}=t;n&&n.title.changed.disconnect(p),d.model.sessionContext=null!==(a=[...u].map((e=>e(t.newValue))).filter((e=>null!==e))[0])&&void 0!==a?a:null,o&&d.model.sessionContext&&(p(o.title),o.title.changed.connect(p))}const p=e=>{d.model.activityName=e.label};return s&&s.currentChanged.connect(m),t.registerStatusItem(A.id,{priority:1,item:d,align:"left",rank:1,isActive:()=>null!==d.model.sessionContext}),{addSessionProvider:t=>{u.add(t),e.shell.currentWidget&&m(e.shell,{newValue:e.shell.currentWidget,oldValue:null})}}}},M={id:"@jupyterlab/apputils-extension:running-sessions-status",description:"Add the running sessions and terminals status bar item.",autoStart:!0,requires:[v.IStatusBar,l.ITranslator],activate:(e,t,a)=>{const n=new o.RunningSessions({onClick:()=>e.shell.activateById("jp-running-sessions"),onKeyDown:t=>{"Enter"!==t.key&&"Spacebar"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),e.shell.activateById("jp-running-sessions"))},serviceManager:e.serviceManager,translator:a});n.model.sessions=Array.from(e.serviceManager.sessions.running()).length,n.model.terminals=Array.from(e.serviceManager.terminals.running()).length,t.registerStatusItem(M.id,{item:n,align:"left",rank:0})}};var O,L=a(99246);!function(e){e.changeTheme="apputils:change-theme",e.changePreferredLightTheme="apputils:change-light-theme",e.changePreferredDarkTheme="apputils:change-dark-theme",e.toggleAdaptiveTheme="apputils:adaptive-theme",e.themeScrollbars="apputils:theme-scrollbars",e.changeFont="apputils:change-font",e.incrFontSize="apputils:incr-font-size",e.decrFontSize="apputils:decr-font-size"}(O||(O={}));const z={id:"@jupyterlab/apputils-extension:themes",description:"Provides the theme manager.",requires:[i.ISettingRegistry,n.JupyterFrontEnd.IPaths,l.ITranslator],optional:[o.ISplashScreen],activate:(e,t,a,n,i)=>{const r=n.load("jupyterlab"),l=e.shell,c=e.commands,d=s.URLExt.join(s.PageConfig.getBaseUrl(),a.urls.themes),u=z.id,m=new o.ThemeManager({key:u,host:l,settings:t,splash:null!=i?i:void 0,url:d});let p,h=null;return m.themeChanged.connect(((e,t)=>{p=t.newValue,document.body.dataset.jpThemeLight=String(m.isLight(p)),document.body.dataset.jpThemeName=p,document.body.style.colorScheme=m.isLight(p)?"light":"dark",document.body.dataset.jpThemeScrollbars!==String(m.themeScrollbars(p))&&(document.body.dataset.jpThemeScrollbars=String(m.themeScrollbars(p)),m.themeScrollbars(p)?(h||(h=function(e){const t=document.createElement("style");return t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n * Webkit scrollbar styling.\n * Separate file which is dynamically loaded based on user/theme settings.\n */\n\n/* use standard opaque scrollbars for most nodes */\n\n::-webkit-scrollbar,\n::-webkit-scrollbar-corner {\n background: var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-thumb {\n background: rgb(var(--jp-scrollbar-thumb-color));\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-right: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-bottom: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar */\n\n.CodeMirror-hscrollbar::-webkit-scrollbar,\n.CodeMirror-vscrollbar::-webkit-scrollbar,\n.CodeMirror-hscrollbar::-webkit-scrollbar-corner,\n.CodeMirror-vscrollbar::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-thumb,\n.CodeMirror-vscrollbar::-webkit-scrollbar-thumb {\n background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid transparent;\n border-right: var(--jp-scrollbar-endpad) solid transparent;\n}\n\n.CodeMirror-vscrollbar::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid transparent;\n border-bottom: var(--jp-scrollbar-endpad) solid transparent;\n}\n")),t}()),h.parentElement||document.body.appendChild(h)):h&&h.parentElement&&h.parentElement.removeChild(h)),c.notifyCommandChanged(O.changeTheme)})),c.addCommand(O.changeTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Use Theme: %1",a):a},isToggled:e=>e.theme===p,execute:e=>{const t=e.theme;if(t!==m.theme)return m.isToggledAdaptiveTheme()?m.toggleAdaptiveTheme():m.setTheme(t)}}),c.addCommand(O.changePreferredLightTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided light `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Light Theme: %1",a):a},isToggled:e=>e.theme===m.preferredLightTheme,execute:e=>{const t=e.theme;if(t!==m.preferredLightTheme)return m.setPreferredLightTheme(t)}}),c.addCommand(O.changePreferredDarkTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided dark `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Dark Theme: %1",a):a},isToggled:e=>e.theme===m.preferredDarkTheme,execute:e=>{const t=e.theme;if(t!==m.preferredDarkTheme)return m.setPreferredDarkTheme(t)}}),c.addCommand(O.toggleAdaptiveTheme,{label:e=>e.isPalette?r.__("Synchronize Styling Theme with System Settings"):r.__("Synchronize with System Settings"),isToggled:()=>m.isToggledAdaptiveTheme(),execute:()=>{m.toggleAdaptiveTheme().catch(console.warn)}}),c.addCommand(O.themeScrollbars,{label:r.__("Theme Scrollbars"),isToggled:()=>m.isToggledThemeScrollbars(),execute:()=>m.toggleThemeScrollbars()}),c.addCommand(O.changeFont,{label:e=>e.enabled?`${e.font}`:r.__("waiting for fonts"),isEnabled:e=>e.enabled,isToggled:e=>m.getCSS(e.key)===e.font,execute:e=>m.setCSSOverride(e.key,e.font)}),c.addCommand(O.incrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Increase Code Font Size");case"content-font-size1":return r.__("Increase Content Font Size");case"ui-font-size1":return r.__("Increase UI Font Size");default:return r.__("Increase Font Size")}},execute:e=>m.incrFontSize(e.key)}),c.addCommand(O.decrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Decrease Code Font Size");case"content-font-size1":return r.__("Decrease Content Font Size");case"ui-font-size1":return r.__("Decrease UI Font Size");default:return r.__("Decrease Font Size")}},execute:e=>m.decrFontSize(e.key)}),m},autoStart:!0,provides:o.IThemeManager},$={id:"@jupyterlab/apputils-extension:themes-palette-menu",description:"Adds theme commands to the menu and the command palette.",requires:[o.IThemeManager,l.ITranslator],optional:[o.ICommandPalette,L.IMainMenu],activate:(e,t,a,n,o)=>{const s=a.load("jupyterlab");o&&e.restored.then((()=>{var e;const a=null===(e=o.settingsMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-settings-apputilstheme"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===e?void 0:e.submenu;a&&t.themes.forEach(((e,t)=>{a.insertItem(t,{command:O.changeTheme,args:{isPalette:!1,theme:e}})}))})),n&&e.restored.then((()=>{const e=s.__("Theme"),a=O.changeTheme,o=!0;t.themes.forEach((t=>{n.addItem({command:a,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:O.changePreferredLightTheme,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:O.changePreferredDarkTheme,args:{isPalette:o,theme:t},category:e})})),n.addItem({command:O.toggleAdaptiveTheme,args:{isPalette:o},category:e}),n.addItem({command:O.themeScrollbars,category:e}),n.addItem({command:O.incrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:O.decrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:O.incrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:O.decrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:O.incrFontSize,args:{key:"ui-font-size1"},category:e}),n.addItem({command:O.decrFontSize,args:{key:"ui-font-size1"},category:e})}))},autoStart:!0},W={id:"@jupyterlab/apputils-extension:toolbar-registry",description:"Provides toolbar items registry.",autoStart:!0,provides:o.IToolbarWidgetRegistry,activate:e=>new o.ToolbarWidgetRegistry({defaultFactory:(0,o.createDefaultFactory)(e.commands)})};var U=a(89945),B=a(53836);const H="jupyterlab-workspace",q="."+H,J={id:"@jupyterlab/apputils-extension:workspaces",description:"Add workspace file type.",autoStart:!0,requires:[r.IStateDB,l.ITranslator,n.JupyterFrontEnd.IPaths],optional:[n.IRouter,B.IWorkspaceCommands],activate:(e,t,a,n,o,i)=>{const r=new K.WorkspaceFactory({workspaces:e.serviceManager.workspaces,state:t,translator:a,open:async t=>{if(i)await e.commands.execute(i.open,{workspace:t});else{const e=s.URLExt.join(n.urls.app,"workspaces"),a=s.URLExt.join(e,t);if(!a.startsWith(e))throw new Error("Can only be used for workspaces");o?o.navigate(a,{hard:!0}):document.location.href=a}}}),l=a.load("jupyterlab");e.docRegistry.addFileType({name:H,contentType:"file",fileFormat:"text",displayName:l.__("JupyterLab Workspace File"),extensions:[q],mimeTypes:["text/json"],iconClass:"jp-JupyterIcon"}),e.docRegistry.addWidgetFactory(r)}};var K;!function(e){class t extends U.ABCWidgetFactory{constructor(e){super({name:"Workspace loader",label:(e.translator||l.nullTranslator).load("jupyterlab").__("Workspace loader"),fileTypes:[H],defaultFor:[H],readOnly:!0}),this._state=e.state,this._workspaces=e.workspaces,this._open=e.open}createNewWidget(e){return e.ready.then((async()=>{const t=e.model.toJSON(),a=e.path,n=t.metadata.id;await this._workspaces.save(n,t),await this._state.save("workspace-ui:lastSave",a),await this._open(n)})),function(e){const t=new U.DocumentWidget({content:new _.Widget,context:e});return t.content.dispose(),t}(e)}}e.WorkspaceFactory=t}(K||(K={}));var V=a(18395);const Q="jp-ContextualShortcut-TableItem";var Y;!function(e){e.loadState="apputils:load-statedb",e.print="apputils:print",e.reset="apputils:reset",e.resetOnLoad="apputils:reset-on-load",e.runFirstEnabled="apputils:run-first-enabled",e.runAllEnabled="apputils:run-all-enabled",e.toggleHeader="apputils:toggle-header",e.displayShortcuts="apputils:display-shortcuts"}(Y||(Y={}));const G={id:"@jupyterlab/apputils-extension:palette",description:"Provides the command palette.",autoStart:!0,requires:[l.ITranslator],provides:o.ICommandPalette,optional:[i.ISettingRegistry],activate:(e,t,a)=>D.activate(e,t,a)},X={id:"@jupyterlab/apputils-extension:palette-restorer",description:"Restores the command palette.",autoStart:!0,requires:[n.ILayoutRestorer,l.ITranslator],activate:(e,t,a)=>{D.restore(e,t,a)}},Z={id:"@jupyterlab/apputils-extension:resolver",description:"Provides the window name resolver.",autoStart:!0,provides:o.IWindowResolver,requires:[n.JupyterFrontEnd.IPaths,n.IRouter],activate:async(e,t,a)=>{const{hash:n,search:i}=a.current,r=s.URLExt.queryStringToObject(i||""),l=new o.WindowResolver,c=s.PageConfig.getOption("workspace"),d=s.PageConfig.getOption("treePath"),u="multiple-document"===s.PageConfig.getOption("mode")?"lab":"doc",m=c||s.PageConfig.defaultWorkspace,p=d?s.URLExt.join("tree",d):"";try{return await l.resolve(m),l}catch(e){return new Promise((()=>{const{base:e}=t.urls,o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())];let i=s.URLExt.join(e,u,"workspaces",`auto-${o}`);i=p?s.URLExt.join(i,s.URLExt.encodeParts(p)):i,r.reset="";const l=i+s.URLExt.objectToQueryString(r)+(n||"");a.navigate(l,{hard:!0})}))}}},ee={id:"@jupyterlab/apputils-extension:splash",description:"Provides the splash screen.",autoStart:!0,requires:[l.ITranslator],provides:o.ISplashScreen,activate:(e,t)=>{const a=t.load("jupyterlab"),{commands:n,restored:s}=e,i=document.createElement("div"),r=document.createElement("div"),l=document.createElement("div");let d;i.id="jupyterlab-splash",r.id="galaxy",l.id="main-logo",c.jupyterFaviconIcon.element({container:l,stylesheet:"splash"}),r.appendChild(l),["1","2","3"].forEach((e=>{const t=document.createElement("div"),a=document.createElement("div");t.id=`moon${e}`,t.className="moon orbit",a.id=`planet${e}`,a.className="planet",t.appendChild(a),r.appendChild(t)})),i.appendChild(r);const p=new m.Throttler((async()=>{if(!d){d=new o.Dialog({title:a.__("Loading…"),body:a.__("The loading screen is taking a long time.\nWould you like to clear the workspace or keep waiting?"),buttons:[o.Dialog.cancelButton({label:a.__("Keep Waiting")}),o.Dialog.warnButton({label:a.__("Clear Workspace")})]});try{const e=await d.launch();if(d.dispose(),d=null,e.button.accept&&n.hasCommand(Y.reset))return n.execute(Y.reset);requestAnimationFrame((()=>{p.invoke().catch((e=>{}))}))}catch(e){}}}),{limit:12e3,edge:"trailing"});let h=0;return{show:(e=!0)=>(i.classList.remove("splash-fade"),i.classList.toggle("light",e),i.classList.toggle("dark",!e),h++,document.body.appendChild(i),p.invoke().catch((e=>{})),new u.DisposableDelegate((async()=>{await s,0==--h&&(p.stop(),d&&(d.dispose(),d=null),i.classList.add("splash-fade"),window.setTimeout((()=>{document.body.removeChild(i)}),200))})))}}},te={id:"@jupyterlab/apputils-extension:print",description:"Add the print capability",autoStart:!0,requires:[l.ITranslator],activate:(e,t)=>{var a;const n=t.load("jupyterlab");e.commands.addCommand(Y.print,{label:n.__("Print…"),isEnabled:()=>{const t=e.shell.currentWidget;return null!==o.Printing.getPrintFunction(t)},execute:async()=>{const t=e.shell.currentWidget,a=o.Printing.getPrintFunction(t);a&&await a()}}),null===(a=e.shell.currentChanged)||void 0===a||a.connect((()=>{e.commands.notifyCommandChanged(Y.print)}))}},ae={id:"@jupyterlab/apputils-extension:toggle-header",description:"Adds a command to display the main area widget content header.",autoStart:!0,requires:[l.ITranslator],optional:[o.ICommandPalette],activate:(e,t,a)=>{var n;const s=t.load("jupyterlab"),i=s.__("Main Area");e.commands.addCommand(Y.toggleHeader,{label:s.__("Show Header Above Content"),isEnabled:()=>e.shell.currentWidget instanceof o.MainAreaWidget&&!e.shell.currentWidget.contentHeader.isDisposed&&e.shell.currentWidget.contentHeader.widgets.length>0,isToggled:()=>{const t=e.shell.currentWidget;return t instanceof o.MainAreaWidget&&!t.contentHeader.isHidden},execute:async()=>{const t=e.shell.currentWidget;t instanceof o.MainAreaWidget&&t.contentHeader.setHidden(!t.contentHeader.isHidden)}}),null===(n=e.shell.currentChanged)||void 0===n||n.connect((()=>{e.commands.notifyCommandChanged(Y.toggleHeader)})),a&&a.addItem({command:Y.toggleHeader,category:i})}},ne={id:"@jupyterlab/apputils-extension:state",description:"Provides the application state. It is stored per workspaces.",autoStart:!0,provides:r.IStateDB,requires:[n.JupyterFrontEnd.IPaths,n.IRouter,l.ITranslator],optional:[o.IWindowResolver],activate:(e,t,a,n,o)=>{const i=n.load("jupyterlab");if(null===o)return new r.StateDB;let l=!1;const{commands:c,name:u,serviceManager:p}=e,{workspaces:h}=p,g=o.name,b=new d.PromiseDelegate,f=new r.StateDB({transform:b.promise}),y=new m.Debouncer((async()=>{const e=g,t={id:e},a=await f.toJSON();await h.save(e,{data:a,metadata:t})}));return f.changed.connect((()=>{y.invoke()}),f),f.changed.connect((()=>async function(e,t,a){var n,o;const i=await t.toJSON();if(void 0===(null===(o=null===(n=i["layout-restorer:data"])||void 0===n?void 0:n.main)||void 0===o?void 0:o.current))document.title=`${s.PageConfig.getOption("appName")||"JupyterLab"}${e.startsWith("auto-")?` (${e})`:""}`;else{let t=s.PathExt.basename(decodeURIComponent(window.location.href));t=t.length>15?t.slice(0,12).concat("…"):t;const n=Object.keys(i).filter((e=>e.startsWith("notebook")||e.startsWith("editor"))).length;e.startsWith("auto-")?document.title=`${t} (${e}${n>1?` : ${n}`:""}) - ${a}`:document.title=`${t}${n>1?` (${n})`:""} - ${a}`}}(g,f,u))),c.addCommand(Y.loadState,{label:i.__("Load state for the current workspace."),execute:async e=>{if(l)return;const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="string"==typeof i.clone?""===i.clone?s.PageConfig.defaultWorkspace:i.clone:null,c=r||g||null;if(null!==c){try{const e=await h.fetch(c);l||(l=!0,b.resolve({type:"overwrite",contents:e.data}))}catch({message:e}){console.warn(`Fetching workspace "${g}" failed.`,e),l||(l=!0,b.resolve({type:"cancel",contents:null}))}if(c===r){delete i.clone;const e=n+s.URLExt.objectToQueryString(i)+t,o=y.invoke().then((()=>a.stop));return o.then((()=>{a.navigate(e)})),o}await y.invoke()}else console.error(`${Y.loadState} cannot load null workspace.`)}}),c.addCommand(Y.reset,{label:i.__("Reset Application State"),execute:async({reload:e})=>{await f.clear(),await y.invoke(),e&&a.reload()}}),c.addCommand(Y.resetOnLoad,{label:i.__("Reset state when loading for the workspace."),execute:e=>{const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="clone"in i;if(!("reset"in i))return;if(l)return a.reload();l=!0,b.resolve({type:"clear",contents:null}),delete i.reset;const c=n+s.URLExt.objectToQueryString(i)+t,d=f.clear().then((()=>y.invoke()));return r?d.then((()=>{a.navigate(c,{hard:!0})})):d.then((()=>{a.navigate(c)})),d}}),a.register({command:Y.loadState,pattern:/.?/,rank:30}),a.register({command:Y.resetOnLoad,pattern:/(\?reset|\&reset)($|&)/,rank:20}),f}},oe={id:"@jupyterlab/apputils-extension:sessionDialogs",description:"Provides the session context dialogs.",provides:o.ISessionContextDialogs,optional:[l.ITranslator],autoStart:!0,activate:async(e,t)=>new o.SessionContextDialogs({translator:null!=t?t:l.nullTranslator})},se={id:"@jupyterlab/apputils-extension:utilityCommands",description:"Adds meta commands to run set of other commands.",requires:[l.ITranslator],optional:[o.ICommandPalette],autoStart:!0,activate:(e,t,a)=>{const n=t.load("jupyterlab"),{commands:s}=e;if(s.addCommand(Y.runFirstEnabled,{label:n.__("Run First Enabled Command"),execute:t=>{const a=t.commands,n=t.args,o=Array.isArray(t);for(let t=0;t<a.length;t++){const s=a[t],i=o?n[t]:n;if(e.commands.isEnabled(s,i))return e.commands.execute(s,i)}}}),s.addCommand(Y.runAllEnabled,{label:n.__("Run All Enabled Commands Passed as Args"),execute:async t=>{var a,n;const o=null!==(a=t.commands)&&void 0!==a?a:[],s=t.args,i=Array.isArray(t),r=null!==(n=t.errorIfNotEnabled)&&void 0!==n&&n;for(let t=0;t<o.length;t++){const a=o[t],n=i?s[t]:s;e.commands.isEnabled(a,n)?await e.commands.execute(a,n):r&&console.error(`${a} is not enabled.`)}},isEnabled:t=>{var a;const n=null!==(a=t.commands)&&void 0!==a?a:[],o=t.args,s=Array.isArray(t);return n.some(((t,a)=>e.commands.isEnabled(t,s?o[a]:o)))}}),s.addCommand(Y.displayShortcuts,{label:n.__("Show Keyboard Shortcuts…"),caption:n.__("Show relevant keyboard shortcuts for the current active widget"),execute:t=>{var a;const i=e.shell.currentWidget;if(!(null==i?void 0:i.node.contains(document.activeElement))&&i instanceof o.MainAreaWidget){const e=null!==(a=i.content.node)&&void 0!==a?a:null==i?void 0:i.node;null==e||e.focus()}return function(e){const{commands:t,trans:a,activeElement:n}=e,s=null!=n?n:document.activeElement;function i(e){const t=[];return e.forEach(((e,a)=>{const n=[];e.split(" ").forEach(((e,t)=>{n.push(w.createElement("span",{className:"jp-ContextualShortcut-Key",key:`ch-${t}`},w.createElement("kbd",null,e)),w.createElement(w.Fragment,{key:`fragment-${t}`}," + "))})),t.push(w.createElement("span",{key:`key-${a}`},n.slice(0,-1)),w.createElement(w.Fragment,{key:`fragment-${a}`}," + "))})),w.createElement("span",null,t.slice(0,-1))}function r(e){const a=t.label(e.command),n=e.command.split(":")[1].split("-");let o="";for(let e=0;e<n.length;e++)o=o+" "+((s=n[e]).charAt(0).toUpperCase()+s.slice(1));var s;return a.length>0?a:o}function l(e,t){let a=t;for(let t=0;null!==a&&a!==a.parentElement;a=a.parentElement,++t){if(a.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(a.matches(e))return t}return-1}const c=new Map;for(let e=0;e<t.keyBindings.length;e++){const a=t.keyBindings[e];let n=l(a.selector,s);if(n<0)continue;let o=P.CommandRegistry.formatKeystroke(a.keys);if(c.has(o)){let e=c.get(o);if(e[0]<n||e[0]===n&&V.Selector.calculateSpecificity(e[1].selector)>V.Selector.calculateSpecificity(a.selector))continue}c.set(o,[n,a])}let d=-1;const u=new Map;for(let[e,t]of c.values())d=Math.max(e,d),u.has(e)||u.set(e,[]),u.get(e).push(t);const m=[];for(let e=0;e<=d;e++)u.has(e)&&(m.push(u.get(e).map((e=>w.createElement("tr",{className:"jp-ContextualShortcut-TableRow",key:`${e.command}-${e.keys.join("-").replace(" ","_")}`},w.createElement("td",{className:Q},r(e)),w.createElement("td",{className:Q},i([...e.keys])))))),m.push(w.createElement("tr",{className:"jp-ContextualShortcut-TableLastRow",key:`group-${e}-last`})));const p=w.createElement("table",null,w.createElement("tbody",null,m));return(0,o.showDialog)({title:a.__("Keyboard Shortcuts"),body:p,buttons:[o.Dialog.cancelButton({label:a.__("Close")})]})}({commands:s,trans:n})}}),a){const e=n.__("Help");a.addItem({command:Y.displayShortcuts,category:e})}}},ie={id:"@jupyterlab/apputils-extension:sanitizer",description:"Provides the HTML sanitizer.",autoStart:!0,provides:o.ISanitizer,requires:[i.ISettingRegistry],activate:(e,t)=>{const a=new o.Sanitizer,n=e=>{const t=e.get("allowedSchemes").composite,n=e.get("autolink").composite;t&&a.setAllowedSchemes(t),a.setAutolink(n)};return t.load("@jupyterlab/apputils-extension:sanitizer").then((e=>{n(e),e.changed.connect(n)})).catch((e=>{console.error("Failed to load sanitizer settings:",e)})),a}},re=[f,A,j,G,X,te,Z,M,ie,R,ne,ee,oe,z,$,ae,W,se,J]},37634:(e,t,a)=>{var n=a(38005);t.s=n.createRoot,n.hydrateRoot}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5099],{25099:(e,t,a)=>{a.r(t),a.d(t,{default:()=>re,toggleHeader:()=>ae});var n=a(27961),o=a(15465),s=a(44548),i=a(87844),r=a(93223),l=a(25291),c=a(12668),d=a(20998),u=a(2549),m=a(97934),p=a(60211);const h="help:open",g="https://jupyterlab.readthedocs.io/en/latest/privacy_policies.html";async function b(e,t={}){const a=p.ServerConnection.makeSettings(),n=s.URLExt.join(a.baseUrl,e);let o;try{o=await p.ServerConnection.makeRequest(n,t,a)}catch(e){throw new p.ServerConnection.NetworkError(e)}const i=await o.json();if(!o.ok)throw new p.ServerConnection.ResponseError(o,i.message);return i}const f={id:"@jupyterlab/apputils-extension:announcements",description:"Add the announcement feature. It will fetch news on the internet and check for application updates.",autoStart:!0,optional:[i.ISettingRegistry,l.ITranslator],activate:(e,t,a)=>{var n;const s=f.id.replace(/[^\w]/g,"");Promise.all([e.restored,null!==(n=null==t?void 0:t.load("@jupyterlab/apputils-extension:notification"))&&void 0!==n?n:Promise.resolve(null),p.ConfigSection.create({name:s})]).then((async([t,n,s])=>{const i=(null!=a?a:l.nullTranslator).load("jupyterlab");if(o.Notification.manager.changed.connect(((e,t)=>{var a;if("removed"!==t.type)return;const{id:n,tags:o}=null!==(a=t.notification.options.data)&&void 0!==a?a:{};if((null!=o?o:[]).some((e=>["news","update"].includes(e)))&&n){const e={};e[n]={seen:!0,dismissed:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}})),"none"===(null==n?void 0:n.get("fetchNews").composite)){const t=o.Notification.emit(i.__("Would you like to get notified about official Jupyter news?"),"default",{autoClose:!1,actions:[{label:i.__("Open privacy policy"),caption:g,callback:t=>{t.preventDefault(),e.commands.hasCommand(h)?e.commands.execute(h,{text:i.__("Privacy policies"),url:g}):window.open(g,"_blank","noreferrer")},displayType:"link"},{label:i.__("Yes"),callback:()=>{o.Notification.dismiss(t),s.update({}).then((()=>r())).catch((e=>{console.error(`Failed to get the news:\n${e}`)})),null==n||n.set("fetchNews","true").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}},{label:i.__("No"),callback:()=>{o.Notification.dismiss(t),null==n||n.set("fetchNews","false").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}}]})}else await r();async function r(){var e,t,a,r;if("true"===(null!==(e=null==n?void 0:n.get("fetchNews").composite)&&void 0!==e?e:"false"))try{const e=await b("/lab/api/news");for(const{link:a,message:n,type:r,options:l}of e.news){const e=l.data.id,c=null!==(t=s.data[e])&&void 0!==t?t:{seen:!1,dismissed:!1};if(!c.dismissed){if(l.actions=[{label:i.__("Hide"),caption:i.__("Never show this notification again."),callback:()=>{const t={};t[e]={seen:!0,dismissed:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}}],2===(null==a?void 0:a.length)&&l.actions.push({label:a[0],caption:a[1],callback:()=>{window.open(a[1],"_blank","noreferrer")},displayType:"link"}),!c.seen){l.autoClose=5e3;const t={};t[e]={seen:!0},s.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}o.Notification.emit(n,r,l)}}}catch(e){console.log("Failed to get the announcements.",e)}if(null===(a=null==n?void 0:n.get("checkForUpdates").composite)||void 0===a||a){const e=await b("/lab/api/update");if(e.notification){const{link:t,message:a,type:l,options:c}=e.notification,d=c.data.id,u=null!==(r=s.data[d])&&void 0!==r?r:{seen:!1,dismissed:!1};if(!u.dismissed){let e;if(c.actions=[{label:i.__("Do not check for updates"),caption:i.__("If pressed, you will not be prompted if a new JupyterLab version is found."),callback:()=>{null==n||n.set("checkForUpdates",!1).then((()=>{o.Notification.dismiss(e)})).catch((e=>{console.error("Failed to set the `checkForUpdates` setting.",e)}))}}],2===(null==t?void 0:t.length)&&c.actions.push({label:t[0],caption:t[1],callback:()=>{window.open(t[1],"_blank","noreferrer")},displayType:"link"}),!u.seen){c.autoClose=5e3;const e={};e[d]={seen:!0},s.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}e=o.Notification.emit(a,l,c)}}}}}))}};var y,v=a(54252),_=a(63485),w=a(78156),k=a(37634);function C(e){const{manager:t,onClose:a,trans:n}=e,[o,s]=w.useState([]),[i,r]=w.useState(null);return w.useEffect((()=>{async function e(){s(await Promise.all(t.notifications.map((async e=>Object.freeze({...e})))))}return o.length!==t.count&&e(),t.changed.connect(e),()=>{t.changed.disconnect(e)}}),[t]),w.useEffect((()=>{E.getIcons().then((e=>{r(e)})).catch((e=>{console.error(`Failed to get react-toastify icons:\n${e}`)}))}),[]),w.createElement(c.UseSignal,{signal:t.changed},(()=>w.createElement(w.Fragment,null,w.createElement("h2",{className:"jp-Notification-Header jp-Toolbar"},w.createElement("span",{className:"jp-Toolbar-item"},t.count>0?n._n("%1 notification","%1 notifications",t.count):n.__("No notifications")),w.createElement("span",{className:"jp-Toolbar-item jp-Toolbar-spacer"}),w.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:()=>{t.dismiss()},icon:c.deleteIcon,tooltip:n.__("Dismiss all notifications"),enabled:t.count>0}),w.createElement(c.ToolbarButtonComponent,{actualOnClick:!0,onClick:a,icon:c.closeIcon,tooltip:n.__("Hide notifications")})),w.createElement("ol",{className:"jp-Notification-List"},o.map((e=>{var a;const{id:o,message:s,type:r,options:l}=e,d="in-progress"===r?"default":r,u=()=>{t.dismiss(o)},m="default"===r?null:"in-progress"===r?null!==(a=null==i?void 0:i.spinner)&&void 0!==a?a:null:i&&i[r];return w.createElement("li",{className:"jp-Notification-List-Item",key:e.id,onClick:e=>{e.stopPropagation()}},w.createElement("div",{className:`Toastify__toast Toastify__toast-theme--light Toastify__toast--${d} jp-Notification-Toast-${d}`},w.createElement("div",{className:"Toastify__toast-body"},m&&w.createElement("div",{className:"Toastify__toast-icon"},m({theme:"light",type:d})),w.createElement("div",null,E.createContent(s,u,l.actions))),w.createElement(E.CloseButton,{close:u,closeIcon:c.deleteIcon.react,title:n.__("Dismiss notification"),closeIconMargin:!0})))}))))))}!function(e){e.dismiss="apputils:dismiss-notification",e.display="apputils:display-notifications",e.notify="apputils:notify",e.update="apputils:update-notification"}(y||(y={}));class S extends c.VDomModel{constructor(e){super(),this.manager=e,this._highlight=!1,this._listOpened=!1,this._doNotDisturbMode=!1,this._count=e.count,this.manager.changed.connect(this.onNotificationChanged,this)}get count(){return this._count}get doNotDisturbMode(){return this._doNotDisturbMode}set doNotDisturbMode(e){this._doNotDisturbMode=e}get highlight(){return this._highlight}get listOpened(){return this._listOpened}set listOpened(e){this._listOpened=e,(this._listOpened||this._highlight)&&(this._highlight=!1),this.stateChanged.emit()}onNotificationChanged(e,t){this._count=this.manager.count;const{autoClose:a}=t.notification.options,n=this.doNotDisturbMode||"number"==typeof a&&a<=0;!this._listOpened&&"removed"!==t.type&&n&&(this._highlight=!0),this.stateChanged.emit()}}function T(e){return w.createElement(v.GroupItem,{spacing:4,onClick:()=>{e.onClick()},title:e.count>0?e.trans._n("%1 notification","%1 notifications",e.count):e.trans.__("No notifications")},w.createElement(v.TextItem,{className:"jp-Notification-Status-Text",source:`${e.count}`}),w.createElement(c.bellIcon.react,{top:"2px",stylesheet:"statusBar"}))}const j={id:"@jupyterlab/apputils-extension:notification",description:"Add the notification center and its status indicator.",autoStart:!0,optional:[v.IStatusBar,i.ISettingRegistry,l.ITranslator],activate:(e,t,a,n)=>{E.translator=null!=n?n:l.nullTranslator;const s=E.translator.load("jupyterlab"),i=new S(o.Notification.manager);i.doNotDisturbMode=!1,a&&Promise.all([a.load(j.id),e.restored]).then((([e])=>{const t=()=>{i.doNotDisturbMode=e.get("doNotDisturbMode").composite};t(),e.changed.connect(t)})),e.commands.addCommand(y.notify,{label:s.__("Emit a notification"),caption:s.__("Notification is described by {message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{var a;const{message:n,type:s}=t,i=null!==(a=t.options)&&void 0!==a?a:{};return o.Notification.manager.notify(n,null!=s?s:"default",{...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.update,{label:s.__("Update a notification"),caption:s.__("Notification is described by {id: string, message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{const{id:a,message:n,type:s,...i}=t;return o.Notification.manager.update({id:a,message:n,type:null!=s?s:"default",...i,actions:i.actions?i.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}}),e.commands.addCommand(y.dismiss,{label:s.__("Dismiss a notification"),execute:e=>{const{id:t}=e;o.Notification.manager.dismiss(t)}});let r=null;i.listOpened=!1;const d=o.ReactWidget.create(w.createElement(C,{manager:o.Notification.manager,onClose:()=>{null==r||r.dispose()},trans:s}));d.addClass("jp-Notification-Center"),o.Notification.manager.changed.connect((async function(e,t){var a;if(i.doNotDisturbMode||null!==r&&!r.isDisposed)return;const{message:n,type:o,options:s,id:l}=t.notification;if(!("number"==typeof s.autoClose&&s.autoClose<=0))switch(t.type){case"added":await E.createToast(l,n,o,s);break;case"updated":{const t=await E.toast(),i=s.actions,r=null!==(a=s.autoClose)&&void 0!==a?a:!(i&&i.length>0)&&null;if(t.isActive(l)){const a=()=>{t.dismiss(l),e.dismiss(l)};t.update(l,{type:"in-progress"===o?null:o,isLoading:"in-progress"===o,autoClose:r,render:E.createContent(n,a,s.actions)})}else await E.createToast(l,n,o,s)}break;case"removed":await E.toast().then((e=>{e.dismiss(l)}))}}));const u=()=>{r?(r.dispose(),r=null):(r=(0,v.showPopup)({body:d,anchor:m,align:"right",hasDynamicSize:!0,startHidden:!0}),E.toast().then((e=>{e.dismiss()})).catch((e=>{console.error(`Failed to dismiss all toasts:\n${e}`)})).finally((()=>{null==r||r.launch(),d.node.focus(),null==r||r.disposed.connect((()=>{i.listOpened=!1,r=null}))}))),i.listOpened=null!==r};e.commands.addCommand(y.display,{label:s.__("Show Notifications"),execute:u});const m=o.ReactWidget.create(w.createElement(c.UseSignal,{signal:i.stateChanged},(()=>(i.highlight||r&&!r.isDisposed?m.addClass("jp-mod-selected"):m.removeClass("jp-mod-selected"),w.createElement(T,{count:i.count,highlight:i.highlight,trans:s,onClick:u})))));m.addClass("jp-Notification-Status"),t?t.registerStatusItem(j.id,{item:m,align:"right",rank:-1}):(m.node.style.position="fixed",m.node.style.bottom="0",m.node.style.right="10px",_.Widget.attach(m,document.body),m.show())}};var E;!function(e){e.translator=l.nullTranslator;let t=null;function n(e){var t;return w.createElement("button",{className:"jp-Button jp-mod-minimal jp-Notification-Toast-Close"+(e.closeIconMargin?" jp-Notification-Toast-Close-Margin":""),title:null!==(t=e.title)&&void 0!==t?t:"",onClick:e.close},w.createElement(e.closeIcon,{className:"jp-icon-hover",tag:"span"}))}function s(t){const a=e.translator.load("jupyterlab");return w.createElement(n,{close:t.closeToast,closeIcon:c.closeIcon.react,title:a.__("Hide notification")})}e.CloseButton=n;let i=null;async function r(){if(null===i?i=new d.PromiseDelegate:await i.promise,null===t){t=await a.e(53).then(a.t.bind(a,60053,23));const e=document.body.appendChild(document.createElement("div"));e.id="react-toastify-container",(0,k.s)(e).render(w.createElement(t.ToastContainer,{draggable:!1,closeOnClick:!1,hideProgressBar:!0,newestOnTop:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,position:"bottom-right",className:"jp-toastContainer",transition:t.Slide,closeButton:s})),i.resolve()}return t.toast}e.toast=r,e.getIcons=async function(){return null===t&&await r(),t.Icons};const u={accent:"jp-mod-accept",link:"jp-mod-link",warn:"jp-mod-warn",default:""};function m({action:e,closeToast:t}){var a,n;const o=["jp-toast-button",u[null!==(a=e.displayType)&&void 0!==a?a:"default"]].join(" ");return w.createElement(c.Button,{title:null!==(n=e.caption)&&void 0!==n?n:e.label,className:o,onClick:a=>{e.callback(a),a.defaultPrevented||t()},small:!0},e.label)}function p(e,t,a){var n;const o=e.length>140?e.slice(0,140)+"…":e;return w.createElement(w.Fragment,null,w.createElement("div",{className:"jp-toast-message"},o.split("\n").map(((e,t)=>w.createElement(w.Fragment,{key:`part-${t}`},t>0?w.createElement("br",null):null,e)))),(null!==(n=null==a?void 0:a.length)&&void 0!==n?n:0)>0&&w.createElement("div",{className:"jp-toast-buttonBar"},w.createElement("div",{className:"jp-toast-spacer"}),a.map(((e,a)=>w.createElement(m,{key:"button-"+a,action:e,closeToast:t})))))}e.createContent=p,e.createToast=async function(e,t,a,n={}){const{actions:s,autoClose:i,data:l}=n;return(await r())((({closeToast:a})=>p(t,(()=>{a&&a(),o.Notification.manager.dismiss(e)}),s)),{autoClose:null!=i?i:!(s&&s.length>0)&&void 0,data:l,className:`jp-Notification-Toast-${a}`,toastId:e,type:"in-progress"===a?null:a,isLoading:"in-progress"===a})}}(E||(E={}));var I,x,N=a(33625),P=a(16934);!function(e){e.activate="apputils:activate-command-palette"}(I||(I={}));class D{constructor(e,t){this.translator=t||l.nullTranslator;const a=this.translator.load("jupyterlab");this._palette=e,this._palette.title.label="",this._palette.title.caption=a.__("Command Palette")}set placeholder(e){this._palette.inputNode.placeholder=e}get placeholder(){return this._palette.inputNode.placeholder}activate(){this._palette.activate()}addItem(e){const t=this._palette.addItem(e);return new u.DisposableDelegate((()=>{this._palette.removeItem(t)}))}}!function(e){e.activate=function(t,a,n){const{commands:s,shell:i}=t,r=a.load("jupyterlab"),l=x.createPalette(t,a),c=new o.ModalCommandPalette({commandPalette:l});let d=!1;if(l.node.setAttribute("role","region"),l.node.setAttribute("aria-label",r.__("Command Palette Section")),i.add(l,"left",{rank:300,type:"Command Palette"}),n){const e=n.load("@jupyterlab/apputils-extension:palette"),a=e=>{const t=e.get("modal").composite;d&&!t?(l.parent=null,c.detach(),i.add(l,"left",{rank:300,type:"Command Palette"})):!d&&t&&(l.parent=null,c.palette=l,l.show(),c.attach()),d=t};Promise.all([e,t.restored]).then((([e])=>{a(e),e.changed.connect((e=>{a(e)}))})).catch((e=>{console.error(e.message)}))}const u=()=>{const e=(0,N.find)(t.commands.keyBindings,(e=>e.command===I.activate));if(e){const t=e.keys.map(P.CommandRegistry.formatKeystroke).join(", ");l.title.caption=r.__("Commands (%1)",t)}else l.title.caption=r.__("Commands")};return u(),t.commands.keyBindingChanged.connect((()=>{u()})),s.addCommand(I.activate,{execute:()=>{d?c.activate():i.activateById(l.id)},label:r.__("Activate Command Palette")}),l.inputNode.placeholder=r.__("SEARCH"),new e(l,a)},e.restore=function(e,t,a){const n=x.createPalette(e,a);t.add(n,"command-palette")}}(D||(D={})),function(e){let t;e.createPalette=function(e,a){if(!t){t=new _.CommandPalette({commands:e.commands,renderer:c.CommandPaletteSvg.defaultRenderer}),t.id="command-palette",t.title.icon=c.paletteIcon;const n=a.load("jupyterlab");t.title.label=n.__("Commands")}return t}}(x||(x={}));class F extends r.DataConnector{constructor(e){super(),this._throttlers=Object.create(null),this._connector=e}fetch(e){const t=this._throttlers;return e in t||(t[e]=new m.Throttler((()=>this._connector.fetch(e)),100)),t[e].invoke()}async list(e="all"){const{isDisabled:t}=s.PageConfig.Extension,{ids:a,values:n}=await this._connector.list("ids"===e?"ids":void 0);return"all"===e?{ids:a,values:n}:"ids"===e?{ids:a}:{ids:a.filter((e=>!t(e))),values:n.filter((({id:e})=>!t(e)))}}async save(e,t){await this._connector.save(e,t)}}const R={id:"@jupyterlab/apputils-extension:settings",description:"Provides the setting registry.",activate:async e=>{const{isDisabled:t}=s.PageConfig.Extension,a=new F(e.serviceManager.settings),n=new i.SettingRegistry({connector:a,plugins:(await a.list("active")).values.filter((t=>e.hasPlugin(t.id)))});return e.restored.then((async()=>{(await a.list("ids")).ids.forEach((async a=>{if(e.hasPlugin(a)&&!t(a)&&!(a in n.plugins))try{await n.load(a)}catch(t){console.warn(`Settings failed to load for (${a})`,t),e.isPluginActivated(a)||console.warn(`If 'jupyter.lab.transform=true' in the plugin schema, this may happen if {autoStart: false} in (${a}) or if it is one of the deferredExtensions in page config.`)}}))})),n},autoStart:!0,provides:i.ISettingRegistry},A={id:"@jupyterlab/apputils-extension:kernel-status",description:"Provides the kernel status indicator model.",autoStart:!0,requires:[v.IStatusBar],provides:o.IKernelStatusModel,optional:[o.ISessionContextDialogs,l.ITranslator,n.ILabShell],activate:(e,t,a,n,s)=>{const i=null!=n?n:l.nullTranslator,r=null!=a?a:new o.SessionContextDialogs({translator:i}),c=async()=>{d.model.sessionContext&&await r.selectKernel(d.model.sessionContext)},d=new o.KernelStatus({onClick:c,onKeyDown:async e=>{if("Enter"===e.key||"Spacebar"===e.key||" "===e.key)return e.preventDefault(),e.stopPropagation(),c()}},i),u=new Set;function m(e,t){var a;const{oldValue:n,newValue:o}=t;n&&n.title.changed.disconnect(p),d.model.sessionContext=null!==(a=[...u].map((e=>e(t.newValue))).filter((e=>null!==e))[0])&&void 0!==a?a:null,o&&d.model.sessionContext&&(p(o.title),o.title.changed.connect(p))}const p=e=>{d.model.activityName=e.label};return s&&s.currentChanged.connect(m),t.registerStatusItem(A.id,{priority:1,item:d,align:"left",rank:1,isActive:()=>null!==d.model.sessionContext}),{addSessionProvider:t=>{u.add(t),e.shell.currentWidget&&m(e.shell,{newValue:e.shell.currentWidget,oldValue:null})}}}},M={id:"@jupyterlab/apputils-extension:running-sessions-status",description:"Add the running sessions and terminals status bar item.",autoStart:!0,requires:[v.IStatusBar,l.ITranslator],activate:(e,t,a)=>{const n=new o.RunningSessions({onClick:()=>e.shell.activateById("jp-running-sessions"),onKeyDown:t=>{"Enter"!==t.key&&"Spacebar"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),e.shell.activateById("jp-running-sessions"))},serviceManager:e.serviceManager,translator:a});n.model.sessions=Array.from(e.serviceManager.sessions.running()).length,n.model.terminals=Array.from(e.serviceManager.terminals.running()).length,t.registerStatusItem(M.id,{item:n,align:"left",rank:0})}};var O,L=a(2646);!function(e){e.changeTheme="apputils:change-theme",e.changePreferredLightTheme="apputils:change-light-theme",e.changePreferredDarkTheme="apputils:change-dark-theme",e.toggleAdaptiveTheme="apputils:adaptive-theme",e.themeScrollbars="apputils:theme-scrollbars",e.changeFont="apputils:change-font",e.incrFontSize="apputils:incr-font-size",e.decrFontSize="apputils:decr-font-size"}(O||(O={}));const z={id:"@jupyterlab/apputils-extension:themes",description:"Provides the theme manager.",requires:[i.ISettingRegistry,n.JupyterFrontEnd.IPaths,l.ITranslator],optional:[o.ISplashScreen],activate:(e,t,a,n,i)=>{const r=n.load("jupyterlab"),l=e.shell,c=e.commands,d=s.URLExt.join(s.PageConfig.getBaseUrl(),a.urls.themes),u=z.id,m=new o.ThemeManager({key:u,host:l,settings:t,splash:null!=i?i:void 0,url:d});let p,h=null;return m.themeChanged.connect(((e,t)=>{p=t.newValue,document.body.dataset.jpThemeLight=String(m.isLight(p)),document.body.dataset.jpThemeName=p,document.body.style.colorScheme=m.isLight(p)?"light":"dark",document.body.dataset.jpThemeScrollbars!==String(m.themeScrollbars(p))&&(document.body.dataset.jpThemeScrollbars=String(m.themeScrollbars(p)),m.themeScrollbars(p)?(h||(h=function(e){const t=document.createElement("style");return t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n * Webkit scrollbar styling.\n * Separate file which is dynamically loaded based on user/theme settings.\n */\n\n/* use standard opaque scrollbars for most nodes */\n\n::-webkit-scrollbar,\n::-webkit-scrollbar-corner {\n background: var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-thumb {\n background: rgb(var(--jp-scrollbar-thumb-color));\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-right: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-bottom: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar */\n\n.CodeMirror-hscrollbar::-webkit-scrollbar,\n.CodeMirror-vscrollbar::-webkit-scrollbar,\n.CodeMirror-hscrollbar::-webkit-scrollbar-corner,\n.CodeMirror-vscrollbar::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-thumb,\n.CodeMirror-vscrollbar::-webkit-scrollbar-thumb {\n background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid transparent;\n border-right: var(--jp-scrollbar-endpad) solid transparent;\n}\n\n.CodeMirror-vscrollbar::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid transparent;\n border-bottom: var(--jp-scrollbar-endpad) solid transparent;\n}\n")),t}()),h.parentElement||document.body.appendChild(h)):h&&h.parentElement&&h.parentElement.removeChild(h)),c.notifyCommandChanged(O.changeTheme)})),c.addCommand(O.changeTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Use Theme: %1",a):a},isToggled:e=>e.theme===p,execute:e=>{const t=e.theme;if(t!==m.theme)return m.isToggledAdaptiveTheme()?m.toggleAdaptiveTheme():m.setTheme(t)}}),c.addCommand(O.changePreferredLightTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided light `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Light Theme: %1",a):a},isToggled:e=>e.theme===m.preferredLightTheme,execute:e=>{const t=e.theme;if(t!==m.preferredLightTheme)return m.setPreferredLightTheme(t)}}),c.addCommand(O.changePreferredDarkTheme,{label:e=>{if(void 0===e.theme)return r.__("Switch to the provided dark `theme`.");const t=e.theme,a=m.getDisplayName(t);return e.isPalette?r.__("Set Preferred Dark Theme: %1",a):a},isToggled:e=>e.theme===m.preferredDarkTheme,execute:e=>{const t=e.theme;if(t!==m.preferredDarkTheme)return m.setPreferredDarkTheme(t)}}),c.addCommand(O.toggleAdaptiveTheme,{label:e=>e.isPalette?r.__("Synchronize Styling Theme with System Settings"):r.__("Synchronize with System Settings"),isToggled:()=>m.isToggledAdaptiveTheme(),execute:()=>{m.toggleAdaptiveTheme().catch(console.warn)}}),c.addCommand(O.themeScrollbars,{label:r.__("Theme Scrollbars"),isToggled:()=>m.isToggledThemeScrollbars(),execute:()=>m.toggleThemeScrollbars()}),c.addCommand(O.changeFont,{label:e=>e.enabled?`${e.font}`:r.__("waiting for fonts"),isEnabled:e=>e.enabled,isToggled:e=>m.getCSS(e.key)===e.font,execute:e=>m.setCSSOverride(e.key,e.font)}),c.addCommand(O.incrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Increase Code Font Size");case"content-font-size1":return r.__("Increase Content Font Size");case"ui-font-size1":return r.__("Increase UI Font Size");default:return r.__("Increase Font Size")}},execute:e=>m.incrFontSize(e.key)}),c.addCommand(O.decrFontSize,{label:e=>{switch(e.key){case"code-font-size":return r.__("Decrease Code Font Size");case"content-font-size1":return r.__("Decrease Content Font Size");case"ui-font-size1":return r.__("Decrease UI Font Size");default:return r.__("Decrease Font Size")}},execute:e=>m.decrFontSize(e.key)}),m},autoStart:!0,provides:o.IThemeManager},$={id:"@jupyterlab/apputils-extension:themes-palette-menu",description:"Adds theme commands to the menu and the command palette.",requires:[o.IThemeManager,l.ITranslator],optional:[o.ICommandPalette,L.IMainMenu],activate:(e,t,a,n,o)=>{const s=a.load("jupyterlab");o&&e.restored.then((()=>{var e;const a=null===(e=o.settingsMenu.items.find((e=>{var t;return"submenu"===e.type&&"jp-mainmenu-settings-apputilstheme"===(null===(t=e.submenu)||void 0===t?void 0:t.id)})))||void 0===e?void 0:e.submenu;a&&t.themes.forEach(((e,t)=>{a.insertItem(t,{command:O.changeTheme,args:{isPalette:!1,theme:e}})}))})),n&&e.restored.then((()=>{const e=s.__("Theme"),a=O.changeTheme,o=!0;t.themes.forEach((t=>{n.addItem({command:a,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:O.changePreferredLightTheme,args:{isPalette:o,theme:t},category:e})})),t.themes.forEach((t=>{n.addItem({command:O.changePreferredDarkTheme,args:{isPalette:o,theme:t},category:e})})),n.addItem({command:O.toggleAdaptiveTheme,args:{isPalette:o},category:e}),n.addItem({command:O.themeScrollbars,category:e}),n.addItem({command:O.incrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:O.decrFontSize,args:{key:"code-font-size"},category:e}),n.addItem({command:O.incrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:O.decrFontSize,args:{key:"content-font-size1"},category:e}),n.addItem({command:O.incrFontSize,args:{key:"ui-font-size1"},category:e}),n.addItem({command:O.decrFontSize,args:{key:"ui-font-size1"},category:e})}))},autoStart:!0},W={id:"@jupyterlab/apputils-extension:toolbar-registry",description:"Provides toolbar items registry.",autoStart:!0,provides:o.IToolbarWidgetRegistry,activate:e=>new o.ToolbarWidgetRegistry({defaultFactory:(0,o.createDefaultFactory)(e.commands)})};var U=a(71120),B=a(23518);const H="jupyterlab-workspace",q="."+H,J={id:"@jupyterlab/apputils-extension:workspaces",description:"Add workspace file type.",autoStart:!0,requires:[r.IStateDB,l.ITranslator,n.JupyterFrontEnd.IPaths],optional:[n.IRouter,B.IWorkspaceCommands],activate:(e,t,a,n,o,i)=>{const r=new K.WorkspaceFactory({workspaces:e.serviceManager.workspaces,state:t,translator:a,open:async t=>{if(i)await e.commands.execute(i.open,{workspace:t});else{const e=s.URLExt.join(n.urls.app,"workspaces"),a=s.URLExt.join(e,t);if(!a.startsWith(e))throw new Error("Can only be used for workspaces");o?o.navigate(a,{hard:!0}):document.location.href=a}}}),l=a.load("jupyterlab");e.docRegistry.addFileType({name:H,contentType:"file",fileFormat:"text",displayName:l.__("JupyterLab Workspace File"),extensions:[q],mimeTypes:["text/json"],iconClass:"jp-JupyterIcon"}),e.docRegistry.addWidgetFactory(r)}};var K;!function(e){class t extends U.ABCWidgetFactory{constructor(e){super({name:"Workspace loader",label:(e.translator||l.nullTranslator).load("jupyterlab").__("Workspace loader"),fileTypes:[H],defaultFor:[H],readOnly:!0}),this._state=e.state,this._workspaces=e.workspaces,this._open=e.open}createNewWidget(e){return e.ready.then((async()=>{const t=e.model.toJSON(),a=e.path,n=t.metadata.id;await this._workspaces.save(n,t),await this._state.save("workspace-ui:lastSave",a),await this._open(n)})),function(e){const t=new U.DocumentWidget({content:new _.Widget,context:e});return t.content.dispose(),t}(e)}}e.WorkspaceFactory=t}(K||(K={}));var V=a(18395);const Q="jp-ContextualShortcut-TableItem";var Y;!function(e){e.loadState="apputils:load-statedb",e.print="apputils:print",e.reset="apputils:reset",e.resetOnLoad="apputils:reset-on-load",e.runFirstEnabled="apputils:run-first-enabled",e.runAllEnabled="apputils:run-all-enabled",e.toggleHeader="apputils:toggle-header",e.displayShortcuts="apputils:display-shortcuts"}(Y||(Y={}));const G={id:"@jupyterlab/apputils-extension:palette",description:"Provides the command palette.",autoStart:!0,requires:[l.ITranslator],provides:o.ICommandPalette,optional:[i.ISettingRegistry],activate:(e,t,a)=>D.activate(e,t,a)},X={id:"@jupyterlab/apputils-extension:palette-restorer",description:"Restores the command palette.",autoStart:!0,requires:[n.ILayoutRestorer,l.ITranslator],activate:(e,t,a)=>{D.restore(e,t,a)}},Z={id:"@jupyterlab/apputils-extension:resolver",description:"Provides the window name resolver.",autoStart:!0,provides:o.IWindowResolver,requires:[n.JupyterFrontEnd.IPaths,n.IRouter],activate:async(e,t,a)=>{const{hash:n,search:i}=a.current,r=s.URLExt.queryStringToObject(i||""),l=new o.WindowResolver,c=s.PageConfig.getOption("workspace"),d=s.PageConfig.getOption("treePath"),u="multiple-document"===s.PageConfig.getOption("mode")?"lab":"doc",m=c||s.PageConfig.defaultWorkspace,p=d?s.URLExt.join("tree",d):"";try{return await l.resolve(m),l}catch(e){return new Promise((()=>{const{base:e}=t.urls,o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(62*Math.random())];let i=s.URLExt.join(e,u,"workspaces",`auto-${o}`);i=p?s.URLExt.join(i,s.URLExt.encodeParts(p)):i,r.reset="";const l=i+s.URLExt.objectToQueryString(r)+(n||"");a.navigate(l,{hard:!0})}))}}},ee={id:"@jupyterlab/apputils-extension:splash",description:"Provides the splash screen.",autoStart:!0,requires:[l.ITranslator],provides:o.ISplashScreen,activate:(e,t)=>{const a=t.load("jupyterlab"),{commands:n,restored:s}=e,i=document.createElement("div"),r=document.createElement("div"),l=document.createElement("div");let d;i.id="jupyterlab-splash",r.id="galaxy",l.id="main-logo",c.jupyterFaviconIcon.element({container:l,stylesheet:"splash"}),r.appendChild(l),["1","2","3"].forEach((e=>{const t=document.createElement("div"),a=document.createElement("div");t.id=`moon${e}`,t.className="moon orbit",a.id=`planet${e}`,a.className="planet",t.appendChild(a),r.appendChild(t)})),i.appendChild(r);const p=new m.Throttler((async()=>{if(!d){d=new o.Dialog({title:a.__("Loading…"),body:a.__("The loading screen is taking a long time.\nWould you like to clear the workspace or keep waiting?"),buttons:[o.Dialog.cancelButton({label:a.__("Keep Waiting")}),o.Dialog.warnButton({label:a.__("Clear Workspace")})]});try{const e=await d.launch();if(d.dispose(),d=null,e.button.accept&&n.hasCommand(Y.reset))return n.execute(Y.reset);requestAnimationFrame((()=>{p.invoke().catch((e=>{}))}))}catch(e){}}}),{limit:12e3,edge:"trailing"});let h=0;return{show:(e=!0)=>(i.classList.remove("splash-fade"),i.classList.toggle("light",e),i.classList.toggle("dark",!e),h++,document.body.appendChild(i),p.invoke().catch((e=>{})),new u.DisposableDelegate((async()=>{await s,0==--h&&(p.stop(),d&&(d.dispose(),d=null),i.classList.add("splash-fade"),window.setTimeout((()=>{document.body.removeChild(i)}),200))})))}}},te={id:"@jupyterlab/apputils-extension:print",description:"Add the print capability",autoStart:!0,requires:[l.ITranslator],activate:(e,t)=>{var a;const n=t.load("jupyterlab");e.commands.addCommand(Y.print,{label:n.__("Print…"),isEnabled:()=>{const t=e.shell.currentWidget;return null!==o.Printing.getPrintFunction(t)},execute:async()=>{const t=e.shell.currentWidget,a=o.Printing.getPrintFunction(t);a&&await a()}}),null===(a=e.shell.currentChanged)||void 0===a||a.connect((()=>{e.commands.notifyCommandChanged(Y.print)}))}},ae={id:"@jupyterlab/apputils-extension:toggle-header",description:"Adds a command to display the main area widget content header.",autoStart:!0,requires:[l.ITranslator],optional:[o.ICommandPalette],activate:(e,t,a)=>{var n;const s=t.load("jupyterlab"),i=s.__("Main Area");e.commands.addCommand(Y.toggleHeader,{label:s.__("Show Header Above Content"),isEnabled:()=>e.shell.currentWidget instanceof o.MainAreaWidget&&!e.shell.currentWidget.contentHeader.isDisposed&&e.shell.currentWidget.contentHeader.widgets.length>0,isToggled:()=>{const t=e.shell.currentWidget;return t instanceof o.MainAreaWidget&&!t.contentHeader.isHidden},execute:async()=>{const t=e.shell.currentWidget;t instanceof o.MainAreaWidget&&t.contentHeader.setHidden(!t.contentHeader.isHidden)}}),null===(n=e.shell.currentChanged)||void 0===n||n.connect((()=>{e.commands.notifyCommandChanged(Y.toggleHeader)})),a&&a.addItem({command:Y.toggleHeader,category:i})}},ne={id:"@jupyterlab/apputils-extension:state",description:"Provides the application state. It is stored per workspaces.",autoStart:!0,provides:r.IStateDB,requires:[n.JupyterFrontEnd.IPaths,n.IRouter,l.ITranslator],optional:[o.IWindowResolver],activate:(e,t,a,n,o)=>{const i=n.load("jupyterlab");if(null===o)return new r.StateDB;let l=!1;const{commands:c,name:u,serviceManager:p}=e,{workspaces:h}=p,g=o.name,b=new d.PromiseDelegate,f=new r.StateDB({transform:b.promise}),y=new m.Debouncer((async()=>{const e=g,t={id:e},a=await f.toJSON();await h.save(e,{data:a,metadata:t})}));return f.changed.connect((()=>{y.invoke()}),f),f.changed.connect((()=>async function(e,t,a){var n,o;const i=await t.toJSON();if(void 0===(null===(o=null===(n=i["layout-restorer:data"])||void 0===n?void 0:n.main)||void 0===o?void 0:o.current))document.title=`${s.PageConfig.getOption("appName")||"JupyterLab"}${e.startsWith("auto-")?` (${e})`:""}`;else{let t=s.PathExt.basename(decodeURIComponent(window.location.href));t=t.length>15?t.slice(0,12).concat("…"):t;const n=Object.keys(i).filter((e=>e.startsWith("notebook")||e.startsWith("editor"))).length;e.startsWith("auto-")?document.title=`${t} (${e}${n>1?` : ${n}`:""}) - ${a}`:document.title=`${t}${n>1?` (${n})`:""} - ${a}`}}(g,f,u))),c.addCommand(Y.loadState,{label:i.__("Load state for the current workspace."),execute:async e=>{if(l)return;const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="string"==typeof i.clone?""===i.clone?s.PageConfig.defaultWorkspace:i.clone:null,c=r||g||null;if(null!==c){try{const e=await h.fetch(c);l||(l=!0,b.resolve({type:"overwrite",contents:e.data}))}catch({message:e}){console.warn(`Fetching workspace "${g}" failed.`,e),l||(l=!0,b.resolve({type:"cancel",contents:null}))}if(c===r){delete i.clone;const e=n+s.URLExt.objectToQueryString(i)+t,o=y.invoke().then((()=>a.stop));return o.then((()=>{a.navigate(e)})),o}await y.invoke()}else console.error(`${Y.loadState} cannot load null workspace.`)}}),c.addCommand(Y.reset,{label:i.__("Reset Application State"),execute:async({reload:e})=>{await f.clear(),await y.invoke(),e&&a.reload()}}),c.addCommand(Y.resetOnLoad,{label:i.__("Reset state when loading for the workspace."),execute:e=>{const{hash:t,path:n,search:o}=e,i=s.URLExt.queryStringToObject(o||""),r="clone"in i;if(!("reset"in i))return;if(l)return a.reload();l=!0,b.resolve({type:"clear",contents:null}),delete i.reset;const c=n+s.URLExt.objectToQueryString(i)+t,d=f.clear().then((()=>y.invoke()));return r?d.then((()=>{a.navigate(c,{hard:!0})})):d.then((()=>{a.navigate(c)})),d}}),a.register({command:Y.loadState,pattern:/.?/,rank:30}),a.register({command:Y.resetOnLoad,pattern:/(\?reset|\&reset)($|&)/,rank:20}),f}},oe={id:"@jupyterlab/apputils-extension:sessionDialogs",description:"Provides the session context dialogs.",provides:o.ISessionContextDialogs,optional:[l.ITranslator],autoStart:!0,activate:async(e,t)=>new o.SessionContextDialogs({translator:null!=t?t:l.nullTranslator})},se={id:"@jupyterlab/apputils-extension:utilityCommands",description:"Adds meta commands to run set of other commands.",requires:[l.ITranslator],optional:[o.ICommandPalette],autoStart:!0,activate:(e,t,a)=>{const n=t.load("jupyterlab"),{commands:s}=e;if(s.addCommand(Y.runFirstEnabled,{label:n.__("Run First Enabled Command"),execute:t=>{const a=t.commands,n=t.args,o=Array.isArray(t);for(let t=0;t<a.length;t++){const s=a[t],i=o?n[t]:n;if(e.commands.isEnabled(s,i))return e.commands.execute(s,i)}}}),s.addCommand(Y.runAllEnabled,{label:n.__("Run All Enabled Commands Passed as Args"),execute:async t=>{var a,n;const o=null!==(a=t.commands)&&void 0!==a?a:[],s=t.args,i=Array.isArray(t),r=null!==(n=t.errorIfNotEnabled)&&void 0!==n&&n;for(let t=0;t<o.length;t++){const a=o[t],n=i?s[t]:s;e.commands.isEnabled(a,n)?await e.commands.execute(a,n):r&&console.error(`${a} is not enabled.`)}},isEnabled:t=>{var a;const n=null!==(a=t.commands)&&void 0!==a?a:[],o=t.args,s=Array.isArray(t);return n.some(((t,a)=>e.commands.isEnabled(t,s?o[a]:o)))}}),s.addCommand(Y.displayShortcuts,{label:n.__("Show Keyboard Shortcuts…"),caption:n.__("Show relevant keyboard shortcuts for the current active widget"),execute:t=>{var a;const i=e.shell.currentWidget;if(!(null==i?void 0:i.node.contains(document.activeElement))&&i instanceof o.MainAreaWidget){const e=null!==(a=i.content.node)&&void 0!==a?a:null==i?void 0:i.node;null==e||e.focus()}return function(e){const{commands:t,trans:a,activeElement:n}=e,s=null!=n?n:document.activeElement;function i(e){const t=[];return e.forEach(((e,a)=>{const n=[];e.split(" ").forEach(((e,t)=>{n.push(w.createElement("span",{className:"jp-ContextualShortcut-Key",key:`ch-${t}`},w.createElement("kbd",null,e)),w.createElement(w.Fragment,{key:`fragment-${t}`}," + "))})),t.push(w.createElement("span",{key:`key-${a}`},n.slice(0,-1)),w.createElement(w.Fragment,{key:`fragment-${a}`}," + "))})),w.createElement("span",null,t.slice(0,-1))}function r(e){const a=t.label(e.command),n=e.command.split(":")[1].split("-");let o="";for(let e=0;e<n.length;e++)o=o+" "+((s=n[e]).charAt(0).toUpperCase()+s.slice(1));var s;return a.length>0?a:o}function l(e,t){let a=t;for(let t=0;null!==a&&a!==a.parentElement;a=a.parentElement,++t){if(a.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(a.matches(e))return t}return-1}const c=new Map;for(let e=0;e<t.keyBindings.length;e++){const a=t.keyBindings[e];let n=l(a.selector,s);if(n<0)continue;let o=P.CommandRegistry.formatKeystroke(a.keys);if(c.has(o)){let e=c.get(o);if(e[0]<n||e[0]===n&&V.Selector.calculateSpecificity(e[1].selector)>V.Selector.calculateSpecificity(a.selector))continue}c.set(o,[n,a])}let d=-1;const u=new Map;for(let[e,t]of c.values())d=Math.max(e,d),u.has(e)||u.set(e,[]),u.get(e).push(t);const m=[];for(let e=0;e<=d;e++)u.has(e)&&(m.push(u.get(e).map((e=>w.createElement("tr",{className:"jp-ContextualShortcut-TableRow",key:`${e.command}-${e.keys.join("-").replace(" ","_")}`},w.createElement("td",{className:Q},r(e)),w.createElement("td",{className:Q},i([...e.keys])))))),m.push(w.createElement("tr",{className:"jp-ContextualShortcut-TableLastRow",key:`group-${e}-last`})));const p=w.createElement("table",null,w.createElement("tbody",null,m));return(0,o.showDialog)({title:a.__("Keyboard Shortcuts"),body:p,buttons:[o.Dialog.cancelButton({label:a.__("Close")})]})}({commands:s,trans:n})}}),a){const e=n.__("Help");a.addItem({command:Y.displayShortcuts,category:e})}}},ie={id:"@jupyterlab/apputils-extension:sanitizer",description:"Provides the HTML sanitizer.",autoStart:!0,provides:o.ISanitizer,requires:[i.ISettingRegistry],activate:(e,t)=>{const a=new o.Sanitizer,n=e=>{const t=e.get("allowedSchemes").composite,n=e.get("autolink").composite;t&&a.setAllowedSchemes(t),a.setAutolink(n)};return t.load("@jupyterlab/apputils-extension:sanitizer").then((e=>{n(e),e.changed.connect(n)})).catch((e=>{console.error("Failed to load sanitizer settings:",e)})),a}},re=[f,A,j,G,X,te,Z,M,ie,R,ne,ee,oe,z,$,ae,W,se,J]},37634:(e,t,a)=>{var n=a(38005);t.s=n.createRoot,n.hydrateRoot}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5135],{45135:(e,t,i)=>{i.r(t),i.d(t,{INotebookPathOpener:()=>C,INotebookShell:()=>y,NotebookApp:()=>H,NotebookShell:()=>k,PanelHandler:()=>f,Private:()=>v,SidePanelHandler:()=>w,SidePanelPalette:()=>W,defaultNotebookPathOpener:()=>b});var s,n=i(94535),r=i(89945),a=i(75677),o=i(20389),d=i(65848),l=i(97934),h=i(70858),p=i(33625),g=i(20998),u=i(81997),c=i(63485),_=i(95291),m=i(49503);class f{constructor(){this._panelChildHook=(e,t)=>{if("child-removed"===t.type){const e=t.child;p.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}return!0},this._items=new Array,this._panel=new c.Panel,m.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(e,t){e.parent=null;const i={widget:e,rank:t},n=p.ArrayExt.upperBound(this._items,i,s.itemCmp);p.ArrayExt.insert(this._items,n,i),this._panel.insertWidget(n,e)}}class w extends f{constructor(e){super(),this._isHiddenByUser=!1,this._widgetAdded=new u.Signal(this),this._widgetRemoved=new u.Signal(this),this._area=e,this._panel.hide(),this._currentWidget=null,this._lastCurrentWidget=null,this._widgetPanel=new c.StackedPanel,this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._closeButton=document.createElement("button"),_.closeIcon.element({container:this._closeButton,height:"16px",width:"auto"}),this._closeButton.onclick=()=>{this.collapse(),this.hide()},this._closeButton.className="jp-Button jp-SidePanel-collapse",this._closeButton.title="Collapse side panel";const t=new c.Widget({node:this._closeButton});this._panel.addWidget(t),this._panel.addWidget(this._widgetPanel)}get currentWidget(){return this._currentWidget||this._lastCurrentWidget||(this._items.length>0?this._items[0].widget:null)}get area(){return this._area}get isVisible(){return this._panel.isVisible}get panel(){return this._panel}get widgets(){return this._items.map((e=>e.widget))}get widgetAdded(){return this._widgetAdded}get widgetRemoved(){return this._widgetRemoved}get closeButton(){return this._closeButton}expand(e){e?this._currentWidget&&this._currentWidget.id===e?(this.collapse(),this.hide()):(this.collapse(),this.hide(),this.activate(e),this.show()):this.currentWidget&&(this._currentWidget=this.currentWidget,this.activate(this._currentWidget.id),this.show())}activate(e){const t=this._findWidgetByID(e);t&&(this._currentWidget=t,t.show(),t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){var e;null===(e=this._currentWidget)||void 0===e||e.hide(),this._currentWidget=null}addWidget(e,t){e.parent=null,e.hide();const i={widget:e,rank:t},s=this._findInsertIndex(i);p.ArrayExt.insert(this._items,s,i),this._widgetPanel.insertWidget(s,e),this._refreshVisibility(),this._widgetAdded.emit(e)}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(e){return p.ArrayExt.upperBound(this._items,e,s.itemCmp)}_findWidgetIndex(e){return p.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByID(e){const t=(0,p.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._panel.setHidden(this._isHiddenByUser)}_onWidgetRemoved(e,t){t===this._lastCurrentWidget&&(this._lastCurrentWidget=null),p.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._refreshVisibility(),this._widgetRemoved.emit(t)}}class W{constructor(e){this._items=[],this._commandPalette=e.commandPalette,this._command=e.command}getItem(e,t){const i=this._items;for(let s=0;s<i.length;s++){const n=i[s];if(n.widgetId===e.id&&n.area===t)return n}return null}addItem(e,t){if(this.getItem(e,t))return;const i=this._commandPalette.addItem({command:this._command,category:"View",args:{side:t,title:`Show ${e.title.caption}`,id:e.id}});this._items.push({widgetId:e.id,area:t,disposable:i})}removeItem(e,t){const i=this.getItem(e,t);i&&i.disposable.dispose()}}!function(e){e.itemCmp=function(e,t){return e.rank-t.rank}}(s||(s={}));const y=new g.Token("@jupyter-notebook/application:INotebookShell");class k extends c.Widget{constructor(){super(),this._translator=h.nullTranslator,this._currentChanged=new u.Signal(this),this._mainWidgetLoaded=new g.PromiseDelegate,this.id="main",this._userLayout={},this._topHandler=new f,this._menuHandler=new f,this._leftHandler=new w("left"),this._rightHandler=new w("right"),this._main=new c.Panel;const e=this._topWrapper=new c.Panel,t=this._menuWrapper=new c.Panel;this._topHandler.panel.id="top-panel",this._topHandler.panel.node.setAttribute("role","banner"),this._menuHandler.panel.id="menu-panel",this._menuHandler.panel.node.setAttribute("role","navigation"),this._main.id="main-panel",this._main.node.setAttribute("role","main"),this._spacer_top=new c.Widget,this._spacer_top.id="spacer-widget-top",this._spacer_bottom=new c.Widget,this._spacer_bottom.id="spacer-widget-bottom",e.id="top-panel-wrapper",e.addWidget(this._topHandler.panel),t.id="menu-panel-wrapper",t.addWidget(this._menuHandler.panel);const i=new c.BoxLayout,s=this._leftHandler,n=this._rightHandler;s.panel.id="jp-left-stack",s.panel.node.setAttribute("role","complementary"),n.panel.id="jp-right-stack",n.panel.node.setAttribute("role","complementary"),s.hide(),n.hide();const r=new c.BoxLayout({spacing:0,direction:"top-to-bottom"});c.BoxLayout.setStretch(this._topWrapper,0),c.BoxLayout.setStretch(this._menuWrapper,0),c.BoxLayout.setStretch(this._main,1);const a=new c.Panel({layout:r});a.addWidget(this._topWrapper),a.addWidget(this._menuWrapper),a.addWidget(this._spacer_top),a.addWidget(this._main),a.addWidget(this._spacer_bottom),a.layout=r;const o=new c.SplitPanel;o.id="main-split-panel",o.spacing=1,c.BoxLayout.setStretch(o,1),c.SplitPanel.setStretch(s.panel,0),c.SplitPanel.setStretch(n.panel,0),c.SplitPanel.setStretch(a,1),o.addWidget(s.panel),o.addWidget(a),o.addWidget(n.panel),o.setRelativeSizes([1,2.5,1]),i.spacing=0,i.addWidget(o),this.layout=i;const d=this._skipLinkWidgetHandler=new v.SkipLinkWidgetHandler(this);this.add(d.skipLinkWidget,"top",{rank:0}),this._skipLinkWidgetHandler.show()}get currentChanged(){return this._currentChanged}get currentWidget(){var e;return null!==(e=this._main.widgets[0])&&void 0!==e?e:null}get top(){return this._topWrapper}get menu(){return this._menuWrapper}get leftHandler(){return this._leftHandler}get rightHandler(){return this._rightHandler}get leftCollapsed(){return!(this._leftHandler.isVisible&&this._leftHandler.panel.isVisible)}get rightCollapsed(){return!(this._rightHandler.isVisible&&this._rightHandler.panel.isVisible)}get restored(){return this._mainWidgetLoaded.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:h.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e;const t=e.load("notebook");this._leftHandler.closeButton.title=t.__("Collapse %1 side panel",this._leftHandler.area),this._rightHandler.closeButton.title=t.__("Collapse %1 side panel",this._rightHandler.area)}}get userLayout(){return g.JSONExt.deepCopy(this._userLayout)}activateById(e){for(const t of["main","top","left","right","menu"]){const i=(0,p.find)(this.widgets(t),(t=>t.id===e));i&&("left"===t?this.expandLeft(e):"right"===t?this.expandRight(e):i.activate())}}add(e,t,i){var s,n;let r;r=(null==i?void 0:i.type)&&this._userLayout[i.type]?this._userLayout[i.type]:this._userLayout[e.id],t=null!==(s=null==r?void 0:r.area)&&void 0!==s?s:t;const a=null!==(n=null==(i=i||(null==r?void 0:r.options)?{...i,...null==r?void 0:r.options}:void 0)?void 0:i.rank)&&void 0!==n?n:900;switch(t){case"top":return this._topHandler.addWidget(e,a);case"menu":return this._menuHandler.addWidget(e,a);case"main":case void 0:{if(this._main.widgets.length>0)return;const t=this.currentWidget;this._main.addWidget(e),this._main.update(),this._currentChanged.emit({newValue:e,oldValue:t}),this._mainWidgetLoaded.resolve();break}case"left":return this._leftHandler.addWidget(e,a);case"right":return this._rightHandler.addWidget(e,a);default:console.warn(`Cannot add widget to area: ${t}`)}}collapseTop(){this._topWrapper.setHidden(!0),this._spacer_top.setHidden(!0)}expandTop(){this._topWrapper.setHidden(!1),this._spacer_top.setHidden(!1)}*widgets(e){switch(null!=e?e:"main"){case"top":return void(yield*this._topHandler.panel.widgets);case"menu":return void(yield*this._menuHandler.panel.widgets);case"main":return void(yield*this._main.widgets);case"left":return void(yield*this._leftHandler.widgets);case"right":return void(yield*this._rightHandler.widgets);default:return void console.error(`This shell has no area called "${e}"`)}}expandLeft(e){this._leftHandler.panel.show(),this._leftHandler.expand(e)}collapseLeft(){this._leftHandler.collapse(),this._leftHandler.panel.hide()}expandRight(e){this._rightHandler.panel.show(),this._rightHandler.expand(e)}collapseRight(){this._rightHandler.collapse(),this._rightHandler.panel.hide()}async restoreLayout(e){this._userLayout=e}}var v,P;!function(e){e.SkipLinkWidgetHandler=class{constructor(e){this._isDisposed=!1;const t=this._skipLinkWidget=new c.Widget,i=document.createElement("a");i.href="#first-cell",i.tabIndex=1,i.text="Skip to Main",i.className="skip-link",i.addEventListener("click",this),t.addClass("jp-skiplink"),t.id="jp-skiplink",t.node.appendChild(i)}handleEvent(e){"click"===e.type&&this._focusMain()}_focusMain(){const e=document.querySelector("#main-panel .jp-InputArea-editor");e.tabIndex=1,e.focus()}get skipLinkWidget(){return this._skipLinkWidget}dispose(){this.isDisposed||(this._isDisposed=!0,this._skipLinkWidget.node.removeEventListener("click",this),this._skipLinkWidget.dispose())}hide(){this._skipLinkWidget.hide()}show(){this._skipLinkWidget.show()}get isDisposed(){return this._isDisposed}}}(v||(v={}));class H extends n.JupyterFrontEnd{constructor(e={shell:new k}){var t,i;if(super({...e,shell:null!==(t=e.shell)&&void 0!==t?t:new k}),this.name="Jupyter Notebook",this.namespace=this.name,this.status=new o.J(this),this.version=null!==(i=d.PageConfig.getOption("appVersion"))&&void 0!==i?i:"unknown",this._info=n.JupyterLab.defaultInfo,this._formatter=new l.Throttler((()=>{P.setFormat(this)}),250),this.docRegistry.addModelFactory(new r.Base64ModelFactory),e.mimeExtensions)for(const t of(0,a.as)(e.mimeExtensions))this.registerPlugin(t);const s=Object.keys(n.JupyterLab.defaultInfo).reduce(((t,i)=>(i in e&&(t[i]=JSON.parse(JSON.stringify(e[i]))),t)),{});this._info={...n.JupyterLab.defaultInfo,...s},this.restored=this.shell.restored,this.restored.then((()=>this._formatter.invoke()))}get info(){return this._info}get paths(){return{urls:{base:d.PageConfig.getOption("baseUrl"),notFound:d.PageConfig.getOption("notFoundUrl"),app:d.PageConfig.getOption("appUrl"),static:d.PageConfig.getOption("staticUrl"),settings:d.PageConfig.getOption("settingsUrl"),themes:d.PageConfig.getOption("themesUrl"),doc:d.PageConfig.getOption("docUrl"),translations:d.PageConfig.getOption("translationsApiUrl"),hubHost:d.PageConfig.getOption("hubHost")||void 0,hubPrefix:d.PageConfig.getOption("hubPrefix")||void 0,hubUser:d.PageConfig.getOption("hubUser")||void 0,hubServerName:d.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:d.PageConfig.getOption("appSettingsDir"),schemas:d.PageConfig.getOption("schemasDir"),static:d.PageConfig.getOption("staticDir"),templates:d.PageConfig.getOption("templatesDir"),themes:d.PageConfig.getOption("themesDir"),userSettings:d.PageConfig.getOption("userSettingsDir"),serverRoot:d.PageConfig.getOption("serverRoot"),workspaces:d.PageConfig.getOption("workspacesDir")}}}handleEvent(e){super.handleEvent(e),"resize"===e.type&&this._formatter.invoke()}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}!function(e){e.setFormat=function(e){e.format=window.matchMedia("only screen and (max-width: 760px)").matches?"mobile":"desktop"}}(P||(P={}));const b=new class{open(e){const{prefix:t,path:i,searchParams:s,target:n,features:r}=e,a=new URL(d.URLExt.join(t,null!=i?i:""),window.location.origin);return s&&(a.search=s.toString()),window.open(a,n,r)}},C=new g.Token("@jupyter-notebook/application:INotebookPathOpener")}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5135],{45135:(e,t,i)=>{i.r(t),i.d(t,{INotebookPathOpener:()=>C,INotebookShell:()=>y,NotebookApp:()=>H,NotebookShell:()=>k,PanelHandler:()=>f,Private:()=>v,SidePanelHandler:()=>w,SidePanelPalette:()=>W,defaultNotebookPathOpener:()=>b});var s,n=i(27961),r=i(71120),a=i(75677),o=i(20389),d=i(44548),l=i(97934),h=i(25291),p=i(33625),g=i(20998),u=i(81997),c=i(63485),_=i(12668),m=i(49503);class f{constructor(){this._panelChildHook=(e,t)=>{if("child-removed"===t.type){const e=t.child;p.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}return!0},this._items=new Array,this._panel=new c.Panel,m.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(e,t){e.parent=null;const i={widget:e,rank:t},n=p.ArrayExt.upperBound(this._items,i,s.itemCmp);p.ArrayExt.insert(this._items,n,i),this._panel.insertWidget(n,e)}}class w extends f{constructor(e){super(),this._isHiddenByUser=!1,this._widgetAdded=new u.Signal(this),this._widgetRemoved=new u.Signal(this),this._area=e,this._panel.hide(),this._currentWidget=null,this._lastCurrentWidget=null,this._widgetPanel=new c.StackedPanel,this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._closeButton=document.createElement("button"),_.closeIcon.element({container:this._closeButton,height:"16px",width:"auto"}),this._closeButton.onclick=()=>{this.collapse(),this.hide()},this._closeButton.className="jp-Button jp-SidePanel-collapse",this._closeButton.title="Collapse side panel";const t=new c.Widget({node:this._closeButton});this._panel.addWidget(t),this._panel.addWidget(this._widgetPanel)}get currentWidget(){return this._currentWidget||this._lastCurrentWidget||(this._items.length>0?this._items[0].widget:null)}get area(){return this._area}get isVisible(){return this._panel.isVisible}get panel(){return this._panel}get widgets(){return this._items.map((e=>e.widget))}get widgetAdded(){return this._widgetAdded}get widgetRemoved(){return this._widgetRemoved}get closeButton(){return this._closeButton}expand(e){e?this._currentWidget&&this._currentWidget.id===e?(this.collapse(),this.hide()):(this.collapse(),this.hide(),this.activate(e),this.show()):this.currentWidget&&(this._currentWidget=this.currentWidget,this.activate(this._currentWidget.id),this.show())}activate(e){const t=this._findWidgetByID(e);t&&(this._currentWidget=t,t.show(),t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){var e;null===(e=this._currentWidget)||void 0===e||e.hide(),this._currentWidget=null}addWidget(e,t){e.parent=null,e.hide();const i={widget:e,rank:t},s=this._findInsertIndex(i);p.ArrayExt.insert(this._items,s,i),this._widgetPanel.insertWidget(s,e),this._refreshVisibility(),this._widgetAdded.emit(e)}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(e){return p.ArrayExt.upperBound(this._items,e,s.itemCmp)}_findWidgetIndex(e){return p.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByID(e){const t=(0,p.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._panel.setHidden(this._isHiddenByUser)}_onWidgetRemoved(e,t){t===this._lastCurrentWidget&&(this._lastCurrentWidget=null),p.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._refreshVisibility(),this._widgetRemoved.emit(t)}}class W{constructor(e){this._items=[],this._commandPalette=e.commandPalette,this._command=e.command}getItem(e,t){const i=this._items;for(let s=0;s<i.length;s++){const n=i[s];if(n.widgetId===e.id&&n.area===t)return n}return null}addItem(e,t){if(this.getItem(e,t))return;const i=this._commandPalette.addItem({command:this._command,category:"View",args:{side:t,title:`Show ${e.title.caption}`,id:e.id}});this._items.push({widgetId:e.id,area:t,disposable:i})}removeItem(e,t){const i=this.getItem(e,t);i&&i.disposable.dispose()}}!function(e){e.itemCmp=function(e,t){return e.rank-t.rank}}(s||(s={}));const y=new g.Token("@jupyter-notebook/application:INotebookShell");class k extends c.Widget{constructor(){super(),this._translator=h.nullTranslator,this._currentChanged=new u.Signal(this),this._mainWidgetLoaded=new g.PromiseDelegate,this.id="main",this._userLayout={},this._topHandler=new f,this._menuHandler=new f,this._leftHandler=new w("left"),this._rightHandler=new w("right"),this._main=new c.Panel;const e=this._topWrapper=new c.Panel,t=this._menuWrapper=new c.Panel;this._topHandler.panel.id="top-panel",this._topHandler.panel.node.setAttribute("role","banner"),this._menuHandler.panel.id="menu-panel",this._menuHandler.panel.node.setAttribute("role","navigation"),this._main.id="main-panel",this._main.node.setAttribute("role","main"),this._spacer_top=new c.Widget,this._spacer_top.id="spacer-widget-top",this._spacer_bottom=new c.Widget,this._spacer_bottom.id="spacer-widget-bottom",e.id="top-panel-wrapper",e.addWidget(this._topHandler.panel),t.id="menu-panel-wrapper",t.addWidget(this._menuHandler.panel);const i=new c.BoxLayout,s=this._leftHandler,n=this._rightHandler;s.panel.id="jp-left-stack",s.panel.node.setAttribute("role","complementary"),n.panel.id="jp-right-stack",n.panel.node.setAttribute("role","complementary"),s.hide(),n.hide();const r=new c.BoxLayout({spacing:0,direction:"top-to-bottom"});c.BoxLayout.setStretch(this._topWrapper,0),c.BoxLayout.setStretch(this._menuWrapper,0),c.BoxLayout.setStretch(this._main,1);const a=new c.Panel({layout:r});a.addWidget(this._topWrapper),a.addWidget(this._menuWrapper),a.addWidget(this._spacer_top),a.addWidget(this._main),a.addWidget(this._spacer_bottom),a.layout=r;const o=new c.SplitPanel;o.id="main-split-panel",o.spacing=1,c.BoxLayout.setStretch(o,1),c.SplitPanel.setStretch(s.panel,0),c.SplitPanel.setStretch(n.panel,0),c.SplitPanel.setStretch(a,1),o.addWidget(s.panel),o.addWidget(a),o.addWidget(n.panel),o.setRelativeSizes([1,2.5,1]),i.spacing=0,i.addWidget(o),this.layout=i;const d=this._skipLinkWidgetHandler=new v.SkipLinkWidgetHandler(this);this.add(d.skipLinkWidget,"top",{rank:0}),this._skipLinkWidgetHandler.show()}get currentChanged(){return this._currentChanged}get currentWidget(){var e;return null!==(e=this._main.widgets[0])&&void 0!==e?e:null}get top(){return this._topWrapper}get menu(){return this._menuWrapper}get leftHandler(){return this._leftHandler}get rightHandler(){return this._rightHandler}get leftCollapsed(){return!(this._leftHandler.isVisible&&this._leftHandler.panel.isVisible)}get rightCollapsed(){return!(this._rightHandler.isVisible&&this._rightHandler.panel.isVisible)}get restored(){return this._mainWidgetLoaded.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:h.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e;const t=e.load("notebook");this._leftHandler.closeButton.title=t.__("Collapse %1 side panel",this._leftHandler.area),this._rightHandler.closeButton.title=t.__("Collapse %1 side panel",this._rightHandler.area)}}get userLayout(){return g.JSONExt.deepCopy(this._userLayout)}activateById(e){for(const t of["main","top","left","right","menu"]){const i=(0,p.find)(this.widgets(t),(t=>t.id===e));i&&("left"===t?this.expandLeft(e):"right"===t?this.expandRight(e):i.activate())}}add(e,t,i){var s,n;let r;r=(null==i?void 0:i.type)&&this._userLayout[i.type]?this._userLayout[i.type]:this._userLayout[e.id],t=null!==(s=null==r?void 0:r.area)&&void 0!==s?s:t;const a=null!==(n=null==(i=i||(null==r?void 0:r.options)?{...i,...null==r?void 0:r.options}:void 0)?void 0:i.rank)&&void 0!==n?n:900;switch(t){case"top":return this._topHandler.addWidget(e,a);case"menu":return this._menuHandler.addWidget(e,a);case"main":case void 0:{if(this._main.widgets.length>0)return;const t=this.currentWidget;this._main.addWidget(e),this._main.update(),this._currentChanged.emit({newValue:e,oldValue:t}),this._mainWidgetLoaded.resolve();break}case"left":return this._leftHandler.addWidget(e,a);case"right":return this._rightHandler.addWidget(e,a);default:console.warn(`Cannot add widget to area: ${t}`)}}collapseTop(){this._topWrapper.setHidden(!0),this._spacer_top.setHidden(!0)}expandTop(){this._topWrapper.setHidden(!1),this._spacer_top.setHidden(!1)}*widgets(e){switch(null!=e?e:"main"){case"top":return void(yield*this._topHandler.panel.widgets);case"menu":return void(yield*this._menuHandler.panel.widgets);case"main":return void(yield*this._main.widgets);case"left":return void(yield*this._leftHandler.widgets);case"right":return void(yield*this._rightHandler.widgets);default:return void console.error(`This shell has no area called "${e}"`)}}expandLeft(e){this._leftHandler.panel.show(),this._leftHandler.expand(e)}collapseLeft(){this._leftHandler.collapse(),this._leftHandler.panel.hide()}expandRight(e){this._rightHandler.panel.show(),this._rightHandler.expand(e)}collapseRight(){this._rightHandler.collapse(),this._rightHandler.panel.hide()}async restoreLayout(e){this._userLayout=e}}var v,P;!function(e){e.SkipLinkWidgetHandler=class{constructor(e){this._isDisposed=!1;const t=this._skipLinkWidget=new c.Widget,i=document.createElement("a");i.href="#first-cell",i.tabIndex=1,i.text="Skip to Main",i.className="skip-link",i.addEventListener("click",this),t.addClass("jp-skiplink"),t.id="jp-skiplink",t.node.appendChild(i)}handleEvent(e){"click"===e.type&&this._focusMain()}_focusMain(){const e=document.querySelector("#main-panel .jp-InputArea-editor");e.tabIndex=1,e.focus()}get skipLinkWidget(){return this._skipLinkWidget}dispose(){this.isDisposed||(this._isDisposed=!0,this._skipLinkWidget.node.removeEventListener("click",this),this._skipLinkWidget.dispose())}hide(){this._skipLinkWidget.hide()}show(){this._skipLinkWidget.show()}get isDisposed(){return this._isDisposed}}}(v||(v={}));class H extends n.JupyterFrontEnd{constructor(e={shell:new k}){var t,i;if(super({...e,shell:null!==(t=e.shell)&&void 0!==t?t:new k}),this.name="Jupyter Notebook",this.namespace=this.name,this.status=new o.J(this),this.version=null!==(i=d.PageConfig.getOption("appVersion"))&&void 0!==i?i:"unknown",this._info=n.JupyterLab.defaultInfo,this._formatter=new l.Throttler((()=>{P.setFormat(this)}),250),this.docRegistry.addModelFactory(new r.Base64ModelFactory),e.mimeExtensions)for(const t of(0,a.as)(e.mimeExtensions))this.registerPlugin(t);const s=Object.keys(n.JupyterLab.defaultInfo).reduce(((t,i)=>(i in e&&(t[i]=JSON.parse(JSON.stringify(e[i]))),t)),{});this._info={...n.JupyterLab.defaultInfo,...s},this.restored=this.shell.restored,this.restored.then((()=>this._formatter.invoke()))}get info(){return this._info}get paths(){return{urls:{base:d.PageConfig.getOption("baseUrl"),notFound:d.PageConfig.getOption("notFoundUrl"),app:d.PageConfig.getOption("appUrl"),static:d.PageConfig.getOption("staticUrl"),settings:d.PageConfig.getOption("settingsUrl"),themes:d.PageConfig.getOption("themesUrl"),doc:d.PageConfig.getOption("docUrl"),translations:d.PageConfig.getOption("translationsApiUrl"),hubHost:d.PageConfig.getOption("hubHost")||void 0,hubPrefix:d.PageConfig.getOption("hubPrefix")||void 0,hubUser:d.PageConfig.getOption("hubUser")||void 0,hubServerName:d.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:d.PageConfig.getOption("appSettingsDir"),schemas:d.PageConfig.getOption("schemasDir"),static:d.PageConfig.getOption("staticDir"),templates:d.PageConfig.getOption("templatesDir"),themes:d.PageConfig.getOption("themesDir"),userSettings:d.PageConfig.getOption("userSettingsDir"),serverRoot:d.PageConfig.getOption("serverRoot"),workspaces:d.PageConfig.getOption("workspacesDir")}}}handleEvent(e){super.handleEvent(e),"resize"===e.type&&this._formatter.invoke()}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}!function(e){e.setFormat=function(e){e.format=window.matchMedia("only screen and (max-width: 760px)").matches?"mobile":"desktop"}}(P||(P={}));const b=new class{open(e){const{prefix:t,path:i,searchParams:s,target:n,features:r}=e,a=new URL(d.URLExt.join(t,null!=i?i:""),window.location.origin);return s&&(a.search=s.toString()),window.open(a,n,r)}},C=new g.Token("@jupyter-notebook/application:INotebookPathOpener")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5254],{95254:(e,a,t)=>{t.r(a),t.d(a,{default:()=>i});var r=t(72703),s=t(70858);const i={id:"@jupyterlab/theme-dark-high-contrast-extension:plugin",description:"Adds a dark high contrast theme.",requires:[r.IThemeManager,s.ITranslator],activate:(e,a,t)=>{const r=t.load("jupyterlab");a.register({name:"JupyterLab Dark High Contrast",displayName:r.__("JupyterLab Dark High Contrast"),isLight:!1,themeScrollbars:!0,load:()=>a.loadCSS("@jupyterlab/theme-dark-high-contrast-extension/index.css"),unload:()=>Promise.resolve(void 0)})},autoStart:!0}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5254],{95254:(e,a,t)=>{t.r(a),t.d(a,{default:()=>i});var r=t(15465),s=t(25291);const i={id:"@jupyterlab/theme-dark-high-contrast-extension:plugin",description:"Adds a dark high contrast theme.",requires:[r.IThemeManager,s.ITranslator],activate:(e,a,t)=>{const r=t.load("jupyterlab");a.register({name:"JupyterLab Dark High Contrast",displayName:r.__("JupyterLab Dark High Contrast"),isLight:!1,themeScrollbars:!0,load:()=>a.loadCSS("@jupyterlab/theme-dark-high-contrast-extension/index.css"),unload:()=>Promise.resolve(void 0)})},autoStart:!0}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5261],{25261:(e,t,r)=>{r.r(t),r.d(t,{RegExpCursor:()=>u,SearchCursor:()=>l,SearchQuery:()=>W,closeSearchPanel:()=>ae,findNext:()=>G,findPrevious:()=>H,getSearchQuery:()=>_,gotoLine:()=>y,highlightSelectionMatches:()=>C,openSearchPanel:()=>se,replaceAll:()=>te,replaceNext:()=>ee,search:()=>A,searchKeymap:()=>le,searchPanelOpen:()=>N,selectMatches:()=>X,selectNextOccurrence:()=>L,selectSelectionMatches:()=>Z,setSearchQuery:()=>$});var i=r(62695),n=r(89843);function o(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,r=arguments[1];if(r&&"object"==typeof r&&null==r.nodeType&&!Array.isArray(r)){for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=r[i];"string"==typeof n?e.setAttribute(i,n):null!=n&&(e[i]=n)}t++}for(;t<arguments.length;t++)s(e,arguments[t]);return e}function s(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var r=0;r<t.length;r++)s(e,t[r])}}const a="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class l{constructor(e,t,r=0,i=e.length,n,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=n?e=>n(a(e)):a,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return(0,n.codePointAt)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=(0,n.fromCodePoint)(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=(0,n.codePointSize)(e);let i=this.normalize(t);for(let e=0,n=r;;e++){let o=i.charCodeAt(e),s=this.match(o,n,this.bufferPos+this.bufferStart);if(e==i.length-1){if(s)return this.value=s,this;break}n==r&&e<t.length&&t.charCodeAt(e)==o&&n++}}}match(e,t,r){let i=null;for(let t=0;t<this.matches.length;t+=2){let n=this.matches[t],o=!1;this.query.charCodeAt(n)==e&&(n==this.query.length-1?i={from:this.matches[t+1],to:r}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?i={from:t,to:r}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}"undefined"!=typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this});const c={from:-1,to:-1,match:/.*/.exec("")},h="gm"+(null==/x/.unicode?"":"u");class u{constructor(e,t,r,i=0,n=e.length){if(this.text=e,this.to=n,this.curLine="",this.done=!1,this.value=c,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new m(e,t,r,i,n);this.re=new RegExp(t,h+((null==r?void 0:r.ignoreCase)?"i":"")),this.test=null==r?void 0:r.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=p(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=p(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const f=new WeakMap;class d{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=f.get(e);if(!i||i.from>=r||i.to<=t){let i=new d(t,e.sliceString(t,r));return f.set(e,i),i}if(i.from==t&&i.to==r)return i;let{text:n,from:o}=i;return o>t&&(n=e.sliceString(t,o)+n,o=t),i.to<r&&(n+=e.sliceString(i.to,r)),f.set(e,new d(o,n)),new d(t,n.slice(t-o,r-o))}}class m{constructor(e,t,r,i,n){this.text=e,this.to=n,this.done=!1,this.value=c,this.matchPos=p(e,i),this.re=new RegExp(t,h+((null==r?void 0:r.ignoreCase)?"i":"")),this.test=null==r?void 0:r.test,this.flat=d.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,r=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,r,t)))return this.value={from:e,to:r,match:t},this.matchPos=p(this.text,r+(e==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=d.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function p(e,t){if(t>=e.length)return t;let r,i=e.lineAt(t);for(;t<i.to&&(r=i.text.charCodeAt(t-i.from))>=56320&&r<57344;)t++;return t}function g(e){let t=o("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function r(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=e,s=o.doc.lineAt(o.selection.main.head),[,a,l,c,h]=r,u=c?+c.slice(1):0,f=l?+l:s.number;if(l&&h){let e=f/100;a&&(e=e*("-"==a?-1:1)+s.number/o.doc.lines),f=Math.round(o.doc.lines*e)}else l&&a&&(f=f*("-"==a?-1:1)+s.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,f))),m=n.EditorSelection.cursor(d.from+Math.max(0,Math.min(u,d.length)));e.dispatch({effects:[v.of(!1),i.EditorView.scrollIntoView(m.from,{y:"center"})],selection:m}),e.focus()}return{dom:o("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:v.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},o("label",e.state.phrase("Go to line"),": ",t)," ",o("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(u.prototype[Symbol.iterator]=m.prototype[Symbol.iterator]=function(){return this});const v=n.StateEffect.define(),x=n.StateField.define({create:()=>!0,update(e,t){for(let r of t.effects)r.is(v)&&(e=r.value);return e},provide:e=>i.showPanel.from(e,(e=>e?g:null))}),y=e=>{let t=(0,i.getPanel)(e,g);if(!t){let r=[v.of(!0)];null==e.state.field(x,!1)&&r.push(n.StateEffect.appendConfig.of([x,w])),e.dispatch({effects:r}),t=(0,i.getPanel)(e,g)}return t&&t.dom.querySelector("input").select(),!0},w=i.EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),S={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},b=n.Facet.define({combine:e=>(0,n.combineConfig)(e,S,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function C(e){let t=[q,D];return e&&t.push(b.of(e)),t}const k=i.Decoration.mark({class:"cm-selectionMatch"}),M=i.Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function E(e,t,r,i){return!(0!=r&&e(t.sliceDoc(r-1,r))==n.CharCategory.Word||i!=t.doc.length&&e(t.sliceDoc(i,i+1))==n.CharCategory.Word)}const D=i.ViewPlugin.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(b),{state:r}=e,o=r.selection;if(o.ranges.length>1)return i.Decoration.none;let s,a=o.main,c=null;if(a.empty){if(!t.highlightWordAroundCursor)return i.Decoration.none;let e=r.wordAt(a.head);if(!e)return i.Decoration.none;c=r.charCategorizer(a.head),s=r.sliceDoc(e.from,e.to)}else{let e=a.to-a.from;if(e<t.minSelectionLength||e>200)return i.Decoration.none;if(t.wholeWords){if(s=r.sliceDoc(a.from,a.to),c=r.charCategorizer(a.head),!E(c,r,a.from,a.to)||!function(e,t,r,i){return e(t.sliceDoc(r,r+1))==n.CharCategory.Word&&e(t.sliceDoc(i-1,i))==n.CharCategory.Word}(c,r,a.from,a.to))return i.Decoration.none}else if(s=r.sliceDoc(a.from,a.to),!s)return i.Decoration.none}let h=[];for(let n of e.visibleRanges){let e=new l(r.doc,s,n.from,n.to);for(;!e.next().done;){let{from:n,to:o}=e.value;if((!c||E(c,r,n,o))&&(a.empty&&n<=a.from&&o>=a.to?h.push(M.range(n,o)):(n>=a.to||o<=a.from)&&h.push(k.range(n,o)),h.length>t.maxMatches))return i.Decoration.none}}return i.Decoration.set(h)}},{decorations:e=>e.decorations}),q=i.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),L=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:r}=e,i=n.EditorSelection.create(r.ranges.map((t=>e.wordAt(t.head)||n.EditorSelection.cursor(t.head))),r.mainIndex);return!i.eq(r)&&(t(e.update({selection:i})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let s=function(e,t){let{main:r,ranges:i}=e.selection,n=e.wordAt(r.head),o=n&&n.from==r.from&&n.to==r.to;for(let r=!1,n=new l(e.doc,t,i[i.length-1].to);;){if(n.next(),!n.done){if(r&&i.some((e=>e.from==n.value.from)))continue;if(o){let t=e.wordAt(n.value.from);if(!t||t.from!=n.value.from||t.to!=n.value.to)continue}return n.value}if(r)return null;n=new l(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),r=!0}}(e,o);return!!s&&(t(e.update({selection:e.selection.addRange(n.EditorSelection.range(s.from,s.to),!1),effects:i.EditorView.scrollIntoView(s.to)})),!0)},P=n.Facet.define({combine:e=>(0,n.combineConfig)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ce(e),scrollToMatch:e=>i.EditorView.scrollIntoView(e)})});function A(e){return e?[P.of(e),pe]:pe}class W{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,h),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new z(this):new T(this)}getCursor(e,t=0,r){let i=e.doc?e:n.EditorState.create({doc:e});return null==r&&(r=i.doc.length),this.regexp?O(this,i,t,r):R(this,i,t,r)}}class F{constructor(e){this.spec=e}}function R(e,t,r,i){return new l(t.doc,e.unquoted,r,i,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(o=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,r,i)=>((i>e||i+r.length<t)&&(i=Math.max(0,e-2),r=o.sliceString(i,Math.min(o.length,t+2))),!(s(V(r,e-i))==n.CharCategory.Word&&s(I(r,e-i))==n.CharCategory.Word||s(I(r,t-i))==n.CharCategory.Word&&s(V(r,t-i))==n.CharCategory.Word))):void 0);var o,s}class T extends F{constructor(e){super(e)}nextMatch(e,t,r){let i=R(this.spec,e,r,e.doc.length).nextOverlapping();return i.done&&(i=R(this.spec,e,0,t).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let r=Math.max(t,i-1e4-this.spec.unquoted.length),n=R(this.spec,e,r,i),o=null;for(;!n.nextOverlapping().done;)o=n.value;if(o)return o;if(r==t)return null;i-=1e4}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=R(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let n=R(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!n.next().done;)i(n.value.from,n.value.to)}}function O(e,t,r,i){return new u(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(o=t.charCategorizer(t.selection.main.head),(e,t,r)=>!r[0].length||(o(V(r.input,r.index))!=n.CharCategory.Word||o(I(r.input,r.index))!=n.CharCategory.Word)&&(o(I(r.input,r.index+r[0].length))!=n.CharCategory.Word||o(V(r.input,r.index+r[0].length))!=n.CharCategory.Word)):void 0},r,i);var o}function V(e,t){return e.slice((0,n.findClusterBreak)(e,t,!1),t)}function I(e,t){return e.slice(t,(0,n.findClusterBreak)(e,t))}class z extends F{nextMatch(e,t,r){let i=O(this.spec,e,r,e.doc.length).next();return i.done&&(i=O(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let n=Math.max(t,r-1e4*i),o=O(this.spec,e,n,r),s=null;for(;!o.next().done;)s=o.value;if(s&&(n==t||s.from>n+10))return s;if(n==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,r)=>"$"==r?"$":"&"==r?e.match[0]:"0"!=r&&+r<e.match.length?e.match[r]:t))}matchAll(e,t){let r=O(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let n=O(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!n.next().done;)i(n.value.from,n.value.to)}}const $=n.StateEffect.define(),U=n.StateEffect.define(),B=n.StateField.define({create:e=>new Q(ie(e).create(),null),update(e,t){for(let r of t.effects)r.is($)?e=new Q(r.value.create(),e.panel):r.is(U)&&(e=new Q(e.query,r.value?re:null));return e},provide:e=>i.showPanel.from(e,(e=>e.panel))});function _(e){let t=e.field(B,!1);return t?t.query.spec:ie(e)}function N(e){var t;return null!=(null===(t=e.field(B,!1))||void 0===t?void 0:t.panel)}class Q{constructor(e,t){this.query=e,this.panel=t}}const K=i.Decoration.mark({class:"cm-searchMatch"}),j=i.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),J=i.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(B))}update(e){let t=e.state.field(B);(t!=e.startState.field(B)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return i.Decoration.none;let{view:r}=this,o=new n.RangeSetBuilder;for(let t=0,i=r.visibleRanges,n=i.length;t<n;t++){let{from:s,to:a}=i[t];for(;t<n-1&&a>i[t+1].from-500;)a=i[++t].to;e.highlight(r.state,s,a,((e,t)=>{let i=r.state.selection.ranges.some((r=>r.from==e&&r.to==t));o.add(e,t,i?j:K)}))}return o.finish()}},{decorations:e=>e.decorations});function Y(e){return t=>{let r=t.state.field(B,!1);return r&&r.query.spec.valid?e(t,r):se(t)}}const G=Y(((e,{query:t})=>{let{to:r}=e.state.selection.main,i=t.nextMatch(e.state,r,r);if(!i)return!1;let o=n.EditorSelection.single(i.from,i.to),s=e.state.facet(P);return e.dispatch({selection:o,effects:[de(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),oe(e),!0})),H=Y(((e,{query:t})=>{let{state:r}=e,{from:i}=r.selection.main,o=t.prevMatch(r,i,i);if(!o)return!1;let s=n.EditorSelection.single(o.from,o.to),a=e.state.facet(P);return e.dispatch({selection:s,effects:[de(e,o),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),oe(e),!0})),X=Y(((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!(!r||!r.length||(e.dispatch({selection:n.EditorSelection.create(r.map((e=>n.EditorSelection.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),Z=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:i,to:o}=r.main,s=[],a=0;for(let t=new l(e.doc,e.sliceDoc(i,o));!t.next().done;){if(s.length>1e3)return!1;t.value.from==i&&(a=s.length),s.push(n.EditorSelection.range(t.value.from,t.value.to))}return t(e.update({selection:n.EditorSelection.create(s,a),userEvent:"select.search.matches"})),!0},ee=Y(((e,{query:t})=>{let{state:r}=e,{from:o,to:s}=r.selection.main;if(r.readOnly)return!1;let a=t.nextMatch(r,o,o);if(!a)return!1;let l,c,h=[],u=[];if(a.from==o&&a.to==s&&(c=r.toText(t.getReplacement(a)),h.push({from:a.from,to:a.to,insert:c}),a=t.nextMatch(r,a.from,a.to),u.push(i.EditorView.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(o).number)+"."))),a){let t=0==h.length||h[0].from>=a.to?0:a.to-a.from-c.length;l=n.EditorSelection.single(a.from-t,a.to-t),u.push(de(e,a)),u.push(r.facet(P).scrollToMatch(l.main,e))}return e.dispatch({changes:h,selection:l,effects:u,userEvent:"input.replace"}),!0})),te=Y(((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map((e=>{let{from:r,to:i}=e;return{from:r,to:i,insert:t.getReplacement(e)}}));if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:i.EditorView.announce.of(n),userEvent:"input.replace.all"}),!0}));function re(e){return e.state.facet(P).createPanel(e)}function ie(e,t){var r,i,n,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(P);return new W({search:(null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:c.caseSensitive,literal:null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal,regexp:null!==(o=null==t?void 0:t.regexp)&&void 0!==o?o:c.regexp,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:c.wholeWord})}function ne(e){let t=(0,i.getPanel)(e,re);return t&&t.dom.querySelector("[main-field]")}function oe(e){let t=ne(e);t&&t==e.root.activeElement&&t.select()}const se=e=>{let t=e.state.field(B,!1);if(t&&t.panel){let r=ne(e);if(r&&r!=e.root.activeElement){let i=ie(e.state,t.query.spec);i.valid&&e.dispatch({effects:$.of(i)}),r.focus(),r.select()}}else e.dispatch({effects:[U.of(!0),t?$.of(ie(e.state,t.query.spec)):n.StateEffect.appendConfig.of(pe)]});return!0},ae=e=>{let t=e.state.field(B,!1);if(!t||!t.panel)return!1;let r=(0,i.getPanel)(e,re);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:U.of(!1)}),!0},le=[{key:"Mod-f",run:se,scope:"editor search-panel"},{key:"F3",run:G,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:G,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ae,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Z},{key:"Mod-Alt-g",run:y},{key:"Mod-d",run:L,preventDefault:!0}];class ce{constructor(e){this.view=e;let t=this.query=e.state.field(B).query.spec;function r(e,t,r){return o("button",{class:"cm-button",name:e,onclick:t,type:"button"},r)}this.commit=this.commit.bind(this),this.searchField=o("input",{value:t.search,placeholder:he(e,"Find"),"aria-label":he(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=o("input",{value:t.replace,placeholder:he(e,"Replace"),"aria-label":he(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=o("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=o("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=o("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=o("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,r("next",(()=>G(e)),[he(e,"next")]),r("prev",(()=>H(e)),[he(e,"previous")]),r("select",(()=>X(e)),[he(e,"all")]),o("label",null,[this.caseField,he(e,"match case")]),o("label",null,[this.reField,he(e,"regexp")]),o("label",null,[this.wordField,he(e,"by word")]),...e.state.readOnly?[]:[o("br"),this.replaceField,r("replace",(()=>ee(e)),[he(e,"replace")]),r("replaceAll",(()=>te(e)),[he(e,"replace all")])],o("button",{name:"close",onclick:()=>ae(e),"aria-label":he(e,"close"),type:"button"},["×"])])}commit(){let e=new W({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:$.of(e)}))}keydown(e){(0,i.runScopeHandlers)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?H:G)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),ee(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is($)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(P).top}}function he(e,t){return e.state.phrase(t)}const ue=30,fe=/[\s\.,:;?!]/;function de(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),o=e.state.doc.lineAt(r).to,s=Math.max(n.from,t-ue),a=Math.min(o,r+ue),l=e.state.sliceDoc(s,a);if(s!=n.from)for(let e=0;e<ue;e++)if(!fe.test(l[e+1])&&fe.test(l[e])){l=l.slice(e);break}if(a!=o)for(let e=l.length-1;e>l.length-ue;e--)if(!fe.test(l[e-1])&&fe.test(l[e])){l=l.slice(0,e);break}return i.EditorView.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${n.number}.`)}const me=i.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),pe=[B,n.Prec.low(J),me]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5261],{25261:(e,t,r)=>{r.r(t),r.d(t,{RegExpCursor:()=>u,SearchCursor:()=>l,SearchQuery:()=>W,closeSearchPanel:()=>ae,findNext:()=>G,findPrevious:()=>H,getSearchQuery:()=>_,gotoLine:()=>y,highlightSelectionMatches:()=>C,openSearchPanel:()=>se,replaceAll:()=>te,replaceNext:()=>ee,search:()=>A,searchKeymap:()=>le,searchPanelOpen:()=>N,selectMatches:()=>X,selectNextOccurrence:()=>L,selectSelectionMatches:()=>Z,setSearchQuery:()=>$});var i=r(46750),n=r(89843);function o(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,r=arguments[1];if(r&&"object"==typeof r&&null==r.nodeType&&!Array.isArray(r)){for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=r[i];"string"==typeof n?e.setAttribute(i,n):null!=n&&(e[i]=n)}t++}for(;t<arguments.length;t++)s(e,arguments[t]);return e}function s(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var r=0;r<t.length;r++)s(e,t[r])}}const a="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class l{constructor(e,t,r=0,i=e.length,n,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=n?e=>n(a(e)):a,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return(0,n.codePointAt)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=(0,n.fromCodePoint)(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=(0,n.codePointSize)(e);let i=this.normalize(t);for(let e=0,n=r;;e++){let o=i.charCodeAt(e),s=this.match(o,n,this.bufferPos+this.bufferStart);if(e==i.length-1){if(s)return this.value=s,this;break}n==r&&e<t.length&&t.charCodeAt(e)==o&&n++}}}match(e,t,r){let i=null;for(let t=0;t<this.matches.length;t+=2){let n=this.matches[t],o=!1;this.query.charCodeAt(n)==e&&(n==this.query.length-1?i={from:this.matches[t+1],to:r}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?i={from:t,to:r}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}"undefined"!=typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this});const c={from:-1,to:-1,match:/.*/.exec("")},h="gm"+(null==/x/.unicode?"":"u");class u{constructor(e,t,r,i=0,n=e.length){if(this.text=e,this.to=n,this.curLine="",this.done=!1,this.value=c,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new m(e,t,r,i,n);this.re=new RegExp(t,h+((null==r?void 0:r.ignoreCase)?"i":"")),this.test=null==r?void 0:r.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=p(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=p(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const f=new WeakMap;class d{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=f.get(e);if(!i||i.from>=r||i.to<=t){let i=new d(t,e.sliceString(t,r));return f.set(e,i),i}if(i.from==t&&i.to==r)return i;let{text:n,from:o}=i;return o>t&&(n=e.sliceString(t,o)+n,o=t),i.to<r&&(n+=e.sliceString(i.to,r)),f.set(e,new d(o,n)),new d(t,n.slice(t-o,r-o))}}class m{constructor(e,t,r,i,n){this.text=e,this.to=n,this.done=!1,this.value=c,this.matchPos=p(e,i),this.re=new RegExp(t,h+((null==r?void 0:r.ignoreCase)?"i":"")),this.test=null==r?void 0:r.test,this.flat=d.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,r=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,r,t)))return this.value={from:e,to:r,match:t},this.matchPos=p(this.text,r+(e==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=d.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function p(e,t){if(t>=e.length)return t;let r,i=e.lineAt(t);for(;t<i.to&&(r=i.text.charCodeAt(t-i.from))>=56320&&r<57344;)t++;return t}function g(e){let t=o("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function r(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=e,s=o.doc.lineAt(o.selection.main.head),[,a,l,c,h]=r,u=c?+c.slice(1):0,f=l?+l:s.number;if(l&&h){let e=f/100;a&&(e=e*("-"==a?-1:1)+s.number/o.doc.lines),f=Math.round(o.doc.lines*e)}else l&&a&&(f=f*("-"==a?-1:1)+s.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,f))),m=n.EditorSelection.cursor(d.from+Math.max(0,Math.min(u,d.length)));e.dispatch({effects:[v.of(!1),i.EditorView.scrollIntoView(m.from,{y:"center"})],selection:m}),e.focus()}return{dom:o("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:v.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},o("label",e.state.phrase("Go to line"),": ",t)," ",o("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(u.prototype[Symbol.iterator]=m.prototype[Symbol.iterator]=function(){return this});const v=n.StateEffect.define(),x=n.StateField.define({create:()=>!0,update(e,t){for(let r of t.effects)r.is(v)&&(e=r.value);return e},provide:e=>i.showPanel.from(e,(e=>e?g:null))}),y=e=>{let t=(0,i.getPanel)(e,g);if(!t){let r=[v.of(!0)];null==e.state.field(x,!1)&&r.push(n.StateEffect.appendConfig.of([x,w])),e.dispatch({effects:r}),t=(0,i.getPanel)(e,g)}return t&&t.dom.querySelector("input").select(),!0},w=i.EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),S={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},b=n.Facet.define({combine:e=>(0,n.combineConfig)(e,S,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function C(e){let t=[q,D];return e&&t.push(b.of(e)),t}const k=i.Decoration.mark({class:"cm-selectionMatch"}),M=i.Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function E(e,t,r,i){return!(0!=r&&e(t.sliceDoc(r-1,r))==n.CharCategory.Word||i!=t.doc.length&&e(t.sliceDoc(i,i+1))==n.CharCategory.Word)}const D=i.ViewPlugin.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(b),{state:r}=e,o=r.selection;if(o.ranges.length>1)return i.Decoration.none;let s,a=o.main,c=null;if(a.empty){if(!t.highlightWordAroundCursor)return i.Decoration.none;let e=r.wordAt(a.head);if(!e)return i.Decoration.none;c=r.charCategorizer(a.head),s=r.sliceDoc(e.from,e.to)}else{let e=a.to-a.from;if(e<t.minSelectionLength||e>200)return i.Decoration.none;if(t.wholeWords){if(s=r.sliceDoc(a.from,a.to),c=r.charCategorizer(a.head),!E(c,r,a.from,a.to)||!function(e,t,r,i){return e(t.sliceDoc(r,r+1))==n.CharCategory.Word&&e(t.sliceDoc(i-1,i))==n.CharCategory.Word}(c,r,a.from,a.to))return i.Decoration.none}else if(s=r.sliceDoc(a.from,a.to),!s)return i.Decoration.none}let h=[];for(let n of e.visibleRanges){let e=new l(r.doc,s,n.from,n.to);for(;!e.next().done;){let{from:n,to:o}=e.value;if((!c||E(c,r,n,o))&&(a.empty&&n<=a.from&&o>=a.to?h.push(M.range(n,o)):(n>=a.to||o<=a.from)&&h.push(k.range(n,o)),h.length>t.maxMatches))return i.Decoration.none}}return i.Decoration.set(h)}},{decorations:e=>e.decorations}),q=i.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),L=({state:e,dispatch:t})=>{let{ranges:r}=e.selection;if(r.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:r}=e,i=n.EditorSelection.create(r.ranges.map((t=>e.wordAt(t.head)||n.EditorSelection.cursor(t.head))),r.mainIndex);return!i.eq(r)&&(t(e.update({selection:i})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(r[0].from,r[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let s=function(e,t){let{main:r,ranges:i}=e.selection,n=e.wordAt(r.head),o=n&&n.from==r.from&&n.to==r.to;for(let r=!1,n=new l(e.doc,t,i[i.length-1].to);;){if(n.next(),!n.done){if(r&&i.some((e=>e.from==n.value.from)))continue;if(o){let t=e.wordAt(n.value.from);if(!t||t.from!=n.value.from||t.to!=n.value.to)continue}return n.value}if(r)return null;n=new l(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),r=!0}}(e,o);return!!s&&(t(e.update({selection:e.selection.addRange(n.EditorSelection.range(s.from,s.to),!1),effects:i.EditorView.scrollIntoView(s.to)})),!0)},P=n.Facet.define({combine:e=>(0,n.combineConfig)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ce(e),scrollToMatch:e=>i.EditorView.scrollIntoView(e)})});function A(e){return e?[P.of(e),pe]:pe}class W{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,h),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new z(this):new T(this)}getCursor(e,t=0,r){let i=e.doc?e:n.EditorState.create({doc:e});return null==r&&(r=i.doc.length),this.regexp?O(this,i,t,r):R(this,i,t,r)}}class F{constructor(e){this.spec=e}}function R(e,t,r,i){return new l(t.doc,e.unquoted,r,i,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(o=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,r,i)=>((i>e||i+r.length<t)&&(i=Math.max(0,e-2),r=o.sliceString(i,Math.min(o.length,t+2))),!(s(V(r,e-i))==n.CharCategory.Word&&s(I(r,e-i))==n.CharCategory.Word||s(I(r,t-i))==n.CharCategory.Word&&s(V(r,t-i))==n.CharCategory.Word))):void 0);var o,s}class T extends F{constructor(e){super(e)}nextMatch(e,t,r){let i=R(this.spec,e,r,e.doc.length).nextOverlapping();return i.done&&(i=R(this.spec,e,0,t).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let r=Math.max(t,i-1e4-this.spec.unquoted.length),n=R(this.spec,e,r,i),o=null;for(;!n.nextOverlapping().done;)o=n.value;if(o)return o;if(r==t)return null;i-=1e4}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=R(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let n=R(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!n.next().done;)i(n.value.from,n.value.to)}}function O(e,t,r,i){return new u(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(o=t.charCategorizer(t.selection.main.head),(e,t,r)=>!r[0].length||(o(V(r.input,r.index))!=n.CharCategory.Word||o(I(r.input,r.index))!=n.CharCategory.Word)&&(o(I(r.input,r.index+r[0].length))!=n.CharCategory.Word||o(V(r.input,r.index+r[0].length))!=n.CharCategory.Word)):void 0},r,i);var o}function V(e,t){return e.slice((0,n.findClusterBreak)(e,t,!1),t)}function I(e,t){return e.slice(t,(0,n.findClusterBreak)(e,t))}class z extends F{nextMatch(e,t,r){let i=O(this.spec,e,r,e.doc.length).next();return i.done&&(i=O(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let n=Math.max(t,r-1e4*i),o=O(this.spec,e,n,r),s=null;for(;!o.next().done;)s=o.value;if(s&&(n==t||s.from>n+10))return s;if(n==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,r)=>"$"==r?"$":"&"==r?e.match[0]:"0"!=r&&+r<e.match.length?e.match[r]:t))}matchAll(e,t){let r=O(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let n=O(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!n.next().done;)i(n.value.from,n.value.to)}}const $=n.StateEffect.define(),U=n.StateEffect.define(),B=n.StateField.define({create:e=>new Q(ie(e).create(),null),update(e,t){for(let r of t.effects)r.is($)?e=new Q(r.value.create(),e.panel):r.is(U)&&(e=new Q(e.query,r.value?re:null));return e},provide:e=>i.showPanel.from(e,(e=>e.panel))});function _(e){let t=e.field(B,!1);return t?t.query.spec:ie(e)}function N(e){var t;return null!=(null===(t=e.field(B,!1))||void 0===t?void 0:t.panel)}class Q{constructor(e,t){this.query=e,this.panel=t}}const K=i.Decoration.mark({class:"cm-searchMatch"}),j=i.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),J=i.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(B))}update(e){let t=e.state.field(B);(t!=e.startState.field(B)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return i.Decoration.none;let{view:r}=this,o=new n.RangeSetBuilder;for(let t=0,i=r.visibleRanges,n=i.length;t<n;t++){let{from:s,to:a}=i[t];for(;t<n-1&&a>i[t+1].from-500;)a=i[++t].to;e.highlight(r.state,s,a,((e,t)=>{let i=r.state.selection.ranges.some((r=>r.from==e&&r.to==t));o.add(e,t,i?j:K)}))}return o.finish()}},{decorations:e=>e.decorations});function Y(e){return t=>{let r=t.state.field(B,!1);return r&&r.query.spec.valid?e(t,r):se(t)}}const G=Y(((e,{query:t})=>{let{to:r}=e.state.selection.main,i=t.nextMatch(e.state,r,r);if(!i)return!1;let o=n.EditorSelection.single(i.from,i.to),s=e.state.facet(P);return e.dispatch({selection:o,effects:[de(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),oe(e),!0})),H=Y(((e,{query:t})=>{let{state:r}=e,{from:i}=r.selection.main,o=t.prevMatch(r,i,i);if(!o)return!1;let s=n.EditorSelection.single(o.from,o.to),a=e.state.facet(P);return e.dispatch({selection:s,effects:[de(e,o),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),oe(e),!0})),X=Y(((e,{query:t})=>{let r=t.matchAll(e.state,1e3);return!(!r||!r.length||(e.dispatch({selection:n.EditorSelection.create(r.map((e=>n.EditorSelection.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),Z=({state:e,dispatch:t})=>{let r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:i,to:o}=r.main,s=[],a=0;for(let t=new l(e.doc,e.sliceDoc(i,o));!t.next().done;){if(s.length>1e3)return!1;t.value.from==i&&(a=s.length),s.push(n.EditorSelection.range(t.value.from,t.value.to))}return t(e.update({selection:n.EditorSelection.create(s,a),userEvent:"select.search.matches"})),!0},ee=Y(((e,{query:t})=>{let{state:r}=e,{from:o,to:s}=r.selection.main;if(r.readOnly)return!1;let a=t.nextMatch(r,o,o);if(!a)return!1;let l,c,h=[],u=[];if(a.from==o&&a.to==s&&(c=r.toText(t.getReplacement(a)),h.push({from:a.from,to:a.to,insert:c}),a=t.nextMatch(r,a.from,a.to),u.push(i.EditorView.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(o).number)+"."))),a){let t=0==h.length||h[0].from>=a.to?0:a.to-a.from-c.length;l=n.EditorSelection.single(a.from-t,a.to-t),u.push(de(e,a)),u.push(r.facet(P).scrollToMatch(l.main,e))}return e.dispatch({changes:h,selection:l,effects:u,userEvent:"input.replace"}),!0})),te=Y(((e,{query:t})=>{if(e.state.readOnly)return!1;let r=t.matchAll(e.state,1e9).map((e=>{let{from:r,to:i}=e;return{from:r,to:i,insert:t.getReplacement(e)}}));if(!r.length)return!1;let n=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:i.EditorView.announce.of(n),userEvent:"input.replace.all"}),!0}));function re(e){return e.state.facet(P).createPanel(e)}function ie(e,t){var r,i,n,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(P);return new W({search:(null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:c.caseSensitive,literal:null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal,regexp:null!==(o=null==t?void 0:t.regexp)&&void 0!==o?o:c.regexp,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:c.wholeWord})}function ne(e){let t=(0,i.getPanel)(e,re);return t&&t.dom.querySelector("[main-field]")}function oe(e){let t=ne(e);t&&t==e.root.activeElement&&t.select()}const se=e=>{let t=e.state.field(B,!1);if(t&&t.panel){let r=ne(e);if(r&&r!=e.root.activeElement){let i=ie(e.state,t.query.spec);i.valid&&e.dispatch({effects:$.of(i)}),r.focus(),r.select()}}else e.dispatch({effects:[U.of(!0),t?$.of(ie(e.state,t.query.spec)):n.StateEffect.appendConfig.of(pe)]});return!0},ae=e=>{let t=e.state.field(B,!1);if(!t||!t.panel)return!1;let r=(0,i.getPanel)(e,re);return r&&r.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:U.of(!1)}),!0},le=[{key:"Mod-f",run:se,scope:"editor search-panel"},{key:"F3",run:G,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:G,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ae,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Z},{key:"Mod-Alt-g",run:y},{key:"Mod-d",run:L,preventDefault:!0}];class ce{constructor(e){this.view=e;let t=this.query=e.state.field(B).query.spec;function r(e,t,r){return o("button",{class:"cm-button",name:e,onclick:t,type:"button"},r)}this.commit=this.commit.bind(this),this.searchField=o("input",{value:t.search,placeholder:he(e,"Find"),"aria-label":he(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=o("input",{value:t.replace,placeholder:he(e,"Replace"),"aria-label":he(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=o("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=o("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=o("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=o("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,r("next",(()=>G(e)),[he(e,"next")]),r("prev",(()=>H(e)),[he(e,"previous")]),r("select",(()=>X(e)),[he(e,"all")]),o("label",null,[this.caseField,he(e,"match case")]),o("label",null,[this.reField,he(e,"regexp")]),o("label",null,[this.wordField,he(e,"by word")]),...e.state.readOnly?[]:[o("br"),this.replaceField,r("replace",(()=>ee(e)),[he(e,"replace")]),r("replaceAll",(()=>te(e)),[he(e,"replace all")])],o("button",{name:"close",onclick:()=>ae(e),"aria-label":he(e,"close"),type:"button"},["×"])])}commit(){let e=new W({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:$.of(e)}))}keydown(e){(0,i.runScopeHandlers)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?H:G)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),ee(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is($)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(P).top}}function he(e,t){return e.state.phrase(t)}const ue=30,fe=/[\s\.,:;?!]/;function de(e,{from:t,to:r}){let n=e.state.doc.lineAt(t),o=e.state.doc.lineAt(r).to,s=Math.max(n.from,t-ue),a=Math.min(o,r+ue),l=e.state.sliceDoc(s,a);if(s!=n.from)for(let e=0;e<ue;e++)if(!fe.test(l[e+1])&&fe.test(l[e])){l=l.slice(e);break}if(a!=o)for(let e=l.length-1;e>l.length-ue;e--)if(!fe.test(l[e-1])&&fe.test(l[e])){l=l.slice(0,e);break}return i.EditorView.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${n.number}.`)}const me=i.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),pe=[B,n.Prec.low(J),me]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5313,8060],{65313:(e,t,i)=>{i.r(t),i.d(t,{CSVDelimiter:()=>n.p,CSVDocumentWidget:()=>o.kw,CSVViewer:()=>o.A9,CSVViewerFactory:()=>o.LT,DSVModel:()=>r.DSVModel,GridSearchService:()=>o.JZ,TSVViewerFactory:()=>o._d,TextRenderConfig:()=>o.B0,parseDSV:()=>s.G,parseDSVNoQuotes:()=>s.z});var r=i(18032),s=i(48234),n=i(40930),o=i(21058)},40930:(e,t,i)=>{i.d(t,{p:()=>a});var r,s=i(70858),n=i(95291),o=i(63485);class a extends o.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const i=null==(t=t||s.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",i.__("tab")],["|",i.__("pipe")],["#",i.__("hash")]],o=document.createElement("div"),a=document.createElement("span"),d=document.createElement("select");a.textContent=i.__("Delimiter: "),a.className="jp-CSVDelimiter-label";for(const[t,i]of r){const r=document.createElement("option");r.value=t,r.textContent=i,t===e&&(r.selected=!0),d.appendChild(r)}o.appendChild(a);const l=n.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),o.appendChild(l),o}}(r||(r={}))},21058:(e,t,i)=>{i.d(t,{A9:()=>u,B0:()=>h,JZ:()=>c,LT:()=>g,_d:()=>m,kw:()=>_});var r,s=i(65848),n=i(89945),o=i(20998),a=i(81997),d=i(63485),l=i(40930);class h{}class c{constructor(e){this._looping=!0,this._changed=new a.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:i,column:r})=>this._query&&t.match(this._query)?this._row===i&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const i=this._grid.dataModel,r=i.rowCount("body"),s=i.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const n=this._grid.scrollY/this._grid.defaultSizes.rowHeight,o=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,a=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=n&&e<=o&&t>=a&&t<=d,h=t?-1:1;this._column+=h;for(let n=this._row;t?n>=0:n<r;n+=h){for(let r=this._column;t?r>=0:r<s;r+=h)if(i.data("body",n,r).match(e))return this._changed.emit(void 0),l(n,r)||this._grid.scrollToRow(n),this._row=n,this._column=r,!0;this._column=t?s-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,i=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=i-1,this._column=r):!e&&this._row>=i-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new o.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:i,DataGrid:n}=await r.ensureDataGrid();this._defaultStyle=n.defaultStyle,this._grid=new n({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new i,this._grid.copyConfig={separator:"\t",format:n.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new c(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new s.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),i=this._context.model.toString(),s=this._delimiter,n=this._grid.dataModel,o=this._grid.dataModel=new t({data:i,delimiter:s});this._grid.selectionModel=new e({dataModel:o}),n&&n.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,i=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:i,"column-header":i,"corner-header":i,"row-header":i})}}class _ extends n.DocumentWidget{constructor(e){let{content:t,context:i,delimiter:s,reveal:n,...o}=e;t=t||r.createContent(i),n=Promise.all([n,t.revealed]),super({content:t,context:i,reveal:n,...o}),s&&(t.delimiter=s)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let i=t[1].split(";")[0];i=i.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(i))}))}}class g extends n.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new _({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends g{createNewWidget(e){return new _({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new o.PromiseDelegate,t.resolve(await i.e(9072).then(i.t.bind(i,59072,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new o.PromiseDelegate,r.resolve(await Promise.all([i.e(8032),i.e(9072)]).then(i.bind(i,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5313,8060],{65313:(e,t,i)=>{i.r(t),i.d(t,{CSVDelimiter:()=>n.p,CSVDocumentWidget:()=>o.kw,CSVViewer:()=>o.A9,CSVViewerFactory:()=>o.LT,DSVModel:()=>r.DSVModel,GridSearchService:()=>o.JZ,TSVViewerFactory:()=>o._d,TextRenderConfig:()=>o.B0,parseDSV:()=>s.G,parseDSVNoQuotes:()=>s.z});var r=i(18032),s=i(48234),n=i(40930),o=i(21058)},40930:(e,t,i)=>{i.d(t,{p:()=>a});var r,s=i(25291),n=i(12668),o=i(63485);class a extends o.Widget{constructor(e){super({node:r.createNode(e.widget.delimiter,e.translator)}),this._widget=e.widget,this.addClass("jp-CSVDelimiter")}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){"change"===e.type&&(this._widget.delimiter=this.selectNode.value)}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}!function(e){e.createNode=function(e,t){const i=null==(t=t||s.nullTranslator)?void 0:t.load("jupyterlab"),r=[[",",","],[";",";"],["\t",i.__("tab")],["|",i.__("pipe")],["#",i.__("hash")]],o=document.createElement("div"),a=document.createElement("span"),d=document.createElement("select");a.textContent=i.__("Delimiter: "),a.className="jp-CSVDelimiter-label";for(const[t,i]of r){const r=document.createElement("option");r.value=t,r.textContent=i,t===e&&(r.selected=!0),d.appendChild(r)}o.appendChild(a);const l=n.Styling.wrapSelect(d);return l.classList.add("jp-CSVDelimiter-dropdown"),o.appendChild(l),o}}(r||(r={}))},21058:(e,t,i)=>{i.d(t,{A9:()=>u,B0:()=>h,JZ:()=>c,LT:()=>g,_d:()=>m,kw:()=>_});var r,s=i(44548),n=i(71120),o=i(20998),a=i(81997),d=i(63485),l=i(40930);class h{}class c{constructor(e){this._looping=!0,this._changed=new a.Signal(this),this._grid=e,this._query=null,this._row=0,this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:i,column:r})=>this._query&&t.match(this._query)?this._row===i&&this._column===r?e.currentMatchBackgroundColor:e.matchBackgroundColor:""}clear(){this._query=null,this._row=0,this._column=-1,this._changed.emit(void 0)}find(e,t=!1){const i=this._grid.dataModel,r=i.rowCount("body"),s=i.columnCount("body");this._query!==e&&(this._row=0,this._column=-1),this._query=e;const n=this._grid.scrollY/this._grid.defaultSizes.rowHeight,o=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight,a=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight,d=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight,l=(e,t)=>e>=n&&e<=o&&t>=a&&t<=d,h=t?-1:1;this._column+=h;for(let n=this._row;t?n>=0:n<r;n+=h){for(let r=this._column;t?r>=0:r<s;r+=h)if(i.data("body",n,r).match(e))return this._changed.emit(void 0),l(n,r)||this._grid.scrollToRow(n),this._row=n,this._column=r,!0;this._column=t?s-1:0}if(this._looping){this._looping=!1,this._row=t?0:r-1,this._wrapRows(t);try{return this.find(e,t)}finally{this._looping=!0}}return!1}_wrapRows(e=!1){const t=this._grid.dataModel,i=t.rowCount("body"),r=t.columnCount("body");e&&this._row<=0?(this._row=i-1,this._column=r):!e&&this._row>=i-1&&(this._row=0,this._column=-1)}get query(){return this._query}}class u extends d.Widget{constructor(e){super(),this._monitor=null,this._delimiter=",",this._revealed=new o.PromiseDelegate,this._baseRenderer=null,this._context=e.context,this.layout=new d.PanelLayout,this.addClass("jp-CSVViewer"),this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e)return;const{BasicKeyHandler:t,BasicMouseHandler:i,DataGrid:n}=await r.ensureDataGrid();this._defaultStyle=n.defaultStyle,this._grid=new n({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}}),this._grid.addClass("jp-CSVViewer-grid"),this._grid.headerVisibility="all",this._grid.keyHandler=new t,this._grid.mouseHandler=new i,this._grid.copyConfig={separator:"\t",format:n.copyFormatGeneric,headers:"all",warningThreshold:1e6},e.addWidget(this._grid),this._searchService=new c(this._grid),this._searchService.changed.connect(this._updateRenderer,this),await this._context.ready,await this._updateGrid(),this._revealed.resolve(void 0),this._monitor=new s.ActivityMonitor({signal:this._context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){e!==this._delimiter&&(this._delimiter=e,this._updateGrid())}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e,this._updateRenderer()}get searchService(){return this._searchService}dispose(){this._monitor&&this._monitor.dispose(),super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1,this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await r.ensureDataGrid(),{DSVModel:t}=await r.ensureDSVModel(),i=this._context.model.toString(),s=this._delimiter,n=this._grid.dataModel,o=this._grid.dataModel=new t({data:i,delimiter:s});this._grid.selectionModel=new e({dataModel:o}),n&&n.dispose()}async _updateRenderer(){if(null===this._baseRenderer)return;const{TextRenderer:e}=await r.ensureDataGrid(),t=this._baseRenderer,i=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:i,"column-header":i,"corner-header":i,"row-header":i})}}class _ extends n.DocumentWidget{constructor(e){let{content:t,context:i,delimiter:s,reveal:n,...o}=e;t=t||r.createContent(i),n=Promise.all([n,t.revealed]),super({content:t,context:i,reveal:n,...o}),s&&(t.delimiter=s)}setFragment(e){const t=e.split("=");if("#row"!==t[0])return;let i=t[1].split(";")[0];i=i.split("-")[0],this.context.ready.then((()=>{this.content.goToLine(Number(i))}))}}class g extends n.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new _({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new l.p({widget:e.content,translator:this.translator})}]}}class m extends g{createNewWidget(e){return new _({context:e,delimiter:"\t",translator:this.translator})}}!function(e){let t=null,r=null;e.ensureDataGrid=async function(){return null==t&&(t=new o.PromiseDelegate,t.resolve(await i.e(9072).then(i.t.bind(i,59072,23)))),t.promise},e.ensureDSVModel=async function(){return null==r&&(r=new o.PromiseDelegate,r.resolve(await Promise.all([i.e(8032),i.e(9072)]).then(i.bind(i,18032)))),r.promise},e.createContent=function(e){return new u({context:e})}}(r||(r={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5325,377],{35325:(t,e,n)=>{n.r(e),n.d(e,{HTMLViewer:()=>h,HTMLViewerFactory:()=>m,IHTMLViewerTracker:()=>r,ToolbarItems:()=>o});const r=new(n(20998).Token)("@jupyterlab/htmlviewer:IHTMLViewerTracker","A widget tracker for rendered HTML documents.\n Use this if you want to be able to iterate over and interact with HTML documents\n viewed by the application.");var o,a,s=n(65848),i=n(89945),l=n(70858),u=n(95291),c=n(81997),d=n(78156);class h extends i.DocumentWidget{constructor(t){super({...t,content:new u.IFrame({sandbox:["allow-same-origin"]})}),this._renderPending=!1,this._parser=new DOMParser,this._monitor=null,this._objectUrl="",this._trustedChanged=new c.Signal(this),this.translator=t.translator||l.nullTranslator,this.content.addClass("jp-HTMLViewer"),this.context.ready.then((()=>{this.update(),this._monitor=new s.ActivityMonitor({signal:this.context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this.update,this)}))}get trusted(){return-1!==this.content.sandbox.indexOf("allow-scripts")}set trusted(t){this.trusted!==t&&(this.content.sandbox=t?a.trusted:a.untrusted,this.update(),this._trustedChanged.emit(t))}get trustedChanged(){return this._trustedChanged}dispose(){if(this._objectUrl)try{URL.revokeObjectURL(this._objectUrl)}catch(t){}super.dispose()}onUpdateRequest(){this._renderPending||(this._renderPending=!0,this._renderModel().then((()=>this._renderPending=!1)))}async _renderModel(){let t=this.context.model.toString();t=await this._setupDocument(t);const e=new Blob([t],{type:"text/html"}),n=this._objectUrl;if(this._objectUrl=URL.createObjectURL(e),this.content.url=this._objectUrl,n)try{URL.revokeObjectURL(n)}catch(t){}}async _setupDocument(t){const e=this._parser.parseFromString(t,"text/html");let n=e.querySelector("base");n||(n=e.createElement("base"),e.head.insertBefore(n,e.head.firstChild));const r=this.context.path,o=await this.context.urlResolver.getDownloadUrl(r);if(n.href=o,n.target="_self",!this.trusted){const t=this.translator.load("jupyterlab").__("Action disabled as the file is not trusted.");e.body.insertAdjacentHTML("beforeend",`<style>\na[target="_blank"],\narea[target="_blank"],\nform[target="_blank"],\nbutton[formtarget="_blank"],\ninput[formtarget="_blank"][type="image"],\ninput[formtarget="_blank"][type="submit"] {\n cursor: not-allowed !important;\n}\na[target="_blank"]:hover::after,\narea[target="_blank"]:hover::after,\nform[target="_blank"]:hover::after,\nbutton[formtarget="_blank"]:hover::after,\ninput[formtarget="_blank"][type="image"]:hover::after,\ninput[formtarget="_blank"][type="submit"]:hover::after {\n content: "${{warning:t}.warning}";\n box-sizing: border-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1000;\n border: 2px solid #e65100;\n background-color: #ffb74d;\n color: black;\n font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', helvetica, arial, sans-serif;\n text-align: center;\n}\n</style>`)}return e.documentElement.innerHTML}}class m extends i.ABCWidgetFactory{createNewWidget(t){return new h({context:t})}defaultToolbarFactory(t){return[{name:"refresh",widget:o.createRefreshButton(t,this.translator)},{name:"trust",widget:o.createTrustButton(t,this.translator)}]}}!function(t){t.createRefreshButton=function(t,e){const n=(null!=e?e:l.nullTranslator).load("jupyterlab");return new u.ToolbarButton({icon:u.refreshIcon,onClick:async()=>{t.context.model.dirty||(await t.context.revert(),t.update())},tooltip:n.__("Rerender HTML Document")})},t.createTrustButton=function(t,e){return u.ReactWidget.create(d.createElement(a.TrustButtonComponent,{htmlDocument:t,translator:e}))}}(o||(o={})),function(t){t.untrusted=[],t.trusted=["allow-scripts","allow-popups"],t.TrustButtonComponent=function(t){const e=(t.translator||l.nullTranslator).load("jupyterlab");return d.createElement(u.UseSignal,{signal:t.htmlDocument.trustedChanged,initialSender:t.htmlDocument},(()=>d.createElement(u.ToolbarButtonComponent,{className:"",onClick:()=>t.htmlDocument.trusted=!t.htmlDocument.trusted,tooltip:e.__("Whether the HTML file is trusted.\nTrusting the file allows opening pop-ups and running scripts\nwhich may result in security risks.\nOnly enable for files you trust."),label:t.htmlDocument.trusted?e.__("Distrust HTML"):e.__("Trust HTML")})))}}(a||(a={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5325,377],{35325:(t,e,n)=>{n.r(e),n.d(e,{HTMLViewer:()=>h,HTMLViewerFactory:()=>m,IHTMLViewerTracker:()=>r,ToolbarItems:()=>o});const r=new(n(20998).Token)("@jupyterlab/htmlviewer:IHTMLViewerTracker","A widget tracker for rendered HTML documents.\n Use this if you want to be able to iterate over and interact with HTML documents\n viewed by the application.");var o,a,s=n(44548),i=n(71120),l=n(25291),u=n(12668),c=n(81997),d=n(78156);class h extends i.DocumentWidget{constructor(t){super({...t,content:new u.IFrame({sandbox:["allow-same-origin"],loading:"lazy"})}),this._renderPending=!1,this._parser=new DOMParser,this._monitor=null,this._objectUrl="",this._trustedChanged=new c.Signal(this),this.translator=t.translator||l.nullTranslator,this.content.addClass("jp-HTMLViewer"),this.context.ready.then((()=>{this.update(),this._monitor=new s.ActivityMonitor({signal:this.context.model.contentChanged,timeout:1e3}),this._monitor.activityStopped.connect(this.update,this)}))}get trusted(){return-1!==this.content.sandbox.indexOf("allow-scripts")}set trusted(t){this.trusted!==t&&(this.content.sandbox=t?a.trusted:a.untrusted,this.update(),this._trustedChanged.emit(t))}get trustedChanged(){return this._trustedChanged}dispose(){if(this._objectUrl)try{URL.revokeObjectURL(this._objectUrl)}catch(t){}super.dispose()}onUpdateRequest(){this._renderPending||(this._renderPending=!0,this._renderModel().then((()=>this._renderPending=!1)))}async _renderModel(){let t=this.context.model.toString();t=await this._setupDocument(t);const e=new Blob([t],{type:"text/html"}),n=this._objectUrl;if(this._objectUrl=URL.createObjectURL(e),this.content.url=this._objectUrl,n)try{URL.revokeObjectURL(n)}catch(t){}}async _setupDocument(t){const e=this._parser.parseFromString(t,"text/html");let n=e.querySelector("base");n||(n=e.createElement("base"),e.head.insertBefore(n,e.head.firstChild));const r=this.context.path,o=await this.context.urlResolver.getDownloadUrl(r);if(n.href=o,n.target="_self",!this.trusted){const t=this.translator.load("jupyterlab").__("Action disabled as the file is not trusted.");e.body.insertAdjacentHTML("beforeend",`<style>\na[target="_blank"],\narea[target="_blank"],\nform[target="_blank"],\nbutton[formtarget="_blank"],\ninput[formtarget="_blank"][type="image"],\ninput[formtarget="_blank"][type="submit"] {\n cursor: not-allowed !important;\n}\na[target="_blank"]:hover::after,\narea[target="_blank"]:hover::after,\nform[target="_blank"]:hover::after,\nbutton[formtarget="_blank"]:hover::after,\ninput[formtarget="_blank"][type="image"]:hover::after,\ninput[formtarget="_blank"][type="submit"]:hover::after {\n content: "${{warning:t}.warning}";\n box-sizing: border-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 1000;\n border: 2px solid #e65100;\n background-color: #ffb74d;\n color: black;\n font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', helvetica, arial, sans-serif;\n text-align: center;\n}\n</style>`)}return e.documentElement.innerHTML}}class m extends i.ABCWidgetFactory{createNewWidget(t){return new h({context:t})}defaultToolbarFactory(t){return[{name:"refresh",widget:o.createRefreshButton(t,this.translator)},{name:"trust",widget:o.createTrustButton(t,this.translator)}]}}!function(t){t.createRefreshButton=function(t,e){const n=(null!=e?e:l.nullTranslator).load("jupyterlab");return new u.ToolbarButton({icon:u.refreshIcon,onClick:async()=>{t.context.model.dirty||(await t.context.revert(),t.update())},tooltip:n.__("Rerender HTML Document")})},t.createTrustButton=function(t,e){return u.ReactWidget.create(d.createElement(a.TrustButtonComponent,{htmlDocument:t,translator:e}))}}(o||(o={})),function(t){t.untrusted=[],t.trusted=["allow-scripts","allow-popups"],t.TrustButtonComponent=function(t){const e=(t.translator||l.nullTranslator).load("jupyterlab");return d.createElement(u.UseSignal,{signal:t.htmlDocument.trustedChanged,initialSender:t.htmlDocument},(()=>d.createElement(u.ToolbarButtonComponent,{className:"",onClick:()=>t.htmlDocument.trusted=!t.htmlDocument.trusted,tooltip:e.__("Whether the HTML file is trusted.\nTrusting the file allows opening pop-ups and running scripts\nwhich may result in security risks.\nOnly enable for files you trust."),label:t.htmlDocument.trusted?e.__("Distrust HTML"):e.__("Trust HTML")})))}}(a||(a={}))}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5346],{15346:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var n=a(38855),l=a(78156),s=a.n(l),d=a(95291),i=a(33625),r=a(70858);const o="jp-CellTags-Tag",c="jp-CellTags-Unapplied",g="jp-CellTags-Holder",p="jp-CellTags-Add",u="jp-CellTags-Empty";class h{constructor(e,t){this._tracker=e,this._translator=t||r.nullTranslator,this._trans=this._translator.load("jupyterlab"),this._editing=!1}addTag(e,t){const a=e.formData;t&&!a.includes(t)&&(a.push(t),e.formContext.updateMetadata({[e.name]:a},!0))}pullTags(){var e,t;const a=null===(e=this._tracker)||void 0===e?void 0:e.currentWidget,n=null===(t=null==a?void 0:a.model)||void 0===t?void 0:t.cells;if(void 0===n)return[];const l=(0,i.reduce)(n,((e,t)=>{var a;return[...e,...null!==(a=t.getMetadata("tags"))&&void 0!==a?a:[]]}),[]);return[...new Set(l)].filter((e=>""!==e))}_emptyAddTag(e){e.value="",e.style.width="",e.classList.add(u)}_onAddTagKeyDown(e,t){const a=t.target;t.ctrlKey||("Enter"===t.key?this.addTag(e,a.value):"Escape"===t.key&&this._emptyAddTag(a))}_onAddTagFocus(e){this._editing||e.target.blur()}_onAddTagBlur(e){this._editing&&(this._editing=!1,this._emptyAddTag(e))}_onChange(e){if(e.target.value){e.target.classList.remove(u);const t=document.createElement("span");t.className=p,t.textContent=e.target.value,document.body.appendChild(t),e.target.style.setProperty("width",`calc(${t.getBoundingClientRect().width}px + var(--jp-add-tag-extra-width))`),document.body.removeChild(t)}else this._emptyAddTag(e.target)}_onAddTagClick(e,t){const a=t.target.closest("div"),n=null==a?void 0:a.childNodes[0];this._editing?t.target!==n&&this.addTag(e,n.value):(this._editing=!0,n.value="",n.focus()),t.preventDefault()}_onTagClick(e,t){const a=e.formData;a.includes(t)?a.splice(a.indexOf(t),1):a.push(t),e.formContext.updateMetadata({[e.name]:a},!0)}render(e){const t=this.pullTags();return s().createElement("div",{className:"jp-CellTags"},s().createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},"Cell Tags"),t&&t.map(((t,a)=>s().createElement("div",{key:a,className:`${o} ${e.formData.includes(t)?"jp-CellTags-Applied":c}`,onClick:()=>this._onTagClick(e,t)},s().createElement("div",{className:g},s().createElement("span",null,t),e.formData.includes(t)&&s().createElement(d.LabIcon.resolveReact,{icon:d.checkIcon,tag:"span",elementPosition:"center",height:"18px",width:"18px",marginLeft:"5px",marginRight:"-3px"}))))),s().createElement("div",{className:`${o} ${c}`},s().createElement("div",{className:g,onMouseDown:t=>this._onAddTagClick(e,t)},s().createElement("input",{className:`${p} ${u}`,type:"text",placeholder:this._trans.__("Add Tag"),onKeyDown:t=>this._onAddTagKeyDown(e,t),onFocus:e=>this._onAddTagFocus(e),onBlur:e=>this._onAddTagBlur(e.target),onChange:e=>{this._onChange(e)}}),s().createElement(d.LabIcon.resolveReact,{icon:d.addIcon,tag:"span",height:"18px",width:"18px",marginLeft:"5px",marginRight:"-3px"}))))}}const m=[{id:"@jupyterlab/celltags-extension:plugin",description:"Adds the cell tags editor.",autoStart:!0,requires:[n.INotebookTracker],optional:[d.IFormRendererRegistry],activate:(e,t,a)=>{if(a){const e={fieldRenderer:e=>new h(t).render(e)};a.addRenderer("@jupyterlab/celltags-extension:plugin.renderer",e)}}}]}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5346],{15346:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var n=a(30754),l=a(78156),s=a.n(l),d=a(12668),i=a(33625),r=a(25291);const o="jp-CellTags-Tag",c="jp-CellTags-Unapplied",g="jp-CellTags-Holder",p="jp-CellTags-Add",u="jp-CellTags-Empty";class h{constructor(e,t){this._tracker=e,this._translator=t||r.nullTranslator,this._trans=this._translator.load("jupyterlab"),this._editing=!1}addTag(e,t){const a=e.formData;t&&!a.includes(t)&&(a.push(t),e.formContext.updateMetadata({[e.name]:a},!0))}pullTags(){var e,t;const a=null===(e=this._tracker)||void 0===e?void 0:e.currentWidget,n=null===(t=null==a?void 0:a.model)||void 0===t?void 0:t.cells;if(void 0===n)return[];const l=(0,i.reduce)(n,((e,t)=>{var a;return[...e,...null!==(a=t.getMetadata("tags"))&&void 0!==a?a:[]]}),[]);return[...new Set(l)].filter((e=>""!==e))}_emptyAddTag(e){e.value="",e.style.width="",e.classList.add(u)}_onAddTagKeyDown(e,t){const a=t.target;t.ctrlKey||("Enter"===t.key?this.addTag(e,a.value):"Escape"===t.key&&this._emptyAddTag(a))}_onAddTagFocus(e){this._editing||e.target.blur()}_onAddTagBlur(e){this._editing&&(this._editing=!1,this._emptyAddTag(e))}_onChange(e){if(e.target.value){e.target.classList.remove(u);const t=document.createElement("span");t.className=p,t.textContent=e.target.value,document.body.appendChild(t),e.target.style.setProperty("width",`calc(${t.getBoundingClientRect().width}px + var(--jp-add-tag-extra-width))`),document.body.removeChild(t)}else this._emptyAddTag(e.target)}_onAddTagClick(e,t){const a=t.target.closest("div"),n=null==a?void 0:a.childNodes[0];this._editing?t.target!==n&&this.addTag(e,n.value):(this._editing=!0,n.value="",n.focus()),t.preventDefault()}_onTagClick(e,t){const a=e.formData;a.includes(t)?a.splice(a.indexOf(t),1):a.push(t),e.formContext.updateMetadata({[e.name]:a},!0)}render(e){const t=this.pullTags();return s().createElement("div",{className:"jp-CellTags"},s().createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},"Cell Tags"),t&&t.map(((t,a)=>s().createElement("div",{key:a,className:`${o} ${e.formData.includes(t)?"jp-CellTags-Applied":c}`,onClick:()=>this._onTagClick(e,t)},s().createElement("div",{className:g},s().createElement("span",null,t),e.formData.includes(t)&&s().createElement(d.LabIcon.resolveReact,{icon:d.checkIcon,tag:"span",elementPosition:"center",height:"18px",width:"18px",marginLeft:"5px",marginRight:"-3px"}))))),s().createElement("div",{className:`${o} ${c}`},s().createElement("div",{className:g,onMouseDown:t=>this._onAddTagClick(e,t)},s().createElement("input",{className:`${p} ${u}`,type:"text",placeholder:this._trans.__("Add Tag"),onKeyDown:t=>this._onAddTagKeyDown(e,t),onFocus:e=>this._onAddTagFocus(e),onBlur:e=>this._onAddTagBlur(e.target),onChange:e=>{this._onChange(e)}}),s().createElement(d.LabIcon.resolveReact,{icon:d.addIcon,tag:"span",height:"18px",width:"18px",marginLeft:"5px",marginRight:"-3px"}))))}}const m=[{id:"@jupyterlab/celltags-extension:plugin",description:"Adds the cell tags editor.",autoStart:!0,requires:[n.INotebookTracker],optional:[d.IFormRendererRegistry],activate:(e,t,a)=>{if(a){const e={fieldRenderer:e=>new h(t).render(e)};a.addRenderer("@jupyterlab/celltags-extension:plugin.renderer",e)}}}]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5426],{45426:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var i=a(72703),r=a(70858);const s={id:"@jupyterlab/theme-light-extension:plugin",description:"Adds a light theme.",requires:[i.IThemeManager,r.ITranslator],activate:(e,t,a)=>{const i=a.load("jupyterlab");t.register({name:"JupyterLab Light",displayName:i.__("JupyterLab Light"),isLight:!0,themeScrollbars:!1,load:()=>t.loadCSS("@jupyterlab/theme-light-extension/index.css"),unload:()=>Promise.resolve(void 0)})},autoStart:!0}}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[5426],{45426:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var i=a(15465),r=a(25291);const s={id:"@jupyterlab/theme-light-extension:plugin",description:"Adds a light theme.",requires:[i.IThemeManager,r.ITranslator],activate:(e,t,a)=>{const i=a.load("jupyterlab");t.register({name:"JupyterLab Light",displayName:i.__("JupyterLab Light"),isLight:!0,themeScrollbars:!1,load:()=>t.loadCSS("@jupyterlab/theme-light-extension/index.css"),unload:()=>Promise.resolve(void 0)})},autoStart:!0}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[545],{60545:(e,n,t)=>{t.r(n),t.d(n,{CommandIDs:()=>w,default:()=>f});var a,o=t(94535),l=t(72703),r=t(65848),s=t(99246),d=t(1101),i=t(89150),c=t(70858),u=t(95291),m=t(33625),p=t(20998),h=t(63485),_=t(4102),g=t(37383);!function(e){e.openRecent="recentmenu:open-recent",e.reopenLast="recentmenu:reopen-last",e.clearRecents="docmanager:clear-recents"}(a||(a={}));class b extends h.Menu{constructor(e){super(e),this._manager=e.manager,this._showDirectories=e.showDirectories,this.updateItems(),this._manager.changed.connect(this.updateItems,this)}async _validateRecentlyOpened(){Promise.all(this._manager.recentlyOpened.map((e=>this._manager.validate(e))))}onBeforeAttach(e){const n=new p.PromiseDelegate;setTimeout((()=>{n.reject("Recents validation timed out.")}),550),Promise.race([n.promise,this._validateRecentlyOpened()]).then((()=>{this.update()})).catch((()=>{})),super.onBeforeAttach(e)}updateItems(){this.clearItems(),this.addItem({command:a.reopenLast}),this.addItem({type:"separator"});let e=!0,n=!1;this._manager.recentlyOpened.sort(((e,n)=>e.contentType===n.contentType?0:"directory"!==e.contentType?1:-1)).forEach((t=>{if("directory"===t.contentType){if(!this._showDirectories)return;n=!0}else e&&n&&(e=!1,this.addItem({type:"separator"}));this.addItem({command:a.openRecent,args:{recent:t}})})),this.addItem({type:"separator"}),this.addItem({command:a.clearRecents})}}const v={id:"@jupyterlab/mainmenu-extension:recents",description:"Adds sub-menu for opening recent documents to the File section of the main menu.",autoStart:!0,requires:[_.IRecentsManager,s.IMainMenu],optional:[g.IFileBrowserCommands,c.ITranslator],activate:(e,n,t,o,s)=>{const{commands:d}=e,i=(null!=s?s:c.nullTranslator).load("jupyterlab"),u=null!==o,m=async e=>{const t=await n.validate(e);return t||await(0,l.showErrorMessage)(i.__("Could Not Open Recent"),i.__("%1 is no longer valid and will be removed from the list",e.path)),t};d.addCommand(a.openRecent,{execute:async e=>{const n=e.recent,t=""===n.path?"/":n.path;await m(n)&&(o&&"directory"===n.contentType?await d.execute(o.openPath,{path:t}):await d.execute("docmanager:open",{path:t,factory:n.factory}))},label:e=>{const n=e.recent;return n?r.PathExt.joinWithLeadingSlash(n.root,n.path):i.__("Open a Recent Document (given by `recent` argument)")},isEnabled:e=>n.recentlyOpened.includes(e.recent)}),e.commands.addCommand(a.reopenLast,{execute:async()=>{const e=n.recentlyClosed[0];e&&await m(e)&&(await d.execute("docmanager:open",{path:e.path,factory:e.factory}),n.removeRecent(e,"closed"))},label:()=>{const e=n.recentlyClosed[0];return e?i.__("Reopen %1",e.path):i.__("Reopen Closed Document")},isEnabled:()=>0!==n.recentlyClosed.length,caption:i.__("Reopen recently closed file or notebook.")});const p=new b({commands:d,manager:n,showDirectories:u});p.title.label=i.__("Open Recent"),t.fileMenu.addItem({type:"submenu",submenu:p,rank:1})}},C="@jupyterlab/mainmenu-extension:plugin";var w;!function(e){e.openEdit="editmenu:open",e.undo="editmenu:undo",e.redo="editmenu:redo",e.clearCurrent="editmenu:clear-current",e.clearAll="editmenu:clear-all",e.find="editmenu:find",e.goToLine="editmenu:go-to-line",e.openFile="filemenu:open",e.closeAndCleanup="filemenu:close-and-cleanup",e.createConsole="filemenu:create-console",e.shutdown="filemenu:shutdown",e.logout="filemenu:logout",e.openKernel="kernelmenu:open",e.interruptKernel="kernelmenu:interrupt",e.reconnectToKernel="kernelmenu:reconnect-to-kernel",e.restartKernel="kernelmenu:restart",e.restartKernelAndClear="kernelmenu:restart-and-clear",e.changeKernel="kernelmenu:change",e.shutdownKernel="kernelmenu:shutdown",e.shutdownAllKernels="kernelmenu:shutdownAll",e.openView="viewmenu:open",e.wordWrap="viewmenu:word-wrap",e.lineNumbering="viewmenu:line-numbering",e.matchBrackets="viewmenu:match-brackets",e.openRun="runmenu:open",e.run="runmenu:run",e.runAll="runmenu:run-all",e.restartAndRunAll="runmenu:restart-and-run-all",e.runAbove="runmenu:run-above",e.runBelow="runmenu:run-below",e.openTabs="tabsmenu:open",e.activateById="tabsmenu:activate-by-id",e.activatePreviouslyUsedTab="tabsmenu:activate-previously-used-tab",e.openSettings="settingsmenu:open",e.openHelp="helpmenu:open",e.getKernel="helpmenu:get-kernel",e.openFirst="mainmenu:open-first"}(w||(w={}));const f=[{id:C,description:"Adds and provides the application main menu.",requires:[o.IRouter,c.ITranslator],optional:[l.ICommandPalette,o.ILabShell,i.ISettingRegistry],provides:s.IMainMenu,activate:async(e,n,t,a,i,c)=>{const{commands:p}=e,_=t.load("jupyterlab"),g=new s.MainMenu(p);g.id="jp-MainMenu",g.addClass("jp-scrollbar-tiny"),c&&(await y.loadSettingsMenu(c,(e=>{g.addMenu(e,!1,{rank:e.rank})}),(e=>s.MainMenu.generateMenu(p,e,_)),t),g.update());const b=r.PageConfig.getOption("quitButton").toLowerCase();g.fileMenu.quitEntry="true"===b,function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.undo,commands:a,shell:l,semanticCommands:n.undoers.undo,default:{label:t.__("Undo")},trans:t}),(0,o.addSemanticCommand)({id:w.redo,commands:a,shell:l,semanticCommands:n.undoers.redo,default:{label:t.__("Redo")},trans:t}),(0,o.addSemanticCommand)({id:w.clearCurrent,commands:a,shell:l,semanticCommands:n.clearers.clearCurrent,default:{label:t.__("Clear")},trans:t}),(0,o.addSemanticCommand)({id:w.clearAll,commands:a,shell:l,semanticCommands:n.clearers.clearAll,default:{label:t.__("Clear All")},trans:t}),(0,o.addSemanticCommand)({id:w.goToLine,commands:a,shell:l,semanticCommands:n.goToLiners,default:{label:t.__("Go to Line…")},trans:t})}(e,g.editMenu,_),function(e,n,t,a){const{commands:s,shell:i}=e;(0,o.addSemanticCommand)({id:w.closeAndCleanup,commands:s,shell:i,semanticCommands:n.closeAndCleaners,default:{execute:"application:close",label:a.__("Close and Shut Down"),isEnabled:!0},overrides:{isEnabled:()=>!!e.shell.currentWidget&&!!e.shell.currentWidget.title.closable},trans:a}),(0,o.addSemanticCommand)({id:w.createConsole,commands:s,shell:i,semanticCommands:n.consoleCreators,default:{label:a.__("New Console for Activity")},trans:a}),s.addCommand(w.shutdown,{label:a.__("Shut Down"),caption:a.__("Shut down %1",e.name),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>(0,l.showDialog)({title:a.__("Shutdown confirmation"),body:a.__("Please confirm you want to shut down %1.",e.name),buttons:[l.Dialog.cancelButton(),l.Dialog.warnButton({label:a.__("Shut Down")})]}).then((async n=>{if(n.button.accept){const n=d.ServerConnection.makeSettings(),t=r.URLExt.join(n.baseUrl,"api/shutdown");try{await Promise.all([e.serviceManager.sessions.shutdownAll(),e.serviceManager.terminals.shutdownAll()])}catch(e){console.log(`Failed to shutdown sessions and terminals: ${e}`)}return d.ServerConnection.makeRequest(t,{method:"POST"},n).then((n=>{if(!n.ok)throw new d.ServerConnection.ResponseError(n);{const n=document.createElement("div"),t=document.createElement("p");t.textContent=a.__("You have shut down the Jupyter server. You can now close this tab.");const o=document.createElement("p");o.textContent=a.__("To use %1 again, you will need to relaunch it.",e.name),n.appendChild(t),n.appendChild(o),(0,l.showDialog)({title:a.__("Server stopped"),body:new h.Widget({node:n}),buttons:[]}),window.close()}})).catch((e=>{throw new d.ServerConnection.NetworkError(e)}))}}))}),s.addCommand(w.logout,{label:a.__("Log Out"),caption:a.__("Log out of %1",e.name),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>{t.navigate("/logout",{hard:!0})}})}(e,g.fileMenu,n,_),function(e,n,t){const{commands:a,shell:r}=e;(0,o.addSemanticCommand)({id:w.interruptKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.interruptKernel,default:{label:t.__("Interrupt Kernel"),caption:t.__("Interrupt the kernel")},overrides:{icon:e=>e.toolbar?u.stopIcon:void 0},trans:t}),(0,o.addSemanticCommand)({id:w.reconnectToKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.reconnectToKernel,default:{label:t.__("Reconnect to Kernel")},trans:t}),(0,o.addSemanticCommand)({id:w.restartKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.restartKernel,default:{label:t.__("Restart Kernel…"),caption:t.__("Restart the kernel")},overrides:{icon:e=>e.toolbar?u.refreshIcon:void 0},trans:t}),(0,o.addSemanticCommand)({id:w.restartKernelAndClear,commands:a,shell:r,semanticCommands:[n.kernelUsers.restartKernel,n.kernelUsers.clearWidget],default:{label:t.__("Restart Kernel and Clear…")},trans:t}),(0,o.addSemanticCommand)({id:w.changeKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.changeKernel,default:{label:t.__("Change Kernel…")},trans:t}),(0,o.addSemanticCommand)({id:w.shutdownKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.shutdownKernel,default:{label:t.__("Shut Down Kernel"),caption:t.__("Shut down kernel")},trans:t}),a.addCommand(w.shutdownAllKernels,{label:t.__("Shut Down All Kernels…"),isEnabled:()=>!e.serviceManager.sessions.running().next().done,execute:()=>(0,l.showDialog)({title:t.__("Shut Down All?"),body:t.__("Shut down all kernels?"),buttons:[l.Dialog.cancelButton({label:t.__("Dismiss")}),l.Dialog.warnButton({label:t.__("Shut Down All")})]}).then((n=>{if(n.button.accept)return e.serviceManager.sessions.shutdownAll()}))})}(e,g.kernelMenu,_),function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.run,commands:a,shell:l,semanticCommands:n.codeRunners.run,default:{label:t.__("Run Selected"),caption:t.__("Run Selected")},overrides:{icon:e=>e.toolbar?u.runIcon:void 0},trans:t}),(0,o.addSemanticCommand)({id:w.runAll,commands:a,shell:l,semanticCommands:n.codeRunners.runAll,default:{label:t.__("Run All"),caption:t.__("Run All")},trans:t}),(0,o.addSemanticCommand)({id:w.restartAndRunAll,commands:a,shell:l,semanticCommands:[n.codeRunners.restart,n.codeRunners.runAll],default:{label:t.__("Restart Kernel and Run All"),caption:t.__("Restart Kernel and Run All")},overrides:{icon:e=>e.toolbar?u.fastForwardIcon:void 0},trans:t})}(e,g.runMenu,_),function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.lineNumbering,commands:a,shell:l,semanticCommands:n.editorViewers.toggleLineNumbers,default:{label:t.__("Show Line Numbers")},trans:t}),(0,o.addSemanticCommand)({id:w.matchBrackets,commands:a,shell:l,semanticCommands:n.editorViewers.toggleMatchBrackets,default:{label:t.__("Match Brackets")},trans:t}),(0,o.addSemanticCommand)({id:w.wordWrap,commands:a,shell:l,semanticCommands:n.editorViewers.toggleWordWrap,default:{label:t.__("Wrap Words")},trans:t})}(e,g.viewMenu,_),function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.getKernel,commands:a,shell:l,semanticCommands:n.getKernel,default:{label:t.__("Get Kernel"),isVisible:!1},trans:t})}(e,g.helpMenu,_),i&&function(e,n,t,a){const o=e.commands,l=[];let r;o.addCommand(w.activateById,{label:n=>{if(void 0===n.id)return a.__("Activate a widget by its `id`.");const t=n.id||"",o=(0,m.find)(e.shell.widgets("main"),(e=>e.id===t));return o&&o.title.label||""},isToggled:n=>{const t=n.id||"";return!!e.shell.currentWidget&&e.shell.currentWidget.id===t},execute:n=>e.shell.activateById(n.id||"")});let s="";o.addCommand(w.activatePreviouslyUsedTab,{label:a.__("Activate Previously Used Tab"),isEnabled:()=>!!s,execute:()=>o.execute(w.activateById,{id:s})}),t&&e.restored.then((()=>{const a=()=>{r&&!r.isDisposed&&r.dispose(),l.length=0;let t=!1;for(const n of e.shell.widgets("main"))n.id===s&&(t=!0),l.push({command:w.activateById,args:{id:n.id}});r=n.addGroup(l,1),s=t?s:""};a(),t.layoutModified.connect((()=>{a()})),t.currentChanged.connect(((e,n)=>{const t=n.oldValue;t&&(s=t.id)}))}))}(e,g.tabsMenu,i,_);const v=e=>{g.activeMenu=e,g.openActiveMenu()};return p.addCommand(w.openEdit,{label:_.__("Open Edit Menu"),execute:()=>v(g.editMenu)}),p.addCommand(w.openFile,{label:_.__("Open File Menu"),execute:()=>v(g.fileMenu)}),p.addCommand(w.openKernel,{label:_.__("Open Kernel Menu"),execute:()=>v(g.kernelMenu)}),p.addCommand(w.openRun,{label:_.__("Open Run Menu"),execute:()=>v(g.runMenu)}),p.addCommand(w.openView,{label:_.__("Open View Menu"),execute:()=>v(g.viewMenu)}),p.addCommand(w.openSettings,{label:_.__("Open Settings Menu"),execute:()=>v(g.settingsMenu)}),p.addCommand(w.openTabs,{label:_.__("Open Tabs Menu"),execute:()=>v(g.tabsMenu)}),p.addCommand(w.openHelp,{label:_.__("Open Help Menu"),execute:()=>v(g.helpMenu)}),p.addCommand(w.openFirst,{label:_.__("Open First Menu"),execute:()=>{g.activeIndex=0,g.openActiveMenu()}}),a&&(a.addItem({command:w.shutdown,category:_.__("Main Area")}),a.addItem({command:w.logout,category:_.__("Main Area")}),a.addItem({command:w.shutdownAllKernels,category:_.__("Kernel Operations")}),a.addItem({command:w.activatePreviouslyUsedTab,category:_.__("Main Area")})),e.shell.add(g,"menu",{rank:100}),g}},v];var y;!function(e){async function n(e){(await(0,l.showDialog)({title:e.__("Information"),body:e.__("Menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[l.Dialog.cancelButton(),l.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsMenu=async function(e,t,a,o){var r;const s=o.load("jupyterlab");let d=null,c={};function u(n){var t,a;c={};const o=Object.keys(e.plugins).map((n=>{var t,a;const o=null!==(a=null===(t=e.plugins[n].schema["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[];return c[n]=o,o})).concat([null!==(a=null===(t=n["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[]]).reduceRight(((e,n)=>i.SettingRegistry.reconcileMenus(e,n,!0)),n.properties.menus.default);n.properties.menus.default=i.SettingRegistry.reconcileMenus(o,n.properties.menus.default,!0).sort(((e,n)=>{var t,a;return(null!==(t=e.rank)&&void 0!==t?t:1/0)-(null!==(a=n.rank)&&void 0!==a?a:1/0)}))}e.transform(C,{compose:e=>{var n,t,a,o;d||(d=p.JSONExt.deepCopy(e.schema),u(d));const l=null!==(a=null===(t=null===(n=d.properties)||void 0===n?void 0:n.menus)||void 0===t?void 0:t.default)&&void 0!==a?a:[],r={...e.data.user,menus:null!==(o=e.data.user.menus)&&void 0!==o?o:[]},s={...e.data.composite,menus:i.SettingRegistry.reconcileMenus(l,r.menus)};return e.data={composite:s,user:r},e},fetch:e=>(d||(d=p.JSONExt.deepCopy(e.schema),u(d)),{data:e.data,id:e.id,raw:e.raw,schema:d,version:e.version})});const m=await e.load(C),h=null!==(r=p.JSONExt.deepCopy(m.composite.menus))&&void 0!==r?r:[],_=new Array;l.MenuFactory.createMenus(h.filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}})),a).forEach((e=>{_.push(e),t(e)})),m.changed.connect((()=>{var e;const t=null!==(e=m.composite.menus)&&void 0!==e?e:[];p.JSONExt.deepEqual(h,t)||n(s)})),e.pluginChanged.connect((async(o,r)=>{var d,u,m;if(r!==C){const o=null!==(d=c[r])&&void 0!==d?d:[],g=null!==(m=null===(u=e.plugins[r].schema["jupyter.lab.menus"])||void 0===u?void 0:u.main)&&void 0!==m?m:[];if(!p.JSONExt.deepEqual(o,g))if(c[r])await n(s);else{c[r]=p.JSONExt.deepCopy(g);const e=i.SettingRegistry.reconcileMenus(g,h,!1,!1).filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}}));l.MenuFactory.updateMenus(_,e,a).forEach((e=>{t(e)}))}}}))}}(y||(y={}))}}]);
1
+ "use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[545],{60545:(e,n,t)=>{t.r(n),t.d(n,{CommandIDs:()=>w,default:()=>f});var a,o=t(27961),l=t(15465),r=t(44548),s=t(2646),d=t(60211),i=t(87844),c=t(25291),u=t(12668),m=t(33625),p=t(20998),h=t(63485),_=t(94624),g=t(73684);!function(e){e.openRecent="recentmenu:open-recent",e.reopenLast="recentmenu:reopen-last",e.clearRecents="docmanager:clear-recents"}(a||(a={}));class b extends h.Menu{constructor(e){super(e),this._manager=e.manager,this._showDirectories=e.showDirectories,this.updateItems(),this._manager.changed.connect(this.updateItems,this)}async _validateRecentlyOpened(){Promise.all(this._manager.recentlyOpened.map((e=>this._manager.validate(e))))}onBeforeAttach(e){const n=new p.PromiseDelegate;setTimeout((()=>{n.reject("Recents validation timed out.")}),550),Promise.race([n.promise,this._validateRecentlyOpened()]).then((()=>{this.update()})).catch((()=>{})),super.onBeforeAttach(e)}updateItems(){this.clearItems(),this.addItem({command:a.reopenLast}),this.addItem({type:"separator"});let e=!0,n=!1;this._manager.recentlyOpened.sort(((e,n)=>e.contentType===n.contentType?0:"directory"!==e.contentType?1:-1)).forEach((t=>{if("directory"===t.contentType){if(!this._showDirectories)return;n=!0}else e&&n&&(e=!1,this.addItem({type:"separator"}));this.addItem({command:a.openRecent,args:{recent:t}})})),this.addItem({type:"separator"}),this.addItem({command:a.clearRecents})}}const v={id:"@jupyterlab/mainmenu-extension:recents",description:"Adds sub-menu for opening recent documents to the File section of the main menu.",autoStart:!0,requires:[_.IRecentsManager,s.IMainMenu],optional:[g.IFileBrowserCommands,c.ITranslator],activate:(e,n,t,o,s)=>{const{commands:d}=e,i=(null!=s?s:c.nullTranslator).load("jupyterlab"),u=null!==o,m=async e=>{const t=await n.validate(e);return t||await(0,l.showErrorMessage)(i.__("Could Not Open Recent"),i.__("%1 is no longer valid and will be removed from the list",e.path)),t};d.addCommand(a.openRecent,{execute:async e=>{const n=e.recent,t=""===n.path?"/":n.path;await m(n)&&(o&&"directory"===n.contentType?await d.execute(o.openPath,{path:t}):await d.execute("docmanager:open",{path:t,factory:n.factory}))},label:e=>{const n=e.recent;return n?r.PathExt.joinWithLeadingSlash(n.root,n.path):i.__("Open a Recent Document (given by `recent` argument)")},isEnabled:e=>n.recentlyOpened.includes(e.recent)}),e.commands.addCommand(a.reopenLast,{execute:async()=>{const e=n.recentlyClosed[0];e&&await m(e)&&(await d.execute("docmanager:open",{path:e.path,factory:e.factory}),n.removeRecent(e,"closed"))},label:()=>{const e=n.recentlyClosed[0];return e?i.__("Reopen %1",e.path):i.__("Reopen Closed Document")},isEnabled:()=>0!==n.recentlyClosed.length,caption:i.__("Reopen recently closed file or notebook.")});const p=new b({commands:d,manager:n,showDirectories:u});p.title.label=i.__("Open Recent"),t.fileMenu.addItem({type:"submenu",submenu:p,rank:1})}},C="@jupyterlab/mainmenu-extension:plugin";var w;!function(e){e.openEdit="editmenu:open",e.undo="editmenu:undo",e.redo="editmenu:redo",e.clearCurrent="editmenu:clear-current",e.clearAll="editmenu:clear-all",e.find="editmenu:find",e.goToLine="editmenu:go-to-line",e.openFile="filemenu:open",e.closeAndCleanup="filemenu:close-and-cleanup",e.createConsole="filemenu:create-console",e.shutdown="filemenu:shutdown",e.logout="filemenu:logout",e.openKernel="kernelmenu:open",e.interruptKernel="kernelmenu:interrupt",e.reconnectToKernel="kernelmenu:reconnect-to-kernel",e.restartKernel="kernelmenu:restart",e.restartKernelAndClear="kernelmenu:restart-and-clear",e.changeKernel="kernelmenu:change",e.shutdownKernel="kernelmenu:shutdown",e.shutdownAllKernels="kernelmenu:shutdownAll",e.openView="viewmenu:open",e.wordWrap="viewmenu:word-wrap",e.lineNumbering="viewmenu:line-numbering",e.matchBrackets="viewmenu:match-brackets",e.openRun="runmenu:open",e.run="runmenu:run",e.runAll="runmenu:run-all",e.restartAndRunAll="runmenu:restart-and-run-all",e.runAbove="runmenu:run-above",e.runBelow="runmenu:run-below",e.openTabs="tabsmenu:open",e.activateById="tabsmenu:activate-by-id",e.activatePreviouslyUsedTab="tabsmenu:activate-previously-used-tab",e.openSettings="settingsmenu:open",e.openHelp="helpmenu:open",e.getKernel="helpmenu:get-kernel",e.openFirst="mainmenu:open-first"}(w||(w={}));const f=[{id:C,description:"Adds and provides the application main menu.",requires:[o.IRouter,c.ITranslator],optional:[l.ICommandPalette,o.ILabShell,i.ISettingRegistry],provides:s.IMainMenu,activate:async(e,n,t,a,i,c)=>{const{commands:p}=e,_=t.load("jupyterlab"),g=new s.MainMenu(p);g.id="jp-MainMenu",g.addClass("jp-scrollbar-tiny"),c&&(await y.loadSettingsMenu(c,(e=>{g.addMenu(e,!1,{rank:e.rank})}),(e=>s.MainMenu.generateMenu(p,e,_)),t),g.update());const b=r.PageConfig.getOption("quitButton").toLowerCase();g.fileMenu.quitEntry="true"===b,function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.undo,commands:a,shell:l,semanticCommands:n.undoers.undo,default:{label:t.__("Undo")},trans:t}),(0,o.addSemanticCommand)({id:w.redo,commands:a,shell:l,semanticCommands:n.undoers.redo,default:{label:t.__("Redo")},trans:t}),(0,o.addSemanticCommand)({id:w.clearCurrent,commands:a,shell:l,semanticCommands:n.clearers.clearCurrent,default:{label:t.__("Clear")},trans:t}),(0,o.addSemanticCommand)({id:w.clearAll,commands:a,shell:l,semanticCommands:n.clearers.clearAll,default:{label:t.__("Clear All")},trans:t}),(0,o.addSemanticCommand)({id:w.goToLine,commands:a,shell:l,semanticCommands:n.goToLiners,default:{label:t.__("Go to Line…")},trans:t})}(e,g.editMenu,_),function(e,n,t,a){const{commands:s,shell:i}=e;(0,o.addSemanticCommand)({id:w.closeAndCleanup,commands:s,shell:i,semanticCommands:n.closeAndCleaners,default:{execute:"application:close",label:a.__("Close and Shut Down"),isEnabled:!0},overrides:{isEnabled:()=>!!e.shell.currentWidget&&!!e.shell.currentWidget.title.closable},trans:a}),(0,o.addSemanticCommand)({id:w.createConsole,commands:s,shell:i,semanticCommands:n.consoleCreators,default:{label:a.__("New Console for Activity")},trans:a}),s.addCommand(w.shutdown,{label:a.__("Shut Down"),caption:a.__("Shut down %1",e.name),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>(0,l.showDialog)({title:a.__("Shutdown confirmation"),body:a.__("Please confirm you want to shut down %1.",e.name),buttons:[l.Dialog.cancelButton(),l.Dialog.warnButton({label:a.__("Shut Down")})]}).then((async n=>{if(n.button.accept){const n=d.ServerConnection.makeSettings(),t=r.URLExt.join(n.baseUrl,"api/shutdown");try{await Promise.all([e.serviceManager.sessions.shutdownAll(),e.serviceManager.terminals.shutdownAll()])}catch(e){console.log(`Failed to shutdown sessions and terminals: ${e}`)}return d.ServerConnection.makeRequest(t,{method:"POST"},n).then((n=>{if(!n.ok)throw new d.ServerConnection.ResponseError(n);{const n=document.createElement("div"),t=document.createElement("p");t.textContent=a.__("You have shut down the Jupyter server. You can now close this tab.");const o=document.createElement("p");o.textContent=a.__("To use %1 again, you will need to relaunch it.",e.name),n.appendChild(t),n.appendChild(o),(0,l.showDialog)({title:a.__("Server stopped"),body:new h.Widget({node:n}),buttons:[]}),window.close()}})).catch((e=>{throw new d.ServerConnection.NetworkError(e)}))}}))}),s.addCommand(w.logout,{label:a.__("Log Out"),caption:a.__("Log out of %1",e.name),isVisible:()=>n.quitEntry,isEnabled:()=>n.quitEntry,execute:()=>{t.navigate("/logout",{hard:!0})}})}(e,g.fileMenu,n,_),function(e,n,t){const{commands:a,shell:r}=e;(0,o.addSemanticCommand)({id:w.interruptKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.interruptKernel,default:{label:t.__("Interrupt Kernel"),caption:t.__("Interrupt the kernel")},overrides:{icon:e=>e.toolbar?u.stopIcon:void 0},trans:t}),(0,o.addSemanticCommand)({id:w.reconnectToKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.reconnectToKernel,default:{label:t.__("Reconnect to Kernel")},trans:t}),(0,o.addSemanticCommand)({id:w.restartKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.restartKernel,default:{label:t.__("Restart Kernel…"),caption:t.__("Restart the kernel")},overrides:{icon:e=>e.toolbar?u.refreshIcon:void 0},trans:t}),(0,o.addSemanticCommand)({id:w.restartKernelAndClear,commands:a,shell:r,semanticCommands:[n.kernelUsers.restartKernel,n.kernelUsers.clearWidget],default:{label:t.__("Restart Kernel and Clear…")},trans:t}),(0,o.addSemanticCommand)({id:w.changeKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.changeKernel,default:{label:t.__("Change Kernel…")},trans:t}),(0,o.addSemanticCommand)({id:w.shutdownKernel,commands:a,shell:r,semanticCommands:n.kernelUsers.shutdownKernel,default:{label:t.__("Shut Down Kernel"),caption:t.__("Shut down kernel")},trans:t}),a.addCommand(w.shutdownAllKernels,{label:t.__("Shut Down All Kernels…"),isEnabled:()=>!e.serviceManager.sessions.running().next().done,execute:()=>(0,l.showDialog)({title:t.__("Shut Down All?"),body:t.__("Shut down all kernels?"),buttons:[l.Dialog.cancelButton({label:t.__("Dismiss")}),l.Dialog.warnButton({label:t.__("Shut Down All")})]}).then((n=>{if(n.button.accept)return e.serviceManager.sessions.shutdownAll()}))})}(e,g.kernelMenu,_),function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.run,commands:a,shell:l,semanticCommands:n.codeRunners.run,default:{label:t.__("Run Selected"),caption:t.__("Run Selected")},overrides:{icon:e=>e.toolbar?u.runIcon:void 0},trans:t}),(0,o.addSemanticCommand)({id:w.runAll,commands:a,shell:l,semanticCommands:n.codeRunners.runAll,default:{label:t.__("Run All"),caption:t.__("Run All")},trans:t}),(0,o.addSemanticCommand)({id:w.restartAndRunAll,commands:a,shell:l,semanticCommands:[n.codeRunners.restart,n.codeRunners.runAll],default:{label:t.__("Restart Kernel and Run All"),caption:t.__("Restart Kernel and Run All")},overrides:{icon:e=>e.toolbar?u.fastForwardIcon:void 0},trans:t})}(e,g.runMenu,_),function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.lineNumbering,commands:a,shell:l,semanticCommands:n.editorViewers.toggleLineNumbers,default:{label:t.__("Show Line Numbers")},trans:t}),(0,o.addSemanticCommand)({id:w.matchBrackets,commands:a,shell:l,semanticCommands:n.editorViewers.toggleMatchBrackets,default:{label:t.__("Match Brackets")},trans:t}),(0,o.addSemanticCommand)({id:w.wordWrap,commands:a,shell:l,semanticCommands:n.editorViewers.toggleWordWrap,default:{label:t.__("Wrap Words")},trans:t})}(e,g.viewMenu,_),function(e,n,t){const{commands:a,shell:l}=e;(0,o.addSemanticCommand)({id:w.getKernel,commands:a,shell:l,semanticCommands:n.getKernel,default:{label:t.__("Get Kernel"),isVisible:!1},trans:t})}(e,g.helpMenu,_),i&&function(e,n,t,a){const o=e.commands,l=[];let r;o.addCommand(w.activateById,{label:n=>{if(void 0===n.id)return a.__("Activate a widget by its `id`.");const t=n.id||"",o=(0,m.find)(e.shell.widgets("main"),(e=>e.id===t));return o&&o.title.label||""},isToggled:n=>{const t=n.id||"";return!!e.shell.currentWidget&&e.shell.currentWidget.id===t},execute:n=>e.shell.activateById(n.id||"")});let s="";o.addCommand(w.activatePreviouslyUsedTab,{label:a.__("Activate Previously Used Tab"),isEnabled:()=>!!s,execute:()=>o.execute(w.activateById,{id:s})}),t&&e.restored.then((()=>{const a=()=>{r&&!r.isDisposed&&r.dispose(),l.length=0;let t=!1;for(const n of e.shell.widgets("main"))n.id===s&&(t=!0),l.push({command:w.activateById,args:{id:n.id}});r=n.addGroup(l,1),s=t?s:""};a(),t.layoutModified.connect((()=>{a()})),t.currentChanged.connect(((e,n)=>{const t=n.oldValue;t&&(s=t.id)}))}))}(e,g.tabsMenu,i,_);const v=e=>{g.activeMenu=e,g.openActiveMenu()};return p.addCommand(w.openEdit,{label:_.__("Open Edit Menu"),execute:()=>v(g.editMenu)}),p.addCommand(w.openFile,{label:_.__("Open File Menu"),execute:()=>v(g.fileMenu)}),p.addCommand(w.openKernel,{label:_.__("Open Kernel Menu"),execute:()=>v(g.kernelMenu)}),p.addCommand(w.openRun,{label:_.__("Open Run Menu"),execute:()=>v(g.runMenu)}),p.addCommand(w.openView,{label:_.__("Open View Menu"),execute:()=>v(g.viewMenu)}),p.addCommand(w.openSettings,{label:_.__("Open Settings Menu"),execute:()=>v(g.settingsMenu)}),p.addCommand(w.openTabs,{label:_.__("Open Tabs Menu"),execute:()=>v(g.tabsMenu)}),p.addCommand(w.openHelp,{label:_.__("Open Help Menu"),execute:()=>v(g.helpMenu)}),p.addCommand(w.openFirst,{label:_.__("Open First Menu"),execute:()=>{g.activeIndex=0,g.openActiveMenu()}}),a&&(a.addItem({command:w.shutdown,category:_.__("Main Area")}),a.addItem({command:w.logout,category:_.__("Main Area")}),a.addItem({command:w.shutdownAllKernels,category:_.__("Kernel Operations")}),a.addItem({command:w.activatePreviouslyUsedTab,category:_.__("Main Area")})),e.shell.add(g,"menu",{rank:100}),g}},v];var y;!function(e){async function n(e){(await(0,l.showDialog)({title:e.__("Information"),body:e.__("Menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[l.Dialog.cancelButton(),l.Dialog.okButton({label:e.__("Reload")})]})).button.accept&&location.reload()}e.loadSettingsMenu=async function(e,t,a,o){var r;const s=o.load("jupyterlab");let d=null,c={};function u(n){var t,a;c={};const o=Object.keys(e.plugins).map((n=>{var t,a;const o=null!==(a=null===(t=e.plugins[n].schema["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[];return c[n]=o,o})).concat([null!==(a=null===(t=n["jupyter.lab.menus"])||void 0===t?void 0:t.main)&&void 0!==a?a:[]]).reduceRight(((e,n)=>i.SettingRegistry.reconcileMenus(e,n,!0)),n.properties.menus.default);n.properties.menus.default=i.SettingRegistry.reconcileMenus(o,n.properties.menus.default,!0).sort(((e,n)=>{var t,a;return(null!==(t=e.rank)&&void 0!==t?t:1/0)-(null!==(a=n.rank)&&void 0!==a?a:1/0)}))}e.transform(C,{compose:e=>{var n,t,a,o;d||(d=p.JSONExt.deepCopy(e.schema),u(d));const l=null!==(a=null===(t=null===(n=d.properties)||void 0===n?void 0:n.menus)||void 0===t?void 0:t.default)&&void 0!==a?a:[],r={...e.data.user,menus:null!==(o=e.data.user.menus)&&void 0!==o?o:[]},s={...e.data.composite,menus:i.SettingRegistry.reconcileMenus(l,r.menus)};return e.data={composite:s,user:r},e},fetch:e=>(d||(d=p.JSONExt.deepCopy(e.schema),u(d)),{data:e.data,id:e.id,raw:e.raw,schema:d,version:e.version})});const m=await e.load(C),h=null!==(r=p.JSONExt.deepCopy(m.composite.menus))&&void 0!==r?r:[],_=new Array;l.MenuFactory.createMenus(h.filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}})),a).forEach((e=>{_.push(e),t(e)})),m.changed.connect((()=>{var e;const t=null!==(e=m.composite.menus)&&void 0!==e?e:[];p.JSONExt.deepEqual(h,t)||n(s)})),e.pluginChanged.connect((async(o,r)=>{var d,u,m;if(r!==C){const o=null!==(d=c[r])&&void 0!==d?d:[],g=null!==(m=null===(u=e.plugins[r].schema["jupyter.lab.menus"])||void 0===u?void 0:u.main)&&void 0!==m?m:[];if(!p.JSONExt.deepEqual(o,g))if(c[r])await n(s);else{c[r]=p.JSONExt.deepCopy(g);const e=i.SettingRegistry.reconcileMenus(g,h,!1,!1).filter((e=>!e.disabled)).map((e=>{var n;return{...e,items:i.SettingRegistry.filterDisabledItems(null!==(n=e.items)&&void 0!==n?n:[])}}));l.MenuFactory.updateMenus(_,e,a).forEach((e=>{t(e)}))}}}))}}(y||(y={}))}}]);