@datalayer/agent-runtimes 1.6.72 → 1.6.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed/chunks/{AgentDetails-JEKCQYM4.js → AgentDetails-LhuDov4Q.js} +1 -1
- package/dist-embed/chunks/{AgentDetailsDialog-NAMvdHyL.js → AgentDetailsDialog-DMTVgMus.js} +1 -1
- package/dist-embed/chunks/AgentInspector-DwJHlEsw.js +1 -0
- package/dist-embed/chunks/{AgentInspectorDialog-CyHzEFe4.js → AgentInspectorDialog-WpVv_yIt.js} +1 -1
- package/dist-embed/chunks/{CellSidebarExtension-Dx_Rm2j5.js → CellSidebarExtension-DwGg7VbR.js} +7 -7
- package/dist-embed/chunks/{ChatView-IgMCIcQU.js → ChatView-eRieNBDa.js} +1 -1
- package/dist-embed/chunks/{CollapsiblePlugin-Cw8Q8IWz.js → CollapsiblePlugin-DS2HZl7a.js} +1 -1
- package/dist-embed/chunks/{ContextPie-krf-G4Ja.js → ContextPie-C0N8hwmj.js} +1 -1
- package/dist-embed/chunks/{DeckComponent-CGTzTPwI.js → DeckComponent-1aJoEglD.js} +2 -2
- package/dist-embed/chunks/{DocumentView-BM7pVo1r.js → DocumentView-CaVDL8X7.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument--_i7ghFX.js → EphemeralDocument-SeXQLZbi.js} +1 -1
- package/dist-embed/chunks/{EphemeralNotebook-DVY3SPVf.js → EphemeralNotebook-DrL1r8Nx.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-CGM8z5XO.js → ExcalidrawComponent-CoZvA0u7.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-4MXeDi6L.js → ExcalidrawModal-Czd2Kx8H.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-BGj3tSI6.js → JupyterLexicalExtension-Du1Loz2o.js} +29 -29
- package/dist-embed/chunks/{KernelVariables-DLBQe0HT.js → KernelVariables-CmWkosM8.js} +1 -1
- package/dist-embed/chunks/{LexicalToolRegistry-CxKoI0Fi.js → LexicalToolRegistry-BZUJ9wvF.js} +1 -1
- package/dist-embed/chunks/{NotebookToolSurfaces-BcUESGXl.js → NotebookToolSurfaces-m37Crb7c.js} +1 -1
- package/dist-embed/chunks/{NotebookView-CyxaVN-O.js → NotebookView-DeCxHOph.js} +1 -1
- package/dist-embed/chunks/{Output-DePHyrJp.js → Output-CJVIj3Io.js} +6 -6
- package/dist-embed/chunks/{SandboxDetailsDialog-V-oSQL_u.js → SandboxDetailsDialog-B4_0r2A_.js} +1 -1
- package/dist-embed/chunks/{SchemaForm-Cnusp_g9.js → SchemaForm-9JmMbUiD.js} +1 -1
- package/dist-embed/chunks/{SheetTabs-wZqQpkX8.js → SheetTabs-DJLVReVo.js} +2 -2
- package/dist-embed/chunks/{SpreadsheetPreviewView-DljhwLEp.js → SpreadsheetPreviewView-BGdz5D65.js} +1 -1
- package/dist-embed/chunks/{SpreadsheetView-BuUfKXea.js → SpreadsheetView-BvCWGCsx.js} +1 -1
- package/dist-embed/chunks/{WidgetVariableView-C-NLJIdO.js → WidgetVariableView-B9KgSbhv.js} +1 -1
- package/dist-embed/chunks/{YouTubePlugin-CasHY3Io.js → YouTubePlugin-DtVTIrdm.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-Din4lNdn.js → abnfDiagram-VCTEODGH-BG9Jt7Hr.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-GnaR64st.js → abnfDiagram-VCTEODGH-CvZ8usho.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-BSmEjUJk.js → abnfDiagram-VCTEODGH-DN0kRlog.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-DxZmaXSr.js → ar-SA-G6X2FPQ2-C-nP9nq8.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-B0gp8U3r.js → architectureDiagram-5GKGNRK7-87FtCsnw.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-ByAYkSMW.js → architectureDiagram-5GKGNRK7-Bwqgkba9.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-Cy6c9GhS.js → architectureDiagram-5GKGNRK7-DRfUn2vu.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-D6_hI1qP.js → az-AZ-76LH7QW2-WoAwmwN_.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-DD3spkPC.js → bg-BG-XCXSNQG7-SLqAK6qo.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-868be97b-SJGV5uMV.js → blockDiagram-868be97b-CH6k87Wa.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-CJlW5z_T.js → blockDiagram-I7D4REHJ-BWHrrqXo.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-zXh6gZYF.js → blockDiagram-I7D4REHJ-BjLfxD7u.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-Clrwi7_Q.js → blockDiagram-I7D4REHJ-DUfJri3_.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-H0zOOYPr.js → bn-BD-2XOGV67Q-DfCeTaG1.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-3f4bdde3-CXvPU5ga.js → c4Diagram-3f4bdde3-ufrtLRrD.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-p14SIG7V.js → c4Diagram-7LVT6UL2-BK8yvli2.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-CZvEIDdH.js → c4Diagram-7LVT6UL2-C-0ZQ8Xa.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BWQ9xHoN.js → c4Diagram-7LVT6UL2-O_rZefrz.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-DQlAuxYC.js → ca-ES-6MX7JW3Y-1rV8dCez.js} +1 -1
- package/dist-embed/chunks/{celltoolbartracker-D5H7qtOH.js → celltoolbartracker-B_UScIax.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B-DXFGVRZV.js → chunk-2Q5K7J3B-BFUbUsBE.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B-BkzWX8eg.js → chunk-2Q5K7J3B-BX9u1bBi.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B-CWx-QJ0-.js → chunk-2Q5K7J3B-DiqqlJZw.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-Ciba-ybC.js → chunk-5VM5RSS4-BbOPwJfe.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-DgSzeVg9.js → chunk-5VM5RSS4-D4N_xxBJ.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-O8p7luYq.js → chunk-5VM5RSS4-box8kQsT.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-Bo5boRfj.js → chunk-F27PBJKO-BUeWPnw5.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-CZHz6AS9.js → chunk-F27PBJKO-CQM02DXR.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-BzBvJLmh.js → chunk-F27PBJKO-DPF3nC8g.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-BJR6rkFo.js → chunk-IMKFNOWR-CPIe37ka.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-DODKl-4z.js → chunk-IMKFNOWR-DAOxV09i.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-Csfu1kFU.js → chunk-IMKFNOWR-rg2BEcj6.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-BVXd-ICe.js → chunk-JWPE2WC7-BGdc9-bH.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-Bf4pFlIJ.js → chunk-JWPE2WC7-NvLQtuoq.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-nWjEvJWR.js → chunk-JWPE2WC7-QIDUQRBr.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-DhNnPwZp.js → chunk-POPQ4Y6H-BgR92oKl.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-DsBRlZYP.js → chunk-POPQ4Y6H-Cl1oUaAM.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-s1yt1ZtK.js → chunk-POPQ4Y6H-DWWKSDND.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-CsFEUe5B.js → chunk-SVP7TREG-BGHt1HDi.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-4yrBA5Q8.js → chunk-SVP7TREG-DtwPtAP8.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-8oKVa2mm.js → chunk-SVP7TREG-lMq3S-u-.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-InZQ5ZEH.js → chunk-TICWLB2K-BdUzhQPw.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-Br51vTwj.js → chunk-TICWLB2K-CaVrVRpm.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-CSCMv_QA.js → chunk-TICWLB2K-D6WJ64X6.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-Y8pSpMzF.js → chunk-XXDRQBXY-BU32lP3z.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-sm2AIgJ5.js → chunk-XXDRQBXY-CjAMT3RS.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-B76itibr.js → chunk-XXDRQBXY-CtNPThT-.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-CoxSb8Y6.js → classDiagram-ZZMXUADV-9x2pAf81.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-BjEOw29S.js → classDiagram-ZZMXUADV-Cy9bb-Ja.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-G9WI_1Zg.js → classDiagram-ZZMXUADV-HBhnoh6h.js} +1 -1
- package/dist-embed/chunks/{classDiagram-f62afe4f-C7V9AhQG.js → classDiagram-f62afe4f-DKREECyJ.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-604399ef-D5fT6Dr7.js → classDiagram-v2-604399ef-CQ5TgOQe.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-CoxSb8Y6.js → classDiagram-v2-VYDZK3BY-9x2pAf81.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-BjEOw29S.js → classDiagram-v2-VYDZK3BY-Cy9bb-Ja.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-G9WI_1Zg.js → classDiagram-v2-VYDZK3BY-HBhnoh6h.js} +1 -1
- package/dist-embed/chunks/{code-block-IT6T5CEO-C2SgK78N.js → code-block-IT6T5CEO-B1q5VFMK.js} +1 -1
- package/dist-embed/chunks/{component-D06eSJe4.js → component-CHd9jmXQ.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-C73aLaB-.js → cose-bilkent-JH36ORCC-DFWJgtSE.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-DCtKiRmD.js → cose-bilkent-JH36ORCC-DGrxjlJ4.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-3hKxz2TJ.js → cose-bilkent-JH36ORCC-F97qu5nX.js} +1 -1
- package/dist-embed/chunks/{createText-aed3d8b3-BW8KnfYh.js → createText-aed3d8b3-B1Tmb4Mr.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-DF0QlWYl.js → cs-CZ-2BRQDIVT-SF5YII-L.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-BSwaTAfL.js → cynefinDiagram-5FMLGOSQ-BZ1LtKUy.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-NWammrfO.js → cynefinDiagram-5FMLGOSQ-CR7crOrC.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-DLyDkFEh.js → cynefinDiagram-5FMLGOSQ-DhFh7Gts.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-DZpohvgg.js → da-DK-5WZEPLOC-nd3n1KuA.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-CPu-St26.js → dagre-GXQ25YYZ-4P90jeEC.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-ZuXkHh9P.js → dagre-GXQ25YYZ-BpWd0wTo.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-DTWZ8vY1.js → dagre-GXQ25YYZ-MXGi4287.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-BcvwLNFI.js → de-DE-XR44H4JA-DxoPxuG0.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-ERKr1j6v.js → diagram-S7CK7UJ4-Ccq8-Zxr.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-RBcSDktx.js → diagram-S7CK7UJ4-DhLnfG8J.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-ewBgYmRN.js → diagram-S7CK7UJ4-xgW0lqt_.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-B-f2Afei.js → diagram-UQ7AKVKN-Csc8IuSs.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-CGNA7gub.js → diagram-UQ7AKVKN-DM05uJg0.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-BQVu3Qe-.js → diagram-UQ7AKVKN-vfaPVBIp.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-GkbP6NMy.js → diagram-VSXAHHWV-BpkflTV8.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-DRVoe_PH.js → diagram-VSXAHHWV-C0Dte6B4.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-CTQu2IBp.js → diagram-VSXAHHWV-ChcqzpvG.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-CaynSBjY.js → diagram-VX7I27RA-D3eZ6yyK.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-B_LkfTnq.js → diagram-VX7I27RA-DA3s85ZI.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-DHwSWNj4.js → diagram-VX7I27RA-DFBWpFKi.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-BSrrfEXq.js → diagram-Z3DM3KII-BPDco9BP.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-D0Xt6xwn.js → diagram-Z3DM3KII-CWv5dRb1.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-BZ9tmKdd.js → diagram-Z3DM3KII-DpwpLNON.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-CqUNJWps.js → ebnfDiagram-PWID7BFC-BrHZve2O.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-DN2tb-X8.js → ebnfDiagram-PWID7BFC-CeZcQDV3.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-Dk5WVIim.js → ebnfDiagram-PWID7BFC-ZbRTmpLY.js} +1 -1
- package/dist-embed/chunks/{edges-b2856ca0-C7Oyg_aM.js → edges-b2856ca0-CHQtJW0X.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-BFYxkU9G.js → el-GR-BZB4AONW-B_p1F0WP.js} +1 -1
- package/dist-embed/chunks/{erDiagram-5d81789a-ow68WqFY.js → erDiagram-5d81789a-7uQXDmYP.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-BsU1EeJN.js → erDiagram-RLTQ6QDP-CmahDLTF.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-Dk34WMaW.js → erDiagram-RLTQ6QDP-DO7X3O5w.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-BTXMcY7Y.js → erDiagram-RLTQ6QDP-QI_LQlaL.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-DfsrGpW8.js → es-ES-U4NZUMDT-BWCUsoic.js} +1 -1
- package/dist-embed/chunks/{esm-BuDeg2OK.js → esm-M4z_FfnQ.js} +1 -1
- package/dist-embed/chunks/{esm-8_0YCB2q.js → esm-itrlzhnT.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-C4M9A--a.js → eu-ES-A7QVB2H4-QqCRXKSF.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-Dz5YhtO5.js → fa-IR-HGAKTJCU-C0NVSF_c.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-XjyQSB_d.js → fi-FI-Z5N7JZ37-BP_C4Wwz.js} +1 -1
- package/dist-embed/chunks/{flowDb-185abca5-Cs4mMxhw.js → flowDb-185abca5-BmhWH32g.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-1629c991-CHvSNikI.js → flowDiagram-1629c991-oMWtc4C3.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-DP1PWdQF.js → flowDiagram-HODETNUW-CgvZqEVs.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-DNjEQlAR.js → flowDiagram-HODETNUW-CmuRDMmw.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-DXLXSKI7.js → flowDiagram-HODETNUW-Cy-T1qw4.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-v2-1d953310-eV94YCy9.js → flowDiagram-v2-1d953310-OG6RhgdC.js} +1 -1
- package/dist-embed/chunks/{flowchart-elk-definition-6df44142-6xYb0NnW.js → flowchart-elk-definition-6df44142-I8LO2x_c.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-VH6OvmOI.js → fr-FR-RHASNOE6-B1_hgegA.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-3b0b3873-BplyF8AP.js → ganttDiagram-3b0b3873-Ch394Td4.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-DmwhuzrV.js → ganttDiagram-EL5Y4UJY-DjmeWOsd.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-UWTfR8VF.js → ganttDiagram-EL5Y4UJY-iVAJV8uC.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-Qz5HuyzZ.js → ganttDiagram-EL5Y4UJY-sX30iW6f.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CF5nE-hV.js → gitGraphDiagram-WWUBYQGX-BuldyYGe.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-BUlSUrle.js → gitGraphDiagram-WWUBYQGX-CVcSYkDK.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-kicEF2lX.js → gitGraphDiagram-WWUBYQGX-CeOMDDRZ.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-Bhx3RNmO.js → gitGraphDiagram-f01e8bc2-CfNzWqtG.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-DD5-fm7n.js → gl-ES-HMX3MZ6V-BhVM3-ho.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-CJ6dYqWM.js → he-IL-6SHJWFNN-oud0_kOl.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-CGMlTAed.js → hi-IN-IWLTKZ5I-CD6iySjh.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-B62Sv99K.js → hu-HU-A5ZG7DT2-DXuEZMlE.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-OcuSDAR-.js → id-ID-SAP4L64H-C-E1a9_p.js} +1 -1
- package/dist-embed/chunks/{index-Botot3k_.js → index-86hxexQA.js} +2 -2
- package/dist-embed/chunks/{index-9bae90f3-C-Eph-LM.js → index-9bae90f3-BZE71ijg.js} +1 -1
- package/dist-embed/chunks/{index-QUGTBUbz.js → index-BMY48-7N.js} +2 -2
- package/dist-embed/chunks/{index-Df2MkvAW.js → index-CLB4KPZs.js} +4 -4
- package/dist-embed/chunks/{index-D-tu7af7.js → index-CShCHnof.js} +1 -1
- package/dist-embed/chunks/{index-B9R5Oy-_.js → index-CXSUknte.js} +1 -1
- package/dist-embed/chunks/{index-CzDD-mUF.js → index-CaEDkyBB.js} +2 -2
- package/dist-embed/chunks/{index-DjDXWGO2.js → index-CvKH_NYI.js} +2 -2
- package/dist-embed/chunks/{index-BBAQAg8z.js → index-DakHBTji.js} +1 -1
- package/dist-embed/chunks/{index-DObGLuCI.js → index-s25RSqvt.js} +4 -4
- package/dist-embed/chunks/{index.esm-Ct20ZUrP.js → index.esm-CDmg415B.js} +1 -1
- package/dist-embed/chunks/{index.esm-KJZmBZvS.js → index.esm-tNe_Tes8.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-DGlJ7Q80.js → infoDiagram-27XIBGKW-CJ3r0yt4.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-Cs7bZlH6.js → infoDiagram-27XIBGKW-ZpA0pyod.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-B4XVsJvC.js → infoDiagram-27XIBGKW-r53wKy7u.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-a29d40f1-qBdv4q0h.js → infoDiagram-a29d40f1-SCeFVgXv.js} +1 -1
- package/dist-embed/chunks/{isEqual-ZTQsAovp.js → isEqual-DXPB_0fo.js} +1 -1
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-HBIqRNLh.js → ishikawaDiagram-5VMMS53U-CvqPw0ea.js} +1 -1
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-BIytcjnR.js → ishikawaDiagram-5VMMS53U-DZTg3ecD.js} +1 -1
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-BB-Kv-Mj.js → ishikawaDiagram-5VMMS53U-DyyVsa6G.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-1UkMde1K.js → it-IT-JPQ66NNP-iU7kI7qX.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-ZHmHs3WT.js → ja-JP-DBVTYXUO-CgiuMyHB.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-C3yCP95B.js → journeyDiagram-3NMN7TZE-Bc9JVKJo.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-Bs6ObzT9.js → journeyDiagram-3NMN7TZE-DAnc386V.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-DEtcUVr2.js → journeyDiagram-3NMN7TZE-MiKYaC2s.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-95396277-D89HQ4tg.js → journeyDiagram-95396277-DT_97eTw.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-C57X5Q7d.js → kaa-6HZHGXH3-kCO_bmZz.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-BUnQ_56J.js → kab-KAB-ZGHBKWFO-XZlP8YRp.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-CWfihtP5.js → kanban-definition-UXKFOSKX-BkReeSIH.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-_mcHB773.js → kanban-definition-UXKFOSKX-C2nVULib.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-B9DSJpj9.js → kanban-definition-UXKFOSKX-CaaDxJqC.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-CBp9NICk.js → kk-KZ-P5N5QNE5-BYUwHB4m.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-MPn8eiKl.js → km-KH-HSX4SM5Z-CUO0IDD-.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-DqUfCjgF.js → ko-KR-MTYHY66A-CuR4MTdp.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-BhyGSJkh.js → ku-TR-6OUDTVRD-CuFtqN6b.js} +1 -1
- package/dist-embed/chunks/{layout-XFc4Od7Z.js → layout-BD_a0kBf.js} +1 -1
- package/dist-embed/chunks/{layout-DTdkd155.js → layout-BjpOdFu2.js} +1 -1
- package/dist-embed/chunks/{layout-D_LOxL0l.js → layout-DQIVAfpO.js} +1 -1
- package/dist-embed/chunks/{lexicalHooks-0KfusRdE.js → lexicalHooks-BM3oRORX.js} +1 -1
- package/dist-embed/chunks/{lib-qL5koKak.js → lib-0t46pS-5.js} +1 -1
- package/dist-embed/chunks/{lib-r8emmCZN.js → lib-B5XoICB9.js} +1 -1
- package/dist-embed/chunks/{lib-DLVOFtf2.js → lib-BXb6Der8.js} +1 -1
- package/dist-embed/chunks/{lib-BuNapvTN.js → lib-BZnIPSNY.js} +1 -1
- package/dist-embed/chunks/{lib-B8QeIpMg.js → lib-B_ADtK-Y.js} +1 -1
- package/dist-embed/chunks/{lib-BKRN5rY4.js → lib-Bf4e9-pt.js} +1 -1
- package/dist-embed/chunks/{lib-5puVfbvR.js → lib-Bj6VnDnz.js} +1 -1
- package/dist-embed/chunks/{lib-B0-V3yWM.js → lib-Bx0zoo2z.js} +1 -1
- package/dist-embed/chunks/{lib-1k8qJMow.js → lib-CBlEbdz_.js} +1 -1
- package/dist-embed/chunks/{lib-DGXPl5aF.js → lib-CEAQckSu.js} +1 -1
- package/dist-embed/chunks/{lib-BDCbvZ5k.js → lib-CJ9ULCcA.js} +1 -1
- package/dist-embed/chunks/{lib-CJ1wJo-A.js → lib-CXURv0CD.js} +1 -1
- package/dist-embed/chunks/{lib-CG1c2su0.js → lib-CqNuA7eJ.js} +1 -1
- package/dist-embed/chunks/{lib-D8ZZk58r.js → lib-CtFV0V1H.js} +11 -11
- package/dist-embed/chunks/{lib-CDTJBLjs.js → lib-DXoXqPR6.js} +4 -4
- package/dist-embed/chunks/{lib-B5oYQnVZ.js → lib-Dfg3vZM8.js} +1 -1
- package/dist-embed/chunks/{lib-D0_SMUcl.js → lib-QwGhpmEd.js} +1 -1
- package/dist-embed/chunks/{lib-eUsLplee.js → lib-WvggSsMk.js} +1 -1
- package/dist-embed/chunks/{lib-M0p61UIz.js → lib-Yguxonvz.js} +1 -1
- package/dist-embed/chunks/{lib-CSk1FKf1.js → lib-eeN6DkZa.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-DnzpQbb1.js → lt-LT-XHIRWOB4-TpyDKA3C.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-CdDJ-bA0.js → lv-LV-5QDEKY6T-Dz0_ikqR.js} +1 -1
- package/dist-embed/chunks/{mermaid.core-gUuQZ3q0.js → mermaid.core-Dkoaa-_D.js} +5 -5
- package/dist-embed/chunks/{mermaid.core-KTB2Lxd3.js → mermaid.core-meWUGbq7.js} +3 -3
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-Zy7pURli.js → mindmap-definition-YA3MSWOX-1p4XwdjF.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-CmGscTNk.js → mindmap-definition-YA3MSWOX-BxYK9vLg.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-CCpwK8vh.js → mindmap-definition-YA3MSWOX-DQSoT62j.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-e4c1d938-Bx-OHtVA.js → mindmap-definition-e4c1d938-BGiAi0LL.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-dch-5wWZ.js → mr-IN-CRQNXWMA-Vbci-IWj.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-CpBgcBwB.js → my-MM-5M5IBNSE-C0JHZ0Gp.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-COa2OyCA.js → nb-NO-T6EIAALU-eFOvuJCy.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-CUds_bYU.js → nl-NL-IS3SIHDZ-Din9L_2S.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-C7gst3vb.js → nn-NO-6E72VCQL-D7cIpOBH.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-BPpFvRq9.js → oc-FR-POXYY2M6-Bcxv3YfP.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-CFdnD-54.js → pa-IN-N4M65BXN-IrBb1NlL.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-CRdzWywN.js → pegDiagram-XKGWAZYB-DDgyLvau.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-C1R8Kk6K.js → pegDiagram-XKGWAZYB-GlLsdSxR.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-dwQNJiaW.js → pegDiagram-XKGWAZYB-iCCMOEMa.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-PE_Zr0z2.js → percentages-BXMCSKIN-BaaVroR_.js} +5 -5
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-CH60iHt1.js → pieDiagram-E7YTZNPT-CIfzhxTy.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-IN-ewUih.js → pieDiagram-E7YTZNPT-DIErsg9L.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-Cm-wzRi8.js → pieDiagram-E7YTZNPT-ffhUIieA.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-c941bede-CsV2p2ej.js → pieDiagram-c941bede-JKyix3vD.js} +1 -1
- package/dist-embed/chunks/{pl-PL-T2D74RX3-DC0vXmC3.js → pl-PL-T2D74RX3-bF5WEfvP.js} +1 -1
- package/dist-embed/chunks/{plugin-KPr60ZvH.js → plugin-BFdQv_3f.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-BOMTxvy-.js → pt-BR-5N22H2LF-K9lAvfY5.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-BoKelgnz.js → pt-PT-UZXXM6DQ-DAlaVYmT.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-mkOZIUHb.js → quadrantDiagram-AXDQQJYC-BE9RPE6m.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-B7W6MWBq.js → quadrantDiagram-AXDQQJYC-D3pxCP4M.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-B1wf6Zth.js → quadrantDiagram-AXDQQJYC-DbYIZcyN.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-ZmcsdB3H.js → quadrantDiagram-cf8b8fe0-C_nd7FeD.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-DrkBEH1z.js → railroadDiagram-O6MQD6OU-CEl2l0ZE.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-B6nFyCFz.js → railroadDiagram-O6MQD6OU-CpXUNzTV.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-DEB7gRmX.js → railroadDiagram-O6MQD6OU-CwaTW3Mo.js} +1 -1
- package/dist-embed/chunks/{renderer-DEJh7EnD.js → renderer-CtmiT4nP.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-53bda41b-B_LQ_xkB.js → requirementDiagram-53bda41b-WVBAkQmj.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-S8WT8VJ1.js → requirementDiagram-BXWQKSXE-Bd0fV1Bn.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-C8d0kJ1A.js → requirementDiagram-BXWQKSXE-ClYVmNTl.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-fKcgNNOv.js → requirementDiagram-BXWQKSXE-sE3y_NEM.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-DUoE6b7w.js → ro-RO-JPDTUUEW-kn8FzruZ.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-BvGrQ7oU.js → ru-RU-B4JR7IUQ-iQW1KMip.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-zVvXOpK2.js → sankeyDiagram-P5KCCOFB-BZnLyt_G.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-eNBOyfBR.js → sankeyDiagram-P5KCCOFB-CLR82118.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-C2LowYxA.js → sankeyDiagram-P5KCCOFB-DH-uxGJV.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-c3ef121a-CbZiQf68.js → sankeyDiagram-c3ef121a-CINAq9g5.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-82a5b84f-E5IR2bYb.js → sequenceDiagram-82a5b84f-Bx7xO8lv.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-CYxIlDNg.js → sequenceDiagram-WJ2MYXX4-CxHuil7I.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-C_2alFNp.js → sequenceDiagram-WJ2MYXX4-D00NbcmA.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-fsR56p6L.js → sequenceDiagram-WJ2MYXX4-VyUqwKEJ.js} +1 -1
- package/dist-embed/chunks/{server-extension-BL8WkLTl.js → server-extension-CTAcsVqM.js} +1 -1
- package/dist-embed/chunks/{sessions-HqXTOvV9.js → sessions-LMslHH3H.js} +2 -2
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-DSd6gBaB.js → si-LK-N5RQ5JYF-C1J6zA3p.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-BCe0IiFV.js → sizeCapture-INFHLROL-B_CNNL_v.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-BVaNrAtp.js → sizeCapture-INFHLROL-BhSnrZjU.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-BsZaIjAU.js → sizeCapture-INFHLROL-_h3QW8w5.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-CX5Daxph.js → sk-SK-C5VTKIMK-CK9RvjRD.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-D5seNheP.js → sl-SI-NN7IZMDC-CcDWOBHp.js} +1 -1
- package/dist-embed/chunks/{state-DeMGhTAB.js → state-CGa66Nqd.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-43e79a5f-DpDccHEJ.js → stateDiagram-43e79a5f-DFrFK9qM.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-DosU0FIz.js → stateDiagram-D77RDMKH-BVJqlFiv.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-ul2eLf5Q.js → stateDiagram-D77RDMKH-CEvuFuTH.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-BUw_L8lD.js → stateDiagram-D77RDMKH-QwBnfyKm.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-Tvcnabbb.js → stateDiagram-v2-2041ed4f-CcaIZYWt.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-Bf-2UYRk.js → stateDiagram-v2-MP3YSRHH-BaZ6xgsr.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-D0rhfnrW.js → stateDiagram-v2-MP3YSRHH-C_JHNwKt.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-DeEmivLr.js → stateDiagram-v2-MP3YSRHH-ok1qePbZ.js} +1 -1
- package/dist-embed/chunks/{styles-455b33cd-CqrAPL5i.js → styles-455b33cd-CAiZEic0.js} +1 -1
- package/dist-embed/chunks/{styles-f932cba9-Dw1HY-mR.js → styles-f932cba9-CEhWf7q3.js} +1 -1
- package/dist-embed/chunks/{styles-fcc2142b-C27pEgaj.js → styles-fcc2142b-v0gPnZ9U.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-X0WjKx8m.js → subset-shared.chunk-C0JvsRAi.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-B_UbRqFW.js → subset-worker.chunk-qynV-rht.js} +1 -1
- package/dist-embed/chunks/{substates-BuHNVWkx.js → substates-Bs9ZMVGa.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-C45sq5QB.js → sv-SE-XGPEYMSR-B38oK2Y4.js} +1 -1
- package/dist-embed/chunks/{svgDrawCommon-148a3cd9-CUn_M4Ra.js → svgDrawCommon-148a3cd9-vsaJmSq8.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-CzG-9Sou.js → swimlanes-42K2YHIH-C_43oheZ.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-CIW2hU2l.js → swimlanes-42K2YHIH-CpRw9PHz.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-DOkKP2_2.js → swimlanes-42K2YHIH-DO1ZzP4k.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-Cgj6azeO.js → swimlanesDiagram-VR7AAH4N-BBi0wpOL.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-9yw92Xx_.js → swimlanesDiagram-VR7AAH4N-BYKvE-MW.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BlFZ7eQS.js → swimlanesDiagram-VR7AAH4N-BucpGmoC.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-CoxPm9Ew.js → ta-IN-2NMHFXQM-uSQqrrN6.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-Smv8dde_.js → th-TH-HPSO5L25-Cs2r4usA.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-HSOgPjq4.js → timeline-definition-24CTP7MA-C9oiFt1s.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-C9Ed6D0K.js → timeline-definition-24CTP7MA-CRpA2xfq.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-kHlycslq.js → timeline-definition-24CTP7MA-C_RPFzcS.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-7545f45a-CCyhwQdt.js → timeline-definition-7545f45a-diaQHYG7.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-DBMN0v-o.js → tr-TR-DEFEU3FU-D8o50B7O.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-DNvJwc9t.js → uk-UA-QMV73CPH-B5fUoSFX.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-CxvgI2f-.js → vennDiagram-4TSXK5OY-6I3E2S1J.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-7gMUaOyw.js → vennDiagram-4TSXK5OY-ByKQXzaL.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-Dt9fBhlj.js → vennDiagram-4TSXK5OY-C4cLgb45.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-D1mitKRR.js → vi-VN-M7AON7JQ-Dj_kFfvZ.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-Bbh5PYAM.js → wardleyDiagram-VM6X3IG4-6QgHmuap.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-6HRbbvDt.js → wardleyDiagram-VM6X3IG4-CLayLpj4.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-AvAVDPLG.js → wardleyDiagram-VM6X3IG4-CnxCRlDr.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-3f383b91-BVsOkv2G.js → xychartDiagram-3f383b91-COn0cE9r.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-VWPR98LV.js → xychartDiagram-S5SC5T6Z-CoRCml5l.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-DNoz1WpS.js → xychartDiagram-S5SC5T6Z-Hrzni--y.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-ZZD1fZ1L.js → xychartDiagram-S5SC5T6Z-RhhCg-yn.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-DtmUhdIG.js → zh-CN-LNUGB5OW-CHJxgGXp.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-BKtdEVTQ.js → zh-HK-E62DVLB3-CLxE_xvU.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-BHnZRfWI.js → zh-TW-RAJ6MFWO-CpEgHY46.js} +1 -1
- package/dist-embed/datalayer-app-main.js +27 -27
- package/lib/apps/agentUiPlugins.js +3 -0
- package/lib/apps/plugins/product-cards/index.d.ts +57 -0
- package/lib/apps/plugins/product-cards/index.js +99 -0
- package/lib/apps/plugins/product-cards/read.d.ts +47 -0
- package/lib/apps/plugins/product-cards/read.js +74 -0
- package/lib/apps/plugins/product-comparison/index.d.ts +2 -1
- package/lib/apps/plugins/product-comparison/index.js +6 -2
- package/lib/apps/plugins/product-comparison/read.d.ts +2 -0
- package/lib/apps/plugins/product-comparison/read.js +2 -1
- package/lib/apps/plugins/shopping-basket/index.d.ts +2 -1
- package/lib/apps/plugins/shopping-basket/index.js +9 -5
- package/lib/apps/plugins/shopping-basket/read.d.ts +2 -0
- package/lib/apps/plugins/shopping-basket/read.js +2 -1
- package/lib/apps/toolCards/productPhoto.d.ts +28 -0
- package/lib/apps/toolCards/productPhoto.js +28 -0
- package/lib/examples/pap/traces/account-tokens.json +1 -1
- package/lib/examples/pap/traces/conversation-control.json +11 -11
- package/lib/examples/pap/traces/conversation-streaming.json +5 -5
- package/lib/examples/pap/traces/mediated-sign-in.json +1 -1
- package/lib/examples/pap/traces/operations.json +23 -23
- package/lib/examples/pap/traces/two-companies.json +25 -25
- package/lib/examples/pap/traces/user-with-a-company.json +14 -14
- package/lib/pap/index.d.ts +4 -4
- package/lib/pap/index.js +6 -11
- package/lib/protocols/pap/index.d.ts +0 -2
- package/lib/protocols/pap/index.js +3 -4
- package/lib/specs/actions.js +9 -0
- package/lib/specs/apps.d.ts +3 -1
- package/lib/specs/apps.js +1434 -203
- package/lib/specs/backendTools.d.ts +5 -0
- package/lib/specs/backendTools.js +102 -2
- package/lib/specs/scenes.d.ts +1 -0
- package/lib/specs/scenes.js +251 -0
- package/lib/specs/stages.d.ts +1 -0
- package/lib/specs/stages.js +18 -0
- package/lib/specs/teams/teams.d.ts +1 -0
- package/lib/specs/teams/teams.js +77 -0
- package/lib/specs/ui.d.ts +1 -0
- package/lib/specs/ui.js +24 -2
- package/package.json +2 -2
- package/dist-embed/chunks/AgentInspector-a_P_e-b-.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{T as De,q as he,t as ht,r as ce,b as $e,g as Je,I as pt,k as gt,a as ze,f as Ge,C as Re,h as Ie}from"./index-QUGTBUbz.js";import{J as M,aB as ee,ch as ie,aE as R,gw as mt,eJ as Ct,fT as bt,cj as me,aK as Te,eh as ft,cl as vt,ei as _t,cf as Ce,iE as yt,r as J,eP as xt,ix as wt,eN as kt,dC as Q,cp as St,iF as v,dN as Ye,dJ as Xe,dO as Ze,fR as Qe,fS as et,eM as Be,aJ as At,aF as tt,aG as ke,iG as Mt,iH as Tt,iz as Bt,k as Y,bh as Et,go as Nt,aa as Ot,aC as be,gB as G,iI as ge,aA as le,iJ as xe,iK as Z,eG as Pe,iL as jt,iM as Rt,dX as we,dZ as It,d$ as Le,iN as We,dY as Pt,iO as Lt,iP as Wt,ax as ot,iQ as Ht,iR as Ft,eL as Kt,iS as Vt,aD as F,ew as fe,iT as Se,dx as Ut,eE as qt,e3 as Dt,iU as $t,iV as se,iW as nt,ce as pe,dz as Jt,aH as zt,dE as Gt,cr as Yt,gz as Xt,iX as Zt,dS as Qt,dV as eo,iY as to,dH as oo,iZ as no,i_ as io,ed as lo,ee as so,dy as ro,bg as ao,fk as co}from"../datalayer-app-main.js";import{b as uo,I as it}from"./token-CdPvDaO6.js";import{ToolbarItems as ho}from"./lib-B5oYQnVZ.js";import{I as po}from"./index-B3Hf3MzW.js";import{I as ve}from"./tokens-C5FWZLTC.js";import{a as lt,I as L,b as st,c as go}from"./tokens-BiQDy_zz.js";import{I as mo,a as rt}from"./tokens-DuSIK5iU.js";import{I as Co}from"./tokens-iGMkLb0v.js";import{f as at,e as bo,c as fo,I as vo,b as _o}from"./index-DjDXWGO2.js";import{I as dt}from"./tokens-DfQxPp01.js";import{I as _e}from"./tokens-1h_N3aLM.js";import{a as Ee}from"./tokens-B3Xc25f7.js";import{I as yo}from"./tokens-BoOsoUsu.js";import{I as xo}from"./index-CzDD-mUF.js";import{I as wo}from"./tokens-udK9JDBx.js";import{W as ko,u as He,V as So,I as Ao,a as Mo,b as To,c as Bo}from"./document-Dx9me6Cm.js";import{s as Eo}from"./hover-DpawhsId.js";import{b as No,c as Oo,d as jo}from"./CellSidebarExtension-Dx_Rm2j5.js";import{H as Ro}from"./htmlselect-CIhYGigR.js";import{T as Io,a as Po}from"./model-DrXnd96t.js";import{C as Fe}from"./celltoolbartracker-D5H7qtOH.js";import"./hoverbox-CStlKQWE.js";import"./Output-DePHyrJp.js";import"./index-B9R5Oy-_.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-ZTQsAovp.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-DEJh7EnD.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-BoT73xjq.js";import"./index-D-tu7af7.js";import"./KernelVariables-DLBQe0HT.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-HqXTOvV9.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";function Lo(r){const n=s=>{const a=Math.max(s*3.6,.1),l=a*Math.PI/180,p=Math.sin(l)*104,i=Math.cos(l)*-104;return"M 0 0 v -104 A 104 104 1 "+(a<180?1:0)+" 0 "+p.toFixed(4)+" "+i.toFixed(4)+" z"};return M.createElement("div",{className:"jp-Statusbar-ProgressCircle",role:"progressbar","aria-label":r.label||"Unlabelled progress circle","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r.progress,onClick:r.onClick},M.createElement("svg",{viewBox:"0 0 250 250"},M.createElement("circle",{cx:"125",cy:"125",r:"104",stroke:"var(--jp-inverse-layout-color3)",strokeWidth:"20",fill:"none"}),M.createElement("path",{className:"jp-Statusbar-ProgressCirclePath",transform:"translate(125,125) scale(.9)",d:n(r.progress),fill:"var(--jp-inverse-layout-color3)"})))}const Wo="jp-JSONEditor",ue="jp-mod-error",Ho="jp-JSONEditor-host",Fo="jp-JSONEditor-header";class Ko extends ee{constructor(e){super(),this._dataDirty=!1,this._inputDirty=!1,this._source=null,this._originalValue=ie.emptyObject,this._changeGuard=!1,this.translator=e.translator||R,this._trans=this.translator.load("jupyterlab"),this.addClass(Wo),this.headerNode=document.createElement("div"),this.headerNode.className=Fo,this.revertButtonNode=mt.element({tag:"span",title:this._trans.__("Revert changes to data")}),this.commitButtonNode=Ct.element({tag:"span",title:this._trans.__("Commit changes to data"),marginLeft:"8px"}),this.editorHostNode=document.createElement("div"),this.editorHostNode.className=Ho,this.headerNode.appendChild(this.revertButtonNode),this.headerNode.appendChild(this.commitButtonNode),this.node.appendChild(this.headerNode),this.node.appendChild(this.editorHostNode);const n=new bt.Model({mimeType:"application/json"});n.sharedModel.changed.connect(this._onModelChanged,this),this.model=n,this.editor=e.editorFactory({host:this.editorHostNode,model:n,config:{readOnly:!0}})}get source(){return this._source}set source(e){this._source!==e&&(this._source&&this._source.changed.disconnect(this._onSourceChanged,this),this._source=e,this.editor.setOption("readOnly",e===null),e&&e.changed.connect(this._onSourceChanged,this),this._setValue())}get isDirty(){return this._dataDirty||this._inputDirty}dispose(){var e;this.isDisposed||((e=this.source)===null||e===void 0||e.dispose(),this.model.dispose(),this.editor.dispose(),super.dispose())}handleEvent(e){switch(e.type){case"blur":this._evtBlur(e);break;case"click":this._evtClick(e);break}}onAfterAttach(e){const n=this.editorHostNode;n.addEventListener("blur",this,!0),n.addEventListener("click",this,!0),this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.headerNode.addEventListener("click",this)}onBeforeDetach(e){const n=this.editorHostNode;n.removeEventListener("blur",this,!0),n.removeEventListener("click",this,!0),this.headerNode.removeEventListener("click",this)}_onSourceChanged(e,n){if(!this._changeGuard){if(this._inputDirty||this.editor.hasFocus()){this._dataDirty=!0;return}this._setValue()}}_onModelChanged(e,n){if(n.sourceChange){let s=!0;try{const a=JSON.parse(this.editor.model.sharedModel.getSource());this.removeClass(ue),this._inputDirty=!this._changeGuard&&!ie.deepEqual(a,this._originalValue)}catch{this.addClass(ue),this._inputDirty=!0,s=!1}this.revertButtonNode.hidden=!this._inputDirty,this.commitButtonNode.hidden=!s||!this._inputDirty}}_evtBlur(e){!this._inputDirty&&this._dataDirty&&this._setValue()}_evtClick(e){const n=e.target;this.revertButtonNode.contains(n)?this._setValue():this.commitButtonNode.contains(n)?!this.commitButtonNode.hidden&&!this.hasClass(ue)&&(this._changeGuard=!0,this._mergeContent(),this._changeGuard=!1,this._setValue()):this.editorHostNode.contains(n)&&this.editor.focus()}_mergeContent(){const e=this.editor.model,n=this._originalValue,s=JSON.parse(e.sharedModel.getSource()),a=this.source;if(a){for(const l in s)ie.deepEqual(s[l],n[l]||null)||a.set(l,s[l]);for(const l in n)l in s||a.delete(l)}}_setValue(){this._dataDirty=!1,this._inputDirty=!1,this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.removeClass(ue);const e=this.editor.model,n=this._source?this._source.toJSON():{};if(this._changeGuard=!0,n===void 0)e.sharedModel.setSource(this._trans.__("No data!")),this._originalValue=ie.emptyObject;else{const s=JSON.stringify(n,null,4);e.sharedModel.setSource(s),this._originalValue=n,s.length>1&&s[0]==="{"&&this.editor.setCursorPosition({line:0,column:1})}this._changeGuard=!1,this.commitButtonNode.hidden=!0,this.revertButtonNode.hidden=!0}}class Vo extends M.Component{constructor(e){super(e),this._handleChange=s=>{this.setState({value:s.currentTarget.value})},this._handleSubmit=s=>{var a,l;s.preventDefault();const p=parseInt((l=(a=this._textInput)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",10);return!isNaN(p)&&isFinite(p)&&1<=p&&p<=this.props.maxCell&&this.props.handleSubmit(p),!1},this._handleFocus=()=>{this.setState({hasFocus:!0})},this._handleBlur=()=>{this.setState({hasFocus:!1})},this._textInput=null;const n=e.translator||R;this._trans=n.load("jupyterlab"),this.state={value:"",hasFocus:!1,textInputId:ft.createDomID()+"-cell-number-input"}}componentDidMount(){var e;(e=this._textInput)===null||e===void 0||e.focus()}render(){return M.createElement("div",{className:"jp-lineFormSearch"},M.createElement("form",{name:"cellNumberForm",onSubmit:this._handleSubmit,noValidate:!0},M.createElement("div",{className:vt("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":void 0)},M.createElement("input",{type:"number",id:this.state.textInputId,className:"jp-lineFormInput",min:1,max:this.props.maxCell,onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),M.createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},M.createElement(_t.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),M.createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),M.createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to cell number between 1 and %1",this.props.maxCell))))}}function Uo(r){const n=(r.translator||R).load("jupyterlab"),s=r.selectionStart>0&&r.selectionStart!==r.selectionEnd?n.__("%1:%2/%3",r.selectionStart,r.selectionEnd,r.totalCells):n.__("Cell %1/%2",r.activeCell,r.totalCells),a=l=>{(l.key==="Enter"||l.key==="Spacebar"||l.key===" ")&&(l.preventDefault(),l.stopPropagation(),r.handleClick())};return M.createElement(De,{role:"button","aria-haspopup":!0,onClick:r.handleClick,source:s,title:n.__("Go to cell…"),tabIndex:0,onKeyDown:a})}class re extends me{constructor(e={}){super(new re.Model),this._popup=null,this.addClass("jp-mod-highlighted"),this._translator=e.translator||R}render(){return this.model===null?null:M.createElement(Uo,{activeCell:this.model.activeCell,selectionStart:this.model.selectionStart,selectionEnd:this.model.selectionEnd,totalCells:this.model.totalCells,translator:this._translator,handleClick:()=>this._handleClick()})}_handleClick(){if(this.model.totalCells<1)return;this._popup&&this._popup.dispose();const e=Te.create(M.createElement(Vo,{handleSubmit:n=>this._handleSubmit(n),maxCell:this.model.totalCells,translator:this._translator}));this._popup=Eo({body:e,anchor:this,align:"right"})}_handleSubmit(e){var n;const s=this.model.notebook;if(!s)return;const a=e-1;s.activeCellIndex=a,s.deselectAll(),s.scrollToItem(a).catch(l=>{console.error("Go to cell",l)}),(n=this._popup)===null||n===void 0||n.dispose(),s.activate()}}(function(r){class e extends Ce{constructor(){super(...arguments),this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0,this._notebook=null}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a&&(a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this),a.selectionChanged.disconnect(this._onChanged,this));const l=this._getAllState();this._notebook=s,this._notebook?(this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this),this._notebook.selectionChanged.connect(this._onChanged,this),this._updateStateFromNotebook(this._notebook)):(this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0),this._triggerChange(l,this._getAllState())}get activeCell(){return this._activeCell}get selectionStart(){return this._selectionStart}get selectionEnd(){return this._selectionEnd}get totalCells(){return this._totalCells}_onChanged(s){const a=this._getAllState();this._updateStateFromNotebook(s),this._triggerChange(a,this._getAllState())}_updateStateFromNotebook(s){const a=s.activeCellIndex;this._activeCell=a>=0?a+1:0,this._totalCells=s.widgets.length;let l=this._activeCell,p=this._activeCell,i=!1;s.widgets.forEach((u,d)=>{if(!s.isSelectedOrActive(u))return;const g=d+1;if(!i){l=g,p=g,i=!0;return}p=g}),this._selectionStart=i?l:0,this._selectionEnd=i?p:0}_getAllState(){return{activeCell:this._activeCell,selectionStart:this._selectionStart,selectionEnd:this._selectionEnd,totalCells:this._totalCells}}_triggerChange(s,a){(s.activeCell!==a.activeCell||s.selectionStart!==a.selectionStart||s.selectionEnd!==a.selectionEnd||s.totalCells!==a.totalCells)&&this.stateChanged.emit(void 0)}}r.Model=e})(re||(re={}));const qo="jp-Notebook-toolbarCellType",Do="jp-Notebook-toolbarCellTypeDropdown";var Ae;(function(r){function e(g,b){const f=(b||R).load("jupyterlab");function _(){if(g.context.model.readOnly)return tt({title:f.__("Cannot Save"),body:f.__("Document is read-only"),buttons:[ke.okButton()]});g.context.save().then(()=>{if(!g.isDisposed)return g.context.createCheckpoint()})}return yt(Te.create(J.createElement(xt,{signal:g.context.fileChanged},()=>J.createElement(wt,{icon:kt,onClick:_,tooltip:f.__("Save the notebook contents and create checkpoint"),enabled:!!(g&&g.context&&g.context.contentsModel&&g.context.contentsModel.writable)}))))}r.createSaveButton=e;function n(g,b){const f=(b||R).load("jupyterlab");return new Q({icon:St,onClick:()=>{v.insertBelow(g.content)},tooltip:f.__("Insert a cell below")})}r.createInsertButton=n;function s(g,b,f){const _=(b||R).load("jupyterlab");return new Q({icon:Ye,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.cutToSystemClipboard(g.content):v.cut(g.content)},tooltip:_.__("Cut the selected cells")})}r.createCutButton=s;function a(g,b,f){const _=(b||R).load("jupyterlab");return new Q({icon:Xe,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.copyToSystemClipboard(g.content):v.copy(g.content)},tooltip:_.__("Copy the selected cells")})}r.createCopyButton=a;function l(g,b,f){const _=(b||R).load("jupyterlab");return new Q({icon:Ze,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.pasteFromSystemClipboard(g.content):v.paste(g.content)},tooltip:_.__("Paste cells from the clipboard")})}r.createPasteButton=l;function p(g,b,f){const _=(f??R).load("jupyterlab");return new Q({icon:Qe,onClick:()=>{v.runAndAdvance(g.content,g.sessionContext,b,f)},tooltip:_.__("Run the selected cells and advance")})}r.createRunButton=p;function i(g,b,f){const _=(f??R).load("jupyterlab");return new Q({icon:et,onClick:()=>{const y=b??new Be({translator:f});y.restart(g.sessionContext).then(w=>(w&&v.runAll(g.content,g.sessionContext,y,f),w))},tooltip:_.__("Restart the kernel, then re-run the whole notebook")})}r.createRestartRunAllButton=i;function u(g,b){return new $o(g.content,b)}r.createCellTypeItem=u;function d(g,b,f,_){return[{name:"save",widget:e(g,f)},{name:"insert",widget:n(g,f)},{name:"cut",widget:s(g,f,_)},{name:"copy",widget:a(g,f,_)},{name:"paste",widget:l(g,f,_)},{name:"run",widget:p(g,b,f)},{name:"interrupt",widget:he.createInterruptButton(g.sessionContext,f)},{name:"restart",widget:he.createRestartButton(g.sessionContext,b,f)},{name:"restart-and-run",widget:i(g,b,f)},{name:"cellType",widget:u(g,f)},{name:"spacer",widget:At.createSpacerItem()},{name:"kernelName",widget:he.createKernelNameItem(g.sessionContext,b,f)}]}r.getDefaultItems=d})(Ae||(Ae={}));class $o extends Te{constructor(e,n){super(),this.handleChange=s=>{s.target.value!=="-"&&(v.changeCellType(this._notebook,s.target.value),this._notebook.activate())},this.handleKeyDown=s=>{s.key==="Enter"&&this._notebook.activate()},this._trans=(n||R).load("jupyterlab"),this.addClass(qo),this._notebook=e,e.model&&this.update(),e.activeCellChanged.connect(this.update,this),e.selectionChanged.connect(this.update,this)}render(){let e="-";this._notebook.activeCell&&(e=this._notebook.activeCell.model.type);for(const n of this._notebook.widgets)if(this._notebook.isSelectedOrActive(n)&&n.model.type!==e){e="-";break}return J.createElement(Ro,{className:Do,onChange:this.handleChange,onKeyDown:this.handleKeyDown,value:e,"aria-label":this._trans.__("Cell type"),title:this._trans.__("Select the cell type")},J.createElement("option",{value:"-"},"-"),J.createElement("option",{value:"code"},this._trans.__("Code")),J.createElement("option",{value:"markdown"},this._trans.__("Markdown")),J.createElement("option",{value:"raw"},this._trans.__("Raw")))}}function Ke(r){var e;const n=r.translator||R,s=ht(n),a=n.load("jupyterlab"),l=(e=r.displayOption.showJumpToCell)!==null&&e!==void 0?e:!1,p=r.state,i=r.displayOption.showOnToolBar,u=r.displayOption.showProgress,d=i?"down":"up",g=M.createElement("div",null),[b,f]=M.useState(!1);if(M.useEffect(()=>{if(b)return;const j=()=>{f(!0)};return v.executionScheduled.connect(j),()=>{v.executionScheduled.disconnect(j)}},[l,b]),!p)return g;const _=p.kernelStatus,y={alignSelf:"normal",height:"24px"},w=p.totalTime,S=p.scheduledCellNumber||0,o=p.scheduledCell.size||0,t=S-o;let h=100*t/S,C=u?"":"hidden";!u&&h<100&&(h=0);const k=j=>M.createElement(Lo,{progress:j,width:16,height:24,label:a.__("Kernel status")}),A=j=>a.__("Kernel status: %1",j),B=()=>{const j=r.notebook;v.selectLastRunCell(j),j.activeCell&&j.scrollToCell(j.activeCell)},E=(j,K,W)=>M.createElement("div",{className:"jp-Notebook-ExecutionIndicator",title:u?"":A(s[j]),"data-status":j},K,M.createElement("div",{className:`jp-Notebook-ExecutionIndicator-tooltip ${d} ${C}`},M.createElement("span",null," ",A(s[j])," "),W,l&&b&&M.createElement(Bt,{className:"jp-Notebook-ExecutionIndicator-jumpButton",onClick:B,title:a.__("Jump to current or last executed cell")},a.__("Jump to cell"))));if(p.kernelStatus==="connecting"||p.kernelStatus==="disconnected"||p.kernelStatus==="unknown")return E(_,M.createElement(Mt.react,{...y}),[]);if(p.kernelStatus==="starting"||p.kernelStatus==="terminating"||p.kernelStatus==="restarting"||p.kernelStatus==="initializing")return E(_,M.createElement(Tt.react,{...y}),[]);if(p.executionStatus==="busy")return E("busy",k(h),[M.createElement("span",{key:0},a.__("Executed %1/%2 cells",t,S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))]);{const j=p.kernelStatus==="busy"?0:100,K=p.kernelStatus==="busy"||w===0?[]:[M.createElement("span",{key:0},a._n("Executed %1 cell","Executed %1 cells",S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))];return E(p.kernelStatus,k(j),K)}}class X extends me{constructor(e,n=!0){super(new X.Model),this.translator=e||R,this.addClass("jp-mod-highlighted")}dispose(){var e;this.isDisposed||((e=this.model)===null||e===void 0||e.dispose(),super.dispose())}render(){if(this.model===null||!this.model.renderFlag)return M.createElement("div",null);{const e=this.model.currentNotebook;return e?M.createElement(Ke,{displayOption:this.model.displayOption,state:this.model.executionState(e),translator:this.translator,notebook:e}):M.createElement(Ke,{displayOption:this.model.displayOption,state:void 0,translator:this.translator,notebook:void 0})}}}(function(r){class e extends Ce{constructor(){super(),this._notebookExecutionProgress=new WeakMap,this._displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},this._renderFlag=!0}attachNotebook(l){var p,i,u,d;if(l&&l.content&&l.context){const g=l.content,b=l.context;if(this._currentNotebook=g,!this._notebookExecutionProgress.has(g)){this._notebookExecutionProgress.set(g,{executionStatus:"idle",kernelStatus:"idle",totalTime:0,interval:0,timeout:0,scheduledCell:new Set,scheduledCellNumber:0,needReset:!0});const f=this._notebookExecutionProgress.get(g),_=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.statusChanged.connect(_,this);const y=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.connectionStatusChanged.connect(y,this),b.disposed.connect(o=>{o.connectionStatusChanged.disconnect(y,this),o.statusChanged.disconnect(_,this)},this);const w=(o,t)=>{const h=t.msg,C=h.header.msg_id;if(h.header.msg_type==="execute_request")this._cellScheduledCallback(g,C);else if(Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="idle"){const k=h.parent_header.msg_id;this._cellExecutedCallback(g,k)}else Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="restarting"?this._restartHandler(g):h.header.msg_type==="execute_input"&&this._startTimer(g)};(i=(p=b.session)===null||p===void 0?void 0:p.kernel)===null||i===void 0||i.anyMessage.connect(w,this),(d=(u=b.session)===null||u===void 0?void 0:u.kernel)===null||d===void 0||d.disposed.connect(o=>o.anyMessage.disconnect(w,this),this);const S=(o,t)=>{f&&(this._resetTime(f),this.stateChanged.emit(void 0),t.newValue&&t.newValue.anyMessage.connect(w,this))};b.kernelChanged.connect(S,this),b.disposed.connect(o=>o.kernelChanged.disconnect(S,this),this)}}}get currentNotebook(){return this._currentNotebook}get displayOption(){return this._displayOption}set displayOption(l){this._displayOption=l}executionState(l){return this._notebookExecutionProgress.get(l)}_scheduleSwitchToIdle(l){window.setTimeout(()=>{l.executionStatus="idle",clearInterval(l.interval),this.stateChanged.emit(void 0)},150),l.timeout=window.setTimeout(()=>{l.needReset=!0},1e3)}_cellExecutedCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&i.scheduledCell.has(p)&&(i.scheduledCell.delete(p),i.scheduledCell.size===0&&this._scheduleSwitchToIdle(i))}_restartHandler(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.clear(),this._scheduleSwitchToIdle(p))}_startTimer(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.size>0?p.executionStatus!=="busy"&&(p.executionStatus="busy",clearTimeout(p.timeout),this.stateChanged.emit(void 0),p.interval=window.setInterval(()=>{this._tick(p)},1e3)):this._resetTime(p))}_cellScheduledCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&!i.scheduledCell.has(p)&&(i.needReset&&this._resetTime(i),i.scheduledCell.add(p),i.scheduledCellNumber+=1)}_tick(l){if(this.isDisposed){clearInterval(l.interval),clearTimeout(l.timeout);return}l.totalTime+=1,this.stateChanged.emit(void 0)}_resetTime(l){l.totalTime=0,l.scheduledCellNumber=0,l.executionStatus="idle",l.scheduledCell=new Set,clearTimeout(l.timeout),clearInterval(l.interval),l.needReset=!1}get renderFlag(){return this._renderFlag}updateRenderOption(l){this.displayOption.showOnToolBar&&(l.showOnToolBar?this._renderFlag=!0:this._renderFlag=!1),this.displayOption.showProgress=l.showProgress,this.displayOption.showJumpToCell=l.showJumpToCell,this.stateChanged.emit(void 0)}}r.Model=e;function n(a,l,p){const i=new r(l);return i.model.displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},i.model.attachNotebook({content:a.content,context:a.sessionContext}),p&&p.then(u=>{const d=g=>{const b=s(g);b.showJumpToCell&&(g.get("recordTiming").composite||g.set("recordTiming",!0).catch(_=>{console.error("Failed to auto-enable recordTiming:",_.message)})),i.model.updateRenderOption(b)};u.changed.connect(d),d(u),i.disposed.connect(()=>{u.changed.disconnect(d)})}).catch(u=>{console.error(u.message)}),i}r.createExecutionIndicatorItem=n;function s(a){let l=!0,p=!0,i=!1;const u=a.get("kernelStatus").composite;return u&&(l=!u.showOnStatusBar,p=u.showProgress,i=u.showJumpToRecentExecutionButton),{showOnToolBar:l,showProgress:p,showJumpToCell:i}}r.getSettingValue=s})(X||(X={}));function Jo(r){const e=(r.translator||R).load("jupyterlab");return J.createElement(De,{source:e.__("Mode: %1",r.modeNames[r.notebookMode])})}class ae extends me{constructor(e){super(new ae.Model),this.translator=e||R,this._trans=this.translator.load("jupyterlab"),this._modeNames={command:this._trans.__("Command"),edit:this._trans.__("Edit")}}render(){return this.model?(this.node.title=this._trans.__("Notebook is in %1 mode",this._modeNames[this.model.notebookMode]),J.createElement(Jo,{notebookMode:this.model.notebookMode,translator:this.translator,modeNames:this._modeNames})):null}}(function(r){class e extends Ce{constructor(){super(...arguments),this._onChanged=s=>{const a=this._notebookMode;this._notebook?this._notebookMode=s.mode:this._notebookMode="command",this._triggerChange(a,this._notebookMode)},this._notebookMode="command",this._notebook=null}get notebookMode(){return this._notebookMode}set notebook(s){const a=this._notebook;a!==null&&(a.stateChanged.disconnect(this._onChanged,this),a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this));const l=this._notebookMode;this._notebook=s,this._notebook===null?this._notebookMode="command":(this._notebookMode=this._notebook.mode,this._notebook.stateChanged.connect(this._onChanged,this),this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this)),this._triggerChange(l,this._notebookMode)}_triggerChange(s,a){s!==a&&this.stateChanged.emit(void 0)}}r.Model=e})(ae||(ae={}));class zo extends ko{constructor(e,n){super(e,n),this.editorWidget=e,this.options=n,this._type="code",this._readyDelegate=new Et,this._editorToCell=new Map,this.editor=e.content,this._cellToEditor=new WeakMap,this.isReady=this.isReady.bind(this),Promise.all([this.widget.context.sessionContext.ready,this.connectionManager.ready]).then(async()=>{await this.initOnceReady(),this._readyDelegate.resolve()}).catch(console.error)}get documentPath(){return this.widget.context.path}get mimeType(){var e;let n,s=this.language_info();return!s||!s.mimetype?n=this.widget.content.codeMimetype:n=s.mimetype,Array.isArray(n)?(e=n[0])!==null&&e!==void 0?e:Nt.defaultMimeType:n}get languageFileExtension(){let e=this.language_info();if(!(!e||!e.file_extension))return e.file_extension.replace(".","")}get wrapperElement(){return this.widget.node}get editors(){if(this.isDisposed)return[];let e=this.widget.content;return this._editorToCell.clear(),e.isDisposed?[]:e.widgets.map(n=>({ceEditor:this._getCellEditor(n),type:n.model.type,value:n.model.sharedModel.getSource()}))}get activeEditor(){return this.editor.activeCell?this._getCellEditor(this.editor.activeCell):void 0}get ready(){return this._readyDelegate.promise}getEditorIndexAt(e){let n=this._getCellAt(e);return this.widget.content.widgets.findIndex(a=>n===a)}getEditorIndex(e){let n=this._editorToCell.get(e);return this.editor.widgets.findIndex(s=>n===s)}getEditorWrapper(e){return this._editorToCell.get(e).node}async onKernelChanged(e,n){if(n.newValue)try{const s=this._languageInfo;await He(this.isReady,-1),await this._updateLanguageInfo();const a=this._languageInfo;s?.name!=a.name||s?.mimetype!=a?.mimetype||s?.file_extension!=a?.file_extension?(console.log(`Changed to ${this._languageInfo.name} kernel, reconnecting`),this.reloadConnection()):console.log("Keeping old LSP connection as the new kernel uses the same language")}catch(s){console.warn(s),this.reloadConnection()}}dispose(){this.isDisposed||(this.widget.context.sessionContext.kernelChanged.disconnect(this.onKernelChanged,this),this.widget.content.activeCellChanged.disconnect(this._activeCellChanged,this),super.dispose(),this._editorToCell.clear(),Ot.clearData(this))}isReady(){var e;return!this.widget.isDisposed&&this.widget.context.isReady&&this.widget.content.isVisible&&this.widget.content.widgets.length>0&&((e=this.widget.context.sessionContext.session)===null||e===void 0?void 0:e.kernel)!=null}async handleCellChange(e,n){let s=[],a=[];const l=this._type;if(n.type==="set"){let p=[],i=[];if(n.newValues.length===n.oldValues.length){for(let u=0;u<n.newValues.length;u++)n.oldValues[u].type===l&&n.newValues[u].type!==l?p.push(n.newValues[u]):n.oldValues[u].type!==l&&n.newValues[u].type===l&&i.push(n.newValues[u]);s=i,a=p}}else n.type=="add"&&(s=n.newValues.filter(p=>p.type===l));(a.length||s.length||n.type==="set"||n.type==="move"||n.type==="remove"||n.type==="clear")&&await this.updateDocuments();for(let p of s){let i=this.widget.content.widgets.find(u=>u.model.id===p.id);if(!i){console.warn(`Widget for added cell with ID: ${p.id} not found!`);continue}this._getCellEditor(i)}}createVirtualDocument(){return new So({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!1,hasLspSupportedFile:!1})}language_info(){return this._languageInfo}async initOnceReady(){await He(this.isReady.bind(this),-1),await this._updateLanguageInfo(),this.initVirtual(),this.connectDocument(this.virtualDocument,!1).catch(console.warn),this.widget.context.sessionContext.kernelChanged.connect(this.onKernelChanged,this),this.widget.content.activeCellChanged.connect(this._activeCellChanged,this),this._connectModelSignals(this.widget),this.editor.modelChanged.connect(e=>{console.warn("Model changed, connecting cell change handler; this is not something we were expecting"),this._connectModelSignals(e)})}_connectModelSignals(e){e.model===null?console.warn(`Model is missing for notebook ${e}, cannot connect cell changed signal!`):e.model.cells.changed.connect(this.handleCellChange,this)}async _updateLanguageInfo(){var e,n,s,a;const l=(a=await((s=(n=(e=this.widget.context.sessionContext)===null||e===void 0?void 0:e.session)===null||n===void 0?void 0:n.kernel)===null||s===void 0?void 0:s.info))===null||a===void 0?void 0:a.language_info;if(l)this._languageInfo=l;else throw new Error("Language info update failed (no session, kernel, or info available)")}_activeCellChanged(e,n){!n||n.model.type!==this._type||this._activeEditorChanged.emit({editor:this._getCellEditor(n)})}_getCellAt(e){let n=this.virtualDocument.getEditorAtVirtualLine(e);return this._editorToCell.get(n)}_getCellEditor(e){if(!this._cellToEditor.has(e)){const n=Object.freeze({getEditor:()=>e.editor,ready:async()=>(await e.ready,e.editor),reveal:async()=>(await this.editor.scrollToCell(e),e.editor)});this._cellToEditor.set(e,n),this._editorToCell.set(n,e),e.disposed.connect(()=>{this._cellToEditor.delete(e),this._editorToCell.delete(n),this._editorRemoved.emit({editor:n})}),this._editorAdded.emit({editor:n})}return this._cellToEditor.get(e)}}class Go extends ee{constructor(){super(),this._items=[],this.layout=new be,this.addClass("jp-RankedPanel")}addWidget(e,n){const s={widget:e,rank:n},a=le.upperBound(this._items,s,Me.itemCmp);le.insert(this._items,a,s),this.layout.insertWidget(a,e)}onChildRemoved(e){const n=le.findFirstIndex(this._items,s=>s.widget===e.child);n!==-1&&le.removeAt(this._items,n)}}class q extends ee{constructor(e){super(),this.addClass("jp-NotebookTools"),this.translator=e.translator||R,this._tools=[],this.layout=new be,this._tracker=e.tracker,this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged,this),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.selectionChanged.connect(this._onSelectionChanged,this),this._onActiveNotebookPanelChanged(),this._onActiveCellChanged(),this._onSelectionChanged()}get activeCell(){return this._tracker.activeCell}get selectedCells(){const e=this._tracker.currentWidget;if(!e)return[];const n=e.content;return n.widgets.filter(s=>n.isSelectedOrActive(s))}get activeNotebookPanel(){return this._tracker.currentWidget}addItem(e){var n;const s=e.tool,a=(n=e.rank)!==null&&n!==void 0?n:100;let l;const p=this._tools.find(i=>i.section===e.section);if(p)l=p.panel;else throw new Error(`The section ${e.section} does not exist`);s.addClass("jp-NotebookTools-tool"),l.addWidget(s,a),s.notebookTools=this,G.sendMessage(s,q.ActiveNotebookPanelMessage),G.sendMessage(s,q.ActiveCellMessage)}addSection(e){var n;const s=e.sectionName,a=e.label||e.sectionName,l=e.tool;let p=(n=e.rank)!==null&&n!==void 0?n:null;const i=new Go;if(i.title.label=a,l&&i.addWidget(l,0),this._tools.push({section:s,panel:i,rank:p}),p!=null)this.layout.insertWidget(p,new ce({widget:i}));else{let u=null;const d=this.layout;for(let g=0;g<d.widgets.length;g++){let b=d.widgets[g];if(b instanceof ce&&b.widget.id==="advancedToolsSection"){u=g;break}}u!==null?this.layout.insertWidget(u,new ce({widget:i})):this.layout.addWidget(new ce({widget:i}))}}_onActiveNotebookPanelChanged(){this._prevActiveNotebookModel&&!this._prevActiveNotebookModel.isDisposed&&this._prevActiveNotebookModel.metadataChanged.disconnect(this._onActiveNotebookPanelMetadataChanged,this);const e=this.activeNotebookPanel&&this.activeNotebookPanel.content?this.activeNotebookPanel.content.model:null;this._prevActiveNotebookModel=e,e&&e.metadataChanged.connect(this._onActiveNotebookPanelMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveNotebookPanelMessage)}_onActiveCellChanged(){this._prevActiveCell&&!this._prevActiveCell.isDisposed&&this._prevActiveCell.metadataChanged.disconnect(this._onActiveCellMetadataChanged,this);const e=this.activeCell?this.activeCell.model:null;this._prevActiveCell=e,e&&e.metadataChanged.connect(this._onActiveCellMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveCellMessage)}_onSelectionChanged(){for(const e of this._toolChildren())G.sendMessage(e,q.SelectionMessage)}_onActiveNotebookPanelMetadataChanged(e,n){const s=new ge.ChangeMessage("activenotebookpanel-metadata-changed",{oldValue:void 0,newValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}_onActiveCellMetadataChanged(e,n){const s=new ge.ChangeMessage("activecell-metadata-changed",{newValue:void 0,oldValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}*_toolChildren(){for(let e of this._tools)yield*e.panel.children()}}(function(r){r.ActiveNotebookPanelMessage=new xe("activenotebookpanel-changed"),r.ActiveCellMessage=new xe("activecell-changed"),r.SelectionMessage=new xe("selection-changed");class e extends ee{dispose(){super.dispose(),this.notebookTools&&(this.notebookTools=null)}processMessage(a){switch(super.processMessage(a),a.type){case"activenotebookpanel-changed":this.onActiveNotebookPanelChanged(a);break;case"activecell-changed":this.onActiveCellChanged(a);break;case"selection-changed":this.onSelectionChanged(a);break;case"activecell-metadata-changed":this.onActiveCellMetadataChanged(a);break;case"activenotebookpanel-metadata-changed":this.onActiveNotebookPanelMetadataChanged(a);break}}onActiveNotebookPanelChanged(a){}onActiveCellChanged(a){}onSelectionChanged(a){}onActiveCellMetadataChanged(a){}onActiveNotebookPanelMetadataChanged(a){}}r.Tool=e;class n extends e{constructor(a){super();const{editorFactory:l}=a;this.addClass("jp-MetadataEditorTool");const p=this.layout=new be;this._editorFactory=l,this._editorLabel=a.label||"Edit Metadata",this.createEditor();const i=new ee({node:document.createElement("label")});i.node.textContent=a.label||"Edit Metadata",p.addWidget(i),p.addWidget(this.editor)}get editor(){return this._editor}onActiveNotebookPanelChanged(a){this.editor.dispose(),this.notebookTools.activeNotebookPanel&&this.createEditor()}createEditor(){this._editor=new Ko({editorFactory:this._editorFactory}),this.editor.title.label=this._editorLabel,this.layout.addWidget(this.editor)}}r.MetadataEditorTool=n})(q||(q={}));var Me;(function(r){function e(n,s){return n.rank-s.rank}r.itemCmp=e})(Me||(Me={}));const Yo=6;var V;(function(r){r[r.Idle=-1]="Idle",r[r.Error=-.5]="Error",r[r.Scheduled=0]="Scheduled",r[r.Running=1]="Running"})(V||(V={}));class Xo extends Po{constructor(e,n,s,a){super(e,a),this.parser=n,this.sanitizer=s,this.configMetadataMap={numberHeaders:["toc-autonumbering","toc/number_sections"],numberingH1:["!toc/skip_h1_title"],baseNumbering:["toc/base_numbering"]},this._runningCells=new Array,this._errorCells=new Array,this._cellToHeadingIndex=new WeakMap,e.context.ready.then(()=>{this.setConfiguration({})}),this.widget.context.model.metadataChanged.connect(this.onMetadataChanged,this),this.widget.content.activeCellChanged.connect(this.onActiveCellChanged,this),v.executionScheduled.connect(this.onExecutionScheduled,this),v.executed.connect(this.onExecuted,this),v.outputCleared.connect(this.onOutputCleared,this),this.headingsChanged.connect(this.onHeadingsChanged,this)}get documentType(){return"notebook"}get isAlwaysActive(){return!0}get supportedOptions(){return["baseNumbering","maximalDepth","numberingH1","numberHeaders","includeOutput","syncCollapseState"]}getCellHeadings(e){const n=new Array;let s=this._cellToHeadingIndex.get(e);if(s!==void 0){const a=this.headings[s];for(n.push(a);this.headings[s-1]&&this.headings[s-1].cellRef===a.cellRef;)s--,n.unshift(this.headings[s])}return n}dispose(){var e,n,s;this.isDisposed||(this.headingsChanged.disconnect(this.onHeadingsChanged,this),(n=(e=this.widget.context)===null||e===void 0?void 0:e.model)===null||n===void 0||n.metadataChanged.disconnect(this.onMetadataChanged,this),(s=this.widget.content)===null||s===void 0||s.activeCellChanged.disconnect(this.onActiveCellChanged,this),v.executionScheduled.disconnect(this.onExecutionScheduled,this),v.executed.disconnect(this.onExecuted,this),v.outputCleared.disconnect(this.onOutputCleared,this),this._runningCells.length=0,this._errorCells.length=0,super.dispose())}setConfiguration(e){const n=this.loadConfigurationFromMetadata();super.setConfiguration({...this.configuration,...n,...e})}toggleCollapse(e){super.toggleCollapse(e),this.updateRunningStatus(this.headings)}async getHeadings(){const e=this.widget.content.widgets,n=new Set(e),s=[],a=new Array,l=new WeakMap;for(let p=0;p<e.length;p++){const i=e[p];switch(i.model.type){case"code":{!this.configuration.syncCollapseState&&this.configuration.includeOutput&&s.push(...Le(await i.getHeadings(),this.configuration,a).map(d=>({...d,cellRef:i,collapsed:!1,isRunning:V.Idle})));break}case"markdown":{const d=Le(await i.getHeadings(),this.configuration,a).map((g,b)=>({...g,cellRef:i,collapsed:!1,isRunning:V.Idle}));if(this.configuration.syncCollapseState&&i.headingCollapsed){const g=Math.min(...d.map(f=>f.level)),b=d.find(f=>f.level===g);b.collapsed=i.headingCollapsed}s.push(...d);break}}s.length>0&&l.set(i,s.length-1)}return this._cellToHeadingIndex=l,this._runningCells=this._runningCells.filter(p=>n.has(p)),this._errorCells=this._errorCells.filter(p=>n.has(p)),this.updateRunningStatus(s),Promise.resolve(s)}isHeadingEqual(e,n){return super.isHeadingEqual(e,n)&&e.cellRef===n.cellRef&&e.isRunning===n.isRunning}loadConfigurationFromMetadata(){const e=this.widget.content.model,n={};if(e)for(const s in this.configMetadataMap){const a=this.configMetadataMap[s];for(const l of a){let p=l;const i=p[0]==="!";i&&(p=p.slice(1));const u=p.split("/");let d=e.getMetadata(u[0]);for(let g=1;g<u.length;g++)d=(d??{})[u[g]];d!==void 0&&(typeof d=="boolean"&&i&&(d=!d),n[s]=d)}}return n}onActiveCellChanged(e,n){const s=this.getCellHeadings(n)[0];this.setActiveHeading(s??null,!1)}onHeadingsChanged(){this.widget.content.activeCell&&this.onActiveCellChanged(this.widget.content,this.widget.content.activeCell)}onExecuted(e,n){this._runningCells.forEach((s,a)=>{var l;if(s===n.cell){this._runningCells.splice(a,1);const p=this._cellToHeadingIndex.get(s);if(p!==void 0){const i=this.headings[p];if(n.success||((l=n.error)===null||l===void 0?void 0:l.errorName)===void 0){i.isRunning=V.Idle;return}i.isRunning=V.Error,this._errorCells.includes(s)||this._errorCells.push(s)}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onExecutionScheduled(e,n){this._runningCells.includes(n.cell)||this._runningCells.push(n.cell),this._errorCells.forEach((s,a)=>{s===n.cell&&this._errorCells.splice(a,1)}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onOutputCleared(e,n){this._errorCells.forEach((s,a)=>{if(s===n.cell){this._errorCells.splice(a,1);const l=this._cellToHeadingIndex.get(s);if(l!==void 0){const p=this.headings[l];p.isRunning=V.Idle}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onMetadataChanged(){this.setConfiguration({})}updateRunningStatus(e){e.forEach(a=>{a.isRunning=V.Idle}),this._runningCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning!==V.Running&&(i.isRunning=l>0?V.Scheduled:V.Running)}}),this._errorCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning===V.Idle&&(i.isRunning=V.Error)}});let n=0;for(;n<e.length;){const a=e[n];if(n++,a.collapsed){const l=Math.max(a.isRunning,s(e,a.level));a.dataset={...a.dataset,"data-running":l.toString()}}else a.dataset={...a.dataset,"data-running":a.isRunning.toString()}}function s(a,l){let p=V.Idle;for(;n<a.length;){const i=a[n];if(i.dataset={...i.dataset,"data-running":i.isRunning.toString()},i.level>l)n++,p=Math.max(i.isRunning,p),i.collapsed&&(p=Math.max(p,s(a,i.level)),i.dataset={...i.dataset,"data-running":p.toString()});else break}return p}}}class Zo extends Io{constructor(e,n,s,a){super(e),this.parser=n,this.sanitizer=s,this.commands=a,this._scrollToTop=!0}get scrollToTop(){return this._scrollToTop}set scrollToTop(e){this._scrollToTop=e}_createNew(e,n){const s=new Xo(e,this.parser,this.sanitizer,n);let a=new WeakMap;const l=(_,y)=>{if(y){const w=async h=>{if(!h.inViewport)return;let C=a.get(y);if((!C||!y.cellRef.node.contains(C))&&(await i(h),C=a.get(y)),C)if(this.scrollToTop)C.scrollIntoView({block:"start"}),e.content.outerNode.scrollTop-=Yo;else{const k=e.content.node.getBoundingClientRect(),A=C.getBoundingClientRect();(A.top>k.bottom||A.bottom<k.top)&&C.scrollIntoView({block:"center"})}else console.debug("scrolling to heading: using fallback strategy"),await e.content.scrollToItem(e.content.activeCellIndex,this.scrollToTop?"start":void 0,0)},S=y.cellRef,t=e.content.widgets.indexOf(S);S.model.type=="markdown"&&e.content.mode!="command"&&(e.content.mode="command"),e.content.activeCellIndex=t,S.inViewport?w(S).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)}):e.content.scrollToItem(t,this.scrollToTop?"start":void 0).then(()=>i(S)).then(()=>w(S)).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)})}},p=_=>s.getCellHeadings(_).filter(y=>y.cellRef===_),i=async _=>{var y;const w=p(_),S=(y=this.sanitizer.allowNamedProperties)!==null&&y!==void 0&&y?"id":"data-jupyter-id",o=await Promise.all(w.map(async h=>{const C=await Qo(h,this.parser,this.sanitizer);return C?`h${h.level}[${S}="${CSS.escape(C)}"]`:`h${h.level}`})),t=p(_);t.length!==w.length||t.some((h,C)=>h!==w[C])||(we(_.node),w.forEach((h,C)=>{var k,A;const B=h.outputIndex===void 0?h.cellRef.node:(k=h.cellRef.outputArea.widgets[h.outputIndex])===null||k===void 0?void 0:k.node;a.set(h,B?It(B,o[C],(A=h.prefix)!==null&&A!==void 0?A:""):null)}))},u=_=>{if(this.parser){we(e.content.node),a=new WeakMap;for(const y of e.content.widgets)y instanceof Z&&y.renderedChanged.connect(f);return Promise.all(e.content.widgets.map(y=>i(y)))}},d=(_,y)=>{var w,S,o,t;if(s.configuration.syncCollapseState)if(y!==null){const h=y.cellRef;h.headingCollapsed!==((w=y.collapsed)!==null&&w!==void 0?w:!1)&&(h.headingCollapsed=(S=y.collapsed)!==null&&S!==void 0?S:!1)}else{const h=(t=(o=s.headings[0])===null||o===void 0?void 0:o.collapsed)!==null&&t!==void 0?t:!1;e.content.widgets.forEach(C=>{C instanceof Z&&C.headingInfo.level>=0&&(C.headingCollapsed=h)})}},g=(_,y)=>{if(s.configuration.syncCollapseState){const w=s.getCellHeadings(y)[0];w&&s.toggleCollapse({heading:w,collapsed:y.headingCollapsed})}},b=(_,y)=>{var w;y.inViewport?(w=i(y))===null||w===void 0||w.catch(console.warn):we(y.node)},f=(_,y)=>{y&&i(_).catch(console.warn)};return e.context.ready.then(()=>{var _;(_=u())===null||_===void 0||_.catch(console.warn),s.activeHeadingChanged.connect(l),s.headingsChanged.connect(u),s.collapseChanged.connect(d),e.content.cellCollapsed.connect(g),e.content.cellInViewportChanged.connect(b),e.disposed.connect(()=>{s.activeHeadingChanged.disconnect(l),s.headingsChanged.disconnect(u),s.collapseChanged.disconnect(d),e.content.cellCollapsed.disconnect(g),e.content.cellInViewportChanged.disconnect(b);for(const y of e.content.widgets)y instanceof Z&&y.renderedChanged.disconnect(f)})}),s}getToolbarItems(e){return this.commands?[{name:"select-last-modified-back",widget:new Pe({commands:this.commands,id:"notebook:select-last-modified-cell",args:{toolbar:!0},icon:jt,label:""})},{name:"select-last-modified-forward",widget:new Pe({commands:this.commands,id:"notebook:select-next-modified-cell",args:{toolbar:!0},icon:Rt,label:""})}]:[]}}async function Qo(r,e,n){let s=null;return r.type===We.HeadingType.Markdown?s=await Pt(e,r.raw,r.level,n):r.type===We.HeadingType.HTML&&(s=r.id),s}const en="jp-StatusItem-trust";function tn(r,e){e=e||R;const n=e.load("jupyterlab");return r.trustedCells===r.totalCells?n.__("Notebook trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):r.activeCellTrusted?n.__("Active cell trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):n.__("Notebook not trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells)}function on(r){return r.allCellsTrusted?M.createElement(Lt.react,{top:"2px",stylesheet:"statusBar"}):M.createElement(Wt.react,{top:"2px",stylesheet:"statusBar"})}class de extends me{constructor(e){super(new de.Model),this.translator=e||R,this.node.classList.add(en)}render(){if(!this.model)return null;const e=tn(this.model,this.translator);return e!==this.node.title&&(this.node.title=e),M.createElement(on,{allCellsTrusted:this.model.trustedCells===this.model.totalCells,activeCellTrusted:this.model.activeCellTrusted,totalCells:this.model.totalCells,trustedCells:this.model.trustedCells})}}(function(r){class e extends Ce{constructor(){super(...arguments),this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1,this._notebook=null}get trustedCells(){return this._trustedCells}get totalCells(){return this._totalCells}get activeCellTrusted(){return this._activeCellTrusted}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a!==null&&(a.activeCellChanged.disconnect(this._onActiveCellChanged,this),a.modelContentChanged.disconnect(this._onModelChanged,this));const l=this._getAllState();if(this._notebook=s,this._notebook===null)this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1;else{this._notebook.activeCellChanged.connect(this._onActiveCellChanged,this),this._notebook.modelContentChanged.connect(this._onModelChanged,this),this._notebook.activeCell?this._activeCellTrusted=this._notebook.activeCell.model.trusted:this._activeCellTrusted=!1;const{total:p,trusted:i}=this._deriveCellTrustState(this._notebook.model);this._totalCells=p,this._trustedCells=i}this._triggerChange(l,this._getAllState())}_onModelChanged(s){const a=this._getAllState(),{total:l,trusted:p}=this._deriveCellTrustState(s.model);this._totalCells=l,this._trustedCells=p,this._triggerChange(a,this._getAllState())}_onActiveCellChanged(s,a){const l=this._getAllState();a?this._activeCellTrusted=a.model.trusted:this._activeCellTrusted=!1,this._triggerChange(l,this._getAllState())}_deriveCellTrustState(s){if(s===null)return{total:0,trusted:0};let a=0,l=0;for(const p of s.cells)p.type==="code"&&(a++,p.trusted&&l++);return{total:a,trusted:l}}_getAllState(){return[this._trustedCells,this._totalCells,this.activeCellTrusted]}_triggerChange(s,a){(s[0]!==a[0]||s[1]!==a[1]||s[2]!==a[2])&&this.stateChanged.emit(void 0)}}r.Model=e})(de||(de={}));const nn=new ot("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets."),ln={id:"@jupyterlab/notebook-extension:cell-executor",description:"Provides the notebook cell executor.",autoStart:!0,provides:lt,activate:()=>Object.freeze({runCell:Ht})},sn=new ot("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure."),rn={activate:an,id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[L],optional:[sn],autoStart:!0};function an(r,e,n){if(!n)return;function s(a){function l(p,i,u){if(Y.KernelMessage.isDisplayDataMsg(p)||Y.KernelMessage.isStreamMsg(p)||Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isExecuteResultMsg(p)){const d=n.getLogger(a.context.path);d.rendermime=a.content.rendermime;const g={...p.content,output_type:p.header.msg_type};let b=i;(Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isStreamMsg(p)&&p.content.name==="stderr")&&(b=u),d.log({type:"output",data:g,level:b})}}a.context.sessionContext.iopubMessage.connect((p,i)=>l(i,"info","info"),a),a.context.sessionContext.unhandledMessage.connect((p,i)=>l(i,"warning","error"),a)}e.forEach(a=>s(a)),e.widgetAdded.connect((a,l)=>s(l))}const dn="jp-ActiveCellTool",cn="jp-ActiveCellTool-Content",un="jp-ActiveCellTool-CellContent";class hn extends q.Tool{constructor(e){super(),this._cellModel=null,this._updateId=0,this._pendingUpdate=!1,this._promptOutdated=!1,this._tracker=e.tracker,this._languages=e.languages,this.addClass(dn),this.layout=new be,this._inputPrompt=new Ft,this.layout.addWidget(this._inputPrompt);const n=document.createElement("div");n.classList.add(cn);const s=n.appendChild(document.createElement("div")),a=s.appendChild(document.createElement("pre"));s.className=un,this._editorEl=a,this.layout.addWidget(new ee({node:n})),this._previewDebouncer=new Kt(()=>this._update(),150),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.currentChanged.connect(this._onActiveCellChanged,this),this._onActiveCellChanged()}dispose(){this.isDisposed||(this._tracker.activeCellChanged.disconnect(this._onActiveCellChanged,this),this._tracker.currentChanged.disconnect(this._onActiveCellChanged,this),this._disconnectCellModel(),this._previewDebouncer.dispose(),super.dispose())}render(e){return M.createElement("div",{ref:n=>{!n||this.node.parentElement===n||(n.appendChild(this.node),this._pendingUpdate&&this._update().catch(console.warn))}})}_onActiveCellChanged(){var e,n;const s=(n=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model)!==null&&n!==void 0?n:null;s!==this._cellModel&&(this._disconnectCellModel(),this._cellModel=s,s&&(s.sharedModel.changed.connect(this._onCellContentChanged,this),s.mimeTypeChanged.connect(this._onCellContentChanged,this)),this._promptOutdated=!0,this._update().catch(console.warn))}_onCellContentChanged(){if(!this.node.isConnected){this._pendingUpdate=!0,this._promptOutdated=!0;return}this._promptOutdated||this._updatePrompt(),this._previewDebouncer.invoke().catch(console.warn)}_disconnectCellModel(){const e=this._cellModel;e&&(e.sharedModel.changed.disconnect(this._onCellContentChanged,this),e.mimeTypeChanged.disconnect(this._onCellContentChanged,this),this._cellModel=null)}_updatePrompt(){var e;const n=this._cellModel;n&&Vt(n)?(this._inputPrompt.executionCount=`${(e=n.executionCount)!==null&&e!==void 0?e:""}`,this._inputPrompt.show()):(this._inputPrompt.executionCount=null,this._inputPrompt.hide())}async _update(){if(!this.node.isConnected){this._pendingUpdate=!0;return}this._pendingUpdate=!1;const e=this._cellModel,n=++this._updateId;if(!e){this._promptOutdated=!1,this._updatePrompt(),this._editorEl.replaceChildren();return}const s=e.sharedModel.getSource(),a=s.indexOf(`
|
|
2
|
-
`),l=a===-1?s:s.slice(0,a),p=document.createElement("pre");try{await this._languages.highlight(l,this._languages.findByMIME(e.mimeType),p)}catch(u){console.warn(u),p.replaceChildren(document.createTextNode(l))}if(n!==this._updateId)return;this._promptOutdated&&(this._updatePrompt(),this._promptOutdated=!1);const i=document.createDocumentFragment();for(;p.firstChild;)i.appendChild(p.firstChild);this._editorEl.replaceChildren(i)}}const pn="jp-CellMetadataEditor",gn="jp-NotebookMetadataEditor";class mn extends q.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,n,s;const a=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model.sharedModel;if(a&&this.editor.source){const l=Object.keys((n=a.metadata)!==null&&n!==void 0?n:{}),p=(s=this.editor.source.toJSON())!==null&&s!==void 0?s:{};a.transact(()=>{l.forEach(i=>a.deleteMetadata(i)),a.setMetadata(p)})}}render(e){var n;const s=this._tracker.activeCell,a=this.editor.source;return this.editor.source=s?new ge({values:s.model.metadata}):null,a?.dispose(),(n=this.editor.source)===null||n===void 0||n.changed.connect(this._onSourceChanged,this),M.createElement("div",{className:pn},M.createElement("div",{ref:l=>l?.appendChild(this.node)}))}}class Cn extends q.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,n;this.editor.source&&((n=(e=this._tracker.currentWidget)===null||e===void 0?void 0:e.model)===null||n===void 0||n.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var n,s;const a=this._tracker.currentWidget,l=this.editor.source;return this.editor.source=a?new ge({values:(n=a.model)===null||n===void 0?void 0:n.metadata}):null,l?.dispose(),(s=this.editor.source)===null||s===void 0||s.changed.connect(this._onSourceChanged,this),M.createElement("div",{className:gn},M.createElement("div",{ref:p=>p?.appendChild(this.node)}))}}var c;(function(r){r.createNew="notebook:create-new",r.interrupt="notebook:interrupt-kernel",r.restart="notebook:restart-kernel",r.restartClear="notebook:restart-clear-output",r.restartAndRunToSelected="notebook:restart-and-run-to-selected",r.restartRunAll="notebook:restart-run-all",r.reconnectToKernel="notebook:reconnect-to-kernel",r.changeKernel="notebook:change-kernel",r.getKernel="notebook:get-kernel",r.createConsole="notebook:create-console",r.createSubshellConsole="notebook:create-subshell-console",r.createOutputView="notebook:create-output-view",r.clearAllOutputs="notebook:clear-all-cell-outputs",r.shutdown="notebook:shutdown-kernel",r.closeAndShutdown="notebook:close-and-shutdown",r.trust="notebook:trust",r.exportToFormat="notebook:export-to-format",r.run="notebook:run-cell",r.runAndAdvance="notebook:run-cell-and-select-next",r.runAndInsert="notebook:run-cell-and-insert-below",r.runInConsole="notebook:run-in-console",r.runAll="notebook:run-all-cells",r.runAllAbove="notebook:run-all-above",r.runAllBelow="notebook:run-all-below",r.renderAllMarkdown="notebook:render-all-markdown",r.toCode="notebook:change-cell-to-code",r.toMarkdown="notebook:change-cell-to-markdown",r.toRaw="notebook:change-cell-to-raw",r.cut="notebook:cut-cell",r.copy="notebook:copy-cell",r.pasteAbove="notebook:paste-cell-above",r.pasteBelow="notebook:paste-cell-below",r.duplicateBelow="notebook:duplicate-below",r.pasteAndReplace="notebook:paste-and-replace-cell",r.moveUp="notebook:move-cell-up",r.moveDown="notebook:move-cell-down",r.clearOutputs="notebook:clear-cell-output",r.deleteCell="notebook:delete-cell",r.insertAbove="notebook:insert-cell-above",r.insertBelow="notebook:insert-cell-below",r.selectAbove="notebook:move-cursor-up",r.selectBelow="notebook:move-cursor-down",r.selectHeadingAboveOrCollapse="notebook:move-cursor-heading-above-or-collapse",r.selectHeadingBelowOrExpand="notebook:move-cursor-heading-below-or-expand",r.insertHeadingAbove="notebook:insert-heading-above",r.insertHeadingBelow="notebook:insert-heading-below",r.extendAbove="notebook:extend-marked-cells-above",r.extendTop="notebook:extend-marked-cells-top",r.extendBelow="notebook:extend-marked-cells-below",r.extendBottom="notebook:extend-marked-cells-bottom",r.selectAll="notebook:select-all",r.deselectAll="notebook:deselect-all",r.editMode="notebook:enter-edit-mode",r.merge="notebook:merge-cells",r.mergeAbove="notebook:merge-cell-above",r.mergeBelow="notebook:merge-cell-below",r.split="notebook:split-cell-at-cursor",r.commandMode="notebook:enter-command-mode",r.toggleAllLines="notebook:toggle-all-cell-line-numbers",r.undoCellAction="notebook:undo-cell-action",r.redoCellAction="notebook:redo-cell-action",r.redo="notebook:redo",r.undo="notebook:undo",r.markdown1="notebook:change-cell-to-heading-1",r.markdown2="notebook:change-cell-to-heading-2",r.markdown3="notebook:change-cell-to-heading-3",r.markdown4="notebook:change-cell-to-heading-4",r.markdown5="notebook:change-cell-to-heading-5",r.markdown6="notebook:change-cell-to-heading-6",r.hideCode="notebook:hide-cell-code",r.showCode="notebook:show-cell-code",r.hideAllCode="notebook:hide-all-cell-code",r.showAllCode="notebook:show-all-cell-code",r.hideOutput="notebook:hide-cell-outputs",r.showOutput="notebook:show-cell-outputs",r.toggleOutput="notebook:toggle-cell-outputs",r.hideAllOutputs="notebook:hide-all-cell-outputs",r.showAllOutputs="notebook:show-all-cell-outputs",r.toggleRenderSideBySideCurrentNotebook="notebook:toggle-render-side-by-side-current",r.setSideBySideRatio="notebook:set-side-by-side-ratio",r.enableOutputScrolling="notebook:enable-output-scrolling",r.disableOutputScrolling="notebook:disable-output-scrolling",r.toggleOutputScrolling="notebook:toggle-output-scrolling",r.selectLastRunCell="notebook:select-last-run-cell",r.selectLastModifiedCell="notebook:select-last-modified-cell",r.selectNextModifiedCell="notebook:select-next-modified-cell",r.replaceSelection="notebook:replace-selection",r.autoClosingBrackets="notebook:toggle-autoclosing-brackets",r.toggleCollapseCmd="notebook:toggle-heading-collapse",r.collapseAllCmd="notebook:collapse-all-headings",r.expandAllCmd="notebook:expand-all-headings",r.copyToClipboard="notebook:copy-to-clipboard",r.invokeCompleter="completer:invoke-notebook",r.selectCompleter="completer:select-notebook",r.tocRunCells="toc:run-cells",r.accessPreviousHistory="notebook:access-previous-history-entry",r.accessNextHistory="notebook:access-next-history-entry",r.virtualScrollbar="notebook:toggle-virtual-scrollbar",r.copySelectedtext="notebook:copy-selected-text",r.pasteText="notebook:paste-text",r.cutSelectedtext="notebook:cut-selected-text"})(c||(c={}));const D="Notebook",bn=["notebook","python","custom"],fn="@jupyterlab/notebook-extension:panel",Ve="jp-NotebookExtension-sideBySideMargins",te={id:"@jupyterlab/notebook-extension:tracker",description:"Provides the notebook widget tracker.",provides:L,requires:[st,uo,lt],optional:[$e,mo,Co,at,dt,bo,_e,Je,F,Ee,rt],activate:qn,autoStart:!0},vn={id:"@jupyterlab/notebook-extension:factory",description:"Provides the notebook and cell factory.",provides:Se.IContentFactory,requires:[fe],autoStart:!0,activate:(r,e)=>{const n=e.factoryService.newInlineEditor;return new Se.ContentFactory({editorFactory:n})}},_n={activate:Hn,provides:go,id:"@jupyterlab/notebook-extension:tools",description:"Provides the notebook tools.",autoStart:!0,requires:[L,fe,it,Ut.IStateDB,F],optional:[po]},yn={id:"@jupyterlab/notebook-extension:mode-status",description:"Adds a notebook mode status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new ae(n);e.currentChanged.connect(()=>{const p=e.currentWidget;l.model.notebook=p&&p.content}),s.registerStatusItem("@jupyterlab/notebook-extension:mode-status",{priority:1,item:l,align:"right",rank:4,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},ct={id:"@jupyterlab/notebook-extension:cell-counter-status",description:"Adds a notebook cell counter status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new re({translator:n}),p=()=>{const i=e.currentWidget;l.model.notebook=i&&i.content};e.currentChanged.connect(p),p(),s.registerStatusItem(ct.id,{priority:1,item:l,align:"right",rank:2.5,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},xn={id:"@jupyterlab/notebook-extension:execution-indicator",description:"Adds a notebook execution status widget.",autoStart:!0,requires:[L,fo,F],optional:[ve,_e],activate:(r,e,n,s,a,l)=>{let p,i,u;const d=g=>{var b,f;let{showOnToolBar:_,showProgress:y,showJumpToCell:w}=g;if(_)u&&(n.currentChanged.disconnect(i),u.dispose());else{if(!a)return;p?.model||(p=new X(s),i=(S,o)=>{const{newValue:t}=o;if(t&&e.has(t)){const h=t;p.model.attachNotebook({content:h.content,context:h.sessionContext})}},u=a.registerStatusItem("@jupyterlab/notebook-extension:execution-indicator",{item:p,align:"left",rank:3,isActive:()=>{const S=n.currentWidget;return!!S&&e.has(S)}}),p.model.attachNotebook({content:(b=e.currentWidget)===null||b===void 0?void 0:b.content,context:(f=e.currentWidget)===null||f===void 0?void 0:f.sessionContext}),n.currentChanged.connect(i),p.disposed.connect(()=>{n.currentChanged.disconnect(i)})),p.model.displayOption={showOnToolBar:_,showProgress:y,showJumpToCell:w}}};if(l){const g=l.load(te.id);Promise.all([g,r.restored]).then(([b])=>{d(X.getSettingValue(b)),b.changed.connect(f=>d(X.getSettingValue(f)))}).catch(b=>{console.error(b.message)})}}},wn={id:"@jupyterlab/notebook-extension:export",description:"Adds the export notebook commands.",autoStart:!0,requires:[F,L],optional:[dt,$e],activate:(r,e,n,s,a)=>{var l;const p=e.load("jupyterlab"),{commands:i,shell:u}=r,d=r.serviceManager,g=()=>H.isEnabled(u,n);i.addCommand(c.exportToFormat,{label:y=>{if(y.label===void 0)return p.__("Save and Export Notebook to the given `format`.");const w=y.label;return y.isPalette?p.__("Save and Export Notebook: %1",w):w},execute:async y=>{var w,S,o;const t=m(n,u,y);if(!t)return;const{context:h}=t,C=pe.PageConfig.getNotebookVersion(),k=pe.compareVersions(C,[4,0,0])<0&&pe.compareVersions(C,[2,18,0])>=0;let A=!1;if(y.format==="html"&&k){const E=await Ge.getBoolean({title:p.__("Export as HTML"),label:p.__("Sanitize HTML output"),value:!0});if(!E.button.accept)return;A=(w=E.value)!==null&&w!==void 0?w:!1}const B={format:y.format,path:t.context.path,exporterOptions:{download:!0,sanitizeHtml:A}};return h.model.dirty&&!h.model.readOnly&&await h.save(),(o=(S=d.nbconvert).exportAs)===null||o===void 0?void 0:o.call(S,B)},isEnabled:g,describedBy:{args:{type:"object",properties:{format:{type:"string",description:p.__("The export format (e.g., pdf, html, latex)")},label:{type:"string",description:p.__("The label to display for this format")},isPalette:{type:"boolean",description:p.__("Whether the command is called from the command palette")}},required:["format"]}}});let b;s&&(b=(l=s.fileMenu.items.find(y=>{var w;return y.type==="submenu"&&((w=y.submenu)===null||w===void 0?void 0:w.id)==="jp-mainmenu-file-notebookexport"}))===null||l===void 0?void 0:l.submenu);let f=!1;const _=async()=>{if(f)return;n.widgetAdded.disconnect(_),f=!0;const y=await d.nbconvert.getExportFormats(!1);if(!y)return;const w=H.getFormatLabels(e);Object.keys(y).forEach(function(o){const t=o[0].toLocaleUpperCase()+o.slice(1),h=p.__(t),C=w[o]?w[o]:h;let k={format:o,label:C,isPalette:!1};if(bn.indexOf(o)===-1&&(b&&b.addItem({command:c.exportToFormat,args:k}),a)){k={format:o,label:C,isPalette:!0};const A=p.__("Notebook Operations");a.addItem({command:c.exportToFormat,category:A,args:k})}})};n.widgetAdded.connect(_)}},kn={id:"@jupyterlab/notebook-extension:trust-status",description:"Adds the notebook trusted status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new de(n);e.currentChanged.connect(()=>{const p=e.currentWidget;l.model.notebook=p&&p.content}),s.registerStatusItem("@jupyterlab/notebook-extension:trust-status",{item:l,align:"right",rank:3,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},Sn={id:"@jupyterlab/notebook-extension:widget-factory",description:"Provides the notebook widget factory.",provides:st,requires:[Se.IContentFactory,fe,vo,pt],optional:[_e,Je,F],activate:Fn,autoStart:!0},An={id:"@jupyterlab/notebook-extension:cloned-outputs",description:"Adds the clone output feature.",requires:[yo,L,F],optional:[at],activate:Kn,autoStart:!0},Mn={id:"@jupyterlab/notebook-extension:code-console",description:"Adds the notebook code consoles features.",requires:[L,F],activate:Vn,autoStart:!0},Tn={id:"@jupyterlab/notebook-extension:copy-output",description:"Adds the copy cell outputs feature.",activate:Un,requires:[F,L],autoStart:!0},Bn={id:"@jupyterlab/notebook-extension:kernel-status",description:"Adds the notebook kernel status.",activate:(r,e,n)=>{const s=a=>{let l=null;return a&&e.has(a)?a.sessionContext:l};n.addSessionProvider(s)},requires:[L,gt],autoStart:!0},En={id:"@jupyterlab/notebook-extension:cursor-position",description:"Adds the notebook cursor position status.",activate:(r,e,n)=>{let s=null;const a=async l=>{let p=null;if(l!==s){if(s?.content.activeCellChanged.disconnect(n.update),s=null,l&&e.has(l)){l.content.activeCellChanged.connect(n.update);const i=l.content.activeCell;p=null,i&&(await i.ready,p=i.editor),s=l}}else if(l){const i=l.content.activeCell;p=null,i&&(await i.ready,p=i.editor)}return p};n.addEditorProvider(a)},requires:[L,qt],autoStart:!0},Nn={id:"@jupyterlab/notebook-extension:completer",description:"Adds the code completion capability to notebooks.",requires:[L],optional:[xo,F,ze],activate:Dn,autoStart:!0},On={id:"@jupyterlab/notebook-extension:search",description:"Adds search capability to notebooks.",requires:[wo],autoStart:!0,activate:(r,e)=>{e.add("jp-notebookSearchProvider",Zt)}},jn={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[L,Dt,ze],optional:[_o,_e],autoStart:!0,activate:(r,e,n,s,a,l)=>{const p=new Zo(e,a,s,r.commands);n.add(p),l&&Promise.all([r.restored,l.load(te.id)]).then(([i,u])=>{const d=()=>{var g;p.scrollToTop=(g=u.composite.scrollHeadingToTop)!==null&&g!==void 0?g:!0};d(),u.changed.connect(d)}).catch(i=>{console.error("Failed to load notebook table of content settings.",i)})}},Rn={id:"@jupyterlab/notebook-extension:language-server",description:"Adds language server capability to the notebooks.",requires:[L,Ao,Mo,To,Bo],activate:$n,autoStart:!0},In={id:"@jupyterlab/notebook-extension:update-raw-mimetype",description:"Adds metadata form editor for raw cell mimetype.",autoStart:!0,requires:[L,nn,F],activate:(r,e,n,s)=>{const a=s.load("jupyterlab");let l=!1;async function p(){if(l||!n.get("commonToolsSection"))return;const i=n.get("commonToolsSection").getProperties("/raw_mimetype");if(!i)return;e.widgetAdded.disconnect(p),l=!0;const d=await r.serviceManager.nbconvert.getExportFormats(!1);if(!d)return;const g=Object.keys(d),b=H.getFormatLabels(s);g.forEach(function(f){var _;if(!(((_=i.oneOf)===null||_===void 0?void 0:_.filter(w=>w.const===f).length)>0)){const w=f[0].toLocaleUpperCase()+f.slice(1),S=a.__(w),o=b[f]?b[f]:S,t=d[f].output_mimetype;i.oneOf.push({const:t,title:o})}}),n.get("commonToolsSection").setProperties("/raw_mimetype",i)}e.widgetAdded.connect(p)}},Pn={id:"@jupyterlab/notebook-extension:metadata-editor",description:"Adds metadata form for full metadata editor.",autoStart:!0,requires:[L,fe,Ee],optional:[F],activate:(r,e,n,s,a)=>{const l=g=>n.factoryService.newInlineEditor(g),p=new mn({editorFactory:l,tracker:e,label:"Cell metadata",translator:a}),i={fieldRenderer:g=>p.render(g)};s.addRenderer("@jupyterlab/notebook-extension:metadata-editor.cell-metadata",i);const u=new Cn({editorFactory:l,tracker:e,label:"Notebook metadata",translator:a}),d={fieldRenderer:g=>u.render(g)};s.addRenderer("@jupyterlab/notebook-extension:metadata-editor.notebook-metadata",d)}},Ln={id:"@jupyterlab/notebook-extension:active-cell-tool",description:"Adds active cell field in the metadata editor tab.",autoStart:!0,requires:[L,Ee,it],activate:(r,e,n,s)=>{const a=new hn({tracker:e,languages:s}),l={fieldRenderer:p=>a.render(p)};n.addRenderer("@jupyterlab/notebook-extension:active-cell-tool.renderer",l)}},Wn={id:"@jupyterlab/notebook-extension:open-with-no-kernel",description:'Adds the "Notebook (no kernel)" option to the Open With menu.',requires:[rt],optional:[F],autoStart:!0,activate:(r,e,n)=>{const{tracker:s}=e,a=(n??R).load("jupyterlab"),l=[];function p(i){var u,d;l.forEach(_=>_.dispose()),l.length=0;const g=(d=(u=i.menu.items.find(_=>{var y;return _.type==="submenu"&&((y=_.submenu)===null||y===void 0?void 0:y.id)==="jp-contextmenu-open-with"}))===null||u===void 0?void 0:u.submenu)!==null&&d!==void 0?d:null;if(!g)return;(s.currentWidget?Array.from(s.currentWidget.selectedItems()):[]).some(_=>_.type==="notebook")&&l.push(g.addItem({command:"filebrowser:open",args:{label:a.__("Notebook (no kernel)"),factory:D,kernelPreference:{shouldStart:!1,shouldReuse:!1}}}))}r.contextMenu.opened.connect(p)}},al=[ln,vn,te,xn,wn,_n,ct,yn,kn,Sn,rn,An,Mn,Tn,Bn,En,Nn,On,jn,Rn,In,Pn,Ln,Wn];function Hn(r,e,n,s,a,l,p){const i=l.load("jupyterlab"),u="notebook-tools",d=new q({tracker:e,translator:l}),g=(b,f)=>{switch(f.type){case"activate-request":a.save(u,{open:!0});break;case"after-hide":case"close-request":a.remove(u);break}return!0};return d.title.icon=Jt,d.title.dataset={...d.title.dataset,jpTabLabel:i.__("Notebook Tools")},d.title.caption=i.__("Notebook Tools"),d.id=u,G.installMessageHook(d,g),p&&e.widgetAdded.connect((b,f)=>{p.register(f).render(d)}),d}function Fn(r,e,n,s,a,l,p,i){const u=i??R,d=p??new Be({translator:u}),g=pe.PageConfig.getOption("notebookStartsKernel"),b=g===""||g.toLowerCase()==="true",{commands:f}=r;let _;a.addFactory(D,"save",S=>ho.createSaveButton(f,S.context.fileChanged)),a.addFactory(D,"cellType",S=>Ae.createCellTypeItem(S,u)),a.addFactory(D,"kernelName",S=>he.createKernelNameItem(S.sessionContext,d,u)),a.addFactory(D,"executionProgress",S=>{const o=l?.load(te.id),t=X.createExecutionIndicatorItem(S,u,o);return o?.then(h=>{S.disposed.connect(()=>{h.dispose()})}),t}),l&&(_=zt(a,l,D,fn,u));const y=u.load("jupyterlab"),w=new jo({name:D,label:y.__("Notebook"),fileTypes:["notebook"],modelName:"notebook",defaultFor:["notebook"],preferKernel:b,canStartKernel:!0,rendermime:s,contentFactory:e,editorConfig:se.defaultEditorConfig,notebookConfig:se.defaultNotebookConfig,mimeTypeService:n.mimeTypeService,toolbarFactory:_,translator:u});return r.docRegistry.addWidgetFactory(w),w}function Kn(r,e,n,s,a){const l=s.load("jupyterlab"),p=new Gt({namespace:"cloned-outputs"});a&&a.restore(p,{command:c.createOutputView,args:g=>({path:g.content.path,index:g.content.index}),name:g=>`${g.content.path}:${g.content.index}`,when:n.restored});const{commands:i,shell:u}=r,d=()=>H.isEnabledAndSingleSelected(u,n);i.addCommand(c.createOutputView,{label:l.__("Create New View for Cell Output"),execute:async g=>{var b;let f,_;const y=g.path;let w=g.index;if(y&&w!==void 0&&w!==null){if(_=e.findWidget(y,D),!_)return}else{if(_=n.currentWidget,!_)return;f=_.content.activeCell,w=_.content.activeCellIndex}const S=new H.ClonedOutputArea({notebook:_,cell:f,index:w,translator:s}),o=new Yt({content:S});_.context.addSibling(o,{ref:_.id,mode:"split-bottom",type:"Cloned Output"});const t=()=>{p.save(o)};_.context.pathChanged.connect(t),(b=_.context.model)===null||b===void 0||b.cells.changed.connect(t),p.add(o),_.content.disposed.connect(()=>{var h;_.context.pathChanged.disconnect(t),(h=_.context.model)===null||h===void 0||h.cells.changed.disconnect(t),o.dispose()})},isEnabled:d,describedBy:{args:{type:"object",properties:{path:{type:"string",description:l.__("The path to the notebook containing the cell")},index:{type:"number",description:l.__("The index of the cell to create an output view for")}}}}})}function Vn(r,e,n){const s=n.load("jupyterlab"),{commands:a,shell:l}=r,p=()=>H.isEnabled(l,e);a.addCommand(c.createConsole,{label:s.__("New Console for Notebook"),execute:i=>{const u=e.currentWidget;if(u)return H.createConsole(a,u,i.activate)},isEnabled:p,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:s.__("Whether to activate the console after creation")}}}}}),a.addCommand(c.createSubshellConsole,{label:s.__("New Subshell Console for Notebook"),execute:i=>{const u=e.currentWidget;if(u)return H.createConsole(a,u,i.activate,!0)},isEnabled:p,isVisible:()=>{var i,u,d;const g=(u=(i=e.currentWidget)===null||i===void 0?void 0:i.context.sessionContext.session)===null||u===void 0?void 0:u.kernel;return(d=g?.supportsSubshells)!==null&&d!==void 0?d:!1},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:s.__("Whether to activate the console after creation")}}}}}),a.addCommand(c.runInConsole,{label:s.__("Run Selected Text or Current Line in Console"),execute:async i=>{var u,d;const g=e.currentWidget;if(!g)return;const{context:b,content:f}=g,_=f.activeCell,y=_?.model.metadata,w=b.path;if(!_||_.model.type!=="code")return;let S;const o=_.editor;if(!o)return;const t=o.getSelection(),{start:h,end:C}=t;if(h.column!==C.column||h.line!==C.line){const A=o.getOffsetAt(t.start),B=o.getOffsetAt(t.end);S=o.model.sharedModel.getSource().substring(A,B)}else{const A=o.getCursorPosition(),B=o.model.sharedModel.getSource().split(`
|
|
1
|
+
import{T as $e,q as he,t as ht,r as ce,b as De,g as Je,I as pt,k as gt,a as ze,f as Ge,C as Re,h as Ie}from"./index-BMY48-7N.js";import{J as M,aB as ee,ch as ie,aE as R,gx as mt,eJ as Ct,fU as bt,cj as me,aK as Te,eh as ft,cl as vt,ei as _t,cf as Ce,iF as yt,r as J,eP as xt,iy as wt,eN as kt,dC as Q,cp as St,iG as v,dN as Ye,dJ as Xe,dO as Ze,fS as Qe,fT as et,eM as Be,aJ as At,aF as tt,aG as ke,iH as Mt,iI as Tt,iA as Bt,k as Y,bh as Et,gp as Nt,aa as Ot,aC as be,gC as G,iJ as ge,aA as le,iK as xe,iL as Z,eG as Pe,iM as jt,iN as Rt,dX as we,dZ as It,d$ as Le,iO as We,dY as Pt,iP as Lt,iQ as Wt,ax as ot,iR as Ht,iS as Ft,eL as Kt,iT as Vt,aD as F,ew as fe,iU as Se,dx as Ut,eE as qt,e3 as $t,iV as Dt,iW as se,iX as nt,ce as pe,dz as Jt,aH as zt,dE as Gt,cr as Yt,gA as Xt,iY as Zt,dS as Qt,dV as eo,iZ as to,dH as oo,i_ as no,i$ as io,ed as lo,ee as so,dy as ro,bg as ao,fl as co}from"../datalayer-app-main.js";import{b as uo,I as it}from"./token-CdPvDaO6.js";import{ToolbarItems as ho}from"./lib-Dfg3vZM8.js";import{I as po}from"./index-B3Hf3MzW.js";import{I as ve}from"./tokens-C5FWZLTC.js";import{a as lt,I as L,b as st,c as go}from"./tokens-BiQDy_zz.js";import{I as mo,a as rt}from"./tokens-DuSIK5iU.js";import{I as Co}from"./tokens-iGMkLb0v.js";import{f as at,e as bo,c as fo,I as vo,b as _o}from"./index-CvKH_NYI.js";import{I as dt}from"./tokens-DfQxPp01.js";import{I as _e}from"./tokens-1h_N3aLM.js";import{a as Ee}from"./tokens-B3Xc25f7.js";import{I as yo}from"./tokens-BoOsoUsu.js";import{I as xo}from"./index-CaEDkyBB.js";import{I as wo}from"./tokens-udK9JDBx.js";import{W as ko,u as He,V as So,I as Ao,a as Mo,b as To,c as Bo}from"./document-Dx9me6Cm.js";import{s as Eo}from"./hover-DpawhsId.js";import{b as No,c as Oo,d as jo}from"./CellSidebarExtension-DwGg7VbR.js";import{H as Ro}from"./htmlselect-CIhYGigR.js";import{T as Io,a as Po}from"./model-DrXnd96t.js";import{C as Fe}from"./celltoolbartracker-B_UScIax.js";import"./hoverbox-CStlKQWE.js";import"./Output-CJVIj3Io.js";import"./index-CXSUknte.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-DXPB_0fo.js";import"./d3-color-Jd8hXty2.js";import"./dist-Frc5TvpU.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./index-BaRoLDk0.js";import"./RestartIcon-DvpOf5Mf.js";import"./NotebookSkeleton-GSdyJDf_.js";import"./Avatar-DUPBQXVt.js";import"./renderer-CtmiT4nP.js";import"./SquareIcon-Dy3l3VdH.js";import"./FileDirectoryOpenFillIcon-jGhuRcP3.js";import"./url-DY3jeuF8.js";/* empty css *//* empty css */import"./style-DdAxk_bj.js";/* empty css */import"./style-Cj1gzCjo.js";/* empty css */import"./style-rkw8dR9f.js";import"./style-GHJFdtIz.js";import"./style-ZSIOeMoX.js";import"./style-iVfD6mFL.js";import"./style-DA-Ya7rp.js";import"./style-D3tvWcFO.js";import"./style-BOqStzF9.js";import"./style-ADLQJ-E9.js";import"./style-DgglluaK.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./SkubbleIcon-CAaVh_BE.js";import"./usePrimerThemeBridge-BoT73xjq.js";import"./index-CShCHnof.js";import"./KernelVariables-CmWkosM8.js";import"./index-BWeXDhSd.js";import"./SortAscIcon-CmH04s3F.js";import"./SortDescIcon-Qif6E10I.js";import"./NotebookToolbar-C1fpK-Vi.js";import"./RepoPushIcon-BtXQRhLa.js";import"./sessions-LMslHH3H.js";import"./tokens-UgGv77-l.js";import"./drivecontents-BabrDJge.js";import"./kernel-DWlDRhgJ.js";function Lo(r){const n=s=>{const a=Math.max(s*3.6,.1),l=a*Math.PI/180,p=Math.sin(l)*104,i=Math.cos(l)*-104;return"M 0 0 v -104 A 104 104 1 "+(a<180?1:0)+" 0 "+p.toFixed(4)+" "+i.toFixed(4)+" z"};return M.createElement("div",{className:"jp-Statusbar-ProgressCircle",role:"progressbar","aria-label":r.label||"Unlabelled progress circle","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r.progress,onClick:r.onClick},M.createElement("svg",{viewBox:"0 0 250 250"},M.createElement("circle",{cx:"125",cy:"125",r:"104",stroke:"var(--jp-inverse-layout-color3)",strokeWidth:"20",fill:"none"}),M.createElement("path",{className:"jp-Statusbar-ProgressCirclePath",transform:"translate(125,125) scale(.9)",d:n(r.progress),fill:"var(--jp-inverse-layout-color3)"})))}const Wo="jp-JSONEditor",ue="jp-mod-error",Ho="jp-JSONEditor-host",Fo="jp-JSONEditor-header";class Ko extends ee{constructor(e){super(),this._dataDirty=!1,this._inputDirty=!1,this._source=null,this._originalValue=ie.emptyObject,this._changeGuard=!1,this.translator=e.translator||R,this._trans=this.translator.load("jupyterlab"),this.addClass(Wo),this.headerNode=document.createElement("div"),this.headerNode.className=Fo,this.revertButtonNode=mt.element({tag:"span",title:this._trans.__("Revert changes to data")}),this.commitButtonNode=Ct.element({tag:"span",title:this._trans.__("Commit changes to data"),marginLeft:"8px"}),this.editorHostNode=document.createElement("div"),this.editorHostNode.className=Ho,this.headerNode.appendChild(this.revertButtonNode),this.headerNode.appendChild(this.commitButtonNode),this.node.appendChild(this.headerNode),this.node.appendChild(this.editorHostNode);const n=new bt.Model({mimeType:"application/json"});n.sharedModel.changed.connect(this._onModelChanged,this),this.model=n,this.editor=e.editorFactory({host:this.editorHostNode,model:n,config:{readOnly:!0}})}get source(){return this._source}set source(e){this._source!==e&&(this._source&&this._source.changed.disconnect(this._onSourceChanged,this),this._source=e,this.editor.setOption("readOnly",e===null),e&&e.changed.connect(this._onSourceChanged,this),this._setValue())}get isDirty(){return this._dataDirty||this._inputDirty}dispose(){var e;this.isDisposed||((e=this.source)===null||e===void 0||e.dispose(),this.model.dispose(),this.editor.dispose(),super.dispose())}handleEvent(e){switch(e.type){case"blur":this._evtBlur(e);break;case"click":this._evtClick(e);break}}onAfterAttach(e){const n=this.editorHostNode;n.addEventListener("blur",this,!0),n.addEventListener("click",this,!0),this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.headerNode.addEventListener("click",this)}onBeforeDetach(e){const n=this.editorHostNode;n.removeEventListener("blur",this,!0),n.removeEventListener("click",this,!0),this.headerNode.removeEventListener("click",this)}_onSourceChanged(e,n){if(!this._changeGuard){if(this._inputDirty||this.editor.hasFocus()){this._dataDirty=!0;return}this._setValue()}}_onModelChanged(e,n){if(n.sourceChange){let s=!0;try{const a=JSON.parse(this.editor.model.sharedModel.getSource());this.removeClass(ue),this._inputDirty=!this._changeGuard&&!ie.deepEqual(a,this._originalValue)}catch{this.addClass(ue),this._inputDirty=!0,s=!1}this.revertButtonNode.hidden=!this._inputDirty,this.commitButtonNode.hidden=!s||!this._inputDirty}}_evtBlur(e){!this._inputDirty&&this._dataDirty&&this._setValue()}_evtClick(e){const n=e.target;this.revertButtonNode.contains(n)?this._setValue():this.commitButtonNode.contains(n)?!this.commitButtonNode.hidden&&!this.hasClass(ue)&&(this._changeGuard=!0,this._mergeContent(),this._changeGuard=!1,this._setValue()):this.editorHostNode.contains(n)&&this.editor.focus()}_mergeContent(){const e=this.editor.model,n=this._originalValue,s=JSON.parse(e.sharedModel.getSource()),a=this.source;if(a){for(const l in s)ie.deepEqual(s[l],n[l]||null)||a.set(l,s[l]);for(const l in n)l in s||a.delete(l)}}_setValue(){this._dataDirty=!1,this._inputDirty=!1,this.revertButtonNode.hidden=!0,this.commitButtonNode.hidden=!0,this.removeClass(ue);const e=this.editor.model,n=this._source?this._source.toJSON():{};if(this._changeGuard=!0,n===void 0)e.sharedModel.setSource(this._trans.__("No data!")),this._originalValue=ie.emptyObject;else{const s=JSON.stringify(n,null,4);e.sharedModel.setSource(s),this._originalValue=n,s.length>1&&s[0]==="{"&&this.editor.setCursorPosition({line:0,column:1})}this._changeGuard=!1,this.commitButtonNode.hidden=!0,this.revertButtonNode.hidden=!0}}class Vo extends M.Component{constructor(e){super(e),this._handleChange=s=>{this.setState({value:s.currentTarget.value})},this._handleSubmit=s=>{var a,l;s.preventDefault();const p=parseInt((l=(a=this._textInput)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",10);return!isNaN(p)&&isFinite(p)&&1<=p&&p<=this.props.maxCell&&this.props.handleSubmit(p),!1},this._handleFocus=()=>{this.setState({hasFocus:!0})},this._handleBlur=()=>{this.setState({hasFocus:!1})},this._textInput=null;const n=e.translator||R;this._trans=n.load("jupyterlab"),this.state={value:"",hasFocus:!1,textInputId:ft.createDomID()+"-cell-number-input"}}componentDidMount(){var e;(e=this._textInput)===null||e===void 0||e.focus()}render(){return M.createElement("div",{className:"jp-lineFormSearch"},M.createElement("form",{name:"cellNumberForm",onSubmit:this._handleSubmit,noValidate:!0},M.createElement("div",{className:vt("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":void 0)},M.createElement("input",{type:"number",id:this.state.textInputId,className:"jp-lineFormInput",min:1,max:this.props.maxCell,onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),M.createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},M.createElement(_t.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),M.createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),M.createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to cell number between 1 and %1",this.props.maxCell))))}}function Uo(r){const n=(r.translator||R).load("jupyterlab"),s=r.selectionStart>0&&r.selectionStart!==r.selectionEnd?n.__("%1:%2/%3",r.selectionStart,r.selectionEnd,r.totalCells):n.__("Cell %1/%2",r.activeCell,r.totalCells),a=l=>{(l.key==="Enter"||l.key==="Spacebar"||l.key===" ")&&(l.preventDefault(),l.stopPropagation(),r.handleClick())};return M.createElement($e,{role:"button","aria-haspopup":!0,onClick:r.handleClick,source:s,title:n.__("Go to cell…"),tabIndex:0,onKeyDown:a})}class re extends me{constructor(e={}){super(new re.Model),this._popup=null,this.addClass("jp-mod-highlighted"),this._translator=e.translator||R}render(){return this.model===null?null:M.createElement(Uo,{activeCell:this.model.activeCell,selectionStart:this.model.selectionStart,selectionEnd:this.model.selectionEnd,totalCells:this.model.totalCells,translator:this._translator,handleClick:()=>this._handleClick()})}_handleClick(){if(this.model.totalCells<1)return;this._popup&&this._popup.dispose();const e=Te.create(M.createElement(Vo,{handleSubmit:n=>this._handleSubmit(n),maxCell:this.model.totalCells,translator:this._translator}));this._popup=Eo({body:e,anchor:this,align:"right"})}_handleSubmit(e){var n;const s=this.model.notebook;if(!s)return;const a=e-1;s.activeCellIndex=a,s.deselectAll(),s.scrollToItem(a).catch(l=>{console.error("Go to cell",l)}),(n=this._popup)===null||n===void 0||n.dispose(),s.activate()}}(function(r){class e extends Ce{constructor(){super(...arguments),this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0,this._notebook=null}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a&&(a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this),a.selectionChanged.disconnect(this._onChanged,this));const l=this._getAllState();this._notebook=s,this._notebook?(this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this),this._notebook.selectionChanged.connect(this._onChanged,this),this._updateStateFromNotebook(this._notebook)):(this._activeCell=0,this._selectionStart=0,this._selectionEnd=0,this._totalCells=0),this._triggerChange(l,this._getAllState())}get activeCell(){return this._activeCell}get selectionStart(){return this._selectionStart}get selectionEnd(){return this._selectionEnd}get totalCells(){return this._totalCells}_onChanged(s){const a=this._getAllState();this._updateStateFromNotebook(s),this._triggerChange(a,this._getAllState())}_updateStateFromNotebook(s){const a=s.activeCellIndex;this._activeCell=a>=0?a+1:0,this._totalCells=s.widgets.length;let l=this._activeCell,p=this._activeCell,i=!1;s.widgets.forEach((u,d)=>{if(!s.isSelectedOrActive(u))return;const g=d+1;if(!i){l=g,p=g,i=!0;return}p=g}),this._selectionStart=i?l:0,this._selectionEnd=i?p:0}_getAllState(){return{activeCell:this._activeCell,selectionStart:this._selectionStart,selectionEnd:this._selectionEnd,totalCells:this._totalCells}}_triggerChange(s,a){(s.activeCell!==a.activeCell||s.selectionStart!==a.selectionStart||s.selectionEnd!==a.selectionEnd||s.totalCells!==a.totalCells)&&this.stateChanged.emit(void 0)}}r.Model=e})(re||(re={}));const qo="jp-Notebook-toolbarCellType",$o="jp-Notebook-toolbarCellTypeDropdown";var Ae;(function(r){function e(g,b){const f=(b||R).load("jupyterlab");function _(){if(g.context.model.readOnly)return tt({title:f.__("Cannot Save"),body:f.__("Document is read-only"),buttons:[ke.okButton()]});g.context.save().then(()=>{if(!g.isDisposed)return g.context.createCheckpoint()})}return yt(Te.create(J.createElement(xt,{signal:g.context.fileChanged},()=>J.createElement(wt,{icon:kt,onClick:_,tooltip:f.__("Save the notebook contents and create checkpoint"),enabled:!!(g&&g.context&&g.context.contentsModel&&g.context.contentsModel.writable)}))))}r.createSaveButton=e;function n(g,b){const f=(b||R).load("jupyterlab");return new Q({icon:St,onClick:()=>{v.insertBelow(g.content)},tooltip:f.__("Insert a cell below")})}r.createInsertButton=n;function s(g,b,f){const _=(b||R).load("jupyterlab");return new Q({icon:Ye,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.cutToSystemClipboard(g.content):v.cut(g.content)},tooltip:_.__("Cut the selected cells")})}r.createCutButton=s;function a(g,b,f){const _=(b||R).load("jupyterlab");return new Q({icon:Xe,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.copyToSystemClipboard(g.content):v.copy(g.content)},tooltip:_.__("Copy the selected cells")})}r.createCopyButton=a;function l(g,b,f){const _=(b||R).load("jupyterlab");return new Q({icon:Ze,onClick:async()=>{f?.get("useSystemClipboardForCells").composite?await v.pasteFromSystemClipboard(g.content):v.paste(g.content)},tooltip:_.__("Paste cells from the clipboard")})}r.createPasteButton=l;function p(g,b,f){const _=(f??R).load("jupyterlab");return new Q({icon:Qe,onClick:()=>{v.runAndAdvance(g.content,g.sessionContext,b,f)},tooltip:_.__("Run the selected cells and advance")})}r.createRunButton=p;function i(g,b,f){const _=(f??R).load("jupyterlab");return new Q({icon:et,onClick:()=>{const y=b??new Be({translator:f});y.restart(g.sessionContext).then(w=>(w&&v.runAll(g.content,g.sessionContext,y,f),w))},tooltip:_.__("Restart the kernel, then re-run the whole notebook")})}r.createRestartRunAllButton=i;function u(g,b){return new Do(g.content,b)}r.createCellTypeItem=u;function d(g,b,f,_){return[{name:"save",widget:e(g,f)},{name:"insert",widget:n(g,f)},{name:"cut",widget:s(g,f,_)},{name:"copy",widget:a(g,f,_)},{name:"paste",widget:l(g,f,_)},{name:"run",widget:p(g,b,f)},{name:"interrupt",widget:he.createInterruptButton(g.sessionContext,f)},{name:"restart",widget:he.createRestartButton(g.sessionContext,b,f)},{name:"restart-and-run",widget:i(g,b,f)},{name:"cellType",widget:u(g,f)},{name:"spacer",widget:At.createSpacerItem()},{name:"kernelName",widget:he.createKernelNameItem(g.sessionContext,b,f)}]}r.getDefaultItems=d})(Ae||(Ae={}));class Do extends Te{constructor(e,n){super(),this.handleChange=s=>{s.target.value!=="-"&&(v.changeCellType(this._notebook,s.target.value),this._notebook.activate())},this.handleKeyDown=s=>{s.key==="Enter"&&this._notebook.activate()},this._trans=(n||R).load("jupyterlab"),this.addClass(qo),this._notebook=e,e.model&&this.update(),e.activeCellChanged.connect(this.update,this),e.selectionChanged.connect(this.update,this)}render(){let e="-";this._notebook.activeCell&&(e=this._notebook.activeCell.model.type);for(const n of this._notebook.widgets)if(this._notebook.isSelectedOrActive(n)&&n.model.type!==e){e="-";break}return J.createElement(Ro,{className:$o,onChange:this.handleChange,onKeyDown:this.handleKeyDown,value:e,"aria-label":this._trans.__("Cell type"),title:this._trans.__("Select the cell type")},J.createElement("option",{value:"-"},"-"),J.createElement("option",{value:"code"},this._trans.__("Code")),J.createElement("option",{value:"markdown"},this._trans.__("Markdown")),J.createElement("option",{value:"raw"},this._trans.__("Raw")))}}function Ke(r){var e;const n=r.translator||R,s=ht(n),a=n.load("jupyterlab"),l=(e=r.displayOption.showJumpToCell)!==null&&e!==void 0?e:!1,p=r.state,i=r.displayOption.showOnToolBar,u=r.displayOption.showProgress,d=i?"down":"up",g=M.createElement("div",null),[b,f]=M.useState(!1);if(M.useEffect(()=>{if(b)return;const j=()=>{f(!0)};return v.executionScheduled.connect(j),()=>{v.executionScheduled.disconnect(j)}},[l,b]),!p)return g;const _=p.kernelStatus,y={alignSelf:"normal",height:"24px"},w=p.totalTime,S=p.scheduledCellNumber||0,o=p.scheduledCell.size||0,t=S-o;let h=100*t/S,C=u?"":"hidden";!u&&h<100&&(h=0);const k=j=>M.createElement(Lo,{progress:j,width:16,height:24,label:a.__("Kernel status")}),A=j=>a.__("Kernel status: %1",j),B=()=>{const j=r.notebook;v.selectLastRunCell(j),j.activeCell&&j.scrollToCell(j.activeCell)},E=(j,K,W)=>M.createElement("div",{className:"jp-Notebook-ExecutionIndicator",title:u?"":A(s[j]),"data-status":j},K,M.createElement("div",{className:`jp-Notebook-ExecutionIndicator-tooltip ${d} ${C}`},M.createElement("span",null," ",A(s[j])," "),W,l&&b&&M.createElement(Bt,{className:"jp-Notebook-ExecutionIndicator-jumpButton",onClick:B,title:a.__("Jump to current or last executed cell")},a.__("Jump to cell"))));if(p.kernelStatus==="connecting"||p.kernelStatus==="disconnected"||p.kernelStatus==="unknown")return E(_,M.createElement(Mt.react,{...y}),[]);if(p.kernelStatus==="starting"||p.kernelStatus==="terminating"||p.kernelStatus==="restarting"||p.kernelStatus==="initializing")return E(_,M.createElement(Tt.react,{...y}),[]);if(p.executionStatus==="busy")return E("busy",k(h),[M.createElement("span",{key:0},a.__("Executed %1/%2 cells",t,S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))]);{const j=p.kernelStatus==="busy"?0:100,K=p.kernelStatus==="busy"||w===0?[]:[M.createElement("span",{key:0},a._n("Executed %1 cell","Executed %1 cells",S)),M.createElement("span",{key:1},a._n("Elapsed time: %1 second","Elapsed time: %1 seconds",w))];return E(p.kernelStatus,k(j),K)}}class X extends me{constructor(e,n=!0){super(new X.Model),this.translator=e||R,this.addClass("jp-mod-highlighted")}dispose(){var e;this.isDisposed||((e=this.model)===null||e===void 0||e.dispose(),super.dispose())}render(){if(this.model===null||!this.model.renderFlag)return M.createElement("div",null);{const e=this.model.currentNotebook;return e?M.createElement(Ke,{displayOption:this.model.displayOption,state:this.model.executionState(e),translator:this.translator,notebook:e}):M.createElement(Ke,{displayOption:this.model.displayOption,state:void 0,translator:this.translator,notebook:void 0})}}}(function(r){class e extends Ce{constructor(){super(),this._notebookExecutionProgress=new WeakMap,this._displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},this._renderFlag=!0}attachNotebook(l){var p,i,u,d;if(l&&l.content&&l.context){const g=l.content,b=l.context;if(this._currentNotebook=g,!this._notebookExecutionProgress.has(g)){this._notebookExecutionProgress.set(g,{executionStatus:"idle",kernelStatus:"idle",totalTime:0,interval:0,timeout:0,scheduledCell:new Set,scheduledCellNumber:0,needReset:!0});const f=this._notebookExecutionProgress.get(g),_=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.statusChanged.connect(_,this);const y=o=>{f&&(f.kernelStatus=o.kernelDisplayStatus),this.stateChanged.emit(void 0)};b.connectionStatusChanged.connect(y,this),b.disposed.connect(o=>{o.connectionStatusChanged.disconnect(y,this),o.statusChanged.disconnect(_,this)},this);const w=(o,t)=>{const h=t.msg,C=h.header.msg_id;if(h.header.msg_type==="execute_request")this._cellScheduledCallback(g,C);else if(Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="idle"){const k=h.parent_header.msg_id;this._cellExecutedCallback(g,k)}else Y.KernelMessage.isStatusMsg(h)&&h.content.execution_state==="restarting"?this._restartHandler(g):h.header.msg_type==="execute_input"&&this._startTimer(g)};(i=(p=b.session)===null||p===void 0?void 0:p.kernel)===null||i===void 0||i.anyMessage.connect(w,this),(d=(u=b.session)===null||u===void 0?void 0:u.kernel)===null||d===void 0||d.disposed.connect(o=>o.anyMessage.disconnect(w,this),this);const S=(o,t)=>{f&&(this._resetTime(f),this.stateChanged.emit(void 0),t.newValue&&t.newValue.anyMessage.connect(w,this))};b.kernelChanged.connect(S,this),b.disposed.connect(o=>o.kernelChanged.disconnect(S,this),this)}}}get currentNotebook(){return this._currentNotebook}get displayOption(){return this._displayOption}set displayOption(l){this._displayOption=l}executionState(l){return this._notebookExecutionProgress.get(l)}_scheduleSwitchToIdle(l){window.setTimeout(()=>{l.executionStatus="idle",clearInterval(l.interval),this.stateChanged.emit(void 0)},150),l.timeout=window.setTimeout(()=>{l.needReset=!0},1e3)}_cellExecutedCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&i.scheduledCell.has(p)&&(i.scheduledCell.delete(p),i.scheduledCell.size===0&&this._scheduleSwitchToIdle(i))}_restartHandler(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.clear(),this._scheduleSwitchToIdle(p))}_startTimer(l){const p=this._notebookExecutionProgress.get(l);p&&(p.scheduledCell.size>0?p.executionStatus!=="busy"&&(p.executionStatus="busy",clearTimeout(p.timeout),this.stateChanged.emit(void 0),p.interval=window.setInterval(()=>{this._tick(p)},1e3)):this._resetTime(p))}_cellScheduledCallback(l,p){const i=this._notebookExecutionProgress.get(l);i&&!i.scheduledCell.has(p)&&(i.needReset&&this._resetTime(i),i.scheduledCell.add(p),i.scheduledCellNumber+=1)}_tick(l){if(this.isDisposed){clearInterval(l.interval),clearTimeout(l.timeout);return}l.totalTime+=1,this.stateChanged.emit(void 0)}_resetTime(l){l.totalTime=0,l.scheduledCellNumber=0,l.executionStatus="idle",l.scheduledCell=new Set,clearTimeout(l.timeout),clearInterval(l.interval),l.needReset=!1}get renderFlag(){return this._renderFlag}updateRenderOption(l){this.displayOption.showOnToolBar&&(l.showOnToolBar?this._renderFlag=!0:this._renderFlag=!1),this.displayOption.showProgress=l.showProgress,this.displayOption.showJumpToCell=l.showJumpToCell,this.stateChanged.emit(void 0)}}r.Model=e;function n(a,l,p){const i=new r(l);return i.model.displayOption={showOnToolBar:!0,showProgress:!0,showJumpToCell:!1},i.model.attachNotebook({content:a.content,context:a.sessionContext}),p&&p.then(u=>{const d=g=>{const b=s(g);b.showJumpToCell&&(g.get("recordTiming").composite||g.set("recordTiming",!0).catch(_=>{console.error("Failed to auto-enable recordTiming:",_.message)})),i.model.updateRenderOption(b)};u.changed.connect(d),d(u),i.disposed.connect(()=>{u.changed.disconnect(d)})}).catch(u=>{console.error(u.message)}),i}r.createExecutionIndicatorItem=n;function s(a){let l=!0,p=!0,i=!1;const u=a.get("kernelStatus").composite;return u&&(l=!u.showOnStatusBar,p=u.showProgress,i=u.showJumpToRecentExecutionButton),{showOnToolBar:l,showProgress:p,showJumpToCell:i}}r.getSettingValue=s})(X||(X={}));function Jo(r){const e=(r.translator||R).load("jupyterlab");return J.createElement($e,{source:e.__("Mode: %1",r.modeNames[r.notebookMode])})}class ae extends me{constructor(e){super(new ae.Model),this.translator=e||R,this._trans=this.translator.load("jupyterlab"),this._modeNames={command:this._trans.__("Command"),edit:this._trans.__("Edit")}}render(){return this.model?(this.node.title=this._trans.__("Notebook is in %1 mode",this._modeNames[this.model.notebookMode]),J.createElement(Jo,{notebookMode:this.model.notebookMode,translator:this.translator,modeNames:this._modeNames})):null}}(function(r){class e extends Ce{constructor(){super(...arguments),this._onChanged=s=>{const a=this._notebookMode;this._notebook?this._notebookMode=s.mode:this._notebookMode="command",this._triggerChange(a,this._notebookMode)},this._notebookMode="command",this._notebook=null}get notebookMode(){return this._notebookMode}set notebook(s){const a=this._notebook;a!==null&&(a.stateChanged.disconnect(this._onChanged,this),a.activeCellChanged.disconnect(this._onChanged,this),a.modelContentChanged.disconnect(this._onChanged,this));const l=this._notebookMode;this._notebook=s,this._notebook===null?this._notebookMode="command":(this._notebookMode=this._notebook.mode,this._notebook.stateChanged.connect(this._onChanged,this),this._notebook.activeCellChanged.connect(this._onChanged,this),this._notebook.modelContentChanged.connect(this._onChanged,this)),this._triggerChange(l,this._notebookMode)}_triggerChange(s,a){s!==a&&this.stateChanged.emit(void 0)}}r.Model=e})(ae||(ae={}));class zo extends ko{constructor(e,n){super(e,n),this.editorWidget=e,this.options=n,this._type="code",this._readyDelegate=new Et,this._editorToCell=new Map,this.editor=e.content,this._cellToEditor=new WeakMap,this.isReady=this.isReady.bind(this),Promise.all([this.widget.context.sessionContext.ready,this.connectionManager.ready]).then(async()=>{await this.initOnceReady(),this._readyDelegate.resolve()}).catch(console.error)}get documentPath(){return this.widget.context.path}get mimeType(){var e;let n,s=this.language_info();return!s||!s.mimetype?n=this.widget.content.codeMimetype:n=s.mimetype,Array.isArray(n)?(e=n[0])!==null&&e!==void 0?e:Nt.defaultMimeType:n}get languageFileExtension(){let e=this.language_info();if(!(!e||!e.file_extension))return e.file_extension.replace(".","")}get wrapperElement(){return this.widget.node}get editors(){if(this.isDisposed)return[];let e=this.widget.content;return this._editorToCell.clear(),e.isDisposed?[]:e.widgets.map(n=>({ceEditor:this._getCellEditor(n),type:n.model.type,value:n.model.sharedModel.getSource()}))}get activeEditor(){return this.editor.activeCell?this._getCellEditor(this.editor.activeCell):void 0}get ready(){return this._readyDelegate.promise}getEditorIndexAt(e){let n=this._getCellAt(e);return this.widget.content.widgets.findIndex(a=>n===a)}getEditorIndex(e){let n=this._editorToCell.get(e);return this.editor.widgets.findIndex(s=>n===s)}getEditorWrapper(e){return this._editorToCell.get(e).node}async onKernelChanged(e,n){if(n.newValue)try{const s=this._languageInfo;await He(this.isReady,-1),await this._updateLanguageInfo();const a=this._languageInfo;s?.name!=a.name||s?.mimetype!=a?.mimetype||s?.file_extension!=a?.file_extension?(console.log(`Changed to ${this._languageInfo.name} kernel, reconnecting`),this.reloadConnection()):console.log("Keeping old LSP connection as the new kernel uses the same language")}catch(s){console.warn(s),this.reloadConnection()}}dispose(){this.isDisposed||(this.widget.context.sessionContext.kernelChanged.disconnect(this.onKernelChanged,this),this.widget.content.activeCellChanged.disconnect(this._activeCellChanged,this),super.dispose(),this._editorToCell.clear(),Ot.clearData(this))}isReady(){var e;return!this.widget.isDisposed&&this.widget.context.isReady&&this.widget.content.isVisible&&this.widget.content.widgets.length>0&&((e=this.widget.context.sessionContext.session)===null||e===void 0?void 0:e.kernel)!=null}async handleCellChange(e,n){let s=[],a=[];const l=this._type;if(n.type==="set"){let p=[],i=[];if(n.newValues.length===n.oldValues.length){for(let u=0;u<n.newValues.length;u++)n.oldValues[u].type===l&&n.newValues[u].type!==l?p.push(n.newValues[u]):n.oldValues[u].type!==l&&n.newValues[u].type===l&&i.push(n.newValues[u]);s=i,a=p}}else n.type=="add"&&(s=n.newValues.filter(p=>p.type===l));(a.length||s.length||n.type==="set"||n.type==="move"||n.type==="remove"||n.type==="clear")&&await this.updateDocuments();for(let p of s){let i=this.widget.content.widgets.find(u=>u.model.id===p.id);if(!i){console.warn(`Widget for added cell with ID: ${p.id} not found!`);continue}this._getCellEditor(i)}}createVirtualDocument(){return new So({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:!1,hasLspSupportedFile:!1})}language_info(){return this._languageInfo}async initOnceReady(){await He(this.isReady.bind(this),-1),await this._updateLanguageInfo(),this.initVirtual(),this.connectDocument(this.virtualDocument,!1).catch(console.warn),this.widget.context.sessionContext.kernelChanged.connect(this.onKernelChanged,this),this.widget.content.activeCellChanged.connect(this._activeCellChanged,this),this._connectModelSignals(this.widget),this.editor.modelChanged.connect(e=>{console.warn("Model changed, connecting cell change handler; this is not something we were expecting"),this._connectModelSignals(e)})}_connectModelSignals(e){e.model===null?console.warn(`Model is missing for notebook ${e}, cannot connect cell changed signal!`):e.model.cells.changed.connect(this.handleCellChange,this)}async _updateLanguageInfo(){var e,n,s,a;const l=(a=await((s=(n=(e=this.widget.context.sessionContext)===null||e===void 0?void 0:e.session)===null||n===void 0?void 0:n.kernel)===null||s===void 0?void 0:s.info))===null||a===void 0?void 0:a.language_info;if(l)this._languageInfo=l;else throw new Error("Language info update failed (no session, kernel, or info available)")}_activeCellChanged(e,n){!n||n.model.type!==this._type||this._activeEditorChanged.emit({editor:this._getCellEditor(n)})}_getCellAt(e){let n=this.virtualDocument.getEditorAtVirtualLine(e);return this._editorToCell.get(n)}_getCellEditor(e){if(!this._cellToEditor.has(e)){const n=Object.freeze({getEditor:()=>e.editor,ready:async()=>(await e.ready,e.editor),reveal:async()=>(await this.editor.scrollToCell(e),e.editor)});this._cellToEditor.set(e,n),this._editorToCell.set(n,e),e.disposed.connect(()=>{this._cellToEditor.delete(e),this._editorToCell.delete(n),this._editorRemoved.emit({editor:n})}),this._editorAdded.emit({editor:n})}return this._cellToEditor.get(e)}}class Go extends ee{constructor(){super(),this._items=[],this.layout=new be,this.addClass("jp-RankedPanel")}addWidget(e,n){const s={widget:e,rank:n},a=le.upperBound(this._items,s,Me.itemCmp);le.insert(this._items,a,s),this.layout.insertWidget(a,e)}onChildRemoved(e){const n=le.findFirstIndex(this._items,s=>s.widget===e.child);n!==-1&&le.removeAt(this._items,n)}}class q extends ee{constructor(e){super(),this.addClass("jp-NotebookTools"),this.translator=e.translator||R,this._tools=[],this.layout=new be,this._tracker=e.tracker,this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged,this),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.selectionChanged.connect(this._onSelectionChanged,this),this._onActiveNotebookPanelChanged(),this._onActiveCellChanged(),this._onSelectionChanged()}get activeCell(){return this._tracker.activeCell}get selectedCells(){const e=this._tracker.currentWidget;if(!e)return[];const n=e.content;return n.widgets.filter(s=>n.isSelectedOrActive(s))}get activeNotebookPanel(){return this._tracker.currentWidget}addItem(e){var n;const s=e.tool,a=(n=e.rank)!==null&&n!==void 0?n:100;let l;const p=this._tools.find(i=>i.section===e.section);if(p)l=p.panel;else throw new Error(`The section ${e.section} does not exist`);s.addClass("jp-NotebookTools-tool"),l.addWidget(s,a),s.notebookTools=this,G.sendMessage(s,q.ActiveNotebookPanelMessage),G.sendMessage(s,q.ActiveCellMessage)}addSection(e){var n;const s=e.sectionName,a=e.label||e.sectionName,l=e.tool;let p=(n=e.rank)!==null&&n!==void 0?n:null;const i=new Go;if(i.title.label=a,l&&i.addWidget(l,0),this._tools.push({section:s,panel:i,rank:p}),p!=null)this.layout.insertWidget(p,new ce({widget:i}));else{let u=null;const d=this.layout;for(let g=0;g<d.widgets.length;g++){let b=d.widgets[g];if(b instanceof ce&&b.widget.id==="advancedToolsSection"){u=g;break}}u!==null?this.layout.insertWidget(u,new ce({widget:i})):this.layout.addWidget(new ce({widget:i}))}}_onActiveNotebookPanelChanged(){this._prevActiveNotebookModel&&!this._prevActiveNotebookModel.isDisposed&&this._prevActiveNotebookModel.metadataChanged.disconnect(this._onActiveNotebookPanelMetadataChanged,this);const e=this.activeNotebookPanel&&this.activeNotebookPanel.content?this.activeNotebookPanel.content.model:null;this._prevActiveNotebookModel=e,e&&e.metadataChanged.connect(this._onActiveNotebookPanelMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveNotebookPanelMessage)}_onActiveCellChanged(){this._prevActiveCell&&!this._prevActiveCell.isDisposed&&this._prevActiveCell.metadataChanged.disconnect(this._onActiveCellMetadataChanged,this);const e=this.activeCell?this.activeCell.model:null;this._prevActiveCell=e,e&&e.metadataChanged.connect(this._onActiveCellMetadataChanged,this);for(const n of this._toolChildren())G.sendMessage(n,q.ActiveCellMessage)}_onSelectionChanged(){for(const e of this._toolChildren())G.sendMessage(e,q.SelectionMessage)}_onActiveNotebookPanelMetadataChanged(e,n){const s=new ge.ChangeMessage("activenotebookpanel-metadata-changed",{oldValue:void 0,newValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}_onActiveCellMetadataChanged(e,n){const s=new ge.ChangeMessage("activecell-metadata-changed",{newValue:void 0,oldValue:void 0,...n});for(const a of this._toolChildren())G.sendMessage(a,s)}*_toolChildren(){for(let e of this._tools)yield*e.panel.children()}}(function(r){r.ActiveNotebookPanelMessage=new xe("activenotebookpanel-changed"),r.ActiveCellMessage=new xe("activecell-changed"),r.SelectionMessage=new xe("selection-changed");class e extends ee{dispose(){super.dispose(),this.notebookTools&&(this.notebookTools=null)}processMessage(a){switch(super.processMessage(a),a.type){case"activenotebookpanel-changed":this.onActiveNotebookPanelChanged(a);break;case"activecell-changed":this.onActiveCellChanged(a);break;case"selection-changed":this.onSelectionChanged(a);break;case"activecell-metadata-changed":this.onActiveCellMetadataChanged(a);break;case"activenotebookpanel-metadata-changed":this.onActiveNotebookPanelMetadataChanged(a);break}}onActiveNotebookPanelChanged(a){}onActiveCellChanged(a){}onSelectionChanged(a){}onActiveCellMetadataChanged(a){}onActiveNotebookPanelMetadataChanged(a){}}r.Tool=e;class n extends e{constructor(a){super();const{editorFactory:l}=a;this.addClass("jp-MetadataEditorTool");const p=this.layout=new be;this._editorFactory=l,this._editorLabel=a.label||"Edit Metadata",this.createEditor();const i=new ee({node:document.createElement("label")});i.node.textContent=a.label||"Edit Metadata",p.addWidget(i),p.addWidget(this.editor)}get editor(){return this._editor}onActiveNotebookPanelChanged(a){this.editor.dispose(),this.notebookTools.activeNotebookPanel&&this.createEditor()}createEditor(){this._editor=new Ko({editorFactory:this._editorFactory}),this.editor.title.label=this._editorLabel,this.layout.addWidget(this.editor)}}r.MetadataEditorTool=n})(q||(q={}));var Me;(function(r){function e(n,s){return n.rank-s.rank}r.itemCmp=e})(Me||(Me={}));const Yo=6;var V;(function(r){r[r.Idle=-1]="Idle",r[r.Error=-.5]="Error",r[r.Scheduled=0]="Scheduled",r[r.Running=1]="Running"})(V||(V={}));class Xo extends Po{constructor(e,n,s,a){super(e,a),this.parser=n,this.sanitizer=s,this.configMetadataMap={numberHeaders:["toc-autonumbering","toc/number_sections"],numberingH1:["!toc/skip_h1_title"],baseNumbering:["toc/base_numbering"]},this._runningCells=new Array,this._errorCells=new Array,this._cellToHeadingIndex=new WeakMap,e.context.ready.then(()=>{this.setConfiguration({})}),this.widget.context.model.metadataChanged.connect(this.onMetadataChanged,this),this.widget.content.activeCellChanged.connect(this.onActiveCellChanged,this),v.executionScheduled.connect(this.onExecutionScheduled,this),v.executed.connect(this.onExecuted,this),v.outputCleared.connect(this.onOutputCleared,this),this.headingsChanged.connect(this.onHeadingsChanged,this)}get documentType(){return"notebook"}get isAlwaysActive(){return!0}get supportedOptions(){return["baseNumbering","maximalDepth","numberingH1","numberHeaders","includeOutput","syncCollapseState"]}getCellHeadings(e){const n=new Array;let s=this._cellToHeadingIndex.get(e);if(s!==void 0){const a=this.headings[s];for(n.push(a);this.headings[s-1]&&this.headings[s-1].cellRef===a.cellRef;)s--,n.unshift(this.headings[s])}return n}dispose(){var e,n,s;this.isDisposed||(this.headingsChanged.disconnect(this.onHeadingsChanged,this),(n=(e=this.widget.context)===null||e===void 0?void 0:e.model)===null||n===void 0||n.metadataChanged.disconnect(this.onMetadataChanged,this),(s=this.widget.content)===null||s===void 0||s.activeCellChanged.disconnect(this.onActiveCellChanged,this),v.executionScheduled.disconnect(this.onExecutionScheduled,this),v.executed.disconnect(this.onExecuted,this),v.outputCleared.disconnect(this.onOutputCleared,this),this._runningCells.length=0,this._errorCells.length=0,super.dispose())}setConfiguration(e){const n=this.loadConfigurationFromMetadata();super.setConfiguration({...this.configuration,...n,...e})}toggleCollapse(e){super.toggleCollapse(e),this.updateRunningStatus(this.headings)}async getHeadings(){const e=this.widget.content.widgets,n=new Set(e),s=[],a=new Array,l=new WeakMap;for(let p=0;p<e.length;p++){const i=e[p];switch(i.model.type){case"code":{!this.configuration.syncCollapseState&&this.configuration.includeOutput&&s.push(...Le(await i.getHeadings(),this.configuration,a).map(d=>({...d,cellRef:i,collapsed:!1,isRunning:V.Idle})));break}case"markdown":{const d=Le(await i.getHeadings(),this.configuration,a).map((g,b)=>({...g,cellRef:i,collapsed:!1,isRunning:V.Idle}));if(this.configuration.syncCollapseState&&i.headingCollapsed){const g=Math.min(...d.map(f=>f.level)),b=d.find(f=>f.level===g);b.collapsed=i.headingCollapsed}s.push(...d);break}}s.length>0&&l.set(i,s.length-1)}return this._cellToHeadingIndex=l,this._runningCells=this._runningCells.filter(p=>n.has(p)),this._errorCells=this._errorCells.filter(p=>n.has(p)),this.updateRunningStatus(s),Promise.resolve(s)}isHeadingEqual(e,n){return super.isHeadingEqual(e,n)&&e.cellRef===n.cellRef&&e.isRunning===n.isRunning}loadConfigurationFromMetadata(){const e=this.widget.content.model,n={};if(e)for(const s in this.configMetadataMap){const a=this.configMetadataMap[s];for(const l of a){let p=l;const i=p[0]==="!";i&&(p=p.slice(1));const u=p.split("/");let d=e.getMetadata(u[0]);for(let g=1;g<u.length;g++)d=(d??{})[u[g]];d!==void 0&&(typeof d=="boolean"&&i&&(d=!d),n[s]=d)}}return n}onActiveCellChanged(e,n){const s=this.getCellHeadings(n)[0];this.setActiveHeading(s??null,!1)}onHeadingsChanged(){this.widget.content.activeCell&&this.onActiveCellChanged(this.widget.content,this.widget.content.activeCell)}onExecuted(e,n){this._runningCells.forEach((s,a)=>{var l;if(s===n.cell){this._runningCells.splice(a,1);const p=this._cellToHeadingIndex.get(s);if(p!==void 0){const i=this.headings[p];if(n.success||((l=n.error)===null||l===void 0?void 0:l.errorName)===void 0){i.isRunning=V.Idle;return}i.isRunning=V.Error,this._errorCells.includes(s)||this._errorCells.push(s)}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onExecutionScheduled(e,n){this._runningCells.includes(n.cell)||this._runningCells.push(n.cell),this._errorCells.forEach((s,a)=>{s===n.cell&&this._errorCells.splice(a,1)}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onOutputCleared(e,n){this._errorCells.forEach((s,a)=>{if(s===n.cell){this._errorCells.splice(a,1);const l=this._cellToHeadingIndex.get(s);if(l!==void 0){const p=this.headings[l];p.isRunning=V.Idle}}}),this.updateRunningStatus(this.headings),this.stateChanged.emit()}onMetadataChanged(){this.setConfiguration({})}updateRunningStatus(e){e.forEach(a=>{a.isRunning=V.Idle}),this._runningCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning!==V.Running&&(i.isRunning=l>0?V.Scheduled:V.Running)}}),this._errorCells.forEach((a,l)=>{const p=this._cellToHeadingIndex.get(a);if(p!==void 0){const i=e[p];i.isRunning===V.Idle&&(i.isRunning=V.Error)}});let n=0;for(;n<e.length;){const a=e[n];if(n++,a.collapsed){const l=Math.max(a.isRunning,s(e,a.level));a.dataset={...a.dataset,"data-running":l.toString()}}else a.dataset={...a.dataset,"data-running":a.isRunning.toString()}}function s(a,l){let p=V.Idle;for(;n<a.length;){const i=a[n];if(i.dataset={...i.dataset,"data-running":i.isRunning.toString()},i.level>l)n++,p=Math.max(i.isRunning,p),i.collapsed&&(p=Math.max(p,s(a,i.level)),i.dataset={...i.dataset,"data-running":p.toString()});else break}return p}}}class Zo extends Io{constructor(e,n,s,a){super(e),this.parser=n,this.sanitizer=s,this.commands=a,this._scrollToTop=!0}get scrollToTop(){return this._scrollToTop}set scrollToTop(e){this._scrollToTop=e}_createNew(e,n){const s=new Xo(e,this.parser,this.sanitizer,n);let a=new WeakMap;const l=(_,y)=>{if(y){const w=async h=>{if(!h.inViewport)return;let C=a.get(y);if((!C||!y.cellRef.node.contains(C))&&(await i(h),C=a.get(y)),C)if(this.scrollToTop)C.scrollIntoView({block:"start"}),e.content.outerNode.scrollTop-=Yo;else{const k=e.content.node.getBoundingClientRect(),A=C.getBoundingClientRect();(A.top>k.bottom||A.bottom<k.top)&&C.scrollIntoView({block:"center"})}else console.debug("scrolling to heading: using fallback strategy"),await e.content.scrollToItem(e.content.activeCellIndex,this.scrollToTop?"start":void 0,0)},S=y.cellRef,t=e.content.widgets.indexOf(S);S.model.type=="markdown"&&e.content.mode!="command"&&(e.content.mode="command"),e.content.activeCellIndex=t,S.inViewport?w(S).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)}):e.content.scrollToItem(t,this.scrollToTop?"start":void 0).then(()=>i(S)).then(()=>w(S)).catch(h=>{console.error(`Fail to scroll to cell to display the required heading (${h}).`)})}},p=_=>s.getCellHeadings(_).filter(y=>y.cellRef===_),i=async _=>{var y;const w=p(_),S=(y=this.sanitizer.allowNamedProperties)!==null&&y!==void 0&&y?"id":"data-jupyter-id",o=await Promise.all(w.map(async h=>{const C=await Qo(h,this.parser,this.sanitizer);return C?`h${h.level}[${S}="${CSS.escape(C)}"]`:`h${h.level}`})),t=p(_);t.length!==w.length||t.some((h,C)=>h!==w[C])||(we(_.node),w.forEach((h,C)=>{var k,A;const B=h.outputIndex===void 0?h.cellRef.node:(k=h.cellRef.outputArea.widgets[h.outputIndex])===null||k===void 0?void 0:k.node;a.set(h,B?It(B,o[C],(A=h.prefix)!==null&&A!==void 0?A:""):null)}))},u=_=>{if(this.parser){we(e.content.node),a=new WeakMap;for(const y of e.content.widgets)y instanceof Z&&y.renderedChanged.connect(f);return Promise.all(e.content.widgets.map(y=>i(y)))}},d=(_,y)=>{var w,S,o,t;if(s.configuration.syncCollapseState)if(y!==null){const h=y.cellRef;h.headingCollapsed!==((w=y.collapsed)!==null&&w!==void 0?w:!1)&&(h.headingCollapsed=(S=y.collapsed)!==null&&S!==void 0?S:!1)}else{const h=(t=(o=s.headings[0])===null||o===void 0?void 0:o.collapsed)!==null&&t!==void 0?t:!1;e.content.widgets.forEach(C=>{C instanceof Z&&C.headingInfo.level>=0&&(C.headingCollapsed=h)})}},g=(_,y)=>{if(s.configuration.syncCollapseState){const w=s.getCellHeadings(y)[0];w&&s.toggleCollapse({heading:w,collapsed:y.headingCollapsed})}},b=(_,y)=>{var w;y.inViewport?(w=i(y))===null||w===void 0||w.catch(console.warn):we(y.node)},f=(_,y)=>{y&&i(_).catch(console.warn)};return e.context.ready.then(()=>{var _;(_=u())===null||_===void 0||_.catch(console.warn),s.activeHeadingChanged.connect(l),s.headingsChanged.connect(u),s.collapseChanged.connect(d),e.content.cellCollapsed.connect(g),e.content.cellInViewportChanged.connect(b),e.disposed.connect(()=>{s.activeHeadingChanged.disconnect(l),s.headingsChanged.disconnect(u),s.collapseChanged.disconnect(d),e.content.cellCollapsed.disconnect(g),e.content.cellInViewportChanged.disconnect(b);for(const y of e.content.widgets)y instanceof Z&&y.renderedChanged.disconnect(f)})}),s}getToolbarItems(e){return this.commands?[{name:"select-last-modified-back",widget:new Pe({commands:this.commands,id:"notebook:select-last-modified-cell",args:{toolbar:!0},icon:jt,label:""})},{name:"select-last-modified-forward",widget:new Pe({commands:this.commands,id:"notebook:select-next-modified-cell",args:{toolbar:!0},icon:Rt,label:""})}]:[]}}async function Qo(r,e,n){let s=null;return r.type===We.HeadingType.Markdown?s=await Pt(e,r.raw,r.level,n):r.type===We.HeadingType.HTML&&(s=r.id),s}const en="jp-StatusItem-trust";function tn(r,e){e=e||R;const n=e.load("jupyterlab");return r.trustedCells===r.totalCells?n.__("Notebook trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):r.activeCellTrusted?n.__("Active cell trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells):n.__("Notebook not trusted: %1 of %2 code cells trusted.",r.trustedCells,r.totalCells)}function on(r){return r.allCellsTrusted?M.createElement(Lt.react,{top:"2px",stylesheet:"statusBar"}):M.createElement(Wt.react,{top:"2px",stylesheet:"statusBar"})}class de extends me{constructor(e){super(new de.Model),this.translator=e||R,this.node.classList.add(en)}render(){if(!this.model)return null;const e=tn(this.model,this.translator);return e!==this.node.title&&(this.node.title=e),M.createElement(on,{allCellsTrusted:this.model.trustedCells===this.model.totalCells,activeCellTrusted:this.model.activeCellTrusted,totalCells:this.model.totalCells,trustedCells:this.model.trustedCells})}}(function(r){class e extends Ce{constructor(){super(...arguments),this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1,this._notebook=null}get trustedCells(){return this._trustedCells}get totalCells(){return this._totalCells}get activeCellTrusted(){return this._activeCellTrusted}get notebook(){return this._notebook}set notebook(s){const a=this._notebook;a!==null&&(a.activeCellChanged.disconnect(this._onActiveCellChanged,this),a.modelContentChanged.disconnect(this._onModelChanged,this));const l=this._getAllState();if(this._notebook=s,this._notebook===null)this._trustedCells=0,this._totalCells=0,this._activeCellTrusted=!1;else{this._notebook.activeCellChanged.connect(this._onActiveCellChanged,this),this._notebook.modelContentChanged.connect(this._onModelChanged,this),this._notebook.activeCell?this._activeCellTrusted=this._notebook.activeCell.model.trusted:this._activeCellTrusted=!1;const{total:p,trusted:i}=this._deriveCellTrustState(this._notebook.model);this._totalCells=p,this._trustedCells=i}this._triggerChange(l,this._getAllState())}_onModelChanged(s){const a=this._getAllState(),{total:l,trusted:p}=this._deriveCellTrustState(s.model);this._totalCells=l,this._trustedCells=p,this._triggerChange(a,this._getAllState())}_onActiveCellChanged(s,a){const l=this._getAllState();a?this._activeCellTrusted=a.model.trusted:this._activeCellTrusted=!1,this._triggerChange(l,this._getAllState())}_deriveCellTrustState(s){if(s===null)return{total:0,trusted:0};let a=0,l=0;for(const p of s.cells)p.type==="code"&&(a++,p.trusted&&l++);return{total:a,trusted:l}}_getAllState(){return[this._trustedCells,this._totalCells,this.activeCellTrusted]}_triggerChange(s,a){(s[0]!==a[0]||s[1]!==a[1]||s[2]!==a[2])&&this.stateChanged.emit(void 0)}}r.Model=e})(de||(de={}));const nn=new ot("@jupyterlab/metadataform:IMetadataFormProvider","A service to register new metadata editor widgets."),ln={id:"@jupyterlab/notebook-extension:cell-executor",description:"Provides the notebook cell executor.",autoStart:!0,provides:lt,activate:()=>Object.freeze({runCell:Ht})},sn=new ot("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure."),rn={activate:an,id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[L],optional:[sn],autoStart:!0};function an(r,e,n){if(!n)return;function s(a){function l(p,i,u){if(Y.KernelMessage.isDisplayDataMsg(p)||Y.KernelMessage.isStreamMsg(p)||Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isExecuteResultMsg(p)){const d=n.getLogger(a.context.path);d.rendermime=a.content.rendermime;const g={...p.content,output_type:p.header.msg_type};let b=i;(Y.KernelMessage.isErrorMsg(p)||Y.KernelMessage.isStreamMsg(p)&&p.content.name==="stderr")&&(b=u),d.log({type:"output",data:g,level:b})}}a.context.sessionContext.iopubMessage.connect((p,i)=>l(i,"info","info"),a),a.context.sessionContext.unhandledMessage.connect((p,i)=>l(i,"warning","error"),a)}e.forEach(a=>s(a)),e.widgetAdded.connect((a,l)=>s(l))}const dn="jp-ActiveCellTool",cn="jp-ActiveCellTool-Content",un="jp-ActiveCellTool-CellContent";class hn extends q.Tool{constructor(e){super(),this._cellModel=null,this._updateId=0,this._pendingUpdate=!1,this._promptOutdated=!1,this._tracker=e.tracker,this._languages=e.languages,this.addClass(dn),this.layout=new be,this._inputPrompt=new Ft,this.layout.addWidget(this._inputPrompt);const n=document.createElement("div");n.classList.add(cn);const s=n.appendChild(document.createElement("div")),a=s.appendChild(document.createElement("pre"));s.className=un,this._editorEl=a,this.layout.addWidget(new ee({node:n})),this._previewDebouncer=new Kt(()=>this._update(),150),this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this),this._tracker.currentChanged.connect(this._onActiveCellChanged,this),this._onActiveCellChanged()}dispose(){this.isDisposed||(this._tracker.activeCellChanged.disconnect(this._onActiveCellChanged,this),this._tracker.currentChanged.disconnect(this._onActiveCellChanged,this),this._disconnectCellModel(),this._previewDebouncer.dispose(),super.dispose())}render(e){return M.createElement("div",{ref:n=>{!n||this.node.parentElement===n||(n.appendChild(this.node),this._pendingUpdate&&this._update().catch(console.warn))}})}_onActiveCellChanged(){var e,n;const s=(n=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model)!==null&&n!==void 0?n:null;s!==this._cellModel&&(this._disconnectCellModel(),this._cellModel=s,s&&(s.sharedModel.changed.connect(this._onCellContentChanged,this),s.mimeTypeChanged.connect(this._onCellContentChanged,this)),this._promptOutdated=!0,this._update().catch(console.warn))}_onCellContentChanged(){if(!this.node.isConnected){this._pendingUpdate=!0,this._promptOutdated=!0;return}this._promptOutdated||this._updatePrompt(),this._previewDebouncer.invoke().catch(console.warn)}_disconnectCellModel(){const e=this._cellModel;e&&(e.sharedModel.changed.disconnect(this._onCellContentChanged,this),e.mimeTypeChanged.disconnect(this._onCellContentChanged,this),this._cellModel=null)}_updatePrompt(){var e;const n=this._cellModel;n&&Vt(n)?(this._inputPrompt.executionCount=`${(e=n.executionCount)!==null&&e!==void 0?e:""}`,this._inputPrompt.show()):(this._inputPrompt.executionCount=null,this._inputPrompt.hide())}async _update(){if(!this.node.isConnected){this._pendingUpdate=!0;return}this._pendingUpdate=!1;const e=this._cellModel,n=++this._updateId;if(!e){this._promptOutdated=!1,this._updatePrompt(),this._editorEl.replaceChildren();return}const s=e.sharedModel.getSource(),a=s.indexOf(`
|
|
2
|
+
`),l=a===-1?s:s.slice(0,a),p=document.createElement("pre");try{await this._languages.highlight(l,this._languages.findByMIME(e.mimeType),p)}catch(u){console.warn(u),p.replaceChildren(document.createTextNode(l))}if(n!==this._updateId)return;this._promptOutdated&&(this._updatePrompt(),this._promptOutdated=!1);const i=document.createDocumentFragment();for(;p.firstChild;)i.appendChild(p.firstChild);this._editorEl.replaceChildren(i)}}const pn="jp-CellMetadataEditor",gn="jp-NotebookMetadataEditor";class mn extends q.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,n,s;const a=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model.sharedModel;if(a&&this.editor.source){const l=Object.keys((n=a.metadata)!==null&&n!==void 0?n:{}),p=(s=this.editor.source.toJSON())!==null&&s!==void 0?s:{};a.transact(()=>{l.forEach(i=>a.deleteMetadata(i)),a.setMetadata(p)})}}render(e){var n;const s=this._tracker.activeCell,a=this.editor.source;return this.editor.source=s?new ge({values:s.model.metadata}):null,a?.dispose(),(n=this.editor.source)===null||n===void 0||n.changed.connect(this._onSourceChanged,this),M.createElement("div",{className:pn},M.createElement("div",{ref:l=>l?.appendChild(this.node)}))}}class Cn extends q.MetadataEditorTool{constructor(e){super(e),this._tracker=e.tracker,this.editor.editorHostNode.addEventListener("blur",this.editor,!0),this.editor.editorHostNode.addEventListener("click",this.editor,!0),this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,n;this.editor.source&&((n=(e=this._tracker.currentWidget)===null||e===void 0?void 0:e.model)===null||n===void 0||n.sharedModel.setMetadata(this.editor.source.toJSON()))}render(e){var n,s;const a=this._tracker.currentWidget,l=this.editor.source;return this.editor.source=a?new ge({values:(n=a.model)===null||n===void 0?void 0:n.metadata}):null,l?.dispose(),(s=this.editor.source)===null||s===void 0||s.changed.connect(this._onSourceChanged,this),M.createElement("div",{className:gn},M.createElement("div",{ref:p=>p?.appendChild(this.node)}))}}var c;(function(r){r.createNew="notebook:create-new",r.interrupt="notebook:interrupt-kernel",r.restart="notebook:restart-kernel",r.restartClear="notebook:restart-clear-output",r.restartAndRunToSelected="notebook:restart-and-run-to-selected",r.restartRunAll="notebook:restart-run-all",r.reconnectToKernel="notebook:reconnect-to-kernel",r.changeKernel="notebook:change-kernel",r.getKernel="notebook:get-kernel",r.createConsole="notebook:create-console",r.createSubshellConsole="notebook:create-subshell-console",r.createOutputView="notebook:create-output-view",r.clearAllOutputs="notebook:clear-all-cell-outputs",r.shutdown="notebook:shutdown-kernel",r.closeAndShutdown="notebook:close-and-shutdown",r.trust="notebook:trust",r.exportToFormat="notebook:export-to-format",r.run="notebook:run-cell",r.runAndAdvance="notebook:run-cell-and-select-next",r.runAndInsert="notebook:run-cell-and-insert-below",r.runInConsole="notebook:run-in-console",r.runAll="notebook:run-all-cells",r.runAllAbove="notebook:run-all-above",r.runAllBelow="notebook:run-all-below",r.renderAllMarkdown="notebook:render-all-markdown",r.toCode="notebook:change-cell-to-code",r.toMarkdown="notebook:change-cell-to-markdown",r.toRaw="notebook:change-cell-to-raw",r.cut="notebook:cut-cell",r.copy="notebook:copy-cell",r.pasteAbove="notebook:paste-cell-above",r.pasteBelow="notebook:paste-cell-below",r.duplicateBelow="notebook:duplicate-below",r.pasteAndReplace="notebook:paste-and-replace-cell",r.moveUp="notebook:move-cell-up",r.moveDown="notebook:move-cell-down",r.clearOutputs="notebook:clear-cell-output",r.deleteCell="notebook:delete-cell",r.insertAbove="notebook:insert-cell-above",r.insertBelow="notebook:insert-cell-below",r.selectAbove="notebook:move-cursor-up",r.selectBelow="notebook:move-cursor-down",r.selectHeadingAboveOrCollapse="notebook:move-cursor-heading-above-or-collapse",r.selectHeadingBelowOrExpand="notebook:move-cursor-heading-below-or-expand",r.insertHeadingAbove="notebook:insert-heading-above",r.insertHeadingBelow="notebook:insert-heading-below",r.extendAbove="notebook:extend-marked-cells-above",r.extendTop="notebook:extend-marked-cells-top",r.extendBelow="notebook:extend-marked-cells-below",r.extendBottom="notebook:extend-marked-cells-bottom",r.selectAll="notebook:select-all",r.deselectAll="notebook:deselect-all",r.editMode="notebook:enter-edit-mode",r.merge="notebook:merge-cells",r.mergeAbove="notebook:merge-cell-above",r.mergeBelow="notebook:merge-cell-below",r.split="notebook:split-cell-at-cursor",r.commandMode="notebook:enter-command-mode",r.toggleAllLines="notebook:toggle-all-cell-line-numbers",r.undoCellAction="notebook:undo-cell-action",r.redoCellAction="notebook:redo-cell-action",r.redo="notebook:redo",r.undo="notebook:undo",r.markdown1="notebook:change-cell-to-heading-1",r.markdown2="notebook:change-cell-to-heading-2",r.markdown3="notebook:change-cell-to-heading-3",r.markdown4="notebook:change-cell-to-heading-4",r.markdown5="notebook:change-cell-to-heading-5",r.markdown6="notebook:change-cell-to-heading-6",r.hideCode="notebook:hide-cell-code",r.showCode="notebook:show-cell-code",r.hideAllCode="notebook:hide-all-cell-code",r.showAllCode="notebook:show-all-cell-code",r.hideOutput="notebook:hide-cell-outputs",r.showOutput="notebook:show-cell-outputs",r.toggleOutput="notebook:toggle-cell-outputs",r.hideAllOutputs="notebook:hide-all-cell-outputs",r.showAllOutputs="notebook:show-all-cell-outputs",r.toggleRenderSideBySideCurrentNotebook="notebook:toggle-render-side-by-side-current",r.setSideBySideRatio="notebook:set-side-by-side-ratio",r.enableOutputScrolling="notebook:enable-output-scrolling",r.disableOutputScrolling="notebook:disable-output-scrolling",r.toggleOutputScrolling="notebook:toggle-output-scrolling",r.selectLastRunCell="notebook:select-last-run-cell",r.selectLastModifiedCell="notebook:select-last-modified-cell",r.selectNextModifiedCell="notebook:select-next-modified-cell",r.replaceSelection="notebook:replace-selection",r.autoClosingBrackets="notebook:toggle-autoclosing-brackets",r.toggleCollapseCmd="notebook:toggle-heading-collapse",r.collapseAllCmd="notebook:collapse-all-headings",r.expandAllCmd="notebook:expand-all-headings",r.copyToClipboard="notebook:copy-to-clipboard",r.invokeCompleter="completer:invoke-notebook",r.selectCompleter="completer:select-notebook",r.tocRunCells="toc:run-cells",r.accessPreviousHistory="notebook:access-previous-history-entry",r.accessNextHistory="notebook:access-next-history-entry",r.virtualScrollbar="notebook:toggle-virtual-scrollbar",r.copySelectedtext="notebook:copy-selected-text",r.pasteText="notebook:paste-text",r.cutSelectedtext="notebook:cut-selected-text"})(c||(c={}));const $="Notebook",bn=["notebook","python","custom"],fn="@jupyterlab/notebook-extension:panel",Ve="jp-NotebookExtension-sideBySideMargins",te={id:"@jupyterlab/notebook-extension:tracker",description:"Provides the notebook widget tracker.",provides:L,requires:[st,uo,lt],optional:[De,mo,Co,at,dt,bo,_e,Je,F,Ee,rt],activate:qn,autoStart:!0},vn={id:"@jupyterlab/notebook-extension:factory",description:"Provides the notebook and cell factory.",provides:Se.IContentFactory,requires:[fe],autoStart:!0,activate:(r,e)=>{const n=e.factoryService.newInlineEditor;return new Se.ContentFactory({editorFactory:n})}},_n={activate:Hn,provides:go,id:"@jupyterlab/notebook-extension:tools",description:"Provides the notebook tools.",autoStart:!0,requires:[L,fe,it,Ut.IStateDB,F],optional:[po]},yn={id:"@jupyterlab/notebook-extension:mode-status",description:"Adds a notebook mode status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new ae(n);e.currentChanged.connect(()=>{const p=e.currentWidget;l.model.notebook=p&&p.content}),s.registerStatusItem("@jupyterlab/notebook-extension:mode-status",{priority:1,item:l,align:"right",rank:4,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},ct={id:"@jupyterlab/notebook-extension:cell-counter-status",description:"Adds a notebook cell counter status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new re({translator:n}),p=()=>{const i=e.currentWidget;l.model.notebook=i&&i.content};e.currentChanged.connect(p),p(),s.registerStatusItem(ct.id,{priority:1,item:l,align:"right",rank:2.5,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},xn={id:"@jupyterlab/notebook-extension:execution-indicator",description:"Adds a notebook execution status widget.",autoStart:!0,requires:[L,fo,F],optional:[ve,_e],activate:(r,e,n,s,a,l)=>{let p,i,u;const d=g=>{var b,f;let{showOnToolBar:_,showProgress:y,showJumpToCell:w}=g;if(_)u&&(n.currentChanged.disconnect(i),u.dispose());else{if(!a)return;p?.model||(p=new X(s),i=(S,o)=>{const{newValue:t}=o;if(t&&e.has(t)){const h=t;p.model.attachNotebook({content:h.content,context:h.sessionContext})}},u=a.registerStatusItem("@jupyterlab/notebook-extension:execution-indicator",{item:p,align:"left",rank:3,isActive:()=>{const S=n.currentWidget;return!!S&&e.has(S)}}),p.model.attachNotebook({content:(b=e.currentWidget)===null||b===void 0?void 0:b.content,context:(f=e.currentWidget)===null||f===void 0?void 0:f.sessionContext}),n.currentChanged.connect(i),p.disposed.connect(()=>{n.currentChanged.disconnect(i)})),p.model.displayOption={showOnToolBar:_,showProgress:y,showJumpToCell:w}}};if(l){const g=l.load(te.id);Promise.all([g,r.restored]).then(([b])=>{d(X.getSettingValue(b)),b.changed.connect(f=>d(X.getSettingValue(f)))}).catch(b=>{console.error(b.message)})}}},wn={id:"@jupyterlab/notebook-extension:export",description:"Adds the export notebook commands.",autoStart:!0,requires:[F,L],optional:[dt,De],activate:(r,e,n,s,a)=>{var l;const p=e.load("jupyterlab"),{commands:i,shell:u}=r,d=r.serviceManager,g=()=>H.isEnabled(u,n);i.addCommand(c.exportToFormat,{label:y=>{if(y.label===void 0)return p.__("Save and Export Notebook to the given `format`.");const w=y.label;return y.isPalette?p.__("Save and Export Notebook: %1",w):w},execute:async y=>{var w,S,o;const t=m(n,u,y);if(!t)return;const{context:h}=t,C=pe.PageConfig.getNotebookVersion(),k=pe.compareVersions(C,[4,0,0])<0&&pe.compareVersions(C,[2,18,0])>=0;let A=!1;if(y.format==="html"&&k){const E=await Ge.getBoolean({title:p.__("Export as HTML"),label:p.__("Sanitize HTML output"),value:!0});if(!E.button.accept)return;A=(w=E.value)!==null&&w!==void 0?w:!1}const B={format:y.format,path:t.context.path,exporterOptions:{download:!0,sanitizeHtml:A}};return h.model.dirty&&!h.model.readOnly&&await h.save(),(o=(S=d.nbconvert).exportAs)===null||o===void 0?void 0:o.call(S,B)},isEnabled:g,describedBy:{args:{type:"object",properties:{format:{type:"string",description:p.__("The export format (e.g., pdf, html, latex)")},label:{type:"string",description:p.__("The label to display for this format")},isPalette:{type:"boolean",description:p.__("Whether the command is called from the command palette")}},required:["format"]}}});let b;s&&(b=(l=s.fileMenu.items.find(y=>{var w;return y.type==="submenu"&&((w=y.submenu)===null||w===void 0?void 0:w.id)==="jp-mainmenu-file-notebookexport"}))===null||l===void 0?void 0:l.submenu);let f=!1;const _=async()=>{if(f)return;n.widgetAdded.disconnect(_),f=!0;const y=await d.nbconvert.getExportFormats(!1);if(!y)return;const w=H.getFormatLabels(e);Object.keys(y).forEach(function(o){const t=o[0].toLocaleUpperCase()+o.slice(1),h=p.__(t),C=w[o]?w[o]:h;let k={format:o,label:C,isPalette:!1};if(bn.indexOf(o)===-1&&(b&&b.addItem({command:c.exportToFormat,args:k}),a)){k={format:o,label:C,isPalette:!0};const A=p.__("Notebook Operations");a.addItem({command:c.exportToFormat,category:A,args:k})}})};n.widgetAdded.connect(_)}},kn={id:"@jupyterlab/notebook-extension:trust-status",description:"Adds the notebook trusted status widget.",autoStart:!0,requires:[L,F],optional:[ve],activate:(r,e,n,s)=>{if(!s)return;const{shell:a}=r,l=new de(n);e.currentChanged.connect(()=>{const p=e.currentWidget;l.model.notebook=p&&p.content}),s.registerStatusItem("@jupyterlab/notebook-extension:trust-status",{item:l,align:"right",rank:3,isActive:()=>!!a.currentWidget&&!!e.currentWidget&&a.currentWidget===e.currentWidget})}},Sn={id:"@jupyterlab/notebook-extension:widget-factory",description:"Provides the notebook widget factory.",provides:st,requires:[Se.IContentFactory,fe,vo,pt],optional:[_e,Je,F],activate:Fn,autoStart:!0},An={id:"@jupyterlab/notebook-extension:cloned-outputs",description:"Adds the clone output feature.",requires:[yo,L,F],optional:[at],activate:Kn,autoStart:!0},Mn={id:"@jupyterlab/notebook-extension:code-console",description:"Adds the notebook code consoles features.",requires:[L,F],activate:Vn,autoStart:!0},Tn={id:"@jupyterlab/notebook-extension:copy-output",description:"Adds the copy cell outputs feature.",activate:Un,requires:[F,L],autoStart:!0},Bn={id:"@jupyterlab/notebook-extension:kernel-status",description:"Adds the notebook kernel status.",activate:(r,e,n)=>{const s=a=>{let l=null;return a&&e.has(a)?a.sessionContext:l};n.addSessionProvider(s)},requires:[L,gt],autoStart:!0},En={id:"@jupyterlab/notebook-extension:cursor-position",description:"Adds the notebook cursor position status.",activate:(r,e,n)=>{let s=null;const a=async l=>{let p=null;if(l!==s){if(s?.content.activeCellChanged.disconnect(n.update),s=null,l&&e.has(l)){l.content.activeCellChanged.connect(n.update);const i=l.content.activeCell;p=null,i&&(await i.ready,p=i.editor),s=l}}else if(l){const i=l.content.activeCell;p=null,i&&(await i.ready,p=i.editor)}return p};n.addEditorProvider(a)},requires:[L,qt],autoStart:!0},Nn={id:"@jupyterlab/notebook-extension:completer",description:"Adds the code completion capability to notebooks.",requires:[L],optional:[xo,F,ze],activate:$n,autoStart:!0},On={id:"@jupyterlab/notebook-extension:search",description:"Adds search capability to notebooks.",requires:[wo],autoStart:!0,activate:(r,e)=>{e.add("jp-notebookSearchProvider",Zt)}},jn={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[L,$t,ze],optional:[_o,_e],autoStart:!0,activate:(r,e,n,s,a,l)=>{const p=new Zo(e,a,s,r.commands);n.add(p),l&&Promise.all([r.restored,l.load(te.id)]).then(([i,u])=>{const d=()=>{var g;p.scrollToTop=(g=u.composite.scrollHeadingToTop)!==null&&g!==void 0?g:!0};d(),u.changed.connect(d)}).catch(i=>{console.error("Failed to load notebook table of content settings.",i)})}},Rn={id:"@jupyterlab/notebook-extension:language-server",description:"Adds language server capability to the notebooks.",requires:[L,Ao,Mo,To,Bo],activate:Dn,autoStart:!0},In={id:"@jupyterlab/notebook-extension:update-raw-mimetype",description:"Adds metadata form editor for raw cell mimetype.",autoStart:!0,requires:[L,nn,F],activate:(r,e,n,s)=>{const a=s.load("jupyterlab");let l=!1;async function p(){if(l||!n.get("commonToolsSection"))return;const i=n.get("commonToolsSection").getProperties("/raw_mimetype");if(!i)return;e.widgetAdded.disconnect(p),l=!0;const d=await r.serviceManager.nbconvert.getExportFormats(!1);if(!d)return;const g=Object.keys(d),b=H.getFormatLabels(s);g.forEach(function(f){var _;if(!(((_=i.oneOf)===null||_===void 0?void 0:_.filter(w=>w.const===f).length)>0)){const w=f[0].toLocaleUpperCase()+f.slice(1),S=a.__(w),o=b[f]?b[f]:S,t=d[f].output_mimetype;i.oneOf.push({const:t,title:o})}}),n.get("commonToolsSection").setProperties("/raw_mimetype",i)}e.widgetAdded.connect(p)}},Pn={id:"@jupyterlab/notebook-extension:metadata-editor",description:"Adds metadata form for full metadata editor.",autoStart:!0,requires:[L,fe,Ee],optional:[F],activate:(r,e,n,s,a)=>{const l=g=>n.factoryService.newInlineEditor(g),p=new mn({editorFactory:l,tracker:e,label:"Cell metadata",translator:a}),i={fieldRenderer:g=>p.render(g)};s.addRenderer("@jupyterlab/notebook-extension:metadata-editor.cell-metadata",i);const u=new Cn({editorFactory:l,tracker:e,label:"Notebook metadata",translator:a}),d={fieldRenderer:g=>u.render(g)};s.addRenderer("@jupyterlab/notebook-extension:metadata-editor.notebook-metadata",d)}},Ln={id:"@jupyterlab/notebook-extension:active-cell-tool",description:"Adds active cell field in the metadata editor tab.",autoStart:!0,requires:[L,Ee,it],activate:(r,e,n,s)=>{const a=new hn({tracker:e,languages:s}),l={fieldRenderer:p=>a.render(p)};n.addRenderer("@jupyterlab/notebook-extension:active-cell-tool.renderer",l)}},Wn={id:"@jupyterlab/notebook-extension:open-with-no-kernel",description:'Adds the "Notebook (no kernel)" option to the Open With menu.',requires:[rt],optional:[F],autoStart:!0,activate:(r,e,n)=>{const{tracker:s}=e,a=(n??R).load("jupyterlab"),l=[];function p(i){var u,d;l.forEach(_=>_.dispose()),l.length=0;const g=(d=(u=i.menu.items.find(_=>{var y;return _.type==="submenu"&&((y=_.submenu)===null||y===void 0?void 0:y.id)==="jp-contextmenu-open-with"}))===null||u===void 0?void 0:u.submenu)!==null&&d!==void 0?d:null;if(!g)return;(s.currentWidget?Array.from(s.currentWidget.selectedItems()):[]).some(_=>_.type==="notebook")&&l.push(g.addItem({command:"filebrowser:open",args:{label:a.__("Notebook (no kernel)"),factory:$,kernelPreference:{shouldStart:!1,shouldReuse:!1}}}))}r.contextMenu.opened.connect(p)}},al=[ln,vn,te,xn,wn,_n,ct,yn,kn,Sn,rn,An,Mn,Tn,Bn,En,Nn,On,jn,Rn,In,Pn,Ln,Wn];function Hn(r,e,n,s,a,l,p){const i=l.load("jupyterlab"),u="notebook-tools",d=new q({tracker:e,translator:l}),g=(b,f)=>{switch(f.type){case"activate-request":a.save(u,{open:!0});break;case"after-hide":case"close-request":a.remove(u);break}return!0};return d.title.icon=Jt,d.title.dataset={...d.title.dataset,jpTabLabel:i.__("Notebook Tools")},d.title.caption=i.__("Notebook Tools"),d.id=u,G.installMessageHook(d,g),p&&e.widgetAdded.connect((b,f)=>{p.register(f).render(d)}),d}function Fn(r,e,n,s,a,l,p,i){const u=i??R,d=p??new Be({translator:u}),g=pe.PageConfig.getOption("notebookStartsKernel"),b=g===""||g.toLowerCase()==="true",{commands:f}=r;let _;a.addFactory($,"save",S=>ho.createSaveButton(f,S.context.fileChanged)),a.addFactory($,"cellType",S=>Ae.createCellTypeItem(S,u)),a.addFactory($,"kernelName",S=>he.createKernelNameItem(S.sessionContext,d,u)),a.addFactory($,"executionProgress",S=>{const o=l?.load(te.id),t=X.createExecutionIndicatorItem(S,u,o);return o?.then(h=>{S.disposed.connect(()=>{h.dispose()})}),t}),l&&(_=zt(a,l,$,fn,u));const y=u.load("jupyterlab"),w=new jo({name:$,label:y.__("Notebook"),fileTypes:["notebook"],modelName:"notebook",defaultFor:["notebook"],preferKernel:b,canStartKernel:!0,rendermime:s,contentFactory:e,editorConfig:se.defaultEditorConfig,notebookConfig:se.defaultNotebookConfig,mimeTypeService:n.mimeTypeService,toolbarFactory:_,translator:u});return r.docRegistry.addWidgetFactory(w),w}function Kn(r,e,n,s,a){const l=s.load("jupyterlab"),p=new Gt({namespace:"cloned-outputs"});a&&a.restore(p,{command:c.createOutputView,args:g=>({path:g.content.path,index:g.content.index}),name:g=>`${g.content.path}:${g.content.index}`,when:n.restored});const{commands:i,shell:u}=r,d=()=>H.isEnabledAndSingleSelected(u,n);i.addCommand(c.createOutputView,{label:l.__("Create New View for Cell Output"),execute:async g=>{var b;let f,_;const y=g.path;let w=g.index;if(y&&w!==void 0&&w!==null){if(_=e.findWidget(y,$),!_)return}else{if(_=n.currentWidget,!_)return;f=_.content.activeCell,w=_.content.activeCellIndex}const S=new H.ClonedOutputArea({notebook:_,cell:f,index:w,translator:s}),o=new Yt({content:S});_.context.addSibling(o,{ref:_.id,mode:"split-bottom",type:"Cloned Output"});const t=()=>{p.save(o)};_.context.pathChanged.connect(t),(b=_.context.model)===null||b===void 0||b.cells.changed.connect(t),p.add(o),_.content.disposed.connect(()=>{var h;_.context.pathChanged.disconnect(t),(h=_.context.model)===null||h===void 0||h.cells.changed.disconnect(t),o.dispose()})},isEnabled:d,describedBy:{args:{type:"object",properties:{path:{type:"string",description:l.__("The path to the notebook containing the cell")},index:{type:"number",description:l.__("The index of the cell to create an output view for")}}}}})}function Vn(r,e,n){const s=n.load("jupyterlab"),{commands:a,shell:l}=r,p=()=>H.isEnabled(l,e);a.addCommand(c.createConsole,{label:s.__("New Console for Notebook"),execute:i=>{const u=e.currentWidget;if(u)return H.createConsole(a,u,i.activate)},isEnabled:p,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:s.__("Whether to activate the console after creation")}}}}}),a.addCommand(c.createSubshellConsole,{label:s.__("New Subshell Console for Notebook"),execute:i=>{const u=e.currentWidget;if(u)return H.createConsole(a,u,i.activate,!0)},isEnabled:p,isVisible:()=>{var i,u,d;const g=(u=(i=e.currentWidget)===null||i===void 0?void 0:i.context.sessionContext.session)===null||u===void 0?void 0:u.kernel;return(d=g?.supportsSubshells)!==null&&d!==void 0?d:!1},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:s.__("Whether to activate the console after creation")}}}}}),a.addCommand(c.runInConsole,{label:s.__("Run Selected Text or Current Line in Console"),execute:async i=>{var u,d;const g=e.currentWidget;if(!g)return;const{context:b,content:f}=g,_=f.activeCell,y=_?.model.metadata,w=b.path;if(!_||_.model.type!=="code")return;let S;const o=_.editor;if(!o)return;const t=o.getSelection(),{start:h,end:C}=t;if(h.column!==C.column||h.line!==C.line){const A=o.getOffsetAt(t.start),B=o.getOffsetAt(t.end);S=o.model.sharedModel.getSource().substring(A,B)}else{const A=o.getCursorPosition(),B=o.model.sharedModel.getSource().split(`
|
|
3
3
|
`);let E=t.start.line;for(;E<o.lineCount&&!B[E].replace(/\s/g,"").length;)E+=1;let j=E>0,K=0,W=K+1;for(;;){S=B.slice(K,W).join(`
|
|
4
4
|
`);const oe=await((d=(u=g.context.sessionContext.session)===null||u===void 0?void 0:u.kernel)===null||d===void 0?void 0:d.requestIsComplete({code:S+`
|
|
5
5
|
|
|
6
|
-
`}));if(oe?.content.status==="complete")if(E<W){for(;W<o.lineCount&&!B[W].replace(/\s/g,"").length;)W+=1;o.setCursorPosition({line:W,column:A.column});break}else K=W,W=K+1;else if(W<o.lineCount)W+=1;else if(j)K=E,W=E+1,j=!1;else{for(S=B[E];E+1<o.lineCount&&!B[E+1].replace(/\s/g,"").length;)E+=1;o.setCursorPosition({line:E+1,column:A.column});break}}}S&&(await a.execute("console:open",{activate:!1,insertMode:"split-bottom",path:w}),await a.execute("console:inject",{activate:!1,code:S,path:w,metadata:y}))},isEnabled:p,describedBy:{args:{type:"object",properties:{}}}})}function Un(r,e,n){const s=e.load("jupyterlab");function a(l){const p=window.getSelection();if(p==null)return;const i=[];for(let d=0;d<p.rangeCount;++d)i[d]=p.getRangeAt(d).cloneRange();const u=document.createRange();u.selectNodeContents(l),p.removeAllRanges(),p.addRange(u),document.execCommand("copy"),p.removeAllRanges(),i.forEach(d=>p.addRange(d))}r.commands.addCommand(c.copyToClipboard,{label:s.__("Copy Output to Clipboard"),execute:l=>{var p;const i=(p=n.currentWidget)===null||p===void 0?void 0:p.content.activeCell;if(i==null)return;const u=i.outputArea.outputTracker.currentWidget;if(u==null)return;const d=u.node.getElementsByClassName("jp-OutputArea-output");if(d.length>0){const g=d[0];a(g)}},describedBy:{args:{type:"object",properties:{}}}}),r.contextMenu.addItem({command:c.copyToClipboard,selector:".jp-Notebook .jp-OutputArea-child",rank:0})}function qn(r,e,n,s,a,l,p,i,u,d,g,b,f,_,y){
|
|
6
|
+
`}));if(oe?.content.status==="complete")if(E<W){for(;W<o.lineCount&&!B[W].replace(/\s/g,"").length;)W+=1;o.setCursorPosition({line:W,column:A.column});break}else K=W,W=K+1;else if(W<o.lineCount)W+=1;else if(j)K=E,W=E+1,j=!1;else{for(S=B[E];E+1<o.lineCount&&!B[E+1].replace(/\s/g,"").length;)E+=1;o.setCursorPosition({line:E+1,column:A.column});break}}}S&&(await a.execute("console:open",{activate:!1,insertMode:"split-bottom",path:w}),await a.execute("console:inject",{activate:!1,code:S,path:w,metadata:y}))},isEnabled:p,describedBy:{args:{type:"object",properties:{}}}})}function Un(r,e,n){const s=e.load("jupyterlab");function a(l){const p=window.getSelection();if(p==null)return;const i=[];for(let d=0;d<p.rangeCount;++d)i[d]=p.getRangeAt(d).cloneRange();const u=document.createRange();u.selectNodeContents(l),p.removeAllRanges(),p.addRange(u),document.execCommand("copy"),p.removeAllRanges(),i.forEach(d=>p.addRange(d))}r.commands.addCommand(c.copyToClipboard,{label:s.__("Copy Output to Clipboard"),execute:l=>{var p;const i=(p=n.currentWidget)===null||p===void 0?void 0:p.content.activeCell;if(i==null)return;const u=i.outputArea.outputTracker.currentWidget;if(u==null)return;const d=u.node.getElementsByClassName("jp-OutputArea-output");if(d.length>0){const g=d[0];a(g)}},describedBy:{args:{type:"object",properties:{}}}}),r.contextMenu.addItem({command:c.copyToClipboard,selector:".jp-Notebook .jp-OutputArea-child",rank:0})}function qn(r,e,n,s,a,l,p,i,u,d,g,b,f,_,y){Dt(s);const w=f??R,S=b??new Be({translator:w}),o=w.load("jupyterlab"),t=r.serviceManager,{commands:h,shell:C}=r,k=new No({namespace:"notebook"});function A(x,T){T.hash&&k.currentWidget&&k.currentWidget.setFragment(T.hash)}d?.routed.connect(A);const B=()=>H.isEnabled(C,k),E=x=>document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${x}fr`);if((g?g.load(te.id):Promise.reject(new Error(`No setting registry for ${te.id}`))).then(x=>{Oe(x),x.changed.connect(()=>{Oe(x),h.notifyCommandChanged(c.virtualScrollbar)});const T=(I,N)=>{const{newValue:U,oldValue:ne}=N,z=U.autoStartDefault;typeof z=="boolean"&&z!==ne.autoStartDefault&&z!==x.get("autoStartDefaultKernel").composite&&x.set("autoStartDefaultKernel",z).catch(je=>{console.error(`Failed to set ${x.id}.autoStartDefaultKernel`)})},O=new WeakSet,P=I=>{const N=I.context.sessionContext;!N.isDisposed&&!O.has(N)&&(O.add(N),N.kernelPreferenceChanged.connect(T),N.disposed.connect(()=>{N.kernelPreferenceChanged.disconnect(T)}))};k.forEach(P),k.widgetAdded.connect((I,N)=>{P(N)}),h.addCommand(c.autoClosingBrackets,{execute:I=>{var N;const U=x.get("codeCellConfig").composite,ne=x.get("markdownCellConfig").composite,z=x.get("rawCellConfig").composite,je=U.autoClosingBrackets||ne.autoClosingBrackets||z.autoClosingBrackets,ye=!!((N=I.force)!==null&&N!==void 0?N:!je);[U.autoClosingBrackets,ne.autoClosingBrackets,z.autoClosingBrackets]=[ye,ye,ye],x.set("codeCellConfig",U),x.set("markdownCellConfig",ne),x.set("rawCellConfig",z)},label:o.__("Auto Close Brackets for All Notebook Cell Types"),isToggled:()=>["codeCellConfig","markdownCellConfig","rawCellConfig"].some(I=>{var N;return((N=x.get(I).composite.autoClosingBrackets)!==null&&N!==void 0?N:n.baseConfiguration.autoClosingBrackets)===!0}),describedBy:{args:{type:"object",properties:{force:{type:"boolean",description:o.__("Force toggling the auto closing brackets setting")}}}}}),h.addCommand(c.setSideBySideRatio,{label:o.__("Set side-by-side ratio"),execute:I=>{Ge.getNumber({title:o.__("Width of the output in side-by-side mode"),value:x.get("sideBySideOutputRatio").composite}).then(N=>{E(N.value),N.value&&x.set("sideBySideOutputRatio",N.value)}).catch(console.error)},describedBy:{args:{type:"object",properties:{}}}}),qe(r,k,w,S,x,B)}).catch(x=>{console.warn(x.message),Ne({editorConfig:e.editorConfig,notebookConfig:e.notebookConfig,kernelShutdown:e.shutdownOnClose,autoStartDefault:e.autoStartDefault}),qe(r,k,w,S,null,B)}),_){const x=_.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");x&&(_.addRenderer("@jupyterlab/notebook-extension:tracker.codeCellConfig",x),_.addRenderer("@jupyterlab/notebook-extension:tracker.markdownCellConfig",x),_.addRenderer("@jupyterlab/notebook-extension:tracker.rawCellConfig",x))}i&&i.restore(k,{command:"docmanager:open",args:x=>({path:x.context.path,factory:$}),name:x=>x.context.path,when:t.ready});const K=r.docRegistry,W=new Oo({disableDocumentWideUndoRedo:e.notebookConfig.disableDocumentWideUndoRedo,collaborative:!0});K.addModelFactory(W),a&&Jn(a,w);let oe=0;const D=r.docRegistry.getFileType("notebook");e.widgetCreated.connect((x,T)=>{var O,P,I;T.id=T.id||`notebook-${++oe}`,T.content.node.setAttribute("data-trust-command",c.trust),T.title.icon=D?.icon,T.title.iconClass=(O=D?.iconClass)!==null&&O!==void 0?O:"",T.title.iconLabel=(P=D?.iconLabel)!==null&&P!==void 0?P:"",T.content.scrollbar=(I=e.notebookConfig.showMinimap)!==null&&I!==void 0?I:!1,T.context.pathChanged.connect(()=>{k.save(T)},T),k.add(T)});function Ne(x){k.forEach(T=>{var O;T.setConfig(x),T.content.scrollbar=(O=x.notebookConfig.showMinimap)!==null&&O!==void 0?O:!1})}function Oe(x){const T={...se.defaultEditorConfig.code,...x.get("codeCellConfig").composite},O={...se.defaultEditorConfig.markdown,...x.get("markdownCellConfig").composite},P={...se.defaultEditorConfig.raw,...x.get("rawCellConfig").composite};e.editorConfig={code:T,markdown:O,raw:P},e.notebookConfig={enableKernelInitNotification:x.get("enableKernelInitNotification").composite,autoRenderMarkdownCells:x.get("autoRenderMarkdownCells").composite,showHiddenCellsButton:x.get("showHiddenCellsButton").composite,scrollPastEnd:x.get("scrollPastEnd").composite,defaultCell:x.get("defaultCell").composite,recordTiming:x.get("recordTiming").composite,overscanCount:x.get("overscanCount").composite,showInputPlaceholder:x.get("showInputPlaceholder").composite,inputHistoryScope:x.get("inputHistoryScope").composite,maxNumberOutputs:x.get("maxNumberOutputs").composite,showEditorForReadOnlyMarkdown:x.get("showEditorForReadOnlyMarkdown").composite,disableDocumentWideUndoRedo:!x.get("documentWideUndoRedo").composite,renderingLayout:x.get("renderingLayout").composite,sideBySideLeftMarginOverride:x.get("sideBySideLeftMarginOverride").composite,sideBySideRightMarginOverride:x.get("sideBySideRightMarginOverride").composite,sideBySideOutputRatio:x.get("sideBySideOutputRatio").composite,windowingMode:x.get("windowingMode").composite,accessKernelHistory:x.get("accessKernelHistory").composite,showMinimap:x.get("showMinimap").composite},E(e.notebookConfig.sideBySideOutputRatio);const I=`.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {
|
|
7
7
|
margin-left: ${e.notebookConfig.sideBySideLeftMarginOverride} !important;
|
|
8
8
|
margin-right: ${e.notebookConfig.sideBySideRightMarginOverride} !important;
|
|
9
|
-
}`,N=document.getElementById(Ve);if(N)N.textContent=I;else{const U=document.createElement("style");U.id=Ve,U.textContent=I,document.head.appendChild(U)}e.autoStartDefault=x.get("autoStartDefaultKernel").composite,e.shutdownOnClose=x.get("kernelShutdown").composite,W.disableDocumentWideUndoRedo=!x.get("documentWideUndoRedo").composite,Ne({editorConfig:e.editorConfig,notebookConfig:e.notebookConfig,kernelShutdown:e.shutdownOnClose,autoStartDefault:e.autoStartDefault})}u&&zn(u,B);const ut=async(x,T,O)=>{const P=await h.execute("docmanager:new-untitled",{path:x,type:"notebook"});if(P!==void 0){const I=await h.execute("docmanager:open",{path:P.path,factory:D,kernel:{id:T,name:O}});return I.isUntitled=!0,I}};return h.addCommand(c.createNew,{label:x=>{var T,O,P;const I=x.kernelName||"";return x.isLauncher&&x.kernelName&&t.kernelspecs?(P=(O=(T=t.kernelspecs.specs)===null||T===void 0?void 0:T.kernelspecs[I])===null||O===void 0?void 0:O.display_name)!==null&&P!==void 0?P:"":x.isPalette||x.isContextMenu?o.__("New Notebook"):o.__("Notebook")},caption:o.__("Create a new notebook"),icon:x=>x.isPalette?void 0:nt,execute:x=>{var T,O;const P=(T=y?.tracker.currentWidget)!==null&&T!==void 0?T:l,I=x.cwd||((O=P?.model.path)!==null&&O!==void 0?O:""),N=x.kernelId||"",U=x.kernelName||"";return ut(I,N,U)},describedBy:{args:{type:"object",properties:{cwd:{type:"string",description:o.__("Current working directory for the new notebook")},kernelId:{type:"string",description:o.__("Kernel ID to use for the new notebook")},kernelName:{type:"string",description:o.__("Kernel name to use for the new notebook")},isLauncher:{type:"boolean",description:o.__("Whether the command is executed from launcher")},isPalette:{type:"boolean",description:o.__("Whether the command is executed from palette")},isContextMenu:{type:"boolean",description:o.__("Whether the command is executed from context menu")}}}}}),p&&t.ready.then(()=>{let x=null;const T=()=>{x&&(x.dispose(),x=null);const O=t.kernelspecs.specs;if(O){x=new ro;for(const P in O.kernelspecs){const I=P===O.default?0:1/0,N=O.kernelspecs[P],U=N.resources["logo-svg"]||N.resources["logo-64x64"];x.add(p.add({command:c.createNew,args:{isLauncher:!0,kernelName:P},category:o.__("Notebook"),rank:I,kernelIconUrl:U,metadata:{kernel:ie.deepCopy(N.metadata||{})}}))}}};T(),t.kernelspecs.specsChanged.connect(T)}),k}function Dn(r,e,n,s,a){if(!n)return;const l=(s??R).load("jupyterlab"),p=a??new Xt;r.commands.addCommand(c.invokeCompleter,{label:l.__("Display the completion helper."),execute:d=>{var g;const b=e.currentWidget;b&&((g=b.content.activeCell)===null||g===void 0?void 0:g.model.type)==="code"&&n.invoke(b.id)},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:l.__("Whether to activate the widget")}}}}}),r.commands.addCommand(c.selectCompleter,{label:l.__("Select the completion suggestion."),execute:()=>{const d=e.currentWidget&&e.currentWidget.id;if(d)return n.select(d)},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:l.__("Whether to activate the widget")}}}}}),r.commands.addKeyBinding({command:c.selectCompleter,keys:["Enter"],selector:".jp-Notebook .jp-mod-completer-active"});const i=new WeakSet,u=async(d,g)=>{var b,f;const _={editor:(f=(b=g.content.activeCell)===null||b===void 0?void 0:b.editor)!==null&&f!==void 0?f:null,session:g.sessionContext.session,widget:g,sanitizer:p};await n.updateCompleter(_),!(g.isDisposed||i.has(g))&&(i.add(g),g.content.activeCellChanged.connect((y,w)=>{w?.ready.then(()=>{const S={editor:w.editor,session:g.sessionContext.session,widget:g,sanitizer:p};return n.updateCompleter(S)}).catch(console.error)}),g.sessionContext.sessionChanged.connect(()=>{var y;(y=g.content.activeCell)===null||y===void 0||y.ready.then(()=>{var w,S;const o={editor:(S=(w=g.content.activeCell)===null||w===void 0?void 0:w.editor)!==null&&S!==void 0?S:null,session:g.sessionContext.session,widget:g};return n.updateCompleter(o)}).catch(console.error)},g))};e.widgetAdded.connect(u),n.activeProvidersChanged.connect(()=>{e.forEach(d=>{u(void 0,d).catch(g=>console.error(g))})})}function $n(r,e,n,s,a,l){e.widgetAdded.connect(async(p,i)=>{const u=new zo(i,{connectionManager:n,featureManager:s,foreignCodeExtractorsManager:a});l.add(u)})}function m(r,e,n){var s,a;let l=null;return n[Fe.WIDGET_ID_ARG]?l=(s=r.find(i=>i.id===n[Fe.WIDGET_ID_ARG]))!==null&&s!==void 0?s:null:n[Ie.WIDGET]?l=(a=r.find(i=>i.id===n[Ie.WIDGET]))!==null&&a!==void 0?a:null:l=r.currentWidget,n.activate!==!1&&l&&e.activateById(l.id),l}function Ue(r){if(!r.model||!r.activeCell)return!1;let e=!1;for(const n of r.widgets)if(r.isSelectedOrActive(n)&&n.model.type==="code"&&(e=!0,!n.outputsScrolled))return!1;return e}function qe(r,e,n,s,a,l){var p;const i=n.load("jupyterlab"),{commands:u,shell:d}=r,g=()=>H.isEnabledAndSingleSelected(d,e),b=o=>{var t,h;for(const C of o.widgets)C instanceof Z&&C.headingCollapsed&&C.getHeadings().then(()=>{C.isDisposed||!C.headingCollapsed||v.setHeadingCollapse(C,!0,o)}).catch(k=>{console.warn("Failed to resolve headings: ",k)}),C.model.id===((h=(t=o.activeCell)===null||t===void 0?void 0:t.model)===null||h===void 0?void 0:h.id)&&v.expandParent(C,o)},f=()=>H.isEnabledAndHeadingSelected(d,e),_=async(o,t)=>{var h;const C=!!(!((h=a?.get("pasteCodeCellsWithoutOutput"))===null||h===void 0)&&h.composite);a?.get("useSystemClipboardForCells").composite?await v.pasteFromSystemClipboard(o,t,{stripOutputs:C}):v.paste(o,t,{stripOutputs:C})},y=new WeakSet;e.currentChanged.connect((o,t)=>{var h,C;!(!((C=(h=t?.content)===null||h===void 0?void 0:h.model)===null||C===void 0)&&C.cells)||y.has(t)||(y.add(t),t.content.model.cells.changed.connect((k,A)=>{b(t.content)},t.content),t.content.activeCellChanged.connect((k,A)=>{v.expandParent(A,k)}))}),e.selectionChanged.connect(()=>{u.notifyCommandChanged(c.duplicateBelow),u.notifyCommandChanged(c.deleteCell),u.notifyCommandChanged(c.copySelectedtext),u.notifyCommandChanged(c.pasteText),u.notifyCommandChanged(c.cutSelectedtext),u.notifyCommandChanged(c.copy),u.notifyCommandChanged(c.cut),u.notifyCommandChanged(c.pasteBelow),u.notifyCommandChanged(c.pasteAbove),u.notifyCommandChanged(c.pasteAndReplace),u.notifyCommandChanged(c.moveUp),u.notifyCommandChanged(c.moveDown),u.notifyCommandChanged(c.run),u.notifyCommandChanged(c.runAll),u.notifyCommandChanged(c.runAndAdvance),u.notifyCommandChanged(c.runAndInsert)}),e.activeCellChanged.connect(()=>{u.notifyCommandChanged(c.deleteCell),u.notifyCommandChanged(c.moveUp),u.notifyCommandChanged(c.moveDown),u.notifyCommandChanged(c.selectLastModifiedCell),u.notifyCommandChanged(c.selectNextModifiedCell)}),e.widgetAdded.connect((o,t)=>{t.content.stateChanged.connect((h,C)=>{C.name==="lastModifiedCellStack"&&(u.notifyCommandChanged(c.selectLastModifiedCell),u.notifyCommandChanged(c.selectNextModifiedCell))})}),u.addCommand(c.runAndAdvance,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run Selected Cell","Run Selected Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run this cell and advance","Run these %1 cells and advance",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAndAdvance(C,h.sessionContext,s,n)}},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?Qe:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.run,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run Selected Cell and Do not Advance","Run Selected Cells and Do not Advance",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.run(C,h.sessionContext,s,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.runAndInsert,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run Selected Cell and Insert Below","Run Selected Cells and Insert Below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAndInsert(C,h.sessionContext,s,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.runAll,{label:i.__("Run All Cells"),caption:i.__("Run all cells"),execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAll(C,h.sessionContext,s,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.runAllAbove,{label:i.__("Run All Above Selected Cell"),execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAllAbove(C,h.sessionContext,s,n)}},isEnabled:()=>g()&&e.currentWidget.content.activeCellIndex!==0,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.runAllBelow,{label:i.__("Run Selected Cell and All Below"),execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAllBelow(C,h.sessionContext,s,n)}},isEnabled:()=>g()&&(e.currentWidget.content.widgets.length===1||e.currentWidget.content.activeCellIndex!==e.currentWidget.content.widgets.length-1),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.renderAllMarkdown,{label:i.__("Render All Markdown Cells"),execute:o=>{const t=m(e,d,o);if(t){const{content:h}=t;return v.renderAllMarkdown(h)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.restart,{label:i.__("Restart Kernel…"),caption:i.__("Restart the kernel"),execute:o=>{const t=m(e,d,o);if(t)return s.restart(t.sessionContext)},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?Qt:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.shutdown,{label:i.__("Shut Down Kernel"),execute:o=>{const t=m(e,d,o);if(t)return t.context.sessionContext.shutdown()},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.closeAndShutdown,{label:i.__("Close and Shut Down Notebook…"),execute:o=>{const t=m(e,d,o);if(!t)return;const h=t.title.label;return tt({title:i.__("Shut down the notebook?"),body:i.__('Are you sure you want to close "%1"?',h),buttons:[ke.cancelButton(),ke.warnButton()]}).then(C=>{if(C.button.accept)return u.execute(c.shutdown,{activate:!1}).then(()=>{t.dispose()})})},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.trust,{label:()=>i.__("Trust Notebook"),execute:async o=>{var t;const h=o[Re.TRUST_BOUNDARY_ID_ARG],C=typeof h=="string"?(t=e.find(k=>k.content.node.id===h))!==null&&t!==void 0?t:null:m(e,d,o);if(C&&!C.isDisposed){const{context:k,content:A}=C,B=await v.trust(A);return B.trusted&&await k.save(),B}return{trusted:!1}},isEnabled:l,describedBy:{args:{type:"object",properties:{[Re.TRUST_BOUNDARY_ID_ARG]:{type:"string",description:i.__("The notebook trust boundary ID")}}}}}),u.addCommand(c.restartClear,{label:i.__("Restart Kernel and Clear Outputs of All Cells…"),caption:i.__("Restart the kernel and clear all outputs of all cells"),execute:async()=>{await u.execute(c.restart,{activate:!1})&&await u.execute(c.clearAllOutputs)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.restartAndRunToSelected,{label:i.__("Restart Kernel and Run up to Selected Cell…"),execute:async o=>{const t=m(e,d,{activate:!1,...o});if(!t)return;const{context:h,content:C}=t,k=C.widgets.slice(0,C.activeCellIndex+1);if(await s.restart(t.sessionContext))return v.runCells(C,k,h.sessionContext,s,n)},isEnabled:g,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.restartRunAll,{label:i.__("Restart Kernel and Run All Cells…"),caption:i.__("Restart the kernel and run all cells"),execute:async o=>{const t=m(e,d,{activate:!1,...o});if(!t)return;const{context:h,content:C}=t,k=C.widgets;if(await s.restart(t.sessionContext))return v.runCells(C,k,h.sessionContext,s,n)},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?et:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.clearAllOutputs,{label:i.__("Clear Outputs of All Cells"),caption:i.__("Clear all outputs of all cells"),execute:o=>{const t=m(e,d,o);if(t)return v.clearAllOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.clearOutputs,{label:i.__("Clear Cell Output"),caption:i.__("Clear outputs for the selected cells"),execute:o=>{const t=m(e,d,o);if(t)return v.clearOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.interrupt,{label:i.__("Interrupt Kernel"),caption:i.__("Interrupt the kernel"),execute:o=>{var t;const h=m(e,d,o);if(!h)return;const C=(t=h.context.sessionContext.session)===null||t===void 0?void 0:t.kernel;if(C)return C.interrupt()},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?eo:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.toCode,{label:i.__("Change to Code Cell Type"),execute:o=>{const t=m(e,d,o);if(t)return v.changeCellType(t.content,"code",n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toMarkdown,{label:i.__("Change to Markdown Cell Type"),execute:o=>{const t=m(e,d,o);if(t)return v.changeCellType(t.content,"markdown",n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toRaw,{label:i.__("Change to Raw Cell Type"),execute:o=>{const t=m(e,d,o);if(t)return v.changeCellType(t.content,"raw",n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.cut,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Cut Cell","Cut Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Cut this cell","Cut these %1 cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return a?.get("useSystemClipboardForCells").composite?await v.cutToSystemClipboard(t.content):v.cut(t.content)},icon:o=>o.toolbar?Ye:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.copy,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Copy Cell","Copy Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Copy this cell","Copy these %1 cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return a?.get("useSystemClipboardForCells").composite?await v.copyToSystemClipboard(t.content):v.copy(t.content)},icon:o=>o.toolbar?Xe:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.pasteBelow,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste Cell Below","Paste Cells Below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return _(t.content,"below")},icon:o=>o.toolbar?Ze:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.pasteAbove,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste Cell Above","Paste Cells Above",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return _(t.content,"above")},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.duplicateBelow,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Duplicate Cell Below","Duplicate Cells Below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Create a duplicate of this cell below","Create duplicates of %1 cells below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);t&&v.duplicate(t.content,"belowSelected")},icon:o=>o.toolbar?to:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.pasteAndReplace,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste Cell and Replace","Paste Cells and Replace",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return _(t.content,"replace")},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.deleteCell,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Delete Cell","Delete Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Delete this cell","Delete these %1 cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t)return v.deleteCells(t.content)},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});return h?((t=h.content.activeCell)===null||t===void 0?void 0:t.model.getMetadata("deletable"))!==!1:!1},describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.copySelectedtext,{label:i.__("Copy Selected Text"),caption:i.__("Copy selected text from the active cell or output area"),execute:async o=>{var t;const h=m(e,d,o);if(!h)return;const C=(t=h.content.activeCell)===null||t===void 0?void 0:t.editor;if(C){const B=C.getSelection(),E=C.getOffsetAt(B.start),j=C.getOffsetAt(B.end),K=C.model.sharedModel.getSource().slice(E,j);if(K){await navigator.clipboard.writeText(K);return}}const k=window.getSelection(),A=k?.toString();A&&A.trim().length>0&&await navigator.clipboard.writeText(A)},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});if(!h)return!1;const C=(t=h.content.activeCell)===null||t===void 0?void 0:t.editor;if(C){const A=C.getSelection();if(A.start.line!==A.end.line||A.start.column!==A.end.column)return!0}const k=window.getSelection();return!!k&&k.toString().trim().length>0},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.cutSelectedtext,{label:i.__("Cut Selected Text"),caption:i.__("Cut selected text from the active cell or output area"),execute:async o=>{var t,h;const C=m(e,d,o);if(!C)return;const k=(t=C.content.activeCell)===null||t===void 0?void 0:t.editor;if(k){const A=k.getSelection(),B=k.getOffsetAt(A.start),E=k.getOffsetAt(A.end),j=k.model.sharedModel.getSource().slice(B,E);if(j){await navigator.clipboard.writeText(j),(h=k.replaceSelection)===null||h===void 0||h.call(k,"");return}}},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});if(!h)return!1;const C=(t=h.content.activeCell)===null||t===void 0?void 0:t.editor;if(!C)return!1;const k=C.getSelection();return k.start.line!==k.end.line||k.start.column!==k.end.column},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.pasteText,{label:i.__("Paste Text"),caption:i.__("Paste text from the clipboard into the active cell editor"),execute:async o=>{var t,h;const C=m(e,d,o);if(!C)return;const k=(t=C.content.activeCell)===null||t===void 0?void 0:t.editor;if(k)try{const A=await navigator.clipboard.readText();A&&((h=k.replaceSelection)===null||h===void 0||h.call(k,A))}catch{oo.showPasteUnavailableDialog(i)}},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});return h?!!(!((t=h.content.activeCell)===null||t===void 0)&&t.editor):!1},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.split,{label:i.__("Split Cell"),execute:o=>{const t=m(e,d,o);if(t)return v.splitCell(t.content,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.merge,{label:i.__("Merge Selected Cells"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=(t=a?.get("addExtraLineOnCellMerge").composite)!==null&&t!==void 0?t:!0;return v.mergeCells(h.content,!1,C,n)}},isVisible:o=>{const t=m(e,d,{...o,activate:!1});if(!t)return!1;const h=t.content;return h&&h.selectedCells.length>1},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.mergeAbove,{label:i.__("Merge Cell Above"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=(t=a?.get("addExtraLineOnCellMerge").composite)!==null&&t!==void 0?t:!0;return v.mergeCells(h.content,!0,C,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.mergeBelow,{label:i.__("Merge Cell Below"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=(t=a?.get("addExtraLineOnCellMerge").composite)!==null&&t!==void 0?t:!0;return v.mergeCells(h.content,!1,C,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.insertAbove,{label:i.__("Insert Cell Above"),caption:i.__("Insert a cell above"),execute:o=>{const t=m(e,d,o);if(t)return v.insertAbove(t.content)},icon:o=>o.toolbar?no:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.insertBelow,{label:i.__("Insert Cell Below"),caption:i.__("Insert a cell below"),execute:o=>{const t=m(e,d,o);if(t)return v.insertBelow(t.content)},icon:o=>o.toolbar?io:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.selectAbove,{label:i.__("Select Cell Above"),execute:o=>{const t=m(e,d,o);if(t)return v.selectAbove(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectBelow,{label:i.__("Select Cell Below"),execute:o=>{const t=m(e,d,o);if(t)return v.selectBelow(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.insertHeadingAbove,{label:i.__("Insert Heading Above Current Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.insertSameLevelHeadingAbove(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.insertHeadingBelow,{label:i.__("Insert Heading Below Current Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.insertSameLevelHeadingBelow(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectHeadingAboveOrCollapse,{label:i.__("Select Heading Above or Collapse Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.selectHeadingAboveOrCollapseHeading(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectHeadingBelowOrExpand,{label:i.__("Select Heading Below or Expand Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.selectHeadingBelowOrExpandHeading(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendAbove,{label:i.__("Extend Selection Above"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionAbove(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendTop,{label:i.__("Extend Selection to Top"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionAbove(t.content,!0)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendBelow,{label:i.__("Extend Selection Below"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionBelow(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendBottom,{label:i.__("Extend Selection to Bottom"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionBelow(t.content,!0)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectAll,{label:i.__("Select All Cells"),execute:o=>{const t=m(e,d,o);if(t)return v.selectAll(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.deselectAll,{label:i.__("Deselect All Cells"),execute:o=>{const t=m(e,d,o);if(t)return v.deselectAll(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.moveUp,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move Cell Up","Move Cells Up",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move this cell up","Move these %1 cells up",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);t&&(v.moveUp(t.content),H.raiseSilentNotification(i.__("Notebook cell shifted up successfully"),t.node))},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});return t?t.content.activeCellIndex>=1:!1},icon:o=>o.toolbar?lo:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.moveDown,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move Cell Down","Move Cells Down",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move this cell down","Move these %1 cells down",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);t&&(v.moveDown(t.content),H.raiseSilentNotification(i.__("Notebook cell shifted down successfully"),t.node))},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});if(!t||!t.content.model)return!1;const h=t.content.model.cells.length;return t.content.activeCellIndex<h-1},icon:o=>o.toolbar?so:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.toggleAllLines,{label:i.__("Show Line Numbers"),execute:o=>{const t=m(e,d,o);if(t)return v.toggleAllLineNumbers(t.content)},isEnabled:l,isToggled:o=>{const t=m(e,d,{...o,activate:!1});if(t){const h=t.content.editorConfig;return!!(h.code.lineNumbers&&h.markdown.lineNumbers&&h.raw.lineNumbers)}else return!1},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.commandMode,{label:i.__("Enter Command Mode"),execute:o=>{const t=m(e,d,o);t&&(t.content.mode="command")},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.editMode,{label:i.__("Enter Edit Mode"),execute:o=>{const t=m(e,d,o);t&&(t.content.mode="edit")},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.undoCellAction,{label:i.__("Undo Cell Operation"),execute:o=>{const t=m(e,d,o);if(t)return v.undo(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.redoCellAction,{label:i.__("Redo Cell Operation"),execute:o=>{const t=m(e,d,o);if(t)return v.redo(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.redo,{label:i.__("Redo"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=h.content.activeCell;if(C)return C.inputHidden=!1,(t=C.editor)===null||t===void 0?void 0:t.redo()}},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.undo,{label:i.__("Undo"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=h.content.activeCell;if(C)return C.inputHidden=!1,(t=C.editor)===null||t===void 0?void 0:t.undo()}},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.changeKernel,{label:i.__("Change Kernel…"),execute:o=>{const t=m(e,d,o);if(t)return s.selectKernel(t.context.sessionContext)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.getKernel,{label:i.__("Get Kernel"),execute:o=>{var t;const h=m(e,d,{activate:!1,...o});if(h)return(t=h.sessionContext.session)===null||t===void 0?void 0:t.kernel},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.reconnectToKernel,{label:i.__("Reconnect to Kernel"),execute:o=>{var t;const h=m(e,d,o);if(!h)return;const C=(t=h.context.sessionContext.session)===null||t===void 0?void 0:t.kernel;if(C)return C.reconnect()},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown1,{label:i.__("Change to Heading 1"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,1,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown2,{label:i.__("Change to Heading 2"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,2,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown3,{label:i.__("Change to Heading 3"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,3,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown4,{label:i.__("Change to Heading 4"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,4,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown5,{label:i.__("Change to Heading 5"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,5,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown6,{label:i.__("Change to Heading 6"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,6,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideCode,{label:i.__("Collapse Selected Code"),execute:o=>{const t=m(e,d,o);if(t)return v.hideCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.showCode,{label:i.__("Expand Selected Code"),execute:o=>{const t=m(e,d,o);if(t)return v.showCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideAllCode,{label:i.__("Collapse All Code"),execute:o=>{const t=m(e,d,o);if(t)return v.hideAllCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.showAllCode,{label:i.__("Expand All Code"),execute:o=>{const t=m(e,d,o);if(t)return v.showAllCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideOutput,{label:i.__("Collapse Selected Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.hideOutput(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.showOutput,{label:i.__("Expand Selected Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.showOutput(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toggleOutput,{label:i.__("Toggle Visibility of Selected Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.toggleOutput(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideAllOutputs,{label:i.__("Collapse All Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.hideAllOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toggleRenderSideBySideCurrentNotebook,{label:i.__("Render Side-by-Side"),execute:o=>{const t=m(e,d,o);if(t)return t.content.renderingLayout==="side-by-side"?v.renderDefault(t.content):v.renderSideBySide(t.content)},isEnabled:l,isToggled:o=>{const t=m(e,d,{...o,activate:!1});return t?t.content.renderingLayout==="side-by-side":!1},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.showAllOutputs,{label:i.__("Expand All Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.showAllOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.enableOutputScrolling,{label:i.__("Enable Scrolling for Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.enableOutputScrolling(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.disableOutputScrolling,{label:i.__("Disable Scrolling for Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.disableOutputScrolling(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toggleOutputScrolling,{label:o=>o.isMenu||o.isPalette?i.__("Enable Scrolling for Outputs"):i.__("Toggle Scrolling for Outputs"),execute:o=>{const t=m(e,d,o);if(t)return Ue(t.content)?v.disableOutputScrolling(t.content):v.enableOutputScrolling(t.content)},isEnabled:l,isToggled:o=>{const t=m(e,d,{...o,activate:!1});return t?Ue(t.content):!1},describedBy:{args:{type:"object",properties:{isMenu:{type:"boolean",description:i.__("Whether the command is called from a menu")}}}}}),u.addCommand(c.selectLastRunCell,{label:i.__("Select current running or last run cell"),execute:o=>{const t=m(e,d,o);if(t)return v.selectLastRunCell(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectLastModifiedCell,{label:i.__("Select Last Modified Cell"),execute:async o=>{const t=m(e,d,o);t&&await v.selectLastModifiedCell(t.content)},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});return!!t&&t.content.hasNavigableModifiedCellBack()},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectNextModifiedCell,{label:i.__("Select Next Modified Cell"),execute:async o=>{const t=m(e,d,o);t&&await v.selectNextModifiedCell(t.content)},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});return!!t&&t.content.hasNavigableModifiedCellForward()},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.replaceSelection,{label:i.__("Replace Selection in Notebook Cell"),execute:o=>{const t=m(e,d,o),h=o.text||"";if(t)return v.replaceSelection(t.content,h)},isEnabled:l,describedBy:{args:{type:"object",properties:{text:{type:"string",description:i.__("Text to replace the selection with")}}}}}),u.addCommand(c.toggleCollapseCmd,{label:i.__("Toggle Collapse Notebook Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.toggleCurrentHeadingCollapse(t.content)},isEnabled:f,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.collapseAllCmd,{label:i.__("Collapse All Headings"),execute:o=>{const t=m(e,d,o);if(t)return v.collapseAllHeadings(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.expandAllCmd,{label:i.__("Expand All Headings"),execute:o=>{const t=m(e,d,o);if(t)return v.expandAllHeadings(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.tocRunCells,{label:i.__("Select and Run Cell(s) for this Heading"),execute:o=>{const t=m(e,d,{activate:!1,...o});if(t===null)return;const h=t.content.activeCell;let C=t.content.activeCellIndex;if(h instanceof Z){const k=t.content.widgets,A=h.headingInfo.level;for(let B=t.content.activeCellIndex+1;B<k.length;B++){const E=k[B];if(E instanceof Z&&E.headingInfo.level>=0&&E.headingInfo.level<=A)break;C=B}}t.content.extendContiguousSelectionTo(C),v.run(t.content,t.sessionContext,s,n)},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.accessPreviousHistory,{label:i.__("Access Previous Kernel History Entry"),execute:async o=>{const t=m(e,d,o);if(t)return await v.accessPreviousHistory(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.accessNextHistory,{label:i.__("Access Next Kernel History Entry"),execute:async o=>{const t=m(e,d,o);if(t)return await v.accessNextHistory(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.virtualScrollbar,{label:i.__("Show Minimap"),caption:i.__("Show Minimap"),execute:o=>{const t=m(e,d,o);t&&(t.content.scrollbar=!t.content.scrollbar)},isEnabled:()=>!!e.currentWidget,isToggled:()=>{var o;const t=e.currentWidget;return(o=t?.content.scrollbar)!==null&&o!==void 0?o:!1},describedBy:{args:{type:"object",properties:{}}}});const w=[c.createNew,c.createOutputView],S=()=>{Object.values(c).filter(o=>!w.includes(o)&&r.commands.hasCommand(o)).forEach(o=>r.commands.notifyCommandChanged(o))};e.currentChanged.connect(S),(p=d.currentChanged)===null||p===void 0||p.connect(S)}function Jn(r,e){const n=e.load("jupyterlab");let s=n.__("Notebook Operations");[c.interrupt,c.restart,c.restartClear,c.restartRunAll,c.runAll,c.renderAllMarkdown,c.runAllAbove,c.runAllBelow,c.restartAndRunToSelected,c.selectAll,c.deselectAll,c.clearAllOutputs,c.toggleAllLines,c.editMode,c.commandMode,c.changeKernel,c.reconnectToKernel,c.createConsole,c.createSubshellConsole,c.closeAndShutdown,c.trust,c.toggleCollapseCmd,c.collapseAllCmd,c.expandAllCmd,c.accessPreviousHistory,c.accessNextHistory,c.virtualScrollbar].forEach(a=>{r.addItem({command:a,category:s})}),r.addItem({command:c.createNew,category:s,args:{isPalette:!0}}),s=n.__("Notebook Cell Operations"),[c.run,c.runAndAdvance,c.runAndInsert,c.runInConsole,c.clearOutputs,c.toCode,c.toMarkdown,c.toRaw,c.cut,c.copy,c.pasteBelow,c.pasteAbove,c.pasteAndReplace,c.deleteCell,c.copySelectedtext,c.pasteText,c.cutSelectedtext,c.split,c.merge,c.mergeAbove,c.mergeBelow,c.insertAbove,c.insertBelow,c.selectAbove,c.selectBelow,c.selectHeadingAboveOrCollapse,c.selectHeadingBelowOrExpand,c.insertHeadingAbove,c.insertHeadingBelow,c.extendAbove,c.extendTop,c.extendBelow,c.extendBottom,c.moveDown,c.moveUp,c.undoCellAction,c.redoCellAction,c.markdown1,c.markdown2,c.markdown3,c.markdown4,c.markdown5,c.markdown6,c.hideCode,c.showCode,c.hideAllCode,c.showAllCode,c.hideOutput,c.showOutput,c.toggleOutput,c.hideAllOutputs,c.showAllOutputs,c.toggleRenderSideBySideCurrentNotebook,c.setSideBySideRatio,c.enableOutputScrolling,c.disableOutputScrolling,c.selectLastModifiedCell,c.selectNextModifiedCell].forEach(a=>{r.addItem({command:a,category:s})})}function zn(r,e){r.editMenu.undoers.redo.add({id:c.redo,isEnabled:e}),r.editMenu.undoers.undo.add({id:c.undo,isEnabled:e}),r.editMenu.clearers.clearAll.add({id:c.clearAllOutputs,isEnabled:e}),r.editMenu.clearers.clearCurrent.add({id:c.clearOutputs,isEnabled:e}),r.fileMenu.consoleCreators.add({id:c.createConsole,isEnabled:e}),r.fileMenu.closeAndCleaners.add({id:c.closeAndShutdown,isEnabled:e}),r.kernelMenu.kernelUsers.changeKernel.add({id:c.changeKernel,isEnabled:e}),r.kernelMenu.kernelUsers.clearWidget.add({id:c.clearAllOutputs,isEnabled:e}),r.kernelMenu.kernelUsers.interruptKernel.add({id:c.interrupt,isEnabled:e}),r.kernelMenu.kernelUsers.reconnectToKernel.add({id:c.reconnectToKernel,isEnabled:e}),r.kernelMenu.kernelUsers.restartKernel.add({id:c.restart,isEnabled:e}),r.kernelMenu.kernelUsers.shutdownKernel.add({id:c.shutdown,isEnabled:e}),r.viewMenu.editorViewers.toggleLineNumbers.add({id:c.toggleAllLines,isEnabled:e}),r.viewMenu.editorViewers.toggleMinimap.add({id:c.virtualScrollbar,isEnabled:()=>!0}),r.runMenu.codeRunners.restart.add({id:c.restart,isEnabled:e}),r.runMenu.codeRunners.run.add({id:c.runAndAdvance,isEnabled:e}),r.runMenu.codeRunners.runAll.add({id:c.runAll,isEnabled:e}),r.helpMenu.getKernel.add({id:c.getKernel,isEnabled:e})}var H;(function(r){function e(u,d,g,b){const f={path:d.context.path,preferredLanguage:d.context.model.defaultKernelLanguage,activate:g,subshell:b,ref:d.id,insertMode:"split-bottom",type:"Linked Console"};return u.execute("console:create",f)}r.createConsole=e;function n(u,d){return d.currentWidget!==null&&d.currentWidget===u.currentWidget}r.isEnabled=n;function s(u,d){if(!r.isEnabled(u,d))return!1;const{content:g}=d.currentWidget,b=g.activeCellIndex;for(let f=0;f<g.widgets.length;++f)if(g.isSelected(g.widgets[f])&&f!==b)return!1;return!0}r.isEnabledAndSingleSelected=s;function a(u,d){if(!r.isEnabled(u,d))return!1;const{content:g}=d.currentWidget,b=g.activeCellIndex;if(!(g.activeCell instanceof Z))return!1;for(let f=0;f<g.widgets.length;++f)if(g.isSelected(g.widgets[f])&&f!==b)return!1;return!0}r.isEnabledAndHeadingSelected=a;function l(u){u=u||R;const d=u.load("jupyterlab");return{html:d.__("HTML"),latex:d.__("LaTeX"),markdown:d.__("Markdown"),pdf:d.__("PDF"),rst:d.__("ReStructured Text"),script:d.__("Executable Script"),slides:d.__("Reveal.js Slides")}}r.getFormatLabels=l;function p(u,d){const g=`sr-message-container-${d.id}`,b=document.getElementById(g)||document.createElement("div");b.getAttribute("id")!==g&&(b.setAttribute("id",g),d.appendChild(b)),b.classList.add("jp-sr-only"),b.setAttribute("role","alert"),b.setAttribute("aria-live","assertive"),b.setAttribute("aria-atomic","true"),b.hidden=!1,b.innerText=u}r.raiseSilentNotification=p;class i extends ao{constructor(d){super(),this._cell=null;const g=(d.translator||R).load("jupyterlab");this._notebook=d.notebook,this._index=d.index!==void 0?d.index:-1,this._cell=d.cell||null,this.id=`LinkedOutputView-${co.uuid4()}`,this.title.label=g.__("Output View"),this.title.icon=nt,this.title.caption=this._notebook.title.label?g.__("For Notebook: %1",this._notebook.title.label):g.__("For Notebook:"),this.addClass("jp-LinkedOutputView"),this._notebook.context.ready.then(()=>{if(this._cell||(this._cell=this._notebook.content.widgets[this._index]),!this._cell||this._cell.model.type!=="code"){this.dispose();return}const b=this._cell.cloneOutputArea();this.addWidget(b)})}get index(){return this._cell?le.findFirstIndex(this._notebook.content.widgets,d=>d===this._cell):this._index}get path(){return this._notebook.context.path}}r.ClonedOutputArea=i})(H||(H={}));export{ct as cellCounterItem,yn as commandEditItem,al as default,xn as executionIndicator,wn as exportPlugin,kn as notebookTrustItem};
|
|
9
|
+
}`,N=document.getElementById(Ve);if(N)N.textContent=I;else{const U=document.createElement("style");U.id=Ve,U.textContent=I,document.head.appendChild(U)}e.autoStartDefault=x.get("autoStartDefaultKernel").composite,e.shutdownOnClose=x.get("kernelShutdown").composite,W.disableDocumentWideUndoRedo=!x.get("documentWideUndoRedo").composite,Ne({editorConfig:e.editorConfig,notebookConfig:e.notebookConfig,kernelShutdown:e.shutdownOnClose,autoStartDefault:e.autoStartDefault})}u&&zn(u,B);const ut=async(x,T,O)=>{const P=await h.execute("docmanager:new-untitled",{path:x,type:"notebook"});if(P!==void 0){const I=await h.execute("docmanager:open",{path:P.path,factory:$,kernel:{id:T,name:O}});return I.isUntitled=!0,I}};return h.addCommand(c.createNew,{label:x=>{var T,O,P;const I=x.kernelName||"";return x.isLauncher&&x.kernelName&&t.kernelspecs?(P=(O=(T=t.kernelspecs.specs)===null||T===void 0?void 0:T.kernelspecs[I])===null||O===void 0?void 0:O.display_name)!==null&&P!==void 0?P:"":x.isPalette||x.isContextMenu?o.__("New Notebook"):o.__("Notebook")},caption:o.__("Create a new notebook"),icon:x=>x.isPalette?void 0:nt,execute:x=>{var T,O;const P=(T=y?.tracker.currentWidget)!==null&&T!==void 0?T:l,I=x.cwd||((O=P?.model.path)!==null&&O!==void 0?O:""),N=x.kernelId||"",U=x.kernelName||"";return ut(I,N,U)},describedBy:{args:{type:"object",properties:{cwd:{type:"string",description:o.__("Current working directory for the new notebook")},kernelId:{type:"string",description:o.__("Kernel ID to use for the new notebook")},kernelName:{type:"string",description:o.__("Kernel name to use for the new notebook")},isLauncher:{type:"boolean",description:o.__("Whether the command is executed from launcher")},isPalette:{type:"boolean",description:o.__("Whether the command is executed from palette")},isContextMenu:{type:"boolean",description:o.__("Whether the command is executed from context menu")}}}}}),p&&t.ready.then(()=>{let x=null;const T=()=>{x&&(x.dispose(),x=null);const O=t.kernelspecs.specs;if(O){x=new ro;for(const P in O.kernelspecs){const I=P===O.default?0:1/0,N=O.kernelspecs[P],U=N.resources["logo-svg"]||N.resources["logo-64x64"];x.add(p.add({command:c.createNew,args:{isLauncher:!0,kernelName:P},category:o.__("Notebook"),rank:I,kernelIconUrl:U,metadata:{kernel:ie.deepCopy(N.metadata||{})}}))}}};T(),t.kernelspecs.specsChanged.connect(T)}),k}function $n(r,e,n,s,a){if(!n)return;const l=(s??R).load("jupyterlab"),p=a??new Xt;r.commands.addCommand(c.invokeCompleter,{label:l.__("Display the completion helper."),execute:d=>{var g;const b=e.currentWidget;b&&((g=b.content.activeCell)===null||g===void 0?void 0:g.model.type)==="code"&&n.invoke(b.id)},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:l.__("Whether to activate the widget")}}}}}),r.commands.addCommand(c.selectCompleter,{label:l.__("Select the completion suggestion."),execute:()=>{const d=e.currentWidget&&e.currentWidget.id;if(d)return n.select(d)},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:l.__("Whether to activate the widget")}}}}}),r.commands.addKeyBinding({command:c.selectCompleter,keys:["Enter"],selector:".jp-Notebook .jp-mod-completer-active"});const i=new WeakSet,u=async(d,g)=>{var b,f;const _={editor:(f=(b=g.content.activeCell)===null||b===void 0?void 0:b.editor)!==null&&f!==void 0?f:null,session:g.sessionContext.session,widget:g,sanitizer:p};await n.updateCompleter(_),!(g.isDisposed||i.has(g))&&(i.add(g),g.content.activeCellChanged.connect((y,w)=>{w?.ready.then(()=>{const S={editor:w.editor,session:g.sessionContext.session,widget:g,sanitizer:p};return n.updateCompleter(S)}).catch(console.error)}),g.sessionContext.sessionChanged.connect(()=>{var y;(y=g.content.activeCell)===null||y===void 0||y.ready.then(()=>{var w,S;const o={editor:(S=(w=g.content.activeCell)===null||w===void 0?void 0:w.editor)!==null&&S!==void 0?S:null,session:g.sessionContext.session,widget:g};return n.updateCompleter(o)}).catch(console.error)},g))};e.widgetAdded.connect(u),n.activeProvidersChanged.connect(()=>{e.forEach(d=>{u(void 0,d).catch(g=>console.error(g))})})}function Dn(r,e,n,s,a,l){e.widgetAdded.connect(async(p,i)=>{const u=new zo(i,{connectionManager:n,featureManager:s,foreignCodeExtractorsManager:a});l.add(u)})}function m(r,e,n){var s,a;let l=null;return n[Fe.WIDGET_ID_ARG]?l=(s=r.find(i=>i.id===n[Fe.WIDGET_ID_ARG]))!==null&&s!==void 0?s:null:n[Ie.WIDGET]?l=(a=r.find(i=>i.id===n[Ie.WIDGET]))!==null&&a!==void 0?a:null:l=r.currentWidget,n.activate!==!1&&l&&e.activateById(l.id),l}function Ue(r){if(!r.model||!r.activeCell)return!1;let e=!1;for(const n of r.widgets)if(r.isSelectedOrActive(n)&&n.model.type==="code"&&(e=!0,!n.outputsScrolled))return!1;return e}function qe(r,e,n,s,a,l){var p;const i=n.load("jupyterlab"),{commands:u,shell:d}=r,g=()=>H.isEnabledAndSingleSelected(d,e),b=o=>{var t,h;for(const C of o.widgets)C instanceof Z&&C.headingCollapsed&&C.getHeadings().then(()=>{C.isDisposed||!C.headingCollapsed||v.setHeadingCollapse(C,!0,o)}).catch(k=>{console.warn("Failed to resolve headings: ",k)}),C.model.id===((h=(t=o.activeCell)===null||t===void 0?void 0:t.model)===null||h===void 0?void 0:h.id)&&v.expandParent(C,o)},f=()=>H.isEnabledAndHeadingSelected(d,e),_=async(o,t)=>{var h;const C=!!(!((h=a?.get("pasteCodeCellsWithoutOutput"))===null||h===void 0)&&h.composite);a?.get("useSystemClipboardForCells").composite?await v.pasteFromSystemClipboard(o,t,{stripOutputs:C}):v.paste(o,t,{stripOutputs:C})},y=new WeakSet;e.currentChanged.connect((o,t)=>{var h,C;!(!((C=(h=t?.content)===null||h===void 0?void 0:h.model)===null||C===void 0)&&C.cells)||y.has(t)||(y.add(t),t.content.model.cells.changed.connect((k,A)=>{b(t.content)},t.content),t.content.activeCellChanged.connect((k,A)=>{v.expandParent(A,k)}))}),e.selectionChanged.connect(()=>{u.notifyCommandChanged(c.duplicateBelow),u.notifyCommandChanged(c.deleteCell),u.notifyCommandChanged(c.copySelectedtext),u.notifyCommandChanged(c.pasteText),u.notifyCommandChanged(c.cutSelectedtext),u.notifyCommandChanged(c.copy),u.notifyCommandChanged(c.cut),u.notifyCommandChanged(c.pasteBelow),u.notifyCommandChanged(c.pasteAbove),u.notifyCommandChanged(c.pasteAndReplace),u.notifyCommandChanged(c.moveUp),u.notifyCommandChanged(c.moveDown),u.notifyCommandChanged(c.run),u.notifyCommandChanged(c.runAll),u.notifyCommandChanged(c.runAndAdvance),u.notifyCommandChanged(c.runAndInsert)}),e.activeCellChanged.connect(()=>{u.notifyCommandChanged(c.deleteCell),u.notifyCommandChanged(c.moveUp),u.notifyCommandChanged(c.moveDown),u.notifyCommandChanged(c.selectLastModifiedCell),u.notifyCommandChanged(c.selectNextModifiedCell)}),e.widgetAdded.connect((o,t)=>{t.content.stateChanged.connect((h,C)=>{C.name==="lastModifiedCellStack"&&(u.notifyCommandChanged(c.selectLastModifiedCell),u.notifyCommandChanged(c.selectNextModifiedCell))})}),u.addCommand(c.runAndAdvance,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run Selected Cell","Run Selected Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run this cell and advance","Run these %1 cells and advance",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAndAdvance(C,h.sessionContext,s,n)}},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?Qe:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.run,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run Selected Cell and Do not Advance","Run Selected Cells and Do not Advance",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.run(C,h.sessionContext,s,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.runAndInsert,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Run Selected Cell and Insert Below","Run Selected Cells and Insert Below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAndInsert(C,h.sessionContext,s,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.runAll,{label:i.__("Run All Cells"),caption:i.__("Run all cells"),execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAll(C,h.sessionContext,s,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.runAllAbove,{label:i.__("Run All Above Selected Cell"),execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAllAbove(C,h.sessionContext,s,n)}},isEnabled:()=>g()&&e.currentWidget.content.activeCellIndex!==0,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.runAllBelow,{label:i.__("Run Selected Cell and All Below"),execute:o=>{const t=m(e,d,o);if(t){const{context:h,content:C}=t;return v.runAllBelow(C,h.sessionContext,s,n)}},isEnabled:()=>g()&&(e.currentWidget.content.widgets.length===1||e.currentWidget.content.activeCellIndex!==e.currentWidget.content.widgets.length-1),describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.renderAllMarkdown,{label:i.__("Render All Markdown Cells"),execute:o=>{const t=m(e,d,o);if(t){const{content:h}=t;return v.renderAllMarkdown(h)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.restart,{label:i.__("Restart Kernel…"),caption:i.__("Restart the kernel"),execute:o=>{const t=m(e,d,o);if(t)return s.restart(t.sessionContext)},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?Qt:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.shutdown,{label:i.__("Shut Down Kernel"),execute:o=>{const t=m(e,d,o);if(t)return t.context.sessionContext.shutdown()},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.closeAndShutdown,{label:i.__("Close and Shut Down Notebook…"),execute:o=>{const t=m(e,d,o);if(!t)return;const h=t.title.label;return tt({title:i.__("Shut down the notebook?"),body:i.__('Are you sure you want to close "%1"?',h),buttons:[ke.cancelButton(),ke.warnButton()]}).then(C=>{if(C.button.accept)return u.execute(c.shutdown,{activate:!1}).then(()=>{t.dispose()})})},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.trust,{label:()=>i.__("Trust Notebook"),execute:async o=>{var t;const h=o[Re.TRUST_BOUNDARY_ID_ARG],C=typeof h=="string"?(t=e.find(k=>k.content.node.id===h))!==null&&t!==void 0?t:null:m(e,d,o);if(C&&!C.isDisposed){const{context:k,content:A}=C,B=await v.trust(A);return B.trusted&&await k.save(),B}return{trusted:!1}},isEnabled:l,describedBy:{args:{type:"object",properties:{[Re.TRUST_BOUNDARY_ID_ARG]:{type:"string",description:i.__("The notebook trust boundary ID")}}}}}),u.addCommand(c.restartClear,{label:i.__("Restart Kernel and Clear Outputs of All Cells…"),caption:i.__("Restart the kernel and clear all outputs of all cells"),execute:async()=>{await u.execute(c.restart,{activate:!1})&&await u.execute(c.clearAllOutputs)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.restartAndRunToSelected,{label:i.__("Restart Kernel and Run up to Selected Cell…"),execute:async o=>{const t=m(e,d,{activate:!1,...o});if(!t)return;const{context:h,content:C}=t,k=C.widgets.slice(0,C.activeCellIndex+1);if(await s.restart(t.sessionContext))return v.runCells(C,k,h.sessionContext,s,n)},isEnabled:g,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.restartRunAll,{label:i.__("Restart Kernel and Run All Cells…"),caption:i.__("Restart the kernel and run all cells"),execute:async o=>{const t=m(e,d,{activate:!1,...o});if(!t)return;const{context:h,content:C}=t,k=C.widgets;if(await s.restart(t.sessionContext))return v.runCells(C,k,h.sessionContext,s,n)},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?et:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.clearAllOutputs,{label:i.__("Clear Outputs of All Cells"),caption:i.__("Clear all outputs of all cells"),execute:o=>{const t=m(e,d,o);if(t)return v.clearAllOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.clearOutputs,{label:i.__("Clear Cell Output"),caption:i.__("Clear outputs for the selected cells"),execute:o=>{const t=m(e,d,o);if(t)return v.clearOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.interrupt,{label:i.__("Interrupt Kernel"),caption:i.__("Interrupt the kernel"),execute:o=>{var t;const h=m(e,d,o);if(!h)return;const C=(t=h.context.sessionContext.session)===null||t===void 0?void 0:t.kernel;if(C)return C.interrupt()},isEnabled:o=>o.toolbar?!0:l(),icon:o=>o.toolbar?eo:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.toCode,{label:i.__("Change to Code Cell Type"),execute:o=>{const t=m(e,d,o);if(t)return v.changeCellType(t.content,"code",n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toMarkdown,{label:i.__("Change to Markdown Cell Type"),execute:o=>{const t=m(e,d,o);if(t)return v.changeCellType(t.content,"markdown",n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toRaw,{label:i.__("Change to Raw Cell Type"),execute:o=>{const t=m(e,d,o);if(t)return v.changeCellType(t.content,"raw",n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.cut,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Cut Cell","Cut Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Cut this cell","Cut these %1 cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return a?.get("useSystemClipboardForCells").composite?await v.cutToSystemClipboard(t.content):v.cut(t.content)},icon:o=>o.toolbar?Ye:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.copy,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Copy Cell","Copy Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Copy this cell","Copy these %1 cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return a?.get("useSystemClipboardForCells").composite?await v.copyToSystemClipboard(t.content):v.copy(t.content)},icon:o=>o.toolbar?Xe:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.pasteBelow,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste Cell Below","Paste Cells Below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return _(t.content,"below")},icon:o=>o.toolbar?Ze:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.pasteAbove,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste Cell Above","Paste Cells Above",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return _(t.content,"above")},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.duplicateBelow,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Duplicate Cell Below","Duplicate Cells Below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Create a duplicate of this cell below","Create duplicates of %1 cells below",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);t&&v.duplicate(t.content,"belowSelected")},icon:o=>o.toolbar?to:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.pasteAndReplace,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Paste Cell and Replace","Paste Cells and Replace",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:async o=>{const t=m(e,d,o);if(t)return _(t.content,"replace")},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.deleteCell,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Delete Cell","Delete Cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Delete this cell","Delete these %1 cells",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);if(t)return v.deleteCells(t.content)},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});return h?((t=h.content.activeCell)===null||t===void 0?void 0:t.model.getMetadata("deletable"))!==!1:!1},describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.copySelectedtext,{label:i.__("Copy Selected Text"),caption:i.__("Copy selected text from the active cell or output area"),execute:async o=>{var t;const h=m(e,d,o);if(!h)return;const C=(t=h.content.activeCell)===null||t===void 0?void 0:t.editor;if(C){const B=C.getSelection(),E=C.getOffsetAt(B.start),j=C.getOffsetAt(B.end),K=C.model.sharedModel.getSource().slice(E,j);if(K){await navigator.clipboard.writeText(K);return}}const k=window.getSelection(),A=k?.toString();A&&A.trim().length>0&&await navigator.clipboard.writeText(A)},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});if(!h)return!1;const C=(t=h.content.activeCell)===null||t===void 0?void 0:t.editor;if(C){const A=C.getSelection();if(A.start.line!==A.end.line||A.start.column!==A.end.column)return!0}const k=window.getSelection();return!!k&&k.toString().trim().length>0},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.cutSelectedtext,{label:i.__("Cut Selected Text"),caption:i.__("Cut selected text from the active cell or output area"),execute:async o=>{var t,h;const C=m(e,d,o);if(!C)return;const k=(t=C.content.activeCell)===null||t===void 0?void 0:t.editor;if(k){const A=k.getSelection(),B=k.getOffsetAt(A.start),E=k.getOffsetAt(A.end),j=k.model.sharedModel.getSource().slice(B,E);if(j){await navigator.clipboard.writeText(j),(h=k.replaceSelection)===null||h===void 0||h.call(k,"");return}}},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});if(!h)return!1;const C=(t=h.content.activeCell)===null||t===void 0?void 0:t.editor;if(!C)return!1;const k=C.getSelection();return k.start.line!==k.end.line||k.start.column!==k.end.column},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.pasteText,{label:i.__("Paste Text"),caption:i.__("Paste text from the clipboard into the active cell editor"),execute:async o=>{var t,h;const C=m(e,d,o);if(!C)return;const k=(t=C.content.activeCell)===null||t===void 0?void 0:t.editor;if(k)try{const A=await navigator.clipboard.readText();A&&((h=k.replaceSelection)===null||h===void 0||h.call(k,A))}catch{oo.showPasteUnavailableDialog(i)}},isEnabled:o=>{var t;const h=m(e,d,{...o,activate:!1});return h?!!(!((t=h.content.activeCell)===null||t===void 0)&&t.editor):!1},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.split,{label:i.__("Split Cell"),execute:o=>{const t=m(e,d,o);if(t)return v.splitCell(t.content,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.merge,{label:i.__("Merge Selected Cells"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=(t=a?.get("addExtraLineOnCellMerge").composite)!==null&&t!==void 0?t:!0;return v.mergeCells(h.content,!1,C,n)}},isVisible:o=>{const t=m(e,d,{...o,activate:!1});if(!t)return!1;const h=t.content;return h&&h.selectedCells.length>1},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.mergeAbove,{label:i.__("Merge Cell Above"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=(t=a?.get("addExtraLineOnCellMerge").composite)!==null&&t!==void 0?t:!0;return v.mergeCells(h.content,!0,C,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.mergeBelow,{label:i.__("Merge Cell Below"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=(t=a?.get("addExtraLineOnCellMerge").composite)!==null&&t!==void 0?t:!0;return v.mergeCells(h.content,!1,C,n)}},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.insertAbove,{label:i.__("Insert Cell Above"),caption:i.__("Insert a cell above"),execute:o=>{const t=m(e,d,o);if(t)return v.insertAbove(t.content)},icon:o=>o.toolbar?no:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.insertBelow,{label:i.__("Insert Cell Below"),caption:i.__("Insert a cell below"),execute:o=>{const t=m(e,d,o);if(t)return v.insertBelow(t.content)},icon:o=>o.toolbar?io:void 0,isEnabled:o=>o.toolbar?!0:l(),describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"}}}}}),u.addCommand(c.selectAbove,{label:i.__("Select Cell Above"),execute:o=>{const t=m(e,d,o);if(t)return v.selectAbove(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectBelow,{label:i.__("Select Cell Below"),execute:o=>{const t=m(e,d,o);if(t)return v.selectBelow(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.insertHeadingAbove,{label:i.__("Insert Heading Above Current Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.insertSameLevelHeadingAbove(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.insertHeadingBelow,{label:i.__("Insert Heading Below Current Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.insertSameLevelHeadingBelow(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectHeadingAboveOrCollapse,{label:i.__("Select Heading Above or Collapse Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.selectHeadingAboveOrCollapseHeading(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectHeadingBelowOrExpand,{label:i.__("Select Heading Below or Expand Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.selectHeadingBelowOrExpandHeading(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendAbove,{label:i.__("Extend Selection Above"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionAbove(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendTop,{label:i.__("Extend Selection to Top"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionAbove(t.content,!0)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendBelow,{label:i.__("Extend Selection Below"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionBelow(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.extendBottom,{label:i.__("Extend Selection to Bottom"),execute:o=>{const t=m(e,d,o);if(t)return v.extendSelectionBelow(t.content,!0)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectAll,{label:i.__("Select All Cells"),execute:o=>{const t=m(e,d,o);if(t)return v.selectAll(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.deselectAll,{label:i.__("Deselect All Cells"),execute:o=>{const t=m(e,d,o);if(t)return v.deselectAll(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.moveUp,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move Cell Up","Move Cells Up",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move this cell up","Move these %1 cells up",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);t&&(v.moveUp(t.content),H.raiseSilentNotification(i.__("Notebook cell shifted up successfully"),t.node))},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});return t?t.content.activeCellIndex>=1:!1},icon:o=>o.toolbar?lo:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.moveDown,{label:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move Cell Down","Move Cells Down",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},caption:o=>{var t;const h=m(e,d,{...o,activate:!1});return i._n("Move this cell down","Move these %1 cells down",(t=h?.content.selectedCells.length)!==null&&t!==void 0?t:1)},execute:o=>{const t=m(e,d,o);t&&(v.moveDown(t.content),H.raiseSilentNotification(i.__("Notebook cell shifted down successfully"),t.node))},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});if(!t||!t.content.model)return!1;const h=t.content.model.cells.length;return t.content.activeCellIndex<h-1},icon:o=>o.toolbar?so:void 0,describedBy:{args:{type:"object",properties:{toolbar:{type:"boolean",description:"Whether the command is being executed from the toolbar"},activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.toggleAllLines,{label:i.__("Show Line Numbers"),execute:o=>{const t=m(e,d,o);if(t)return v.toggleAllLineNumbers(t.content)},isEnabled:l,isToggled:o=>{const t=m(e,d,{...o,activate:!1});if(t){const h=t.content.editorConfig;return!!(h.code.lineNumbers&&h.markdown.lineNumbers&&h.raw.lineNumbers)}else return!1},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.commandMode,{label:i.__("Enter Command Mode"),execute:o=>{const t=m(e,d,o);t&&(t.content.mode="command")},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.editMode,{label:i.__("Enter Edit Mode"),execute:o=>{const t=m(e,d,o);t&&(t.content.mode="edit")},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.undoCellAction,{label:i.__("Undo Cell Operation"),execute:o=>{const t=m(e,d,o);if(t)return v.undo(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.redoCellAction,{label:i.__("Redo Cell Operation"),execute:o=>{const t=m(e,d,o);if(t)return v.redo(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.redo,{label:i.__("Redo"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=h.content.activeCell;if(C)return C.inputHidden=!1,(t=C.editor)===null||t===void 0?void 0:t.redo()}},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.undo,{label:i.__("Undo"),execute:o=>{var t;const h=m(e,d,o);if(h){const C=h.content.activeCell;if(C)return C.inputHidden=!1,(t=C.editor)===null||t===void 0?void 0:t.undo()}},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.changeKernel,{label:i.__("Change Kernel…"),execute:o=>{const t=m(e,d,o);if(t)return s.selectKernel(t.context.sessionContext)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.getKernel,{label:i.__("Get Kernel"),execute:o=>{var t;const h=m(e,d,{activate:!1,...o});if(h)return(t=h.sessionContext.session)===null||t===void 0?void 0:t.kernel},isEnabled:l,describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.reconnectToKernel,{label:i.__("Reconnect to Kernel"),execute:o=>{var t;const h=m(e,d,o);if(!h)return;const C=(t=h.context.sessionContext.session)===null||t===void 0?void 0:t.kernel;if(C)return C.reconnect()},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown1,{label:i.__("Change to Heading 1"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,1,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown2,{label:i.__("Change to Heading 2"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,2,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown3,{label:i.__("Change to Heading 3"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,3,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown4,{label:i.__("Change to Heading 4"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,4,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown5,{label:i.__("Change to Heading 5"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,5,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.markdown6,{label:i.__("Change to Heading 6"),execute:o=>{const t=m(e,d,o);if(t)return v.setMarkdownHeader(t.content,6,n)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideCode,{label:i.__("Collapse Selected Code"),execute:o=>{const t=m(e,d,o);if(t)return v.hideCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.showCode,{label:i.__("Expand Selected Code"),execute:o=>{const t=m(e,d,o);if(t)return v.showCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideAllCode,{label:i.__("Collapse All Code"),execute:o=>{const t=m(e,d,o);if(t)return v.hideAllCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.showAllCode,{label:i.__("Expand All Code"),execute:o=>{const t=m(e,d,o);if(t)return v.showAllCode(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideOutput,{label:i.__("Collapse Selected Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.hideOutput(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.showOutput,{label:i.__("Expand Selected Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.showOutput(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toggleOutput,{label:i.__("Toggle Visibility of Selected Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.toggleOutput(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.hideAllOutputs,{label:i.__("Collapse All Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.hideAllOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toggleRenderSideBySideCurrentNotebook,{label:i.__("Render Side-by-Side"),execute:o=>{const t=m(e,d,o);if(t)return t.content.renderingLayout==="side-by-side"?v.renderDefault(t.content):v.renderSideBySide(t.content)},isEnabled:l,isToggled:o=>{const t=m(e,d,{...o,activate:!1});return t?t.content.renderingLayout==="side-by-side":!1},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.showAllOutputs,{label:i.__("Expand All Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.showAllOutputs(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.enableOutputScrolling,{label:i.__("Enable Scrolling for Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.enableOutputScrolling(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.disableOutputScrolling,{label:i.__("Disable Scrolling for Outputs"),execute:o=>{const t=m(e,d,o);if(t)return v.disableOutputScrolling(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.toggleOutputScrolling,{label:o=>o.isMenu||o.isPalette?i.__("Enable Scrolling for Outputs"):i.__("Toggle Scrolling for Outputs"),execute:o=>{const t=m(e,d,o);if(t)return Ue(t.content)?v.disableOutputScrolling(t.content):v.enableOutputScrolling(t.content)},isEnabled:l,isToggled:o=>{const t=m(e,d,{...o,activate:!1});return t?Ue(t.content):!1},describedBy:{args:{type:"object",properties:{isMenu:{type:"boolean",description:i.__("Whether the command is called from a menu")}}}}}),u.addCommand(c.selectLastRunCell,{label:i.__("Select current running or last run cell"),execute:o=>{const t=m(e,d,o);if(t)return v.selectLastRunCell(t.content)},isEnabled:l,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectLastModifiedCell,{label:i.__("Select Last Modified Cell"),execute:async o=>{const t=m(e,d,o);t&&await v.selectLastModifiedCell(t.content)},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});return!!t&&t.content.hasNavigableModifiedCellBack()},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.selectNextModifiedCell,{label:i.__("Select Next Modified Cell"),execute:async o=>{const t=m(e,d,o);t&&await v.selectNextModifiedCell(t.content)},isEnabled:o=>{const t=m(e,d,{...o,activate:!1});return!!t&&t.content.hasNavigableModifiedCellForward()},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.replaceSelection,{label:i.__("Replace Selection in Notebook Cell"),execute:o=>{const t=m(e,d,o),h=o.text||"";if(t)return v.replaceSelection(t.content,h)},isEnabled:l,describedBy:{args:{type:"object",properties:{text:{type:"string",description:i.__("Text to replace the selection with")}}}}}),u.addCommand(c.toggleCollapseCmd,{label:i.__("Toggle Collapse Notebook Heading"),execute:o=>{const t=m(e,d,o);if(t)return v.toggleCurrentHeadingCollapse(t.content)},isEnabled:f,describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.collapseAllCmd,{label:i.__("Collapse All Headings"),execute:o=>{const t=m(e,d,o);if(t)return v.collapseAllHeadings(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.expandAllCmd,{label:i.__("Expand All Headings"),execute:o=>{const t=m(e,d,o);if(t)return v.expandAllHeadings(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.tocRunCells,{label:i.__("Select and Run Cell(s) for this Heading"),execute:o=>{const t=m(e,d,{activate:!1,...o});if(t===null)return;const h=t.content.activeCell;let C=t.content.activeCellIndex;if(h instanceof Z){const k=t.content.widgets,A=h.headingInfo.level;for(let B=t.content.activeCellIndex+1;B<k.length;B++){const E=k[B];if(E instanceof Z&&E.headingInfo.level>=0&&E.headingInfo.level<=A)break;C=B}}t.content.extendContiguousSelectionTo(C),v.run(t.content,t.sessionContext,s,n)},describedBy:{args:{type:"object",properties:{activate:{type:"boolean",description:i.__("Whether to activate the notebook after execution")}}}}}),u.addCommand(c.accessPreviousHistory,{label:i.__("Access Previous Kernel History Entry"),execute:async o=>{const t=m(e,d,o);if(t)return await v.accessPreviousHistory(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.accessNextHistory,{label:i.__("Access Next Kernel History Entry"),execute:async o=>{const t=m(e,d,o);if(t)return await v.accessNextHistory(t.content)},describedBy:{args:{type:"object",properties:{}}}}),u.addCommand(c.virtualScrollbar,{label:i.__("Show Minimap"),caption:i.__("Show Minimap"),execute:o=>{const t=m(e,d,o);t&&(t.content.scrollbar=!t.content.scrollbar)},isEnabled:()=>!!e.currentWidget,isToggled:()=>{var o;const t=e.currentWidget;return(o=t?.content.scrollbar)!==null&&o!==void 0?o:!1},describedBy:{args:{type:"object",properties:{}}}});const w=[c.createNew,c.createOutputView],S=()=>{Object.values(c).filter(o=>!w.includes(o)&&r.commands.hasCommand(o)).forEach(o=>r.commands.notifyCommandChanged(o))};e.currentChanged.connect(S),(p=d.currentChanged)===null||p===void 0||p.connect(S)}function Jn(r,e){const n=e.load("jupyterlab");let s=n.__("Notebook Operations");[c.interrupt,c.restart,c.restartClear,c.restartRunAll,c.runAll,c.renderAllMarkdown,c.runAllAbove,c.runAllBelow,c.restartAndRunToSelected,c.selectAll,c.deselectAll,c.clearAllOutputs,c.toggleAllLines,c.editMode,c.commandMode,c.changeKernel,c.reconnectToKernel,c.createConsole,c.createSubshellConsole,c.closeAndShutdown,c.trust,c.toggleCollapseCmd,c.collapseAllCmd,c.expandAllCmd,c.accessPreviousHistory,c.accessNextHistory,c.virtualScrollbar].forEach(a=>{r.addItem({command:a,category:s})}),r.addItem({command:c.createNew,category:s,args:{isPalette:!0}}),s=n.__("Notebook Cell Operations"),[c.run,c.runAndAdvance,c.runAndInsert,c.runInConsole,c.clearOutputs,c.toCode,c.toMarkdown,c.toRaw,c.cut,c.copy,c.pasteBelow,c.pasteAbove,c.pasteAndReplace,c.deleteCell,c.copySelectedtext,c.pasteText,c.cutSelectedtext,c.split,c.merge,c.mergeAbove,c.mergeBelow,c.insertAbove,c.insertBelow,c.selectAbove,c.selectBelow,c.selectHeadingAboveOrCollapse,c.selectHeadingBelowOrExpand,c.insertHeadingAbove,c.insertHeadingBelow,c.extendAbove,c.extendTop,c.extendBelow,c.extendBottom,c.moveDown,c.moveUp,c.undoCellAction,c.redoCellAction,c.markdown1,c.markdown2,c.markdown3,c.markdown4,c.markdown5,c.markdown6,c.hideCode,c.showCode,c.hideAllCode,c.showAllCode,c.hideOutput,c.showOutput,c.toggleOutput,c.hideAllOutputs,c.showAllOutputs,c.toggleRenderSideBySideCurrentNotebook,c.setSideBySideRatio,c.enableOutputScrolling,c.disableOutputScrolling,c.selectLastModifiedCell,c.selectNextModifiedCell].forEach(a=>{r.addItem({command:a,category:s})})}function zn(r,e){r.editMenu.undoers.redo.add({id:c.redo,isEnabled:e}),r.editMenu.undoers.undo.add({id:c.undo,isEnabled:e}),r.editMenu.clearers.clearAll.add({id:c.clearAllOutputs,isEnabled:e}),r.editMenu.clearers.clearCurrent.add({id:c.clearOutputs,isEnabled:e}),r.fileMenu.consoleCreators.add({id:c.createConsole,isEnabled:e}),r.fileMenu.closeAndCleaners.add({id:c.closeAndShutdown,isEnabled:e}),r.kernelMenu.kernelUsers.changeKernel.add({id:c.changeKernel,isEnabled:e}),r.kernelMenu.kernelUsers.clearWidget.add({id:c.clearAllOutputs,isEnabled:e}),r.kernelMenu.kernelUsers.interruptKernel.add({id:c.interrupt,isEnabled:e}),r.kernelMenu.kernelUsers.reconnectToKernel.add({id:c.reconnectToKernel,isEnabled:e}),r.kernelMenu.kernelUsers.restartKernel.add({id:c.restart,isEnabled:e}),r.kernelMenu.kernelUsers.shutdownKernel.add({id:c.shutdown,isEnabled:e}),r.viewMenu.editorViewers.toggleLineNumbers.add({id:c.toggleAllLines,isEnabled:e}),r.viewMenu.editorViewers.toggleMinimap.add({id:c.virtualScrollbar,isEnabled:()=>!0}),r.runMenu.codeRunners.restart.add({id:c.restart,isEnabled:e}),r.runMenu.codeRunners.run.add({id:c.runAndAdvance,isEnabled:e}),r.runMenu.codeRunners.runAll.add({id:c.runAll,isEnabled:e}),r.helpMenu.getKernel.add({id:c.getKernel,isEnabled:e})}var H;(function(r){function e(u,d,g,b){const f={path:d.context.path,preferredLanguage:d.context.model.defaultKernelLanguage,activate:g,subshell:b,ref:d.id,insertMode:"split-bottom",type:"Linked Console"};return u.execute("console:create",f)}r.createConsole=e;function n(u,d){return d.currentWidget!==null&&d.currentWidget===u.currentWidget}r.isEnabled=n;function s(u,d){if(!r.isEnabled(u,d))return!1;const{content:g}=d.currentWidget,b=g.activeCellIndex;for(let f=0;f<g.widgets.length;++f)if(g.isSelected(g.widgets[f])&&f!==b)return!1;return!0}r.isEnabledAndSingleSelected=s;function a(u,d){if(!r.isEnabled(u,d))return!1;const{content:g}=d.currentWidget,b=g.activeCellIndex;if(!(g.activeCell instanceof Z))return!1;for(let f=0;f<g.widgets.length;++f)if(g.isSelected(g.widgets[f])&&f!==b)return!1;return!0}r.isEnabledAndHeadingSelected=a;function l(u){u=u||R;const d=u.load("jupyterlab");return{html:d.__("HTML"),latex:d.__("LaTeX"),markdown:d.__("Markdown"),pdf:d.__("PDF"),rst:d.__("ReStructured Text"),script:d.__("Executable Script"),slides:d.__("Reveal.js Slides")}}r.getFormatLabels=l;function p(u,d){const g=`sr-message-container-${d.id}`,b=document.getElementById(g)||document.createElement("div");b.getAttribute("id")!==g&&(b.setAttribute("id",g),d.appendChild(b)),b.classList.add("jp-sr-only"),b.setAttribute("role","alert"),b.setAttribute("aria-live","assertive"),b.setAttribute("aria-atomic","true"),b.hidden=!1,b.innerText=u}r.raiseSilentNotification=p;class i extends ao{constructor(d){super(),this._cell=null;const g=(d.translator||R).load("jupyterlab");this._notebook=d.notebook,this._index=d.index!==void 0?d.index:-1,this._cell=d.cell||null,this.id=`LinkedOutputView-${co.uuid4()}`,this.title.label=g.__("Output View"),this.title.icon=nt,this.title.caption=this._notebook.title.label?g.__("For Notebook: %1",this._notebook.title.label):g.__("For Notebook:"),this.addClass("jp-LinkedOutputView"),this._notebook.context.ready.then(()=>{if(this._cell||(this._cell=this._notebook.content.widgets[this._index]),!this._cell||this._cell.model.type!=="code"){this.dispose();return}const b=this._cell.cloneOutputArea();this.addWidget(b)})}get index(){return this._cell?le.findFirstIndex(this._notebook.content.widgets,d=>d===this._cell):this._index}get path(){return this._notebook.context.path}}r.ClonedOutputArea=i})(H||(H={}));export{ct as cellCounterItem,yn as commandEditItem,al as default,xn as executionIndicator,wn as exportPlugin,kn as notebookTrustItem};
|