@datalayer/agent-runtimes 1.6.39 → 1.6.40
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-Ba3DRn2p.js → AgentDetails-DC7O2VWb.js} +1 -1
- package/dist-embed/chunks/{AgentDetailsDialog-CXN0RO_L.js → AgentDetailsDialog-BTJCl-o-.js} +1 -1
- package/dist-embed/chunks/{AgentInspector-C66D0b0W.js → AgentInspector-BXqYY8g-.js} +1 -1
- package/dist-embed/chunks/{AgentInspectorDialog-DeK96QG1.js → AgentInspectorDialog-dRHZ1p73.js} +1 -1
- package/dist-embed/chunks/Avatar-Cv5OpUWu.js +1 -0
- package/dist-embed/chunks/{CellSidebarExtension-D7aXShZc.js → CellSidebarExtension-DXPIz0Km.js} +7 -7
- package/dist-embed/chunks/{ChatView-2N7PbcDs.js → ChatView-CRitAB2i.js} +4 -4
- package/dist-embed/chunks/{CollapsiblePlugin-y8sx_FL8.js → CollapsiblePlugin-BPlfrDQU.js} +1 -1
- package/dist-embed/chunks/DatalayerAgentBridge-D01Ek4NE.js +1 -0
- package/dist-embed/chunks/{DeckComponent-BnyeYRQq.js → DeckComponent-jvb83Q__.js} +1 -1
- package/dist-embed/chunks/{DocumentView-DT4DcdJI.js → DocumentView-BrdFnTVh.js} +3 -3
- package/dist-embed/chunks/{EphemeralDocument-CGISw1N3.js → EphemeralDocument-CkPQKyfy.js} +1 -1
- package/dist-embed/chunks/{EphemeralNotebook-Dyx-25uN.js → EphemeralNotebook-CiQIC3MG.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-Bl3R2Mic.js → ExcalidrawComponent-D6Cr_b0Z.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-DSL5jBhG.js → ExcalidrawModal-Bso7oDbl.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-C55KdpCk.js → JupyterLexicalExtension-DuD7IV6j.js} +6 -6
- package/dist-embed/chunks/{KernelVariables-D3DSQaD3.js → KernelVariables-CXQagESp.js} +2 -2
- package/dist-embed/chunks/{NotebookSkeleton-BkzTMhIX.js → NotebookSkeleton-CvO9WylK.js} +1 -1
- package/dist-embed/chunks/{NotebookToolSurfaces-Bvj9nwA9.js → NotebookToolSurfaces-B9fkzQNR.js} +1 -1
- package/dist-embed/chunks/{NotebookToolbar-BMjQTGrr.js → NotebookToolbar-D36duUxK.js} +1 -1
- package/dist-embed/chunks/{NotebookView-DRPnBAI2.js → NotebookView-BrdHwtKH.js} +1 -1
- package/dist-embed/chunks/{Output-D-7eUege.js → Output-D9cwH5rg.js} +1 -1
- package/dist-embed/chunks/{SandboxDetailsDialog-qJBg2naH.js → SandboxDetailsDialog-BYgLjg3W.js} +1 -1
- package/dist-embed/chunks/{SchemaForm-D6BAKaNe.js → SchemaForm-B3qMIWMy.js} +1 -1
- package/dist-embed/chunks/{SheetTabs-BLaEhX0D.js → SheetTabs-BR72mzuo.js} +2 -2
- package/dist-embed/chunks/{SpreadsheetPreviewView-CaFQASZ4.js → SpreadsheetPreviewView-RA8ASTBV.js} +1 -1
- package/dist-embed/chunks/{SpreadsheetView-DesdGLpm.js → SpreadsheetView-BfScdA-X.js} +1 -1
- package/dist-embed/chunks/{Toolbar-BncUh2ly.js → Toolbar-BAjGB6b-.js} +1 -1
- package/dist-embed/chunks/{WidgetVariableView-B4faSdWW.js → WidgetVariableView-7lvDcxCg.js} +1 -1
- package/dist-embed/chunks/{YouTubePlugin-BPUrB3sh.js → YouTubePlugin-BbjCzaT_.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-Dq_tRQtR.js → ar-SA-G6X2FPQ2-D4M2b5Lr.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-DQAoJi9C.js → az-AZ-76LH7QW2-Rn7oINhz.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-CfZUFj2_.js → bg-BG-XCXSNQG7-xztohKe7.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-DiqZdhkT.js → bn-BD-2XOGV67Q-C7Ssg1_2.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-B6c2PcO9.js → ca-ES-6MX7JW3Y-Cr0zd8Z6.js} +1 -1
- package/dist-embed/chunks/{celltoolbartracker-BHSFiiuz.js → celltoolbartracker-D1C_kGQL.js} +1 -1
- package/dist-embed/chunks/{component-BUTWfiVL.js → component-CmnuUtgX.js} +3 -3
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-ha7l75va.js → cs-CZ-2BRQDIVT-G9tBUkZh.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-C3b8_hbR.js → da-DK-5WZEPLOC-91_vyLpq.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-CxWFSn3l.js → de-DE-XR44H4JA-Bb9tvIZa.js} +1 -1
- package/dist-embed/chunks/{dist-BF0YFIb6.js → dist-B5YvY_O1.js} +2 -2
- package/dist-embed/chunks/{dist-DsEDq9qF.js → dist-BBqWTRLi.js} +1 -1
- package/dist-embed/chunks/{dist-DRRbvr4-.js → dist-BC_2VyAM.js} +1 -1
- package/dist-embed/chunks/{dist-B_TGJsfl.js → dist-BhfyuH1D.js} +1 -1
- package/dist-embed/chunks/{dist-Cfvz7CF7.js → dist-BlIg6ytm.js} +1 -1
- package/dist-embed/chunks/{dist-COiURBxL.js → dist-Ct-bkqXx.js} +4 -4
- package/dist-embed/chunks/{dist-tosaS6vh.js → dist-CtFgtNKe.js} +1 -1
- package/dist-embed/chunks/{dist-B1tXS8Wo.js → dist-DLyNQ3Jj.js} +1 -1
- package/dist-embed/chunks/{document-CqNE0DPx.js → document-Dp0KpIjg.js} +1 -1
- package/dist-embed/chunks/{drivecontents-D1HzL7Fi.js → drivecontents-BsC6Y2Vl.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-iSsL6em8.js → el-GR-BZB4AONW-B5kc3JC5.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-BEbh9GGw.js → es-ES-U4NZUMDT-CpFB18Kf.js} +1 -1
- package/dist-embed/chunks/{esm-RWOqF6ly.js → esm-BqqxV5QL.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-C7o7R9hc.js → eu-ES-A7QVB2H4-CqCALK0Q.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-DQNpeHKi.js → fa-IR-HGAKTJCU-BzSY8fri.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-D083iC1R.js → fi-FI-Z5N7JZ37-DPRPVT_v.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-CUvaq7hG.js → fr-FR-RHASNOE6-Cr4lVSvD.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-DU31KRvC.js → gl-ES-HMX3MZ6V-CZUw7dN0.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-bMtU7JNY.js → he-IL-6SHJWFNN-DaU5Odek.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-Pma0rKxO.js → hi-IN-IWLTKZ5I-BZ84Rooc.js} +1 -1
- package/dist-embed/chunks/{htmlselect-CqXICb9e.js → htmlselect-5N6NdDqL.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-Dof3afSc.js → hu-HU-A5ZG7DT2-SZiCSe0B.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-ZwqZHBDj.js → id-ID-SAP4L64H-DrRa3vVi.js} +1 -1
- package/dist-embed/chunks/{index-9EhrHHj7.js → index-B6-uQd5L.js} +3 -3
- package/dist-embed/chunks/{index-9wJFadG-.js → index-CEeyR3FZ.js} +1 -1
- package/dist-embed/chunks/{index-CqP3xLL5.js → index-CKWSKbHe.js} +1 -1
- package/dist-embed/chunks/{index-BbcMy3Al.js → index-DpN8KK6c.js} +1 -1
- package/dist-embed/chunks/{index--S8WFITA.js → index-JmqWOkdt.js} +1 -1
- package/dist-embed/chunks/{index-CMhceBby.js → index-PKH5uAl-.js} +1 -1
- package/dist-embed/chunks/{index-C7UsrKrP.js → index-hhftmReh.js} +1 -1
- package/dist-embed/chunks/{index-6zxBQeM_.js → index-qhxI1VzX.js} +2 -2
- package/dist-embed/chunks/{index.esm-xgVG4GIx.js → index.esm-Bvtnemp7.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-C-uM6NhO.js → it-IT-JPQ66NNP-_TEhDIcF.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-qzihtLnX.js → ja-JP-DBVTYXUO-IJaTVgTb.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-Amx_Jfx0.js → kaa-6HZHGXH3-CTksAiLJ.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-BPZfDYRT.js → kab-KAB-ZGHBKWFO-DbA7aOfU.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-B83bJ3Yw.js → kk-KZ-P5N5QNE5-Bdzg30AB.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-BvPDwBVw.js → km-KH-HSX4SM5Z-Bwn2NP1-.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-jpQ_OpzG.js → ko-KR-MTYHY66A-KUaxlo0q.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-RsfwTm7i.js → ku-TR-6OUDTVRD-DRegsFXo.js} +1 -1
- package/dist-embed/chunks/{lib-CFx15o08.js → lib--J3JPp2K.js} +1 -1
- package/dist-embed/chunks/{lib-D6X8UF4a.js → lib-9S57siQD.js} +1 -1
- package/dist-embed/chunks/{lib-CoK70EWs.js → lib-BpltV-0Y.js} +1 -1
- package/dist-embed/chunks/{lib-DGhrI5Uw.js → lib-C2mgrsS1.js} +1 -1
- package/dist-embed/chunks/{lib-XSPvEMl2.js → lib-C46CpvHb.js} +1 -1
- package/dist-embed/chunks/{lib-D0Q8IWel.js → lib-CHID83aM.js} +1 -1
- package/dist-embed/chunks/{lib-Pqxz_81N.js → lib-COJY2oKd.js} +25 -25
- package/dist-embed/chunks/{lib-p7v7zGkv.js → lib-CQeoQJWp.js} +1 -1
- package/dist-embed/chunks/{lib-CdtiDxdA.js → lib-CjBEbEzm.js} +1 -1
- package/dist-embed/chunks/{lib-BBnVlTAj.js → lib-Cpc8Fspj.js} +1 -1
- package/dist-embed/chunks/{lib-CsiCQ8oM.js → lib-D7CvuX1J.js} +1 -1
- package/dist-embed/chunks/{lib-7ge2Kma3.js → lib-DOnguzJf.js} +1 -1
- package/dist-embed/chunks/{lib-UYAFV0Oh.js → lib-Dh9o1esj.js} +1 -1
- package/dist-embed/chunks/{lib-DdeRC7g0.js → lib-DrEcjKb5.js} +1 -1
- package/dist-embed/chunks/{lib-Dj12Ge-1.js → lib-PbTUB5SW.js} +1 -1
- package/dist-embed/chunks/{lib-DMy40SOL.js → lib-QmOij8gS.js} +1 -1
- package/dist-embed/chunks/{lib-C7Y61LM1.js → lib-csBGF1d0.js} +1 -1
- package/dist-embed/chunks/{lib-DTyx2eLX.js → lib-op0DTswa.js} +1 -1
- package/dist-embed/chunks/{lib-CkcilPdy.js → lib-ox3VOLDA.js} +1 -1
- package/dist-embed/chunks/{lib-Bi95m_cb.js → lib-rn9DpcHi.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-qZ_KjUTQ.js → lt-LT-XHIRWOB4-c6CdaS7u.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-BOKJbljG.js → lv-LV-5QDEKY6T-D9RognOk.js} +1 -1
- package/dist-embed/chunks/{model-C2VRzh1c.js → model-DbDJZyri.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-xba6p6AI.js → mr-IN-CRQNXWMA-ht3P_mrN.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-B_H0GaRX.js → my-MM-5M5IBNSE-CsIkhWRp.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-Ddg4NpHf.js → nb-NO-T6EIAALU-DJw7Uvbx.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-DS_Sofox.js → nl-NL-IS3SIHDZ-Dcrp-zwB.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-CYSB6TTi.js → nn-NO-6E72VCQL-DaBAIbM9.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-QrIn4XvF.js → oc-FR-POXYY2M6-DSdMEDCa.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-BbacRfk_.js → pa-IN-N4M65BXN-BMyPito1.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-TyKhSuec.js → percentages-BXMCSKIN-pswfKMt2.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-Cn2ehrU4.js → pl-PL-T2D74RX3-CFk8rHgP.js} +1 -1
- package/dist-embed/chunks/{plugin-CPCdQWpK.js → plugin-BpyrQiv7.js} +1 -1
- package/dist-embed/chunks/{plugin-D7Giq2rW.js → plugin-NcgdmcAO.js} +1 -1
- package/dist-embed/chunks/{plugin-AdqytlNC.js → plugin-omHCT1Jk.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-CpNtiBPh.js → pt-BR-5N22H2LF-BYlDcalT.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-CcDR3Igq.js → pt-PT-UZXXM6DQ-xXdoFOOb.js} +1 -1
- package/dist-embed/chunks/{pyodide-kernel-CN7B4QLg.js → pyodide-kernel-bjLdubpe.js} +1 -1
- package/dist-embed/chunks/{pyodide-kernel-extension-CKE5jq9F.js → pyodide-kernel-extension-CshyO6Mm.js} +1 -1
- package/dist-embed/chunks/{renderer-8__rsP1H.js → renderer-We9CyR7b.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-CANXxss1.js → ro-RO-JPDTUUEW-e-URCww-.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-B_NkKbWo.js → ru-RU-B4JR7IUQ-CrXBOpZl.js} +1 -1
- package/dist-embed/chunks/{server-extension-BvlUJPbJ.js → server-extension-D9R-wwz5.js} +1 -1
- package/dist-embed/chunks/{sessions-CgjtuOSm.js → sessions-DdXtI_C1.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-Da_Bg8Mv.js → si-LK-N5RQ5JYF-DmJK04-A.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-BKs6l_DT.js → sk-SK-C5VTKIMK-BDHycW1Q.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-C4TvSXZU.js → sl-SI-NN7IZMDC-Bv9ZQTNb.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-BZGTZU2h.js → subset-shared.chunk-B0WCMaCa.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-CNJFtQV7.js → subset-worker.chunk-i0SNRqXr.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-DdKzikID.js → sv-SE-XGPEYMSR-_HPzcZFc.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-CDzGLNXS.js → ta-IN-2NMHFXQM-Ccvi-lqm.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-X4BJ7awj.js → th-TH-HPSO5L25-DvAg4Mv1.js} +1 -1
- package/dist-embed/chunks/{tokens-CBhRbpQP.js → tokens-CTXFWLvM.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-CN69_6_H.js → tr-TR-DEFEU3FU-DJsjfrja.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-KjB2cySI.js → uk-UA-QMV73CPH-3fvexlQA.js} +1 -1
- package/dist-embed/chunks/{usePrimerThemeBridge-DyX4EYyN.js → usePrimerThemeBridge-NsTRGuo7.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-BqVSbGWG.js → vi-VN-M7AON7JQ-BoQ3ayAr.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-oRPI4tbl.js → zh-CN-LNUGB5OW-Dzh0Ni_q.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-BUlz3y0i.js → zh-HK-E62DVLB3-_1FpSc_d.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-NxjUwhr3.js → zh-TW-RAJ6MFWO-CU-R8eF0.js} +1 -1
- package/dist-embed/datalayer-app-main.js +18 -18
- package/lib/apps/apps/AppRenderer.d.ts +6 -0
- package/lib/apps/apps/AppRenderer.js +3 -0
- package/lib/apps/plugins/agents/appLaunch.js +12 -0
- package/lib/hooks/useAgentRuntimes.d.ts +1 -1
- package/lib/hooks/useAgentRuntimes.js +2 -0
- package/lib/runtimes/actions.js +6 -0
- package/lib/runtimes/apis.d.ts +8 -0
- package/lib/specs/agents/agents.js +1 -1
- package/lib/types/agents-lifecycle.d.ts +7 -0
- package/lib/types/agentspecs.d.ts +9 -4
- package/lib/types/agentspecs.js +7 -1
- package/package.json +1 -1
- package/dist-embed/chunks/Avatar-MNx1kN3F.js +0 -1
- package/dist-embed/chunks/DatalayerAgentBridge-BuGt8vDu.js +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{d as V}from"./LexicalToolRegistry-LfEpCrfD.js";import{D as Yl,a as Gl,b as Zl,e as Kl,c as Ql,g as ec,i as tc,f as nc,l as sc,h as oc,j as rc,k as ic,m as ac,n as lc,r as cc,o as uc,p as dc,q as pc,s as fc,t as mc,v as gc,w as hc,x as bc,y as yc,z as xc,u as Ec}from"./LexicalToolRegistry-LfEpCrfD.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 Un,S as Xt,U as Fn,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 Fe,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Us,bb as rn,bc as an,bd as ln,be as cn,j as Fs,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-C55KdpCk.js";import{bi as Cc,bj as vc,bk as wc,bl as Sc,bm as Lc,bn as _c,bo as kc,bp as Ac,bq as Nc,br as $c,bs as Rc,bt as Ic,bu as Pc,bv as Oc,d as Mc,e as Dc,bw as Bc,bx as jc,B as Uc,by as Fc,A as zc,bz as Hc,bA as qc,bB as Wc,bC as Xc,bD as Jc,bE as Vc,bF as Yc,bG as Gc,bH as Zc,bI as Kc,bJ as Qc,bK as eu,bL as tu,bM as nu,bN as su,bO as ou,bP as ru,f as iu,bQ as au,g as lu,bR as cu,bS as uu,bT as du,bU as pu,bV as fu,q as mu,bW as gu,bX as hu,bY as bu,bZ as yu,b_ as xu,b$ as Eu,c0 as Tu,c1 as Cu,c2 as vu,c3 as wu,c4 as Su,c5 as Lu,c6 as _u,c7 as ku,c8 as Au,c9 as Nu,ca as $u,cb as Ru,cc as Iu,cd as Pu,ce as Ou,cf as Mu,cg as Du,ch as Bu,ci as ju,cj as Uu,I as Fu,ck as zu,cl as Hu,cm as qu,cn as Wu,co as Xu,cp as Ju,cq as Vu,cr as Yu,cs as Gu,ct as Zu,cu as Ku,cv as Qu,h as ed,z as td,cw as nd,cx as sd,cy as od,cz as rd,cA as id,cB as ad,cC as ld,cD as cd,cE as ud,cF as dd,cG as pd,J as fd,cH as md,cI as gd,cJ as hd,cK as bd,cL as yd,cM as xd,cN as Ed,cO as Td,cP as Cd,cQ as vd,cR as wd,cS as Sd,cT as Ld,cU as _d,cV as kd,cW as Ad,cX as Nd,cY as $d,cZ as Rd,c_ as Id,c$ as Pd,d0 as Od,d1 as Md,d2 as Dd,d3 as Bd,d4 as jd,d5 as Ud,d6 as Fd,d7 as zd,d8 as Hd,d9 as qd,da as Wd,db as Xd,dc as Jd,dd as Vd,de as Yd,df as Gd,dg as Zd,dh as Kd,di as Qd,dj as ep,dk as tp,dl as np,dm as sp,dn as op,dp as rp,dq as ip,dr as ap,ds as lp,dt as cp,du as up,dv as dp,dw as pp,dx as fp,dy as mp,dz as gp,dA as hp,dB as bp,dC as yp,dD as xp,dE as Ep,dF as Tp,dG as Cp,dH as vp,dI as wp,dJ as Sp,dK as Lp,dL as _p,dM as kp,dN as Ap,dO as Np,dP as $p,dQ as Rp,dR as Ip,dS as Pp,dT as Op,dU as Mp,dV as Dp,dW as Bp,dX as jp,dY as Up,dZ as Fp,d_ as zp,d$ as Hp,e0 as qp,e1 as Wp,e2 as Xp,e3 as Jp,e4 as Vp,e5 as Yp,e6 as Gp,e7 as Zp,e8 as Kp,e9 as Qp,ea as ef,eb as tf,ec as nf,ed as sf,ee as of,ef as rf,eg as af,eh as lf,ei as cf,ej as uf,ek as df,el as pf,em as ff,en as mf,eo as gf,ep as hf,eq as bf,er as yf,es as xf,et as Ef,eu as Tf,ev as Cf,ew as vf,ex as wf,ey as Sf,ez as Lf,eA as _f,eB as kf,eC as Af,eD as Nf,eE as $f,eF as Rf,eG as If,eH as Pf,eI as Of,eJ as Mf,eK as Df,eL as Bf,eM as jf,eN as Uf,eO as Ff,eP as zf,eQ as Hf,eR as qf,eS as Wf,eT as Xf,eU as Jf,eV as Vf,eW as Yf,eX as Gf,r as Zf,eY as Kf,eZ as Qf,e_ as em,e$ as tm,i as nm,f0 as sm,f1 as om,f2 as rm,f3 as im,f4 as am,f5 as lm,f6 as cm,f7 as um,f8 as dm,f9 as pm,fa as fm,fb as mm,fc as gm,fd as hm,fe as bm,ff as ym,fg as xm,fh as Em,fi as Tm,fj as Cm,fk as vm,fl as wm,fm as Sm,fn as Lm,fo as _m,fp as km,fq as Am,fr as Nm,fs as $m,ft as Rm,fu as Im,fv as Pm}from"./JupyterLexicalExtension-C55KdpCk.js";import{lQ as io,r as m,j as h,aW as ao,aQ as lo,B as co,a_ as ee,lR as U,lS as ae,lT as un,lU as fe,lV as z,lW as uo,lX as po,lY as fo,lZ as mo,l_ as j,aZ as ce,l$ as Ee,m0 as ut,m1 as go,m2 as ho,m3 as bo,m4 as yo,m5 as dn,m6 as xo,m7 as Eo,m8 as To,m9 as Co,ma as vo,mb as wo,aY as So,aa as M,cc as ve,mc as Lo,md as se,me as X,mf as ye,mg as _o,mh as ko,mi as Ao,cd as No,mj as le,cf as pn,mk as fn,ml as mn,bz as gn,mm as pe,mn as $o,mo as Ro,bE as ie,dl as Io,I as Le,f3 as hn,z as Po,y as Oo,ch as Mo,V as Do,mp as Bo,mq as jo,cg as ze,mr as Uo,ms as xt,e5 as Fo,fj as zo,T as Ho,mt as Et,mu as qo,mv as Wo,mw as Xo,mx as Tt,my as Jo,mz as Vo,aR as Yo,aS as Go,aM as Zo,aX as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Mm}from"./CollapsiblePlugin-y8sx_FL8.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-DyX4EYyN.js";import{u as er}from"./Output-D-7eUege.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Bm,u as jm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Fm}from"./YouTubePlugin-BPUrB3sh.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./url-C6fJII94.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./VideoIcon-C3wcjUxu.js";import"./LinkIcon-BtBG9K47.js";import"./Toolbar-BncUh2ly.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./PrismCss-DQMhvzcI.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-9wJFadG-.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./index-CqP3xLL5.js";import"./RestartIcon-DvpOf5Mf.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 pl{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,fl=dt.Consumer,ml=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function gl(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-LfEpCrfD.js";import{D as Yl,a as Gl,b as Zl,e as Kl,c as Ql,g as ec,i as tc,f as nc,l as sc,h as oc,j as rc,k as ic,m as ac,n as lc,r as cc,o as uc,p as dc,q as pc,s as fc,t as mc,v as gc,w as hc,x as bc,y as yc,z as xc,u as Tc}from"./LexicalToolRegistry-LfEpCrfD.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 Un,S as Xt,U as Fn,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 Ts,aO as Oe,aP as Ke,aQ as bt,aR as yt,aS as Es,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 Fe,b6 as Ms,b7 as Ds,b8 as Bs,b9 as js,ba as Us,bb as rn,bc as an,bd as ln,be as cn,j as Fs,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-DuD7IV6j.js";import{bi as Cc,bj as vc,bk as wc,bl as Sc,bm as Lc,bn as _c,bo as kc,bp as Ac,bq as Nc,br as $c,bs as Rc,bt as Ic,bu as Pc,bv as Oc,d as Mc,e as Dc,bw as Bc,bx as jc,B as Uc,by as Fc,A as zc,bz as Hc,bA as qc,bB as Wc,bC as Xc,bD as Jc,bE as Vc,bF as Yc,bG as Gc,bH as Zc,bI as Kc,bJ as Qc,bK as eu,bL as tu,bM as nu,bN as su,bO as ou,bP as ru,f as iu,bQ as au,g as lu,bR as cu,bS as uu,bT as du,bU as pu,bV as fu,q as mu,bW as gu,bX as hu,bY as bu,bZ as yu,b_ as xu,b$ as Tu,c0 as Eu,c1 as Cu,c2 as vu,c3 as wu,c4 as Su,c5 as Lu,c6 as _u,c7 as ku,c8 as Au,c9 as Nu,ca as $u,cb as Ru,cc as Iu,cd as Pu,ce as Ou,cf as Mu,cg as Du,ch as Bu,ci as ju,cj as Uu,I as Fu,ck as zu,cl as Hu,cm as qu,cn as Wu,co as Xu,cp as Ju,cq as Vu,cr as Yu,cs as Gu,ct as Zu,cu as Ku,cv as Qu,h as ed,z as td,cw as nd,cx as sd,cy as od,cz as rd,cA as id,cB as ad,cC as ld,cD as cd,cE as ud,cF as dd,cG as pd,J as fd,cH as md,cI as gd,cJ as hd,cK as bd,cL as yd,cM as xd,cN as Td,cO as Ed,cP as Cd,cQ as vd,cR as wd,cS as Sd,cT as Ld,cU as _d,cV as kd,cW as Ad,cX as Nd,cY as $d,cZ as Rd,c_ as Id,c$ as Pd,d0 as Od,d1 as Md,d2 as Dd,d3 as Bd,d4 as jd,d5 as Ud,d6 as Fd,d7 as zd,d8 as Hd,d9 as qd,da as Wd,db as Xd,dc as Jd,dd as Vd,de as Yd,df as Gd,dg as Zd,dh as Kd,di as Qd,dj as ep,dk as tp,dl as np,dm as sp,dn as op,dp as rp,dq as ip,dr as ap,ds as lp,dt as cp,du as up,dv as dp,dw as pp,dx as fp,dy as mp,dz as gp,dA as hp,dB as bp,dC as yp,dD as xp,dE as Tp,dF as Ep,dG as Cp,dH as vp,dI as wp,dJ as Sp,dK as Lp,dL as _p,dM as kp,dN as Ap,dO as Np,dP as $p,dQ as Rp,dR as Ip,dS as Pp,dT as Op,dU as Mp,dV as Dp,dW as Bp,dX as jp,dY as Up,dZ as Fp,d_ as zp,d$ as Hp,e0 as qp,e1 as Wp,e2 as Xp,e3 as Jp,e4 as Vp,e5 as Yp,e6 as Gp,e7 as Zp,e8 as Kp,e9 as Qp,ea as ef,eb as tf,ec as nf,ed as sf,ee as of,ef as rf,eg as af,eh as lf,ei as cf,ej as uf,ek as df,el as pf,em as ff,en as mf,eo as gf,ep as hf,eq as bf,er as yf,es as xf,et as Tf,eu as Ef,ev as Cf,ew as vf,ex as wf,ey as Sf,ez as Lf,eA as _f,eB as kf,eC as Af,eD as Nf,eE as $f,eF as Rf,eG as If,eH as Pf,eI as Of,eJ as Mf,eK as Df,eL as Bf,eM as jf,eN as Uf,eO as Ff,eP as zf,eQ as Hf,eR as qf,eS as Wf,eT as Xf,eU as Jf,eV as Vf,eW as Yf,eX as Gf,r as Zf,eY as Kf,eZ as Qf,e_ as em,e$ as tm,i as nm,f0 as sm,f1 as om,f2 as rm,f3 as im,f4 as am,f5 as lm,f6 as cm,f7 as um,f8 as dm,f9 as pm,fa as fm,fb as mm,fc as gm,fd as hm,fe as bm,ff as ym,fg as xm,fh as Tm,fi as Em,fj as Cm,fk as vm,fl as wm,fm as Sm,fn as Lm,fo as _m,fp as km,fq as Am,fr as Nm,fs as $m,ft as Rm,fu as Im,fv as Pm}from"./JupyterLexicalExtension-DuD7IV6j.js";import{lQ as io,r as m,j as h,aW as ao,aQ as lo,B as co,a_ as ee,lR as U,lS as ae,lT as un,lU as fe,lV as z,lW as uo,lX as po,lY as fo,lZ as mo,l_ as j,aZ as ce,l$ as Te,m0 as ut,m1 as go,m2 as ho,m3 as bo,m4 as yo,m5 as dn,m6 as xo,m7 as To,m8 as Eo,m9 as Co,ma as vo,mb as wo,aY as So,aa as M,c5 as ve,mc as Lo,md as se,me as X,mf as ye,mg as _o,mh as ko,mi as Ao,c6 as No,mj as le,c8 as pn,mk as fn,ml as mn,br as gn,mm as pe,mn as $o,mo as Ro,bw as ie,dl as Io,I as Le,f3 as hn,z as Po,y as Oo,ca as Mo,V as Do,mp as Bo,mq as jo,c9 as ze,mr as Uo,ms as xt,e5 as Fo,fj as zo,T as Ho,mt as Tt,mu as qo,mv as Wo,mw as Xo,mx as Et,my as Jo,mz as Vo,aR as Yo,aS as Go,aM as Zo,aX as Ko}from"../datalayer-app-main.js";import{CollapsiblePlugin as Mm}from"./CollapsiblePlugin-BPlfrDQU.js";import{u as Qo,N as Ct}from"./usePrimerThemeBridge-NsTRGuo7.js";import{u as er}from"./Output-D9cwH5rg.js";import{T as tr}from"./ThemeContext-D9ztCaU3.js";import{a as Bm,u as jm}from"./ThemeContext-D9ztCaU3.js";import{YouTubePlugin as Fm}from"./YouTubePlugin-BbjCzaT_.js";import"./NotebookSkeleton-CvO9WylK.js";import"./Avatar-Cv5OpUWu.js";import"./url-C6fJII94.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./VideoIcon-C3wcjUxu.js";import"./LinkIcon-BtBG9K47.js";import"./Toolbar-BAjGB6b-.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./ArrowUpIcon-y5enrVH9.js";import"./SortDescIcon-Qif6E10I.js";import"./PaintbrushIcon-CFBHU-3l.js";import"./PrismCss-DQMhvzcI.js";import"./index-JmqWOkdt.js";import"./hoverbox-CStlKQWE.js";import"./index-qhxI1VzX.js";import"./index-CEeyR3FZ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./dist-BrUAt6vF.js";import"./index-CKWSKbHe.js";import"./RestartIcon-DvpOf5Mf.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 pl{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,fl=dt.Consumer,ml=({children:e})=>{const[t,n]=m.useState();return h.jsx(dr,{value:{editor:t,setEditor:n},children:e})};function gl(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
|
-
`)}function
|
|
4
|
+
`)}function Tn(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 En(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 Tr(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(`
|
|
5
5
|
`).replace(/\u001b\[[0-9;]*m/g,""):null}function St(e){return Array.isArray(e)?e.join(""):e}function vn(e,t){const n=xr(t);return`\\begin{lstlisting}${n?`[language=${n}]`:""}
|
|
6
6
|
${e}
|
|
7
|
-
\\end{lstlisting}`}function
|
|
7
|
+
\\end{lstlisting}`}function Er(e){return`\\begin{verbatim}
|
|
8
8
|
${e}
|
|
9
|
-
\\end{verbatim}`}function
|
|
9
|
+
\\end{verbatim}`}function Ee(e,t){const n=[];let s=0,o=0,r="";for(let i=0;i<e.length;i++){const l=e[i];if(l==="\\"){if(e.startsWith("\\begin{",i)?o++:e.startsWith("\\end{",i)&&o--,e.startsWith(t,i)&&s===0&&o===0){n.push(r),r="",i+=t.length-1;continue}r+=l+(e[i+1]??""),i++;continue}if(l==="{"?s++:l==="}"&&s--,!t.startsWith("\\")&&e.startsWith(t,i)&&s===0&&o===0){n.push(r),r="",i+=t.length-1;continue}r+=l}return n.push(r),n}function mt(e){const t=[],n=[];for(const s of e)(ae(s)||it(s)||Q(s))&&z(s)?(t.length>0&&t.push(fe()),t.push(...s.getChildren())):n.push(s);return{inline:t,rest:n}}const Cr={type:"element",dependencies:[me],export:(e,t)=>Q(e)?`\\${(t.chapters?hr:gr)[e.getTag()]??"section"}{${t.exportChildren(e)}}`:null,import:{kind:"line",regExp:/^\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)\*?\s*(?:\[[^\]]*\])?\s*\{/,replace:(e,t,{importInline:n,chapters:s})=>{const o=W(t,e[0].length-1),i=Ce((s?yr:br)[e[1]]??"h1");return i.append(...n(o?o.value:"")),[i]}}},vr={type:"element",dependencies:[Wt],export:(e,{exportChildren:t})=>it(e)?`\\begin{quote}
|
|
10
10
|
${t(e)}
|
|
11
11
|
\\end{quote}`:null,import:{kind:"environment",names:["quote","quotation","abstract","verse"],replace:(e,{importBlocks:t})=>{const{inline:n,rest:s}=mt(t(e.body)),o=Kt();return o.append(...n),[o,...s]}}},wn="$\\boxtimes$",Sn="$\\square$";function Ln(e,t,n){const s=" ".repeat(n),o=e.getListType()==="number"?"enumerate":"itemize",r=[`${s}\\begin{${o}}`];for(const i of e.getChildren()){if(!cs(i))continue;const l=i.getFirstChild();if(i.getChildrenSize()===1&&xe(l)){r.push(Ln(l,t,n+1));continue}let d="";e.getListType()==="check"&&(d=`[${i.getChecked()?wn:Sn}]`),r.push(`${s} \\item${d} ${t.exportChildren(i)}`.trimEnd())}return r.push(`${s}\\end{${o}}`),r.join(`
|
|
12
|
-
`)}function wr(e,t,n,s=!1){const o=at(t),r=
|
|
12
|
+
`)}function wr(e,t,n,s=!1){const o=at(t),r=Ee(e,"\\item").slice(1);for(const i of r){let l=i,d,a=null;const c=/^\s*\[/.test(l)?_n(l):null;if(c){const C=c.value.trim();C===wn||/checkmark|boxtimes|CheckedBox/.test(C)?d=!0:C===Sn||/square|Box\b/.test(C)?d=!1:(s||C)&&(a=C),l=l.slice(c.end)}const u=n.importBlocks(l),{inline:f,rest:y}=mt(u),E=Re(t==="check"||d!==void 0?d??!1:void 0);a&&E.append(...n.importInline(a).map(de),U(" ")),E.append(...f),o.append(E);for(const C of y)if(xe(C)){const L=Re();L.append(C),o.append(L)}else z(C)&&E.append(fe(),...C.getChildren())}return o}function de(e){return j(e)&&!e.hasFormat("bold")&&e.toggleFormat("bold"),e}function et(e){return j(e)&&!e.hasFormat("italic")&&e.toggleFormat("italic"),e}function _n(e){const t=e.indexOf("[");let n=0;for(let s=t;s<e.length;s++)if(e[s]==="[")n++;else if(e[s]==="]"&&(n--,n===0))return{value:e.slice(t+1,s),end:s+1};return null}const Sr={type:"element",dependencies:[ot,rt],export:(e,t)=>xe(e)?Ln(e,t,0):null,import:{kind:"environment",names:["itemize","enumerate","description"],replace:(e,t)=>{const s=/\\item\s*\[\s*\$\\(boxtimes|square)\$\s*\]/.test(e.body)?"check":e.name==="enumerate"?"number":"bullet";return[wr(e.body,s,t,e.name==="description")]}}},Lr={type:"element",dependencies:[Xt,Fn],export:e=>Kn(e)?vn(e.getTextContent(),e.getLanguage()):null,import:{kind:"environment",names:["verbatim","Verbatim","alltt"],replace:e=>{const t=lt();return t.append(U(ft(e.body))),[t]}}},_r={type:"element",dependencies:[jn],export:e=>Be(e)?vn(e.getTextContent(),e.getLanguage()??"python"):null,import:{kind:"environment",names:["lstlisting","minted","pythoncode","code"],replace:e=>{const t=e.name==="minted"?e.argument:Tn(e.options,"language"),n=Zn(t?t.toLowerCase():"python");return n.append(U(ft(e.body))),[n]}}},kr={type:"element",dependencies:[Un],export:e=>{if(!Ve(e))return null;const t=e.getOutputs().map(Tr).filter(n=>n!==null&&n.trim()!=="");return t.length===0?e.getOutputs().length>0?"% [output omitted]":"":Er(t.join(`
|
|
13
13
|
`).replace(/\n$/,""))}},Ar={type:"element",dependencies:[qn],export:e=>un(e)?"\\noindent\\hrulefill":null,import:{kind:"line",regExp:/^(\\noindent\s*)?(\\hrulefill|\\hrule|\\rule\{[^}]*\}\{[^}]*\}|\\hline)$/,replace:()=>[ns()]}};function Nr(e,t){const n=e.getChildren().filter(us),s=i=>Math.max(1,i.getColSpan()),o=Math.max(1,...n.map(i=>i.getChildren().filter(Ze).reduce((l,d)=>l+s(d),0))),r=[`\\begin{tabular}{|${"l|".repeat(o)}}`,"\\hline"];return n.forEach((i,l)=>{const d=i.getChildren().filter(Ze),a=d.length>0&&d.every(u=>u.hasHeaderState(Ge.ROW)),c=d.map(u=>{const f=u.getChildren().map(y=>z(y)?t.exportChildren(y):t.exportBlock(y)).filter(Boolean).join(" ");return s(u)>1?`\\multicolumn{${s(u)}}{l}{${f}}`:f});r.push(`${c.join(" & ")} \\\\`),(a||l===n.length-1)&&r.push("\\hline")}),r.push("\\end{tabular}"),r.join(`
|
|
14
|
-
`)}function $r(e,t){const n=e.body.replace(/\\(toprule|midrule|bottomrule)/g,"\\hline"),s=
|
|
14
|
+
`)}function $r(e,t){const n=e.body.replace(/\\(toprule|midrule|bottomrule)/g,"\\hline"),s=Ee(n,"\\\\").map(i=>i.replace(/^\s*\[[^\]]*\]/,"")).map(i=>({hlineBefore:/^\s*\\hline/.test(i),text:i.replace(/\\hline/g,"").trim()})).filter(i=>i.text!=="");if(s.length===0)return[];const o=Qn(),r=s.length>1&&s[1].hlineBefore;return s.forEach((i,l)=>{const d=es();for(const a of Ee(i.text,"&")){let c=a.trim(),u=1;const f=/^\\multicolumn\s*\{/.exec(c);if(f){const C=oe(c,f[0].length-1,3);u=Math.max(1,Number(C.values[0])||1),c=C.values[2]??""}const y=ts(l===0&&r?Ge.ROW:Ge.NO_STATUS,u),E=ee();E.append(...t.importInline(c)),y.append(E),d.append(y)}o.append(d)}),[o]}const Rr={type:"element",dependencies:[Jt,zn,Hn],export:(e,t)=>Ye(e)?Nr(e,t):null,import:{kind:"environment",names:["tabular","tabularx","longtable","tabulary"],replace:$r}},Ir={type:"element",dependencies:[],export:()=>null,import:{kind:"environment",names:["table","table*","center","flushleft","flushright","titlepage"],replace:(e,{importBlocks:t})=>t(e.body.replace(/\\caption\{/g,"\\textit{").replace(/\\centering/g,""))}},Pr={type:"element",dependencies:[Vt],export:e=>{if(!ae(e)||e.getChildrenSize()!==1)return null;const t=e.getFirstChild();if(!en(t))return null;const n=t.getAltText()?`
|
|
15
15
|
\\caption{${K(t.getAltText())}}`:"";return`\\begin{figure}[h]
|
|
16
16
|
\\centering
|
|
17
17
|
\\includegraphics[width=\\linewidth]{${t.getSrc()}}${n}
|
|
@@ -23,15 +23,15 @@ ${t.getEquation()}
|
|
|
23
23
|
${s.join(`
|
|
24
24
|
\\columnbreak
|
|
25
25
|
`)}
|
|
26
|
-
\\end{multicols}`}return Pe(e)?t.exportBlocks(e.getChildren()):null},import:{kind:"environment",names:["multicols","multicols*","columns","column","minipage","paracol"],replace:(e,t)=>{if(e.name.startsWith("multicols")||e.name==="paracol"){const s=Math.max(1,Number(e.argument)||2),o=
|
|
26
|
+
\\end{multicols}`}return Pe(e)?t.exportBlocks(e.getChildren()):null},import:{kind:"environment",names:["multicols","multicols*","columns","column","minipage","paracol"],replace:(e,t)=>{if(e.name.startsWith("multicols")||e.name==="paracol"){const s=Math.max(1,Number(e.argument)||2),o=Ee(e.body,"\\columnbreak"),r=o.length>1?o.map(i=>t.importBlocks(i)):kn(t.importBlocks(e.body),s);return[Me(r.map($e),r.map(()=>1))]}if(e.name==="columns"){if(/\\column\s*\{/.test(e.body)&&!/\\begin\{column\}/.test(e.body)){const s=e.body.split(/\\column\s*\{([^{}]*)\}/).slice(1),o=[],r=[];for(let i=0;i+1<s.length;i+=2)o.push($e(t.importBlocks(s[i+1]))),r.push(Lt(s[i]));return o.length>0?[Me(o,r)]:[]}return t.importBlocks(e.body)}const n=$e(t.importBlocks(e.body));return t.columnWeights.set(n,Lt(e.argument)),[n]}}},ei=["theorem","lemma","proposition","corollary","definition","example","remark","claim","exercise","solution","note","conjecture","proof"],ti={type:"element",dependencies:[Wt],export:()=>null,import:{kind:"environment",names:ei.flatMap(e=>[e,`${e}*`]),replace:(e,t)=>{const n=e.name.replace(/\*$/,""),{inline:s,rest:o}=mt(t.importBlocks(e.body)),r=Kt(),i=U(n==="proof"?"Proof.":`${En(n)}${e.options?` (${e.options})`:""}.`);return i.toggleFormat(n==="proof"?"italic":"bold"),r.append(i,U(" "),...s),n==="proof"&&r.append(U(" ∎")),[r,...o]}}},ni={type:"element",dependencies:[ot,rt,me],export:()=>null,import:{kind:"environment",names:["thebibliography"],replace:(e,t)=>{const n=at("number");for(const o of Ee(e.body,"\\bibitem").slice(1)){let r=o;const i=/^\s*\[/.test(r)?_n(r):null;i&&(r=r.slice(i.end));const l=W(r,0);l&&(r=r.slice(l.end));const d=Re();d.append(...t.importInline(r.trim())),n.append(d)}const s=Ce("h2");return s.append(U("References")),[s,n]}}},si={type:"element",dependencies:[me],export:()=>null,import:{kind:"environment",names:["frame"],replace:(e,t)=>{const n=[];if(e.argument&&e.argument.trim()){const s=Ce("h2");s.append(...t.importInline(e.argument)),n.push(s)}return n.push(...t.importBlocks(e.body)),n}}},oi={type:"element",dependencies:[me],export:()=>null,import:{kind:"line",regExp:/^\\(frametitle|framesubtitle)\s*\{/,replace:(e,t,n)=>{const s=W(t,e[0].length-1),o=Ce(e[1]==="frametitle"?"h2":"h3");return o.append(...n.importInline(s?s.value:"")),[o]}}},ri={type:"element",dependencies:[Gt],export:()=>null,import:{kind:"environment",names:["block","alertblock","exampleblock","tcolorbox","mdframed","infobox"],replace:(e,t)=>{const n=e.argument&&e.argument.trim()||Tn(e.options,"title")||En(e.name.replace(/block$/,"")||"note"),s=rs(!0),o=is();o.append(...t.importInline(n));const r=as(),i=t.importBlocks(e.body);return r.append(...i.length>0?i:[ee()]),s.append(o,r),[s]}}},ii={type:"element",dependencies:[],export:()=>null,import:{kind:"environment",names:["letter"],replace:(e,t)=>{const n=[];return e.argument&&e.argument.trim()&&n.push(G(t.importInline(e.argument))),n.push(...t.importBlocks(e.body)),n}}},ai={type:"element",dependencies:[],export:()=>null,import:{kind:"line",regExp:/^\\(opening|closing|ps|encl|cc)\s*\{/,replace:(e,t,n)=>{const s=W(t,e[0].length-1),o=s?s.value:"",r={cc:"cc: ",encl:"Enclosures: ",ps:"P.S. "},i=[];if(r[e[1]]){const l=U(r[e[1]]);l.toggleFormat("bold"),i.push(G([l,...n.importInline(o)]))}else i.push(G(n.importInline(o)));return e[1]==="closing"&&n.document.signature&&i.push(G(n.importInline(n.document.signature).map(de))),i}}},li={type:"element",dependencies:[ot,rt],export:()=>null,import:{kind:"line",regExp:/^\\(cventry|cvitem|cvitemwithcomment|cvlistitem|cvlistdoubleitem|cvdoubleitem)\s*\{/,replace:(e,t,n)=>{const s=e[0].length-1,o=r=>n.importInline(r);switch(e[1]){case"cventry":{const[r,i,l,d,a,c]=oe(t,s,6).values,u=[...o(i??"").map(de)],f=[l,d].filter(Boolean).join(", ");return f&&u.push(U(" — "),...o(f)),r&&u.push(U(" ("),...o(r),U(")")),a&&u.push(U(", "),...o(a).map(et)),c&&u.push(fe(),...o(c)),[G(u)]}case"cvitem":case"cvitemwithcomment":{const[r,i,l]=oe(t,s,3).values,d=[];return r&&d.push(...o(`${r}: `).map(de)),d.push(...o(i??"")),l&&d.push(U(" — "),...o(l).map(et)),[G(d)]}case"cvdoubleitem":{const[r,i,l,d]=oe(t,s,4).values,a=[];return r&&a.push(...o(`${r}: `).map(de)),a.push(...o(i??"")),l&&a.push(U(" · "),...o(`${l}: `).map(de)),a.push(...o(d??"")),[G(a)]}default:{const r=at("bullet");for(const i of oe(t,s,2).values){const l=Re();l.append(...o(i)),r.append(l)}return[r]}}}}},ci={type:"element",dependencies:[Xt],export:()=>null,import:{kind:"environment",names:["algorithm","algorithm*","algorithmic","algorithm2e","tikzpicture","circuitikz"],replace:e=>{if(e.name==="tikzpicture"||e.name==="circuitikz"){const n=U("[TikZ picture]");return n.toggleFormat("italic"),[G([n])]}const t=lt();return t.append(U(ft(e.body).trim())),[t]}}},ui=[Zr,Kr,Cr,oi,vr,ti,Sr,ni,_r,kr,Lr,ci,Rr,Ir,Pr,Or,Ar,Mr,Qr,si,ri,ii,ai,li,Dr],di=[Br,jr,Ur,Fr,zr,Hr,qr,Wr],pi=[Xr,Jr,Vr],ge=[...ui,...di,...pi];function An(e){return{element:e.filter(t=>t.type==="element"),textFormat:e.filter(t=>t.type==="text-format"),textMatch:e.filter(t=>t.type==="text-match")}}const fi=["\\usepackage[utf8]{inputenc}","\\usepackage[T1]{fontenc}","\\usepackage{amsmath}","\\usepackage{amssymb}","\\usepackage{graphicx}","\\usepackage{hyperref}","\\usepackage{listings}","\\usepackage{multicol}","\\usepackage[normalem]{ulem}","\\usepackage{soul}"],_t="january|february|march|april|may|june|july|august|september|october|november|december",mi=new RegExp(`^(?:\\d{1,2}(?:st|nd|rd|th)?\\s+(?:${_t})\\s+\\d{4}|(?:${_t})\\s+(?:\\d{1,2},?\\s+)?\\d{4}|\\d{4}-\\d{2}-\\d{2}|\\d{1,2}/\\d{1,2}/\\d{2,4})$`,"i");function gi(e){return!ae(e)||e.getChildrenSize()===0?!1:e.getChildren().every(t=>j(t)&&t.hasFormat("italic"))}function hi(e){return ae(e)&&e.getChildrenSize()>0&&e.getChildren().every(t=>j(t))}function bi(e,t,n){const s={title:t.title?K(t.title):null,subtitle:null,author:t.author?K(t.author):null,institute:null,date:t.date?K(t.date):null,consumed:0},o=e[0];if(!(Q(o)&&o.getTag()==="h1"&&(t.title===void 0||o.getTextContent()===t.title)))return s;s.title=n(o);let i=1;const l=e[i];if(Q(l)&&l.getTag()==="h3"&&(s.subtitle=n(l),i++),gi(e[i])){t.author||(s.author=K(e[i].getTextContent())),i++;const d=(t.documentClass??"").toLowerCase()==="beamer";for(let a=0;a<2&&hi(e[i]);a++){const c=e[i].getTextContent().trim();if(mi.test(c)){t.date||(s.date=K(c)),i++;break}if(d&&s.institute===null){s.institute=K(c),i++;continue}break}}return s.consumed=i,s}function yi(e=ge,t={}){const n=An(e),s=a=>a.map(o).filter(c=>c!==null&&c!=="").join(`
|
|
27
27
|
|
|
28
|
-
`),o=a=>{for(const c of n.element){const u=c.export(a,d);if(u!==null)return u}return z(a)?l(a):
|
|
29
|
-
`):go(u)?c.push("\\quad{}"):j(u)?c.push(i(u)):z(u)?c.push(r(u)??o(u)??""):
|
|
30
|
-
`)}function hl(e=ge,t={}){return yi(e,t)()}const
|
|
31
|
-
`).trim();if(v=[],!A)return;const I=ee();I.append(...g(A)),I.getChildrenSize()>0&&
|
|
28
|
+
`),o=a=>{for(const c of n.element){const u=c.export(a,d);if(u!==null)return u}return z(a)?l(a):Te(a)?r(a)??K(a.getTextContent()):null},r=a=>{for(const c of n.textMatch){const u=c.export(a,d);if(u!==null)return u}return null},i=a=>{let c=K(a.getTextContent());if(c==="")return"";for(const u of n.textFormat)a.hasFormat(u.format)&&(c=`\\${u.command}{${c}}`);return c},l=a=>{const c=[];for(const u of a.getChildren())ut(u)?c.push(`\\\\
|
|
29
|
+
`):go(u)?c.push("\\quad{}"):j(u)?c.push(i(u)):z(u)?c.push(r(u)??o(u)??""):Te(u)&&c.push(r(u)??K(u.getTextContent()));return c.join("")},d={exportBlock:o,exportBlocks:s,exportChildren:l,chapters:Cn(t.documentClass)};return()=>{const a=ce().getChildren();if(!t.document)return s(a);const c=bi(a,t,l);return xi(s(a.slice(c.consumed)),t,c)}}function xi(e,t,n){const s=t.documentClass??"article",r=[`\\documentclass${t.classOptions?.length?`[${t.classOptions.join(",")}]`:""}{${s}}`,...fi],{title:i,subtitle:l,author:d,institute:a,date:c}=n,u=s.toLowerCase();if(u==="moderncv"&&i){const f=i.lastIndexOf(" ");r.push(f===-1?`\\name{${i}}{}`:`\\name{${i.slice(0,f)}}{${i.slice(f+1)}}`),l&&r.push(`\\title{${l}}`)}else i&&(l&&u==="beamer"?r.push(`\\title{${i}}`,`\\subtitle{${l}}`):l?r.push(`\\title{${i}\\\\ \\large ${l}}`):r.push(`\\title{${i}}`));return i&&d&&r.push(`\\author{${d}}`),i&&a&&r.push(`\\institute{${a}}`),i&&c&&r.push(`\\date{${c}}`),r.push("","\\begin{document}"),i&&r.push(u==="moderncv"?"\\makecvtitle":"\\maketitle"),r.push("",e,"","\\end{document}",""),r.join(`
|
|
30
|
+
`)}function hl(e=ge,t={}){return yi(e,t)()}const Ti={bold:Co,italic:Eo,underline:To,strikethrough:xo,code:dn,subscript:yo,superscript:bo,highlight:ho,lowercase:0,uppercase:0,capitalize:0},Ei=/^\\(tableofcontents|listoffigures|listoftables|newpage|clearpage|pagebreak|bigskip|medskip|smallskip|centering|raggedright|raggedleft|noindent|vfill|hfill|appendix|frontmatter|mainmatter|backmatter|twocolumn|onecolumn|sloppy|linenumbers|columnbreak|newcolumn|small|footnotesize|scriptsize|tiny|normalsize|large|Large|LARGE|huge|Huge|vspace\*?\{[^}]*\}|label\{[^}]*\}|setlength\{[^}]*\}\{[^}]*\}|setcounter\{[^}]*\}\{[^}]*\}|bibliographystyle\{[^}]*\}|bibliography\{[^}]*\}|pagestyle\{[^}]*\}|thispagestyle\{[^}]*\}|selectlanguage\{[^}]*\}|pagenumbering\{[^}]*\})$/,Ci=new Set(["verbatim","Verbatim","lstlisting","minted","alltt","pythoncode","code","algorithm","algorithmic","algorithm2e","tikzpicture","circuitikz"]),vi={tabular:1,tabularx:2,tabulary:2,longtable:1,minted:1,wrapfigure:2,minipage:1,multicols:1,column:1,frame:1,block:1,alertblock:1,exampleblock:1,letter:1,thebibliography:1},wi={textcolor:2,colorbox:2,parbox:2,raisebox:2,scalebox:2,rotatebox:2,fcolorbox:3,resizebox:3};function Si(e=new Date){return e.toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"})}function Li(){return{address:null,author:null,classOptions:[],date:null,documentClass:null,email:null,homepage:null,institute:null,macros:[],name:null,phone:null,signature:null,subtitle:null,title:null}}function te(e,t){const s=new RegExp(`\\\\${t}(?![A-Za-z])`).exec(e);if(!s)return null;let o=s.index+s[0].length;const r=ne(e,o);return r&&(o=r.end),W(e,o)?.value??null}function kt(e,t,n){const o=new RegExp(`\\\\${t}(?![A-Za-z])`).exec(e);return o?oe(e,o.index+o[0].length,n).values:[]}function _i(e){const t=[],n=/\\(?:re)?newcommand\*?|\\providecommand\*?|\\DeclareRobustCommand\*?|\\def(?=\\)/g;let s;for(;(s=n.exec(e))!==null;){let o=s.index+s[0].length,r=null;const i=W(e,o);if(i&&/^\\[A-Za-z]+$/.test(i.value.trim()))r=i.value.trim().slice(1),o=i.end;else{const u=/^\s*\\([A-Za-z]+)/.exec(e.slice(o));u&&(r=u[1],o+=u[0].length)}if(!r)continue;let l=0,d=null;const a=ne(e,o);if(a&&/^\d+$/.test(a.value.trim())){l=Number(a.value.trim()),o=a.end;const u=ne(e,o);u&&(d=u.value,o=u.end)}const c=W(e,o);c&&(t.push({arity:l,body:c.value,defaultArg:d,name:r}),n.lastIndex=c.end)}return t}function ki(e,t){if(t.length===0)return e;const n=[...t].sort((o,r)=>r.name.length-o.name.length);let s=e;for(let o=0;o<10;o++){let r=!1;for(const i of n){const l=new RegExp(`\\\\${i.name}(?![A-Za-z])`,"g");let d="",a=0,c;for(;(c=l.exec(s))!==null;){let u=c.index+c[0].length;const f=[];if(i.defaultArg!==null){const g=ne(s,u);f.push(g?g.value:i.defaultArg),g&&(u=g.end)}const y=i.arity-f.length,E=oe(s,u,y);f.push(...E.values),u=E.end;let C=i.body;f.forEach((g,S)=>{C=C.split(`#${S+1}`).join(g)});const L=(/^\s/.test(s.slice(u)),"");d+=s.slice(a,c.index)+C+L,a=u,l.lastIndex=u,r=!0}s=d+s.slice(a)}if(!r)break}return s}function Ai(e){const t=Li(),n=/\\documentclass(?:\[([^[\]\\]*)\])?\{([^{}\\]*)\}/.exec(e);n&&(t.documentClass=n[2].trim(),t.classOptions=(n[1]??"").split(",").map(i=>i.trim()).filter(Boolean));const s=xn(e);t.title=te(s,"title"),t.subtitle=te(s,"subtitle"),t.author=te(s,"author"),t.date=te(s,"date"),t.institute=te(s,"institute"),t.signature=te(s,"signature"),t.email=te(s,"email"),t.homepage=te(s,"homepage"),t.phone=te(s,"phone");const o=kt(s,"address",3);t.address=o.length>0?o.join(", "):null;const r=kt(s,"name",2);return t.name=r.length>0?r.join(" ").trim():null,t.macros=_i(s),t}function Nn(e=ge){const t=An(e),n=new Map,s=[];for(const d of t.element){const a=d.import;if(a)if(a.kind==="environment")for(const c of a.names)n.set(c,a);else s.push(a)}const o=new Map;for(const d of t.textFormat){const a=Ti[d.format];o.set(d.command,a);for(const c of d.aliases??[])o.set(c,a)}const r=new Map;for(const d of t.textMatch)for(const a of d.importCommand?.names??[])r.set(a,d.importCommand);const i=t.textMatch.find(d=>d.importMath),l=(d,a)=>i?.importMath?i.importMath(d,a):U(a?`\\[${d}\\]`:`$${d}$`);return d=>{const{preamble:a,body:c}=fr(d),u=Ai(a),f=new WeakMap,y=p=>{const T=[],v=/(?<!\\)\\begin\{([A-Za-z*]+)\}|(?<!\\)\\\[|(?<!\\)\$\$/g;let x=0;for(;x<p.length;){v.lastIndex=x;const k=v.exec(p),A=k?k.index:p.length;if(T.push(...L(p.slice(x,A))),!k)break;if(k[1]){const I=C(p,k.index,k[1]);if(!I){T.push(...L(p.slice(k.index)));break}const b=n.get(k[1]);T.push(...b?b.replace(I.block,R):y(I.block.body)),x=I.end}else{const I=k[0],b=I==="\\["?"\\]":"$$",N=k.index+I.length,_=p.indexOf(b,N),B=_===-1?p.slice(N):p.slice(N,_),O=ee();O.append(l(B.trim(),!0)),T.push(O),x=_===-1?p.length:_+b.length}}return E(T)},E=p=>{const T=[];let v=0;for(;v<p.length;){const x=p[v];if(Pe(x)){const k=[x];for(;v+1<p.length&&Pe(p[v+1]);)k.push(p[++v]);k.length===1?T.push(...x.getChildren()):T.push(Me(k,k.map(A=>f.get(A)??1)))}else xe(x)&&T.length>0&&xe(T[T.length-1])&&T[T.length-1].getListType()===x.getListType()?T[T.length-1].append(...x.getChildren()):T.push(x);v++}return T},C=(p,T,v)=>{let x=T+`\\begin{${v}}`.length,k=null;const A=ne(p,x);A&&(k=A.value,x=A.end);let I=null;for(let O=0;O<(vi[v]??0);O++){const w=W(p,x);if(!w)break;I=w.value,x=w.end}const b=`\\begin{${v}}`,N=`\\end{${v}}`;let _=1,B=x;for(;_>0;){const O=p.indexOf(N,B);if(O===-1)return null;const w=Ci.has(v)?-1:p.indexOf(b,B);if(w!==-1&&w<O)_++,B=w+b.length;else{if(_--,_===0)return{block:{argument:I,body:p.slice(x,O),name:v,options:k},end:O+N.length};B=O+N.length}}return null},L=p=>{const T=[];let v=[];const x=()=>{const A=v.join(`
|
|
31
|
+
`).trim();if(v=[],!A)return;const I=ee();I.append(...g(A)),I.getChildrenSize()>0&&T.push(I)},k=xn(p).replace(/\\par(?![A-Za-z])/g,`
|
|
32
32
|
|
|
33
33
|
`);for(const A of k.split(`
|
|
34
|
-
`)){const I=A.trim();if(I===""){x();continue}if(
|
|
34
|
+
`)){const I=A.trim();if(I===""){x();continue}if(Ei.test(I))continue;const b=s.find(N=>N.regExp.test(I));if(b){x();const N=b.regExp.exec(I);T.push(...b.replace(N,I,R));continue}v.push(A)}return x(),T},g=p=>S(p.replace(/[ \t]*\n[ \t]*/g," ").replace(/[ \t]{2,}/g," "),0),S=(p,T)=>{const v=[];let x="";const k=()=>{if(x!==""){const N=U(x);T&&N.setFormat(T),v.push(N),x=""}},A=N=>{k(),v.push(...N)},I=N=>{let _=N;for(;p[_]===" ";)_++;return _};let b=0;for(;b<p.length;){const N=p[b];if(N==="\\"){const _=p[b+1];if(_==="\\"){A([fe()]),b+=2;const P=ne(p,b);P&&p[b]==="["&&(b=P.end),b=I(b);continue}if(_==="("||_==="["){const P=_==="("?"\\)":"\\]",D=p.indexOf(P,b+2),q=D===-1?p.slice(b+2):p.slice(b+2,D);A([l(q.trim(),_==="[")]),b=D===-1?p.length:D+2;continue}if(_!==void 0&&"%$&#_{}".includes(_)){x+=_,b+=2;continue}if(_==="~"||_==="^"){x+=_,b+=2,p.startsWith("{}",b)&&(b+=2);continue}if(_===" "||_===","||_===";"||_==="!"||_==="/"){x+=_==="/"?"":" ",b+=2;continue}const B=/^\\([A-Za-z]+)\*?/.exec(p.slice(b));if(!B){x+="\\",b++;continue}const O=B[1];let w=b+B[0].length;const H=o.get(O);if(H!==void 0){const P=W(p,w);P?(A(S(P.value,T|H)),b=P.end):(A(S(p.slice(w),T|H)),b=p.length);continue}const F=r.get(O);if(F){let P=null;const D=ne(p,w);D&&(P=D.value,w=D.end);const q=oe(p,w,2);w=q.end;const Z=F.replace(q.values,P,R);A(Z?[Z]:[]),b=w;continue}const ue=wi[O];if(ue){const P=ne(p,w);P&&(w=P.end);const D=oe(p,w,ue),q=D.values[D.values.length-1];q!==void 0&&A(S(q,T)),b=D.end;continue}switch(O){case"textbackslash":x+="\\",w=_e(p,w);break;case"newline":case"linebreak":A([fe()]),w=I(w);break;case"ldots":case"dots":case"textellipsis":x+="…",w=_e(p,w);break;case"LaTeX":case"TeX":x+=O,w=_e(p,w);break;case"today":x+=Si(),w=_e(p,w);break;case"and":x=x.replace(/\s+$/,"")+", ";break;case"quad":case"qquad":case"enspace":case"hfill":case"vfill":case"dotfill":case"hrulefill":x+=" ";break;case"verb":{const P=p[w],D=P?p.indexOf(P,w+1):-1;if(D!==-1){k();const q=U(p.slice(w+1,D));q.setFormat(T|dn),v.push(q),w=D+1}break}case"footnote":{const P=W(p,w);P&&(x+=" (",A(S(P.value,T)),x+=")",w=P.end);break}case"cite":case"citep":case"citet":case"textcite":case"parencite":case"autocite":{const P=ne(p,w);P&&(w=P.end);const D=W(p,w);D&&(x+=`[${D.value.split(",").map(q=>q.trim()).join(", ")}]`,w=D.end);break}case"label":case"ref":case"eqref":case"pageref":case"index":case"thanks":case"hspace":case"vspace":case"hyphenation":case"phantom":{const P=W(p,w);P&&(w=P.end);break}default:{const P=W(p,w);P&&(A(S(P.value,T)),w=P.end)}}b=w;continue}if(N==="$"){const _=Ni(p,"$",b+1),B=p.slice(b+1,_===-1?void 0:_);A([l(B.trim(),!1)]),b=_===-1?p.length:_+1;continue}if(N==="{"){const _=pt(p,b);if(_===-1){b++;continue}A(S(p.slice(b+1,_),T)),b=_+1;continue}if(N==="}"){b++;continue}if(N==="~"){x+=" ",b++;continue}if(p.startsWith("---",b)){x+="—",b+=3;continue}if(p.startsWith("--",b)){x+="–",b+=2;continue}if(p.startsWith("``",b)){x+="“",b+=2;continue}if(p.startsWith("''",b)){x+="”",b+=2;continue}if(N==="`"){x+="‘",b++;continue}x+=N,b++}return k(),v},R={columnWeights:f,document:u,importBlocks:y,importInline:g,chapters:Cn(u.documentClass,c)};let $=y(ki(c,u.macros));if(u.documentClass==="letter"&&u.address){const p=ee();p.append(...g(u.address.split(", ").join("\\\\ "))),$=[p,...$]}if(u.classOptions.includes("twocolumn")){let p=Q($[0])?1:0;for(;p<$.length&&(ae($[p])||it($[p]));)p++;const T=$.slice(p);T.length>=2&&($=[...$.slice(0,p),Me(kn(T,2).map($e),[1,1])])}return{document:u,nodes:$}}}function _e(e,t){return e.startsWith("{}",t)?t+2:t}function Ni(e,t,n){for(let s=n;s<e.length;s++){if(e[s]==="\\"){s++;continue}if(e[s]===t)return s}return-1}function $i(e=ge){const t=Nn(e);return n=>{ce().append(...t(n).nodes)}}function bl(e,t=ge){return Nn(t)(e)}function yl(e,t=ge){$i(t)(e)}const Ri="``",xl=["Journal articles","Bibliographies","Books","Calendars","CVs and résumés","Formal letters","Assignments","Newsletters","Posters","Presentations","Theses"],Ii=[{id:"journal-article",category:"Journal articles",name:"IEEE Transactions article (IEEEtran)",description:"Two-column article: abstract, equations, a table with a spanning cell, a figure, citations and a bibliography.",source:String.raw`\documentclass[journal,twocolumn]{IEEEtran}
|
|
35
35
|
\usepackage{amsmath}
|
|
36
36
|
\usepackage{graphicx}
|
|
37
37
|
\usepackage{booktabs}
|
|
@@ -527,31 +527,31 @@ The benchmark streams and their generators.
|
|
|
527
527
|
\bibitem{knuth84} D. E. Knuth, \emph{The \TeX{}book}. Addison-Wesley, 1984.
|
|
528
528
|
\end{thebibliography}
|
|
529
529
|
\end{document}
|
|
530
|
-
`}];function
|
|
531
|
-
`):j(r)?s.push(At(r,r.getTextContent(),t)):z(r)&&s.push(De(r,t,n))}return s.join("")}function At(e,t,n){const s=t.trim();let o=s;const r=new Set;for(const i of n){const l=i.format[0],d=i.tag;if(qe(e,l)&&!r.has(l)){r.add(l);const a=Nt(e,!0);qe(a,l)||(o=d+o);const c=Nt(e,!1);qe(c,l)||(o+=d)}}return t.replace(s,o)}function Nt(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const s=e.getParentOrThrow();s.isInline()&&(n=t?s.getPreviousSibling():s.getNextSibling())}for(;n;){if(z(n)){if(!n.isInline())break;const s=t?n.getLastDescendant():n.getFirstDescendant();if(j(s))return s;n=t?n.getPreviousSibling():n.getNextSibling()}if(j(n))return n;if(!z(n))return null}return null}function qe(e,t){return j(e)&&e.hasFormat(t)}const Oi={kernelspec:{display_name:"Python 3 (ipykernel)",language:"python",name:"python3"},language_info:{codemirror_mode:{name:"ipython",version:3},file_extension:".py",mimetype:"text/x-python",name:"python",nbconvert_exporter:"python",pygments_lexer:"ipython3",version:"3"}},
|
|
530
|
+
`}];function Tl(e){return Ii.find(t=>t.id===e)}function Pi(e,t,n,s){for(const o of t){const r=o.export(e,i=>De(i,n,s));if(r!=null)return r}return z(e)?De(e,n,s):null}function De(e,t,n){const s=[],o=e.getChildren();e:for(const r of o){for(const i of n){const l=i.export(r,d=>De(d,t,n),(d,a)=>At(d,a,t));if(l!=null){s.push(l);continue e}}ut(r)?s.push(`
|
|
531
|
+
`):j(r)?s.push(At(r,r.getTextContent(),t)):z(r)&&s.push(De(r,t,n))}return s.join("")}function At(e,t,n){const s=t.trim();let o=s;const r=new Set;for(const i of n){const l=i.format[0],d=i.tag;if(qe(e,l)&&!r.has(l)){r.add(l);const a=Nt(e,!0);qe(a,l)||(o=d+o);const c=Nt(e,!1);qe(c,l)||(o+=d)}}return t.replace(s,o)}function Nt(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const s=e.getParentOrThrow();s.isInline()&&(n=t?s.getPreviousSibling():s.getNextSibling())}for(;n;){if(z(n)){if(!n.isInline())break;const s=t?n.getLastDescendant():n.getFirstDescendant();if(j(s))return s;n=t?n.getPreviousSibling():n.getNextSibling()}if(j(n))return n;if(!z(n))return null}return null}function qe(e,t){return j(e)&&e.hasFormat(t)}const Oi={kernelspec:{display_name:"Python 3 (ipykernel)",language:"python",name:"python3"},language_info:{codemirror_mode:{name:"ipython",version:3},file_extension:".py",mimetype:"text/x-python",name:"python",nbconvert_exporter:"python",pygments_lexer:"ipython3",version:"3"}},El=e=>{const t=[];let n=[];const s=()=>`cell-${t.length+1}`,o=()=>{n.length>0&&(t.push(Mi(s(),n.join(`
|
|
532
532
|
|
|
533
533
|
`))),n=[])};for(let r=0;r<e.length;r++){const i=e[r];if(Be(i)){o();let l=[];const d=e[r+1];Ve(d)&&d.getJupyterInputNodeUuid()===i.getJupyterInputNodeUuid()&&(l=d.getOutputs(),r++),t.push(We(s(),i.getTextContent(),l))}else{if(Ve(i))continue;if(nn(i))o(),t.push(We(s(),`from IPython.display import YouTubeVideo
|
|
534
534
|
YouTubeVideo('${i.getId()}')`,[]));else if(ds(i)){const l=ps(i.getVideo().url);if(!l)continue;o(),t.push(We(s(),`from IPython.display import IFrame
|
|
535
|
-
IFrame('${fs(l)}', width=800, height=450)`,[]))}else if(ae(i)&&i.getChildrenSize()===1&&Ie(i.getFirstChild())){const l=i.getFirstChild();Ie(l)&&n.push(`$$${l.getEquation()}$$`)}else{const l=Bi(i);l!==null&&l.trim()!==""&&n.push(l)}}}return o(),{nbformat:4,nbformat_minor:5,metadata:Oi,cells:t}},We=(e,t,n)=>({id:e,cell_type:"code",metadata:{},source:t,outputs:n,execution_count:null}),Mi=(e,t)=>({id:e,cell_type:"markdown",metadata:{},source:t}),tt=ms(ct),Di=tt.textFormat.filter(e=>e.format.length===1);function Bi(e){return Pi(e,tt.element,Di,tt.textMatch)}function ji(e){return Array.isArray(e)?e.join(""):typeof e=="string"?e:""}const Ui=(e,t)=>{t.update(()=>{const n=ce();vo(null),n.clear(),n.selectStart(),e.cells.forEach((s,o)=>{const r=ji(s.source);if(n.selectEnd(),s.cell_type==="markdown")gs(r,ct);else if(s.cell_type==="code"){const i=s.outputs??[];t.dispatchCommand(hs,{code:r,outputs:i,loading:"Loading..."})}else{const i=lt();i.append(U(r)),n.append(i)}o<e.cells.length-1&&t.dispatchCommand(wo,void 0)})})};function Fi(e){return So(M()[0],e)}function $t(e){return Fi(e).output.Component}function zi(e){const t=e.getChildren();for(const n of t)if(ys(n))return!0;return!1}function Cl({enabled:e=!0,defaultLanguage:t="python",customConfigs:n=[],debug:s=!1,fallbackTabSize:o=4,preserveTabs:r=!1}){const[i]=M(),[l]=m.useState(()=>new rr({defaultLanguage:t,customConfigs:n,debug:s,fallbackTabSize:o,preserveTabs:r})),[d]=m.useState(()=>new nr(l,s));return m.useEffect(()=>{if(e)return ve(i.registerCommand(Ao,a=>{const c=se();if(!X(c))return!1;const u=c.anchor.getNode(),f=nt(u);if(!f||zi(f))return!1;a?.preventDefault();const y=f.getLanguage()||t,T=d.getTabString(y);return s&&V(`[AutoIndentPlugin] Tab key pressed - Language: ${y}, inserting: ${JSON.stringify(T)}`),c.isCollapsed()?c.insertText(T):It(c,T),!0},ye),i.registerCommand(ko,()=>{const a=se();if(!X(a))return!1;const c=Rt(a),u=d.getTabString(c);return s&&V(`[AutoIndentPlugin] INDENT_CONTENT_COMMAND - Language: ${c}, inserting: ${JSON.stringify(u)}`),a.isCollapsed()?a.insertText(u):It(a,u),!0},ye),i.registerCommand(_o,a=>{const c=se();if(!X(c))return!1;const u=c.anchor.getNode(),f=nt(u);if(!f||a?.shiftKey)return!1;a?.preventDefault();const y=f.getLanguage()||t,T=Hi(c),L=T.trim().length===0;s&&V(`[AutoIndentPlugin] Enter key pressed in ${y} cell - Current line: "${T}", isEmpty: ${L}`);let g;if(L)s&&V("[AutoIndentPlugin] Empty line detected - about to clear whitespace"),qi(c,s),g=d.getLeadingWhitespace(T).length,s&&V(`[AutoIndentPlugin] Empty line - cleared whitespace, preserving ${g} spaces for new line`);else{const S=d.calculateIndent({currentLine:T,language:y,currentIndent:d.getLeadingWhitespace(T).length});g=S.spaces,s&&V("[AutoIndentPlugin] Indent result:",S)}if(c.insertNodes([fe()]),g>0){const S=" ".repeat(g),R=bs(S);c.insertNodes([R]),s&&V(`[AutoIndentPlugin] Inserted ${g} spaces`)}return!0},ye),i.registerCommand(Lo,()=>{const a=se();if(!X(a))return!1;const c=Rt(a),u=d.getTabSize(c);return Wi(a,u),!0},ye))},[i,e,t,s]),null}function Rt(e){if(!X(e))return null;const t=e.anchor.getNode();return nt(t)?.getLanguage()||"python"}function nt(e){let t=e;for(;t;){if(Be(t))return t;t=t.getParent()}return null}function Hi(e){if(!X(e))return"";let n=e.anchor.getNode();const s=[];for(j(n)&&s.unshift(n.getTextContent()),n=n.getPreviousSibling();n&&n.getType()!=="linebreak";)j(n)&&s.unshift(n.getTextContent()),n=n.getPreviousSibling();return s.join("")}function qi(e,t=!1){if(!X(e)){t&&V("[clearCurrentLineWhitespace] Not a range selection");return}const n=e.anchor.getNode();let s=n;t&&V("[clearCurrentLineWhitespace] Starting with anchor node:",{type:n.getType(),isTextNode:j(n),content:j(n)?n.getTextContent():"N/A"});const o=[];for(j(s)&&o.push(s),s=s.getPreviousSibling();s;){if(s.getType()==="linebreak"){t&&V("[clearCurrentLineWhitespace] Hit linebreak, stopping");break}j(s)&&o.unshift(s),s=s.getPreviousSibling()}t&&(V(`[clearCurrentLineWhitespace] Found ${o.length} text nodes to clear`),o.forEach((i,l)=>{j(i)&&V(`[clearCurrentLineWhitespace] Node ${l}: "${i.getTextContent()}"`)}));let r=0;o.forEach(i=>{j(i)&&(i.setTextContent(""),r++)}),t&&V(`[clearCurrentLineWhitespace] Cleared ${r} nodes`)}function It(e,t){if(!X(e))return;e.getNodes().forEach(s=>{if(j(s)){const o=s.getTextContent(),r=s.getPreviousSibling();(r===null||r.getType()==="linebreak")&&s.setTextContent(t+o)}})}function Wi(e,t){if(!X(e))return;e.getNodes().forEach(s=>{if(j(s)){const o=s.getTextContent(),r=s.getPreviousSibling();if(r===null||r.getType()==="linebreak"){const i=o.match(/^ {1,}/)?.[0]?.length||0,l=Math.min(i,t);l>0&&s.setTextContent(o.substring(l))}}})}function Xi(e,t,n,s){m.useEffect(()=>{e.hasNodes([Zt])||(function(o,...r){const i=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",o);for(const d of r)l.append("v",d);throw i.search=l.toString(),Error(`Minified Lexical error #${o}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),m.useEffect(()=>xs(e,{changeHandlers:n?[n]:[],excludeParents:s??[],matchers:t}),[e,t,n,s])}function Ji({matchers:e,onChange:t,excludeParents:n}){const[s]=M();return Xi(s,e,t,n),null}const vl=()=>h.jsx(Ji,{matchers:Es}),Vi=10,Yi=5;function Xe(e,t,n,s=Vi,o=Yi){const r=n.parentElement;if(e===null||!r){t.style.opacity="0",t.style.top="-10000px",t.style.left="-10000px",t.style.transform="translate(0px, 0px)";return}const i=t.getBoundingClientRect(),l=n.getBoundingClientRect(),d=r.getBoundingClientRect();let a=e.top-s,c=e.left-o;a<d.top&&(a+=i.height+e.height+s*2),c+i.width>d.right&&(c=d.right-i.width-o),a-=l.top,c-=l.left,t.style.opacity="1",t.style.top="0px",t.style.left="0px",t.style.transform=`translate(${c}px, ${a}px)`}function ke(e){e.preventDefault()}function Gi({editor:e,isLink:t,setIsLink:n,anchorElem:s,isLinkEditMode:o,setIsLinkEditMode:r}){const i=m.useRef(null),l=m.useRef(null),[d,a]=m.useState(""),[c,u]=m.useState("https://"),[f,y]=m.useState(null),T=m.useCallback(()=>{const g=se();if(X(g)){const E=Oe(g),v=le(E,Y);v?a(v.getURL()):Y(E)?a(E.getURL()):a(""),o&&u(d)}else if(pe(g)){const E=g.getNodes();if(E.length>0){const v=E[0],x=v.getParent();Y(x)?a(x.getURL()):Y(v)?a(v.getURL()):a(""),o&&u(d)}}const S=i.current,R=$o(e._window),$=document.activeElement;if(S===null)return;const p=e.getRootElement();if(o){let E;if(g!==null&&p!==null)if(pe(g)){const v=g.getNodes();if(v.length>0){const x=e.getElementByKey(v[0].getKey());x&&(E=x.getBoundingClientRect())}}else R!==null&&p.contains(R.anchorNode)&&(E=R.focusNode?.parentElement?.getBoundingClientRect());E&&(E.y+=40,Xe(E,S,s)),y(g)}else if(t&&g!==null&&p!==null&&e.isEditable()){let E;if(pe(g)){const v=g.getNodes();if(v.length>0){const x=e.getElementByKey(v[0].getKey());x&&(E=x.getBoundingClientRect())}}else R!==null&&p.contains(R.anchorNode)&&(E=R.focusNode?.parentElement?.getBoundingClientRect());E&&(E.y+=40,Xe(E,S,s)),y(g)}else(!$||$.className!=="link-input")&&(p!==null&&Xe(null,S,s),y(null),a(""));return!0},[s,e,o,d,t]);m.useEffect(()=>{const g=s.parentElement,S=()=>{e.getEditorState().read(()=>{T()})};return window.addEventListener("resize",S),g&&g.addEventListener("scroll",S),()=>{window.removeEventListener("resize",S),g&&g.removeEventListener("scroll",S)}},[s.parentElement,e,T]),m.useEffect(()=>ve(e.registerUpdateListener(({editorState:g})=>{g.read(()=>{T()})}),e.registerCommand(fn,()=>(T(),!0),pn),e.registerCommand(Ro,()=>t?(n(!1),!0):!1,ye)),[e,T,n,t]),m.useEffect(()=>{e.getEditorState().read(()=>{T()})},[e,T]),m.useEffect(()=>{e.getEditorState().read(()=>{T()})},[e,T,o,t]),m.useEffect(()=>{o&&l.current&&l.current.focus()},[o,t]),m.useEffect(()=>{const g=i.current;if(g===null)return;const S=R=>{!g.contains(R.relatedTarget)&&t&&n(!1)};return g.addEventListener("focusout",S),()=>{g.removeEventListener("focusout",S)}},[i,n,r,t,o]);const C=g=>{g.key==="Enter"?L(g):g.key==="Escape"&&(g.preventDefault(),r(!1))},L=g=>{g.preventDefault(),f!==null&&(d!==""&&e.update(()=>{e.dispatchCommand(yt,bt(c));const S=se();if(X(S)){const R=Oe(S).getParent();if(Ke(R)){const $=sn(R.getURL(),{rel:R.__rel,target:R.__target,title:R.__title});R.replace($,!0)}}}),u("https://"),r(!1))};return h.jsx(ie,{ref:i,sx:{position:"absolute",zIndex:10,top:"-10000px",left:"-10000px",opacity:0,bg:"var(--overlay-bgColor)",border:"1px solid",borderColor:"var(--borderColor-default)",borderRadius:2,boxShadow:"var(--shadow-floating-large, 0 0 0 1px #d1d9e0, 0 40px 80px 0 #25292e3d)",transition:"opacity 0.15s ease",p:1,minWidth:250},children:t?o?h.jsxs(ie,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Io,{ref:l,value:c,onChange:g=>{u(g.target.value)},onKeyDown:C,size:"small",block:!0,sx:{flex:1}}),h.jsx(Le,{icon:hn,"aria-label":"Cancel",variant:"invisible",size:"small",onMouseDown:ke,onClick:()=>r(!1)}),h.jsx(Le,{icon:Po,"aria-label":"Confirm",variant:"invisible",size:"small",onMouseDown:ke,onClick:L})]}):h.jsxs(ie,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(ie,{sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:1,px:1},children:h.jsx(Oo,{href:bt(d),target:"_blank",rel:"noopener noreferrer",sx:{fontSize:1},children:d})}),h.jsx(Le,{icon:Mo,"aria-label":"Edit link",variant:"invisible",size:"small",onMouseDown:ke,onClick:g=>{g.preventDefault(),u(d),r(!0)}}),h.jsx(Le,{icon:Do,"aria-label":"Remove link",variant:"invisible",size:"small",sx:{color:"var(--fgColor-danger)"},onMouseDown:ke,onClick:()=>{e.dispatchCommand(yt,null)}})]}):null})}function Zi(e,t,n,s){const[o,r]=m.useState(e),[i,l]=m.useState(!1);return m.useEffect(()=>{function d(){const a=se();if(X(a)){const c=Oe(a),u=le(c,Y),f=le(c,Ke);if(!(u||f)){l(!1);return}const y=a.getNodes().filter(T=>!ut(T)).find(T=>{const C=le(T,Y),L=le(T,Ke);return u&&!u.is(C)||C&&!C.is(u)||f&&!f.is(L)||L&&(!L.is(f)||L.getIsUnlinked())});l(!y)}else if(pe(a)){const c=a.getNodes();if(c.length===0){l(!1);return}const u=c[0],f=u.getParent();Y(f)||Y(u)?l(!0):l(!1)}}return ve(e.registerUpdateListener(({editorState:a})=>{a.read(()=>{d()})}),e.registerCommand(fn,(a,c)=>(d(),r(c),!1),mn),e.registerCommand(No,a=>{const c=se();if(X(c)){const u=Oe(c),f=le(u,Y);if(Y(f)&&(a.metaKey||a.ctrlKey))return window.open(f.getURL(),"_blank"),!0}return!1},pn))},[e]),gn.createPortal(h.jsx(Gi,{editor:o,isLink:i,anchorElem:t,setIsLink:l,isLinkEditMode:n,setIsLinkEditMode:s}),t)}function Ki({anchorElem:e=document.body,isLinkEditMode:t,setIsLinkEditMode:n}){const[s]=M();return Zi(s,e,t,n)}function wl(e,t){const n=e.getRangeAt(0);let s;if(e.anchorNode===t){let o=t;for(;o.firstElementChild!=null;)o=o.firstElementChild;s=o.getBoundingClientRect()}else s=n.getBoundingClientRect();return s}const Sl=(...e)=>e.filter(Boolean).join(" "),Ll=()=>window.getSelection(),Qi=10,ea=5;function _l(e,t,n,s=Qi,o=ea){const r=n.parentElement;if(e===null||!r){t.style.opacity="0",t.style.top="-10000px",t.style.left="-10000px";return}const i=t.getBoundingClientRect(),l=n.getBoundingClientRect(),d=r.getBoundingClientRect();let a=e.top-i.height-s,c=e.left-o;a<d.top&&(a+=i.height+e.height+s*2),c+i.width>d.right&&(c=d.right-i.width-o),a-=l.top,c-=l.left,t.style.opacity="1",t.style.top=`${a}px`,t.style.left=`${c}px`}function kl(){const[e]=M();return m.useEffect(()=>Ts(e),[e]),null}const Al=()=>{const[e]=M();return m.useEffect(()=>Cs(e),[e]),null};function Nl(){const[e]=M();return m.useEffect(()=>vs(e),[e]),null}function $l(){const[e]=M();return m.useEffect(()=>ws(e),[e]),null}class Rl{name="LSP (Python & Markdown)";pendingRequests=new Map;requestCounter=0;lexicalId;vscodeAPI;boundHandleMessage;constructor(t,n){this.lexicalId=t,this.vscodeAPI=n||typeof window<"u"&&window.vscode,this.vscodeAPI||console.warn("[LSP-Lexical] VS Code API not available, LSP completions disabled"),this.boundHandleMessage=this.handleMessage.bind(this),typeof window<"u"&&window.addEventListener("message",this.boundHandleMessage)}async fetchCompletions(t,n,s,o){if(!this.vscodeAPI)return console.error("[LSP-Lexical-Provider] VS Code API not available"),[];if(o!=="python"&&o!=="markdown")return[];const r=`lsp-lexical-${++this.requestCounter}`,i={type:"lsp-completion-request",requestId:r,cellId:t,language:o,position:s,source:"lexical",lexicalId:this.lexicalId};return new Promise(l=>{const d=setTimeout(()=>{console.warn("[LSP-Lexical-Provider] Request timed out:",r),this.pendingRequests.delete(r),l([])},15e3);this.pendingRequests.set(r,a=>{clearTimeout(d),l(a)}),this.vscodeAPI.postMessage(i)})}handleMessage(t){const n=t.data;if(n.type==="lsp-completion-response"){const s=this.pendingRequests.get(n.requestId);s?(s(n.completions||[]),this.pendingRequests.delete(n.requestId)):console.warn("[LSP-Lexical-Provider] No resolver found for requestId:",n.requestId)}else if(n.type==="lsp-error"){console.error("[LSP-Lexical-Provider] LSP error received",n);const s=this.pendingRequests.get(n.requestId);s&&(s([]),this.pendingRequests.delete(n.requestId))}}dispose(){this.pendingRequests.clear(),typeof window<"u"&&this.boundHandleMessage&&window.removeEventListener("message",this.boundHandleMessage)}}function ta(e){const t=e.getLanguage();return!t||t==="python"||t==="py"?"python":t==="markdown"||t==="md"||t==="text"?"markdown":"unknown"}function Il({lexicalId:e,onDocumentOpen:t,onDocumentSync:n,onDocumentClose:s,disabled:o=!1}){const[r]=M(),i=m.useRef(new Set),l=m.useRef(t),d=m.useRef(n),a=m.useRef(s);return m.useEffect(()=>{l.current=t,d.current=n,a.current=s},[t,n,s]),m.useEffect(()=>{if(o)return;const c=()=>{const f=ce(),y=new Map;function T(C){if(Be(C)){const L=C.getJupyterInputNodeUuid(),g=C.getTextContent(),S=ta(C);(S==="python"||S==="markdown")&&y.set(L,{uuid:L,content:g,language:S})}z(C)&&C.getChildren().forEach(T)}T(f);for(const[C,L]of y)i.current.has(C)?d.current?.({cellId:L.uuid,notebookId:e,content:L.content,language:L.language,version:Date.now()}):(l.current?.({cellId:L.uuid,notebookId:e,content:L.content,language:L.language,version:Date.now()}),i.current.add(C))};r.getEditorState().read(c);const u=r.registerUpdateListener(({editorState:f})=>{f.read(c)});return()=>{u(),i.current.clear()}},[r,e,o]),null}var Pt;(function(e){e[e.Text=0]="Text",e[e.Method=1]="Method",e[e.Function=2]="Function",e[e.Constructor=3]="Constructor",e[e.Field=4]="Field",e[e.Variable=5]="Variable",e[e.Class=6]="Class",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Unit=10]="Unit",e[e.Value=11]="Value",e[e.Enum=12]="Enum",e[e.Keyword=13]="Keyword",e[e.Snippet=14]="Snippet",e[e.Color=15]="Color",e[e.File=16]="File",e[e.Reference=17]="Reference",e[e.Folder=18]="Folder",e[e.EnumMember=19]="EnumMember",e[e.Constant=20]="Constant",e[e.Struct=21]="Struct",e[e.Event=22]="Event",e[e.Operator=23]="Operator",e[e.TypeParameter=24]="TypeParameter"})(Pt||(Pt={}));const Pl=({maxDepth:e})=>{const[t]=M();return m.useEffect(()=>Ss(t,e??Ls),[t,e]),null},na=[{dependencies:[Bo],export:e=>un(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,s)=>{const o=jo();s||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},triggerOnEnter:!0,type:"element"},...ks];function sa({transformers:e=na}){const[t]=M();return m.useEffect(()=>_s(t,e),[t,e]),null}const Ol=()=>h.jsx(sa,{transformers:ct}),oa=e=>{const{notebook:t}=e,[n]=M(),s=m.useRef(null);return m.useEffect(()=>{if(!t)return;const o=JSON.stringify(t);o!==s.current&&(s.current=o,Ui(t,n))},[n,t]),null};function gt(e){return[e.getKey(),e.getTextContent(),e.getTag()]}function ra(e,t,n){if(t===null)return n;const s=gt(t);let o=[];if(e===null){if(n.length>0&&n[0][0]===t.__key)return n;o=[s,...n]}else for(let r=0;r<n.length;r++){const i=n[r][0];if(o.push(n[r]),i===e.getKey()&&i!==t.getKey()){if(r+1<n.length&&n[r+1][0]===t.__key)return n;o.push(s)}}return o}function ia(e,t){const n=[];for(const s of t)s[0]!==e&&n.push(s);return n}function aa(e,t){const n=[];for(const s of t)s[0]===e.getKey()?n.push(gt(e)):n.push(s);return n}function Ot(e,t,n){const s=[],o=gt(t);e||s.push(o);for(const r of n)r[0]!==t.getKey()&&(s.push(r),e&&r[0]===e.getKey()&&s.push(o));return s}function Je(e){let t=xt(e);for(;t!==null&&!Q(t);)t=xt(t);return t}function la({children:e}){const[t,n]=m.useState([]),[s]=M();return m.useEffect(()=>{let o=[];s.read("latest",()=>{const d=a=>{for(const c of a.getChildren())Q(c)?o.push([c.getKey(),c.getTextContent(),c.getTag()]):z(c)&&d(c)};d(ce()),n(o)});const r=s.registerUpdateListener(({editorState:d,dirtyElements:a})=>{d.read(()=>{const c=u=>{for(const f of u.getChildren())if(Q(f)){const y=Je(f);o=Ot(y,f,o),n(o)}else z(f)&&c(f)};ce().getChildren().forEach(u=>{z(u)&&a.get(u.__key)&&c(u)})})}),i=s.registerMutationListener(me,d=>{s.read("latest",()=>{for(const[a,c]of d)if(c==="created"){const u=ze(a);if(Q(u)){const f=Je(u);o=ra(f,u,o)}}else if(c==="destroyed")o=ia(a,o);else if(c==="updated"){const u=ze(a);if(Q(u)){const f=Je(u);o=Ot(f,u,o)}}n(o)})},{skipInitialization:!0}),l=s.registerMutationListener(Uo,d=>{s.read("latest",()=>{for(const[a,c]of d)if(c==="updated"){const u=ze(a);if(u!==null){const f=u.getParentOrThrow();Q(f)&&(o=aa(f,o),n(o))}}})},{skipInitialization:!0});return()=>{i(),l(),r()}},[s]),e(t,s)}function $n(e){switch(e){case"top-left":return{top:"16px",left:"16px"};case"top-right":return{top:"16px",right:"16px"};case"bottom-left":return{bottom:"16px",left:"16px"};case"center-left":return{top:"50%",left:"16px",transform:"translateY(-50%)"};case"center-right":return{top:"50%",right:"16px",transform:"translateY(-50%)"};case"top":return{top:"16px",left:"50%",transform:"translateX(-50%)"};case"bottom":return{bottom:"16px",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"16px",transform:"translateY(-50%)"};case"right":return{top:"50%",right:"16px",transform:"translateY(-50%)"};case"center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};default:return{bottom:"16px",right:"16px"}}}function ca(e){return e==="h2"?3:e==="h3"?5:0}function ua({tableOfContents:e,onClose:t,collapsePosition:n}){const[s,o]=m.useState(""),r=m.useRef(0),[i]=M();function l(u,f){i.getEditorState().read(()=>{const y=i.getElementByKey(u);y!==null&&(y.scrollIntoView(),o(u),r.current=f)})}function d(u){const f=u?.getClientRects()[0].y;return f>=.26&&f<=9}function a(u){return u?.getClientRects()[0].y<=0}function c(u){return u?.getClientRects()[0].y>9}return m.useEffect(()=>{function u(){if(e.length!==0&&r.current<e.length-1){let C=i.getElementByKey(e[r.current][0]);if(C!==null){if(c(C)){for(;C!==null&&c(C)&&r.current>0;){const g=i.getElementByKey(e[r.current-1][0]);g!==null&&(a(g)||c(g))&&r.current--,C=g}const L=e[r.current][0];o(L)}else if(a(C)){for(;C!==null&&a(C)&&r.current<e.length-1;){const g=i.getElementByKey(e[r.current+1][0]);g!==null&&(d(g)||a(g))&&r.current++,C=g}const L=e[r.current][0];o(L)}}}else r.current=0}let f;function y(C,L){clearTimeout(f),f=setTimeout(C,L)}function T(){y(u,10)}return document.addEventListener("scroll",T),()=>document.removeEventListener("scroll",T)},[e,i]),h.jsxs(ie,{sx:{position:"fixed",...$n(n),width:"220px",maxHeight:"300px",overflowY:"auto",overflowX:"hidden",zIndex:20,bg:"var(--bgColor-default)",border:"1px solid",borderColor:"var(--borderColor-default)",borderRadius:2,boxShadow:"var(--shadow-resting-small, 0 1px 1px 0 #1f23280f, 0 1px 3px 0 #1f23280f)",p:2},children:[h.jsxs(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[h.jsx(Ho,{sx:{fontSize:1,fontWeight:"bold",color:"var(--fgColor-default)"},children:"Table of Contents"}),h.jsx(ie,{as:"button",type:"button",onClick:t,"aria-label":"Close table of contents",title:"Close",sx:{appearance:"none",border:"1px solid",borderColor:"var(--borderColor-default)",borderRadius:1,bg:"var(--bgColor-default)",color:"var(--fgColor-default)",width:"24px",height:"24px",p:0,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer","&:hover":{bg:"var(--bgColor-muted)"}},children:h.jsx(hn,{size:12})})]}),h.jsx(Ct,{"aria-label":"Table of contents",children:e.map(([u,f,y],T)=>{const C=(""+f).length>27?f.substring(0,27)+"…":f;return h.jsx(Ct.Item,{as:"button",type:"button","aria-current":s===u?"location":void 0,onClick:()=>l(u,T),sx:{width:"100%",textAlign:"left",fontWeight:T===0?"bold":void 0,pl:T===0?void 0:ca(y)},children:C},u)})})]})}const da=({showByDefault:e=!1,collapsePosition:t="bottom-right"}={})=>{const[n,s]=m.useState(e);return h.jsx(la,{children:o=>n?h.jsx(ua,{tableOfContents:o,onClose:()=>s(!1),collapsePosition:t}):h.jsx(Fo,{text:"Open TOC",direction:"w",children:h.jsx(ie,{as:"button",type:"button",onClick:()=>s(!0),"aria-label":"Open table of contents",title:"Open TOC",sx:{position:"fixed",...$n(t),zIndex:20,width:"48px",height:"48px",borderRadius:"999px",border:"1px solid",borderColor:"var(--borderColor-default)",bg:"var(--overlay-bgColor)",color:"var(--fgColor-default)",boxShadow:"var(--shadow-resting-medium, 0 1px 1px 0 #25292e1a, 0 3px 6px 0 #25292e1f)",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer","&:hover":{bg:"var(--bgColor-muted)"}},children:h.jsx(zo,{size:16})})})})};function pa(e,t,n){const s=m.useRef(null);return s.current=e,m.useMemo(()=>As((...o)=>{s.current&&s.current(...o)},t,{maxWait:n}),[t,n])}const Mt=20;function fa({anchorElem:e}){const[t,{getTheme:n}]=M(),s=on(),[o,r]=m.useState(!1),[i,l]=m.useState(!1),[d,a]=m.useState(!1),[c,u]=m.useState({}),f=m.useRef(new Set),y=m.useRef(null),T=pa(g=>{const{isOutside:S,tableDOMNode:R}=ma(g,n);if(S){r(!1),l(!1);return}if(!R)return;y.current=R;let $=null,p=null,E=null;if(t.getEditorState().read(()=>{const v=Et(R);if(Ze(v)){const x=le(v,k=>Ye(k));if(!Ye(x))return;if(E=$s(x,t.getElementByKey(x.getKey())),E){const k=x.getChildrenSize(),A=x.getChildAtIndex(0)?.getChildrenSize(),I=Rs(v),b=Is(v);I===k-1?$=v:b===A-1&&(p=v)}}},{editor:t}),E){const{width:v,y:x,right:k,left:A,bottom:I,height:b}=E.getBoundingClientRect(),N=E.parentElement;let _=!1;N&&N.classList.contains("JupyterLexicalTheme__tableScrollableWrapper")&&(_=N.scrollWidth>N.clientWidth);const{y:B,left:O}=e.getBoundingClientRect();if($){const w={height:Mt,left:_&&N?N.offsetLeft:A-O,top:I-B,width:_&&N?N.offsetWidth:v};l(!1),r(!0),u(w)}else if(p){const w={height:b,left:k-O,top:x-B,width:Mt};l(!0),r(!1),u(w)}}},50,250),C=m.useMemo(()=>new ResizeObserver(()=>{r(!1),l(!1)}),[]);m.useEffect(()=>{if(!d)return;const g=()=>{r(!1),l(!1)};return document.addEventListener("mousemove",T),document.addEventListener("scroll",g,!0),()=>{r(!1),l(!1),T.cancel(),document.removeEventListener("mousemove",T),document.removeEventListener("scroll",g,!0)}},[d,T]),m.useEffect(()=>ve(t.registerMutationListener(Jt,g=>{t.getEditorState().read(()=>{let S=!1;for(const[R,$]of g)switch($){case"created":{f.current.add(R),S=!0;break}case"destroyed":{f.current.delete(R),S=!0;break}}if(S){C.disconnect();for(const R of f.current){const{tableElement:$}=Ns(R);C.observe($)}a(f.current.size>0)}},{editor:t})},{skipInitialization:!1})),[t,C]);const L=g=>{t.update(()=>{y.current&&(Et(y.current)?.selectEnd(),g?(Ps(),r(!1)):(Os(),l(!1)))})};return s?h.jsxs(h.Fragment,{children:[o&&h.jsx("button",{className:`${n()?.tableAddRows}`,style:{...c},onClick:()=>L(!0)}),i&&h.jsx("button",{className:`${n()?.tableAddColumns}`,style:{...c},onClick:()=>L(!1)})]}):null}function ma(e,t){const n=e.target,s=Fe(t,"tableCell");if(qo(n)){const o=n.closest(`td${s}, th${s}`);return{isOutside:!(o||n.closest(`button${Fe(t,"tableAddRows")}`)||n.closest(`button${Fe(t,"tableAddColumns")}`)||n.closest("div.TableCellResizer__resizer")),tableDOMNode:o}}else return{isOutside:!0,tableDOMNode:null}}function Ml({anchorElem:e=document.body}){return on()?gn.createPortal(h.jsx(fa,{anchorElem:e}),e):null}const Ae="JupyterLexicalTheme__tableScrollableWrapper",Dt="JupyterLexicalTheme__tableScrollRight",Bt="JupyterLexicalTheme__tableScrollLeft",jt="JupyterLexicalTheme__tableScrollMiddle";function Ne(e){const t=e.scrollWidth>e.clientWidth,n=e.scrollLeft+e.clientWidth>=e.scrollWidth-1,s=e.scrollLeft<=1;e.classList.remove(Dt),e.classList.remove(Bt),e.classList.remove(jt),t&&(!s&&!n?e.classList.add(jt):s&&!n?e.classList.add(Dt):!s&&n&&e.classList.add(Bt))}function Dl(){const[e]=M();return m.useEffect(()=>{const t=e.getRootElement();if(!t)return;const n=()=>{t.querySelectorAll(`.${Ae}`).forEach(Ne)};n();const s=new MutationObserver(()=>{n()});s.observe(t,{childList:!0,subtree:!0});const o=new ResizeObserver(()=>{n()}),r=new Map,i=a=>{if(r.has(a))return;const c=()=>{Ne(a)};a.addEventListener("scroll",c,{passive:!0}),r.set(a,c)};t.querySelectorAll(`.${Ae}`).forEach(a=>{o.observe(a),i(a)});const d=new MutationObserver(a=>{a.forEach(c=>{c.addedNodes.forEach(u=>{u instanceof HTMLElement&&(u.classList.contains(Ae)&&(o.observe(u),i(u),Ne(u)),u.querySelectorAll(`.${Ae}`).forEach(y=>{o.observe(y),i(y),Ne(y)}))})})});return d.observe(t,{childList:!0,subtree:!0}),()=>{s.disconnect(),o.disconnect(),d.disconnect(),r.forEach((a,c)=>{c.removeEventListener("scroll",a)}),r.clear()}},[e]),null}const Rn=Object.freeze({" ":"\\t","\n":"\\n"}),Ut=new RegExp(Object.keys(Rn).join("|"),"g"),J=Object.freeze({ancestorHasNextSibling:"|",ancestorIsLastChild:" ",hasNextSibling:"├",isLastChild:"└",selectedChar:"^",selectedLine:">"}),ga=[e=>e.hasFormat("bold")&&"Bold",e=>e.hasFormat("code")&&"Code",e=>e.hasFormat("italic")&&"Italic",e=>e.hasFormat("strikethrough")&&"Strikethrough",e=>e.hasFormat("subscript")&&"Subscript",e=>e.hasFormat("superscript")&&"Superscript",e=>e.hasFormat("underline")&&"Underline",e=>e.hasFormat("highlight")&&"Highlight"],ha=[e=>e.hasTextFormat("bold")&&"Bold",e=>e.hasTextFormat("code")&&"Code",e=>e.hasTextFormat("italic")&&"Italic",e=>e.hasTextFormat("strikethrough")&&"Strikethrough",e=>e.hasTextFormat("subscript")&&"Subscript",e=>e.hasTextFormat("superscript")&&"Superscript",e=>e.hasTextFormat("underline")&&"Underline",e=>e.hasTextFormat("highlight")&&"Highlight"],ba=[e=>e.isDirectionless()&&"Directionless",e=>e.isUnmergeable()&&"Unmergeable"],ya=[e=>e.isToken()&&"Token",e=>e.isSegmented()&&"Segmented"];function xa(e,t,n,s,o=!1){const r=e.getEditorState(),i=e._config,l=e._compositionKey,d=e._editable;if(n){let f="";return r.read(()=>{f=(function(y){const T=document.createElement("div");return T.innerHTML=y.trim(),In(T,0).innerHTML})(Wo(e))},{editor:e}),f}let a=` root
|
|
536
|
-
`;const c=r.read(()=>{const f=se();return st(ce(),(y,
|
|
537
|
-
`,a+=(function({indent:p,isSelected:
|
|
538
|
-
`})({indent:
|
|
539
|
-
├ anchor { key: ${S.key}, offset: ${$===null?"null":$}, type: ${S.type} }`,
|
|
540
|
-
└ focus { key: ${R.key}, offset: ${p===null?"null":p}, type: ${R.type} }`,
|
|
535
|
+
IFrame('${fs(l)}', width=800, height=450)`,[]))}else if(ae(i)&&i.getChildrenSize()===1&&Ie(i.getFirstChild())){const l=i.getFirstChild();Ie(l)&&n.push(`$$${l.getEquation()}$$`)}else{const l=Bi(i);l!==null&&l.trim()!==""&&n.push(l)}}}return o(),{nbformat:4,nbformat_minor:5,metadata:Oi,cells:t}},We=(e,t,n)=>({id:e,cell_type:"code",metadata:{},source:t,outputs:n,execution_count:null}),Mi=(e,t)=>({id:e,cell_type:"markdown",metadata:{},source:t}),tt=ms(ct),Di=tt.textFormat.filter(e=>e.format.length===1);function Bi(e){return Pi(e,tt.element,Di,tt.textMatch)}function ji(e){return Array.isArray(e)?e.join(""):typeof e=="string"?e:""}const Ui=(e,t)=>{t.update(()=>{const n=ce();vo(null),n.clear(),n.selectStart(),e.cells.forEach((s,o)=>{const r=ji(s.source);if(n.selectEnd(),s.cell_type==="markdown")gs(r,ct);else if(s.cell_type==="code"){const i=s.outputs??[];t.dispatchCommand(hs,{code:r,outputs:i,loading:"Loading..."})}else{const i=lt();i.append(U(r)),n.append(i)}o<e.cells.length-1&&t.dispatchCommand(wo,void 0)})})};function Fi(e){return So(M()[0],e)}function $t(e){return Fi(e).output.Component}function zi(e){const t=e.getChildren();for(const n of t)if(ys(n))return!0;return!1}function Cl({enabled:e=!0,defaultLanguage:t="python",customConfigs:n=[],debug:s=!1,fallbackTabSize:o=4,preserveTabs:r=!1}){const[i]=M(),[l]=m.useState(()=>new rr({defaultLanguage:t,customConfigs:n,debug:s,fallbackTabSize:o,preserveTabs:r})),[d]=m.useState(()=>new nr(l,s));return m.useEffect(()=>{if(e)return ve(i.registerCommand(Ao,a=>{const c=se();if(!X(c))return!1;const u=c.anchor.getNode(),f=nt(u);if(!f||zi(f))return!1;a?.preventDefault();const y=f.getLanguage()||t,E=d.getTabString(y);return s&&V(`[AutoIndentPlugin] Tab key pressed - Language: ${y}, inserting: ${JSON.stringify(E)}`),c.isCollapsed()?c.insertText(E):It(c,E),!0},ye),i.registerCommand(ko,()=>{const a=se();if(!X(a))return!1;const c=Rt(a),u=d.getTabString(c);return s&&V(`[AutoIndentPlugin] INDENT_CONTENT_COMMAND - Language: ${c}, inserting: ${JSON.stringify(u)}`),a.isCollapsed()?a.insertText(u):It(a,u),!0},ye),i.registerCommand(_o,a=>{const c=se();if(!X(c))return!1;const u=c.anchor.getNode(),f=nt(u);if(!f||a?.shiftKey)return!1;a?.preventDefault();const y=f.getLanguage()||t,E=Hi(c),L=E.trim().length===0;s&&V(`[AutoIndentPlugin] Enter key pressed in ${y} cell - Current line: "${E}", isEmpty: ${L}`);let g;if(L)s&&V("[AutoIndentPlugin] Empty line detected - about to clear whitespace"),qi(c,s),g=d.getLeadingWhitespace(E).length,s&&V(`[AutoIndentPlugin] Empty line - cleared whitespace, preserving ${g} spaces for new line`);else{const S=d.calculateIndent({currentLine:E,language:y,currentIndent:d.getLeadingWhitespace(E).length});g=S.spaces,s&&V("[AutoIndentPlugin] Indent result:",S)}if(c.insertNodes([fe()]),g>0){const S=" ".repeat(g),R=bs(S);c.insertNodes([R]),s&&V(`[AutoIndentPlugin] Inserted ${g} spaces`)}return!0},ye),i.registerCommand(Lo,()=>{const a=se();if(!X(a))return!1;const c=Rt(a),u=d.getTabSize(c);return Wi(a,u),!0},ye))},[i,e,t,s]),null}function Rt(e){if(!X(e))return null;const t=e.anchor.getNode();return nt(t)?.getLanguage()||"python"}function nt(e){let t=e;for(;t;){if(Be(t))return t;t=t.getParent()}return null}function Hi(e){if(!X(e))return"";let n=e.anchor.getNode();const s=[];for(j(n)&&s.unshift(n.getTextContent()),n=n.getPreviousSibling();n&&n.getType()!=="linebreak";)j(n)&&s.unshift(n.getTextContent()),n=n.getPreviousSibling();return s.join("")}function qi(e,t=!1){if(!X(e)){t&&V("[clearCurrentLineWhitespace] Not a range selection");return}const n=e.anchor.getNode();let s=n;t&&V("[clearCurrentLineWhitespace] Starting with anchor node:",{type:n.getType(),isTextNode:j(n),content:j(n)?n.getTextContent():"N/A"});const o=[];for(j(s)&&o.push(s),s=s.getPreviousSibling();s;){if(s.getType()==="linebreak"){t&&V("[clearCurrentLineWhitespace] Hit linebreak, stopping");break}j(s)&&o.unshift(s),s=s.getPreviousSibling()}t&&(V(`[clearCurrentLineWhitespace] Found ${o.length} text nodes to clear`),o.forEach((i,l)=>{j(i)&&V(`[clearCurrentLineWhitespace] Node ${l}: "${i.getTextContent()}"`)}));let r=0;o.forEach(i=>{j(i)&&(i.setTextContent(""),r++)}),t&&V(`[clearCurrentLineWhitespace] Cleared ${r} nodes`)}function It(e,t){if(!X(e))return;e.getNodes().forEach(s=>{if(j(s)){const o=s.getTextContent(),r=s.getPreviousSibling();(r===null||r.getType()==="linebreak")&&s.setTextContent(t+o)}})}function Wi(e,t){if(!X(e))return;e.getNodes().forEach(s=>{if(j(s)){const o=s.getTextContent(),r=s.getPreviousSibling();if(r===null||r.getType()==="linebreak"){const i=o.match(/^ {1,}/)?.[0]?.length||0,l=Math.min(i,t);l>0&&s.setTextContent(o.substring(l))}}})}function Xi(e,t,n,s){m.useEffect(()=>{e.hasNodes([Zt])||(function(o,...r){const i=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",o);for(const d of r)l.append("v",d);throw i.search=l.toString(),Error(`Minified Lexical error #${o}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),m.useEffect(()=>xs(e,{changeHandlers:n?[n]:[],excludeParents:s??[],matchers:t}),[e,t,n,s])}function Ji({matchers:e,onChange:t,excludeParents:n}){const[s]=M();return Xi(s,e,t,n),null}const vl=()=>h.jsx(Ji,{matchers:Ts}),Vi=10,Yi=5;function Xe(e,t,n,s=Vi,o=Yi){const r=n.parentElement;if(e===null||!r){t.style.opacity="0",t.style.top="-10000px",t.style.left="-10000px",t.style.transform="translate(0px, 0px)";return}const i=t.getBoundingClientRect(),l=n.getBoundingClientRect(),d=r.getBoundingClientRect();let a=e.top-s,c=e.left-o;a<d.top&&(a+=i.height+e.height+s*2),c+i.width>d.right&&(c=d.right-i.width-o),a-=l.top,c-=l.left,t.style.opacity="1",t.style.top="0px",t.style.left="0px",t.style.transform=`translate(${c}px, ${a}px)`}function ke(e){e.preventDefault()}function Gi({editor:e,isLink:t,setIsLink:n,anchorElem:s,isLinkEditMode:o,setIsLinkEditMode:r}){const i=m.useRef(null),l=m.useRef(null),[d,a]=m.useState(""),[c,u]=m.useState("https://"),[f,y]=m.useState(null),E=m.useCallback(()=>{const g=se();if(X(g)){const T=Oe(g),v=le(T,Y);v?a(v.getURL()):Y(T)?a(T.getURL()):a(""),o&&u(d)}else if(pe(g)){const T=g.getNodes();if(T.length>0){const v=T[0],x=v.getParent();Y(x)?a(x.getURL()):Y(v)?a(v.getURL()):a(""),o&&u(d)}}const S=i.current,R=$o(e._window),$=document.activeElement;if(S===null)return;const p=e.getRootElement();if(o){let T;if(g!==null&&p!==null)if(pe(g)){const v=g.getNodes();if(v.length>0){const x=e.getElementByKey(v[0].getKey());x&&(T=x.getBoundingClientRect())}}else R!==null&&p.contains(R.anchorNode)&&(T=R.focusNode?.parentElement?.getBoundingClientRect());T&&(T.y+=40,Xe(T,S,s)),y(g)}else if(t&&g!==null&&p!==null&&e.isEditable()){let T;if(pe(g)){const v=g.getNodes();if(v.length>0){const x=e.getElementByKey(v[0].getKey());x&&(T=x.getBoundingClientRect())}}else R!==null&&p.contains(R.anchorNode)&&(T=R.focusNode?.parentElement?.getBoundingClientRect());T&&(T.y+=40,Xe(T,S,s)),y(g)}else(!$||$.className!=="link-input")&&(p!==null&&Xe(null,S,s),y(null),a(""));return!0},[s,e,o,d,t]);m.useEffect(()=>{const g=s.parentElement,S=()=>{e.getEditorState().read(()=>{E()})};return window.addEventListener("resize",S),g&&g.addEventListener("scroll",S),()=>{window.removeEventListener("resize",S),g&&g.removeEventListener("scroll",S)}},[s.parentElement,e,E]),m.useEffect(()=>ve(e.registerUpdateListener(({editorState:g})=>{g.read(()=>{E()})}),e.registerCommand(fn,()=>(E(),!0),pn),e.registerCommand(Ro,()=>t?(n(!1),!0):!1,ye)),[e,E,n,t]),m.useEffect(()=>{e.getEditorState().read(()=>{E()})},[e,E]),m.useEffect(()=>{e.getEditorState().read(()=>{E()})},[e,E,o,t]),m.useEffect(()=>{o&&l.current&&l.current.focus()},[o,t]),m.useEffect(()=>{const g=i.current;if(g===null)return;const S=R=>{!g.contains(R.relatedTarget)&&t&&n(!1)};return g.addEventListener("focusout",S),()=>{g.removeEventListener("focusout",S)}},[i,n,r,t,o]);const C=g=>{g.key==="Enter"?L(g):g.key==="Escape"&&(g.preventDefault(),r(!1))},L=g=>{g.preventDefault(),f!==null&&(d!==""&&e.update(()=>{e.dispatchCommand(yt,bt(c));const S=se();if(X(S)){const R=Oe(S).getParent();if(Ke(R)){const $=sn(R.getURL(),{rel:R.__rel,target:R.__target,title:R.__title});R.replace($,!0)}}}),u("https://"),r(!1))};return h.jsx(ie,{ref:i,sx:{position:"absolute",zIndex:10,top:"-10000px",left:"-10000px",opacity:0,bg:"var(--overlay-bgColor)",border:"1px solid",borderColor:"var(--borderColor-default)",borderRadius:2,boxShadow:"var(--shadow-floating-large, 0 0 0 1px #d1d9e0, 0 40px 80px 0 #25292e3d)",transition:"opacity 0.15s ease",p:1,minWidth:250},children:t?o?h.jsxs(ie,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Io,{ref:l,value:c,onChange:g=>{u(g.target.value)},onKeyDown:C,size:"small",block:!0,sx:{flex:1}}),h.jsx(Le,{icon:hn,"aria-label":"Cancel",variant:"invisible",size:"small",onMouseDown:ke,onClick:()=>r(!1)}),h.jsx(Le,{icon:Po,"aria-label":"Confirm",variant:"invisible",size:"small",onMouseDown:ke,onClick:L})]}):h.jsxs(ie,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(ie,{sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:1,px:1},children:h.jsx(Oo,{href:bt(d),target:"_blank",rel:"noopener noreferrer",sx:{fontSize:1},children:d})}),h.jsx(Le,{icon:Mo,"aria-label":"Edit link",variant:"invisible",size:"small",onMouseDown:ke,onClick:g=>{g.preventDefault(),u(d),r(!0)}}),h.jsx(Le,{icon:Do,"aria-label":"Remove link",variant:"invisible",size:"small",sx:{color:"var(--fgColor-danger)"},onMouseDown:ke,onClick:()=>{e.dispatchCommand(yt,null)}})]}):null})}function Zi(e,t,n,s){const[o,r]=m.useState(e),[i,l]=m.useState(!1);return m.useEffect(()=>{function d(){const a=se();if(X(a)){const c=Oe(a),u=le(c,Y),f=le(c,Ke);if(!(u||f)){l(!1);return}const y=a.getNodes().filter(E=>!ut(E)).find(E=>{const C=le(E,Y),L=le(E,Ke);return u&&!u.is(C)||C&&!C.is(u)||f&&!f.is(L)||L&&(!L.is(f)||L.getIsUnlinked())});l(!y)}else if(pe(a)){const c=a.getNodes();if(c.length===0){l(!1);return}const u=c[0],f=u.getParent();Y(f)||Y(u)?l(!0):l(!1)}}return ve(e.registerUpdateListener(({editorState:a})=>{a.read(()=>{d()})}),e.registerCommand(fn,(a,c)=>(d(),r(c),!1),mn),e.registerCommand(No,a=>{const c=se();if(X(c)){const u=Oe(c),f=le(u,Y);if(Y(f)&&(a.metaKey||a.ctrlKey))return window.open(f.getURL(),"_blank"),!0}return!1},pn))},[e]),gn.createPortal(h.jsx(Gi,{editor:o,isLink:i,anchorElem:t,setIsLink:l,isLinkEditMode:n,setIsLinkEditMode:s}),t)}function Ki({anchorElem:e=document.body,isLinkEditMode:t,setIsLinkEditMode:n}){const[s]=M();return Zi(s,e,t,n)}function wl(e,t){const n=e.getRangeAt(0);let s;if(e.anchorNode===t){let o=t;for(;o.firstElementChild!=null;)o=o.firstElementChild;s=o.getBoundingClientRect()}else s=n.getBoundingClientRect();return s}const Sl=(...e)=>e.filter(Boolean).join(" "),Ll=()=>window.getSelection(),Qi=10,ea=5;function _l(e,t,n,s=Qi,o=ea){const r=n.parentElement;if(e===null||!r){t.style.opacity="0",t.style.top="-10000px",t.style.left="-10000px";return}const i=t.getBoundingClientRect(),l=n.getBoundingClientRect(),d=r.getBoundingClientRect();let a=e.top-i.height-s,c=e.left-o;a<d.top&&(a+=i.height+e.height+s*2),c+i.width>d.right&&(c=d.right-i.width-o),a-=l.top,c-=l.left,t.style.opacity="1",t.style.top=`${a}px`,t.style.left=`${c}px`}function kl(){const[e]=M();return m.useEffect(()=>Es(e),[e]),null}const Al=()=>{const[e]=M();return m.useEffect(()=>Cs(e),[e]),null};function Nl(){const[e]=M();return m.useEffect(()=>vs(e),[e]),null}function $l(){const[e]=M();return m.useEffect(()=>ws(e),[e]),null}class Rl{name="LSP (Python & Markdown)";pendingRequests=new Map;requestCounter=0;lexicalId;vscodeAPI;boundHandleMessage;constructor(t,n){this.lexicalId=t,this.vscodeAPI=n||typeof window<"u"&&window.vscode,this.vscodeAPI||console.warn("[LSP-Lexical] VS Code API not available, LSP completions disabled"),this.boundHandleMessage=this.handleMessage.bind(this),typeof window<"u"&&window.addEventListener("message",this.boundHandleMessage)}async fetchCompletions(t,n,s,o){if(!this.vscodeAPI)return console.error("[LSP-Lexical-Provider] VS Code API not available"),[];if(o!=="python"&&o!=="markdown")return[];const r=`lsp-lexical-${++this.requestCounter}`,i={type:"lsp-completion-request",requestId:r,cellId:t,language:o,position:s,source:"lexical",lexicalId:this.lexicalId};return new Promise(l=>{const d=setTimeout(()=>{console.warn("[LSP-Lexical-Provider] Request timed out:",r),this.pendingRequests.delete(r),l([])},15e3);this.pendingRequests.set(r,a=>{clearTimeout(d),l(a)}),this.vscodeAPI.postMessage(i)})}handleMessage(t){const n=t.data;if(n.type==="lsp-completion-response"){const s=this.pendingRequests.get(n.requestId);s?(s(n.completions||[]),this.pendingRequests.delete(n.requestId)):console.warn("[LSP-Lexical-Provider] No resolver found for requestId:",n.requestId)}else if(n.type==="lsp-error"){console.error("[LSP-Lexical-Provider] LSP error received",n);const s=this.pendingRequests.get(n.requestId);s&&(s([]),this.pendingRequests.delete(n.requestId))}}dispose(){this.pendingRequests.clear(),typeof window<"u"&&this.boundHandleMessage&&window.removeEventListener("message",this.boundHandleMessage)}}function ta(e){const t=e.getLanguage();return!t||t==="python"||t==="py"?"python":t==="markdown"||t==="md"||t==="text"?"markdown":"unknown"}function Il({lexicalId:e,onDocumentOpen:t,onDocumentSync:n,onDocumentClose:s,disabled:o=!1}){const[r]=M(),i=m.useRef(new Set),l=m.useRef(t),d=m.useRef(n),a=m.useRef(s);return m.useEffect(()=>{l.current=t,d.current=n,a.current=s},[t,n,s]),m.useEffect(()=>{if(o)return;const c=()=>{const f=ce(),y=new Map;function E(C){if(Be(C)){const L=C.getJupyterInputNodeUuid(),g=C.getTextContent(),S=ta(C);(S==="python"||S==="markdown")&&y.set(L,{uuid:L,content:g,language:S})}z(C)&&C.getChildren().forEach(E)}E(f);for(const[C,L]of y)i.current.has(C)?d.current?.({cellId:L.uuid,notebookId:e,content:L.content,language:L.language,version:Date.now()}):(l.current?.({cellId:L.uuid,notebookId:e,content:L.content,language:L.language,version:Date.now()}),i.current.add(C))};r.getEditorState().read(c);const u=r.registerUpdateListener(({editorState:f})=>{f.read(c)});return()=>{u(),i.current.clear()}},[r,e,o]),null}var Pt;(function(e){e[e.Text=0]="Text",e[e.Method=1]="Method",e[e.Function=2]="Function",e[e.Constructor=3]="Constructor",e[e.Field=4]="Field",e[e.Variable=5]="Variable",e[e.Class=6]="Class",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Unit=10]="Unit",e[e.Value=11]="Value",e[e.Enum=12]="Enum",e[e.Keyword=13]="Keyword",e[e.Snippet=14]="Snippet",e[e.Color=15]="Color",e[e.File=16]="File",e[e.Reference=17]="Reference",e[e.Folder=18]="Folder",e[e.EnumMember=19]="EnumMember",e[e.Constant=20]="Constant",e[e.Struct=21]="Struct",e[e.Event=22]="Event",e[e.Operator=23]="Operator",e[e.TypeParameter=24]="TypeParameter"})(Pt||(Pt={}));const Pl=({maxDepth:e})=>{const[t]=M();return m.useEffect(()=>Ss(t,e??Ls),[t,e]),null},na=[{dependencies:[Bo],export:e=>un(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,s)=>{const o=jo();s||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},triggerOnEnter:!0,type:"element"},...ks];function sa({transformers:e=na}){const[t]=M();return m.useEffect(()=>_s(t,e),[t,e]),null}const Ol=()=>h.jsx(sa,{transformers:ct}),oa=e=>{const{notebook:t}=e,[n]=M(),s=m.useRef(null);return m.useEffect(()=>{if(!t)return;const o=JSON.stringify(t);o!==s.current&&(s.current=o,Ui(t,n))},[n,t]),null};function gt(e){return[e.getKey(),e.getTextContent(),e.getTag()]}function ra(e,t,n){if(t===null)return n;const s=gt(t);let o=[];if(e===null){if(n.length>0&&n[0][0]===t.__key)return n;o=[s,...n]}else for(let r=0;r<n.length;r++){const i=n[r][0];if(o.push(n[r]),i===e.getKey()&&i!==t.getKey()){if(r+1<n.length&&n[r+1][0]===t.__key)return n;o.push(s)}}return o}function ia(e,t){const n=[];for(const s of t)s[0]!==e&&n.push(s);return n}function aa(e,t){const n=[];for(const s of t)s[0]===e.getKey()?n.push(gt(e)):n.push(s);return n}function Ot(e,t,n){const s=[],o=gt(t);e||s.push(o);for(const r of n)r[0]!==t.getKey()&&(s.push(r),e&&r[0]===e.getKey()&&s.push(o));return s}function Je(e){let t=xt(e);for(;t!==null&&!Q(t);)t=xt(t);return t}function la({children:e}){const[t,n]=m.useState([]),[s]=M();return m.useEffect(()=>{let o=[];s.read("latest",()=>{const d=a=>{for(const c of a.getChildren())Q(c)?o.push([c.getKey(),c.getTextContent(),c.getTag()]):z(c)&&d(c)};d(ce()),n(o)});const r=s.registerUpdateListener(({editorState:d,dirtyElements:a})=>{d.read(()=>{const c=u=>{for(const f of u.getChildren())if(Q(f)){const y=Je(f);o=Ot(y,f,o),n(o)}else z(f)&&c(f)};ce().getChildren().forEach(u=>{z(u)&&a.get(u.__key)&&c(u)})})}),i=s.registerMutationListener(me,d=>{s.read("latest",()=>{for(const[a,c]of d)if(c==="created"){const u=ze(a);if(Q(u)){const f=Je(u);o=ra(f,u,o)}}else if(c==="destroyed")o=ia(a,o);else if(c==="updated"){const u=ze(a);if(Q(u)){const f=Je(u);o=Ot(f,u,o)}}n(o)})},{skipInitialization:!0}),l=s.registerMutationListener(Uo,d=>{s.read("latest",()=>{for(const[a,c]of d)if(c==="updated"){const u=ze(a);if(u!==null){const f=u.getParentOrThrow();Q(f)&&(o=aa(f,o),n(o))}}})},{skipInitialization:!0});return()=>{i(),l(),r()}},[s]),e(t,s)}function $n(e){switch(e){case"top-left":return{top:"16px",left:"16px"};case"top-right":return{top:"16px",right:"16px"};case"bottom-left":return{bottom:"16px",left:"16px"};case"center-left":return{top:"50%",left:"16px",transform:"translateY(-50%)"};case"center-right":return{top:"50%",right:"16px",transform:"translateY(-50%)"};case"top":return{top:"16px",left:"50%",transform:"translateX(-50%)"};case"bottom":return{bottom:"16px",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"16px",transform:"translateY(-50%)"};case"right":return{top:"50%",right:"16px",transform:"translateY(-50%)"};case"center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};default:return{bottom:"16px",right:"16px"}}}function ca(e){return e==="h2"?3:e==="h3"?5:0}function ua({tableOfContents:e,onClose:t,collapsePosition:n}){const[s,o]=m.useState(""),r=m.useRef(0),[i]=M();function l(u,f){i.getEditorState().read(()=>{const y=i.getElementByKey(u);y!==null&&(y.scrollIntoView(),o(u),r.current=f)})}function d(u){const f=u?.getClientRects()[0].y;return f>=.26&&f<=9}function a(u){return u?.getClientRects()[0].y<=0}function c(u){return u?.getClientRects()[0].y>9}return m.useEffect(()=>{function u(){if(e.length!==0&&r.current<e.length-1){let C=i.getElementByKey(e[r.current][0]);if(C!==null){if(c(C)){for(;C!==null&&c(C)&&r.current>0;){const g=i.getElementByKey(e[r.current-1][0]);g!==null&&(a(g)||c(g))&&r.current--,C=g}const L=e[r.current][0];o(L)}else if(a(C)){for(;C!==null&&a(C)&&r.current<e.length-1;){const g=i.getElementByKey(e[r.current+1][0]);g!==null&&(d(g)||a(g))&&r.current++,C=g}const L=e[r.current][0];o(L)}}}else r.current=0}let f;function y(C,L){clearTimeout(f),f=setTimeout(C,L)}function E(){y(u,10)}return document.addEventListener("scroll",E),()=>document.removeEventListener("scroll",E)},[e,i]),h.jsxs(ie,{sx:{position:"fixed",...$n(n),width:"220px",maxHeight:"300px",overflowY:"auto",overflowX:"hidden",zIndex:20,bg:"var(--bgColor-default)",border:"1px solid",borderColor:"var(--borderColor-default)",borderRadius:2,boxShadow:"var(--shadow-resting-small, 0 1px 1px 0 #1f23280f, 0 1px 3px 0 #1f23280f)",p:2},children:[h.jsxs(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[h.jsx(Ho,{sx:{fontSize:1,fontWeight:"bold",color:"var(--fgColor-default)"},children:"Table of Contents"}),h.jsx(ie,{as:"button",type:"button",onClick:t,"aria-label":"Close table of contents",title:"Close",sx:{appearance:"none",border:"1px solid",borderColor:"var(--borderColor-default)",borderRadius:1,bg:"var(--bgColor-default)",color:"var(--fgColor-default)",width:"24px",height:"24px",p:0,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer","&:hover":{bg:"var(--bgColor-muted)"}},children:h.jsx(hn,{size:12})})]}),h.jsx(Ct,{"aria-label":"Table of contents",children:e.map(([u,f,y],E)=>{const C=(""+f).length>27?f.substring(0,27)+"…":f;return h.jsx(Ct.Item,{as:"button",type:"button","aria-current":s===u?"location":void 0,onClick:()=>l(u,E),sx:{width:"100%",textAlign:"left",fontWeight:E===0?"bold":void 0,pl:E===0?void 0:ca(y)},children:C},u)})})]})}const da=({showByDefault:e=!1,collapsePosition:t="bottom-right"}={})=>{const[n,s]=m.useState(e);return h.jsx(la,{children:o=>n?h.jsx(ua,{tableOfContents:o,onClose:()=>s(!1),collapsePosition:t}):h.jsx(Fo,{text:"Open TOC",direction:"w",children:h.jsx(ie,{as:"button",type:"button",onClick:()=>s(!0),"aria-label":"Open table of contents",title:"Open TOC",sx:{position:"fixed",...$n(t),zIndex:20,width:"48px",height:"48px",borderRadius:"999px",border:"1px solid",borderColor:"var(--borderColor-default)",bg:"var(--overlay-bgColor)",color:"var(--fgColor-default)",boxShadow:"var(--shadow-resting-medium, 0 1px 1px 0 #25292e1a, 0 3px 6px 0 #25292e1f)",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer","&:hover":{bg:"var(--bgColor-muted)"}},children:h.jsx(zo,{size:16})})})})};function pa(e,t,n){const s=m.useRef(null);return s.current=e,m.useMemo(()=>As((...o)=>{s.current&&s.current(...o)},t,{maxWait:n}),[t,n])}const Mt=20;function fa({anchorElem:e}){const[t,{getTheme:n}]=M(),s=on(),[o,r]=m.useState(!1),[i,l]=m.useState(!1),[d,a]=m.useState(!1),[c,u]=m.useState({}),f=m.useRef(new Set),y=m.useRef(null),E=pa(g=>{const{isOutside:S,tableDOMNode:R}=ma(g,n);if(S){r(!1),l(!1);return}if(!R)return;y.current=R;let $=null,p=null,T=null;if(t.getEditorState().read(()=>{const v=Tt(R);if(Ze(v)){const x=le(v,k=>Ye(k));if(!Ye(x))return;if(T=$s(x,t.getElementByKey(x.getKey())),T){const k=x.getChildrenSize(),A=x.getChildAtIndex(0)?.getChildrenSize(),I=Rs(v),b=Is(v);I===k-1?$=v:b===A-1&&(p=v)}}},{editor:t}),T){const{width:v,y:x,right:k,left:A,bottom:I,height:b}=T.getBoundingClientRect(),N=T.parentElement;let _=!1;N&&N.classList.contains("JupyterLexicalTheme__tableScrollableWrapper")&&(_=N.scrollWidth>N.clientWidth);const{y:B,left:O}=e.getBoundingClientRect();if($){const w={height:Mt,left:_&&N?N.offsetLeft:A-O,top:I-B,width:_&&N?N.offsetWidth:v};l(!1),r(!0),u(w)}else if(p){const w={height:b,left:k-O,top:x-B,width:Mt};l(!0),r(!1),u(w)}}},50,250),C=m.useMemo(()=>new ResizeObserver(()=>{r(!1),l(!1)}),[]);m.useEffect(()=>{if(!d)return;const g=()=>{r(!1),l(!1)};return document.addEventListener("mousemove",E),document.addEventListener("scroll",g,!0),()=>{r(!1),l(!1),E.cancel(),document.removeEventListener("mousemove",E),document.removeEventListener("scroll",g,!0)}},[d,E]),m.useEffect(()=>ve(t.registerMutationListener(Jt,g=>{t.getEditorState().read(()=>{let S=!1;for(const[R,$]of g)switch($){case"created":{f.current.add(R),S=!0;break}case"destroyed":{f.current.delete(R),S=!0;break}}if(S){C.disconnect();for(const R of f.current){const{tableElement:$}=Ns(R);C.observe($)}a(f.current.size>0)}},{editor:t})},{skipInitialization:!1})),[t,C]);const L=g=>{t.update(()=>{y.current&&(Tt(y.current)?.selectEnd(),g?(Ps(),r(!1)):(Os(),l(!1)))})};return s?h.jsxs(h.Fragment,{children:[o&&h.jsx("button",{className:`${n()?.tableAddRows}`,style:{...c},onClick:()=>L(!0)}),i&&h.jsx("button",{className:`${n()?.tableAddColumns}`,style:{...c},onClick:()=>L(!1)})]}):null}function ma(e,t){const n=e.target,s=Fe(t,"tableCell");if(qo(n)){const o=n.closest(`td${s}, th${s}`);return{isOutside:!(o||n.closest(`button${Fe(t,"tableAddRows")}`)||n.closest(`button${Fe(t,"tableAddColumns")}`)||n.closest("div.TableCellResizer__resizer")),tableDOMNode:o}}else return{isOutside:!0,tableDOMNode:null}}function Ml({anchorElem:e=document.body}){return on()?gn.createPortal(h.jsx(fa,{anchorElem:e}),e):null}const Ae="JupyterLexicalTheme__tableScrollableWrapper",Dt="JupyterLexicalTheme__tableScrollRight",Bt="JupyterLexicalTheme__tableScrollLeft",jt="JupyterLexicalTheme__tableScrollMiddle";function Ne(e){const t=e.scrollWidth>e.clientWidth,n=e.scrollLeft+e.clientWidth>=e.scrollWidth-1,s=e.scrollLeft<=1;e.classList.remove(Dt),e.classList.remove(Bt),e.classList.remove(jt),t&&(!s&&!n?e.classList.add(jt):s&&!n?e.classList.add(Dt):!s&&n&&e.classList.add(Bt))}function Dl(){const[e]=M();return m.useEffect(()=>{const t=e.getRootElement();if(!t)return;const n=()=>{t.querySelectorAll(`.${Ae}`).forEach(Ne)};n();const s=new MutationObserver(()=>{n()});s.observe(t,{childList:!0,subtree:!0});const o=new ResizeObserver(()=>{n()}),r=new Map,i=a=>{if(r.has(a))return;const c=()=>{Ne(a)};a.addEventListener("scroll",c,{passive:!0}),r.set(a,c)};t.querySelectorAll(`.${Ae}`).forEach(a=>{o.observe(a),i(a)});const d=new MutationObserver(a=>{a.forEach(c=>{c.addedNodes.forEach(u=>{u instanceof HTMLElement&&(u.classList.contains(Ae)&&(o.observe(u),i(u),Ne(u)),u.querySelectorAll(`.${Ae}`).forEach(y=>{o.observe(y),i(y),Ne(y)}))})})});return d.observe(t,{childList:!0,subtree:!0}),()=>{s.disconnect(),o.disconnect(),d.disconnect(),r.forEach((a,c)=>{c.removeEventListener("scroll",a)}),r.clear()}},[e]),null}const Rn=Object.freeze({" ":"\\t","\n":"\\n"}),Ut=new RegExp(Object.keys(Rn).join("|"),"g"),J=Object.freeze({ancestorHasNextSibling:"|",ancestorIsLastChild:" ",hasNextSibling:"├",isLastChild:"└",selectedChar:"^",selectedLine:">"}),ga=[e=>e.hasFormat("bold")&&"Bold",e=>e.hasFormat("code")&&"Code",e=>e.hasFormat("italic")&&"Italic",e=>e.hasFormat("strikethrough")&&"Strikethrough",e=>e.hasFormat("subscript")&&"Subscript",e=>e.hasFormat("superscript")&&"Superscript",e=>e.hasFormat("underline")&&"Underline",e=>e.hasFormat("highlight")&&"Highlight"],ha=[e=>e.hasTextFormat("bold")&&"Bold",e=>e.hasTextFormat("code")&&"Code",e=>e.hasTextFormat("italic")&&"Italic",e=>e.hasTextFormat("strikethrough")&&"Strikethrough",e=>e.hasTextFormat("subscript")&&"Subscript",e=>e.hasTextFormat("superscript")&&"Superscript",e=>e.hasTextFormat("underline")&&"Underline",e=>e.hasTextFormat("highlight")&&"Highlight"],ba=[e=>e.isDirectionless()&&"Directionless",e=>e.isUnmergeable()&&"Unmergeable"],ya=[e=>e.isToken()&&"Token",e=>e.isSegmented()&&"Segmented"];function xa(e,t,n,s,o=!1){const r=e.getEditorState(),i=e._config,l=e._compositionKey,d=e._editable;if(n){let f="";return r.read(()=>{f=(function(y){const E=document.createElement("div");return E.innerHTML=y.trim(),In(E,0).innerHTML})(Wo(e))},{editor:e}),f}let a=` root
|
|
536
|
+
`;const c=r.read(()=>{const f=se();return st(ce(),(y,E,C)=>{const L=`(${y.getKey()})`,g=y.getType()||"",S=y.isSelected(),R=C!==void 0?`[slot: ${C}] `:"",$=(function(p,T){return T===void 0?"":z(p)&&p.isShadowRoot()?" [shadow-root]":Te(p)&&!p.isInline()?" [atomic decorator]":""})(y,C);a+=`${S?J.selectedLine:" "} ${E.join(" ")} ${L} ${R}${g}${$} ${(function(p,T,v=!1){const x=T?T(p,v):void 0;if(x!==void 0&&x.length>0)return x;if(j(p)){const k=p.getTextContent(),A=k.length===0?"(empty)":`"${Ft(k,v)}"`,I=(function(b){return[zt(b),Ta(b),Ea(b),Ht(b)].filter(Boolean).join(", ")})(p);return[A,I.length!==0?`{ ${I} }`:null].filter(Boolean).join(" ").trim()}if(Y(p)){const k=p.getURL(),A=k.length===0?"(empty)":`"${Ft(k,v)}"`,I=(function(b){return[Ca(b),va(b),wa(b),Ht(b)].filter(Boolean).join(", ")})(p);return[A,I.length!==0?`{ ${I} }`:null].filter(Boolean).join(" ").trim()}if(qt(p))return`ids: [ ${p.getIDs().join(", ")} ]`;if(ae(p)){const k=(function(I){let b=ha.map(N=>N(I)).filter(Boolean).join(", ").toLocaleLowerCase();return b!==""&&(b="format: "+b),b})(p);let A=k!==""?`{ ${k} }`:"";return A+=p.__style?`(${p.__style})`:"",A}return""})(y,s,o)}
|
|
537
|
+
`,a+=(function({indent:p,isSelected:T,node:v,nodeKeyDisplay:x,selection:k,typeDisplay:A}){if(!j(v)||!X(k)||!T||z(v))return"";const I=k.anchor,b=k.focus;if(v.getTextContent()===""||I.getNode()===k.focus.getNode()&&I.offset===b.offset)return"";const[N,_]=(function(P,D){const q=D.getStartEndPoints();if(pe(D)||q===null)return[-1,-1];const[Z,re]=q,je=P.getTextContent(),Ue=je.length;let he=-1,we=-1;if(Z.type==="text"&&re.type==="text"){const be=Z.getNode(),Se=re.getNode();be===Se&&P===be&&Z.offset!==re.offset?[he,we]=Z.offset<re.offset?[Z.offset,re.offset]:[re.offset,Z.offset]:[he,we]=P===be?be.isBefore(Se)?[Z.offset,Ue]:[0,Z.offset]:P===Se?Se.isBefore(be)?[re.offset,Ue]:[0,re.offset]:[0,Ue]}const ht=(je.slice(0,he).match(Ut)||[]).length,On=(je.slice(he,we).match(Ut)||[]).length;return[he+ht,we+ht+On]})(v,k);if(N===_)return"";const B=p[p.length-1]===J.hasNextSibling?J.ancestorHasNextSibling:J.ancestorIsLastChild,O=[...p.slice(0,p.length-1),B],w=Array(N+1).fill(" "),H=Array(_-N).fill(J.selectedChar),F=A.length+2,ue=Array(x.length+F).fill(" ");return[J.selectedLine,O.join(" "),[...ue,...w,...H].join("")].join(" ")+`
|
|
538
|
+
`})({indent:E,isSelected:S,node:y,nodeKeyDisplay:L,selection:f,typeDisplay:g})}),f===null?": null":X(f)?(function(y){let E="";const C=zt(y),L=(function(T){let v=T;for(;v!==null;){const x=Xo(v);if(x!==null){const k=Et(v);if(k!==null)return{host:k,name:x}}v=v.getParent()??Et(v)}return null})(y.anchor.getNode()),g=L!==null?` (in slot "${L.name}" of ${L.host.getType()} { key: ${L.host.getKey()} })`:"";E+=`: range${g} ${C!==""?`{ ${C} }`:""} ${y.style!==""?`{ style: ${y.style} } `:""}`;const S=y.anchor,R=y.focus,$=S.offset,p=R.offset;return E+=`
|
|
539
|
+
├ anchor { key: ${S.key}, offset: ${$===null?"null":$}, type: ${S.type} }`,E+=`
|
|
540
|
+
└ focus { key: ${R.key}, offset: ${p===null?"null":p}, type: ${R.type} }`,E})(f):Ms(f)?(function(y){return`: table
|
|
541
541
|
└ { table: ${y.tableKey}, anchorCell: ${y.anchor.key}, focusCell: ${y.focus.key} }`})(f):(function(y){return pe(y)?`: node
|
|
542
542
|
└ [${Array.from(y._nodes).join(", ")}]`:""})(f)},{editor:e});if(a+=`
|
|
543
543
|
selection`+c,a+=`
|
|
544
544
|
|
|
545
|
-
commands:`,t.length)for(const{index:f,type:y,payload:
|
|
546
|
-
└ ${f}. { type: ${y}, payload: ${
|
|
545
|
+
commands:`,t.length)for(const{index:f,type:y,payload:E}of t)a+=`
|
|
546
|
+
└ ${f}. { type: ${y}, payload: ${E instanceof Event?E.constructor.name:E} }`;else a+=`
|
|
547
547
|
└ None dispatched.`;const{version:u}=e.constructor;return a+=`
|
|
548
548
|
|
|
549
549
|
editor${u?` (v${u})`:""}:`,a+=`
|
|
550
550
|
└ namespace ${i.namespace}`,l!==null&&(a+=`
|
|
551
551
|
└ compositionKey ${l}`),a+=`
|
|
552
|
-
└ editable ${String(d)}`,a}function st(e,t,n=[]){const s=[];for(const l of Jo(e)){const d=Vo(e,l);d!==null&&s.push([l,d])}const o=z(e)?e.getChildren():[],r=s.length+o.length;let i=0;for(const[l,d]of s){const a=i===r-1;t(d,n.concat(a?J.isLastChild:J.hasNextSibling),l),(z(d)||
|
|
552
|
+
└ editable ${String(d)}`,a}function st(e,t,n=[]){const s=[];for(const l of Jo(e)){const d=Vo(e,l);d!==null&&s.push([l,d])}const o=z(e)?e.getChildren():[],r=s.length+o.length;let i=0;for(const[l,d]of s){const a=i===r-1;t(d,n.concat(a?J.isLastChild:J.hasNextSibling),l),(z(d)||Te(d))&&st(d,t,n.concat(a?J.ancestorIsLastChild:J.ancestorHasNextSibling)),i++}for(const l of o){const d=i===r-1;t(l,n.concat(d?J.isLastChild:J.hasNextSibling)),(z(l)||Te(l))&&st(l,t,n.concat(d?J.ancestorIsLastChild:J.ancestorHasNextSibling)),i++}}function Ft(e,t=!1){const n=Object.entries(Rn).reduce((s,[o,r])=>s.replace(new RegExp(o,"g"),String(r)),e);return t?n.replace(/[^\s]/g,"*"):n}function Ta(e){let t=ba.map(n=>n(e)).filter(Boolean).join(", ").toLocaleLowerCase();return t!==""&&(t="detail: "+t),t}function Ea(e){let t=ya.map(n=>n(e)).filter(Boolean).join(", ").toLocaleLowerCase();return t!==""&&(t="mode: "+t),t}function zt(e){let t=ga.map(n=>n(e)).filter(Boolean).join(", ").toLocaleLowerCase();return t!==""&&(t="format: "+t),t}function Ca(e){let t=e.getTarget();return t!=null&&(t="target: "+t),t}function va(e){let t=e.getRel();return t!=null&&(t="rel: "+t),t}function wa(e){let t=e.getTitle();return t!=null&&(t="title: "+t),t}function Ht(e){if(!e.__state)return!1;const t=[];for(const[s,o]of e.__state.knownState.entries()){if(s.isEqual(o,s.defaultValue))continue;const r=JSON.stringify(s.unparse(o));t.push(`[${s.key}: ${r}]`)}let n=t.join(",");return n!==""&&(n="state: "+n),n}function In(e,t){const n=new Array(1+t++).join(" "),s=new Array(t-1).join(" ");let o;for(let r=0;r<e.children.length;r++)o=document.createTextNode(`
|
|
553
553
|
`+n),e.insertBefore(o,e.children[r]),In(e.children[r],t),e.lastElementChild===e.children[r]&&(o=document.createTextNode(`
|
|
554
|
-
`+s),e.appendChild(o));return e}const Sa=m.forwardRef(function({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:s,viewClassName:o,timeTravelPanelClassName:r,editorState:i,setEditorState:l,setEditorReadOnly:d,generateContent:a,commandsLog:c=[]},u){const[f,y]=m.useState([]),[
|
|
554
|
+
`+s),e.appendChild(o));return e}const Sa=m.forwardRef(function({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:s,viewClassName:o,timeTravelPanelClassName:r,editorState:i,setEditorState:l,setEditorReadOnly:d,generateContent:a,commandsLog:c=[]},u){const[f,y]=m.useState([]),[E,C]=m.useState(""),[L,g]=m.useState(!1),[S,R]=m.useState(!1),$=m.useRef(0),p=m.useRef(null),[T,v]=m.useState(!1),[x,k]=m.useState(!1),[A,I]=m.useState(!1),b=m.useRef(null),N=m.useRef([]),_=m.useRef(0),B=m.useCallback(w=>{const H=++_.current;a(w).then(F=>{H===_.current&&C(F)}).catch(F=>{H===_.current&&C(`Error rendering tree: ${F.message}
|
|
555
555
|
|
|
556
556
|
Stack:
|
|
557
|
-
${F.stack}`)})},[a]);m.useEffect(()=>{if(!(!A&&i._nodeMap.size>1e3&&(k(!0),!A))&&(b.current!==i||N.current!==c)){const w=b.current!==i;b.current=i,N.current=c,B(S),!L&&w&&y(H=>[...H,[Date.now(),i]])}},[i,B,S,A,L,c]);const O=f.length;return m.useEffect(()=>{if(E){let w;const H=()=>{const F=$.current;if(F===O-1)return void v(!1);const ue=f[F][0],P=f[F+1][0];w=setTimeout(()=>{$.current++;const D=$.current,q=p.current;q!==null&&(q.value=String(D)),l(f[D][1]),H()},P-ue)};return H(),()=>{clearTimeout(w)}}},[f,E,O,l]),h.jsxs("div",{className:o,children:[!A&&x?h.jsxs("div",{style:{padding:20},children:[h.jsx("span",{style:{marginRight:20},children:"Detected large EditorState, this can impact debugging performance."}),h.jsx("button",{onClick:()=>{I(!0)},style:{background:"transparent",border:"1px solid white",color:"white",cursor:"pointer",padding:5},children:"Show full tree"})]}):null,A?null:h.jsx("button",{onClick:()=>(B(!S),void R(!S)),className:e,type:"button",children:S?"Tree":"Export DOM"}),!L&&(A||!x)&&O>2&&h.jsx("button",{onClick:()=>{d(!0),$.current=O-1,g(!0)},className:t,type:"button",children:"Time Travel"}),(A||!x)&&h.jsx("pre",{ref:u,children:T}),L&&(A||!x)&&h.jsxs("div",{className:r,children:[h.jsx("button",{className:s,onClick:()=>{$.current===O-1&&($.current=1),v(!E)},type:"button",children:E?"Pause":"Play"}),h.jsx("input",{className:n,ref:p,onChange:w=>{const H=Number(w.target.value),F=f[H];F&&($.current=H,l(F[1]))},type:"range",min:"1",max:O-1}),h.jsx("button",{className:s,onClick:()=>{d(!1);const w=f.length-1,H=f[w];l(H[1]);const F=p.current;F!==null&&(F.value=String(w)),g(!1),v(!1)},type:"button",children:"Exit"})]})]})});function La(e,t){const n=[];let s=0;for(const o of e._commands.keys())n.push(e.registerCommand(o,r=>{s+=1;const i={index:s,payload:r,type:o.type?o.type:"UNKNOWN"};return t(l=>[...l.slice(-9),i]),!1},mn));return()=>n.forEach(o=>o())}function _a(e){const[t,n]=m.useState([]);return m.useEffect(()=>La(e,n),[e]),t}function ka({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:s,timeTravelPanelClassName:o,viewClassName:r,editor:i,customPrintNode:l}){const d=m.createRef(),[a,c]=m.useState(i.getEditorState()),u=_a(i);return m.useEffect(()=>ve(i.registerUpdateListener(({editorState:f})=>{c(f)}),i.registerEditableListener(()=>{c(i.getEditorState())})),[i]),m.useEffect(()=>{const f=d.current;if(f!==null)return f.__lexicalEditor=i,()=>{f.__lexicalEditor=null}},[i,d]),h.jsx(Sa,{treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:s,viewClassName:r,timeTravelPanelClassName:o,setEditorReadOnly:f=>{const y=i.getRootElement();y!=null&&(y.contentEditable=f?"false":"true")},editorState:a,setEditorState:f=>i.setEditorState(f),generateContent:async function(f){return xa(i,u,f,l)},ref:d,commandsLog:u})}function Aa(){const[e]=M();return h.jsx(ka,{viewClassName:"tree-view-output",treeTypeButtonClassName:"debug-treetype-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",editor:e})}const Bl=({publicAppId:e})=>{const[t]=M();return m.useEffect(()=>Ds(t),[t]),m.useEffect(()=>Bs(t,e),[t,e]),null},jl=()=>{const[e]=M();return m.useEffect(()=>js(e),[e]),null},Ul=()=>{const[e]=M();return m.useEffect(()=>Us(e),[e]),null};function Fl(e){const[t]=M();return m.useEffect(()=>an(t,e),[t,e]),null}function zl(e){const[t]=M();return m.useEffect(()=>rn(t,e),[t,e]),null}function Hl(e){const[t]=M();return m.useEffect(()=>ln(t,e),[t,e]),null}function ql(e){const[t]=M();return m.useEffect(()=>cn(t,e),[t,e]),null}function Wl(){const[e]=M();return m.useEffect(()=>{const t=[an(e),rn(e),ln(e),cn(e)];return()=>t.forEach(n=>n())},[e]),null}const Na="Jupyter Lexical Example",Pn="Code and analyse data.";function $a(e,t=[]){return Zo({name:"@datalayer/jupyter-lexical/Editor",namespace:Na,theme:so,dependencies:[no,Ko,...t],$initialEditorState:e})}const Ra=({runtimeEnabled:e,onSessionConnection:t})=>{const{defaultKernel:n}=er({startDefaultKernel:e}),s=$t(oo),o=$t(ro);return h.jsxs(h.Fragment,{children:[e&&h.jsx(s,{kernel:n,onSessionConnection:t}),h.jsx(o,{kernel:n})]})};function Ia(){return h.jsx("div",{className:"editor-placeholder",children:Pn})}const Pa=()=>{const{setEditor:e}=ur(),[t]=M();return m.useEffect(()=>{e(t)},[t,e]),null};function Oa(e){const{id:t,notebook:n,onSessionConnection:s,collaboration:o,runtimeEnabled:r=!0}=e,[i]=M(),[l,d]=m.useState(i),[a,c]=m.useState(!1),[u,f]=m.useState(null),y=o?.id,[T,C]=m.useState(),L=y===void 0||T===y,g=o?.onInitialization,S=m.useCallback($=>{C($?y:void 0),g?.($)},[y,g]),R=$=>{$!==null&&f($)};return h.jsxs("div",{className:"editor-container",children:[h.jsx(qs,{editor:i,activeEditor:l,setActiveEditor:d,setIsLinkEditMode:c}),h.jsxs("div",{className:"editor-inner",children:[o&&h.jsx(Ws,{id:o.id,shouldBootstrap:!0,showCollaborators:!0,username:o.username,cursorColor:o.cursorColor,initialEditorState:o.initialEditorState,awarenessData:o.awarenessData,providerFactory:o.providerFactory??Xs,websocketUrl:o.websocketUrl,onIdentityResolved:o.onIdentityResolved,onInitialization:S}),L?h.jsx("div",{className:"editor-scroller",children:h.jsx("div",{className:"editor",ref:R,children:h.jsx(Go,{className:"editor-input",placeholder:h.jsx(Ia,{}),"aria-placeholder":Pn})})}):h.jsx(Js,{maxWidth:"100%"}),h.jsx(Aa,{}),t&&h.jsx(Vs,{}),h.jsx(Ys,{}),h.jsx(Gs,{}),h.jsx(Zs,{}),h.jsx(Ra,{runtimeEnabled:r,onSessionConnection:s}),h.jsx(oa,{notebook:n}),h.jsx(Ks,{}),h.jsx(Pa,{}),h.jsx(da,{}),h.jsx(Qs,{providerFactory:void 0}),u&&h.jsxs(h.Fragment,{children:[h.jsx(eo,{anchorElem:u}),h.jsx(Ki,{anchorElem:u,isLinkEditMode:a,setIsLinkEditMode:c}),h.jsx(to,{anchorElem:u,setIsLinkEditMode:c})]})]})]})}function Xl(e){const{id:t,serviceManager:n,collaboration:s,initialEditorState:o,extensions:r}=e,i=m.useMemo(()=>$a(s?void 0:o,r),[s,o,r]),l=h.jsx(Yo,{extension:i,contentEditable:null,children:h.jsx(Fs,{children:h.jsx(zs,{children:h.jsx("div",{className:"editor-shell",children:h.jsx(Oa,{...e})})})})});return t?h.jsx(Hs,{lexicalId:t,serviceManager:n,children:l}):l}export{Cc as $blockOf,vc as $blocksOf,$e as $columnOf,Me as $columnsOf,yl as $convertFromLatexString,hl as $convertToLatexString,rs as $createCollapsibleContainerNode,as as $createCollapsibleContentNode,is as $createCollapsibleTitleNode,wc as $createCommentThreadNode,Sc as $createCounterNode,Lc as $createDeckNode,tn as $createEquationNode,_c as $createExcalidrawNode,kc as $createExecutionTreeNode,Qt as $createImageNode,Ac as $createInlineCompletionNode,Nc as $createJupyterCellNode,bs as $createJupyterInputHighlightNode,Zn as $createJupyterInputNode,$c as $createJupyterOutputNode,Gn as $createLayoutContainerNode,Yn as $createLayoutItemNode,Rc as $createLoomNode,Ic as $createVideoNode,ss as $createYouTubeNode,bl as $importLatex,Pc as $inlinesOf,Oc as $inlinesOfNodes,ls as $isCollapsibleContainerNode,Mc as $isCollapsibleContentNode,Dc as $isCollapsibleTitleNode,Bc as $isCommentThreadNode,jc as $isCounterNode,Uc as $isDeckNode,Fc as $isEmptyLayoutItemNode,Ie as $isEquationNode,zc as $isExcalidrawNode,Hc as $isExecutionTreeNode,en as $isImageNode,ys as $isInlineCompletionNode,qc as $isJupyterCellNode,Wc as $isJupyterInputHighlightNode,Be as $isJupyterInputNode,Ve as $isJupyterOutputNode,os as $isLayoutContainerNode,Pe as $isLayoutItemNode,ds as $isLoomNode,Xc as $isVideoNode,nn as $isYouTubeNode,Jc as $jupyterInputNodeFor,Vc as $jupyterOutputNodeFor,Yc as $readDocument,kn as $splitBlocks,Gr as $titleBlock,Es as AUTO_LINK_MATCHERS,pl as ApiCommentStore,Gc as AutoEmbedDialog,Zc as AutoEmbedExtension,Kc as AutoEmbedPlugin,nr as AutoIndentEngine,Cl as AutoIndentPlugin,Qc as AutoLinkExtension,vl as AutoLinkPlugin,eu as Button,tu as CAN_USE_DOM,mr as CHAPTER_CLASSES,nu as CLEAR_ALL_OUTPUTS_COMMAND,su as CODE_LANGUAGE_FRIENDLY_NAME_MAP,ou as CODE_LANGUAGE_MAP,Ks as CodeActionMenuPlugin,ru as CodeBlockHighlightExtension,kl as CodeBlockHighlightPlugin,Gt as CollapsibleContainerNode,iu as CollapsibleContentNode,au as CollapsibleExtension,Mm as CollapsiblePlugin,lu as CollapsibleTitleNode,cu as CommentAuthorAvatar,uu as CommentExtension,du as CommentPeopleContext,Qs as CommentPlugin,pu as CommentStore,fu as CommentThreadNode,Fs as CommentsProvider,ro as ComponentPickerMenuExtension,mu as ComponentPickerMenuPlugin,gu as CounterNode,hu as DEFAULT_CODE_LANGUAGE,bu as DEFAULT_CONFIG,yu as DEFAULT_FONT_SIZE,xu as DEFAULT_INITIAL_OUTPUTS,Ls as DEFAULT_LIST_MAX_INDENT_LEVEL,Eu as DEFAULT_TYPST_MODULE_URL,Tu as DEFAULT_TYPST_WASM_URL,Cu as DeckExtension,vu as DeckNode,Ul as DeckPlugin,Yl as DefaultExecutor,Js as DocumentSkeleton,eo as DraggableBlockPlugin,Na as EDITOR_NAMESPACE,wu as EXPORT_PDF_DOCUMENT_COMMAND,Su as EXPORT_PDF_SNAPSHOT_COMMAND,Lu as EXPORT_PDF_TYPESET_COMMAND,Xl as Editor,Oa as EditorContainer,_u as EmbedConfigs,ku as EmbedHandlersContext,Yt as EquationNode,Au as EquationsExtension,Nu as EquationsPlugin,$u as ExcalidrawExtension,Ru as ExcalidrawNode,Iu as ExcalidrawPlugin,Pu as ExecutionTreeExtension,Ou as ExecutionTreeNode,Mu as FileInput,Ki as FloatingLinkEditorPlugin,to as FloatingTextFormatToolbarPlugin,Du as HorizontalRuleExtension,Al as HorizontalRulePlugin,Bu as INPUT_UUID_TO_CODE_KEY,ju as INPUT_UUID_TO_OUTPUT_KEY,Uu as INPUT_UUID_TO_OUTPUT_UUID,Fu as INSERT_COLLAPSIBLE_COMMAND,zu as INSERT_DECK_COMMAND,Hu as INSERT_EQUATION_COMMAND,qu as INSERT_EXCALIDRAW_COMMAND,Wu as INSERT_EXECUTION_TREE_COMMAND,Xu as INSERT_IMAGE_COMMAND,Ju as INSERT_INLINE_COMMAND,Vu as INSERT_JUPYTER_CELL_COMMAND,hs as INSERT_JUPYTER_INPUT_OUTPUT_COMMAND,Yu as INSERT_LAYOUT_COMMAND,Gu as INSERT_LOOM_COMMAND,Zu as INSERT_MARIMO_CELL_COMMAND,Ku as INSERT_TABLE_WITH_DIALOG_COMMAND,Qu as INSERT_VIDEO_COMMAND,ed as INSERT_YOUTUBE_COMMAND,Vt as ImageNode,td as ImageResizer,nd as ImagesExtension,sd as ImagesPlugin,od as InlineCompletionExtension,rd as InlineCompletionNode,id as InsertEquationDialog,ad as InsertImageDialog,ld as InsertImageUploadedDialogBody,cd as InsertImageUriDialogBody,ud as JupyterCellExtension,dd as JupyterCellNode,Nl as JupyterCellPlugin,pd as JupyterInputHighlightNode,jn as JupyterInputNode,oo as JupyterInputOutputExtension,fd as JupyterInputOutputPlugin,no as JupyterLexicalExtension,Un as JupyterOutputNode,md as KatexEquationAlterer,ci as LATEX_ALGORITHM,ni as LATEX_BIBLIOGRAPHY,ri as LATEX_BLOCK,jr as LATEX_BOLD,Lr as LATEX_CODE,Br as LATEX_CODE_FORMAT,Dr as LATEX_COLLAPSIBLE,Qr as LATEX_COLUMNS,li as LATEX_CV,Or as LATEX_DISPLAY_EQUATION,ui as LATEX_ELEMENT_TRANSFORMERS,Pr as LATEX_FIGURE,Ir as LATEX_FLOAT,si as LATEX_FRAME,oi as LATEX_FRAME_TITLE,Cr as LATEX_HEADING,Wr as LATEX_HIGHLIGHT,Ar as LATEX_HORIZONTAL_RULE,Jr as LATEX_IMAGE,Xr as LATEX_INLINE_EQUATION,Ur as LATEX_ITALIC,_r as LATEX_JUPYTER_INPUT,kr as LATEX_JUPYTER_OUTPUT,ii as LATEX_LETTER,ai as LATEX_LETTER_LINES,Vr as LATEX_LINK,Sr as LATEX_LIST,Zr as LATEX_META,fi as LATEX_PREAMBLE_PACKAGES,vr as LATEX_QUOTE,zr as LATEX_STRIKETHROUGH,qr as LATEX_SUBSCRIPT,Hr as LATEX_SUPERSCRIPT,Rr as LATEX_TABLE,Ii as LATEX_TEMPLATES,xl as LATEX_TEMPLATE_CATEGORIES,di as LATEX_TEXT_FORMAT_TRANSFORMERS,pi as LATEX_TEXT_MATCH_TRANSFORMERS,ti as LATEX_THEOREM,Kr as LATEX_TITLE,ge as LATEX_TRANSFORMERS,Fr as LATEX_UNDERLINE,Mr as LATEX_YOUTUBE,gd as LOOM_EXTENSION_NAME,Pt as LSPCompletionItemKind,Il as LSPDocumentSyncPlugin,hd as LSPTabCompletionPlugin,bd as LSP_COMPLETION_INSERTED_COMMAND,yd as LSP_MENU_STATE_COMMAND,rr as LanguageIndentRegistry,Xn as LayoutContainerNode,xd as LayoutExtension,Jn as LayoutItemNode,$l as LayoutPlugin,Ed as LexicalAdapter,Hs as LexicalConfigProvider,Td as LexicalContentEditable,fl as LexicalContextConsumer,dr as LexicalContextProvider,Cd as LexicalInlineCompletionPlugin,Rl as LexicalLSPCompletionProvider,gl as LexicalPrimerThemeProvider,ml as LexicalProvider,vd as LexicalStateExtension,Vs as LexicalStatePlugin,wd as ListMaxIndentLevelExtension,Pl as ListMaxIndentLevelPlugin,Sd as LoomEmbedConfig,Ld as LoomExtension,_d as LoomNode,Bl as LoomPlugin,kd as MAX_ALLOWED_FONT_SIZE,Ad as MIN_ALLOWED_FONT_SIZE,Ol as MarkdownPlugin,Nd as MarkdownShortcutsExtension,$d as MentionsPlugin,Rd as Modal,Oi as NBFORMAT_METADATA,oa as NbformatContentPlugin,Id as OUTPUT_UUID_TO_CODE_UUID,Pd as OUTPUT_UUID_TO_OUTPUT_KEY,Od as OrchestrationRenderersContext,Md as PAGE_SIZES,Dd as PDF_FONTS,Bd as PEOPLE_SEARCH_PAUSE_MS,jd as PRINT_CSS,Ud as PRINT_PDF_COMMAND,Fd as PdfDocumentExtension,zl as PdfDocumentPlugin,zd as PdfExportExtension,Wl as PdfExportPlugin,Hd as PdfPage,qd as PdfPrintExtension,Fl as PdfPrintPlugin,Wd as PdfSnapshotExtension,Hl as PdfSnapshotPlugin,Xd as PdfTypesetExtension,ql as PdfTypesetPlugin,Jd as PdfWriter,Vd as Placeholder,Yd as Point,Gd as PrettierButton,Zd as RESTART_JUPYTER_KERNEL_COMMAND,Kd as RUN_ALL_JUPYTER_CELLS_COMMAND,Qd as RUN_JUPYTER_CELL_COMMAND,ep as Rect,tp as SettingsContext,np as TRIGGER_INLINE_COMPLETION_COMMAND,sp as TYPST_TS_VERSION,Gs as TableActionMenuPlugin,Ys as TableCellResizerPlugin,op as TableExtension,Ml as TableHoverActionsPlugin,Zs as TableHoverActionsV2Plugin,rp as TableInsertDialogPlugin,da as TableOfContentsPlugin,ip as TablePlugin,Dl as TableScrollShadowPlugin,ap as TextInput,tr as ThemeContext,lp as ThreadAssignee,zs as ToolbarContext,qs as ToolbarPlugin,Aa as TreeViewPlugin,cp as VideoExtension,up as VideoNode,jl as VideoPlugin,dp as YouTubeExtension,Wn as YouTubeNode,Fm as YouTubePlugin,pp as YoutubeEmbedConfig,Bn as anonymousAuthor,Dn as authorLabel,fp as authorOf,mp as blockTypeToBlockName,gp as buildPrintHtml,hp as bytesToObjectUrl,bp as canBePrettier,yp as canRaster,xp as canRecordVideo,Ep as canvasElementToRaster,Tp as canvasToJpeg,Cp as canvasToPng,ji as cellSource,vp as charWidth,wp as cloneEditorDom,Sp as collectPictures,Lp as columnWeights,Yr as columnsTemplate,so as commentTheme,_p as countPdfPages,kp as createComment,$a as createEditorExtension,yi as createLatexExport,$i as createLatexImport,Nn as createLatexImporter,Ap as createThread,Np as dataUrlToBytes,Gl as deleteBlocksOperation,Zl as deleteBlocksTool,$p as describeLoomVideo,Rp as describeScene,Ip as discardVideoRecording,Pp as documentToPdf,Op as downloadBytes,Mp as elementSkeletonSchema,Dp as elementToRaster,Li as emptyDocumentInfo,Bp as emptyScene,jp as encodeWinAnsi,Up as equalColumnsTemplate,Fp as equationToRaster,K as escapeLatex,zp as escapeTypst,Hp as excalidrawAddElementsParamsSchema,qp as excalidrawClearSceneParamsSchema,Wp as excalidrawConnectElementsParamsSchema,Xp as excalidrawDeleteElementsParamsSchema,Jp as excalidrawFromMermaidParamsSchema,Vp as excalidrawInsertNodeParamsSchema,Yp as excalidrawListDrawingsParamsSchema,Gp as excalidrawPluginTools,Zp as excalidrawReadSceneParamsSchema,Kp as excalidrawResizeParamsSchema,Qp as excalidrawSetAppStateParamsSchema,ef as excalidrawToolDefinitions,tf as excalidrawToolHandlers,nf as excalidrawToolMismatches,sf as excalidrawToolOperations,of as excalidrawUpdateElementsParamsSchema,Kl as executeCodeOperation,Ql as executeCodeTool,ki as expandMacros,rf as explainLoomFailure,af as explainVideoFailure,lf as exportLexicalToPdf,cf as exportPdfDocument,uf as exportPdfSnapshot,df as exportPdfTypeset,El as findLatexTemplate,pf as flattenToInlines,ff as fontFor,mf as getCodeLanguages,wl as getDOMRangeRect,gf as getDefaultCodeLanguage,hf as getEndOfJupyterInputInLine,bf as getFirstJupyterInputHighlightNodeOfLine,yf as getItemsCountFromTemplate,xf as getLanguageFriendlyName,Ef as getLastJupyterInputHighlightNodeOfLine,ec as getLexicalTools,Oe as getSelectedNode,Ll as getSelection,Tf as getStartOfCodeInLine,Cn as hasChapters,Cf as imageToRaster,vf as inlineSvgOf,wf as inlineText,tc as insertBlockOperation,nc as insertBlockTool,Sf as isDisabled,Lf as isHTMLElement,_f as isPoint,kf as isTypstEngine,Af as isValidContextScope,bn as javascriptIndentConfig,Sl as joinClasses,An as latexTransformersByType,sc as lexicalStore,Tl as lexicalToNbformat,Nf as lexicalToTypst,oc as lexicalToolDefinitions,rc as lexicalToolOperations,ic as lexicalTools,ac as listAvailableBlocksOperation,lc as listAvailableBlocksTool,$f as liveElements,Rf as loadHtml2Canvas,If as loadTypstEngine,fs as loomEmbedUrl,Pf as loomPublicAppIdOf,Of as loomRecorder,Mf as loomShareUrl,ps as loomVideoId,Df as mathToSvg,Bf as mentionsIn,jf as mergeConfig,Ui as nbformatToLexical,Uf as newDeckSpec,Ff as newVideoRecordingId,zf as normalizeCodeLang,_i as parseMacros,Ai as parsePreamble,Hf as parseScene,qf as pdfFilename,Wf as personLabel,Xf as pickVideoMimeType,Jf as printEditorToPdf,Vf as printPdf,sr as pythonIndentConfig,cc as readAllBlocksOperation,uc as readAllBlocksTool,dc as readBlockOperation,pc as readBlockTool,Yf as readDocument,Ts as registerCodeBlockHighlight,Gf as registerCodeHighlighting,Zf as registerCollapsible,Us as registerDeck,Kf as registerEquations,Qf as registerExecutionTree,Cs as registerHorizontalRule,em as registerImages,vs as registerJupyterCell,ws as registerLayout,tm as registerLexicalState,Ss as registerListMaxIndentLevel,Ds as registerLoom,rn as registerPdfDocument,an as registerPdfPrint,ln as registerPdfSnapshot,cn as registerPdfTypeset,js as registerVideo,nm as registerYouTube,fc as runAllBlocksOperation,mc as runAllBlocksTool,gc as runBlockOperation,hc as runBlockTool,bt as sanitizeUrl,sm as scaleCanvas,om as serializeScene,_l as setFloatingElemPosition,Xe as setFloatingElemPositionForLinkEditor,Bs as setLoomPublicAppId,rm as shouldAutoTrigger,im as shouldManualTrigger,am as snapshotEditorToPdf,fr as splitDocument,lm as startVideoRecording,cm as stopVideoRecording,um as subscribeVideoRecordings,dm as summarizeElement,pm as supportedTransformers,fm as svgForTypst,mm as svgToRaster,gm as textWidth,cr as threadsOf,Si as todayForLatex,hm as touchElement,or as typescriptIndentConfig,bm as typesetToPdf,bc as updateBlockOperation,yc as updateBlockTool,ym as useCommentStore,xm as useComments,Em as useDebounce,Bm as useDomColormode,Tm as useEmbedHandlers,Cm as useLayoutEffectImpl,ur as useLexical,vm as useLexicalConfig,xc as useLexicalStore,Ec as useLexicalToolBundle,wm as useModal,Sm as useOptionalLexicalConfig,Lm as useOrchestrationRenderers,_m as usePeopleSearch,km as useSettings,jm as useTheme,Am as useToolbarState,Nm as validateUrl,$m as videoBlockStatus,Rm as videoFileName,Im as videoRecordingOf,Pm as withBoundText};
|
|
557
|
+
${F.stack}`)})},[a]);m.useEffect(()=>{if(!(!A&&i._nodeMap.size>1e3&&(k(!0),!A))&&(b.current!==i||N.current!==c)){const w=b.current!==i;b.current=i,N.current=c,B(S),!L&&w&&y(H=>[...H,[Date.now(),i]])}},[i,B,S,A,L,c]);const O=f.length;return m.useEffect(()=>{if(T){let w;const H=()=>{const F=$.current;if(F===O-1)return void v(!1);const ue=f[F][0],P=f[F+1][0];w=setTimeout(()=>{$.current++;const D=$.current,q=p.current;q!==null&&(q.value=String(D)),l(f[D][1]),H()},P-ue)};return H(),()=>{clearTimeout(w)}}},[f,T,O,l]),h.jsxs("div",{className:o,children:[!A&&x?h.jsxs("div",{style:{padding:20},children:[h.jsx("span",{style:{marginRight:20},children:"Detected large EditorState, this can impact debugging performance."}),h.jsx("button",{onClick:()=>{I(!0)},style:{background:"transparent",border:"1px solid white",color:"white",cursor:"pointer",padding:5},children:"Show full tree"})]}):null,A?null:h.jsx("button",{onClick:()=>(B(!S),void R(!S)),className:e,type:"button",children:S?"Tree":"Export DOM"}),!L&&(A||!x)&&O>2&&h.jsx("button",{onClick:()=>{d(!0),$.current=O-1,g(!0)},className:t,type:"button",children:"Time Travel"}),(A||!x)&&h.jsx("pre",{ref:u,children:E}),L&&(A||!x)&&h.jsxs("div",{className:r,children:[h.jsx("button",{className:s,onClick:()=>{$.current===O-1&&($.current=1),v(!T)},type:"button",children:T?"Pause":"Play"}),h.jsx("input",{className:n,ref:p,onChange:w=>{const H=Number(w.target.value),F=f[H];F&&($.current=H,l(F[1]))},type:"range",min:"1",max:O-1}),h.jsx("button",{className:s,onClick:()=>{d(!1);const w=f.length-1,H=f[w];l(H[1]);const F=p.current;F!==null&&(F.value=String(w)),g(!1),v(!1)},type:"button",children:"Exit"})]})]})});function La(e,t){const n=[];let s=0;for(const o of e._commands.keys())n.push(e.registerCommand(o,r=>{s+=1;const i={index:s,payload:r,type:o.type?o.type:"UNKNOWN"};return t(l=>[...l.slice(-9),i]),!1},mn));return()=>n.forEach(o=>o())}function _a(e){const[t,n]=m.useState([]);return m.useEffect(()=>La(e,n),[e]),t}function ka({treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:s,timeTravelPanelClassName:o,viewClassName:r,editor:i,customPrintNode:l}){const d=m.createRef(),[a,c]=m.useState(i.getEditorState()),u=_a(i);return m.useEffect(()=>ve(i.registerUpdateListener(({editorState:f})=>{c(f)}),i.registerEditableListener(()=>{c(i.getEditorState())})),[i]),m.useEffect(()=>{const f=d.current;if(f!==null)return f.__lexicalEditor=i,()=>{f.__lexicalEditor=null}},[i,d]),h.jsx(Sa,{treeTypeButtonClassName:e,timeTravelButtonClassName:t,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:s,viewClassName:r,timeTravelPanelClassName:o,setEditorReadOnly:f=>{const y=i.getRootElement();y!=null&&(y.contentEditable=f?"false":"true")},editorState:a,setEditorState:f=>i.setEditorState(f),generateContent:async function(f){return xa(i,u,f,l)},ref:d,commandsLog:u})}function Aa(){const[e]=M();return h.jsx(ka,{viewClassName:"tree-view-output",treeTypeButtonClassName:"debug-treetype-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",editor:e})}const Bl=({publicAppId:e})=>{const[t]=M();return m.useEffect(()=>Ds(t),[t]),m.useEffect(()=>Bs(t,e),[t,e]),null},jl=()=>{const[e]=M();return m.useEffect(()=>js(e),[e]),null},Ul=()=>{const[e]=M();return m.useEffect(()=>Us(e),[e]),null};function Fl(e){const[t]=M();return m.useEffect(()=>an(t,e),[t,e]),null}function zl(e){const[t]=M();return m.useEffect(()=>rn(t,e),[t,e]),null}function Hl(e){const[t]=M();return m.useEffect(()=>ln(t,e),[t,e]),null}function ql(e){const[t]=M();return m.useEffect(()=>cn(t,e),[t,e]),null}function Wl(){const[e]=M();return m.useEffect(()=>{const t=[an(e),rn(e),ln(e),cn(e)];return()=>t.forEach(n=>n())},[e]),null}const Na="Jupyter Lexical Example",Pn="Code and analyse data.";function $a(e,t=[]){return Zo({name:"@datalayer/jupyter-lexical/Editor",namespace:Na,theme:so,dependencies:[no,Ko,...t],$initialEditorState:e})}const Ra=({runtimeEnabled:e,onSessionConnection:t})=>{const{defaultKernel:n}=er({startDefaultKernel:e}),s=$t(oo),o=$t(ro);return h.jsxs(h.Fragment,{children:[e&&h.jsx(s,{kernel:n,onSessionConnection:t}),h.jsx(o,{kernel:n})]})};function Ia(){return h.jsx("div",{className:"editor-placeholder",children:Pn})}const Pa=()=>{const{setEditor:e}=ur(),[t]=M();return m.useEffect(()=>{e(t)},[t,e]),null};function Oa(e){const{id:t,notebook:n,onSessionConnection:s,collaboration:o,runtimeEnabled:r=!0}=e,[i]=M(),[l,d]=m.useState(i),[a,c]=m.useState(!1),[u,f]=m.useState(null),y=o?.id,[E,C]=m.useState(),L=y===void 0||E===y,g=o?.onInitialization,S=m.useCallback($=>{C($?y:void 0),g?.($)},[y,g]),R=$=>{$!==null&&f($)};return h.jsxs("div",{className:"editor-container",children:[h.jsx(qs,{editor:i,activeEditor:l,setActiveEditor:d,setIsLinkEditMode:c}),h.jsxs("div",{className:"editor-inner",children:[o&&h.jsx(Ws,{id:o.id,shouldBootstrap:!0,showCollaborators:!0,username:o.username,cursorColor:o.cursorColor,initialEditorState:o.initialEditorState,awarenessData:o.awarenessData,providerFactory:o.providerFactory??Xs,websocketUrl:o.websocketUrl,onIdentityResolved:o.onIdentityResolved,onInitialization:S}),L?h.jsx("div",{className:"editor-scroller",children:h.jsx("div",{className:"editor",ref:R,children:h.jsx(Go,{className:"editor-input",placeholder:h.jsx(Ia,{}),"aria-placeholder":Pn})})}):h.jsx(Js,{maxWidth:"100%"}),h.jsx(Aa,{}),t&&h.jsx(Vs,{}),h.jsx(Ys,{}),h.jsx(Gs,{}),h.jsx(Zs,{}),h.jsx(Ra,{runtimeEnabled:r,onSessionConnection:s}),h.jsx(oa,{notebook:n}),h.jsx(Ks,{}),h.jsx(Pa,{}),h.jsx(da,{}),h.jsx(Qs,{providerFactory:void 0}),u&&h.jsxs(h.Fragment,{children:[h.jsx(eo,{anchorElem:u}),h.jsx(Ki,{anchorElem:u,isLinkEditMode:a,setIsLinkEditMode:c}),h.jsx(to,{anchorElem:u,setIsLinkEditMode:c})]})]})]})}function Xl(e){const{id:t,serviceManager:n,collaboration:s,initialEditorState:o,extensions:r}=e,i=m.useMemo(()=>$a(s?void 0:o,r),[s,o,r]),l=h.jsx(Yo,{extension:i,contentEditable:null,children:h.jsx(Fs,{children:h.jsx(zs,{children:h.jsx("div",{className:"editor-shell",children:h.jsx(Oa,{...e})})})})});return t?h.jsx(Hs,{lexicalId:t,serviceManager:n,children:l}):l}export{Cc as $blockOf,vc as $blocksOf,$e as $columnOf,Me as $columnsOf,yl as $convertFromLatexString,hl as $convertToLatexString,rs as $createCollapsibleContainerNode,as as $createCollapsibleContentNode,is as $createCollapsibleTitleNode,wc as $createCommentThreadNode,Sc as $createCounterNode,Lc as $createDeckNode,tn as $createEquationNode,_c as $createExcalidrawNode,kc as $createExecutionTreeNode,Qt as $createImageNode,Ac as $createInlineCompletionNode,Nc as $createJupyterCellNode,bs as $createJupyterInputHighlightNode,Zn as $createJupyterInputNode,$c as $createJupyterOutputNode,Gn as $createLayoutContainerNode,Yn as $createLayoutItemNode,Rc as $createLoomNode,Ic as $createVideoNode,ss as $createYouTubeNode,bl as $importLatex,Pc as $inlinesOf,Oc as $inlinesOfNodes,ls as $isCollapsibleContainerNode,Mc as $isCollapsibleContentNode,Dc as $isCollapsibleTitleNode,Bc as $isCommentThreadNode,jc as $isCounterNode,Uc as $isDeckNode,Fc as $isEmptyLayoutItemNode,Ie as $isEquationNode,zc as $isExcalidrawNode,Hc as $isExecutionTreeNode,en as $isImageNode,ys as $isInlineCompletionNode,qc as $isJupyterCellNode,Wc as $isJupyterInputHighlightNode,Be as $isJupyterInputNode,Ve as $isJupyterOutputNode,os as $isLayoutContainerNode,Pe as $isLayoutItemNode,ds as $isLoomNode,Xc as $isVideoNode,nn as $isYouTubeNode,Jc as $jupyterInputNodeFor,Vc as $jupyterOutputNodeFor,Yc as $readDocument,kn as $splitBlocks,Gr as $titleBlock,Ts as AUTO_LINK_MATCHERS,pl as ApiCommentStore,Gc as AutoEmbedDialog,Zc as AutoEmbedExtension,Kc as AutoEmbedPlugin,nr as AutoIndentEngine,Cl as AutoIndentPlugin,Qc as AutoLinkExtension,vl as AutoLinkPlugin,eu as Button,tu as CAN_USE_DOM,mr as CHAPTER_CLASSES,nu as CLEAR_ALL_OUTPUTS_COMMAND,su as CODE_LANGUAGE_FRIENDLY_NAME_MAP,ou as CODE_LANGUAGE_MAP,Ks as CodeActionMenuPlugin,ru as CodeBlockHighlightExtension,kl as CodeBlockHighlightPlugin,Gt as CollapsibleContainerNode,iu as CollapsibleContentNode,au as CollapsibleExtension,Mm as CollapsiblePlugin,lu as CollapsibleTitleNode,cu as CommentAuthorAvatar,uu as CommentExtension,du as CommentPeopleContext,Qs as CommentPlugin,pu as CommentStore,fu as CommentThreadNode,Fs as CommentsProvider,ro as ComponentPickerMenuExtension,mu as ComponentPickerMenuPlugin,gu as CounterNode,hu as DEFAULT_CODE_LANGUAGE,bu as DEFAULT_CONFIG,yu as DEFAULT_FONT_SIZE,xu as DEFAULT_INITIAL_OUTPUTS,Ls as DEFAULT_LIST_MAX_INDENT_LEVEL,Tu as DEFAULT_TYPST_MODULE_URL,Eu as DEFAULT_TYPST_WASM_URL,Cu as DeckExtension,vu as DeckNode,Ul as DeckPlugin,Yl as DefaultExecutor,Js as DocumentSkeleton,eo as DraggableBlockPlugin,Na as EDITOR_NAMESPACE,wu as EXPORT_PDF_DOCUMENT_COMMAND,Su as EXPORT_PDF_SNAPSHOT_COMMAND,Lu as EXPORT_PDF_TYPESET_COMMAND,Xl as Editor,Oa as EditorContainer,_u as EmbedConfigs,ku as EmbedHandlersContext,Yt as EquationNode,Au as EquationsExtension,Nu as EquationsPlugin,$u as ExcalidrawExtension,Ru as ExcalidrawNode,Iu as ExcalidrawPlugin,Pu as ExecutionTreeExtension,Ou as ExecutionTreeNode,Mu as FileInput,Ki as FloatingLinkEditorPlugin,to as FloatingTextFormatToolbarPlugin,Du as HorizontalRuleExtension,Al as HorizontalRulePlugin,Bu as INPUT_UUID_TO_CODE_KEY,ju as INPUT_UUID_TO_OUTPUT_KEY,Uu as INPUT_UUID_TO_OUTPUT_UUID,Fu as INSERT_COLLAPSIBLE_COMMAND,zu as INSERT_DECK_COMMAND,Hu as INSERT_EQUATION_COMMAND,qu as INSERT_EXCALIDRAW_COMMAND,Wu as INSERT_EXECUTION_TREE_COMMAND,Xu as INSERT_IMAGE_COMMAND,Ju as INSERT_INLINE_COMMAND,Vu as INSERT_JUPYTER_CELL_COMMAND,hs as INSERT_JUPYTER_INPUT_OUTPUT_COMMAND,Yu as INSERT_LAYOUT_COMMAND,Gu as INSERT_LOOM_COMMAND,Zu as INSERT_MARIMO_CELL_COMMAND,Ku as INSERT_TABLE_WITH_DIALOG_COMMAND,Qu as INSERT_VIDEO_COMMAND,ed as INSERT_YOUTUBE_COMMAND,Vt as ImageNode,td as ImageResizer,nd as ImagesExtension,sd as ImagesPlugin,od as InlineCompletionExtension,rd as InlineCompletionNode,id as InsertEquationDialog,ad as InsertImageDialog,ld as InsertImageUploadedDialogBody,cd as InsertImageUriDialogBody,ud as JupyterCellExtension,dd as JupyterCellNode,Nl as JupyterCellPlugin,pd as JupyterInputHighlightNode,jn as JupyterInputNode,oo as JupyterInputOutputExtension,fd as JupyterInputOutputPlugin,no as JupyterLexicalExtension,Un as JupyterOutputNode,md as KatexEquationAlterer,ci as LATEX_ALGORITHM,ni as LATEX_BIBLIOGRAPHY,ri as LATEX_BLOCK,jr as LATEX_BOLD,Lr as LATEX_CODE,Br as LATEX_CODE_FORMAT,Dr as LATEX_COLLAPSIBLE,Qr as LATEX_COLUMNS,li as LATEX_CV,Or as LATEX_DISPLAY_EQUATION,ui as LATEX_ELEMENT_TRANSFORMERS,Pr as LATEX_FIGURE,Ir as LATEX_FLOAT,si as LATEX_FRAME,oi as LATEX_FRAME_TITLE,Cr as LATEX_HEADING,Wr as LATEX_HIGHLIGHT,Ar as LATEX_HORIZONTAL_RULE,Jr as LATEX_IMAGE,Xr as LATEX_INLINE_EQUATION,Ur as LATEX_ITALIC,_r as LATEX_JUPYTER_INPUT,kr as LATEX_JUPYTER_OUTPUT,ii as LATEX_LETTER,ai as LATEX_LETTER_LINES,Vr as LATEX_LINK,Sr as LATEX_LIST,Zr as LATEX_META,fi as LATEX_PREAMBLE_PACKAGES,vr as LATEX_QUOTE,zr as LATEX_STRIKETHROUGH,qr as LATEX_SUBSCRIPT,Hr as LATEX_SUPERSCRIPT,Rr as LATEX_TABLE,Ii as LATEX_TEMPLATES,xl as LATEX_TEMPLATE_CATEGORIES,di as LATEX_TEXT_FORMAT_TRANSFORMERS,pi as LATEX_TEXT_MATCH_TRANSFORMERS,ti as LATEX_THEOREM,Kr as LATEX_TITLE,ge as LATEX_TRANSFORMERS,Fr as LATEX_UNDERLINE,Mr as LATEX_YOUTUBE,gd as LOOM_EXTENSION_NAME,Pt as LSPCompletionItemKind,Il as LSPDocumentSyncPlugin,hd as LSPTabCompletionPlugin,bd as LSP_COMPLETION_INSERTED_COMMAND,yd as LSP_MENU_STATE_COMMAND,rr as LanguageIndentRegistry,Xn as LayoutContainerNode,xd as LayoutExtension,Jn as LayoutItemNode,$l as LayoutPlugin,Td as LexicalAdapter,Hs as LexicalConfigProvider,Ed as LexicalContentEditable,fl as LexicalContextConsumer,dr as LexicalContextProvider,Cd as LexicalInlineCompletionPlugin,Rl as LexicalLSPCompletionProvider,gl as LexicalPrimerThemeProvider,ml as LexicalProvider,vd as LexicalStateExtension,Vs as LexicalStatePlugin,wd as ListMaxIndentLevelExtension,Pl as ListMaxIndentLevelPlugin,Sd as LoomEmbedConfig,Ld as LoomExtension,_d as LoomNode,Bl as LoomPlugin,kd as MAX_ALLOWED_FONT_SIZE,Ad as MIN_ALLOWED_FONT_SIZE,Ol as MarkdownPlugin,Nd as MarkdownShortcutsExtension,$d as MentionsPlugin,Rd as Modal,Oi as NBFORMAT_METADATA,oa as NbformatContentPlugin,Id as OUTPUT_UUID_TO_CODE_UUID,Pd as OUTPUT_UUID_TO_OUTPUT_KEY,Od as OrchestrationRenderersContext,Md as PAGE_SIZES,Dd as PDF_FONTS,Bd as PEOPLE_SEARCH_PAUSE_MS,jd as PRINT_CSS,Ud as PRINT_PDF_COMMAND,Fd as PdfDocumentExtension,zl as PdfDocumentPlugin,zd as PdfExportExtension,Wl as PdfExportPlugin,Hd as PdfPage,qd as PdfPrintExtension,Fl as PdfPrintPlugin,Wd as PdfSnapshotExtension,Hl as PdfSnapshotPlugin,Xd as PdfTypesetExtension,ql as PdfTypesetPlugin,Jd as PdfWriter,Vd as Placeholder,Yd as Point,Gd as PrettierButton,Zd as RESTART_JUPYTER_KERNEL_COMMAND,Kd as RUN_ALL_JUPYTER_CELLS_COMMAND,Qd as RUN_JUPYTER_CELL_COMMAND,ep as Rect,tp as SettingsContext,np as TRIGGER_INLINE_COMPLETION_COMMAND,sp as TYPST_TS_VERSION,Gs as TableActionMenuPlugin,Ys as TableCellResizerPlugin,op as TableExtension,Ml as TableHoverActionsPlugin,Zs as TableHoverActionsV2Plugin,rp as TableInsertDialogPlugin,da as TableOfContentsPlugin,ip as TablePlugin,Dl as TableScrollShadowPlugin,ap as TextInput,tr as ThemeContext,lp as ThreadAssignee,zs as ToolbarContext,qs as ToolbarPlugin,Aa as TreeViewPlugin,cp as VideoExtension,up as VideoNode,jl as VideoPlugin,dp as YouTubeExtension,Wn as YouTubeNode,Fm as YouTubePlugin,pp as YoutubeEmbedConfig,Bn as anonymousAuthor,Dn as authorLabel,fp as authorOf,mp as blockTypeToBlockName,gp as buildPrintHtml,hp as bytesToObjectUrl,bp as canBePrettier,yp as canRaster,xp as canRecordVideo,Tp as canvasElementToRaster,Ep as canvasToJpeg,Cp as canvasToPng,ji as cellSource,vp as charWidth,wp as cloneEditorDom,Sp as collectPictures,Lp as columnWeights,Yr as columnsTemplate,so as commentTheme,_p as countPdfPages,kp as createComment,$a as createEditorExtension,yi as createLatexExport,$i as createLatexImport,Nn as createLatexImporter,Ap as createThread,Np as dataUrlToBytes,Gl as deleteBlocksOperation,Zl as deleteBlocksTool,$p as describeLoomVideo,Rp as describeScene,Ip as discardVideoRecording,Pp as documentToPdf,Op as downloadBytes,Mp as elementSkeletonSchema,Dp as elementToRaster,Li as emptyDocumentInfo,Bp as emptyScene,jp as encodeWinAnsi,Up as equalColumnsTemplate,Fp as equationToRaster,K as escapeLatex,zp as escapeTypst,Hp as excalidrawAddElementsParamsSchema,qp as excalidrawClearSceneParamsSchema,Wp as excalidrawConnectElementsParamsSchema,Xp as excalidrawDeleteElementsParamsSchema,Jp as excalidrawFromMermaidParamsSchema,Vp as excalidrawInsertNodeParamsSchema,Yp as excalidrawListDrawingsParamsSchema,Gp as excalidrawPluginTools,Zp as excalidrawReadSceneParamsSchema,Kp as excalidrawResizeParamsSchema,Qp as excalidrawSetAppStateParamsSchema,ef as excalidrawToolDefinitions,tf as excalidrawToolHandlers,nf as excalidrawToolMismatches,sf as excalidrawToolOperations,of as excalidrawUpdateElementsParamsSchema,Kl as executeCodeOperation,Ql as executeCodeTool,ki as expandMacros,rf as explainLoomFailure,af as explainVideoFailure,lf as exportLexicalToPdf,cf as exportPdfDocument,uf as exportPdfSnapshot,df as exportPdfTypeset,Tl as findLatexTemplate,pf as flattenToInlines,ff as fontFor,mf as getCodeLanguages,wl as getDOMRangeRect,gf as getDefaultCodeLanguage,hf as getEndOfJupyterInputInLine,bf as getFirstJupyterInputHighlightNodeOfLine,yf as getItemsCountFromTemplate,xf as getLanguageFriendlyName,Tf as getLastJupyterInputHighlightNodeOfLine,ec as getLexicalTools,Oe as getSelectedNode,Ll as getSelection,Ef as getStartOfCodeInLine,Cn as hasChapters,Cf as imageToRaster,vf as inlineSvgOf,wf as inlineText,tc as insertBlockOperation,nc as insertBlockTool,Sf as isDisabled,Lf as isHTMLElement,_f as isPoint,kf as isTypstEngine,Af as isValidContextScope,bn as javascriptIndentConfig,Sl as joinClasses,An as latexTransformersByType,sc as lexicalStore,El as lexicalToNbformat,Nf as lexicalToTypst,oc as lexicalToolDefinitions,rc as lexicalToolOperations,ic as lexicalTools,ac as listAvailableBlocksOperation,lc as listAvailableBlocksTool,$f as liveElements,Rf as loadHtml2Canvas,If as loadTypstEngine,fs as loomEmbedUrl,Pf as loomPublicAppIdOf,Of as loomRecorder,Mf as loomShareUrl,ps as loomVideoId,Df as mathToSvg,Bf as mentionsIn,jf as mergeConfig,Ui as nbformatToLexical,Uf as newDeckSpec,Ff as newVideoRecordingId,zf as normalizeCodeLang,_i as parseMacros,Ai as parsePreamble,Hf as parseScene,qf as pdfFilename,Wf as personLabel,Xf as pickVideoMimeType,Jf as printEditorToPdf,Vf as printPdf,sr as pythonIndentConfig,cc as readAllBlocksOperation,uc as readAllBlocksTool,dc as readBlockOperation,pc as readBlockTool,Yf as readDocument,Es as registerCodeBlockHighlight,Gf as registerCodeHighlighting,Zf as registerCollapsible,Us as registerDeck,Kf as registerEquations,Qf as registerExecutionTree,Cs as registerHorizontalRule,em as registerImages,vs as registerJupyterCell,ws as registerLayout,tm as registerLexicalState,Ss as registerListMaxIndentLevel,Ds as registerLoom,rn as registerPdfDocument,an as registerPdfPrint,ln as registerPdfSnapshot,cn as registerPdfTypeset,js as registerVideo,nm as registerYouTube,fc as runAllBlocksOperation,mc as runAllBlocksTool,gc as runBlockOperation,hc as runBlockTool,bt as sanitizeUrl,sm as scaleCanvas,om as serializeScene,_l as setFloatingElemPosition,Xe as setFloatingElemPositionForLinkEditor,Bs as setLoomPublicAppId,rm as shouldAutoTrigger,im as shouldManualTrigger,am as snapshotEditorToPdf,fr as splitDocument,lm as startVideoRecording,cm as stopVideoRecording,um as subscribeVideoRecordings,dm as summarizeElement,pm as supportedTransformers,fm as svgForTypst,mm as svgToRaster,gm as textWidth,cr as threadsOf,Si as todayForLatex,hm as touchElement,or as typescriptIndentConfig,bm as typesetToPdf,bc as updateBlockOperation,yc as updateBlockTool,ym as useCommentStore,xm as useComments,Tm as useDebounce,Bm as useDomColormode,Em as useEmbedHandlers,Cm as useLayoutEffectImpl,ur as useLexical,vm as useLexicalConfig,xc as useLexicalStore,Tc as useLexicalToolBundle,wm as useModal,Sm as useOptionalLexicalConfig,Lm as useOrchestrationRenderers,_m as usePeopleSearch,km as useSettings,jm as useTheme,Am as useToolbarState,Nm as validateUrl,$m as videoBlockStatus,Rm as videoFileName,Im as videoRecordingOf,Pm as withBoundText};
|