@datalayer/agent-runtimes 1.5.17 → 1.5.19
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-CMBy5o1q.js → AgentDetails-jDVTZOUO.js} +1 -1
- package/dist-embed/chunks/{AgentDetailsDialog-D2vH2Nrd.js → AgentDetailsDialog-BLC4yhCo.js} +1 -1
- package/dist-embed/chunks/{AgentInspector-Bd0oHNAX.js → AgentInspector-DBI8tAJ0.js} +1 -1
- package/dist-embed/chunks/{AgentInspectorDialog-BJUgBPAE.js → AgentInspectorDialog-xW2BjxJT.js} +1 -1
- package/dist-embed/chunks/{CellSidebarExtension-CYOVwk1t.js → CellSidebarExtension-D4_DkfUV.js} +1 -1
- package/dist-embed/chunks/ChatView-CpY0werd.js +32 -0
- package/dist-embed/chunks/{ContextPie-B9mAKJc2.js → ContextPie-Cebjx8jR.js} +1 -1
- package/dist-embed/chunks/{DeckComponent-CbmzVWcF.js → DeckComponent-B0pIJhTp.js} +2 -2
- package/dist-embed/chunks/{DocumentView-BqsGfNys.js → DocumentView-CS_ILd4O.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-DLaNvwm_.js → EphemeralDocument-CwauqhmY.js} +1 -1
- package/dist-embed/chunks/{EphemeralNotebook-jnqAJFPI.js → EphemeralNotebook-BgC-YEtX.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-Cb8yeXqu.js → ExcalidrawComponent-jOeuq53P.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-DaPSGYek.js → ExcalidrawModal-RsJGL2o8.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-BQINjIFV.js → JupyterLexicalExtension-BgcLmrzO.js} +9 -9
- package/dist-embed/chunks/{KernelVariables-CGQkS5EX.js → KernelVariables-cBMhcW1H.js} +1 -1
- package/dist-embed/chunks/{LexicalToolRegistry-BJ6mpMWn.js → LexicalToolRegistry-0QBhZnFO.js} +1 -1
- package/dist-embed/chunks/{NotebookToolSurfaces-DiPifvaW.js → NotebookToolSurfaces-D1GnK3rj.js} +1 -1
- package/dist-embed/chunks/{NotebookView-IX0wNuX8.js → NotebookView-CC5s4q0A.js} +1 -1
- package/dist-embed/chunks/{Output-B9XAhyoF.js → Output-B4b0TC6x.js} +1 -1
- package/dist-embed/chunks/{SandboxDetailsDialog-COCpmo8m.js → SandboxDetailsDialog-DhH0cSRN.js} +1 -1
- package/dist-embed/chunks/{SchemaForm-WIwdKnrk.js → SchemaForm-CPiM13ub.js} +1 -1
- package/dist-embed/chunks/{WidgetVariableView-BoGROi-A.js → WidgetVariableView-CUqRH-Wi.js} +1 -1
- package/dist-embed/chunks/{YouTubePlugin-BEQBWMwx.js → YouTubePlugin-CGKNamMP.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-D3_T0Lze.js → abnfDiagram-VCTEODGH-DRoYJDMb.js} +1 -1
- package/dist-embed/chunks/{abnfDiagram-VCTEODGH-CG18Hf18.js → abnfDiagram-VCTEODGH-DqGkvvLU.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-BDWXsTdt.js → ar-SA-G6X2FPQ2-BdYlCgqh.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-B1QPAYO8.js → architectureDiagram-5GKGNRK7-B4WL7dDA.js} +1 -1
- package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-B5kSsKje.js → architectureDiagram-5GKGNRK7-BfuR2k3K.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-BGchGiT7.js → az-AZ-76LH7QW2-BAJSVApS.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-vCII6Zuq.js → bg-BG-XCXSNQG7-CutR4A8o.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-868be97b-BvM0ptp7.js → blockDiagram-868be97b-gX0yvAGO.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-ClwWG8yx.js → blockDiagram-I7D4REHJ-BzMuNIFV.js} +1 -1
- package/dist-embed/chunks/{blockDiagram-I7D4REHJ-B8BmxOM4.js → blockDiagram-I7D4REHJ-CI05Fmnw.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-Beu9yUTu.js → bn-BD-2XOGV67Q-CjPnVerm.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-3f4bdde3-S92W2yOx.js → c4Diagram-3f4bdde3-CWKvySqQ.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-CNWW_-u7.js → c4Diagram-7LVT6UL2-BVZdygZu.js} +1 -1
- package/dist-embed/chunks/{c4Diagram-7LVT6UL2-nSCKKLuX.js → c4Diagram-7LVT6UL2-BfaHhF7Y.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-CnEo6YQi.js → ca-ES-6MX7JW3Y-D0HWiwHb.js} +1 -1
- package/dist-embed/chunks/{celltoolbartracker-CO6V5FhH.js → celltoolbartracker-DB7Qnu48.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B--r8j4N5L.js → chunk-2Q5K7J3B-Ck5gIh4V.js} +1 -1
- package/dist-embed/chunks/{chunk-2Q5K7J3B-D3fTIaw3.js → chunk-2Q5K7J3B-DEZpvDtA.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-D76mXyWz.js → chunk-5VM5RSS4-BFWTcAj1.js} +1 -1
- package/dist-embed/chunks/{chunk-5VM5RSS4-QmrgOATO.js → chunk-5VM5RSS4-DVfmoMLA.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-DvNrStTM.js → chunk-F27PBJKO-BjmQwwGl.js} +1 -1
- package/dist-embed/chunks/{chunk-F27PBJKO-DdSgBnK0.js → chunk-F27PBJKO-wR8Z4fpP.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-DpxND1Ct.js → chunk-IMKFNOWR-DnYdav9f.js} +1 -1
- package/dist-embed/chunks/{chunk-IMKFNOWR-DwqmSZhU.js → chunk-IMKFNOWR-Dzk9sHxf.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-i7V3vMtZ.js → chunk-JWPE2WC7-Ble97p_W.js} +1 -1
- package/dist-embed/chunks/{chunk-JWPE2WC7-jla8jvq5.js → chunk-JWPE2WC7-DyqhVk-0.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-BGCugXU7.js → chunk-POPQ4Y6H-CQpYIqjb.js} +1 -1
- package/dist-embed/chunks/{chunk-POPQ4Y6H-ofrenTaa.js → chunk-POPQ4Y6H-CtT0-VOM.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-BIxxVjkU.js → chunk-SVP7TREG-BTtpQsSJ.js} +1 -1
- package/dist-embed/chunks/{chunk-SVP7TREG-2Q2uQyQk.js → chunk-SVP7TREG-CwdiQONE.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-BqA5q52L.js → chunk-TICWLB2K-BfGhImQo.js} +1 -1
- package/dist-embed/chunks/{chunk-TICWLB2K-LNiCmYq5.js → chunk-TICWLB2K-D3UY4Hgl.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-CqtfA3WC.js → chunk-XXDRQBXY-BaxFY2Jg.js} +1 -1
- package/dist-embed/chunks/{chunk-XXDRQBXY-CNMg_gvd.js → chunk-XXDRQBXY-a1EY5SM8.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-D6z_X195.js → classDiagram-ZZMXUADV-C0eJXn7r.js} +1 -1
- package/dist-embed/chunks/{classDiagram-ZZMXUADV-Co0jT9i-.js → classDiagram-ZZMXUADV-Cop7Dp41.js} +1 -1
- package/dist-embed/chunks/{classDiagram-f62afe4f-lN62p17q.js → classDiagram-f62afe4f-BGkVvslN.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-604399ef-B_QJ6H8h.js → classDiagram-v2-604399ef-CPwahFkc.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-D6z_X195.js → classDiagram-v2-VYDZK3BY-C0eJXn7r.js} +1 -1
- package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-Co0jT9i-.js → classDiagram-v2-VYDZK3BY-Cop7Dp41.js} +1 -1
- package/dist-embed/chunks/{code-block-IT6T5CEO-BA38Km-f.js → code-block-IT6T5CEO-DEZxRmcq.js} +1 -1
- package/dist-embed/chunks/{component-Chor_J7e.js → component-B8gGyr50.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-B5H1cwBa.js → cose-bilkent-JH36ORCC-CQ3UHpys.js} +1 -1
- package/dist-embed/chunks/{cose-bilkent-JH36ORCC-C3cTgEcU.js → cose-bilkent-JH36ORCC-whW3Ickm.js} +1 -1
- package/dist-embed/chunks/{createText-aed3d8b3-BtgHeyNs.js → createText-aed3d8b3-BdWXGDj2.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-ClBKH9_y.js → cs-CZ-2BRQDIVT-DHo-9UK-.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-sdsAonZm.js → cynefinDiagram-5FMLGOSQ-C1dAzTZy.js} +1 -1
- package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-DPQLh9z7.js → cynefinDiagram-5FMLGOSQ-DKngj3tn.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-BqFDUAty.js → da-DK-5WZEPLOC-BLw7PbxL.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-DHF-9-7e.js → dagre-GXQ25YYZ-Bom0Ow10.js} +1 -1
- package/dist-embed/chunks/{dagre-GXQ25YYZ-Bwf_WjLM.js → dagre-GXQ25YYZ-BuHKUFJc.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-6dsEQn7Z.js → de-DE-XR44H4JA-DqCVLDRk.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-DEqGRBMT.js → diagram-S7CK7UJ4-4zEkI5rV.js} +1 -1
- package/dist-embed/chunks/{diagram-S7CK7UJ4-C-N7Ei3I.js → diagram-S7CK7UJ4-H6Kef58R.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-DACyxI-v.js → diagram-UQ7AKVKN-DVAC1okH.js} +1 -1
- package/dist-embed/chunks/{diagram-UQ7AKVKN-CvSBE0YU.js → diagram-UQ7AKVKN-DeXqnBhe.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-DFze2xro.js → diagram-VSXAHHWV-BYu3Niho.js} +1 -1
- package/dist-embed/chunks/{diagram-VSXAHHWV-DOb69VtE.js → diagram-VSXAHHWV-DJvcLGGT.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-CVTSdYyZ.js → diagram-VX7I27RA-BeOTI_JX.js} +1 -1
- package/dist-embed/chunks/{diagram-VX7I27RA-8EKYM_Sx.js → diagram-VX7I27RA-Cd39Txmj.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-B-689FF6.js → diagram-Z3DM3KII-Ccg8IzPs.js} +1 -1
- package/dist-embed/chunks/{diagram-Z3DM3KII-DyiBmBFy.js → diagram-Z3DM3KII-DV4M-vr2.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-DcKvqn_h.js → ebnfDiagram-PWID7BFC-Ci7iqdKR.js} +1 -1
- package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-gj8dgCWR.js → ebnfDiagram-PWID7BFC-JrHbupeR.js} +1 -1
- package/dist-embed/chunks/{edges-b2856ca0-BqGGNnb4.js → edges-b2856ca0-D0Ve_cWg.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-DOMW2ttY.js → el-GR-BZB4AONW-DWIe_es3.js} +1 -1
- package/dist-embed/chunks/{erDiagram-5d81789a-Bf1Ik49K.js → erDiagram-5d81789a-_wYWwZkR.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-B0PyZB_3.js → erDiagram-RLTQ6QDP-CgP-DSWO.js} +1 -1
- package/dist-embed/chunks/{erDiagram-RLTQ6QDP-GSu-_IUJ.js → erDiagram-RLTQ6QDP-D2UUMLBd.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-DeyWqjw1.js → es-ES-U4NZUMDT-C4nVLuzt.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-CUGbZ0Pv.js → eu-ES-A7QVB2H4-DNtU9lgI.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-Br8UEVO1.js → fa-IR-HGAKTJCU-C9d2dVkk.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-BSHjwo8G.js → fi-FI-Z5N7JZ37-BtMDQ3ec.js} +1 -1
- package/dist-embed/chunks/{flowDb-185abca5-U9PwWSO4.js → flowDb-185abca5-w4ZLOMwa.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-1629c991-BecgzQgp.js → flowDiagram-1629c991-CrRVLCnt.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-2vih3kWM.js → flowDiagram-HODETNUW-BJpTxK5i.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-HODETNUW-tcAkcGh4.js → flowDiagram-HODETNUW-DtWilAWc.js} +1 -1
- package/dist-embed/chunks/{flowDiagram-v2-1d953310-Bdmc9G3m.js → flowDiagram-v2-1d953310-tzv2aPj8.js} +1 -1
- package/dist-embed/chunks/{flowchart-elk-definition-6df44142-oWOWsVNc.js → flowchart-elk-definition-6df44142-C8Gjf4Dy.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-BukqZYPz.js → fr-FR-RHASNOE6-D1fqP_vI.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-3b0b3873-B7lmD9r9.js → ganttDiagram-3b0b3873-WkbnZ3Zy.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-D0E7se_Z.js → ganttDiagram-EL5Y4UJY-B1hq5rq9.js} +1 -1
- package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-DDbqMevq.js → ganttDiagram-EL5Y4UJY-DiSce27A.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-DK3EJl5z.js → gitGraphDiagram-WWUBYQGX-BoqOxrkd.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-DnVwXJWu.js → gitGraphDiagram-WWUBYQGX-Dfl4EOB8.js} +1 -1
- package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-B9vpLy6R.js → gitGraphDiagram-f01e8bc2-DxsYooak.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-BxVOJiaI.js → gl-ES-HMX3MZ6V-BkLcCFrx.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-Dv2VRxlJ.js → he-IL-6SHJWFNN-By48peS7.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-CFo5RUMz.js → hi-IN-IWLTKZ5I-386dm1ZK.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-ul3dS3un.js → hu-HU-A5ZG7DT2-B2wmIkDO.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-ItVb-zwI.js → id-ID-SAP4L64H-Bc22Fq5f.js} +1 -1
- package/dist-embed/chunks/{index-9bae90f3-D9849sgo.js → index-9bae90f3-0dEQW6X4.js} +1 -1
- package/dist-embed/chunks/{index-oGqh9y23.js → index-B2eXWNhX.js} +1 -1
- package/dist-embed/chunks/{index-DSvebR7d.js → index-B5UP_2-0.js} +1 -1
- package/dist-embed/chunks/{index-YlGTgJvL.js → index-BEuw5cVO.js} +1 -1
- package/dist-embed/chunks/{index-CsgaCZaW.js → index-BMlDZi3F.js} +1 -1
- package/dist-embed/chunks/{index-BNFRRs9d.js → index-BW1nTf3r.js} +1 -1
- package/dist-embed/chunks/{index-xiH3WzLm.js → index-Ba1_ej_S.js} +1 -1
- package/dist-embed/chunks/{index-CjM49jS0.js → index-Bf3G_UXi.js} +1 -1
- package/dist-embed/chunks/{index-BOYhJnrD.js → index-BlBHM8M3.js} +1 -1
- package/dist-embed/chunks/{index-B5zrJYwn.js → index-Bw3Ijhff.js} +1 -1
- package/dist-embed/chunks/{index-BT4vYFeY.js → index-C5TEB73S.js} +1 -1
- package/dist-embed/chunks/{index-BkKEXqQS.js → index-CD5d-0QJ.js} +1 -1
- package/dist-embed/chunks/{index-D2LvuQlP.js → index-CTSvc7kN.js} +1 -1
- package/dist-embed/chunks/{index-B-L6ocEV.js → index-CaBZ6zn5.js} +1 -1
- package/dist-embed/chunks/{index-DSF21-29.js → index-Ce0tqSYG.js} +1 -1
- package/dist-embed/chunks/{index-BfUXEHI0.js → index-CeDsYtrC.js} +1 -1
- package/dist-embed/chunks/{index-Cp2aJ2ZR.js → index-Ckzgd1GV.js} +1 -1
- package/dist-embed/chunks/{index-jh9S19of.js → index-Crj6AD3D.js} +1 -1
- package/dist-embed/chunks/{index-bm8APcDZ.js → index-Cs7fNnHI.js} +4 -4
- package/dist-embed/chunks/{index-DoBEQ07P.js → index-D2V9YBSL.js} +2 -2
- package/dist-embed/chunks/{index-B764si9c.js → index-D4xDU_cs.js} +1 -1
- package/dist-embed/chunks/{index-O2jaI8TY.js → index-DB3vaYGl.js} +1 -1
- package/dist-embed/chunks/{index-B0wMyD8Y.js → index-DGpvT0SW.js} +1 -1
- package/dist-embed/chunks/{index-CRpZyQIR.js → index-DIGoR1Tz.js} +4 -4
- package/dist-embed/chunks/{index-CZdWsyNw.js → index-DTF28A2w.js} +1 -1
- package/dist-embed/chunks/{index-7FNjj0f2.js → index-DdBEMKdr.js} +1 -1
- package/dist-embed/chunks/{index-BrD9dtoV.js → index-DiBjbJad.js} +1 -1
- package/dist-embed/chunks/{index-BM6oRiO1.js → index-DkAo6nTX.js} +1 -1
- package/dist-embed/chunks/{index-TEcp7-f6.js → index-DmlogZBL.js} +2 -2
- package/dist-embed/chunks/{index-Cql9gOsL.js → index-DmzlqRz3.js} +1 -1
- package/dist-embed/chunks/{index-CsxlyZef.js → index-DodMg2uF.js} +1 -1
- package/dist-embed/chunks/{index-BiTIdbkn.js → index-DwKNt0FO.js} +1 -1
- package/dist-embed/chunks/{index-BqMoyzEk.js → index-I5uUezOA.js} +1 -1
- package/dist-embed/chunks/{index-DQQXY-7d.js → index-TzvZ9g2T.js} +2 -2
- package/dist-embed/chunks/{index-QZ3sHHT3.js → index-wWGi6oM9.js} +10 -10
- package/dist-embed/chunks/{index.esm-CkSite-X.js → index.esm-DFA6Rod9.js} +1 -1
- package/dist-embed/chunks/{index.esm-B7KoTOBb.js → index.esm-De-JJWit.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-DDO50Ria.js → infoDiagram-27XIBGKW-B6fdV0Xc.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-27XIBGKW-O3q53Qe2.js → infoDiagram-27XIBGKW-C6J796kn.js} +1 -1
- package/dist-embed/chunks/{infoDiagram-a29d40f1-jOvOHUyu.js → infoDiagram-a29d40f1-BjFaAu0-.js} +1 -1
- package/dist-embed/chunks/isEqual-BxgGIFfN.js +1 -0
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-DuiWhpVW.js → ishikawaDiagram-5VMMS53U-CZVbbiJE.js} +1 -1
- package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-IzmbYzxv.js → ishikawaDiagram-5VMMS53U-sjolONOj.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-BuCUBzia.js → it-IT-JPQ66NNP-Cyadykvb.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-BhtQz4sy.js → ja-JP-DBVTYXUO-DYq7TJf3.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-sO-Cfp65.js → journeyDiagram-3NMN7TZE-BJ-6GyhB.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-DGLcsVfC.js → journeyDiagram-3NMN7TZE-CNoB-K6t.js} +1 -1
- package/dist-embed/chunks/{journeyDiagram-95396277-CA4bGq0G.js → journeyDiagram-95396277-E32TRIvj.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-B_TI8Aa0.js → kaa-6HZHGXH3-qdjcAwd_.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-BsSg_l-j.js → kab-KAB-ZGHBKWFO-DHVNVHkT.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-CDtLkjnU.js → kanban-definition-UXKFOSKX-2elwU70n.js} +1 -1
- package/dist-embed/chunks/{kanban-definition-UXKFOSKX-0wjvwDqk.js → kanban-definition-UXKFOSKX-ZErtzIYn.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-B7XK5OQq.js → kk-KZ-P5N5QNE5-DtQCYXHl.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-Cm2LA9F8.js → km-KH-HSX4SM5Z-B_GLLzdn.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-CL5s99y5.js → ko-KR-MTYHY66A-B8OMm-h5.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-CiijvKHq.js → ku-TR-6OUDTVRD-_gB3JeJW.js} +1 -1
- package/dist-embed/chunks/{layout-CzrlbzeK.js → layout-DV2JdCx0.js} +1 -1
- package/dist-embed/chunks/{layout-BBbB54WC.js → layout-Di1pO_ld.js} +1 -1
- package/dist-embed/chunks/{lexicalHooks-DQxNZEiJ.js → lexicalHooks-DuWTjfdx.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-CcA_Z5jR.js → lt-LT-XHIRWOB4-judKfepg.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-CAQS9wGm.js → lv-LV-5QDEKY6T-C-9ZhYTf.js} +1 -1
- package/dist-embed/chunks/{mermaid.core-DfgoT1cz.js → mermaid.core-CH9h-G6m.js} +3 -3
- package/dist-embed/chunks/{mermaid.core-s-D09gpV.js → mermaid.core-DmeLLEp4.js} +5 -5
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-BCiSPRJk.js → mindmap-definition-YA3MSWOX-CH32-IRq.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-B6_K5ZvV.js → mindmap-definition-YA3MSWOX-DQTfxlEc.js} +1 -1
- package/dist-embed/chunks/{mindmap-definition-e4c1d938-D7gmABiC.js → mindmap-definition-e4c1d938-BgjFyiku.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-DMAAvsDA.js → mr-IN-CRQNXWMA-B7W8v3Ft.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-t2TKqrjW.js → my-MM-5M5IBNSE-e3nyuoTM.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-Bi3ZI-HQ.js → nb-NO-T6EIAALU-Dq2hr8f4.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-B8UdlW1K.js → nl-NL-IS3SIHDZ-BPpJK4bx.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-Bt87hI27.js → nn-NO-6E72VCQL-TlFEoum0.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-009NL0Pk.js → oc-FR-POXYY2M6-CnSPPsW-.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-BfUtS2yt.js → pa-IN-N4M65BXN-DOLWrPsW.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-CBrnWUaX.js → pegDiagram-XKGWAZYB-n8BSl7l3.js} +1 -1
- package/dist-embed/chunks/{pegDiagram-XKGWAZYB-BX0ZYMng.js → pegDiagram-XKGWAZYB-oyZR3LwE.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-CfzulzOv.js → percentages-BXMCSKIN-CGGUos_k.js} +5 -5
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-Ct8dzoLU.js → pieDiagram-E7YTZNPT-BW48oEVe.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-E7YTZNPT-B1My5W85.js → pieDiagram-E7YTZNPT-t7G_PNXz.js} +1 -1
- package/dist-embed/chunks/{pieDiagram-c941bede-7DZ-Bl8U.js → pieDiagram-c941bede-Ci9AzDtZ.js} +1 -1
- package/dist-embed/chunks/{pl-PL-T2D74RX3-DbtOl9_x.js → pl-PL-T2D74RX3-hlaxloT-.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-B1pjR1_T.js → pt-BR-5N22H2LF-Zzt5dIRi.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-takC7TRa.js → pt-PT-UZXXM6DQ-DclavEOo.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-B1mlT7fN.js → quadrantDiagram-AXDQQJYC-BLT8OFPd.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-B7p4unpj.js → quadrantDiagram-AXDQQJYC-CqCRrPOH.js} +1 -1
- package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-CTMh_Ad5.js → quadrantDiagram-cf8b8fe0-CCwvL59h.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-CJEwr5d9.js → railroadDiagram-O6MQD6OU-CArU1lc_.js} +1 -1
- package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-xr8bPIl7.js → railroadDiagram-O6MQD6OU-h7bwNVOI.js} +1 -1
- package/dist-embed/chunks/{renderer-Ba0Cwb4p.js → renderer-B7ulbNbj.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-53bda41b-Dv1Piop_.js → requirementDiagram-53bda41b-DwpbUtUG.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-Bw89vFiC.js → requirementDiagram-BXWQKSXE-DjSU8lt8.js} +1 -1
- package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-rabT3v-j.js → requirementDiagram-BXWQKSXE-DouRs4yi.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-DkkqyFBF.js → ro-RO-JPDTUUEW-cgDkcR_I.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CikD-ITp.js → ru-RU-B4JR7IUQ-9-oBtsiZ.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-D--cx9I2.js → sankeyDiagram-P5KCCOFB-CBWfRlJB.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-5SpI76uK.js → sankeyDiagram-P5KCCOFB-DjzmT1hm.js} +1 -1
- package/dist-embed/chunks/{sankeyDiagram-c3ef121a-DbhtSWkB.js → sankeyDiagram-c3ef121a-9XuKuXG6.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-82a5b84f-DpxBSKAk.js → sequenceDiagram-82a5b84f-BG9YQ6K-.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-D_wK-z7a.js → sequenceDiagram-WJ2MYXX4-B9mfZJzJ.js} +1 -1
- package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-DGNwWgf8.js → sequenceDiagram-WJ2MYXX4-CosODaLN.js} +1 -1
- package/dist-embed/chunks/{sessions-DQkTozai.js → sessions-D0uw83Dx.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-BqlWRhwK.js → si-LK-N5RQ5JYF-DwwdanqB.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-4Uh8JUjf.js → sizeCapture-INFHLROL-CwVsdbq8.js} +1 -1
- package/dist-embed/chunks/{sizeCapture-INFHLROL-g-K-6XON.js → sizeCapture-INFHLROL-H5_9Te0l.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-DGsmi02E.js → sk-SK-C5VTKIMK-Bx7Xeegg.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-HFz45GOs.js → sl-SI-NN7IZMDC-BnRYm8hb.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-43e79a5f-DxbV4jP9.js → stateDiagram-43e79a5f-DqSNbxpV.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-D-l3u-WY.js → stateDiagram-D77RDMKH-CFvF2i-n.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-D77RDMKH-C_wYpqah.js → stateDiagram-D77RDMKH-CM0rQJN-.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-BzxzaDdI.js → stateDiagram-v2-2041ed4f-DEAOSRqx.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-IEMNMwm0.js → stateDiagram-v2-MP3YSRHH-BNF3zl7F.js} +1 -1
- package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-BGYkOvTS.js → stateDiagram-v2-MP3YSRHH-x4Ke6-d0.js} +1 -1
- package/dist-embed/chunks/{styles-455b33cd-C42Lyulv.js → styles-455b33cd-CGv1xv-g.js} +1 -1
- package/dist-embed/chunks/{styles-f932cba9-Bf6H3IMq.js → styles-f932cba9-BcvypeEH.js} +1 -1
- package/dist-embed/chunks/{styles-fcc2142b-OZg6fE-p.js → styles-fcc2142b-Bm-8o0Wg.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-KC0vshev.js → subset-shared.chunk-E0MJmgRL.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-CXZAV_Z5.js → subset-worker.chunk-C8uhAh2D.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-yEdPvwHy.js → sv-SE-XGPEYMSR-CsQ6HfG0.js} +1 -1
- package/dist-embed/chunks/{svgDrawCommon-148a3cd9-D9MRwoYw.js → svgDrawCommon-148a3cd9-CfBqsI2Z.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-CPkom4Q8.js → swimlanes-42K2YHIH-C5u-jMMX.js} +1 -1
- package/dist-embed/chunks/{swimlanes-42K2YHIH-DJLFcHMt.js → swimlanes-42K2YHIH-DSy5A1Br.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BJOhuN-y.js → swimlanesDiagram-VR7AAH4N-DiCCWeyH.js} +1 -1
- package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-BRTtY1QX.js → swimlanesDiagram-VR7AAH4N-Dz7sQXaA.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-0i424YGX.js → ta-IN-2NMHFXQM-fGjZyqzP.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-BidF5zNO.js → th-TH-HPSO5L25-mRygXByj.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-BasSLg-_.js → timeline-definition-24CTP7MA-BbGhqNW7.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-24CTP7MA-BfGIJi1H.js → timeline-definition-24CTP7MA-YHoSditW.js} +1 -1
- package/dist-embed/chunks/{timeline-definition-7545f45a-BWwgvKxJ.js → timeline-definition-7545f45a-Cgha50uP.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-BoHR9SlC.js → tr-TR-DEFEU3FU-CSMtrw8Q.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-DfRkqqO0.js → uk-UA-QMV73CPH-CLyS0aEW.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-D1T__rd2.js → vennDiagram-4TSXK5OY-CP_KbGdD.js} +1 -1
- package/dist-embed/chunks/{vennDiagram-4TSXK5OY-DMIYCfJ-.js → vennDiagram-4TSXK5OY-DEMghTP3.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-CvZ4wpTw.js → vi-VN-M7AON7JQ-DI90c6Zt.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-DtlNUHLy.js → wardleyDiagram-VM6X3IG4-BKwp7C6o.js} +1 -1
- package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-CiKuFI26.js → wardleyDiagram-VM6X3IG4-CBfVN6X9.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-3f383b91-DzyuxW4K.js → xychartDiagram-3f383b91-CyeoV8HA.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-p6pYRkk6.js → xychartDiagram-S5SC5T6Z-BdfPJ1NZ.js} +1 -1
- package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-BIeFUHrS.js → xychartDiagram-S5SC5T6Z-DOiTJUlh.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-Cx1Azgu2.js → zh-CN-LNUGB5OW-BhtQOj8w.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-DMjy1d4Z.js → zh-HK-E62DVLB3-BwejmqFd.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-J-YjINmR.js → zh-TW-RAJ6MFWO-CXYEZutZ.js} +1 -1
- package/dist-embed/datalayer-app-main.js +85 -85
- package/lib/apps/apps/appspec.d.ts +31 -1
- package/lib/apps/apps/appspec.js +66 -15
- package/lib/apps/plugins/chat/ChatView.js +31 -4
- package/lib/chat/ChatFloating.js +12 -4
- package/lib/chat/base/ChatBase.js +31 -5
- package/lib/chat/messages/ChatMessageList.js +1 -1
- package/lib/examples/AgentA2ATeamExample.js +6 -5
- package/lib/examples/ChatExample.js +2 -2
- package/lib/examples/VoiceChatExample.js +9 -3
- package/lib/hooks/ownRoutes.d.ts +27 -0
- package/lib/hooks/ownRoutes.js +33 -0
- package/lib/hooks/useAgentRuntimes.d.ts +5 -0
- package/lib/hooks/useAgentRuntimes.js +29 -26
- package/lib/hooks/useBrowserAgent.d.ts +1 -1
- package/lib/hooks/useBrowserAgent.js +1 -1
- package/lib/protocols/AGUIAdapter.d.ts +11 -0
- package/lib/protocols/AGUIAdapter.js +27 -2
- package/lib/specs/apps.d.ts +32 -32
- package/lib/specs/apps.js +620 -139
- package/lib/specs/protocols.js +2 -2
- package/lib/specs/scenes.js +7 -7
- package/lib/specs/teams/teams.js +11 -11
- package/lib/specs/voices.d.ts +4 -0
- package/lib/specs/voices.js +10 -0
- package/lib/types/agentspecs.d.ts +5 -0
- package/lib/types/chat.d.ts +6 -0
- package/lib/types/protocol.d.ts +17 -0
- package/lib/utils/utils.js +8 -1
- package/lib/voice/ReadAloud.d.ts +35 -0
- package/lib/voice/ReadAloud.js +29 -0
- package/lib/voice/hearing.js +5 -3
- package/lib/voice/index.d.ts +7 -2
- package/lib/voice/index.js +1 -0
- package/lib/voice/pinned.d.ts +3 -1
- package/lib/voice/pinned.js +17 -3
- package/package.json +2 -2
- package/scripts/codegen/generate_agents.py +34 -2
- package/scripts/codegen/generate_voices.py +8 -1
- package/scripts/voice/measure.py +9 -4
- package/scripts/voice/pin_store.py +11 -5
- package/scripts/voice/serve_store.py +2 -2
- package/dist-embed/chunks/ChatView-Dr-1g_cg.js +0 -32
- package/dist-embed/chunks/isEqual-CGLTk7wU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{J as L,ag as D,ak as w,dD as q,r as W,v as I,ai as T,dE as k,dF as M,dG as V,dH as K,cG as G,dI as $}from"../datalayer-app-main.js";import{K as j,b as F,c as z,P as U,d as J,I as E,e as N,f as X}from"./index-
|
|
1
|
+
import{J as L,ag as D,ak as w,dD as q,r as W,v as I,ai as T,dE as k,dF as M,dG as V,dH as K,cG as G,dI as $}from"../datalayer-app-main.js";import{K as j,b as F,c as z,P as U,d as J,I as E,e as N,f as X}from"./index-TzvZ9g2T.js";import{a as Q}from"./tokens-_fLcuFXz.js";import{I as B}from"./tokens-BHLmeqjP.js";import{I as H}from"./CellSidebarExtension-D4_DkfUV.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./index-I5uUezOA.js";import"./color-CG7_7V2-.js";import"./isEqual-BxgGIFfN.js";import"./defaultLocale-5voVPcsN.js";import"./renderer-B7ulbNbj.js";import"./SquareIcon-e3ygcjpv.js";const A="CompletionProvider:context";class Y{constructor(){this.identifier=A,this.rank=500,this.renderer=null}async isApplicable(t){return!0}fetch(t,e){const n=e.editor;return n?new Promise(i=>{i(R.contextHint(n))}):Promise.reject("No editor")}}var R;(function(a){function t(n){const i=n.getTokenAtCursor(),r=e(i,n).filter(c=>c.type).map(c=>c.value),m=new Set(r),u=new Array;return m.forEach(c=>u.push({label:c})),{start:i.offset,end:i.offset+i.value.length,items:u}}a.contextHint=t;function e(n,i){return i.getTokens().filter(r=>r.value.indexOf(n.value)===0&&r.value!==n.value)}})(R||(R={}));class Z{constructor(){this._activeProviders=new Set([j,A]),this._inlineCompleterSettings=H.defaultSettings,this._providers=new Map,this._inlineProviders=new Map,this._panelHandlers=new Map,this._mostRecentContext=new Map,this._activeProvidersChanged=new L(this),this._selected=new L(this),this._inlineCompleterFactory=null}get activeProvidersChanged(){return this._activeProvidersChanged}get selected(){return this._selected}setTimeout(t){this._timeout=t}setShowDocumentationPanel(t){this._panelHandlers.forEach(e=>e.completer.showDocsPanel=t),this._showDoc=t}setSuppressIfInlineCompleterActive(t){this._panelHandlers.forEach(e=>e.completer.suppressIfInlineCompleterActive=t),this._suppressIfInlineCompleterActive=t}setContinuousHinting(t){this._panelHandlers.forEach(e=>e.autoCompletion=t),this._autoCompletion=t}registerProvider(t){const e=t.identifier;this._providers.has(e)?console.warn(`Completion provider with identifier ${e} is already registered`):(this._providers.set(e,t),this._panelHandlers.forEach((n,i)=>{this.updateCompleter(this._mostRecentContext.get(i))}))}registerInlineProvider(t){const e=t.identifier;this._inlineProviders.has(e)?console.warn(`Completion provider with identifier ${e} is already registered`):(this._inlineProviders.set(e,t),this._panelHandlers.forEach((n,i)=>{this.updateCompleter(this._mostRecentContext.get(i))}))}getProviders(){return this._providers}activateProvider(t){this._activeProviders=new Set([]),t.forEach(e=>{this._providers.has(e)&&this._activeProviders.add(e)}),this._activeProviders.size===0&&(this._activeProviders.add(j),this._activeProviders.add(A)),this._activeProvidersChanged.emit()}async updateCompleter(t){var e,n;const{widget:i,editor:o,sanitizer:r}=t,m=i.id,u=this._panelHandlers.get(m),c=[...this._activeProviders][0],l=this._providers.get(c);let _=(e=l?.renderer)!==null&&e!==void 0?e:F.getDefaultRenderer(r);const s=l?.modelFactory;let d;s?d=await s.call(l,t):d=new z,this._mostRecentContext.set(i.id,t);const f={model:d,editor:o,renderer:_,sanitizer:r,showDoc:this._showDoc};if(u){const h=u.completer;(n=h.model)===null||n===void 0||n.dispose(),h.model=f.model,h.renderer=f.renderer,h.showDocsPanel=f.showDoc,h.suppressIfInlineCompleterActive=this._suppressIfInlineCompleterActive,u.autoCompletion=this._autoCompletion,o&&(u.editor=o,u.reconciliator=await this.generateReconciliator(t))}else{const h=await this._generateHandler(t,f);this._panelHandlers.set(i.id,h),h.completer.selected.connect((p,g)=>this._selected.emit({insertText:g})),i.disposed.connect(p=>{this.disposeHandler(p.id,h),this._mostRecentContext.delete(m)})}}invoke(t){const e=this._panelHandlers.get(t);e&&e.invoke()}select(t){const e=this._panelHandlers.get(t);e&&e.completer.selectActive()}setInlineCompleterFactory(t){this._inlineCompleterFactory=t,this._panelHandlers.forEach((e,n)=>{this.updateCompleter(this._mostRecentContext.get(n))}),!this.inline&&(this.inline={invoke:e=>{const n=this._panelHandlers.get(e);n&&n.inlineCompleter&&n.invokeInline()},isActive:e=>{const n=this._panelHandlers.get(e);return n&&n.inlineCompleter?n.inlineCompleter.isActive:!1},cycle:(e,n)=>{const i=this._panelHandlers.get(e);i&&i.inlineCompleter&&i.inlineCompleter.cycle(n)},accept:e=>{const n=this._panelHandlers.get(e);n&&n.inlineCompleter&&n.inlineCompleter.accept()},configure:e=>{this._inlineCompleterSettings=e;for(const[n,i]of this._inlineProviders.entries())i.configure&&i.configure(e.providers[n]);this._panelHandlers.forEach((n,i)=>{n.inlineCompleter&&n.inlineCompleter.configure(e),this.updateCompleter(this._mostRecentContext.get(i))})}})}get inlineProviders(){return[...this._inlineProviders.values()]}async generateReconciliator(t){const e=[];for(const[o,r]of Object.entries(this._inlineCompleterSettings.providers))r.enabled===!0&&e.push(o);const n=[...this._inlineProviders.values()].filter(o=>e.includes(o.identifier)),i=[];for(const o of this._activeProviders){const r=this._providers.get(o);r&&i.push(r)}return new U({context:t,providers:i,inlineProviders:n,inlineProvidersSettings:this._inlineCompleterSettings.providers,timeout:this._timeout})}disposeHandler(t,e){var n,i,o,r;(n=e.completer.model)===null||n===void 0||n.dispose(),e.completer.dispose(),(o=(i=e.inlineCompleter)===null||i===void 0?void 0:i.model)===null||o===void 0||o.dispose(),(r=e.inlineCompleter)===null||r===void 0||r.dispose(),e.dispose(),this._panelHandlers.delete(t)}async _generateHandler(t,e){const n=new F(e),i=this._inlineCompleterFactory?this._inlineCompleterFactory.factory({...e,model:new H.Model}):void 0;n.hide(),D.attach(n,document.body),i&&(D.attach(i,document.body),i.hide(),i.configure(this._inlineCompleterSettings));const o=await this.generateReconciliator(t),r=new J({completer:n,inlineCompleter:i,reconciliator:o});return r.editor=t.editor,r}}class ee{constructor(t){this.options=t,this.identifier="@jupyterlab/inline-completer:history",this._maxSuggestions=100;const e=t.translator||w;this._trans=e.load("jupyterlab")}get name(){return this._trans.__("History")}get icon(){return q}get schema(){return{properties:{maxSuggestions:{title:this._trans.__("Maximum number of suggestions"),description:this._trans.__("The maximum number of suggestions to retrieve from history."),type:"number"}},default:{enabled:!1,maxSuggestions:100}}}configure(t){var e;this._maxSuggestions=(e=t.maxSuggestions)!==null&&e!==void 0?e:100}async fetch(t,e,n){var i;const o=(i=e.session)===null||i===void 0?void 0:i.kernel;if(!o)throw new Error("No kernel for completion request.");const m=t.text.slice(0,t.offset).split(`
|
|
2
2
|
`).slice(-1)[0],u=t.text.slice(t.offset).split(`
|
|
3
3
|
`)[0];let c;const l=[];if(m===""){c={output:!1,raw:!0,hist_access_type:"tail",n:this._maxSuggestions};const _=await o.requestHistory(c);if(_.content.status==="ok"){let s=_.content.history;const d=new Map;for(const p of s.reverse()){const g=p[2];d.set(g,(d.get(g)||0)+1)}const h=Array.from(d.entries()).sort((p,g)=>p[1]>g[1]?-1:p[1]<g[1]?1:0);for(const p of h)l.push({insertText:p[0]})}}else{c={output:!1,raw:!0,hist_access_type:"search",pattern:m+"*"+(u?u+"*":""),unique:!0,n:this._maxSuggestions};const _=await o.requestHistory(c);if(_.content.status==="ok")for(const s of _.content.history){const d=s[2].split(`
|
|
4
4
|
`);for(let f=0;f<d.length;f++){const h=d[f];if(h.startsWith(m)){let p=h.slice(m.length);f+1<d.length&&(p+=`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,c1 as S,ef as I,dH as K,eg as x,eh as E,ei as A,ej as R,af as T,v as F,ai as L,ak as B,J as O,d9 as M,cG as D,cS as q}from"../datalayer-app-main.js";import{o as H}from"./index-TEcp7-f6.js";import{a as U}from"./tokens-_fLcuFXz.js";import{I as W}from"./tokens-BHLmeqjP.js";import"./Output-B9XAhyoF.js";import"./index-DoBEQ07P.js";import"./hoverbox-CStlKQWE.js";import"./index-DQQXY-7d.js";import"./index-BqMoyzEk.js";import"./color-CG7_7V2-.js";import"./isEqual-CGLTk7wU.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./PaintbrushIcon-CLU8RilX.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./CellSidebarExtension-CYOVwk1t.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./renderer-Ba0Cwb4p.js";import"./SquareIcon-e3ygcjpv.js";import"./SortAscIcon-CVKVWIWQ.js";import"./url-DuKx0yk0.js";/* empty css */import"./index-Dro44tIm.js";/* empty css *//* empty css */import"./index-DsG9xhMj.js";/* empty css */import"./index-CNU-WVhQ.js";import"./index--OLIX362.js";import"./index-DYGslHkf.js";import"./index-BSRVX3UN.js";import"./index-BH2OX5l8.js";import"./index-C3vDfO5_.js";import"./index-Ko8lxXFd.js";import"./index-CB9u17_J.js";import"./index-BUVtc_FV.js";import"./ArrowLeftIcon-Y3PTljcl.js";import"./SkubbleIcon-tlg17jBG.js";import"./usePrimerThemeBridge-CoHussa9.js";import"./index-jh9S19of.js";import"./KernelVariables-CGQkS5EX.js";import"./index-BvgsWH_d.js";import"./SortDescIcon-CS4EzHeS.js";import"./NotebookToolbar-rtMQZWHQ.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-CGQDY041.js";import"./sessions-DQkTozai.js";import"./tokens-DTIgYcNS.js";import"./drivecontents-CxwZz_5W.js";import"./kernel-BI-BLP-K.js";var _;(function(a){a.editBinding="shortcuts:edit-keybinding",a.addBinding="shortcuts:add-keybinding",a.deleteBinding="shortcuts:delete-keybinding",a.toggleSelectors="shortcuts:toggle-selectors",a.resetAll="shortcuts:reset-all"})(_||(_={}));const j="jp-Shortcuts-ConflictContainer";class C extends o.Component{constructor(e){super(e),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?this.props.toggleInput():await this._updateShortcut():(await this._updateShortcut(),this.props.toggleInput())},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this._handleOverwrite=async(t,i)=>{for(const s of t){const n=s.keybindings.filter(r=>S.deepEqual(r.keys,i)||i.some(h=>S.deepEqual(r.keys,[h])))[0];if(!n){console.error(`Conflicting binding could not be found for ${s} using keys ${i}`);continue}await this.props.deleteKeybinding(s,n)}await this._updateShortcut()},this.parseChaining=(t,i,s,n,r)=>{let h=I.keyForKeydownEvent(t.nativeEvent);const m=["Shift","Control","Alt","Meta","Ctrl","Accel"];if(t.key==="Backspace")s="",i="",n=[],r="",this.setState({value:i,userInput:s,keys:n,currentChain:r});else if(t.key!=="CapsLock"){const y=s.substr(s.lastIndexOf(" ")+1,s.length).trim();m.lastIndexOf(y)===-1&&y!=""?(s=s+",",n.push(r),r="",t.ctrlKey&&t.key!="Control"&&(s=(s+" Ctrl").trim(),r=(r+" Ctrl").trim()),t.metaKey&&t.key!="Meta"&&(s=(s+" Accel").trim(),r=(r+" Accel").trim()),t.altKey&&t.key!="Alt"&&(s=(s+" Alt").trim(),r=(r+" Alt").trim()),t.shiftKey&&t.key!="Shift"&&(s=(s+" Shift").trim(),r=(r+" Shift").trim()),m.lastIndexOf(t.key)===-1?(s=(s+" "+h).trim(),r=(r+" "+h).trim()):t.key==="Meta"?(s=(s+" Accel").trim(),r=(r+" Accel").trim()):t.key==="Control"?(s=(s+" Ctrl").trim(),r=(r+" Ctrl").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),r=(r+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),r=(r+" Alt").trim()):(s=(s+" "+t.key).trim(),r=(r+" "+t.key).trim())):t.key==="Control"?(s=(s+" Ctrl").trim(),r=(r+" Ctrl").trim()):t.key==="Meta"?(s=(s+" Accel").trim(),r=(r+" Accel").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),r=(r+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),r=(r+" Alt").trim()):(s=(s+" "+h).trim(),r=(r+" "+h).trim())}return this.setState({keys:n,currentChain:r}),[s,n,r]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],i=this.state.currentChain.split(" "),s=i[i.length-1];return this.setState({isFunctional:t.indexOf(s)===-1}),t.indexOf(s)!==-1},this.checkShortcutAvailability=(t,i,s)=>{const n=this.props.findConflictsFor([...i,s],this.props.shortcut.selector),r=t===""||n.length===0;return!r&&n.length===1&&n[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:r}),n)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const i=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=i[0],n=i[1],r=i[2],h=this.props.toSymbols(s);let m=this.checkShortcutAvailability(s,n,r);this.setState({value:h,userInput:s,keys:n,currentChain:r},()=>{this.checkNonFunctional(),this._emitConflicts(m)})},this._handleBlur=t=>{var i,s;!((i=this._ref.current)===null||i===void 0)&&i.contains(t.relatedTarget)||!((s=t.relatedTarget)===null||s===void 0)&&s.closest(`.${j}`)||this.props.toggleInput()},this._ref=o.createRef(),this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_emitConflicts(e){const t=[...this.state.keys,this.state.currentChain];this.props.displayConflicts({conflictsWith:e,keys:this.state.keys,overwrite:async()=>{this.setState({isAvailable:!0}),await this._handleOverwrite(e,t),this.props.toggleInput()},cancel:()=>{this.props.toggleInput()}})}render(){const e=this.props.translator.load("jupyterlab");let t="jp-Shortcuts-Input";return this.state.isAvailable||(t+=" jp-mod-unavailable-Input"),o.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",ref:this._ref,onBlur:this._handleBlur},o.createElement("div",{tabIndex:0,className:t,onKeyDown:this.handleInput,ref:i=>i&&i.focus(),"data-lm-suppress-shortcuts":"true"},o.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":this.state.value===""?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},this.state.value===""?e.__("press keys"):this.state.value)),o.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit,tabIndex:0},this.state.isAvailable?o.createElement(K.react,null):o.createElement(x.react,null)))}}class Q extends o.Component{constructor(e){super(e),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput,conflicts:new Map})},this.toSymbols=t=>t.split(" ").reduce((i,s)=>s==="Ctrl"?(i+" ⌃").trim():s==="Alt"?(i+" ⌥").trim():s==="Shift"?(i+" ⇧").trim():s==="Accel"&&E.IS_MAC?(i+" ⌘").trim():s==="Accel"?(i+" ⌃").trim():(i+" "+s).trim(),""),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(!("shortcutId"in t&&t.shortcutId!==this.props.shortcut.id)){if(t.request==="add-keybinding")return this.toggleInputNew();if(t.request==="edit-keybinding"&&this.toggleInputReplaceMethod(t.keybinding),t.request==="delete-keybinding"){const i=this.props.shortcut,s=i.keybindings[t.keybinding];this.props.deleteKeybinding(i,s).catch(console.error)}}}getCategoryCell(){return o.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var e;return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"jp-label"},(e=this.props.shortcut.label)!==null&&e!==void 0?e:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return o.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this._trans.__("Reset"))}getSourceCell(){const e=this.props.shortcut.keybindings.every(t=>t.isDefault);return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"jp-Shortcuts-SourceCell"},e?this._trans.__("Default"):this._trans.__("Custom")),e?"":this.getResetShortCutLink())}getOptionalSelectorCell(){return this.props.showSelectors?o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(e){const t=["jp-Shortcuts-ShortcutCell"];switch(e.length){case 1:t.push("jp-Shortcuts-SingleCell");break;case 0:t.push("jp-Shortcuts-EmptyCell");break}return t.join(" ")}toggleInputReplaceMethod(e){const t=this.state.displayReplaceInput[e];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[e]:!t},conflicts:new Map})}getDisplayReplaceInput(e){return this.state.displayReplaceInput[e]}getOrDiplayIfNeeded(e){const t=["jp-Shortcuts-Or"];return(e||this.state.displayNewInput)&&t.push("jp-Shortcuts-Or-Forced"),o.createElement("div",{className:t.join(" ")},this._trans.__("or"))}getShortCutAsInput(e,t){return o.createElement(C,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(t),shortcut:this.props.shortcut,keybinding:e,displayConflicts:i=>{const s=new Map(this.state.conflicts);s.set(e,i),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(t),placeholder:this.toSymbols(e.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(e){return e.keys.map((t,i)=>o.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:i},o.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(t)),i+1<e.keys.length?o.createElement("div",{className:"jp-Shortcuts-Comma"},","):null))}isLocationBeingEdited(e){return this.state.displayReplaceInput[e]}getDivForKey(e,t,i){return o.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+e,"data-keybinding":e,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(e)},this.isLocationBeingEdited(e)?this.getShortCutAsInput(t,e):this.getShortCutForDisplayOnly(t),!(e===this._nonEmptyBindings.length-1&&Object.values(this.state.displayReplaceInput).some(Boolean))&&this.getOrDiplayIfNeeded(e<this._nonEmptyBindings.length-1))}getAddLink(){return o.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?o.createElement(C,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:e=>{const t=new Map(this.state.conflicts);t.set(null,e),this.setState({conflicts:t})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):o.createElement("div",null)}getShortCutsCell(e){return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:this.getClassNameForShortCuts(e)},e.map((t,i)=>this.getDivForKey(i,t,e)),e.length>=1&&!this.state.displayNewInput&&!Object.values(this.state.displayReplaceInput).some(Boolean)&&this.getAddLink(),e.length===0&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const e=[...this.state.conflicts.values()].filter(t=>t.conflictsWith.length!==0);return e.length===0?o.createElement(o.Fragment,null):o.createElement("div",{className:"jp-Shortcuts-Row jp-Shortcuts-RowWithConflict"},o.createElement("div",{className:j},e.map(t=>{const i=t.keys.join(" ")+"_"+t.conflictsWith.map(s=>s.id).join("");return o.createElement("div",{className:"jp-Shortcuts-Conflict",key:i},o.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map(s=>{var n;return(n=s.label)!==null&&n!==void 0?n:s.command}).join(", "))),o.createElement("div",{className:"jp-Shortcuts-ErrorButton"},o.createElement("button",{className:"jp-Button jp-mod-reject jp-mod-styled",onClick:()=>{this._clearConflict(t),t.cancel()}},this._trans.__("Cancel")),o.createElement("button",{className:"jp-Button jp-mod-warn jp-mod-styled",onClick:()=>{this._clearConflict(t),t.overwrite()}},this._trans.__("Overwrite"))))})))}_clearConflict(e){const t=new Map,i=this._conflictId(e);for(const[s,n]of this.state.conflicts.entries())this._conflictId(n)!==i&&t.set(s,n);this.setState({conflicts:t})}_conflictId(e){return e.keys.join(" ")+"_"+e.conflictsWith.map(t=>t.id).join("")}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter(e=>e.keys.filter(t=>t!="").length!==0)}render(){return o.createElement(o.Fragment,null,o.createElement("div",{className:"jp-Shortcuts-Row","data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}const $=115;class z extends o.Component{render(){return o.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:`${this.props.height-$}px`},id:"shortcutListContainer"},o.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map(e=>o.createElement(Q,{key:e.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,shortcut:e,showSelectors:this.props.showSelectors,external:this.props.external}))))}}class P extends o.Component{render(){return o.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,o.createElement(A.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function J(a){return o.createElement("div",{className:"jp-Shortcuts-Symbols"},o.createElement("table",null,o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("kbd",null,"Cmd")),o.createElement("td",null,"⌘"),o.createElement("td",null,o.createElement("kbd",null,"Ctrl")),o.createElement("td",null,"⌃")),o.createElement("tr",null,o.createElement("td",null,o.createElement("kbd",null,"Alt")),o.createElement("td",null,"⌥"),o.createElement("td",null,o.createElement("kbd",null,"Shift")),o.createElement("td",null,"⇧")))))}function G(a){const e=a.translator.load("jupyterlab");return o.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},o.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>a.toggleSelectors()},a.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),o.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>a.resetShortcuts()},e.__("Reset All")))}class V extends o.Component{constructor(e){super(e)}getShortCutTitleItem(e,t){return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement(P,{title:e,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:t}))}render(){const e=this.props.translator.load("jupyterlab");return o.createElement("div",{className:"jp-Shortcuts-Top"},o.createElement("div",{className:"jp-Shortcuts-TopNav"},o.createElement(J,null),o.createElement(H,{"aria-label":e.__("Search shortcuts"),updateFilter:(t,i)=>this.props.updateSearchQuery(i??""),placeholder:e.__("Search…"),useFuzzyFilter:!1}),o.createElement(G,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,translator:this.props.translator})),o.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},o.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(e.__("Category"),"category"),this.getShortCutTitleItem(e.__("Command"),"command"),o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"title-div"},e.__("Shortcut"))),this.getShortCutTitleItem(e.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(e.__("Selectors"),"selector"))))}}class X extends Map{constructor(e){var t,i,s;super();const{settings:n,commandRegistry:r}=e,h=(t=n.user.shortcuts)!==null&&t!==void 0?t:[],m=new Set(h.map(this._computeKeybindingId.bind(this))),y=(i=n.composite.shortcuts)!==null&&i!==void 0?i:[];for(const p of y){const c=this._computeTargetId(p),u=this._computeKeybindingId(p),d={keys:p.keys,isDefault:!m.has(u)},l=this.get(c);if(l)l.keybindings.push(d);else{const g=p.command.split(":"),f=(s=r.label(p.command,p.args))!==null&&s!==void 0?s:g.length>1?g[1]:void 0,v=g[0];this.set(c,{id:c,selector:p.selector,command:p.command,category:v,label:f,args:p.args,keybindings:[d]})}}}findConflictsFor(e,t){const i=new Y({registry:this});let s=i.findConflicts(e,t);if(s.length!==0)return s;for(const n of e)if(s=i.findConflicts([n],t),s.length!==0)return s;return[]}_computeTargetId(e){var t;return e.command+"_"+e.selector+"_"+JSON.stringify((t=e.args)!==null&&t!==void 0?t:{})}_computeKeybindingId(e){var t;return[e.command,e.selector,JSON.stringify((t=e.args)!==null&&t!==void 0?t:{}),e.keys.join(" ")].join("_")}}class Y{constructor(e){var t;const i=new Map;for(const s of e.registry.values())for(const n of s.keybindings){const r=this._keybindingHash(n.keys,s.selector),h=(t=i.get(r))!==null&&t!==void 0?t:[];h.push(s),i.set(r,h)}this._keybindingsMap=i}findConflicts(e,t){var i;const s=this._keybindingHash(e,t);return(i=this._keybindingsMap.get(s))!==null&&i!==void 0?i:[]}_keybindingHash(e,t){return e.join(" ")+"_"+t}}function Z(a){return a.replace(/\s+/g,"").toLowerCase()}function tt(a,e){var t;const i=a.category.toLowerCase(),s=((t=a.label)!==null&&t!==void 0?t:"").toLowerCase(),n=`${i} ${s}`;let r=1/0,h=null;const m=/\b\w/g;for(;;){const d=m.exec(n);if(!d)break;const l=R.matchSumOfDeltas(n,e,d.index);if(!l)break;l&&l.score<=r&&(r=l.score,h=l.indices)}if(!h||r===1/0)return null;const y=i.length+1,p=T.lowerBound(h,y,(d,l)=>d-l),c=h.slice(0,p),u=h.slice(p);for(let d=0,l=u.length;d<l;++d)u[d]-=y;return c.length===0?{matchType:0,categoryIndices:null,labelIndices:u,score:r,item:a}:u.length===0?{matchType:1,categoryIndices:c,labelIndices:null,score:r,item:a}:{matchType:2,categoryIndices:c,labelIndices:u,score:r,item:a}}function et(a,e){e=Z(e);let t=[];for(const i of a.values()){if(!e){t.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:i});continue}let s=tt(i,e);s&&t.push(s)}return t}class st extends o.Component{constructor(e){super(e),this.updateSearchQuery=t=>{this.setState({searchQuery:t},()=>{const i=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(i)},()=>{this.sortShortcuts()})})},this.resetShortcuts=async()=>{await(await this.props.external.getSettings()).set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{await this._setKeybinding(t,[])},this.replaceKeybinding=async(t,i,s)=>this._setKeybinding(t,s,i),this.deleteKeybinding=async(t,i)=>{await this._setKeybinding(t,[],i)},this.addKeybinding=async(t,i)=>{await this._setKeybinding(t,i)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category"}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(t.request==="toggle-selectors")return this.toggleSelectors();t.request==="reset-all"&&await this.resetShortcuts()}async _refreshShortcutList(){const e=await this.props.external.getSettings(),t=new X({commandRegistry:this.props.external.commandRegistry,settings:e});this.setState({shortcutRegistry:t,filteredShortcutList:this._searchFilterShortcuts(t),shortcutsFetched:!0},()=>{this.sortShortcuts()})}_searchFilterShortcuts(e){return e?et(e,this.state.searchQuery).map(i=>i.item):[]}async _setKeybinding(e,t,i){var s,n,r,h,m;t.length===1&&t[0]==""&&(t=[]);const y=await this.props.external.getSettings(),p=(s=y.user.shortcuts)!==null&&s!==void 0?s:[],c=[];let u=!1;for(let d of p)if(d.command===e.command&&d.selector===e.selector&&S.deepEqual((n=d.args)!==null&&n!==void 0?n:{},(r=e.args)!==null&&r!==void 0?r:{})&&i&&S.deepEqual(i.keys,d.keys)){const l=i&&i.isDefault&&S.deepEqual(i.keys,t);t.length!==0&&!l&&c.push({command:d.command,selector:d.selector,keys:t}),u=!0}else{if(d.command===e.command&&d.selector===e.selector&&S.deepEqual((h=d.args)!==null&&h!==void 0?h:{},(m=e.args)!==null&&m!==void 0?m:{})&&!i&&t.length===0)continue;c.push(d)}if(!u){const d=!i||!S.deepEqual(i.keys,t);i&&i.isDefault&&d&&c.push({command:e.command,selector:e.selector,disabled:!0,keys:i.keys}),t.length!==0&&c.push({command:e.command,selector:e.selector,keys:t})}await y.set("shortcuts",c),await this._refreshShortcutList()}sortShortcuts(){const e=this.state.filteredShortcutList;let t=this.state.currentSort;t==="command"&&(t="label");const i=s=>{var n;return t==="source"?s.keybindings.every(r=>r.isDefault)?"default":"other":(n=s[t])!==null&&n!==void 0?n:""};e.sort((s,n)=>{var r,h;const m=i(s),y=i(n),p=m.localeCompare(y);if(p)return p;{const c=(r=s.label)!==null&&r!==void 0?r:"",u=(h=n.label)!==null&&h!==void 0?h:"";return c.localeCompare(u)}}),this.setState({filteredShortcutList:e})}render(){return this.state.shortcutsFetched?o.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},o.createElement(V,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,width:this.props.width,translator:this.props.external.translator}),o.createElement(z,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,showSelectors:this.state.showSelectors,findConflictsFor:(e,t)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(e,t):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}const it=a=>F.createElement(st,{external:a.external,height:1e3,width:1e3}),w="@jupyterlab/shortcuts-extension:shortcuts";function ot(a,e,t,i){return{translator:t,getSettings:()=>a.load(w,!0),commandRegistry:e.commands,actionRequested:i}}const b={id:w,description:"Adds the keyboard shortcuts editor.",requires:[W],optional:[L,U],activate:async(a,e,t,i)=>{const s=t??B,n=s.load("jupyterlab"),{commands:r}=a;let h,m,y={};if(i){const c=new O({}),u=l=>l.dataset.shortcut!==void 0;a.commands.addCommand(_.editBinding,{label:n.__("Edit Keybinding"),caption:n.__("Edit existing keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=a.contextMenuHitTest(u),g=l?.dataset.keybinding,f=l?.dataset.shortcut;if(!f||!g)return console.log("Missing shortcut id/keybinding information");c.emit({request:"edit-keybinding",keybinding:parseInt(g,10),shortcutId:f})}}),a.commands.addCommand(_.deleteBinding,{label:n.__("Delete Keybinding"),caption:n.__("Delete chosen keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=a.contextMenuHitTest(u),g=l?.dataset.keybinding,f=l?.dataset.shortcut;if(!f||!g)return console.log("Missing shortcut id/keybinding information");c.emit({request:"delete-keybinding",keybinding:parseInt(g,10),shortcutId:f})}}),a.commands.addCommand(_.addBinding,{label:n.__("Add Keybinding"),caption:n.__("Add new keybinding for existing shortcut target"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=a.contextMenuHitTest(u),g=l?.dataset.shortcut;if(!g)return console.log("Missing shortcut id to add keybinding to");c.emit({request:"add-keybinding",shortcutId:g})}}),r.addCommand(_.toggleSelectors,{label:n.__("Toggle Selectors"),caption:n.__("Toggle command selectors"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{c.emit({request:"toggle-selectors"})}}),r.addCommand(_.resetAll,{label:n.__("Reset All"),caption:n.__("Reset all shortcuts"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{c.emit({request:"reset-all"})}});const d={fieldRenderer:l=>it({external:ot(e,a,s,c),...l})};i.addRenderer(`${b.id}.shortcuts`,d)}function p(c){const u=a.commands.listCommands().join(`
|
|
1
|
+
import{r as o,c1 as S,ef as I,dH as K,eg as x,eh as E,ei as A,ej as R,af as T,v as F,ai as L,ak as B,J as O,d9 as M,cG as D,cS as q}from"../datalayer-app-main.js";import{o as H}from"./index-DmlogZBL.js";import{a as U}from"./tokens-_fLcuFXz.js";import{I as W}from"./tokens-BHLmeqjP.js";import"./Output-B4b0TC6x.js";import"./index-D2V9YBSL.js";import"./hoverbox-CStlKQWE.js";import"./index-TzvZ9g2T.js";import"./index-I5uUezOA.js";import"./color-CG7_7V2-.js";import"./isEqual-BxgGIFfN.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./PaintbrushIcon-CLU8RilX.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./CellSidebarExtension-D4_DkfUV.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./renderer-B7ulbNbj.js";import"./SquareIcon-e3ygcjpv.js";import"./SortAscIcon-CVKVWIWQ.js";import"./url-DuKx0yk0.js";/* empty css */import"./index-Dro44tIm.js";/* empty css *//* empty css */import"./index-DsG9xhMj.js";/* empty css */import"./index-CNU-WVhQ.js";import"./index--OLIX362.js";import"./index-DYGslHkf.js";import"./index-BSRVX3UN.js";import"./index-BH2OX5l8.js";import"./index-C3vDfO5_.js";import"./index-Ko8lxXFd.js";import"./index-CB9u17_J.js";import"./index-BUVtc_FV.js";import"./ArrowLeftIcon-Y3PTljcl.js";import"./SkubbleIcon-tlg17jBG.js";import"./usePrimerThemeBridge-CoHussa9.js";import"./index-Crj6AD3D.js";import"./KernelVariables-cBMhcW1H.js";import"./index-BvgsWH_d.js";import"./SortDescIcon-CS4EzHeS.js";import"./NotebookToolbar-rtMQZWHQ.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-CGQDY041.js";import"./sessions-D0uw83Dx.js";import"./tokens-DTIgYcNS.js";import"./drivecontents-CxwZz_5W.js";import"./kernel-BI-BLP-K.js";var _;(function(a){a.editBinding="shortcuts:edit-keybinding",a.addBinding="shortcuts:add-keybinding",a.deleteBinding="shortcuts:delete-keybinding",a.toggleSelectors="shortcuts:toggle-selectors",a.resetAll="shortcuts:reset-all"})(_||(_={}));const j="jp-Shortcuts-ConflictContainer";class C extends o.Component{constructor(e){super(e),this.handleSubmit=async()=>{this._isReplacingExistingKeybinding?this.state.selected?this.props.toggleInput():await this._updateShortcut():(await this._updateShortcut(),this.props.toggleInput())},this._updateShortcut=async()=>{const t=[...this.state.keys,this.state.currentChain];this.setState({keys:t}),this.props.keybinding?await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,t):await this.props.addKeybinding(this.props.shortcut,t)},this._handleOverwrite=async(t,i)=>{for(const s of t){const n=s.keybindings.filter(r=>S.deepEqual(r.keys,i)||i.some(h=>S.deepEqual(r.keys,[h])))[0];if(!n){console.error(`Conflicting binding could not be found for ${s} using keys ${i}`);continue}await this.props.deleteKeybinding(s,n)}await this._updateShortcut()},this.parseChaining=(t,i,s,n,r)=>{let h=I.keyForKeydownEvent(t.nativeEvent);const m=["Shift","Control","Alt","Meta","Ctrl","Accel"];if(t.key==="Backspace")s="",i="",n=[],r="",this.setState({value:i,userInput:s,keys:n,currentChain:r});else if(t.key!=="CapsLock"){const y=s.substr(s.lastIndexOf(" ")+1,s.length).trim();m.lastIndexOf(y)===-1&&y!=""?(s=s+",",n.push(r),r="",t.ctrlKey&&t.key!="Control"&&(s=(s+" Ctrl").trim(),r=(r+" Ctrl").trim()),t.metaKey&&t.key!="Meta"&&(s=(s+" Accel").trim(),r=(r+" Accel").trim()),t.altKey&&t.key!="Alt"&&(s=(s+" Alt").trim(),r=(r+" Alt").trim()),t.shiftKey&&t.key!="Shift"&&(s=(s+" Shift").trim(),r=(r+" Shift").trim()),m.lastIndexOf(t.key)===-1?(s=(s+" "+h).trim(),r=(r+" "+h).trim()):t.key==="Meta"?(s=(s+" Accel").trim(),r=(r+" Accel").trim()):t.key==="Control"?(s=(s+" Ctrl").trim(),r=(r+" Ctrl").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),r=(r+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),r=(r+" Alt").trim()):(s=(s+" "+t.key).trim(),r=(r+" "+t.key).trim())):t.key==="Control"?(s=(s+" Ctrl").trim(),r=(r+" Ctrl").trim()):t.key==="Meta"?(s=(s+" Accel").trim(),r=(r+" Accel").trim()):t.key==="Shift"?(s=(s+" Shift").trim(),r=(r+" Shift").trim()):t.key==="Alt"?(s=(s+" Alt").trim(),r=(r+" Alt").trim()):(s=(s+" "+h).trim(),r=(r+" "+h).trim())}return this.setState({keys:n,currentChain:r}),[s,n,r]},this.checkNonFunctional=()=>{const t=["Ctrl","Alt","Accel","Shift"],i=this.state.currentChain.split(" "),s=i[i.length-1];return this.setState({isFunctional:t.indexOf(s)===-1}),t.indexOf(s)!==-1},this.checkShortcutAvailability=(t,i,s)=>{const n=this.props.findConflictsFor([...i,s],this.props.shortcut.selector),r=t===""||n.length===0;return!r&&n.length===1&&n[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding?(this.setState({isAvailable:!0}),[]):(this.setState({isAvailable:r}),n)},this.handleInput=t=>{t.preventDefault(),this.setState({selected:!1});const i=this.parseChaining(t,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain),s=i[0],n=i[1],r=i[2],h=this.props.toSymbols(s);let m=this.checkShortcutAvailability(s,n,r);this.setState({value:h,userInput:s,keys:n,currentChain:r},()=>{this.checkNonFunctional(),this._emitConflicts(m)})},this._handleBlur=t=>{var i,s;!((i=this._ref.current)===null||i===void 0)&&i.contains(t.relatedTarget)||!((s=t.relatedTarget)===null||s===void 0)&&s.closest(`.${j}`)||this.props.toggleInput()},this._ref=o.createRef(),this.state={value:this.props.placeholder,userInput:"",isAvailable:!0,isFunctional:this._isReplacingExistingKeybinding,keys:[],currentChain:"",selected:!0}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_emitConflicts(e){const t=[...this.state.keys,this.state.currentChain];this.props.displayConflicts({conflictsWith:e,keys:this.state.keys,overwrite:async()=>{this.setState({isAvailable:!0}),await this._handleOverwrite(e,t),this.props.toggleInput()},cancel:()=>{this.props.toggleInput()}})}render(){const e=this.props.translator.load("jupyterlab");let t="jp-Shortcuts-Input";return this.state.isAvailable||(t+=" jp-mod-unavailable-Input"),o.createElement("div",{className:this.props.displayInput?this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox":"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-mod-hidden",ref:this._ref,onBlur:this._handleBlur},o.createElement("div",{tabIndex:0,className:t,onKeyDown:this.handleInput,ref:i=>i&&i.focus(),"data-lm-suppress-shortcuts":"true"},o.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":this.state.value===""?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},this.state.value===""?e.__("press keys"):this.state.value)),o.createElement("button",{className:this.state.isFunctional?this.state.isAvailable?"jp-Shortcuts-Submit":"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit jp-mod-defunc-Submit",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit,tabIndex:0},this.state.isAvailable?o.createElement(K.react,null):o.createElement(x.react,null)))}}class Q extends o.Component{constructor(e){super(e),this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput,conflicts:new Map})},this.toSymbols=t=>t.split(" ").reduce((i,s)=>s==="Ctrl"?(i+" ⌃").trim():s==="Alt"?(i+" ⌥").trim():s==="Shift"?(i+" ⇧").trim():s==="Accel"&&E.IS_MAC?(i+" ⌘").trim():s==="Accel"?(i+" ⌃").trim():(i+" "+s).trim(),""),this._trans=this.props.external.translator.load("jupyterlab"),this.state={displayNewInput:!1,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(!("shortcutId"in t&&t.shortcutId!==this.props.shortcut.id)){if(t.request==="add-keybinding")return this.toggleInputNew();if(t.request==="edit-keybinding"&&this.toggleInputReplaceMethod(t.keybinding),t.request==="delete-keybinding"){const i=this.props.shortcut,s=i.keybindings[t.keybinding];this.props.deleteKeybinding(i,s).catch(console.error)}}}getCategoryCell(){return o.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var e;return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"jp-label"},(e=this.props.shortcut.label)!==null&&e!==void 0?e:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return o.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this._trans.__("Reset"))}getSourceCell(){const e=this.props.shortcut.keybindings.every(t=>t.isDefault);return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"jp-Shortcuts-SourceCell"},e?this._trans.__("Default"):this._trans.__("Custom")),e?"":this.getResetShortCutLink())}getOptionalSelectorCell(){return this.props.showSelectors?o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(e){const t=["jp-Shortcuts-ShortcutCell"];switch(e.length){case 1:t.push("jp-Shortcuts-SingleCell");break;case 0:t.push("jp-Shortcuts-EmptyCell");break}return t.join(" ")}toggleInputReplaceMethod(e){const t=this.state.displayReplaceInput[e];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[e]:!t},conflicts:new Map})}getDisplayReplaceInput(e){return this.state.displayReplaceInput[e]}getOrDiplayIfNeeded(e){const t=["jp-Shortcuts-Or"];return(e||this.state.displayNewInput)&&t.push("jp-Shortcuts-Or-Forced"),o.createElement("div",{className:t.join(" ")},this._trans.__("or"))}getShortCutAsInput(e,t){return o.createElement(C,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(t),shortcut:this.props.shortcut,keybinding:e,displayConflicts:i=>{const s=new Map(this.state.conflicts);s.set(e,i),this.setState({conflicts:s})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(t),placeholder:this.toSymbols(e.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(e){return e.keys.map((t,i)=>o.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:i},o.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(t)),i+1<e.keys.length?o.createElement("div",{className:"jp-Shortcuts-Comma"},","):null))}isLocationBeingEdited(e){return this.state.displayReplaceInput[e]}getDivForKey(e,t,i){return o.createElement("div",{className:"jp-Shortcuts-ShortcutContainer",key:this.props.shortcut.id+"_"+e,"data-keybinding":e,"data-shortcut":this.props.shortcut.id,onClick:()=>this.toggleInputReplaceMethod(e)},this.isLocationBeingEdited(e)?this.getShortCutAsInput(t,e):this.getShortCutForDisplayOnly(t),!(e===this._nonEmptyBindings.length-1&&Object.values(this.state.displayReplaceInput).some(Boolean))&&this.getOrDiplayIfNeeded(e<this._nonEmptyBindings.length-1))}getAddLink(){return o.createElement("a",{className:this.state.displayNewInput?"":"jp-Shortcuts-Plus",onClick:()=>{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?o.createElement(C,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:e=>{const t=new Map(this.state.conflicts);t.set(null,e),this.setState({conflicts:t})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):o.createElement("div",null)}getShortCutsCell(e){return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:this.getClassNameForShortCuts(e)},e.map((t,i)=>this.getDivForKey(i,t,e)),e.length>=1&&!this.state.displayNewInput&&!Object.values(this.state.displayReplaceInput).some(Boolean)&&this.getAddLink(),e.length===0&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const e=[...this.state.conflicts.values()].filter(t=>t.conflictsWith.length!==0);return e.length===0?o.createElement(o.Fragment,null):o.createElement("div",{className:"jp-Shortcuts-Row jp-Shortcuts-RowWithConflict"},o.createElement("div",{className:j},e.map(t=>{const i=t.keys.join(" ")+"_"+t.conflictsWith.map(s=>s.id).join("");return o.createElement("div",{className:"jp-Shortcuts-Conflict",key:i},o.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",t.conflictsWith.map(s=>{var n;return(n=s.label)!==null&&n!==void 0?n:s.command}).join(", "))),o.createElement("div",{className:"jp-Shortcuts-ErrorButton"},o.createElement("button",{className:"jp-Button jp-mod-reject jp-mod-styled",onClick:()=>{this._clearConflict(t),t.cancel()}},this._trans.__("Cancel")),o.createElement("button",{className:"jp-Button jp-mod-warn jp-mod-styled",onClick:()=>{this._clearConflict(t),t.overwrite()}},this._trans.__("Overwrite"))))})))}_clearConflict(e){const t=new Map,i=this._conflictId(e);for(const[s,n]of this.state.conflicts.entries())this._conflictId(n)!==i&&t.set(s,n);this.setState({conflicts:t})}_conflictId(e){return e.keys.join(" ")+"_"+e.conflictsWith.map(t=>t.id).join("")}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter(e=>e.keys.filter(t=>t!="").length!==0)}render(){return o.createElement(o.Fragment,null,o.createElement("div",{className:"jp-Shortcuts-Row","data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}const $=115;class z extends o.Component{render(){return o.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:`${this.props.height-$}px`},id:"shortcutListContainer"},o.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map(e=>o.createElement(Q,{key:e.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,shortcut:e,showSelectors:this.props.showSelectors,external:this.props.external}))))}}class P extends o.Component{render(){return o.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,o.createElement(A.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function J(a){return o.createElement("div",{className:"jp-Shortcuts-Symbols"},o.createElement("table",null,o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("kbd",null,"Cmd")),o.createElement("td",null,"⌘"),o.createElement("td",null,o.createElement("kbd",null,"Ctrl")),o.createElement("td",null,"⌃")),o.createElement("tr",null,o.createElement("td",null,o.createElement("kbd",null,"Alt")),o.createElement("td",null,"⌥"),o.createElement("td",null,o.createElement("kbd",null,"Shift")),o.createElement("td",null,"⇧")))))}function G(a){const e=a.translator.load("jupyterlab");return o.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},o.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>a.toggleSelectors()},a.showSelectors?e.__("Hide Selectors"):e.__("Show Selectors")),o.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>a.resetShortcuts()},e.__("Reset All")))}class V extends o.Component{constructor(e){super(e)}getShortCutTitleItem(e,t){return o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement(P,{title:e,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:t}))}render(){const e=this.props.translator.load("jupyterlab");return o.createElement("div",{className:"jp-Shortcuts-Top"},o.createElement("div",{className:"jp-Shortcuts-TopNav"},o.createElement(J,null),o.createElement(H,{"aria-label":e.__("Search shortcuts"),updateFilter:(t,i)=>this.props.updateSearchQuery(i??""),placeholder:e.__("Search…"),useFuzzyFilter:!1}),o.createElement(G,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,translator:this.props.translator})),o.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},o.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(e.__("Category"),"category"),this.getShortCutTitleItem(e.__("Command"),"command"),o.createElement("div",{className:"jp-Shortcuts-Cell"},o.createElement("div",{className:"title-div"},e.__("Shortcut"))),this.getShortCutTitleItem(e.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(e.__("Selectors"),"selector"))))}}class X extends Map{constructor(e){var t,i,s;super();const{settings:n,commandRegistry:r}=e,h=(t=n.user.shortcuts)!==null&&t!==void 0?t:[],m=new Set(h.map(this._computeKeybindingId.bind(this))),y=(i=n.composite.shortcuts)!==null&&i!==void 0?i:[];for(const p of y){const c=this._computeTargetId(p),u=this._computeKeybindingId(p),d={keys:p.keys,isDefault:!m.has(u)},l=this.get(c);if(l)l.keybindings.push(d);else{const g=p.command.split(":"),f=(s=r.label(p.command,p.args))!==null&&s!==void 0?s:g.length>1?g[1]:void 0,v=g[0];this.set(c,{id:c,selector:p.selector,command:p.command,category:v,label:f,args:p.args,keybindings:[d]})}}}findConflictsFor(e,t){const i=new Y({registry:this});let s=i.findConflicts(e,t);if(s.length!==0)return s;for(const n of e)if(s=i.findConflicts([n],t),s.length!==0)return s;return[]}_computeTargetId(e){var t;return e.command+"_"+e.selector+"_"+JSON.stringify((t=e.args)!==null&&t!==void 0?t:{})}_computeKeybindingId(e){var t;return[e.command,e.selector,JSON.stringify((t=e.args)!==null&&t!==void 0?t:{}),e.keys.join(" ")].join("_")}}class Y{constructor(e){var t;const i=new Map;for(const s of e.registry.values())for(const n of s.keybindings){const r=this._keybindingHash(n.keys,s.selector),h=(t=i.get(r))!==null&&t!==void 0?t:[];h.push(s),i.set(r,h)}this._keybindingsMap=i}findConflicts(e,t){var i;const s=this._keybindingHash(e,t);return(i=this._keybindingsMap.get(s))!==null&&i!==void 0?i:[]}_keybindingHash(e,t){return e.join(" ")+"_"+t}}function Z(a){return a.replace(/\s+/g,"").toLowerCase()}function tt(a,e){var t;const i=a.category.toLowerCase(),s=((t=a.label)!==null&&t!==void 0?t:"").toLowerCase(),n=`${i} ${s}`;let r=1/0,h=null;const m=/\b\w/g;for(;;){const d=m.exec(n);if(!d)break;const l=R.matchSumOfDeltas(n,e,d.index);if(!l)break;l&&l.score<=r&&(r=l.score,h=l.indices)}if(!h||r===1/0)return null;const y=i.length+1,p=T.lowerBound(h,y,(d,l)=>d-l),c=h.slice(0,p),u=h.slice(p);for(let d=0,l=u.length;d<l;++d)u[d]-=y;return c.length===0?{matchType:0,categoryIndices:null,labelIndices:u,score:r,item:a}:u.length===0?{matchType:1,categoryIndices:c,labelIndices:null,score:r,item:a}:{matchType:2,categoryIndices:c,labelIndices:u,score:r,item:a}}function et(a,e){e=Z(e);let t=[];for(const i of a.values()){if(!e){t.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item:i});continue}let s=tt(i,e);s&&t.push(s)}return t}class st extends o.Component{constructor(e){super(e),this.updateSearchQuery=t=>{this.setState({searchQuery:t},()=>{const i=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(i)},()=>{this.sortShortcuts()})})},this.resetShortcuts=async()=>{await(await this.props.external.getSettings()).set("shortcuts",[]),await this._refreshShortcutList()},this.resetKeybindings=async t=>{await this._setKeybinding(t,[])},this.replaceKeybinding=async(t,i,s)=>this._setKeybinding(t,s,i),this.deleteKeybinding=async(t,i)=>{await this._setKeybinding(t,[],i)},this.addKeybinding=async(t,i)=>{await this._setKeybinding(t,i)},this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})},this.updateSort=t=>{t!==this.state.currentSort&&this.setState({currentSort:t},this.sortShortcuts)},this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:!1,searchQuery:"",showSelectors:!1,currentSort:"category"}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this),this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(t.request==="toggle-selectors")return this.toggleSelectors();t.request==="reset-all"&&await this.resetShortcuts()}async _refreshShortcutList(){const e=await this.props.external.getSettings(),t=new X({commandRegistry:this.props.external.commandRegistry,settings:e});this.setState({shortcutRegistry:t,filteredShortcutList:this._searchFilterShortcuts(t),shortcutsFetched:!0},()=>{this.sortShortcuts()})}_searchFilterShortcuts(e){return e?et(e,this.state.searchQuery).map(i=>i.item):[]}async _setKeybinding(e,t,i){var s,n,r,h,m;t.length===1&&t[0]==""&&(t=[]);const y=await this.props.external.getSettings(),p=(s=y.user.shortcuts)!==null&&s!==void 0?s:[],c=[];let u=!1;for(let d of p)if(d.command===e.command&&d.selector===e.selector&&S.deepEqual((n=d.args)!==null&&n!==void 0?n:{},(r=e.args)!==null&&r!==void 0?r:{})&&i&&S.deepEqual(i.keys,d.keys)){const l=i&&i.isDefault&&S.deepEqual(i.keys,t);t.length!==0&&!l&&c.push({command:d.command,selector:d.selector,keys:t}),u=!0}else{if(d.command===e.command&&d.selector===e.selector&&S.deepEqual((h=d.args)!==null&&h!==void 0?h:{},(m=e.args)!==null&&m!==void 0?m:{})&&!i&&t.length===0)continue;c.push(d)}if(!u){const d=!i||!S.deepEqual(i.keys,t);i&&i.isDefault&&d&&c.push({command:e.command,selector:e.selector,disabled:!0,keys:i.keys}),t.length!==0&&c.push({command:e.command,selector:e.selector,keys:t})}await y.set("shortcuts",c),await this._refreshShortcutList()}sortShortcuts(){const e=this.state.filteredShortcutList;let t=this.state.currentSort;t==="command"&&(t="label");const i=s=>{var n;return t==="source"?s.keybindings.every(r=>r.isDefault)?"default":"other":(n=s[t])!==null&&n!==void 0?n:""};e.sort((s,n)=>{var r,h;const m=i(s),y=i(n),p=m.localeCompare(y);if(p)return p;{const c=(r=s.label)!==null&&r!==void 0?r:"",u=(h=n.label)!==null&&h!==void 0?h:"";return c.localeCompare(u)}}),this.setState({filteredShortcutList:e})}render(){return this.state.shortcutsFetched?o.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},o.createElement(V,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,width:this.props.width,translator:this.props.external.translator}),o.createElement(z,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,showSelectors:this.state.showSelectors,findConflictsFor:(e,t)=>this.state.shortcutRegistry?this.state.shortcutRegistry.findConflictsFor(e,t):(console.error("Cannot search for keybinding conflicts at this time: registry is not ready"),[]),height:this.props.height,external:this.props.external})):null}}const it=a=>F.createElement(st,{external:a.external,height:1e3,width:1e3}),w="@jupyterlab/shortcuts-extension:shortcuts";function ot(a,e,t,i){return{translator:t,getSettings:()=>a.load(w,!0),commandRegistry:e.commands,actionRequested:i}}const b={id:w,description:"Adds the keyboard shortcuts editor.",requires:[W],optional:[L,U],activate:async(a,e,t,i)=>{const s=t??B,n=s.load("jupyterlab"),{commands:r}=a;let h,m,y={};if(i){const c=new O({}),u=l=>l.dataset.shortcut!==void 0;a.commands.addCommand(_.editBinding,{label:n.__("Edit Keybinding"),caption:n.__("Edit existing keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=a.contextMenuHitTest(u),g=l?.dataset.keybinding,f=l?.dataset.shortcut;if(!f||!g)return console.log("Missing shortcut id/keybinding information");c.emit({request:"edit-keybinding",keybinding:parseInt(g,10),shortcutId:f})}}),a.commands.addCommand(_.deleteBinding,{label:n.__("Delete Keybinding"),caption:n.__("Delete chosen keybinding"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=a.contextMenuHitTest(u),g=l?.dataset.keybinding,f=l?.dataset.shortcut;if(!f||!g)return console.log("Missing shortcut id/keybinding information");c.emit({request:"delete-keybinding",keybinding:parseInt(g,10),shortcutId:f})}}),a.commands.addCommand(_.addBinding,{label:n.__("Add Keybinding"),caption:n.__("Add new keybinding for existing shortcut target"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{const l=a.contextMenuHitTest(u),g=l?.dataset.shortcut;if(!g)return console.log("Missing shortcut id to add keybinding to");c.emit({request:"add-keybinding",shortcutId:g})}}),r.addCommand(_.toggleSelectors,{label:n.__("Toggle Selectors"),caption:n.__("Toggle command selectors"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{c.emit({request:"toggle-selectors"})}}),r.addCommand(_.resetAll,{label:n.__("Reset All"),caption:n.__("Reset all shortcuts"),describedBy:{args:{type:"object",properties:{}}},execute:()=>{c.emit({request:"reset-all"})}});const d={fieldRenderer:l=>it({external:ot(e,a,s,c),...l})};i.addRenderer(`${b.id}.shortcuts`,d)}function p(c){const u=a.commands.listCommands().join(`
|
|
2
2
|
`);m||(m=S.deepCopy(c.properties.shortcuts.default)),y={},c.properties.shortcuts.default=Object.keys(e.plugins).map(d=>{const l=e.plugins[d].schema["jupyter.lab.shortcuts"]||[];return y[d]=l,l}).concat([m]).reduce((d,l)=>E.IS_MAC?d.concat(l):d.concat(l.filter(g=>!g.keys.some(f=>{const{cmd:v}=D.parseKeystroke(f);return v}))),[]).sort((d,l)=>d.command.localeCompare(l.command)),c.properties.shortcuts.description=n.__(`Note: To disable a system default shortcut,
|
|
3
3
|
copy it to User Preferences and add the
|
|
4
4
|
"disabled" key, for example:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c2 as Z,v as U,b$ as ee,b_ as F,ak as B,J as K,dJ as pe,ai as j,cx as he,dK as me,c1 as ge,ci as W,ch as C,c6 as Q,dL as fe,ao as _e,ag as ve,cF as ye,dM as be,an as we,r as X,dN as xe,dO as Ce}from"../datalayer-app-main.js";import{T as te,f as Se,b as ne,d as oe}from"./index-
|
|
1
|
+
import{c2 as Z,v as U,b$ as ee,b_ as F,ak as B,J as K,dJ as pe,ai as j,cx as he,dK as me,c1 as ge,ci as W,ch as C,c6 as Q,dL as fe,ao as _e,ag as ve,cF as ye,dM as be,an as we,r as X,dN as xe,dO as Ce}from"../datalayer-app-main.js";import{T as te,f as Se,b as ne,d as oe}from"./index-D2V9YBSL.js";import{I as ie}from"./tokens-BHMD_ju9.js";import{a as ae,b as H,c as V,I as P}from"./tokens-CENaHAHm.js";import{I as re}from"./tokens-BHLmeqjP.js";import{j as se,d as ke,m as Re,c as G,D as z,n as We}from"./index-DmlogZBL.js";import"./hoverbox-CStlKQWE.js";import"./Output-B4b0TC6x.js";import"./index-TzvZ9g2T.js";import"./index-I5uUezOA.js";import"./color-CG7_7V2-.js";import"./isEqual-BxgGIFfN.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./PaintbrushIcon-CLU8RilX.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./CellSidebarExtension-D4_DkfUV.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./renderer-B7ulbNbj.js";import"./SquareIcon-e3ygcjpv.js";import"./SortAscIcon-CVKVWIWQ.js";import"./url-DuKx0yk0.js";/* empty css */import"./index-Dro44tIm.js";/* empty css *//* empty css */import"./index-DsG9xhMj.js";/* empty css */import"./index-CNU-WVhQ.js";import"./index--OLIX362.js";import"./index-DYGslHkf.js";import"./index-BSRVX3UN.js";import"./index-BH2OX5l8.js";import"./index-C3vDfO5_.js";import"./index-Ko8lxXFd.js";import"./index-CB9u17_J.js";import"./index-BUVtc_FV.js";import"./ArrowLeftIcon-Y3PTljcl.js";import"./SkubbleIcon-tlg17jBG.js";import"./usePrimerThemeBridge-CoHussa9.js";import"./index-Crj6AD3D.js";import"./KernelVariables-cBMhcW1H.js";import"./index-BvgsWH_d.js";import"./SortDescIcon-CS4EzHeS.js";import"./NotebookToolbar-rtMQZWHQ.js";import"./RepoPushIcon-Cm8g9NuL.js";import"./Toolbar-CGQDY041.js";import"./sessions-D0uw83Dx.js";import"./tokens-DTIgYcNS.js";import"./drivecontents-CxwZz_5W.js";import"./kernel-BI-BLP-K.js";function Fe(i){return U.createElement(te,{source:i.name,title:i.fullPath})}class N extends Z{constructor(e){super(new N.Model(e.docManager)),this.node.title=this.model.path}render(){return U.createElement(Fe,{fullPath:this.model.path,name:this.model.name})}}(function(i){class e extends ee{constructor(n){super(),this._onTitleChange=r=>{const s=this._getAllState();this._name=r.label,this._triggerChange(s,this._getAllState())},this._onPathChange=(r,s)=>{const c=this._getAllState();this._path=s,this._name=F.PathExt.basename(s),this._triggerChange(c,this._getAllState())},this._path="",this._name="",this._widget=null,this._docManager=n}get path(){return this._path}get name(){return this._name}get widget(){return this._widget}set widget(n){const r=this._widget;if(r!==null){const c=this._docManager.contextForWidget(r);c?c.pathChanged.disconnect(this._onPathChange):r.title.changed.disconnect(this._onTitleChange)}const s=this._getAllState();if(this._widget=n,this._widget===null)this._path="",this._name="";else{const c=this._docManager.contextForWidget(this._widget);c?(this._path=c.path,this._name=F.PathExt.basename(c.path),c.pathChanged.connect(this._onPathChange)):(this._path="",this._name=this._widget.title.label,this._widget.title.changed.connect(this._onTitleChange))}this._triggerChange(s,this._getAllState())}_getAllState(){return[this._path,this._name]}_triggerChange(n,r){(n[0]!==r[0]||n[1]!==r[1])&&this.stateChanged.emit(void 0)}}i.Model=e})(N||(N={}));function Te(i){return U.createElement(te,{source:i.fileStatus})}const De=2e3;class O extends Z{constructor(e){super(new O.Model(e.docManager));const n=(e.translator||B).load("jupyterlab");this._statusMap={completed:n.__("Saving completed"),started:n.__("Saving started"),failed:n.__("Saving failed")}}render(){return this.model===null||this.model.status===null?null:U.createElement(Te,{fileStatus:this._statusMap[this.model.status]})}}(function(i){class e extends ee{constructor(n){super(),this._onStatusChange=(r,s)=>{this._status=s,this._status==="completed"?(setTimeout(()=>{this._status=null,this.stateChanged.emit(void 0)},De),this.stateChanged.emit(void 0)):this.stateChanged.emit(void 0)},this._status=null,this._widget=null,this._status=null,this.widget=null,this._docManager=n}get status(){return this._status}get widget(){return this._widget}set widget(n){var r,s;const c=this._widget;if(c!==null){const p=this._docManager.contextForWidget(c);p?p.saveState.disconnect(this._onStatusChange):!((r=this._widget.content)===null||r===void 0)&&r.saveStateChanged&&this._widget.content.saveStateChanged.disconnect(this._onStatusChange)}if(this._widget=n,this._widget===null)this._status=null;else{const p=this._docManager.contextForWidget(this._widget);p?p.saveState.connect(this._onStatusChange):!((s=this._widget.content)===null||s===void 0)&&s.saveStateChanged&&this._widget.content.saveStateChanged.connect(this._onStatusChange)}}}i.Model=e})(O||(O={}));class Be{constructor(e){this._recentsChanged=new K(this),this._recents={opened:[],closed:[]},this._isDisposed=!1,this._maxRecentsLength=10,this._saveDebouncer=new pe(this._save.bind(this),500),this._stateDB=e.stateDB,this._contentsManager=e.contents,this.updateRootDir(),this._loadRecents().catch(t=>{console.error(`Failed to load recent list from state:
|
|
2
2
|
${t}`)})}get isDisposed(){return this._isDisposed}get recentlyOpened(){return(this._recents.opened||[]).filter(t=>t.root===this._serverRoot)}get recentlyClosed(){return(this._recents.closed||[]).filter(t=>t.root===this._serverRoot)}get changed(){return this._recentsChanged}get maximalRecentsLength(){return this._maxRecentsLength}set maximalRecentsLength(e){this._maxRecentsLength=Math.round(Math.max(1,e));let t=!1;for(const n of["opened","closed"])this._recents[n].length>this._maxRecentsLength&&(this._recents[n].length=this._maxRecentsLength,t=!0);t&&this._recentsChanged.emit(void 0)}dispose(){this.isDisposed||(this._isDisposed=!0,K.clearData(this),this._saveDebouncer.dispose())}addRecent(e,t){const n={...e,root:this._serverRoot},r=this._recents[t],s=r.findIndex(c=>c.path===e.path);s>=0&&r.splice(s,1),r.unshift(n),this._setRecents(r,t),this._recentsChanged.emit(void 0)}clearRecents(){this._setRecents([],"opened"),this._setRecents([],"closed"),this._recentsChanged.emit(void 0)}removeRecent(e,t){this._removeRecent(e.path,[t])}async validate(e){const t=await this._isValid(e);return t||this._removeRecent(e.path),t}updateRootDir(){this._serverRoot=F.PageConfig.getOption("serverRoot")}_removeRecent(e,t=["opened","closed"]){let n=!1;for(const r of t){const s=this._recents[r],c=s.filter(p=>e!==p.path);s.length!==c.length&&(this._setRecents(c,r),n=!0)}n&&this._recentsChanged.emit(void 0)}async _isValid(e){var t;try{await this._contentsManager.get(e.path,{content:!1})}catch(n){if(((t=n.response)===null||t===void 0?void 0:t.status)===404)return!1}return!0}_setRecents(e,t){this._recents[t]=e.slice(0,this.maximalRecentsLength).sort((n,r)=>n.root===r.root?0:n.root!==this._serverRoot?1:-1),this._saveDebouncer.invoke().catch(console.warn)}async _loadRecents(){const e=await this._stateDB.fetch(L.stateDBKey)||{opened:[],closed:[]},t=[...e.opened,...e.closed],n=new Set(await this._getInvalidPaths(t));for(const r of["opened","closed"])this._setRecents(e[r].filter(s=>!n.has(s.path)),r);this._recentsChanged.emit(void 0)}async _getInvalidPaths(e){return(await Promise.all(e.map(async n=>await this._isValid(n)?null:n.path))).filter(n=>typeof n=="string")}async _save(){try{await this._stateDB.save(L.stateDBKey,this._recents)}catch(e){console.log("Saving recents failed",e)}}}var L;(function(i){i.stateDBKey="docmanager:recents"})(L||(L={}));var J;(function(i){i.clearRecents="docmanager:clear-recents"})(J||(J={}));var M;(function(i){i.recentsManager="@jupyterlab/docmanager-extension:recents",i.reopenClosed="@jupyterlab/docmanager-extension:reopen-recently-closed",i.mainPlugin="@jupyterlab/docmanager-extension:plugin"})(M||(M={}));const je={id:M.recentsManager,description:"Provides a manager of recently opened and closed documents.",autoStart:!0,requires:[he.IStateDB],optional:[re,j],provides:ae,activate:(i,e,t,n)=>{const{serviceManager:r}=i,s=(n??B).load("jupyterlab"),c=new Be({stateDB:e,contents:r.contents}),p=m=>{c.maximalRecentsLength=m.get("maxNumberRecents").composite};return t&&Promise.all([i.restored,t.load(M.mainPlugin)]).then(([m,a])=>{a.changed.connect(p),p(a)}),i.commands.addCommand(J.clearRecents,{execute:()=>{c.clearRecents()},isEnabled:()=>c.recentlyOpened.length!=0||c.recentlyClosed.length!=0,label:s.__("Clear Recent Documents"),caption:s.__("Clear the list of recently opened items."),describedBy:{args:{type:"object",properties:{}}}}),c}};var h;(function(i){i.clone="docmanager:clone",i.deleteFile="docmanager:delete-file",i.newUntitled="docmanager:new-untitled",i.open="docmanager:open",i.openBrowserTab="docmanager:open-browser-tab",i.reload="docmanager:reload",i.rename="docmanager:rename",i.del="docmanager:delete",i.duplicate="docmanager:duplicate",i.restoreCheckpoint="docmanager:restore-checkpoint",i.save="docmanager:save",i.saveAll="docmanager:save-all",i.saveAs="docmanager:save-as",i.download="docmanager:download",i.toggleAutosave="docmanager:toggle-autosave",i.showInFileBrowser="docmanager:show-in-file-browser"})(h||(h={}));const D="@jupyterlab/docmanager-extension:plugin",Pe={id:"@jupyterlab/docmanager-extension:opener",description:"Provides the widget opener.",autoStart:!0,provides:V,activate:i=>{const{shell:e}=i;return new class{constructor(){this._opened=new K(this)}open(t,n){var r;t.id||(t.id=`document-manager-${++$.id}`),t.title.dataset={type:"document-title",...t.title.dataset},t.isAttached||e.add(t,"main",n||{}),(!((r=n?.activate)!==null&&r!==void 0)||r)&&e.activateById(t.id),this._opened.emit(t)}get opened(){return this._opened}}}},Ee={id:"@jupyterlab/docmanager-extension:contexts",description:"Adds the handling of opened documents dirty state.",autoStart:!0,requires:[P,V],optional:[se],activate:(i,e,t,n)=>{const r=new WeakSet;t.opened.connect((s,c)=>{const p=e.contextForWidget(c);p&&!r.has(p)&&(n&&Ve(n,p),r.add(p))})}},Ae={id:"@jupyterlab/docmanager-extension:manager",description:"Provides the document manager.",provides:P,requires:[V],optional:[j,se,Se,ke.IInfo,ae,Re,H],activate:(i,e,t,n,r,s,c,p,m)=>{var a;const{serviceManager:d,docRegistry:u}=i,_=t??B,f=r??new me({translator:_}),y=m??new z({translator:_}),x=i.restored.then(()=>{});return new We({registry:u,manager:d,opener:e,when:x,setBusy:(a=n&&(()=>n.setBusy()))!==null&&a!==void 0?a:void 0,sessionDialogs:f,translator:_??B,isConnectedCallback:()=>s?s.isConnected:!0,recentsManager:c??void 0,urlResolverFactory:p??void 0,docManagerDialogs:y})}},Ie={id:D,description:"Adds commands and settings to the document manager.",autoStart:!0,requires:[P,V,re],optional:[j,ne,G,H],activate:(i,e,t,n,r,s,c,p)=>{r=r??B;const m=r.load("jupyterlab"),a=i.docRegistry;Me(i,e,t,n,r,c,s,p);const d=u=>{const _=u.get("autosave").composite;e.autosave=_===!0||_===!1?_:!0,i.commands.notifyCommandChanged(h.toggleAutosave);const f=u.get("confirmClosingDocument").composite;e.confirmClosingDocument=f??!0;const y=u.get("autosaveInterval").composite;e.autosaveInterval=y||120;const x=u.get("lastModifiedCheckMargin").composite;e.lastModifiedCheckMargin=x||500;const w=u.get("renameUntitledFileOnSave").composite;e.renameUntitledFileOnSave=w??!0;const T=u.get("defaultViewers").composite,o={};Object.keys(T).forEach(l=>{if(!a.getFileType(l)){console.warn(`File Type ${l} not found`);return}a.getWidgetFactory(T[l])||console.warn(`Document viewer ${T[l]} not found`),o[l]=T[l]});for(const l of a.fileTypes())try{a.setDefaultWidgetFactory(l.name,o[l.name])}catch{console.warn(`Failed to set default viewer ${o[l.name]} for file type ${l.name}`)}};Promise.all([n.load(D),i.restored]).then(([u])=>{u.changed.connect(d),d(u);const _=(f,y)=>{["autosave","autosaveInterval","confirmClosingDocument","lastModifiedCheckMargin","renameUntitledFileOnSave"].includes(y.name)&&u.get(y.name).composite!==y.newValue&&u.set(y.name,y.newValue).catch(x=>{console.error(`Failed to set the setting '${y.name}':
|
|
3
3
|
${x}`)})};e.stateChanged.connect(_)}).catch(u=>{console.error(u.message)}),n.transform(D,{fetch:u=>{const _=Array.from(a.fileTypes()).map(w=>w.name).join(`
|
|
4
4
|
`),f=Array.from(a.widgetFactories()).map(w=>w.name).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as V}from"./LexicalToolRegistry-BJ6mpMWn.js";import{D as Vl,a as Yl,b as Gl,e as Zl,c as Kl,g as Ql,i as ec,f as tc,l as nc,h as sc,j as oc,k as rc,m as ic,n as ac,r as lc,o as cc,p as uc,q as dc,s as pc,t as fc,v as mc,w as gc,x as hc,y as bc,z as yc,u as xc}from"./LexicalToolRegistry-BJ6mpMWn.js";import{_ as qt,E as Mn,G as Dn,H as Bn,K as me,M as Wt,O as ot,P as rt,Q as jn,R as Fn,S as Xt,U as Un,V as Jt,W as zn,X as Hn,Y as Vt,Z as Yt,a0 as qn,a1 as Wn,a2 as Xn,a3 as Jn,C as Gt,a4 as Vn,a5 as Zt,a6 as Yn,a7 as Gn,a8 as Ce,a9 as Q,aa as Kt,ab as it,ac as xe,ad as at,ae as Re,af as Zn,ag as Be,ah as Ve,ai as lt,aj as Kn,ak as Ye,al as Qn,am as es,an as ts,ao as Ge,ap as Qt,aq as en,ar as tn,as as Ie,at as ns,au as ss,av as nn,aw as os,ax as Pe,$ as rs,b as is,a as as,c as ls,ay as sn,az as Y,aA as cs,aB as us,aC as Ze,aD as ds,aE as ps,aF as fs,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Es,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Ts,aT as Cs,aU as vs,aV as ws,aW as Ss,aX as Ls,aY as _s,aZ as ks,a_ as As,x as on,a$ as Ns,b0 as $s,b1 as Rs,b2 as Is,b3 as Ps,b4 as Os,b5 as Ue,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Fs,bb as rn,bc as an,bd as ln,be as cn,j as Us,T as zs,L as Hs,w as qs,k as Ws,l as Xs,D as Js,m as Vs,n as Ys,o as Gs,p as Zs,t as Ks,bf as Qs,s as eo,F as to,u as no,v as so,bg as oo,bh as ro}from"./JupyterLexicalExtension-BQINjIFV.js";import{bi as Tc,bj as Cc,bk as vc,bl as wc,bm as Sc,bn as Lc,bo as _c,bp as kc,bq as Ac,br as Nc,bs as $c,bt as Rc,bu as Ic,bv as Pc,d as Oc,e as Mc,bw as Dc,bx as Bc,B as jc,by as Fc,A as Uc,bz as zc,bA as Hc,bB as qc,bC as Wc,bD as Xc,bE as Jc,bF as Vc,bG as Yc,bH as Gc,bI as Zc,bJ as Kc,bK as Qc,bL as eu,bM as tu,bN as nu,bO as su,bP as ou,f as ru,bQ as iu,g as au,bR as lu,bS as cu,bT as uu,bU as du,bV as pu,q as fu,bW as mu,bX as gu,bY as hu,bZ as bu,b_ as yu,b$ as xu,c0 as Eu,c1 as Tu,c2 as Cu,c3 as vu,c4 as wu,c5 as Su,c6 as Lu,c7 as _u,c8 as ku,c9 as Au,ca as Nu,cb as $u,cc as Ru,cd as Iu,ce as Pu,cf as Ou,cg as Mu,ch as Du,ci as Bu,cj as ju,I as Fu,ck as Uu,cl as zu,cm as Hu,cn as qu,co as Wu,cp as Xu,cq as Ju,cr as Vu,cs as Yu,ct as Gu,cu as Zu,cv as Ku,h as Qu,z as ed,cw as td,cx as nd,cy as sd,cz as od,cA as rd,cB as id,cC as ad,cD as ld,cE as cd,cF as ud,cG as dd,J as pd,cH as fd,cI as md,cJ as gd,cK as hd,cL as bd,cM as yd,cN as xd,cO as Ed,cP as Td,cQ as Cd,cR as vd,cS as wd,cT as Sd,cU as Ld,cV as _d,cW as kd,cX as Ad,cY as Nd,cZ as $d,c_ as Rd,c$ as Id,d0 as Pd,d1 as Od,d2 as Md,d3 as Dd,d4 as Bd,d5 as jd,d6 as Fd,d7 as Ud,d8 as zd,d9 as Hd,da as qd,db as Wd,dc as Xd,dd as Jd,de as Vd,df as Yd,dg as Gd,dh as Zd,di as Kd,dj as Qd,dk as ep,dl as tp,dm as np,dn as sp,dp as op,dq as rp,dr as ip,ds as ap,dt as lp,du as cp,dv as up,dw as dp,dx as pp,dy as fp,dz as mp,dA as gp,dB as hp,dC as bp,dD as yp,dE as xp,dF as Ep,dG as Tp,dH as Cp,dI as vp,dJ as wp,dK as Sp,dL as Lp,dM as _p,dN as kp,dO as Ap,dP as Np,dQ as $p,dR as Rp,dS as Ip,dT as Pp,dU as Op,dV as Mp,dW as Dp,dX as Bp,dY as jp,dZ as Fp,d_ as Up,d$ as zp,e0 as Hp,e1 as qp,e2 as Wp,e3 as Xp,e4 as Jp,e5 as Vp,e6 as Yp,e7 as Gp,e8 as Zp,e9 as Kp,ea as Qp,eb as ef,ec as tf,ed as nf,ee as sf,ef as of,eg as rf,eh as af,ei as lf,ej as cf,ek as uf,el as df,em as pf,en as ff,eo as mf,ep as gf,eq as hf,er as bf,es as yf,et as xf,eu as Ef,ev as Tf,ew as Cf,ex as vf,ey as wf,ez as Sf,eA as Lf,eB as _f,eC as kf,eD as Af,eE as Nf,eF as $f,eG as Rf,eH as If,eI as Pf,eJ as Of,eK as Mf,eL as Df,eM as Bf,eN as jf,eO as Ff,eP as Uf,eQ as zf,eR as Hf,eS as qf,eT as Wf,eU as Xf,eV as Jf,eW as Vf,eX as Yf,r as Gf,eY as Zf,eZ as Kf,e_ as Qf,e$ as em,i as tm,f0 as nm,f1 as sm,f2 as om,f3 as rm,f4 as im,f5 as am,f6 as lm,f7 as cm,f8 as um,f9 as dm,fa as pm,fb as fm,fc as mm,fd as gm,fe as hm,ff as bm,fg as ym,fh as xm,fi as Em,fj as Tm,fk as Cm,fl as vm,fm as wm,fn as Sm,fo as Lm,fp as _m,fq as km,fr as Am,fs as Nm,ft as $m,fu as Rm,fv as Im}from"./JupyterLexicalExtension-BQINjIFV.js";import{kB as io,r as m,j as h,aA as ao,au as lo,B as co,aE as ee,kC as F,kD as ae,kE as un,kF as fe,kG as z,kH as uo,kI as po,kJ as fo,kK as mo,kL as j,aD as ce,kM as Ee,kN as ut,kO as go,kP as ho,kQ as bo,kR as yo,kS as dn,kT as xo,kU as Eo,kV as To,kW as Co,kX as vo,kY as wo,aC as So,K as M,bS as ve,kZ as Lo,k_ as se,k$ as X,l0 as ye,l1 as _o,l2 as ko,l3 as Ao,bT as No,l4 as le,bV as pn,l5 as fn,l6 as mn,bd as gn,l7 as pe,l8 as $o,l9 as Ro,bi as ie,co as Io,I as Le,e4 as hn,C as Po,e as Oo,bX as Mo,k as Do,la as Bo,lb as jo,bW as ze,lc as Fo,ld as xt,d5 as Uo,el as zo,T as Ho,le as Et,lf as qo,lg as Wo,lh as Xo,li as Tt,lj as Jo,lk as Vo,av as Yo,aw as Go,aq as Zo,aB as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Om}from"./index-CsgaCZaW.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-CoHussa9.js";import{u as er}from"./Output-B9XAhyoF.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Dm,u as Bm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Fm}from"./YouTubePlugin-BEQBWMwx.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"./index-DoBEQ07P.js";import"./hoverbox-CStlKQWE.js";import"./index-DQQXY-7d.js";import"./index-BqMoyzEk.js";import"./color-CG7_7V2-.js";import"./isEqual-CGLTk7wU.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";class nr{registry;_debug;constructor(t,n=!1){this.registry=t,this._debug=n}calculateIndent(t){const n=this.registry.getConfigOrDefault(t.language),s=this.getLeadingWhitespaceCount(t.currentLine);let o=s,r=!1,i=!1,l;for(const a of n.indentTriggers)if(this.matchesIndentRule(t.currentLine,a)){o=s+a.indentAmount,r=!0,l=a.name;break}if(!r){for(const a of n.dedentTriggers)if(this.matchesDedentRule(t.currentLine,a)){i=!0,l=a.name;break}}if(n.customRules){for(const a of n.customRules)if(a.condition(t.currentLine,t)){o=a.apply(o,t);break}}return o=Math.max(0,o),{spaces:o,shouldIndent:r,shouldDedent:i,triggeredRule:l}}getTabString(t){const n=this.registry.getConfigOrDefault(t);return n.useTabs?" ":" ".repeat(n.tabSize)}getTabSize(t){return this.registry.getConfigOrDefault(t).tabSize}calculateOutdent(t,n){const s=this.registry.getConfigOrDefault(n),o=t-s.tabSize;return Math.max(0,o)}getLeadingWhitespaceCount(t){const n=t.match(/^[\t ]*/);if(!n)return 0;const s=n[0];let o=0;for(const r of s)r===" "?o+=4:o+=1;return o}getLeadingWhitespace(t){const n=t.match(/^[\t ]*/);return n?n[0]:""}matchesIndentRule(t,n){switch(n.context){case"line-end":return n.pattern.test(t);case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}matchesDedentRule(t,n){switch(n.context){case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}normalizeIndentation(t,n){const s=this.registry.getConfigOrDefault(n);if(s.useTabs){const o=this.getLeadingWhitespace(t),r=o.length,i=Math.floor(r/s.tabSize),l=r%s.tabSize;return" ".repeat(i)+" ".repeat(l)+t.substring(o.length)}else{const o=this.getLeadingWhitespace(t);return o.replace(/\t/g," ".repeat(s.tabSize)).concat(t.substring(o.length))}}}const sr={language:"python",tabSize:4,useTabs:!1,indentTriggers:[{name:"colon-indent",pattern:/:\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"continuation-backslash",pattern:/\\\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"open-bracket",pattern:/[[({]\s*$/,context:"line-end",indentAmount:4}],dedentTriggers:[{name:"flow-control-keywords",pattern:/^\s*(return|break|continue|pass)(\s|$)/,context:"line-start",dedentAmount:4},{name:"raise-keyword",pattern:/^\s*raise(\s|$)/,context:"line-start",dedentAmount:4}],customRules:[{name:"close-bracket-dedent",condition:e=>/^\s*[\])}]/.test(e),apply:e=>Math.max(0,e-4)}]},bn={language:"javascript",tabSize:2,useTabs:!1,indentTriggers:[{name:"open-brace",pattern:/\{\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-bracket",pattern:/\[\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-paren",pattern:/\(\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"arrow-function",pattern:/=>\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"ternary-operator",pattern:/\?\s*(\/\/.*)?$/,context:"line-end",indentAmount:2}],dedentTriggers:[{name:"return-statement",pattern:/^\s*return(\s|;)/,context:"line-start",dedentAmount:2},{name:"break-continue",pattern:/^\s*(break|continue)(\s|;)/,context:"line-start",dedentAmount:2},{name:"throw-statement",pattern:/^\s*throw(\s|;)/,context:"line-start",dedentAmount:2}],customRules:[{name:"close-brace-dedent",condition:e=>/^\s*}/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-bracket-dedent",condition:e=>/^\s*\]/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-paren-dedent",condition:e=>/^\s*\)/.test(e),apply:e=>Math.max(0,e-2)},{name:"case-label",condition:e=>/^\s*(case\s+.*:|default:)/.test(e),apply:(e,t)=>e}]},or={...bn,language:"typescript"};class rr{configs;options;constructor(t={}){this.configs=new Map,this.options={defaultLanguage:"python",fallbackTabSize:4,debug:!1,...t},this.registerDefaultLanguages(),t.customConfigs&&t.customConfigs.forEach(n=>this.registerLanguage(n))}registerDefaultLanguages(){this.registerLanguage(sr),this.registerLanguage(bn),this.registerLanguage(or),this.registerAlias("py","python"),this.registerAlias("js","javascript"),this.registerAlias("ts","typescript"),this.registerAlias("jsx","javascript"),this.registerAlias("tsx","typescript")}registerLanguage(t){if(this.configs.has(t.language)){this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t.language}' already registered. Use updateConfig() to modify.`);return}this.configs.set(t.language,t)}registerAlias(t,n){const s=this.configs.get(n);s&&this.configs.set(t,s)}getConfig(t){if(!t)return this.getConfig(this.options.defaultLanguage);const n=t.toLowerCase().trim();return this.configs.get(n)}getConfigOrDefault(t){const n=this.getConfig(t);if(n)return n;const s=this.getConfig(this.options.defaultLanguage);return s?(this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t}' not found, using default: ${this.options.defaultLanguage}`),s):(this.options.debug&&console.error(`[LanguageIndentRegistry] No config found for '${t}' and default '${this.options.defaultLanguage}' missing!`),this.createFallbackConfig(t||"unknown"))}createFallbackConfig(t){return{language:t,tabSize:this.options.fallbackTabSize||4,useTabs:this.options.preserveTabs||!1,indentTriggers:[],dedentTriggers:[]}}hasLanguage(t){if(!t)return!1;const n=t.toLowerCase().trim();return this.configs.has(n)}updateConfig(t,n){const s=t.toLowerCase().trim(),o=this.configs.get(s);if(!o)return this.options.debug&&console.warn(`[LanguageIndentRegistry] Cannot update '${t}' - not registered`),!1;const r={...o,...n,language:o.language};return this.configs.set(s,r),!0}getRegisteredLanguages(){return Array.from(this.configs.keys())}clear(){this.configs.clear()}reset(){this.clear(),this.registerDefaultLanguages()}}const ir="[Deleted Comment]",Qe=e=>e.uid===e.thread_uid,yn=e=>e.anchor?.mark_id??e.uid,ar=(e,t)=>e.created_at!==t.created_at?e.created_at<t.created_at?-1:1:e.uid<t.uid?-1:e.uid>t.uid?1:0,He=(e,t)=>e!==void 0&&e.updated_at>t.updated_at?e:t,vt=e=>{const{uid:t,handle:n,name:s,agent_uid:o}=e.author;return t?{kind:"user",uid:t,handle:n??null,name:s??null,...o?{agentUid:o}:{}}:Bn(s||n)},lr=e=>({type:"comment",id:e.uid,author:Dn(vt(e)),authorPrincipal:vt(e),content:e.deleted?ir:e.body,deleted:e.deleted,...e.mentions&&e.mentions.length>0?{mentions:e.mentions}:{},timeStamp:Date.parse(e.created_at)});function cr(e){const t=[...e].sort(ar),n=new Map;for(const s of t)Qe(s)||n.set(s.thread_uid,[...n.get(s.thread_uid)??[],s]);return t.filter(s=>Qe(s)&&!s.deleted&&s.status==="open").map(s=>({type:"thread",id:yn(s),quote:s.quote??"",assignee:s.assignee??null,comments:[s,...n.get(s.uid)??[]].map(lr)}))}const wt=e=>e&&e.length>0?{mentions:e}:{};class dl{searchPeople;assignThread;_editor;_backend;_options;_listeners=new Set;_heardDuringReads=new Set;_records=new Map;_comments=[];constructor(t,n,s={}){this._editor=t,this._backend=n,this._options=s;const{searchPeople:o,assign:r}=n;o&&(this.searchPeople=i=>o.call(n,i).catch(l=>{throw this._options.onError?.(l),l})),r&&(this.assignThread=(i,l)=>this._write(()=>r.call(n,this._threadRecord(i).uid,l?.uid??null)))}connect(){const t=this._backend.subscribe({comment:n=>this._heard(n),ready:()=>{this.refresh()}});return this.refresh(),t}async refresh(){const t=new Map;this._heardDuringReads.add(t);try{const n=await this._backend.list(),s=new Map(n.map(o=>[o.uid,o]));for(const[o,r]of t)s.set(o,He(s.get(o),r));this._records=s,this._changed()}catch(n){this._options.onError?.(n)}finally{this._heardDuringReads.delete(t)}}getComments(){return this._comments}addComment(t,n){if(t.type==="thread"){const s=t.id,o=t.comments[0];this._write(()=>this._backend.create({body:o?.content??"",anchor:{mark_id:s},quote:t.quote,...wt(o?.mentions)}),()=>this._unmark(s))}else n!==void 0?this._write(()=>this._backend.create({body:t.content,thread_uid:this._threadRecord(n).uid,...wt(t.mentions)})):this._options.onError?.(new Error("A comment is written in a thread."))}deleteComment(t){this._write(()=>this._backend.delete(t.id))}deleteThread(t){this._write(()=>this._backend.delete(this._threadRecord(t).uid))}resolveThread(t){this._write(()=>this._backend.resolve(this._threadRecord(t).uid))}registerOnChange(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}_write(t,n){Promise.resolve().then(t).then(s=>this._heard(s),s=>{n?.(),this._options.onError?.(s)})}_threadRecord(t){for(const n of this._records.values())if(Qe(n)&&yn(n)===t.id)return n;throw new Error(`The thread ${t.id} is not one the store read.`)}_heard(t){for(const n of this._heardDuringReads)n.set(t.uid,He(n.get(t.uid),t));this._records.set(t.uid,He(this._records.get(t.uid),t)),this._changed()}_changed(){this._comments=cr(this._records.values());for(const t of this._listeners)t()}_unmark(t){this._editor.update(()=>{for(const{node:n}of io())qt(n)&&n.getIDs().includes(t)&&(n.deleteID(t),n.getIDs().length===0&&Mn(n))})}}const dt=m.createContext(void 0);function ur(){const e=m.useContext(dt);if(!e)throw new Error("useContext must be inside a Provider with a value");return e}const dr=dt.Provider,pl=dt.Consumer,fl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function ml(e){const{useStore:t,children:n}=e,{colorMode:s,resolvedMode:o,themeConfig:r,themeBackground:i,lexicalTheme:l}=Qo(t);return h.jsx(ao,{colorMode:s,theme:r.primerTheme,themeStyles:r.themeStyles,children:h.jsx(lo,{colormode:o,backgroundColor:i,useBaseStyles:!1,children:h.jsx(co,{sx:{"& .editor-shell":{backgroundColor:i,borderRadius:2},"& .editor-container":{backgroundColor:i},"& .editor-inner":{backgroundColor:i},"& .editor-input":{backgroundColor:i},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:i}},children:h.jsx(tr.Provider,{value:{theme:l},children:n})})})})}const pr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>pr[t]??t)}function pt(e,t,n="{",s="}"){let o=0;for(let r=t;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(i===n)o++;else if(i===s&&(o--,o===0))return r}return-1}function W(e,t){let n=t;for(;n<e.length&&(e[n]===" "||e[n]===`
|
|
1
|
+
import{d as V}from"./LexicalToolRegistry-0QBhZnFO.js";import{D as Vl,a as Yl,b as Gl,e as Zl,c as Kl,g as Ql,i as ec,f as tc,l as nc,h as sc,j as oc,k as rc,m as ic,n as ac,r as lc,o as cc,p as uc,q as dc,s as pc,t as fc,v as mc,w as gc,x as hc,y as bc,z as yc,u as xc}from"./LexicalToolRegistry-0QBhZnFO.js";import{_ as qt,E as Mn,G as Dn,H as Bn,K as me,M as Wt,O as ot,P as rt,Q as jn,R as Fn,S as Xt,U as Un,V as Jt,W as zn,X as Hn,Y as Vt,Z as Yt,a0 as qn,a1 as Wn,a2 as Xn,a3 as Jn,C as Gt,a4 as Vn,a5 as Zt,a6 as Yn,a7 as Gn,a8 as Ce,a9 as Q,aa as Kt,ab as it,ac as xe,ad as at,ae as Re,af as Zn,ag as Be,ah as Ve,ai as lt,aj as Kn,ak as Ye,al as Qn,am as es,an as ts,ao as Ge,ap as Qt,aq as en,ar as tn,as as Ie,at as ns,au as ss,av as nn,aw as os,ax as Pe,$ as rs,b as is,a as as,c as ls,ay as sn,az as Y,aA as cs,aB as us,aC as Ze,aD as ds,aE as ps,aF as fs,aG as ms,aH as ct,aI as gs,aJ as hs,aK as bs,aL as ys,aM as xs,aN as Es,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Ts,aT as Cs,aU as vs,aV as ws,aW as Ss,aX as Ls,aY as _s,aZ as ks,a_ as As,x as on,a$ as Ns,b0 as $s,b1 as Rs,b2 as Is,b3 as Ps,b4 as Os,b5 as Ue,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Fs,bb as rn,bc as an,bd as ln,be as cn,j as Us,T as zs,L as Hs,w as qs,k as Ws,l as Xs,D as Js,m as Vs,n as Ys,o as Gs,p as Zs,t as Ks,bf as Qs,s as eo,F as to,u as no,v as so,bg as oo,bh as ro}from"./JupyterLexicalExtension-BgcLmrzO.js";import{bi as Tc,bj as Cc,bk as vc,bl as wc,bm as Sc,bn as Lc,bo as _c,bp as kc,bq as Ac,br as Nc,bs as $c,bt as Rc,bu as Ic,bv as Pc,d as Oc,e as Mc,bw as Dc,bx as Bc,B as jc,by as Fc,A as Uc,bz as zc,bA as Hc,bB as qc,bC as Wc,bD as Xc,bE as Jc,bF as Vc,bG as Yc,bH as Gc,bI as Zc,bJ as Kc,bK as Qc,bL as eu,bM as tu,bN as nu,bO as su,bP as ou,f as ru,bQ as iu,g as au,bR as lu,bS as cu,bT as uu,bU as du,bV as pu,q as fu,bW as mu,bX as gu,bY as hu,bZ as bu,b_ as yu,b$ as xu,c0 as Eu,c1 as Tu,c2 as Cu,c3 as vu,c4 as wu,c5 as Su,c6 as Lu,c7 as _u,c8 as ku,c9 as Au,ca as Nu,cb as $u,cc as Ru,cd as Iu,ce as Pu,cf as Ou,cg as Mu,ch as Du,ci as Bu,cj as ju,I as Fu,ck as Uu,cl as zu,cm as Hu,cn as qu,co as Wu,cp as Xu,cq as Ju,cr as Vu,cs as Yu,ct as Gu,cu as Zu,cv as Ku,h as Qu,z as ed,cw as td,cx as nd,cy as sd,cz as od,cA as rd,cB as id,cC as ad,cD as ld,cE as cd,cF as ud,cG as dd,J as pd,cH as fd,cI as md,cJ as gd,cK as hd,cL as bd,cM as yd,cN as xd,cO as Ed,cP as Td,cQ as Cd,cR as vd,cS as wd,cT as Sd,cU as Ld,cV as _d,cW as kd,cX as Ad,cY as Nd,cZ as $d,c_ as Rd,c$ as Id,d0 as Pd,d1 as Od,d2 as Md,d3 as Dd,d4 as Bd,d5 as jd,d6 as Fd,d7 as Ud,d8 as zd,d9 as Hd,da as qd,db as Wd,dc as Xd,dd as Jd,de as Vd,df as Yd,dg as Gd,dh as Zd,di as Kd,dj as Qd,dk as ep,dl as tp,dm as np,dn as sp,dp as op,dq as rp,dr as ip,ds as ap,dt as lp,du as cp,dv as up,dw as dp,dx as pp,dy as fp,dz as mp,dA as gp,dB as hp,dC as bp,dD as yp,dE as xp,dF as Ep,dG as Tp,dH as Cp,dI as vp,dJ as wp,dK as Sp,dL as Lp,dM as _p,dN as kp,dO as Ap,dP as Np,dQ as $p,dR as Rp,dS as Ip,dT as Pp,dU as Op,dV as Mp,dW as Dp,dX as Bp,dY as jp,dZ as Fp,d_ as Up,d$ as zp,e0 as Hp,e1 as qp,e2 as Wp,e3 as Xp,e4 as Jp,e5 as Vp,e6 as Yp,e7 as Gp,e8 as Zp,e9 as Kp,ea as Qp,eb as ef,ec as tf,ed as nf,ee as sf,ef as of,eg as rf,eh as af,ei as lf,ej as cf,ek as uf,el as df,em as pf,en as ff,eo as mf,ep as gf,eq as hf,er as bf,es as yf,et as xf,eu as Ef,ev as Tf,ew as Cf,ex as vf,ey as wf,ez as Sf,eA as Lf,eB as _f,eC as kf,eD as Af,eE as Nf,eF as $f,eG as Rf,eH as If,eI as Pf,eJ as Of,eK as Mf,eL as Df,eM as Bf,eN as jf,eO as Ff,eP as Uf,eQ as zf,eR as Hf,eS as qf,eT as Wf,eU as Xf,eV as Jf,eW as Vf,eX as Yf,r as Gf,eY as Zf,eZ as Kf,e_ as Qf,e$ as em,i as tm,f0 as nm,f1 as sm,f2 as om,f3 as rm,f4 as im,f5 as am,f6 as lm,f7 as cm,f8 as um,f9 as dm,fa as pm,fb as fm,fc as mm,fd as gm,fe as hm,ff as bm,fg as ym,fh as xm,fi as Em,fj as Tm,fk as Cm,fl as vm,fm as wm,fn as Sm,fo as Lm,fp as _m,fq as km,fr as Am,fs as Nm,ft as $m,fu as Rm,fv as Im}from"./JupyterLexicalExtension-BgcLmrzO.js";import{kC as io,r as m,j as h,aA as ao,au as lo,B as co,aE as ee,kD as F,kE as ae,kF as un,kG as fe,kH as z,kI as uo,kJ as po,kK as fo,kL as mo,kM as j,aD as ce,kN as Ee,kO as ut,kP as go,kQ as ho,kR as bo,kS as yo,kT as dn,kU as xo,kV as Eo,kW as To,kX as Co,kY as vo,kZ as wo,aC as So,K as M,bS as ve,k_ as Lo,k$ as se,l0 as X,l1 as ye,l2 as _o,l3 as ko,l4 as Ao,bT as No,l5 as le,bV as pn,l6 as fn,l7 as mn,bd as gn,l8 as pe,l9 as $o,la as Ro,bi as ie,co as Io,I as Le,e4 as hn,C as Po,e as Oo,bX as Mo,k as Do,lb as Bo,lc as jo,bW as ze,ld as Fo,le as xt,d5 as Uo,el as zo,T as Ho,lf as Et,lg as qo,lh as Wo,li as Xo,lj as Tt,lk as Jo,ll as Vo,av as Yo,aw as Go,aq as Zo,aB as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Om}from"./index-BMlDZi3F.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-CoHussa9.js";import{u as er}from"./Output-B4b0TC6x.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Dm,u as Bm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Fm}from"./YouTubePlugin-CGKNamMP.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"./index-D2V9YBSL.js";import"./hoverbox-CStlKQWE.js";import"./index-TzvZ9g2T.js";import"./index-I5uUezOA.js";import"./color-CG7_7V2-.js";import"./isEqual-BxgGIFfN.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";class nr{registry;_debug;constructor(t,n=!1){this.registry=t,this._debug=n}calculateIndent(t){const n=this.registry.getConfigOrDefault(t.language),s=this.getLeadingWhitespaceCount(t.currentLine);let o=s,r=!1,i=!1,l;for(const a of n.indentTriggers)if(this.matchesIndentRule(t.currentLine,a)){o=s+a.indentAmount,r=!0,l=a.name;break}if(!r){for(const a of n.dedentTriggers)if(this.matchesDedentRule(t.currentLine,a)){i=!0,l=a.name;break}}if(n.customRules){for(const a of n.customRules)if(a.condition(t.currentLine,t)){o=a.apply(o,t);break}}return o=Math.max(0,o),{spaces:o,shouldIndent:r,shouldDedent:i,triggeredRule:l}}getTabString(t){const n=this.registry.getConfigOrDefault(t);return n.useTabs?" ":" ".repeat(n.tabSize)}getTabSize(t){return this.registry.getConfigOrDefault(t).tabSize}calculateOutdent(t,n){const s=this.registry.getConfigOrDefault(n),o=t-s.tabSize;return Math.max(0,o)}getLeadingWhitespaceCount(t){const n=t.match(/^[\t ]*/);if(!n)return 0;const s=n[0];let o=0;for(const r of s)r===" "?o+=4:o+=1;return o}getLeadingWhitespace(t){const n=t.match(/^[\t ]*/);return n?n[0]:""}matchesIndentRule(t,n){switch(n.context){case"line-end":return n.pattern.test(t);case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}matchesDedentRule(t,n){switch(n.context){case"line-start":return n.pattern.test(t);case"anywhere":return n.pattern.test(t);default:return!1}}normalizeIndentation(t,n){const s=this.registry.getConfigOrDefault(n);if(s.useTabs){const o=this.getLeadingWhitespace(t),r=o.length,i=Math.floor(r/s.tabSize),l=r%s.tabSize;return" ".repeat(i)+" ".repeat(l)+t.substring(o.length)}else{const o=this.getLeadingWhitespace(t);return o.replace(/\t/g," ".repeat(s.tabSize)).concat(t.substring(o.length))}}}const sr={language:"python",tabSize:4,useTabs:!1,indentTriggers:[{name:"colon-indent",pattern:/:\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"continuation-backslash",pattern:/\\\s*(#.*)?$/,context:"line-end",indentAmount:4},{name:"open-bracket",pattern:/[[({]\s*$/,context:"line-end",indentAmount:4}],dedentTriggers:[{name:"flow-control-keywords",pattern:/^\s*(return|break|continue|pass)(\s|$)/,context:"line-start",dedentAmount:4},{name:"raise-keyword",pattern:/^\s*raise(\s|$)/,context:"line-start",dedentAmount:4}],customRules:[{name:"close-bracket-dedent",condition:e=>/^\s*[\])}]/.test(e),apply:e=>Math.max(0,e-4)}]},bn={language:"javascript",tabSize:2,useTabs:!1,indentTriggers:[{name:"open-brace",pattern:/\{\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-bracket",pattern:/\[\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"open-paren",pattern:/\(\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"arrow-function",pattern:/=>\s*(\/\/.*)?$/,context:"line-end",indentAmount:2},{name:"ternary-operator",pattern:/\?\s*(\/\/.*)?$/,context:"line-end",indentAmount:2}],dedentTriggers:[{name:"return-statement",pattern:/^\s*return(\s|;)/,context:"line-start",dedentAmount:2},{name:"break-continue",pattern:/^\s*(break|continue)(\s|;)/,context:"line-start",dedentAmount:2},{name:"throw-statement",pattern:/^\s*throw(\s|;)/,context:"line-start",dedentAmount:2}],customRules:[{name:"close-brace-dedent",condition:e=>/^\s*}/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-bracket-dedent",condition:e=>/^\s*\]/.test(e),apply:e=>Math.max(0,e-2)},{name:"close-paren-dedent",condition:e=>/^\s*\)/.test(e),apply:e=>Math.max(0,e-2)},{name:"case-label",condition:e=>/^\s*(case\s+.*:|default:)/.test(e),apply:(e,t)=>e}]},or={...bn,language:"typescript"};class rr{configs;options;constructor(t={}){this.configs=new Map,this.options={defaultLanguage:"python",fallbackTabSize:4,debug:!1,...t},this.registerDefaultLanguages(),t.customConfigs&&t.customConfigs.forEach(n=>this.registerLanguage(n))}registerDefaultLanguages(){this.registerLanguage(sr),this.registerLanguage(bn),this.registerLanguage(or),this.registerAlias("py","python"),this.registerAlias("js","javascript"),this.registerAlias("ts","typescript"),this.registerAlias("jsx","javascript"),this.registerAlias("tsx","typescript")}registerLanguage(t){if(this.configs.has(t.language)){this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t.language}' already registered. Use updateConfig() to modify.`);return}this.configs.set(t.language,t)}registerAlias(t,n){const s=this.configs.get(n);s&&this.configs.set(t,s)}getConfig(t){if(!t)return this.getConfig(this.options.defaultLanguage);const n=t.toLowerCase().trim();return this.configs.get(n)}getConfigOrDefault(t){const n=this.getConfig(t);if(n)return n;const s=this.getConfig(this.options.defaultLanguage);return s?(this.options.debug&&console.warn(`[LanguageIndentRegistry] Language '${t}' not found, using default: ${this.options.defaultLanguage}`),s):(this.options.debug&&console.error(`[LanguageIndentRegistry] No config found for '${t}' and default '${this.options.defaultLanguage}' missing!`),this.createFallbackConfig(t||"unknown"))}createFallbackConfig(t){return{language:t,tabSize:this.options.fallbackTabSize||4,useTabs:this.options.preserveTabs||!1,indentTriggers:[],dedentTriggers:[]}}hasLanguage(t){if(!t)return!1;const n=t.toLowerCase().trim();return this.configs.has(n)}updateConfig(t,n){const s=t.toLowerCase().trim(),o=this.configs.get(s);if(!o)return this.options.debug&&console.warn(`[LanguageIndentRegistry] Cannot update '${t}' - not registered`),!1;const r={...o,...n,language:o.language};return this.configs.set(s,r),!0}getRegisteredLanguages(){return Array.from(this.configs.keys())}clear(){this.configs.clear()}reset(){this.clear(),this.registerDefaultLanguages()}}const ir="[Deleted Comment]",Qe=e=>e.uid===e.thread_uid,yn=e=>e.anchor?.mark_id??e.uid,ar=(e,t)=>e.created_at!==t.created_at?e.created_at<t.created_at?-1:1:e.uid<t.uid?-1:e.uid>t.uid?1:0,He=(e,t)=>e!==void 0&&e.updated_at>t.updated_at?e:t,vt=e=>{const{uid:t,handle:n,name:s,agent_uid:o}=e.author;return t?{kind:"user",uid:t,handle:n??null,name:s??null,...o?{agentUid:o}:{}}:Bn(s||n)},lr=e=>({type:"comment",id:e.uid,author:Dn(vt(e)),authorPrincipal:vt(e),content:e.deleted?ir:e.body,deleted:e.deleted,...e.mentions&&e.mentions.length>0?{mentions:e.mentions}:{},timeStamp:Date.parse(e.created_at)});function cr(e){const t=[...e].sort(ar),n=new Map;for(const s of t)Qe(s)||n.set(s.thread_uid,[...n.get(s.thread_uid)??[],s]);return t.filter(s=>Qe(s)&&!s.deleted&&s.status==="open").map(s=>({type:"thread",id:yn(s),quote:s.quote??"",assignee:s.assignee??null,comments:[s,...n.get(s.uid)??[]].map(lr)}))}const wt=e=>e&&e.length>0?{mentions:e}:{};class dl{searchPeople;assignThread;_editor;_backend;_options;_listeners=new Set;_heardDuringReads=new Set;_records=new Map;_comments=[];constructor(t,n,s={}){this._editor=t,this._backend=n,this._options=s;const{searchPeople:o,assign:r}=n;o&&(this.searchPeople=i=>o.call(n,i).catch(l=>{throw this._options.onError?.(l),l})),r&&(this.assignThread=(i,l)=>this._write(()=>r.call(n,this._threadRecord(i).uid,l?.uid??null)))}connect(){const t=this._backend.subscribe({comment:n=>this._heard(n),ready:()=>{this.refresh()}});return this.refresh(),t}async refresh(){const t=new Map;this._heardDuringReads.add(t);try{const n=await this._backend.list(),s=new Map(n.map(o=>[o.uid,o]));for(const[o,r]of t)s.set(o,He(s.get(o),r));this._records=s,this._changed()}catch(n){this._options.onError?.(n)}finally{this._heardDuringReads.delete(t)}}getComments(){return this._comments}addComment(t,n){if(t.type==="thread"){const s=t.id,o=t.comments[0];this._write(()=>this._backend.create({body:o?.content??"",anchor:{mark_id:s},quote:t.quote,...wt(o?.mentions)}),()=>this._unmark(s))}else n!==void 0?this._write(()=>this._backend.create({body:t.content,thread_uid:this._threadRecord(n).uid,...wt(t.mentions)})):this._options.onError?.(new Error("A comment is written in a thread."))}deleteComment(t){this._write(()=>this._backend.delete(t.id))}deleteThread(t){this._write(()=>this._backend.delete(this._threadRecord(t).uid))}resolveThread(t){this._write(()=>this._backend.resolve(this._threadRecord(t).uid))}registerOnChange(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}_write(t,n){Promise.resolve().then(t).then(s=>this._heard(s),s=>{n?.(),this._options.onError?.(s)})}_threadRecord(t){for(const n of this._records.values())if(Qe(n)&&yn(n)===t.id)return n;throw new Error(`The thread ${t.id} is not one the store read.`)}_heard(t){for(const n of this._heardDuringReads)n.set(t.uid,He(n.get(t.uid),t));this._records.set(t.uid,He(this._records.get(t.uid),t)),this._changed()}_changed(){this._comments=cr(this._records.values());for(const t of this._listeners)t()}_unmark(t){this._editor.update(()=>{for(const{node:n}of io())qt(n)&&n.getIDs().includes(t)&&(n.deleteID(t),n.getIDs().length===0&&Mn(n))})}}const dt=m.createContext(void 0);function ur(){const e=m.useContext(dt);if(!e)throw new Error("useContext must be inside a Provider with a value");return e}const dr=dt.Provider,pl=dt.Consumer,fl=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function ml(e){const{useStore:t,children:n}=e,{colorMode:s,resolvedMode:o,themeConfig:r,themeBackground:i,lexicalTheme:l}=Qo(t);return h.jsx(ao,{colorMode:s,theme:r.primerTheme,themeStyles:r.themeStyles,children:h.jsx(lo,{colormode:o,backgroundColor:i,useBaseStyles:!1,children:h.jsx(co,{sx:{"& .editor-shell":{backgroundColor:i,borderRadius:2},"& .editor-container":{backgroundColor:i},"& .editor-inner":{backgroundColor:i},"& .editor-input":{backgroundColor:i},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:i}},children:h.jsx(tr.Provider,{value:{theme:l},children:n})})})})}const pr={"\\":"\\textbackslash{}","{":"\\{","}":"\\}",$:"\\$","&":"\\&","#":"\\#","^":"\\^{}",_:"\\_","%":"\\%","~":"\\~{}"};function K(e){return e.replace(/[\\{}$&#^_%~]/g,t=>pr[t]??t)}function pt(e,t,n="{",s="}"){let o=0;for(let r=t;r<e.length;r++){const i=e[r];if(i==="\\"){r++;continue}if(i===n)o++;else if(i===s&&(o--,o===0))return r}return-1}function W(e,t){let n=t;for(;n<e.length&&(e[n]===" "||e[n]===`
|
|
2
2
|
`);)n++;if(e[n]!=="{")return null;const s=pt(e,n);return s===-1?null:{value:e.slice(n+1,s),end:s+1}}function ne(e,t){let n=t;for(;n<e.length&&e[n]===" ";)n++;if(e[n]!=="[")return null;const s=pt(e,n,"[","]");return s===-1?null:{value:e.slice(n+1,s),end:s+1}}function xn(e){return e.split(`
|
|
3
3
|
`).map(t=>{for(let n=0;n<t.length;n++){if(t[n]==="\\"){n++;continue}if(t[n]==="%")return t.slice(0,n)}return t}).join(`
|
|
4
4
|
`)}function En(e,t){if(!e)return null;const n=new RegExp(`(?:^|,)\\s*${t}\\s*=\\s*([^,]+)`).exec(e);return n?n[1].trim():null}function oe(e,t,n){const s=[];let o=t;for(let r=0;r<n;r++){const i=W(e,o);if(!i)break;s.push(i.value),o=i.end}return{values:s,end:o}}function fr(e){const t=e.indexOf("\\begin{document}");if(t===-1)return{body:e,preamble:""};const n=t+16,s=e.lastIndexOf("\\end{document}");return{body:s===-1?e.slice(n):e.slice(n,s),preamble:e.slice(0,t)}}function Tn(e){return e.charAt(0).toUpperCase()+e.slice(1)}const mr=new Set(["book","report","memoir","scrbook","scrreprt","amsbook","thesis","mitthesis","phdthesis","bookest"]);function Cn(e,t){return mr.has((e??"").toLowerCase())||t!==void 0&&/(?<!\\)\\chapter\b/.test(t)}const gr={h1:"section",h2:"subsection",h3:"subsubsection",h4:"paragraph",h5:"subparagraph",h6:"subparagraph"},hr={h1:"chapter",h2:"section",h3:"subsection",h4:"subsubsection",h5:"paragraph",h6:"subparagraph"},br={part:"h1",chapter:"h1",section:"h1",subsection:"h2",subsubsection:"h3",paragraph:"h4",subparagraph:"h5"},yr={part:"h1",chapter:"h1",section:"h2",subsection:"h3",subsubsection:"h4",paragraph:"h5",subparagraph:"h6"};function xr(e){return e?{js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",typescript:"TypeScript",py:"Python",python:"Python",sh:"bash",bash:"bash",r:"R",sql:"SQL",c:"C",cpp:"C++",java:"Java",html:"HTML",xml:"XML",json:"JSON",markdown:"Markdown",md:"Markdown"}[e.toLowerCase()]??e:null}function ft(e){return e.replace(/^\n/,"").replace(/\n[ \t]*$/,"")}function Er(e){if(uo(e))return St(e.text);if(po(e)||fo(e)){const t=e.data["text/plain"];return t===void 0?null:St(t)}return mo(e)?e.traceback.join(`
|