@datalayer/agent-runtimes 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/dist-embed/chunks/{AgentDetails-Bo0dD1KS.js → AgentDetails-KezohVQI.js} +1 -1
  2. package/dist-embed/chunks/{AgentDetailsDialog-JjCHYxMG.js → AgentDetailsDialog-CklhMnk7.js} +1 -1
  3. package/dist-embed/chunks/{AgentInspector-37Onz4of.js → AgentInspector-CtCaRc1L.js} +1 -1
  4. package/dist-embed/chunks/{AgentInspectorDialog-CCzGVAtX.js → AgentInspectorDialog-DB9cx3Gd.js} +1 -1
  5. package/dist-embed/chunks/Avatar-9MpXENSs.js +1 -0
  6. package/dist-embed/chunks/{CellSidebarExtension-CQlXdanG.js → CellSidebarExtension-CfaJL6DQ.js} +6 -6
  7. package/dist-embed/chunks/{ChatView-CaBuPTyG.js → ChatView-B3QqHhAP.js} +4 -4
  8. package/dist-embed/chunks/{ContextPie-DBIUoPrq.js → ContextPie-1vP4f-3N.js} +1 -1
  9. package/dist-embed/chunks/DatalayerAgentBridge-D54Z9BZ3.js +1 -0
  10. package/dist-embed/chunks/{DeckComponent-cRJJMGgt.js → DeckComponent-82GVdsoi.js} +2 -2
  11. package/dist-embed/chunks/{DocumentView-CiqN9ze6.js → DocumentView-SrJloJDo.js} +2 -2
  12. package/dist-embed/chunks/{EphemeralDocument-BjJfn7J-.js → EphemeralDocument-t1KulOH8.js} +1 -1
  13. package/dist-embed/chunks/{EphemeralNotebook-DbS4f6yr.js → EphemeralNotebook-Co-WQWCc.js} +2 -2
  14. package/dist-embed/chunks/{ExcalidrawComponent-BtNXWUN8.js → ExcalidrawComponent-5NeLUYVB.js} +1 -1
  15. package/dist-embed/chunks/{ExcalidrawModal-C6SEKFlD.js → ExcalidrawModal-9ZnOB03n.js} +1 -1
  16. package/dist-embed/chunks/{JupyterLexicalExtension-BuRLImy5.js → JupyterLexicalExtension-Cize8RXy.js} +29 -29
  17. package/dist-embed/chunks/{KernelVariables-KCUfxhF4.js → KernelVariables-Cl57Zze1.js} +2 -2
  18. package/dist-embed/chunks/{LexicalToolRegistry-CXLITkMD.js → LexicalToolRegistry-CoM9ROsx.js} +3 -3
  19. package/dist-embed/chunks/{NotebookSkeleton-HdM76lOj.js → NotebookSkeleton-CI7ovjNW.js} +1 -1
  20. package/dist-embed/chunks/{NotebookToolSurfaces-ktcGRm7d.js → NotebookToolSurfaces-CWfppxBN.js} +1 -1
  21. package/dist-embed/chunks/{NotebookToolbar-DMKCe3c2.js → NotebookToolbar-rtMQZWHQ.js} +1 -1
  22. package/dist-embed/chunks/{NotebookView-Pps9dPZ7.js → NotebookView-DOf_K74b.js} +1 -1
  23. package/dist-embed/chunks/{Output-BscOPLqE.js → Output-9DKTscSv.js} +1 -1
  24. package/dist-embed/chunks/{SandboxDetailsDialog-pkvlbdM2.js → SandboxDetailsDialog-BCfDm6MB.js} +1 -1
  25. package/dist-embed/chunks/{SchemaForm-Bqor7hh8.js → SchemaForm-BOYPrvf8.js} +1 -1
  26. package/dist-embed/chunks/{Toolbar-6Hdi_m3T.js → Toolbar-CGQDY041.js} +1 -1
  27. package/dist-embed/chunks/{WidgetVariableView-CJTAKqh1.js → WidgetVariableView-BTOwHP78.js} +1 -1
  28. package/dist-embed/chunks/YouTubePlugin-Bs4zZIB1.js +1 -0
  29. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-CWj4pFxo.js → abnfDiagram-VCTEODGH-D5p59vS_.js} +1 -1
  30. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-B4x7mfou.js → abnfDiagram-VCTEODGH-DRYbUvhc.js} +1 -1
  31. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-BB82iKLz.js → ar-SA-G6X2FPQ2-D6XRzkBS.js} +1 -1
  32. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-CRIN999O.js → architectureDiagram-5GKGNRK7-B7ITKDup.js} +1 -1
  33. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-B2D6lZbf.js → architectureDiagram-5GKGNRK7-DQGv0imf.js} +1 -1
  34. package/dist-embed/chunks/{az-AZ-76LH7QW2-DsMRKXlw.js → az-AZ-76LH7QW2-DBTdUiqp.js} +1 -1
  35. package/dist-embed/chunks/{bg-BG-XCXSNQG7-43Y1kPxa.js → bg-BG-XCXSNQG7-DuhcsaSL.js} +1 -1
  36. package/dist-embed/chunks/{blockDiagram-868be97b-bBp9uGVj.js → blockDiagram-868be97b-DYe-XTjy.js} +1 -1
  37. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-DNdo_mUi.js → blockDiagram-I7D4REHJ-IltJXCd6.js} +1 -1
  38. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-CPHEppLa.js → blockDiagram-I7D4REHJ-y7tEFo3j.js} +1 -1
  39. package/dist-embed/chunks/{bn-BD-2XOGV67Q-CLqPJBll.js → bn-BD-2XOGV67Q-CPFeLVSN.js} +1 -1
  40. package/dist-embed/chunks/{c4Diagram-3f4bdde3-cYZlcE7E.js → c4Diagram-3f4bdde3-Bybp0wky.js} +1 -1
  41. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-DTmVwmmb.js → c4Diagram-7LVT6UL2-CizxVqqX.js} +1 -1
  42. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BM2g5U7R.js → c4Diagram-7LVT6UL2-DpaHndz8.js} +1 -1
  43. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-CDFGSEh3.js → ca-ES-6MX7JW3Y-gDR_kEC6.js} +1 -1
  44. package/dist-embed/chunks/{celltoolbartracker-D67W4XWx.js → celltoolbartracker-DLF4PWyW.js} +1 -1
  45. package/dist-embed/chunks/{chunk-2Q5K7J3B-CsB-r261.js → chunk-2Q5K7J3B-BI6lURun.js} +1 -1
  46. package/dist-embed/chunks/{chunk-2Q5K7J3B-CuegvedF.js → chunk-2Q5K7J3B-DWoLSrj9.js} +1 -1
  47. package/dist-embed/chunks/{chunk-5VM5RSS4-D4Ed2_vW.js → chunk-5VM5RSS4-CDh4wYym.js} +1 -1
  48. package/dist-embed/chunks/{chunk-5VM5RSS4-MJQ9uhYe.js → chunk-5VM5RSS4-SleuNqDC.js} +1 -1
  49. package/dist-embed/chunks/{chunk-F27PBJKO-DnjXjdOV.js → chunk-F27PBJKO-AvWsNGYY.js} +1 -1
  50. package/dist-embed/chunks/{chunk-F27PBJKO-BKTrewOm.js → chunk-F27PBJKO-h_FwJMTr.js} +1 -1
  51. package/dist-embed/chunks/{chunk-IMKFNOWR-Bf7PlvQM.js → chunk-IMKFNOWR-DGRceKiU.js} +1 -1
  52. package/dist-embed/chunks/{chunk-IMKFNOWR-BiXdYxxk.js → chunk-IMKFNOWR-Hx4a5yny.js} +1 -1
  53. package/dist-embed/chunks/{chunk-JWPE2WC7-DcVyhh3j.js → chunk-JWPE2WC7-A4gy2qc4.js} +1 -1
  54. package/dist-embed/chunks/{chunk-JWPE2WC7-DmWR08qa.js → chunk-JWPE2WC7-BuJactJo.js} +1 -1
  55. package/dist-embed/chunks/{chunk-POPQ4Y6H-Bw6JH9TT.js → chunk-POPQ4Y6H-CFM-817s.js} +1 -1
  56. package/dist-embed/chunks/{chunk-POPQ4Y6H-snvBGTqY.js → chunk-POPQ4Y6H-CmRF80iG.js} +1 -1
  57. package/dist-embed/chunks/{chunk-SVP7TREG-DLZdx--b.js → chunk-SVP7TREG-CryZx9JE.js} +1 -1
  58. package/dist-embed/chunks/{chunk-SVP7TREG-dE58fUkJ.js → chunk-SVP7TREG-DSNzmytH.js} +1 -1
  59. package/dist-embed/chunks/{chunk-TICWLB2K-DNXzQOV5.js → chunk-TICWLB2K-CEaDF8ZJ.js} +1 -1
  60. package/dist-embed/chunks/{chunk-TICWLB2K-4NdGhPfF.js → chunk-TICWLB2K-DyGS3fIj.js} +1 -1
  61. package/dist-embed/chunks/{chunk-XXDRQBXY-OKsVfhjO.js → chunk-XXDRQBXY-8Cnzpdjz.js} +1 -1
  62. package/dist-embed/chunks/{chunk-XXDRQBXY-D57w8SHP.js → chunk-XXDRQBXY-DxQBcVOz.js} +1 -1
  63. package/dist-embed/chunks/{classDiagram-ZZMXUADV-oYXGLbJe.js → classDiagram-ZZMXUADV-BQkO1UYr.js} +1 -1
  64. package/dist-embed/chunks/{classDiagram-ZZMXUADV-D35oEC_r.js → classDiagram-ZZMXUADV-yvP3zMO3.js} +1 -1
  65. package/dist-embed/chunks/{classDiagram-f62afe4f-DWY2Ws4r.js → classDiagram-f62afe4f-AYfpYKtp.js} +1 -1
  66. package/dist-embed/chunks/{classDiagram-v2-604399ef-By5ijR28.js → classDiagram-v2-604399ef-BWyNcT_y.js} +1 -1
  67. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-oYXGLbJe.js → classDiagram-v2-VYDZK3BY-BQkO1UYr.js} +1 -1
  68. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-D35oEC_r.js → classDiagram-v2-VYDZK3BY-yvP3zMO3.js} +1 -1
  69. package/dist-embed/chunks/{code-block-IT6T5CEO-DvUhQbDq.js → code-block-IT6T5CEO-F4BSIGY6.js} +1 -1
  70. package/dist-embed/chunks/{component-DquJEKgN.js → component-DMQ8W8n1.js} +3 -3
  71. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-j33onHvG.js → cose-bilkent-JH36ORCC-C3HC0XIY.js} +1 -1
  72. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-CfuJvtzg.js → cose-bilkent-JH36ORCC-MVxlcfpd.js} +1 -1
  73. package/dist-embed/chunks/{createText-aed3d8b3-DvlG46OI.js → createText-aed3d8b3-CEJODAXJ.js} +1 -1
  74. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-ByNB8eZd.js → cs-CZ-2BRQDIVT-BXQxcYp6.js} +1 -1
  75. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-YhGHtmc4.js → cynefinDiagram-5FMLGOSQ-D87ENxS0.js} +1 -1
  76. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-CPb2yRsU.js → cynefinDiagram-5FMLGOSQ-DNRKTIHx.js} +1 -1
  77. package/dist-embed/chunks/{da-DK-5WZEPLOC-B7MrVwy8.js → da-DK-5WZEPLOC-Ck3vidj3.js} +1 -1
  78. package/dist-embed/chunks/{dagre-GXQ25YYZ-CSSSVwOB.js → dagre-GXQ25YYZ-BOhThFKd.js} +1 -1
  79. package/dist-embed/chunks/{dagre-GXQ25YYZ-bjTeZGWE.js → dagre-GXQ25YYZ-DscCD5Uq.js} +1 -1
  80. package/dist-embed/chunks/{de-DE-XR44H4JA-CN1cdk94.js → de-DE-XR44H4JA-CPZgrOuc.js} +1 -1
  81. package/dist-embed/chunks/{diagram-S7CK7UJ4-CFdSwdyc.js → diagram-S7CK7UJ4-CUhme3Bl.js} +1 -1
  82. package/dist-embed/chunks/{diagram-S7CK7UJ4-CFDVHfda.js → diagram-S7CK7UJ4-zDQduoQy.js} +1 -1
  83. package/dist-embed/chunks/{diagram-UQ7AKVKN-DDaeau23.js → diagram-UQ7AKVKN-BxhQPjAM.js} +1 -1
  84. package/dist-embed/chunks/{diagram-UQ7AKVKN-GZbDy6ob.js → diagram-UQ7AKVKN-Byi-v8UN.js} +1 -1
  85. package/dist-embed/chunks/{diagram-VSXAHHWV-nXDiS81a.js → diagram-VSXAHHWV-CqihYkDH.js} +1 -1
  86. package/dist-embed/chunks/{diagram-VSXAHHWV-C6q67wko.js → diagram-VSXAHHWV-au-v2v9D.js} +1 -1
  87. package/dist-embed/chunks/{diagram-VX7I27RA-DQUkfMrD.js → diagram-VX7I27RA-Cd5PaF_n.js} +1 -1
  88. package/dist-embed/chunks/{diagram-VX7I27RA-CYLfpYa4.js → diagram-VX7I27RA-ETzwrw79.js} +1 -1
  89. package/dist-embed/chunks/{diagram-Z3DM3KII-DZziYptV.js → diagram-Z3DM3KII-AcMuRFo5.js} +1 -1
  90. package/dist-embed/chunks/{diagram-Z3DM3KII-v-9naUk_.js → diagram-Z3DM3KII-DkbsvY2A.js} +1 -1
  91. package/dist-embed/chunks/{document-BpXPH_dr.js → document-Dluvp7zl.js} +1 -1
  92. package/dist-embed/chunks/{drivecontents-Bg9_6Kmo.js → drivecontents-CxwZz_5W.js} +1 -1
  93. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-EvDUmZgJ.js → ebnfDiagram-PWID7BFC-BrEs-SB2.js} +1 -1
  94. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-CDmryeYY.js → ebnfDiagram-PWID7BFC-DuWfMZcD.js} +1 -1
  95. package/dist-embed/chunks/{edges-b2856ca0-CTakYT6h.js → edges-b2856ca0-Czd3-xvj.js} +1 -1
  96. package/dist-embed/chunks/{el-GR-BZB4AONW-DnaGhWD1.js → el-GR-BZB4AONW-CjQSkw0P.js} +1 -1
  97. package/dist-embed/chunks/{erDiagram-5d81789a-CpiBBm7t.js → erDiagram-5d81789a-JegaF4gy.js} +1 -1
  98. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-B2QZDDaO.js → erDiagram-RLTQ6QDP-Cpn6_cd1.js} +1 -1
  99. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-hsnql-YF.js → erDiagram-RLTQ6QDP-xubaXuKR.js} +1 -1
  100. package/dist-embed/chunks/{es-ES-U4NZUMDT-DE1vZzDE.js → es-ES-U4NZUMDT-CQz3Tsxk.js} +1 -1
  101. package/dist-embed/chunks/{eu-ES-A7QVB2H4-DmHB0zpm.js → eu-ES-A7QVB2H4-DPwxHXvP.js} +1 -1
  102. package/dist-embed/chunks/{fa-IR-HGAKTJCU-CNzE8tJj.js → fa-IR-HGAKTJCU-DlQyRFJP.js} +1 -1
  103. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-Ca2vTFQC.js → fi-FI-Z5N7JZ37-BL9Dv0rT.js} +1 -1
  104. package/dist-embed/chunks/{flowDb-185abca5-D4uRRPhl.js → flowDb-185abca5-BN_8lgCO.js} +1 -1
  105. package/dist-embed/chunks/{flowDiagram-1629c991-B999anFV.js → flowDiagram-1629c991-YRlRqB59.js} +1 -1
  106. package/dist-embed/chunks/{flowDiagram-HODETNUW-DY4I6lzA.js → flowDiagram-HODETNUW-CzRvxVGK.js} +1 -1
  107. package/dist-embed/chunks/{flowDiagram-HODETNUW-D4E8W9uH.js → flowDiagram-HODETNUW-lW-icIxi.js} +1 -1
  108. package/dist-embed/chunks/{flowDiagram-v2-1d953310-2W9bzV_S.js → flowDiagram-v2-1d953310-DBFSFroi.js} +1 -1
  109. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-Cz-ICcxz.js → flowchart-elk-definition-6df44142-RjL83g27.js} +1 -1
  110. package/dist-embed/chunks/{fr-FR-RHASNOE6-B0yWFX3_.js → fr-FR-RHASNOE6-xB7HyFVv.js} +1 -1
  111. package/dist-embed/chunks/{ganttDiagram-3b0b3873-CR9gwUWB.js → ganttDiagram-3b0b3873-Dowe9cKl.js} +1 -1
  112. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-CoCfE73i.js → ganttDiagram-EL5Y4UJY-CLaynGwe.js} +1 -1
  113. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-cZgkz4jA.js → ganttDiagram-EL5Y4UJY-CNQPBdAP.js} +1 -1
  114. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-CZEgVaQ_.js → gitGraphDiagram-WWUBYQGX-CDuBbPX3.js} +1 -1
  115. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-xXoxdFf9.js → gitGraphDiagram-WWUBYQGX-CupHqYWl.js} +1 -1
  116. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-NdofvPL5.js → gitGraphDiagram-f01e8bc2-C06Sje1n.js} +1 -1
  117. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-2_3FMVJq.js → gl-ES-HMX3MZ6V-BX50ltap.js} +1 -1
  118. package/dist-embed/chunks/{he-IL-6SHJWFNN-BW1lby00.js → he-IL-6SHJWFNN-DR3hLzYG.js} +1 -1
  119. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-DTixfSwB.js → hi-IN-IWLTKZ5I-C3bSDqVc.js} +1 -1
  120. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-DOfYwLWP.js → hu-HU-A5ZG7DT2--mRUDQG6.js} +1 -1
  121. package/dist-embed/chunks/{id-ID-SAP4L64H-Cwtdtkvg.js → id-ID-SAP4L64H-D6psdwdp.js} +1 -1
  122. package/dist-embed/chunks/{index-Dyh5xopp.js → index-3O3ob63z.js} +15 -15
  123. package/dist-embed/chunks/{index-KgE-JGae.js → index-7F_pA42X.js} +4 -4
  124. package/dist-embed/chunks/{index-9bae90f3-D4JbZiwv.js → index-9bae90f3-BY7E8HZU.js} +1 -1
  125. package/dist-embed/chunks/{index-DYkwi0aX.js → index-Azo_wV3K.js} +1 -1
  126. package/dist-embed/chunks/{index-BFPUYxvD.js → index-B063q-PC.js} +4 -4
  127. package/dist-embed/chunks/index-B0KVfQGJ.js +1 -0
  128. package/dist-embed/chunks/{index-BRBFWMMG.js → index-B2He8CnP.js} +1 -1
  129. package/dist-embed/chunks/{index-BAr0Q6NS.js → index-BExwmtFS.js} +1 -1
  130. package/dist-embed/chunks/{index-B3WvcNQa.js → index-BJhxZF_K.js} +1 -1
  131. package/dist-embed/chunks/{index-CXL3UCHy.js → index-BYMZi_1t.js} +1 -1
  132. package/dist-embed/chunks/{index-wovGU2zp.js → index-BblwlEJB.js} +1 -1
  133. package/dist-embed/chunks/{index-DvpdAlVH.js → index-BdvS7Q4t.js} +1 -1
  134. package/dist-embed/chunks/{index-S-sjhoD3.js → index-BhU2ra4k.js} +3 -3
  135. package/dist-embed/chunks/{index-j-oeqTuo.js → index-BipXK1tF.js} +1 -1
  136. package/dist-embed/chunks/{index-B_9UD0bt.js → index-BlWZloLe.js} +3 -3
  137. package/dist-embed/chunks/{index-B-UP9DlM.js → index-BzXMsI1v.js} +1 -1
  138. package/dist-embed/chunks/{index-CPY91aGL.js → index-BzxtV5-v.js} +1 -1
  139. package/dist-embed/chunks/{index-C17RrmNV.js → index-C01nR1dW.js} +1 -1
  140. package/dist-embed/chunks/{index-t_gNTVoL.js → index-C643Hfu1.js} +1 -1
  141. package/dist-embed/chunks/{index-BAwsCLGT.js → index-C6wF35Kk.js} +10 -10
  142. package/dist-embed/chunks/{index--qMT5k1q.js → index-C8IekrmL.js} +1 -1
  143. package/dist-embed/chunks/{index-BxjlpSy4.js → index-C9CpG6Nf.js} +1 -1
  144. package/dist-embed/chunks/{index-BITOMOWN.js → index-CA8D7U2s.js} +2 -2
  145. package/dist-embed/chunks/{index-DEn5R18M.js → index-CUL9WiLS.js} +5 -5
  146. package/dist-embed/chunks/{index-DFEBhySA.js → index-Cknn3VQD.js} +1 -1
  147. package/dist-embed/chunks/{index-BJ7Yskx5.js → index-CpcHHQd7.js} +1 -1
  148. package/dist-embed/chunks/{index-wzK_9qZx.js → index-CvBxCcaE.js} +1 -1
  149. package/dist-embed/chunks/{index-DkUimZI8.js → index-CzXnKkqM.js} +1 -1
  150. package/dist-embed/chunks/{index-Ck-wonpc.js → index-D0DBuFMt.js} +1 -1
  151. package/dist-embed/chunks/{index-CMUTS_sA.js → index-D1lY79hS.js} +4 -4
  152. package/dist-embed/chunks/{index-sQy5cmWo.js → index-DB46n9Tf.js} +2 -2
  153. package/dist-embed/chunks/{index-Cgf7tlW3.js → index-DToDguC3.js} +1 -1
  154. package/dist-embed/chunks/{index-Bi5hexj-.js → index-DVDREi21.js} +1 -1
  155. package/dist-embed/chunks/{index-TRLGqZaF.js → index-DVUMPcVw.js} +1 -1
  156. package/dist-embed/chunks/{index-YcqCoWJl.js → index-DcZQ2Oqj.js} +1 -1
  157. package/dist-embed/chunks/{index-bRwN_nxZ.js → index-DvWWLOj6.js} +1 -1
  158. package/dist-embed/chunks/{index-Clp8quV1.js → index-Dv_XGY6Q.js} +1 -1
  159. package/dist-embed/chunks/{index-C3oDHYfa.js → index-DxsDy6PY.js} +1 -1
  160. package/dist-embed/chunks/{index-Jt4bWLoz.js → index-EpYurdzk.js} +6 -6
  161. package/dist-embed/chunks/{index-CzuLxFBK.js → index-MTdX216X.js} +1 -1
  162. package/dist-embed/chunks/{index-B2OWWcCj.js → index-YqGHzM2S.js} +1 -1
  163. package/dist-embed/chunks/{index-BvvaLLhn.js → index-a51XM5L8.js} +3 -3
  164. package/dist-embed/chunks/{index-CrNfUmIU.js → index-jy9kOmqu.js} +1 -1
  165. package/dist-embed/chunks/{index-e5PkgYFg.js → index-kpqZuE4J.js} +1 -1
  166. package/dist-embed/chunks/{index-BgFbP5P0.js → index-qsUgit40.js} +1 -1
  167. package/dist-embed/chunks/{index-Cq19rGjf.js → index-rfsiH_M6.js} +1 -1
  168. package/dist-embed/chunks/{index-BYQwy0Zx.js → index-s3hayhRS.js} +2 -2
  169. package/dist-embed/chunks/{index.esm-RCuogyl2.js → index.esm-CWygaJYM.js} +1 -1
  170. package/dist-embed/chunks/{index.esm-CVNfNVDy.js → index.esm-DYeUXS4c.js} +1 -1
  171. package/dist-embed/chunks/{infoDiagram-27XIBGKW-DpFWmHEH.js → infoDiagram-27XIBGKW-Ctm-zk09.js} +1 -1
  172. package/dist-embed/chunks/{infoDiagram-27XIBGKW-DRf2y76w.js → infoDiagram-27XIBGKW-DRzH33_4.js} +1 -1
  173. package/dist-embed/chunks/{infoDiagram-a29d40f1-CehVkLUM.js → infoDiagram-a29d40f1-c78-ZMuT.js} +1 -1
  174. package/dist-embed/chunks/{isEqual-BybBNsZK.js → isEqual-niFNV5MZ.js} +1 -1
  175. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-C_d1mmp3.js → ishikawaDiagram-5VMMS53U-CILSTTqm.js} +1 -1
  176. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-B534qRQJ.js → ishikawaDiagram-5VMMS53U-DKv5KL85.js} +1 -1
  177. package/dist-embed/chunks/{it-IT-JPQ66NNP-C3xZ61-6.js → it-IT-JPQ66NNP-BfrG_atL.js} +1 -1
  178. package/dist-embed/chunks/{ja-JP-DBVTYXUO-CeTmglEb.js → ja-JP-DBVTYXUO-sahpmNGY.js} +1 -1
  179. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-DEeA8WJr.js → journeyDiagram-3NMN7TZE-CSMQRlsr.js} +1 -1
  180. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-C0GQLJYz.js → journeyDiagram-3NMN7TZE-DlMPiHSP.js} +1 -1
  181. package/dist-embed/chunks/{journeyDiagram-95396277-Cwx_BI95.js → journeyDiagram-95396277-VzHClVrX.js} +1 -1
  182. package/dist-embed/chunks/{kaa-6HZHGXH3-D6Jr6B6Y.js → kaa-6HZHGXH3-BrkhtXQj.js} +1 -1
  183. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-pEXBqeuG.js → kab-KAB-ZGHBKWFO-DwtFIV_I.js} +1 -1
  184. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-DucvIyR1.js → kanban-definition-UXKFOSKX-BkxvAXq2.js} +1 -1
  185. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-Dww2l0wQ.js → kanban-definition-UXKFOSKX-esf1amn7.js} +1 -1
  186. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-BRJunmHm.js → kk-KZ-P5N5QNE5-UxN1LGH5.js} +1 -1
  187. package/dist-embed/chunks/{km-KH-HSX4SM5Z--GJgT9rN.js → km-KH-HSX4SM5Z-B7lolfpy.js} +1 -1
  188. package/dist-embed/chunks/{ko-KR-MTYHY66A-Bjnez4qR.js → ko-KR-MTYHY66A-CnxefCaN.js} +1 -1
  189. package/dist-embed/chunks/{ku-TR-6OUDTVRD-DgOdYJrS.js → ku-TR-6OUDTVRD-Bt7bmFnv.js} +1 -1
  190. package/dist-embed/chunks/{layout-DiAMrtPi.js → layout-D7Mk1riq.js} +1 -1
  191. package/dist-embed/chunks/{layout-LNJhMVxV.js → layout-Sl9Lf6Ae.js} +1 -1
  192. package/dist-embed/chunks/{lexicalHooks-DEzWXVZY.js → lexicalHooks-DKF-DsxG.js} +1 -1
  193. package/dist-embed/chunks/{lt-LT-XHIRWOB4-BMwhrtjM.js → lt-LT-XHIRWOB4-D6qkXs9m.js} +1 -1
  194. package/dist-embed/chunks/{lv-LV-5QDEKY6T-0pxW7YE0.js → lv-LV-5QDEKY6T-D8g27j86.js} +1 -1
  195. package/dist-embed/chunks/{mermaid.core-huvnfV8t.js → mermaid.core-BhiOhb5K.js} +3 -3
  196. package/dist-embed/chunks/{mermaid.core-Dw1n-Hii.js → mermaid.core-CRlujv29.js} +5 -5
  197. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-DWUezf-k.js → mindmap-definition-YA3MSWOX-BJQsz4H1.js} +1 -1
  198. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-DKQu2lXp.js → mindmap-definition-YA3MSWOX-eCxs0BsL.js} +1 -1
  199. package/dist-embed/chunks/{mindmap-definition-e4c1d938-DSDPusnk.js → mindmap-definition-e4c1d938-DoGG9eDO.js} +1 -1
  200. package/dist-embed/chunks/{model-BHONoBA6.js → model-BziAhKNp.js} +1 -1
  201. package/dist-embed/chunks/{mr-IN-CRQNXWMA-tndp8BXC.js → mr-IN-CRQNXWMA-CMbVGyJm.js} +1 -1
  202. package/dist-embed/chunks/{my-MM-5M5IBNSE-sispDhO4.js → my-MM-5M5IBNSE-B-KPsx1j.js} +1 -1
  203. package/dist-embed/chunks/{nb-NO-T6EIAALU-CjBurOuS.js → nb-NO-T6EIAALU-Cl7QLAt7.js} +1 -1
  204. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-B58EVmr3.js → nl-NL-IS3SIHDZ-Brzte_o2.js} +1 -1
  205. package/dist-embed/chunks/{nn-NO-6E72VCQL-D1p7LZSq.js → nn-NO-6E72VCQL-CzCKEx02.js} +1 -1
  206. package/dist-embed/chunks/{oc-FR-POXYY2M6-C1M8sddP.js → oc-FR-POXYY2M6-DA72PkVY.js} +1 -1
  207. package/dist-embed/chunks/{pa-IN-N4M65BXN-D8ESzASl.js → pa-IN-N4M65BXN-CzkFYtL0.js} +1 -1
  208. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-ChXFZFas.js → pegDiagram-XKGWAZYB-CD3xZvKE.js} +1 -1
  209. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-BUPTGFu3.js → pegDiagram-XKGWAZYB-CV-d6HkK.js} +1 -1
  210. package/dist-embed/chunks/{percentages-BXMCSKIN-BihMTsFR.js → percentages-BXMCSKIN-mjCCp4uI.js} +6 -6
  211. package/dist-embed/chunks/{pica-BQREYloS.js → pica-5TeyVfIV.js} +1 -1
  212. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-DAuVz3z-.js → pieDiagram-E7YTZNPT-DipS--g7.js} +1 -1
  213. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-BORvsKK0.js → pieDiagram-E7YTZNPT-toANOh_O.js} +1 -1
  214. package/dist-embed/chunks/{pieDiagram-c941bede-FM1PHjj3.js → pieDiagram-c941bede-DytniBrW.js} +1 -1
  215. package/dist-embed/chunks/{pl-PL-T2D74RX3-DQGe6LHC.js → pl-PL-T2D74RX3-F4ebFTYK.js} +1 -1
  216. package/dist-embed/chunks/{plugin-BoxsYxwM.js → plugin-Cf3g-jak.js} +1 -1
  217. package/dist-embed/chunks/plugin-DA_NCYQX.js +1 -0
  218. package/dist-embed/chunks/{pt-BR-5N22H2LF-CvXBgZQs.js → pt-BR-5N22H2LF-B5i8LuE4.js} +1 -1
  219. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-BMnnlIUJ.js → pt-PT-UZXXM6DQ-BQ7hfRRg.js} +1 -1
  220. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-DpGcSrR9.js → quadrantDiagram-AXDQQJYC-D_j5dzK-.js} +1 -1
  221. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-CZe_C7e2.js → quadrantDiagram-AXDQQJYC-DlhtjZ-k.js} +1 -1
  222. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-DZNznYqD.js → quadrantDiagram-cf8b8fe0-BQ2yjLYu.js} +1 -1
  223. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CuL_zbZ8.js → railroadDiagram-O6MQD6OU-CZFkdwSz.js} +1 -1
  224. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BnCn-tIV.js → railroadDiagram-O6MQD6OU-aWlxxhLc.js} +1 -1
  225. package/dist-embed/chunks/{renderer-lVFw9lw7.js → renderer-2D5v6hpK.js} +1 -1
  226. package/dist-embed/chunks/{requirementDiagram-53bda41b-BLToEv8I.js → requirementDiagram-53bda41b-CWV_b9FE.js} +1 -1
  227. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-KU7DW76t.js → requirementDiagram-BXWQKSXE-BSF51uZZ.js} +1 -1
  228. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-W6Oaw9v0.js → requirementDiagram-BXWQKSXE-EVwiX2gg.js} +1 -1
  229. package/dist-embed/chunks/{ro-RO-JPDTUUEW-DZ-9UUH7.js → ro-RO-JPDTUUEW-BdcZRS6h.js} +1 -1
  230. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-JlRBwjob.js → ru-RU-B4JR7IUQ-Cta1z8f6.js} +1 -1
  231. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-y5tPDHfE.js → sankeyDiagram-P5KCCOFB-BqD6w06O.js} +1 -1
  232. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-1UXJ4wHP.js → sankeyDiagram-P5KCCOFB-t6rHaBZJ.js} +1 -1
  233. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-6gF3bcjb.js → sankeyDiagram-c3ef121a-C9O52Zx9.js} +1 -1
  234. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-CglVrG1T.js → sequenceDiagram-82a5b84f-Dga-BwWi.js} +1 -1
  235. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-CG-4aOyN.js → sequenceDiagram-WJ2MYXX4-DphVeQVS.js} +1 -1
  236. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-DVcXqRnq.js → sequenceDiagram-WJ2MYXX4-ih6W0378.js} +1 -1
  237. package/dist-embed/chunks/{sessions-3PQsLINe.js → sessions-APuuDN3K.js} +2 -2
  238. package/dist-embed/chunks/{si-LK-N5RQ5JYF-Bx8kHnkd.js → si-LK-N5RQ5JYF-DYy_OKHx.js} +1 -1
  239. package/dist-embed/chunks/{sizeCapture-INFHLROL-e294GOp7.js → sizeCapture-INFHLROL-CxIMCruL.js} +1 -1
  240. package/dist-embed/chunks/{sizeCapture-INFHLROL-CCZ7JXfm.js → sizeCapture-INFHLROL-o0dzt8-T.js} +1 -1
  241. package/dist-embed/chunks/{sk-SK-C5VTKIMK-xsfEfbZb.js → sk-SK-C5VTKIMK-B4A8rgzq.js} +1 -1
  242. package/dist-embed/chunks/{sl-SI-NN7IZMDC-SQYUECnr.js → sl-SI-NN7IZMDC-Dn2yU1RA.js} +1 -1
  243. package/dist-embed/chunks/{stateDiagram-43e79a5f-DktiQR1L.js → stateDiagram-43e79a5f-RBFnM6HD.js} +1 -1
  244. package/dist-embed/chunks/{stateDiagram-D77RDMKH-Czz7slb9.js → stateDiagram-D77RDMKH-DUbaZs3a.js} +1 -1
  245. package/dist-embed/chunks/{stateDiagram-D77RDMKH-DvgDxPXs.js → stateDiagram-D77RDMKH-R5RRRvFY.js} +1 -1
  246. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-CGEkaZYz.js → stateDiagram-v2-2041ed4f-O5FpnsEz.js} +1 -1
  247. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-CbzbC1qh.js → stateDiagram-v2-MP3YSRHH-CxTXB7mT.js} +1 -1
  248. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-DGG9ROyK.js → stateDiagram-v2-MP3YSRHH-xKTLvXGN.js} +1 -1
  249. package/dist-embed/chunks/{styles-455b33cd-BpfBULhz.js → styles-455b33cd-D4Xv2qYx.js} +1 -1
  250. package/dist-embed/chunks/{styles-f932cba9-DsM5quNh.js → styles-f932cba9-BRIqeB8k.js} +1 -1
  251. package/dist-embed/chunks/{styles-fcc2142b-bC7I59Fx.js → styles-fcc2142b-CSNd2DtU.js} +1 -1
  252. package/dist-embed/chunks/{subset-shared.chunk-Ch6j8nKC.js → subset-shared.chunk-SugOGKH0.js} +1 -1
  253. package/dist-embed/chunks/{subset-worker.chunk-pJjck5pR.js → subset-worker.chunk-CHn-RJwQ.js} +1 -1
  254. package/dist-embed/chunks/{sv-SE-XGPEYMSR-BxcjSHE2.js → sv-SE-XGPEYMSR-DIGNKjA1.js} +1 -1
  255. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-OC_CIhNw.js → svgDrawCommon-148a3cd9-ioBjWI45.js} +1 -1
  256. package/dist-embed/chunks/{swimlanes-42K2YHIH-DLiqjxvc.js → swimlanes-42K2YHIH-BPXSOfWl.js} +1 -1
  257. package/dist-embed/chunks/{swimlanes-42K2YHIH-nfpJsGfW.js → swimlanes-42K2YHIH-DID4P1mJ.js} +1 -1
  258. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-DVkRheaE.js → swimlanesDiagram-VR7AAH4N-B216TpFb.js} +1 -1
  259. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-DjeQ0TlI.js → swimlanesDiagram-VR7AAH4N-C5LAWW5q.js} +1 -1
  260. package/dist-embed/chunks/{ta-IN-2NMHFXQM-rItSkDUS.js → ta-IN-2NMHFXQM-h5n2V9ms.js} +1 -1
  261. package/dist-embed/chunks/{th-TH-HPSO5L25-B7UzESFj.js → th-TH-HPSO5L25-DPUFV7b6.js} +1 -1
  262. package/dist-embed/chunks/{timeline-definition-24CTP7MA-CapVlXMl.js → timeline-definition-24CTP7MA-CsrTDzso.js} +1 -1
  263. package/dist-embed/chunks/{timeline-definition-24CTP7MA-eOK0mNc7.js → timeline-definition-24CTP7MA-Y3tUsmSp.js} +1 -1
  264. package/dist-embed/chunks/{timeline-definition-7545f45a-afx9iuZR.js → timeline-definition-7545f45a-Dwe7O50H.js} +1 -1
  265. package/dist-embed/chunks/{tokens-BfuLIPUq.js → tokens-DTIgYcNS.js} +1 -1
  266. package/dist-embed/chunks/{tr-TR-DEFEU3FU-Ci6oNfEX.js → tr-TR-DEFEU3FU-BezJkdMx.js} +1 -1
  267. package/dist-embed/chunks/{uk-UA-QMV73CPH-C9csqvO6.js → uk-UA-QMV73CPH-CqILlosm.js} +1 -1
  268. package/dist-embed/chunks/{usePrimerThemeBridge-D_1NuGKb.js → usePrimerThemeBridge-CoHussa9.js} +1 -1
  269. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-D12hHdDQ.js → vennDiagram-4TSXK5OY-BhVdyHxt.js} +1 -1
  270. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-CJ0VIZqI.js → vennDiagram-4TSXK5OY-ClTlC2ql.js} +1 -1
  271. package/dist-embed/chunks/{vi-VN-M7AON7JQ-DRAj2kZj.js → vi-VN-M7AON7JQ-CnkPVQ0a.js} +1 -1
  272. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-B1FfO2GD.js → wardleyDiagram-VM6X3IG4-DbWIMpvU.js} +1 -1
  273. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-BfuBJbTV.js → wardleyDiagram-VM6X3IG4-kS16z5iB.js} +1 -1
  274. package/dist-embed/chunks/{xychartDiagram-3f383b91-BMDhPCCG.js → xychartDiagram-3f383b91-DYoT_EjG.js} +1 -1
  275. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-xLO3w9Bz.js → xychartDiagram-S5SC5T6Z-CdwuwQAF.js} +1 -1
  276. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-DZ-XUHKl.js → xychartDiagram-S5SC5T6Z-KeQp-cQ1.js} +1 -1
  277. package/dist-embed/chunks/{zh-CN-LNUGB5OW-DLOyW8hH.js → zh-CN-LNUGB5OW-CNdfctAT.js} +1 -1
  278. package/dist-embed/chunks/{zh-HK-E62DVLB3-DwC6_2Ws.js → zh-HK-E62DVLB3-DEXwa5-T.js} +1 -1
  279. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-DEMugIwa.js → zh-TW-RAJ6MFWO-BF7cCYAK.js} +1 -1
  280. package/dist-embed/datalayer-app-main.js +21 -21
  281. package/lib/apps/core/index.d.ts +16 -0
  282. package/lib/apps/index.d.ts +2 -2
  283. package/lib/apps/index.js +1 -1
  284. package/lib/apps/plugins/agents/DatalayerAgentBridge.js +9 -14
  285. package/lib/apps/plugins/agents/index.d.ts +1 -1
  286. package/lib/apps/plugins/agents/index.js +1 -1
  287. package/lib/apps/plugins/agents/plugin.d.ts +10 -0
  288. package/lib/apps/plugins/agents/plugin.js +10 -0
  289. package/lib/apps/plugins/chat/ChatView.js +13 -1
  290. package/lib/apps/shell/LoopWorkspace.d.ts +8 -1
  291. package/lib/apps/shell/LoopWorkspace.js +5 -3
  292. package/lib/chat/header/ChatHeaderBase.d.ts +3 -1
  293. package/lib/chat/header/ChatHeaderBase.js +2 -2
  294. package/lib/chat/header/ChatViewModeToggle.d.ts +7 -1
  295. package/lib/chat/header/ChatViewModeToggle.js +5 -2
  296. package/lib/protocols/agentProtocols.js +3 -1
  297. package/lib/protocols/pap/index.d.ts +4 -0
  298. package/lib/protocols/pap/index.js +41 -0
  299. package/package.json +2 -2
  300. package/dist-embed/chunks/Avatar-DbU3YP4x.js +0 -1
  301. package/dist-embed/chunks/DatalayerAgentBridge-Bz2KWRXK.js +0 -1
  302. package/dist-embed/chunks/YouTubePlugin-xBjNr2Iu.js +0 -1
  303. package/dist-embed/chunks/index-DlK9qLPz.js +0 -1
  304. package/dist-embed/chunks/plugin-Dz5L6Xn8.js +0 -1
@@ -1,3 +1,3 @@
1
- import{w as b,x as E,E as v,r as I,j as i,B as c,T as j,bj as N,bk as T,bl as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-BjJfn7J-.js";import{O as _,b as P,u as w}from"./openingNotebook-CjjarT8V.js";import{P as d}from"./PrismCss-CcU1ChRk.js";import"./lexicalHooks-DEzWXVZY.js";import"./LexicalToolRegistry-CXLITkMD.js";import"./useProgressTask-UPro-gwc.js";import"./JupyterLexicalExtension-BuRLImy5.js";import"./NotebookSkeleton-HdM76lOj.js";import"./Avatar-DbU3YP4x.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-6Hdi_m3T.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./Output-BscOPLqE.js";import"./index-BvvaLLhn.js";import"./hoverbox-CStlKQWE.js";import"./index-BYQwy0Zx.js";import"./index-BJ7Yskx5.js";import"./color-CG7_7V2-.js";import"./isEqual-BybBNsZK.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-B3WvcNQa.js";import"./RestartIcon-Ca6_HoK0.js";const D="Quarterly revenue by region",M="Six rows of revenue, two quarters, three regions. The cell below loads them and shows the frame; run it, change it, or ask an agent to take it further — the code and its output live in this document, beside the words about them.",l="opening-document-input",S="opening-document-output",g=e=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1}),u=(e,o,t={})=>({children:o,direction:"ltr",format:"",indent:0,type:e,version:1,...t}),h={type:"linebreak",version:1},s=(e,o)=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"jupyter-input-highlight",version:1,highlightType:o}),f=e=>e.flatMap(o=>{if(typeof o=="string")return o.split(`
1
+ import{w as b,x as E,E as v,r as I,j as i,B as c,T as N,bk as j,bl as T,bm as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-t1KulOH8.js";import{O as _,b as P,u as w}from"./openingNotebook-CjjarT8V.js";import{P as d}from"./PrismCss-CcU1ChRk.js";import"./lexicalHooks-DKF-DsxG.js";import"./LexicalToolRegistry-CoM9ROsx.js";import"./useProgressTask-UPro-gwc.js";import"./JupyterLexicalExtension-Cize8RXy.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./Output-9DKTscSv.js";import"./index-a51XM5L8.js";import"./hoverbox-CStlKQWE.js";import"./index-s3hayhRS.js";import"./index-CpcHHQd7.js";import"./color-CG7_7V2-.js";import"./isEqual-niFNV5MZ.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";const D="Quarterly revenue by region",M="Six rows of revenue, two quarters, three regions. The cell below loads them and shows the frame; run it, change it, or ask an agent to take it further — the code and its output live in this document, beside the words about them.",l="opening-document-input",S="opening-document-output",g=e=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1}),u=(e,o,t={})=>({children:o,direction:"ltr",format:"",indent:0,type:e,version:1,...t}),h={type:"linebreak",version:1},s=(e,o)=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"jupyter-input-highlight",version:1,highlightType:o}),f=e=>e.flatMap(o=>{if(typeof o=="string")return o.split(`
2
2
  `).flatMap((n,m)=>[...m>0?[h]:[],...n.length>0?[s(n)]:[]]);const{content:t,type:r}=o;return typeof t=="string"?[s(t,r)]:Array.isArray(t)?t.length===1&&typeof t[0]=="string"?[s(t[0],r)]:f(t):[]}),k=e=>{const o=d.languages.python;return o?f(d.tokenize(e,o)):e.split(`
3
- `).flatMap((t,r)=>[...r>0?[h]:[],...t.length>0?[s(t)]:[]])};function A(){const e=_.join("");return{root:{children:[u("heading",[g(D)],{tag:"h1"}),u("paragraph",[g(M)],{textFormat:0,textStyle:""}),u("jupyter-input",k(e),{language:"python",jupyterInputNodeUuid:l}),{type:"jupyter-output",version:1,format:"",source:e,outputs:[{output_type:"execute_result",execution_count:1,data:{"text/plain":P},metadata:{}}],jupyterInputNodeUuid:l,jupyterOutputNodeUuid:S}],direction:"ltr",format:"",indent:0,type:"root",version:1}}}function lt({workspace:e}){const o=b(),t=E(o.snapshot),r=e.surfaceId,n=w(T,N,{workspace:e,editorId:r}),a=v(U)[0]?.value,y=I.useMemo(()=>JSON.stringify((a?.document??A)()),[a]),x=a?.autoFocus??!0;if(t.state!=="running")return i.jsx(c,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:4,textAlign:"center",children:i.jsx(j,{children:"The document needs a running sandbox for its code blocks. Open the Sandbox view to see what it is doing."})});const p=o.getServiceManager()??void 0;return i.jsx(c,{height:"100%",minHeight:0,children:i.jsx(O,{inheritTheme:!0,documentId:r,content:y,autoFocus:x,serviceManager:p,showToolbar:n.present,toolbarExtraItems:n.items,kernelId:p?t.kernelId:void 0,runtimeOverride:!p&&t.jupyterUrl?{baseUrl:t.jupyterUrl,token:t.jupyterToken}:void 0})})}export{lt as default};
3
+ `).flatMap((t,r)=>[...r>0?[h]:[],...t.length>0?[s(t)]:[]])};function A(){const e=_.join("");return{root:{children:[u("heading",[g(D)],{tag:"h1"}),u("paragraph",[g(M)],{textFormat:0,textStyle:""}),u("jupyter-input",k(e),{language:"python",jupyterInputNodeUuid:l}),{type:"jupyter-output",version:1,format:"",source:e,outputs:[{output_type:"execute_result",execution_count:1,data:{"text/plain":P},metadata:{}}],jupyterInputNodeUuid:l,jupyterOutputNodeUuid:S}],direction:"ltr",format:"",indent:0,type:"root",version:1}}}function lt({workspace:e}){const o=b(),t=E(o.snapshot),r=e.surfaceId,n=w(T,j,{workspace:e,editorId:r}),a=v(U)[0]?.value,y=I.useMemo(()=>JSON.stringify((a?.document??A)()),[a]),x=a?.autoFocus??!0;if(t.state!=="running")return i.jsx(c,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:4,textAlign:"center",children:i.jsx(N,{children:"The document needs a running sandbox for its code blocks. Open the Sandbox view to see what it is doing."})});const p=o.getServiceManager()??void 0;return i.jsx(c,{height:"100%",minHeight:0,children:i.jsx(O,{inheritTheme:!0,documentId:r,content:y,autoFocus:x,serviceManager:p,showToolbar:n.present,toolbarExtraItems:n.items,kernelId:p?t.kernelId:void 0,runtimeOverride:!p&&t.jupyterUrl?{baseUrl:t.jupyterUrl,token:t.jupyterToken}:void 0})})}export{lt as default};
@@ -1 +1 @@
1
- import{r,ap as ke,aq as Se,ar as je,as as we,at as ve,j as e,B as M,au as Ce,av as Ee,aw as be,ax as Re,ay as V,l as q,az as Me,aA as Te,aB as Pe,K as T,aC as De,aD as K,aE as $,aF as Ne,aG as Ue}from"../datalayer-app-main.js";import{useLexicalTools as Be}from"./lexicalHooks-DEzWXVZY.js";import{u as He}from"./useProgressTask-UPro-gwc.js";import{L as Ae,j as Ie,T as Le,k as We,l as Fe,m as _e,D as G,n as ze,o as Je,p as Ve,q as qe,J as Ke,s as $e,F as Ge,t as Ye,u as Qe,v as Xe,w as Ze}from"./JupyterLexicalExtension-BuRLImy5.js";import"./LexicalToolRegistry-CXLITkMD.js";import"./NotebookSkeleton-HdM76lOj.js";import"./Avatar-DbU3YP4x.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-6Hdi_m3T.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-BscOPLqE.js";import"./index-BvvaLLhn.js";import"./hoverbox-CStlKQWE.js";import"./index-BYQwy0Zx.js";import"./index-BJ7Yskx5.js";import"./color-CG7_7V2-.js";import"./isEqual-BybBNsZK.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-B3WvcNQa.js";import"./RestartIcon-Ca6_HoK0.js";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=K();t.getChildrenSize()===0&&t.append($())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=K();t.clear(),t.append($())},{tag:"history-merge"})}}},[o,s]),null}function et({disabled:o}){const[s]=T();return r.useEffect(()=>{De(s,Ne).output.disabled.value=o},[s,o]),null}function tt({setIsLinkEditMode:o,extraItems:s}){const[l]=T(),[t,d]=r.useState(l);return e.jsx(Ze,{editor:l,activeEditor:t,setActiveEditor:d,setIsLinkEditMode:o,extraItems:s})}function Y({inherit:o,colorMode:s,themeConfig:l,children:t}){return o?e.jsx(e.Fragment,{children:t}):e.jsx(Te,{colorMode:s,theme:l.primerTheme,themeStyles:l.themeStyles,children:t})}function Ut({documentId:o,runtimeName:s,runtimeOverride:l,serviceManager:t,kernelId:d,themeVariant:Q,colorMode:X,content:P,onContentChange:w,onToolsReady:D,onKernelChange:v,collaboration:n,toolbarExtraItems:Z,showToolbar:O=!0,inheritTheme:N=!1,autoFocus:U=!0}){const h=!!(n?.websocketUrl&&n?.roomId),ee=n?.identity?.displayName||n?.identity?.handle||n?.identity?.userId,te=n?.identity?.color,ne=r.useMemo(()=>({user:{id:n?.identity?.userId,username:n?.identity?.userId||n?.identity?.handle||n?.identity?.displayName,name:n?.identity?.handle||n?.identity?.displayName,display_name:n?.identity?.displayName||n?.identity?.handle,initials:n?.identity?.initials,color:n?.identity?.color,avatar_url:n?.identity?.avatarUrl,handle:n?.identity?.handle}}),[n?.identity]),B=r.useRef(P),H=r.useRef(o);H.current!==o&&(H.current=o,B.current=P);const A=B.current,I=r.useRef(A??""),L=Be(o);r.useEffect(()=>{D?.(L)},[L,D]);const{runtimes:W,refetchRuntimes:C}=ke(),m=r.useMemo(()=>{const i=String(l?.baseUrl||"").trim();if(i)return{url:i,wsUrl:String(l?.wsUrl||"").trim()||void 0,token:String(l?.token||"").trim(),runtime_name:String(l?.runtimeName||"").trim()||"agent-node-proxy"};const a=String(s||"").trim();if(a)return W.find(j=>String(j?.runtime_name||"")===a)},[l,s,W]),F=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!F)return;C();const i=window.setInterval(()=>{C()},1e3);return()=>{window.clearInterval(i)}},[F,C]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,j=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const b=String(m?.url||"").trim();if(!b){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||b.replace(/^http/,"ws"),xe=q.ServerConnection.makeSettings({baseUrl:b,wsUrl:pe,token:u,appendToken:!0});a=new q.ServiceManager({serverSettings:xe}),j=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,j?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(v?.(p?.connection??null),()=>{v?.(null)}),[p,v]);const E=re,_=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!E);He(`ephemeral-document-start-${o}`,_);const oe=r.useMemo(()=>Se({name:"@datalayer/agent-runtimes/EphemeralDocument",namespace:`ephemeral-document-${o}`,theme:Xe,dependencies:[Qe,...U?[Pe]:[]],onError(i){console.error("[EphemeralDocument]",i)}}),[o,U]),ie=r.useCallback(i=>{if(!w)return;const a=JSON.stringify(i.toJSON());a!==I.current&&(I.current=a,w(a))},[w]),[x,se]=r.useState(null),[,z]=r.useState(!1),y=h?n?.roomId:void 0,[ae,le]=r.useState(),ce=y===void 0||ae===y,me=r.useCallback(i=>le(i?y:void 0),[y]),de=i=>{i!==null&&se(i)},{colorMode:ue,theme:he}=je(),k=X??ue,ge=Q??he,fe=we(),S=ve(ge),J=k==="auto"?fe:k,c=(J==="dark"?S.themeStyles.dark:S.themeStyles.light).backgroundColor??"";return e.jsx(M,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:E?e.jsx(Y,{inherit:N,colorMode:k,themeConfig:S,children:e.jsx(Ce,{colormode:J,backgroundColor:c,children:e.jsx(M,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",overscrollBehaviorY:"contain",padding:2,backgroundColor:c,"--bgColor-default":c,"& .editor-shell":{backgroundColor:c,borderRadius:2,display:"flex",flexDirection:"column",minHeight:0,flex:1,maxWidth:"none",width:"100%",margin:0},"& .editor-container":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none",margin:0},"& .editor-inner":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none"},"& .editor-scroller":{minHeight:0,flex:1,overflow:"auto",width:"100%",maxWidth:"none"},"& .editor":{minHeight:"100%",width:"100%",maxWidth:"none",margin:0},"& .editor-input":{backgroundColor:c,width:"100%",maxWidth:"none",margin:0},"& .ContentEditable__root":{width:"100%",maxWidth:"none",margin:0},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:c}},children:e.jsx(Ae,{lexicalId:o,serviceManager:E,children:e.jsx(Ee,{extension:oe,contentEditable:null,children:e.jsx(Ie,{children:e.jsx(Le,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:z,extraItems:Z}):null,e.jsx("div",{className:"editor-container",children:e.jsxs("div",{className:"editor-inner",children:[h&&n?e.jsx(We,{id:n.roomId,providerFactory:Fe,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(_e,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(be,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(G,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:A}),e.jsx(ze,{}),e.jsx(Je,{}),e.jsx(Ve,{}),e.jsx(qe,{kernel:p}),e.jsx(Ke,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx($e,{anchorElem:x}),e.jsx(Ge,{anchorElem:x,setIsLinkEditMode:z}),e.jsx(Ye,{anchorElem:x})]})]})})]})})})})})})})}):_?e.jsx(Y,{inherit:N,colorMode:k,themeConfig:S,children:e.jsx(M,{position:"absolute",inset:0,display:"flex",flexDirection:"column",padding:2,backgroundColor:c,children:e.jsx(G,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ut as EphemeralDocument,Ut as default};
1
+ import{r,ap as ke,aq as Se,ar as je,as as we,at as ve,j as e,B as M,au as Ce,av as Ee,aw as be,ax as Re,ay as V,l as q,az as Me,aA as Te,aB as Pe,K as T,aC as De,aD as K,aE as $,aF as Ne,aG as Ue}from"../datalayer-app-main.js";import{useLexicalTools as Be}from"./lexicalHooks-DKF-DsxG.js";import{u as He}from"./useProgressTask-UPro-gwc.js";import{L as Ae,j as Ie,T as Le,k as We,l as Fe,m as _e,D as G,n as ze,o as Je,p as Ve,q as qe,J as Ke,s as $e,F as Ge,t as Ye,u as Qe,v as Xe,w as Ze}from"./JupyterLexicalExtension-Cize8RXy.js";import"./LexicalToolRegistry-CoM9ROsx.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-9DKTscSv.js";import"./index-a51XM5L8.js";import"./hoverbox-CStlKQWE.js";import"./index-s3hayhRS.js";import"./index-CpcHHQd7.js";import"./color-CG7_7V2-.js";import"./isEqual-niFNV5MZ.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=K();t.getChildrenSize()===0&&t.append($())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=K();t.clear(),t.append($())},{tag:"history-merge"})}}},[o,s]),null}function et({disabled:o}){const[s]=T();return r.useEffect(()=>{De(s,Ne).output.disabled.value=o},[s,o]),null}function tt({setIsLinkEditMode:o,extraItems:s}){const[l]=T(),[t,d]=r.useState(l);return e.jsx(Ze,{editor:l,activeEditor:t,setActiveEditor:d,setIsLinkEditMode:o,extraItems:s})}function Y({inherit:o,colorMode:s,themeConfig:l,children:t}){return o?e.jsx(e.Fragment,{children:t}):e.jsx(Te,{colorMode:s,theme:l.primerTheme,themeStyles:l.themeStyles,children:t})}function Ut({documentId:o,runtimeName:s,runtimeOverride:l,serviceManager:t,kernelId:d,themeVariant:Q,colorMode:X,content:P,onContentChange:w,onToolsReady:D,onKernelChange:v,collaboration:n,toolbarExtraItems:Z,showToolbar:O=!0,inheritTheme:N=!1,autoFocus:U=!0}){const h=!!(n?.websocketUrl&&n?.roomId),ee=n?.identity?.displayName||n?.identity?.handle||n?.identity?.userId,te=n?.identity?.color,ne=r.useMemo(()=>({user:{id:n?.identity?.userId,username:n?.identity?.userId||n?.identity?.handle||n?.identity?.displayName,name:n?.identity?.handle||n?.identity?.displayName,display_name:n?.identity?.displayName||n?.identity?.handle,initials:n?.identity?.initials,color:n?.identity?.color,avatar_url:n?.identity?.avatarUrl,handle:n?.identity?.handle}}),[n?.identity]),B=r.useRef(P),H=r.useRef(o);H.current!==o&&(H.current=o,B.current=P);const A=B.current,I=r.useRef(A??""),L=Be(o);r.useEffect(()=>{D?.(L)},[L,D]);const{runtimes:W,refetchRuntimes:C}=ke(),m=r.useMemo(()=>{const i=String(l?.baseUrl||"").trim();if(i)return{url:i,wsUrl:String(l?.wsUrl||"").trim()||void 0,token:String(l?.token||"").trim(),runtime_name:String(l?.runtimeName||"").trim()||"agent-node-proxy"};const a=String(s||"").trim();if(a)return W.find(j=>String(j?.runtime_name||"")===a)},[l,s,W]),F=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!F)return;C();const i=window.setInterval(()=>{C()},1e3);return()=>{window.clearInterval(i)}},[F,C]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,j=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const b=String(m?.url||"").trim();if(!b){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||b.replace(/^http/,"ws"),xe=q.ServerConnection.makeSettings({baseUrl:b,wsUrl:pe,token:u,appendToken:!0});a=new q.ServiceManager({serverSettings:xe}),j=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,j?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(v?.(p?.connection??null),()=>{v?.(null)}),[p,v]);const E=re,_=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!E);He(`ephemeral-document-start-${o}`,_);const oe=r.useMemo(()=>Se({name:"@datalayer/agent-runtimes/EphemeralDocument",namespace:`ephemeral-document-${o}`,theme:Xe,dependencies:[Qe,...U?[Pe]:[]],onError(i){console.error("[EphemeralDocument]",i)}}),[o,U]),ie=r.useCallback(i=>{if(!w)return;const a=JSON.stringify(i.toJSON());a!==I.current&&(I.current=a,w(a))},[w]),[x,se]=r.useState(null),[,z]=r.useState(!1),y=h?n?.roomId:void 0,[ae,le]=r.useState(),ce=y===void 0||ae===y,me=r.useCallback(i=>le(i?y:void 0),[y]),de=i=>{i!==null&&se(i)},{colorMode:ue,theme:he}=je(),k=X??ue,ge=Q??he,fe=we(),S=ve(ge),J=k==="auto"?fe:k,c=(J==="dark"?S.themeStyles.dark:S.themeStyles.light).backgroundColor??"";return e.jsx(M,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:E?e.jsx(Y,{inherit:N,colorMode:k,themeConfig:S,children:e.jsx(Ce,{colormode:J,backgroundColor:c,children:e.jsx(M,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",overscrollBehaviorY:"contain",padding:2,backgroundColor:c,"--bgColor-default":c,"& .editor-shell":{backgroundColor:c,borderRadius:2,display:"flex",flexDirection:"column",minHeight:0,flex:1,maxWidth:"none",width:"100%",margin:0},"& .editor-container":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none",margin:0},"& .editor-inner":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none"},"& .editor-scroller":{minHeight:0,flex:1,overflow:"auto",width:"100%",maxWidth:"none"},"& .editor":{minHeight:"100%",width:"100%",maxWidth:"none",margin:0},"& .editor-input":{backgroundColor:c,width:"100%",maxWidth:"none",margin:0},"& .ContentEditable__root":{width:"100%",maxWidth:"none",margin:0},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:c}},children:e.jsx(Ae,{lexicalId:o,serviceManager:E,children:e.jsx(Ee,{extension:oe,contentEditable:null,children:e.jsx(Ie,{children:e.jsx(Le,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:z,extraItems:Z}):null,e.jsx("div",{className:"editor-container",children:e.jsxs("div",{className:"editor-inner",children:[h&&n?e.jsx(We,{id:n.roomId,providerFactory:Fe,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(_e,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(be,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(G,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:A}),e.jsx(ze,{}),e.jsx(Je,{}),e.jsx(Ve,{}),e.jsx(qe,{kernel:p}),e.jsx(Ke,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx($e,{anchorElem:x}),e.jsx(Ge,{anchorElem:x,setIsLinkEditMode:z}),e.jsx(Ye,{anchorElem:x})]})]})})]})})})})})})})}):_?e.jsx(Y,{inherit:N,colorMode:k,themeConfig:S,children:e.jsx(M,{position:"absolute",inset:0,display:"flex",flexDirection:"column",padding:2,backgroundColor:c,children:e.jsx(G,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ut as EphemeralDocument,Ut as default};
@@ -1,2 +1,2 @@
1
- import{c0 as O,aW as Ee,l as x,bZ as I,aV as be,d_ as _e,d$ as Re,e0 as Ce,r as f,o as ne,ap as Me,e1 as Ue,j as v,ar as je,as as qe,at as Te,B as Z,au as Ae,az as Ne,aA as Ie,aG as Oe}from"../datalayer-app-main.js";import{u as Le}from"./useProgressTask-UPro-gwc.js";import{a as De}from"./NotebookToolbar-DMKCe3c2.js";import{C as Je,a as $e,N as Be}from"./CellSidebarExtension-CQlXdanG.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-6Hdi_m3T.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./index-BYQwy0Zx.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-HdM76lOj.js";import"./Avatar-DbU3YP4x.js";import"./index-BJ7Yskx5.js";import"./color-CG7_7V2-.js";import"./isEqual-BybBNsZK.js";import"./defaultLocale-5voVPcsN.js";import"./renderer-lVFw9lw7.js";import"./SquareIcon-e3ygcjpv.js";const H="jupyter_server_nbmodel",Pe=new WeakSet;function We(e){return Pe.has(e)}function re(e){const n=e.model.getMetadata(H);return n?.kernelId&&n.requestId&&n.requestUrl?n:void 0}function oe(e,n){e.model.setMetadata(H,n)}function Q(e){e.model.deleteMetadata(H)}function se(e){return(typeof e=="string"?JSON.parse(e):e).reduce((r,t)=>{const o=r[r.length-1];if(t.output_type==="stream"&&o?.output_type==="stream"&&o.name===t.name){const s=Array.isArray(o.text)?o.text.join(""):o.text??"",a=Array.isArray(t.text)?t.text.join(""):t.text??"";o.text=s+a}else r.push(t);return r},[])}function j(e){return Array.isArray(e.text)?e.text.join(""):e.text??""}function Ke(e,n){return e?.output_type==="stream"&&n?.output_type==="stream"&&e.name===n.name&&j(n).startsWith(j(e))}function He(e,n){return e.length>n.length?!1:e.every((r,t)=>O.deepEqual(r,n[t])||t===e.length-1&&Ke(r,n[t]))}function Fe(e,n){const r=Math.min(e.length,n.length);for(let t=0;t<r;t+=1){const o=e[t],s=n[t];if(O.deepEqual(o,s))continue;if(!(o?.output_type==="stream"&&s?.output_type==="stream"&&o.name===s.name))return-1;const i=j(o),u=j(s);if(!u.startsWith(i)&&!i.startsWith(u)||t<r-1)return-1}return r}function Ge(e,n,r){let t=n.length;if(n.length>0&&r.length>=n.length){const o=n.length-1,s=n[o],a=r[o];if(!O.deepEqual(s,a)){const i=j(a).slice(j(s).length);i&&e.outputArea.model.add({...a,text:i})}}for(;t<r.length;)e.outputArea.model.add(r[t]),t+=1}function ae(e,n,r){const t=e.model.sharedModel,o=t.getOutputs();if(O.deepEqual(o,n))return;if(n.length===0){r?.length&&o.length&&e.outputArea.model.clear();return}if(He(n,o))return;console.debug("[jupyter-server-nbmodel] Applying pending output snapshot",{cellId:t.getId(),outputCount:n.length});const s=Fe(o,n);s>=0?Ge(e,o.slice(0,s),n):t.setOutputs(n)}const Ve=1e3;async function ze(e,n,r){let t;try{t=await n.json()}catch{return}if(t.request_id&&t.kernel_id){const a=n.headers.get("Location")??t.request_url;a&&(r.requestUrl=a),a&&r.recoverOutputs&&oe(e,{kernelId:t.kernel_id,requestId:t.request_id,requestUrl:a}),r.accepted||(r.accepted=!0,r.onAccepted?.())}if(t.outputs===void 0||!r.recoverOutputs)return;const o=se(t.outputs),s=r.serverOutputs;r.serverOutputs=o,ae(e,o,s)}async function K(e,n,r,t,o,s=100,a={}){const i=new Ee;return x.ServerConnection.makeRequest(n,r,t).then(async u=>{if(u.ok)if(u.status===202){await ze(e,u,a);let c=u.headers.get("Location")||a.requestUrl||n;c.startsWith(t.baseUrl)||(c=I.URLExt.join(t.baseUrl,c)),setTimeout(async(_,w,m,M,k,U,p)=>{try{const h=await K(_,w,m,M,k,U,p);i.resolve(h)}catch(h){i.reject(h)}},s,e,c,{method:"GET"},t,o,Math.min(Ve,s*2),a)}else i.resolve(u);else if(u.status===300){let c=u.headers.get("Location")||"";if(!c){const p=n.match(/^(.*\/api\/kernels\/[^/?]+)/);c=p?`${p[1]}/input`:""}if(!c){i.reject(new Error(`The kernel asked for an input, and where to send it could not be determined: no Location header, and the polled URL names no kernel (${n}).`));return}c.startsWith(t.baseUrl)||(c=I.URLExt.join(t.baseUrl,c));const{parent_header:_,input_request:w}=await u.json(),m=new be;m.addClass("jp-OutputArea-child"),m.addClass("jp-OutputArea-stdin-item");const M=new _e;M.addClass("jp-OutputArea-prompt"),m.addWidget(M);const k=new Re({future:Object.freeze({sendInputReply:(p,h)=>{x.ServerConnection.makeRequest(c,{method:"POST",body:JSON.stringify({input:p.value})},t).catch(E=>{console.error(`Failed to set input to ${JSON.stringify(p)}.`,E)})}}),parent_header:_,password:w.password,prompt:w.prompt,translator:o});k.addClass("jp-OutputArea-output"),m.addWidget(k);const U=k.node.getElementsByTagName("input")[0];k.value.then(p=>{m.addClass("jp-OutputArea-stdin-hiding"),e.outputArea.model.add({output_type:"stream",name:"stdin",text:p+`
2
- `}),U.focus(),window.setTimeout(async()=>{const h=document.activeElement;m.dispose(),h&&h instanceof HTMLElement&&h.focus();try{const E=await K(e,n,r,t,o,100,a);i.resolve(E)}catch(E){i.reject(E)}},500)}),e.outputArea.layout.addWidget(m)}else i.reject(await x.ServerConnection.ResponseError.create(u))}).catch(u=>{i.reject(new x.ServerConnection.NetworkError(u))}),i.promise}async function Ye(e,n,r,t,o,s=100,a,i=!1){return K(e,n,r,t,o,s,{onAccepted:a,recoverOutputs:i})}async function Xe(e,n,r){const t=e.model.sharedModel;t.executionState="running";try{const s=await(await Ye(e,n,{method:"GET"},r,void 0,100,void 0,!0)).json(),a=se(s.outputs??"[]");return ae(e,a),t.execution_count=s.execution_count??null,t.executionState="idle",Q(e),s.status==="ok"}catch(o){if(o instanceof x.ServerConnection.ResponseError&&o.response.status===404)return Q(e),t.executionState="idle",!1;throw o}}const N=new Set;function Ze(e,n){if(e.startsWith(n.baseUrl))return e;const r=e.startsWith("http")?new URL(e).pathname:e;return I.URLExt.join(n.baseUrl,r)}function Qe(e,n){if(We(e))return!1;const r=re(e);if(!r||N.has(r.requestId)||e.isDisposed||!e.model)return!1;N.add(r.requestId);const t=Ze(r.requestUrl,n);return console.info("[agent-runtimes] Resuming a server execution",{cellId:e.model.sharedModel.getId(),requestId:r.requestId,requestUrl:t}),Xe(e,t,n).catch(o=>{if(e.isDisposed){N.delete(r.requestId);return}console.warn(`[agent-runtimes] Failed to resume the execution ${r.requestId}.`,o)}),!0}const W=new Set;async function et(e,n,r){const t=`${r.baseUrl}#${n.id}`;if(W.has(t))return 0;const o=await x.ServerConnection.makeRequest(I.URLExt.join(r.baseUrl,`api/kernels/${n.id}/execute`),{method:"GET"},r);if(o.status===404)return W.add(t),0;if(!o.ok)throw await x.ServerConnection.ResponseError.create(o).catch(()=>new Error(`Invalid response: ${o.status} ${o.statusText}`.trim()));W.add(t);const s=await o.json();let a=0;for(const i of s.requests??[]){if(!i.cell_id||N.has(i.request_id))continue;const u=e.find(c=>c.model?.sharedModel.getId()===i.cell_id);!u||u.isDisposed||re(u)||(oe(u,{kernelId:i.kernel_id,requestId:i.request_id,requestUrl:i.request_url}),a+=1)}return a}async function tt(e){if(e.isDisposed)return 0;const n=e.sessionContext?.session?.kernel,r=n?.serverSettings;if(!n||!r)return 0;const t=e.content.widgets.filter(s=>s instanceof Ce);if(t.length===0)return 0;try{await et(t,n,r)}catch(s){console.warn("[agent-runtimes] Failed to discover the active executions of the kernel.",s)}let o=0;for(const s of t)Qe(s,r)&&(o+=1);return o}const ee=1e3,nt=3e4;function rt(e,n){f.useEffect(()=>{if(!e||!n)return;let r=0;const t=()=>{const a=ne.getState().selectNotebook(e)?.adapter?.panel;!a||a.isDisposed||tt(a)};t();const o=window.setInterval(()=>{if(r+=ee,r>=nt){window.clearInterval(o);return}t()},ee);return()=>{window.clearInterval(o)}},[e,n])}const te={cells:[{cell_type:"code",source:[""],metadata:{},outputs:[],execution_count:null}],metadata:{kernelspec:{display_name:"Python 3",language:"python",name:"python3"},language_info:{name:"python"}},nbformat:4,nbformat_minor:5};function ot({inherit:e,colorMode:n,themeConfig:r,children:t}){return e?v.jsx(v.Fragment,{children:t}):v.jsx(Ie,{colorMode:n,theme:r.primerTheme,themeStyles:r.themeStyles,children:t})}function Et({notebookId:e,runtimeName:n,runtimeOverride:r,serviceManager:t,inheritTheme:o=!1,kernelId:s,cellSidebarMargin:a=120,nbformat:i,onNbformatChange:u,toolbarComponent:c,toolbarExtraItems:_,showToolbar:w=!0,showSaveItem:m=!1,themeVariant:M,colorMode:k,collaborationProvider:U}){const p=f.useRef(i??te),h=f.useRef(e);h.current!==e&&(h.current=e,p.current=i??te);const E=p.current,F=f.useRef(JSON.stringify(E)),{runtimes:G,refetchRuntimes:L}=Me(void 0,{enabled:!!String(n||"").trim()&&!t&&!String(r?.baseUrl||"").trim()}),V=f.useMemo(()=>{const l=String(n||"").trim();if(l)return G.find(d=>String(d?.runtime_name||"")===l)},[n,G]),S=f.useMemo(()=>{const l=String(r?.baseUrl||"").trim();return l?{url:l,wsUrl:String(r?.wsUrl||"").trim()||void 0,token:String(r?.token||"").trim(),runtime_name:String(r?.runtimeName||"").trim()||"agent-node-proxy"}:V},[r,V]),z=!!(!r?.baseUrl&&String(n||"").trim()&&!S);f.useEffect(()=>{if(!z)return;L();const l=window.setInterval(()=>{L()},1e3);return()=>{window.clearInterval(l)}},[z,L]);const[ie,D]=f.useState(null),[ue,J]=f.useState(void 0),[le,$]=f.useState(!1);f.useEffect(()=>{let l=!1,d=null,b=null;const y=async()=>{const R=String(S?.url||"").trim();if(!R){l||(D(null),J(void 0),$(!1));return}try{const A=String(S?.token||"").trim(),we=String(S?.wsUrl||"").trim()||R.replace(/^http/,"ws"),ke=x.ServerConnection.makeSettings({baseUrl:R,wsUrl:we,token:A,appendToken:!0}),C=new x.ServiceManager({serverSettings:ke});if(d=C,b=Ne(String(S?.runtime_name||""),d),l){g(C);return}await C.ready,await C.kernels.refreshRunning();const X=[...C.kernels.running()][0];if(l){g(C);return}D(C),J(X?.id),$(!X)}catch(A){d&&(g(d),d=null),l||(console.warn(`[agent-runtimes] Could not reach the sandbox at ${R}.`,A),D(null),J(void 0),$(!1))}},g=R=>{b?.(),b=null,Oe(R)};return y(),()=>{l=!0,d?(g(d),d=null):(b?.(),b=null)}},[S?.runtime_name,S?.url,S?.token,S?.wsUrl]);const q=t??ie,ce=Ue(),de=s??ue,fe=t?!s:le,me=f.useMemo(()=>{if(!w)return;const l=c||De,d=m?void 0:["notebook-save","notebook-divider-file"];return!_?.length&&!d?l:function(y){return v.jsx(l,{...y,extraItems:_,hiddenItems:d})}},[w,m,c,_]),pe=!!((String(n||"").trim()||String(r?.baseUrl||"").trim())&&!q);Le(`ephemeral-notebook-start-${e}`,pe),rt(e,q??void 0),f.useEffect(()=>{if(U)return;const l=()=>{const g=ne.getState().selectNotebook(e)?.adapter;return(g?.notebook?.model??g?.panel?.content?.model??null)?.toJSON?.()??null},d=()=>{const y=l();if(!y||!Array.isArray(y.cells))return;const g=JSON.stringify(y);g!==F.current&&(F.current=g,u?.(y))},b=window.setInterval(d,500);return()=>{window.clearInterval(b),d()}},[q,e,u]);const{colorMode:he,theme:ge}=je(),B=k??he,Se=M??ge,ye=qe(),P=Te(Se),Y=B==="auto"?ye:B,T=(Y==="dark"?P.themeStyles.dark:P.themeStyles.light).backgroundColor??"",ve=f.useMemo(()=>[new Je({factory:$e})],[]),xe=f.useMemo(()=>`.datalayer/${e}.ipynb`,[e]);return v.jsx(Z,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:q&&ce?v.jsx(ot,{inherit:o,colorMode:B,themeConfig:P,children:v.jsx(Ae,{colormode:Y,backgroundColor:T,children:v.jsx(Z,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",overflow:"hidden",overscrollBehaviorY:"contain",overflowAnchor:"none",padding:2,backgroundColor:T,"& #dla-Jupyter-Notebook":{display:"flex",flexDirection:"column"},...w?{"& #dla-Jupyter-Notebook > :first-of-type":{position:"sticky",top:0,zIndex:2,flex:"0 0 auto",backgroundColor:T}}:{"& .datalayer-NotebookPanel-header":{display:"none",minHeight:0}},"& #dla-Jupyter-Notebook > .dla-Box-Notebook":{flex:"1 1 auto",minHeight:0},'& [role="toolbar"][aria-label="Notebook toolbar"]':{backgroundColor:T}},children:v.jsx(Be,{nbformat:E,id:e,path:xe,serviceManager:q,startDefaultKernel:fe,kernelId:de,height:"100%",cellSidebarMargin:a,extensions:ve,Toolbar:me,collaborationProvider:U})})})}):null})}export{Et as EphemeralNotebook,Et as default};
1
+ import{c1 as O,aW as Ee,l as x,b_ as I,aV as be,d$ as _e,e0 as Re,e1 as Ce,r as f,o as ne,ap as Me,e2 as Ue,j as v,ar as je,as as qe,at as Te,B as Q,au as Ae,az as Ne,aA as Ie,aG as Oe}from"../datalayer-app-main.js";import{u as Le}from"./useProgressTask-UPro-gwc.js";import{a as De}from"./NotebookToolbar-rtMQZWHQ.js";import{C as Je,a as $e,N as Be}from"./CellSidebarExtension-CfaJL6DQ.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./index-s3hayhRS.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./index-CpcHHQd7.js";import"./color-CG7_7V2-.js";import"./isEqual-niFNV5MZ.js";import"./defaultLocale-5voVPcsN.js";import"./renderer-2D5v6hpK.js";import"./SquareIcon-e3ygcjpv.js";const H="jupyter_server_nbmodel",Pe=new WeakSet;function We(e){return Pe.has(e)}function re(e){const n=e.model.getMetadata(H);return n?.kernelId&&n.requestId&&n.requestUrl?n:void 0}function oe(e,n){e.model.setMetadata(H,n)}function Z(e){e.model.deleteMetadata(H)}function se(e){return(typeof e=="string"?JSON.parse(e):e).reduce((r,t)=>{const o=r[r.length-1];if(t.output_type==="stream"&&o?.output_type==="stream"&&o.name===t.name){const s=Array.isArray(o.text)?o.text.join(""):o.text??"",a=Array.isArray(t.text)?t.text.join(""):t.text??"";o.text=s+a}else r.push(t);return r},[])}function j(e){return Array.isArray(e.text)?e.text.join(""):e.text??""}function Ke(e,n){return e?.output_type==="stream"&&n?.output_type==="stream"&&e.name===n.name&&j(n).startsWith(j(e))}function He(e,n){return e.length>n.length?!1:e.every((r,t)=>O.deepEqual(r,n[t])||t===e.length-1&&Ke(r,n[t]))}function Fe(e,n){const r=Math.min(e.length,n.length);for(let t=0;t<r;t+=1){const o=e[t],s=n[t];if(O.deepEqual(o,s))continue;if(!(o?.output_type==="stream"&&s?.output_type==="stream"&&o.name===s.name))return-1;const i=j(o),u=j(s);if(!u.startsWith(i)&&!i.startsWith(u)||t<r-1)return-1}return r}function Ge(e,n,r){let t=n.length;if(n.length>0&&r.length>=n.length){const o=n.length-1,s=n[o],a=r[o];if(!O.deepEqual(s,a)){const i=j(a).slice(j(s).length);i&&e.outputArea.model.add({...a,text:i})}}for(;t<r.length;)e.outputArea.model.add(r[t]),t+=1}function ae(e,n,r){const t=e.model.sharedModel,o=t.getOutputs();if(O.deepEqual(o,n))return;if(n.length===0){r?.length&&o.length&&e.outputArea.model.clear();return}if(He(n,o))return;console.debug("[jupyter-server-nbmodel] Applying pending output snapshot",{cellId:t.getId(),outputCount:n.length});const s=Fe(o,n);s>=0?Ge(e,o.slice(0,s),n):t.setOutputs(n)}const Ve=1e3;async function ze(e,n,r){let t;try{t=await n.json()}catch{return}if(t.request_id&&t.kernel_id){const a=n.headers.get("Location")??t.request_url;a&&(r.requestUrl=a),a&&r.recoverOutputs&&oe(e,{kernelId:t.kernel_id,requestId:t.request_id,requestUrl:a}),r.accepted||(r.accepted=!0,r.onAccepted?.())}if(t.outputs===void 0||!r.recoverOutputs)return;const o=se(t.outputs),s=r.serverOutputs;r.serverOutputs=o,ae(e,o,s)}async function K(e,n,r,t,o,s=100,a={}){const i=new Ee;return x.ServerConnection.makeRequest(n,r,t).then(async u=>{if(u.ok)if(u.status===202){await ze(e,u,a);let c=u.headers.get("Location")||a.requestUrl||n;c.startsWith(t.baseUrl)||(c=I.URLExt.join(t.baseUrl,c)),setTimeout(async(_,w,m,M,k,U,p)=>{try{const h=await K(_,w,m,M,k,U,p);i.resolve(h)}catch(h){i.reject(h)}},s,e,c,{method:"GET"},t,o,Math.min(Ve,s*2),a)}else i.resolve(u);else if(u.status===300){let c=u.headers.get("Location")||"";if(!c){const p=n.match(/^(.*\/api\/kernels\/[^/?]+)/);c=p?`${p[1]}/input`:""}if(!c){i.reject(new Error(`The kernel asked for an input, and where to send it could not be determined: no Location header, and the polled URL names no kernel (${n}).`));return}c.startsWith(t.baseUrl)||(c=I.URLExt.join(t.baseUrl,c));const{parent_header:_,input_request:w}=await u.json(),m=new be;m.addClass("jp-OutputArea-child"),m.addClass("jp-OutputArea-stdin-item");const M=new _e;M.addClass("jp-OutputArea-prompt"),m.addWidget(M);const k=new Re({future:Object.freeze({sendInputReply:(p,h)=>{x.ServerConnection.makeRequest(c,{method:"POST",body:JSON.stringify({input:p.value})},t).catch(E=>{console.error(`Failed to set input to ${JSON.stringify(p)}.`,E)})}}),parent_header:_,password:w.password,prompt:w.prompt,translator:o});k.addClass("jp-OutputArea-output"),m.addWidget(k);const U=k.node.getElementsByTagName("input")[0];k.value.then(p=>{m.addClass("jp-OutputArea-stdin-hiding"),e.outputArea.model.add({output_type:"stream",name:"stdin",text:p+`
2
+ `}),U.focus(),window.setTimeout(async()=>{const h=document.activeElement;m.dispose(),h&&h instanceof HTMLElement&&h.focus();try{const E=await K(e,n,r,t,o,100,a);i.resolve(E)}catch(E){i.reject(E)}},500)}),e.outputArea.layout.addWidget(m)}else i.reject(await x.ServerConnection.ResponseError.create(u))}).catch(u=>{i.reject(new x.ServerConnection.NetworkError(u))}),i.promise}async function Ye(e,n,r,t,o,s=100,a,i=!1){return K(e,n,r,t,o,s,{onAccepted:a,recoverOutputs:i})}async function Xe(e,n,r){const t=e.model.sharedModel;t.executionState="running";try{const s=await(await Ye(e,n,{method:"GET"},r,void 0,100,void 0,!0)).json(),a=se(s.outputs??"[]");return ae(e,a),t.execution_count=s.execution_count??null,t.executionState="idle",Z(e),s.status==="ok"}catch(o){if(o instanceof x.ServerConnection.ResponseError&&o.response.status===404)return Z(e),t.executionState="idle",!1;throw o}}const N=new Set;function Qe(e,n){if(e.startsWith(n.baseUrl))return e;const r=e.startsWith("http")?new URL(e).pathname:e;return I.URLExt.join(n.baseUrl,r)}function Ze(e,n){if(We(e))return!1;const r=re(e);if(!r||N.has(r.requestId)||e.isDisposed||!e.model)return!1;N.add(r.requestId);const t=Qe(r.requestUrl,n);return console.info("[agent-runtimes] Resuming a server execution",{cellId:e.model.sharedModel.getId(),requestId:r.requestId,requestUrl:t}),Xe(e,t,n).catch(o=>{if(e.isDisposed){N.delete(r.requestId);return}console.warn(`[agent-runtimes] Failed to resume the execution ${r.requestId}.`,o)}),!0}const W=new Set;async function et(e,n,r){const t=`${r.baseUrl}#${n.id}`;if(W.has(t))return 0;const o=await x.ServerConnection.makeRequest(I.URLExt.join(r.baseUrl,`api/kernels/${n.id}/execute`),{method:"GET"},r);if(o.status===404)return W.add(t),0;if(!o.ok)throw await x.ServerConnection.ResponseError.create(o).catch(()=>new Error(`Invalid response: ${o.status} ${o.statusText}`.trim()));W.add(t);const s=await o.json();let a=0;for(const i of s.requests??[]){if(!i.cell_id||N.has(i.request_id))continue;const u=e.find(c=>c.model?.sharedModel.getId()===i.cell_id);!u||u.isDisposed||re(u)||(oe(u,{kernelId:i.kernel_id,requestId:i.request_id,requestUrl:i.request_url}),a+=1)}return a}async function tt(e){if(e.isDisposed)return 0;const n=e.sessionContext?.session?.kernel,r=n?.serverSettings;if(!n||!r)return 0;const t=e.content.widgets.filter(s=>s instanceof Ce);if(t.length===0)return 0;try{await et(t,n,r)}catch(s){console.warn("[agent-runtimes] Failed to discover the active executions of the kernel.",s)}let o=0;for(const s of t)Ze(s,r)&&(o+=1);return o}const ee=1e3,nt=3e4;function rt(e,n){f.useEffect(()=>{if(!e||!n)return;let r=0;const t=()=>{const a=ne.getState().selectNotebook(e)?.adapter?.panel;!a||a.isDisposed||tt(a)};t();const o=window.setInterval(()=>{if(r+=ee,r>=nt){window.clearInterval(o);return}t()},ee);return()=>{window.clearInterval(o)}},[e,n])}const te={cells:[{cell_type:"code",source:[""],metadata:{},outputs:[],execution_count:null}],metadata:{kernelspec:{display_name:"Python 3",language:"python",name:"python3"},language_info:{name:"python"}},nbformat:4,nbformat_minor:5};function ot({inherit:e,colorMode:n,themeConfig:r,children:t}){return e?v.jsx(v.Fragment,{children:t}):v.jsx(Ie,{colorMode:n,theme:r.primerTheme,themeStyles:r.themeStyles,children:t})}function Et({notebookId:e,runtimeName:n,runtimeOverride:r,serviceManager:t,inheritTheme:o=!1,kernelId:s,cellSidebarMargin:a=120,nbformat:i,onNbformatChange:u,toolbarComponent:c,toolbarExtraItems:_,showToolbar:w=!0,showSaveItem:m=!1,themeVariant:M,colorMode:k,collaborationProvider:U}){const p=f.useRef(i??te),h=f.useRef(e);h.current!==e&&(h.current=e,p.current=i??te);const E=p.current,F=f.useRef(JSON.stringify(E)),{runtimes:G,refetchRuntimes:L}=Me(void 0,{enabled:!!String(n||"").trim()&&!t&&!String(r?.baseUrl||"").trim()}),V=f.useMemo(()=>{const l=String(n||"").trim();if(l)return G.find(d=>String(d?.runtime_name||"")===l)},[n,G]),S=f.useMemo(()=>{const l=String(r?.baseUrl||"").trim();return l?{url:l,wsUrl:String(r?.wsUrl||"").trim()||void 0,token:String(r?.token||"").trim(),runtime_name:String(r?.runtimeName||"").trim()||"agent-node-proxy"}:V},[r,V]),z=!!(!r?.baseUrl&&String(n||"").trim()&&!S);f.useEffect(()=>{if(!z)return;L();const l=window.setInterval(()=>{L()},1e3);return()=>{window.clearInterval(l)}},[z,L]);const[ie,D]=f.useState(null),[ue,J]=f.useState(void 0),[le,$]=f.useState(!1);f.useEffect(()=>{let l=!1,d=null,b=null;const y=async()=>{const R=String(S?.url||"").trim();if(!R){l||(D(null),J(void 0),$(!1));return}try{const A=String(S?.token||"").trim(),we=String(S?.wsUrl||"").trim()||R.replace(/^http/,"ws"),ke=x.ServerConnection.makeSettings({baseUrl:R,wsUrl:we,token:A,appendToken:!0}),C=new x.ServiceManager({serverSettings:ke});if(d=C,b=Ne(String(S?.runtime_name||""),d),l){g(C);return}await C.ready,await C.kernels.refreshRunning();const X=[...C.kernels.running()][0];if(l){g(C);return}D(C),J(X?.id),$(!X)}catch(A){d&&(g(d),d=null),l||(console.warn(`[agent-runtimes] Could not reach the sandbox at ${R}.`,A),D(null),J(void 0),$(!1))}},g=R=>{b?.(),b=null,Oe(R)};return y(),()=>{l=!0,d?(g(d),d=null):(b?.(),b=null)}},[S?.runtime_name,S?.url,S?.token,S?.wsUrl]);const q=t??ie,ce=Ue(),de=s??ue,fe=t?!s:le,me=f.useMemo(()=>{if(!w)return;const l=c||De,d=m?void 0:["notebook-save","notebook-divider-file"];return!_?.length&&!d?l:function(y){return v.jsx(l,{...y,extraItems:_,hiddenItems:d})}},[w,m,c,_]),pe=!!((String(n||"").trim()||String(r?.baseUrl||"").trim())&&!q);Le(`ephemeral-notebook-start-${e}`,pe),rt(e,q??void 0),f.useEffect(()=>{if(U)return;const l=()=>{const g=ne.getState().selectNotebook(e)?.adapter;return(g?.notebook?.model??g?.panel?.content?.model??null)?.toJSON?.()??null},d=()=>{const y=l();if(!y||!Array.isArray(y.cells))return;const g=JSON.stringify(y);g!==F.current&&(F.current=g,u?.(y))},b=window.setInterval(d,500);return()=>{window.clearInterval(b),d()}},[q,e,u]);const{colorMode:he,theme:ge}=je(),B=k??he,Se=M??ge,ye=qe(),P=Te(Se),Y=B==="auto"?ye:B,T=(Y==="dark"?P.themeStyles.dark:P.themeStyles.light).backgroundColor??"",ve=f.useMemo(()=>[new Je({factory:$e})],[]),xe=f.useMemo(()=>`.datalayer/${e}.ipynb`,[e]);return v.jsx(Q,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:q&&ce?v.jsx(ot,{inherit:o,colorMode:B,themeConfig:P,children:v.jsx(Ae,{colormode:Y,backgroundColor:T,children:v.jsx(Q,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",overflow:"hidden",overscrollBehaviorY:"contain",overflowAnchor:"none",padding:2,backgroundColor:T,"& #dla-Jupyter-Notebook":{display:"flex",flexDirection:"column"},...w?{"& #dla-Jupyter-Notebook > :first-of-type":{position:"sticky",top:0,zIndex:2,flex:"0 0 auto",backgroundColor:T}}:{"& .datalayer-NotebookPanel-header":{display:"none",minHeight:0}},"& #dla-Jupyter-Notebook > .dla-Box-Notebook":{flex:"1 1 auto",minHeight:0},'& [role="toolbar"][aria-label="Notebook toolbar"]':{backgroundColor:T}},children:v.jsx(Be,{nbformat:E,id:e,path:xe,serviceManager:q,startDefaultKernel:fe,kernelId:de,height:"100%",cellSidebarMargin:a,extensions:ve,Toolbar:me,collaborationProvider:U})})})}):null})}export{Et as EphemeralNotebook,Et as default};
@@ -1 +1 @@
1
- import{r as o,j as p,K as N,bR as T,bS as z,bT as L,bU as F,bV as A,I as O,bW as U}from"../datalayer-app-main.js";import{x as _,y as W,z as $,A as M}from"./JupyterLexicalExtension-BuRLImy5.js";import H from"./ExcalidrawModal-C6SEKFlD.js";import{r as V}from"./percentages-BXMCSKIN-BihMTsFR.js";import{u as X}from"./ThemeContext-D9ztCaU3.js";import"./NotebookSkeleton-HdM76lOj.js";import"./Avatar-DbU3YP4x.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-6Hdi_m3T.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-BscOPLqE.js";import"./index-BvvaLLhn.js";import"./hoverbox-CStlKQWE.js";import"./index-BYQwy0Zx.js";import"./index-BJ7Yskx5.js";import"./color-CG7_7V2-.js";import"./isEqual-BybBNsZK.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-B3WvcNQa.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-CXLITkMD.js";import"./extends-CF3RwP-h.js";import"./index-BvgsWH_d.js";import"./index-DoBkwclg.js";const J=e=>{const n=e?.firstElementChild?.firstElementChild,b=e.getAttribute("viewBox");if(b!=null){const a=b.split(" ");e.setAttribute("width",a[2]),e.setAttribute("height",a[3])}n&&n.tagName==="style"&&n.remove()};function P({elements:e,files:n,imageContainerRef:b,appState:a,rootClassName:s=null,width:c="inherit",height:C="inherit"}){const[g,x]=o.useState(null),{theme:E}=X(g),[B,u]=o.useState(null),[v,S]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(w=>{for(const h of w)if(h.type==="attributes"&&(h.attributeName==="style"||h.attributeName==="class")){S(l=>l+1);break}});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),r.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),()=>r.disconnect()},[]),o.useEffect(()=>{(async()=>{await new Promise(D=>setTimeout(D,150));const w=["#ffffff","#000000","transparent",""],h=a?.viewBackgroundColor||"transparent",l=w.includes(h.toLowerCase()),R={...a,viewBackgroundColor:l?"transparent":a?.viewBackgroundColor,exportBackground:!l,exportWithDarkMode:E==="dark"},m=await V({appState:R,elements:e,files:n});J(m),m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("display","block"),u(m)})()},[e,n,a,E,v]);const f={};c!=="inherit"&&(f.width=`${c}px`),C!=="inherit"&&(f.height=`${C}px`);const k=a?.viewBackgroundColor||"transparent";if(["#ffffff","#000000","transparent",""].includes(k.toLowerCase())){const r=E==="dark"?"#1e1e1e":"#ffffff";f.backgroundColor=`var(--bgColor-default, var(--jp-layout-color0, var(--vscode-editor-background, ${r})))`}return p.jsx("div",{ref:r=>{x(r),r&&b&&(b.current=r)},className:s??"",style:f,dangerouslySetInnerHTML:{__html:B?.outerHTML??""}})}function Bt({nodeKey:e,data:n,width:b,height:a}){const[s]=N(),c=_(),[C,g]=o.useState(n==="[]"&&s.isEditable()),x=o.useRef(null),E=o.useRef(null),B=o.useRef(null),[u,v,S]=W(e),[f,k]=o.useState(!1);o.useEffect(()=>{if(!c){u&&S();return}return T(s.registerCommand(z,t=>{const d=E.current,i=t.target;return f?!0:d!==null&&L(i)&&d.contains(i)?(t.shiftKey||S(),v(!u),t.detail>1&&g(!0),!0):!1},F))},[S,s,u,f,v,c]);const j=o.useCallback(()=>(g(!1),s.update(()=>{const t=A(e);t&&t.remove()})),[s,e]),I=(t,d,i)=>s.update(()=>{const y=A(e);M(y)&&(t&&t.length>0||Object.keys(i).length>0?y.setData(JSON.stringify({appState:d,elements:t,files:i})):y.remove())}),r=()=>{k(!0)},w=(t,d)=>{setTimeout(()=>{k(!1)},200),s.update(()=>{const i=A(e);M(i)&&(i.setWidth(t),i.setHeight(d))})},h=o.useCallback(()=>{g(!0)},[]),{elements:l=[],files:R={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),D=o.useCallback(()=>{g(!1),l.length===0&&s.update(()=>{const t=A(e);t&&t.remove()})},[s,e,l.length]);return p.jsxs(p.Fragment,{children:[c&&C&&p.jsx(H,{initialElements:l,initialFiles:R,initialAppState:m,isShown:C,onDelete:j,onClose:D,onSave:(t,d,i)=>{I(t,d,i),g(!1)},closeOnClickOutside:!1}),l.length>0&&p.jsxs("button",{ref:E,className:`excalidraw-button ${u?"selected":""}`,children:[p.jsx(P,{imageContainerRef:x,className:"image",elements:l,files:R,appState:m,width:b,height:a}),u&&c&&p.jsx(O,{icon:U,"aria-label":"Edit the drawing",size:"small",variant:"default",sx:{position:"absolute",top:8,right:8,zIndex:10},onMouseDown:t=>t.preventDefault(),onClick:h}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:x,editor:s,onResizeStart:r,onResizeEnd:w})]})]})}export{Bt as default};
1
+ import{r as o,j as p,K as N,bS as T,bT as z,bU as L,bV as F,bW as R,I as O,bX as U}from"../datalayer-app-main.js";import{x as _,y as W,z as $,A as M}from"./JupyterLexicalExtension-Cize8RXy.js";import H from"./ExcalidrawModal-9ZnOB03n.js";import{r as X}from"./percentages-BXMCSKIN-mjCCp4uI.js";import{u as V}from"./ThemeContext-D9ztCaU3.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-9DKTscSv.js";import"./index-a51XM5L8.js";import"./hoverbox-CStlKQWE.js";import"./index-s3hayhRS.js";import"./index-CpcHHQd7.js";import"./color-CG7_7V2-.js";import"./isEqual-niFNV5MZ.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-CoM9ROsx.js";import"./extends-CF3RwP-h.js";import"./index-BvgsWH_d.js";import"./index-DoBkwclg.js";const J=e=>{const n=e?.firstElementChild?.firstElementChild,b=e.getAttribute("viewBox");if(b!=null){const a=b.split(" ");e.setAttribute("width",a[2]),e.setAttribute("height",a[3])}n&&n.tagName==="style"&&n.remove()};function P({elements:e,files:n,imageContainerRef:b,appState:a,rootClassName:s=null,width:c="inherit",height:C="inherit"}){const[g,x]=o.useState(null),{theme:E}=V(g),[B,u]=o.useState(null),[v,S]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(w=>{for(const h of w)if(h.type==="attributes"&&(h.attributeName==="style"||h.attributeName==="class")){S(l=>l+1);break}});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),r.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),()=>r.disconnect()},[]),o.useEffect(()=>{(async()=>{await new Promise(D=>setTimeout(D,150));const w=["#ffffff","#000000","transparent",""],h=a?.viewBackgroundColor||"transparent",l=w.includes(h.toLowerCase()),A={...a,viewBackgroundColor:l?"transparent":a?.viewBackgroundColor,exportBackground:!l,exportWithDarkMode:E==="dark"},m=await X({appState:A,elements:e,files:n});J(m),m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("display","block"),u(m)})()},[e,n,a,E,v]);const f={};c!=="inherit"&&(f.width=`${c}px`),C!=="inherit"&&(f.height=`${C}px`);const k=a?.viewBackgroundColor||"transparent";if(["#ffffff","#000000","transparent",""].includes(k.toLowerCase())){const r=E==="dark"?"#1e1e1e":"#ffffff";f.backgroundColor=`var(--bgColor-default, var(--jp-layout-color0, var(--vscode-editor-background, ${r})))`}return p.jsx("div",{ref:r=>{x(r),r&&b&&(b.current=r)},className:s??"",style:f,dangerouslySetInnerHTML:{__html:B?.outerHTML??""}})}function Bt({nodeKey:e,data:n,width:b,height:a}){const[s]=N(),c=_(),[C,g]=o.useState(n==="[]"&&s.isEditable()),x=o.useRef(null),E=o.useRef(null),B=o.useRef(null),[u,v,S]=W(e),[f,k]=o.useState(!1);o.useEffect(()=>{if(!c){u&&S();return}return T(s.registerCommand(z,t=>{const d=E.current,i=t.target;return f?!0:d!==null&&L(i)&&d.contains(i)?(t.shiftKey||S(),v(!u),t.detail>1&&g(!0),!0):!1},F))},[S,s,u,f,v,c]);const j=o.useCallback(()=>(g(!1),s.update(()=>{const t=R(e);t&&t.remove()})),[s,e]),I=(t,d,i)=>s.update(()=>{const y=R(e);M(y)&&(t&&t.length>0||Object.keys(i).length>0?y.setData(JSON.stringify({appState:d,elements:t,files:i})):y.remove())}),r=()=>{k(!0)},w=(t,d)=>{setTimeout(()=>{k(!1)},200),s.update(()=>{const i=R(e);M(i)&&(i.setWidth(t),i.setHeight(d))})},h=o.useCallback(()=>{g(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),D=o.useCallback(()=>{g(!1),l.length===0&&s.update(()=>{const t=R(e);t&&t.remove()})},[s,e,l.length]);return p.jsxs(p.Fragment,{children:[c&&C&&p.jsx(H,{initialElements:l,initialFiles:A,initialAppState:m,isShown:C,onDelete:j,onClose:D,onSave:(t,d,i)=>{I(t,d,i),g(!1)},closeOnClickOutside:!1}),l.length>0&&p.jsxs("button",{ref:E,className:`excalidraw-button ${u?"selected":""}`,children:[p.jsx(P,{imageContainerRef:x,className:"image",elements:l,files:A,appState:m,width:b,height:a}),u&&c&&p.jsx(O,{icon:U,"aria-label":"Edit the drawing",size:"small",variant:"default",sx:{position:"absolute",top:8,right:8,zIndex:10},onMouseDown:t=>t.preventDefault(),onClick:h}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:x,editor:s,onResizeStart:r,onResizeEnd:w})]})]})}export{Bt as default};
@@ -1 +1 @@
1
- import{r as t,j as o,D as u,bh as h,c as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-BihMTsFR.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-BuRLImy5.js";import"./NotebookSkeleton-HdM76lOj.js";import"./Avatar-DbU3YP4x.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-6Hdi_m3T.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-BscOPLqE.js";import"./index-BvvaLLhn.js";import"./hoverbox-CStlKQWE.js";import"./index-BYQwy0Zx.js";import"./index-BJ7Yskx5.js";import"./color-CG7_7V2-.js";import"./isEqual-BybBNsZK.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-B3WvcNQa.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-CXLITkMD.js";import"./extends-CF3RwP-h.js";import"./index-BvgsWH_d.js";import"./index-DoBkwclg.js";function pe({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:b}=z(w),m=t.useRef(null),E=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[D,S]=t.useState(d);t.useEffect(()=>{m.current?.focus()},[]),t.useEffect(()=>{if(!r||!n)return;const e=()=>r.refresh(),a=requestAnimationFrame(e),s=setTimeout(e,300);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(a),clearTimeout(s),window.removeEventListener("resize",e)}},[r,n]);const A=()=>{if(p?.some(e=>!e.isDeleted)){const e=r?.getAppState(),a={exportBackground:e?.exportBackground,exportScale:e?.exportScale,exportWithDarkMode:e?.theme==="dark",isBindingEnabled:e?.isBindingEnabled,isLoading:e?.isLoading,name:e?.name,theme:e?.theme,viewBackgroundColor:e?.viewBackgroundColor,viewModeEnabled:e?.viewModeEnabled,zenModeEnabled:e?.zenModeEnabled,zoom:e?.zoom};x(p,a,D)}else v()},B=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),S(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:E,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:b})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:B,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:A,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{pe as default};
1
+ import{r as t,j as o,D as u,bi as h,c as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-mjCCp4uI.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-Cize8RXy.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-9DKTscSv.js";import"./index-a51XM5L8.js";import"./hoverbox-CStlKQWE.js";import"./index-s3hayhRS.js";import"./index-CpcHHQd7.js";import"./color-CG7_7V2-.js";import"./isEqual-niFNV5MZ.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-CoM9ROsx.js";import"./extends-CF3RwP-h.js";import"./index-BvgsWH_d.js";import"./index-DoBkwclg.js";function pe({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:b}=z(w),m=t.useRef(null),E=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[D,S]=t.useState(d);t.useEffect(()=>{m.current?.focus()},[]),t.useEffect(()=>{if(!r||!n)return;const e=()=>r.refresh(),a=requestAnimationFrame(e),s=setTimeout(e,300);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(a),clearTimeout(s),window.removeEventListener("resize",e)}},[r,n]);const A=()=>{if(p?.some(e=>!e.isDeleted)){const e=r?.getAppState(),a={exportBackground:e?.exportBackground,exportScale:e?.exportScale,exportWithDarkMode:e?.theme==="dark",isBindingEnabled:e?.isBindingEnabled,isLoading:e?.isLoading,name:e?.name,theme:e?.theme,viewBackgroundColor:e?.viewBackgroundColor,viewModeEnabled:e?.viewModeEnabled,zenModeEnabled:e?.zenModeEnabled,zoom:e?.zoom};x(p,a,D)}else v()},B=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),S(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:E,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:b})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:B,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:A,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{pe as default};