@datalayer/agent-runtimes 1.6.26 → 1.6.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist-embed/chunks/{CellSidebarExtension-C6l8SYJ5.js → CellSidebarExtension-D7aXShZc.js} +1 -1
  2. package/dist-embed/chunks/{CollapsiblePlugin-Bn70jFpi.js → CollapsiblePlugin-Df_cvRKL.js} +1 -1
  3. package/dist-embed/chunks/{DeckComponent-DuxVpxzx.js → DeckComponent-sQU5JWCV.js} +1 -1
  4. package/dist-embed/chunks/{DocumentView-DKLkbwvh.js → DocumentView-BGthuEds.js} +1 -1
  5. package/dist-embed/chunks/{EphemeralDocument-CAXNOtEL.js → EphemeralDocument-CPSZcPKd.js} +1 -1
  6. package/dist-embed/chunks/{EphemeralNotebook-P_uxBveu.js → EphemeralNotebook-Dyx-25uN.js} +1 -1
  7. package/dist-embed/chunks/{ExcalidrawComponent-mHitiMde.js → ExcalidrawComponent-F2NybZbz.js} +1 -1
  8. package/dist-embed/chunks/{ExcalidrawModal-KB4MTQbk.js → ExcalidrawModal-CDiyt5M-.js} +1 -1
  9. package/dist-embed/chunks/{JupyterLexicalExtension-BtjDYMne.js → JupyterLexicalExtension-CEBuhvME.js} +7 -7
  10. package/dist-embed/chunks/{KernelVariables-CyPoY7Ap.js → KernelVariables-D3DSQaD3.js} +1 -1
  11. package/dist-embed/chunks/{NotebookToolSurfaces-SJd2MRQh.js → NotebookToolSurfaces-BDYXmM7k.js} +1 -1
  12. package/dist-embed/chunks/{NotebookView-CqS2dr1U.js → NotebookView-DRPnBAI2.js} +1 -1
  13. package/dist-embed/chunks/{Output-BfmeU6C2.js → Output-C6ZHZSBH.js} +1 -1
  14. package/dist-embed/chunks/{SandboxDetailsDialog-BQIrcZPM.js → SandboxDetailsDialog-qJBg2naH.js} +1 -1
  15. package/dist-embed/chunks/{WidgetVariableView-CxupIe6b.js → WidgetVariableView-B4faSdWW.js} +1 -1
  16. package/dist-embed/chunks/{YouTubePlugin-B6JmeO6g.js → YouTubePlugin-ChcBEMI-.js} +1 -1
  17. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-BtDm_vBV.js → ar-SA-G6X2FPQ2-CnEVkWCp.js} +1 -1
  18. package/dist-embed/chunks/{az-AZ-76LH7QW2-CU9PzGa-.js → az-AZ-76LH7QW2-CSwFJ6du.js} +1 -1
  19. package/dist-embed/chunks/{bg-BG-XCXSNQG7-CcZG1sMf.js → bg-BG-XCXSNQG7-JG4F_3L3.js} +1 -1
  20. package/dist-embed/chunks/{bn-BD-2XOGV67Q-CsBxRWS8.js → bn-BD-2XOGV67Q-__W94Bx-.js} +1 -1
  21. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-DiPlBY-L.js → ca-ES-6MX7JW3Y-CgTiQ3-C.js} +1 -1
  22. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-B2LG8kaF.js → cs-CZ-2BRQDIVT-CuzIST9-.js} +1 -1
  23. package/dist-embed/chunks/{da-DK-5WZEPLOC-CjiEJ2dL.js → da-DK-5WZEPLOC-D4Z2Xglb.js} +1 -1
  24. package/dist-embed/chunks/{de-DE-XR44H4JA-D2hSEI1m.js → de-DE-XR44H4JA-E0rMdm2C.js} +1 -1
  25. package/dist-embed/chunks/{el-GR-BZB4AONW-C7ps3kie.js → el-GR-BZB4AONW-DHhs1347.js} +1 -1
  26. package/dist-embed/chunks/{es-ES-U4NZUMDT-BfNMUvfg.js → es-ES-U4NZUMDT-DI3jTuDV.js} +1 -1
  27. package/dist-embed/chunks/{esm-dClDAAXj.js → esm-DqlTXy-D.js} +1 -1
  28. package/dist-embed/chunks/{eu-ES-A7QVB2H4-CBQcRcNh.js → eu-ES-A7QVB2H4-ChXyoAj9.js} +1 -1
  29. package/dist-embed/chunks/{fa-IR-HGAKTJCU-CKTkkQUk.js → fa-IR-HGAKTJCU-D1qRoSi6.js} +1 -1
  30. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-B2flJw4O.js → fi-FI-Z5N7JZ37-Cxzt5XFf.js} +1 -1
  31. package/dist-embed/chunks/{fr-FR-RHASNOE6-DCWxP6nh.js → fr-FR-RHASNOE6-DxKK7jD9.js} +1 -1
  32. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-BGEA0PhL.js → gl-ES-HMX3MZ6V-CFdnAa4-.js} +1 -1
  33. package/dist-embed/chunks/{he-IL-6SHJWFNN-BaHixqAA.js → he-IL-6SHJWFNN-lBjIyRxj.js} +1 -1
  34. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-CrHbvHN0.js → hi-IN-IWLTKZ5I-CtdCPck4.js} +1 -1
  35. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-B9wQnRpK.js → hu-HU-A5ZG7DT2-D_CFF32t.js} +1 -1
  36. package/dist-embed/chunks/{id-ID-SAP4L64H-T0pQVB4m.js → id-ID-SAP4L64H-CwTXhwLK.js} +1 -1
  37. package/dist-embed/chunks/{index-BKAeSGYJ.js → index-9wJFadG-.js} +6 -6
  38. package/dist-embed/chunks/{index-Dd7kISed.js → index-C7UsrKrP.js} +1 -1
  39. package/dist-embed/chunks/{index-eH_desiS.js → index-DCpvl_OP.js} +2 -2
  40. package/dist-embed/chunks/{it-IT-JPQ66NNP-ECgWHvcY.js → it-IT-JPQ66NNP-BUEFwYid.js} +1 -1
  41. package/dist-embed/chunks/{ja-JP-DBVTYXUO-Cz96ctDW.js → ja-JP-DBVTYXUO-BAK_QQr1.js} +1 -1
  42. package/dist-embed/chunks/{kaa-6HZHGXH3-Cu7gLGxC.js → kaa-6HZHGXH3-C2yLyxLW.js} +1 -1
  43. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-CoJI939s.js → kab-KAB-ZGHBKWFO-CW0xgQ8n.js} +1 -1
  44. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DiEAZ9si.js → kk-KZ-P5N5QNE5-iG2uKF6i.js} +1 -1
  45. package/dist-embed/chunks/{km-KH-HSX4SM5Z-CNF1qzO2.js → km-KH-HSX4SM5Z-Bm_m99ak.js} +1 -1
  46. package/dist-embed/chunks/{ko-KR-MTYHY66A-BCvHfgyK.js → ko-KR-MTYHY66A-Clgfny6b.js} +1 -1
  47. package/dist-embed/chunks/{ku-TR-6OUDTVRD-BV9JoFXu.js → ku-TR-6OUDTVRD-Y8Y_vzzq.js} +1 -1
  48. package/dist-embed/chunks/{lib-Bx5jthWD.js → lib-7ge2Kma3.js} +1 -1
  49. package/dist-embed/chunks/{lib-yg0_lz05.js → lib-8ZUSfvoH.js} +1 -1
  50. package/dist-embed/chunks/{lib-CAo1qw8O.js → lib-B5Wbadbg.js} +1 -1
  51. package/dist-embed/chunks/{lib-DZN1MrxI.js → lib-B9ahcmxX.js} +1 -1
  52. package/dist-embed/chunks/{lib-BxusOAUc.js → lib-BFuQ3UQC.js} +1 -1
  53. package/dist-embed/chunks/{lib-0nJV2tTp.js → lib-BP80BmI2.js} +1 -1
  54. package/dist-embed/chunks/{lib-NqXc-p0V.js → lib-BepajD8I.js} +1 -1
  55. package/dist-embed/chunks/{lib-Dxhw9PEm.js → lib-COZbOw0Z.js} +1 -1
  56. package/dist-embed/chunks/{lib-DhqDod2q.js → lib-CbUWOQj9.js} +1 -1
  57. package/dist-embed/chunks/{lib-DJJHSa4o.js → lib-CpkMRAJY.js} +1 -1
  58. package/dist-embed/chunks/{lib-CIkHn_Ac.js → lib-D25l5ZAy.js} +1 -1
  59. package/dist-embed/chunks/{lib-CZz_1UlC.js → lib-DBCP5fWa.js} +1 -1
  60. package/dist-embed/chunks/{lib-BkW0DwuV.js → lib-DHHIihJW.js} +1 -1
  61. package/dist-embed/chunks/{lib-Cn6fuwbC.js → lib-DggdYYmh.js} +1 -1
  62. package/dist-embed/chunks/{lib-CJQ5jBOi.js → lib-DmPUUoao.js} +1 -1
  63. package/dist-embed/chunks/{lib-3EwLl_XC.js → lib-DwylwlRk.js} +1 -1
  64. package/dist-embed/chunks/{lib-aEdpLJmk.js → lib-NBgDVJov.js} +1 -1
  65. package/dist-embed/chunks/{lib-Bjb6erCc.js → lib-j6VKUVII.js} +1 -1
  66. package/dist-embed/chunks/{lib-DLAP9X-I.js → lib-obIZUupc.js} +1 -1
  67. package/dist-embed/chunks/{lt-LT-XHIRWOB4-BpoBiZvj.js → lt-LT-XHIRWOB4-D7Por38P.js} +1 -1
  68. package/dist-embed/chunks/{lv-LV-5QDEKY6T-DWPLOycm.js → lv-LV-5QDEKY6T-Bz5t6-LB.js} +1 -1
  69. package/dist-embed/chunks/{mr-IN-CRQNXWMA-C3XokKLN.js → mr-IN-CRQNXWMA-B1NTMzvS.js} +1 -1
  70. package/dist-embed/chunks/{my-MM-5M5IBNSE-bPDcBtIx.js → my-MM-5M5IBNSE-C1gGuOaf.js} +1 -1
  71. package/dist-embed/chunks/{nb-NO-T6EIAALU-zGQywuc4.js → nb-NO-T6EIAALU-o2E12ucR.js} +1 -1
  72. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-D0N-QxdB.js → nl-NL-IS3SIHDZ-Bqxu5mbZ.js} +1 -1
  73. package/dist-embed/chunks/{nn-NO-6E72VCQL-BeiBipEM.js → nn-NO-6E72VCQL-DxUXxDPK.js} +1 -1
  74. package/dist-embed/chunks/{oc-FR-POXYY2M6-BSmiDtLw.js → oc-FR-POXYY2M6-CDttJVdz.js} +1 -1
  75. package/dist-embed/chunks/{pa-IN-N4M65BXN-YTioBliU.js → pa-IN-N4M65BXN-Dp8ANANJ.js} +1 -1
  76. package/dist-embed/chunks/{percentages-BXMCSKIN-B5BZ64UL.js → percentages-BXMCSKIN-B5xVDaSp.js} +3 -3
  77. package/dist-embed/chunks/{pl-PL-T2D74RX3-BmA-mIoA.js → pl-PL-T2D74RX3-N3d_R6le.js} +1 -1
  78. package/dist-embed/chunks/{pt-BR-5N22H2LF-DF1nGVg3.js → pt-BR-5N22H2LF-CpPiMZ-u.js} +1 -1
  79. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-DhiSFYNH.js → pt-PT-UZXXM6DQ-EGdAVYif.js} +1 -1
  80. package/dist-embed/chunks/{renderer-D_wPFwb6.js → renderer-8__rsP1H.js} +1 -1
  81. package/dist-embed/chunks/{ro-RO-JPDTUUEW-DN5nT_8E.js → ro-RO-JPDTUUEW-Bkty7yik.js} +1 -1
  82. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-DJAZColu.js → ru-RU-B4JR7IUQ-BRHTHx-M.js} +1 -1
  83. package/dist-embed/chunks/{si-LK-N5RQ5JYF-BcJdGNJf.js → si-LK-N5RQ5JYF-BnP3_yrO.js} +1 -1
  84. package/dist-embed/chunks/{sk-SK-C5VTKIMK-Bs43X2b-.js → sk-SK-C5VTKIMK-CcOBsX7R.js} +1 -1
  85. package/dist-embed/chunks/{sl-SI-NN7IZMDC-CVhBQ31i.js → sl-SI-NN7IZMDC-DjcpDjk-.js} +1 -1
  86. package/dist-embed/chunks/{standalone-BmUQQ5LE.js → standalone-BjQ9N7UL.js} +1 -1
  87. package/dist-embed/chunks/{subset-shared.chunk-BkTdi2-W.js → subset-shared.chunk-DuIbGrTT.js} +1 -1
  88. package/dist-embed/chunks/{subset-worker.chunk-SkNsdM6t.js → subset-worker.chunk-CNz8UZDr.js} +1 -1
  89. package/dist-embed/chunks/{sv-SE-XGPEYMSR-BR0XZMXJ.js → sv-SE-XGPEYMSR-DbihwJ2w.js} +1 -1
  90. package/dist-embed/chunks/{ta-IN-2NMHFXQM-4CfGQQ8v.js → ta-IN-2NMHFXQM--fKIkmrb.js} +1 -1
  91. package/dist-embed/chunks/{th-TH-HPSO5L25-CjO8TBa6.js → th-TH-HPSO5L25-CkS_jtXJ.js} +1 -1
  92. package/dist-embed/chunks/{tr-TR-DEFEU3FU-B3tO43YQ.js → tr-TR-DEFEU3FU-B7b1yuT5.js} +1 -1
  93. package/dist-embed/chunks/{uk-UA-QMV73CPH-DYk01HNs.js → uk-UA-QMV73CPH-DMXQPyW5.js} +1 -1
  94. package/dist-embed/chunks/{vi-VN-M7AON7JQ-Dyd2Hf1G.js → vi-VN-M7AON7JQ-DQGL1ixT.js} +1 -1
  95. package/dist-embed/chunks/{zh-CN-LNUGB5OW-Bs2W1BrY.js → zh-CN-LNUGB5OW-BzDVFX-Z.js} +1 -1
  96. package/dist-embed/chunks/{zh-HK-E62DVLB3-BwN2oc_m.js → zh-HK-E62DVLB3-DwTp6Tkq.js} +1 -1
  97. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-qOevWsjt.js → zh-TW-RAJ6MFWO-VbTpKAX1.js} +1 -1
  98. package/dist-embed/datalayer-app-main.js +94 -94
  99. package/lib/apps/__tests__/fixtures/stewardReport.json +1022 -0
  100. package/lib/specs/actions.js +51 -2
  101. package/lib/specs/agents/agents.d.ts +1 -1
  102. package/lib/specs/agents/agents.js +134 -134
  103. package/lib/specs/apps.d.ts +1 -1
  104. package/lib/specs/apps.js +396 -396
  105. package/lib/specs/backendTools.js +7 -7
  106. package/lib/specs/mcpServers.js +24 -0
  107. package/lib/specs/policies.js +1 -1
  108. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{r as v,J as Xe,j as m,k3 as Dt,I as J,f3 as Ke,cI as me,bt as ge,v as Y,fx as At,fr as Ze,fI as jt,k4 as It,k5 as Nt,k6 as Qe,k7 as et,cn as V,k8 as Lt,k9 as Rt,ka as Ot,bT as je,kb as ft,kc as mt,kd as Ft,ke as ue,aN as Bt,bU as Ue,kf as gt,kg as Wt,kh as tt,a9 as N,ki as nt,kj as fe,kk as Vt,kl as Ht,km as Gt,aD as pe,kn as Le,ko as st,aE as ke,aF as ee,bg as $t,eJ as zt,ck as U,j$ as Kt,ay as Ut,ct as qt,aA as Z,dB as Jt,d_ as Yt,iH as We,iF as pt,kp as xe,eu as Se,kq as be,kr as Xt,ks as Zt,aI as Qt,aB as en,jZ as tn,kt as _t,ir as K,ku as nn,kv as R,kw as sn,dv as on,kx as vt,ky as rn,kz as an,kA as ln,Y as ne,B as he,dI as dn,_ as cn,au as hn,ey as ot,ez as de,eA as un,cy as fn,k as mn,kB as gn,kC as yt,gJ as pn,kD as ae,bs as D,z as le,dl as it,bE as Ct,e6 as _n,dr as vn,bB as Me,U as yn,P as Cn,aJ as bn,aQ as wn}from"../datalayer-app-main.js";import{b as kn,c as xn,f as ce,P as Re,d as Sn,W as Mn,r as En,g as Tn,h as Pn,i as Dn,C as An,a as jn}from"./index-6zxBQeM_.js";import{c as In,N as Ve}from"./NotebookSkeleton-BkzTMhIX.js";import{H as Nn}from"./hoverbox-CStlKQWE.js";import{R as bt,L as Ln}from"./index-BKAeSGYJ.js";import{a as Rn,W as rt}from"./renderer-D_wPFwb6.js";import{C as Ee,S as Te}from"./SquareIcon-Dy3l3VdH.js";function On(...r){return v.useCallback(e=>{for(const t of r)typeof t=="function"?t(e):t&&(t.current=e)},r)}var Q={Banner:"prc-Banner-Banner-IR8eJ",BannerContainer:"prc-Banner-BannerContainer-lbx3d",BannerContent:"prc-Banner-BannerContent-zTITK",BannerActions:"prc-Banner-BannerActions-XCfHL",BannerTitle:"prc-Banner-BannerTitle-TcuJl",BannerIcon:"prc-Banner-BannerIcon-WuOyf",BannerDismiss:"prc-Banner-BannerDismiss-uBZVm",BannerActionsContainer:"prc-Banner-BannerActionsContainer-ukGMH"};const Fn={critical:m.jsx(It,{}),info:m.jsx(Ze,{}),success:m.jsx(jt,{}),upsell:m.jsx(Ze,{}),warning:m.jsx(At,{})},Bn={critical:"Critical",info:"Information",success:"Success",upsell:"Recommendation",warning:"Warning"},Wn=Xe.forwardRef(function({"aria-label":e,children:t,className:n,description:s,hideTitle:o,icon:i,onDismiss:a,primaryAction:l,secondaryAction:d,title:c,variant:h="info",...u},f){const _=!!a,y=l||d,A=Xe.useRef(null),j=On(f,A),p=h==="info"||h==="upsell";return m.jsxs("section",{...u,"aria-label":e??Bn[h],className:me(n,Q.Banner),"data-dismissible":a?"":void 0,"data-title-hidden":o?"":void 0,"data-variant":h,tabIndex:-1,ref:j,children:[m.jsx("div",{className:Q.BannerIcon,children:i&&p?i:Fn[h]}),m.jsxs("div",{className:Q.BannerContainer,children:[m.jsxs("div",{className:Q.BannerContent,children:[c?o?m.jsx(Dt,{children:m.jsx(He,{children:c})}):m.jsx(He,{children:c}):null,s?m.jsx(wt,{children:s}):null,t]}),y?m.jsx(Vn,{primaryAction:l,secondaryAction:d}):null]}),_?m.jsx(J,{"aria-label":"Dismiss banner",onClick:a,className:Q.BannerDismiss,icon:Ke,variant:"invisible"}):null]})});function He(r){const e=ge.c(12);let t,n,s,o;e[0]!==r?({as:o,className:n,children:t,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s,e[4]=o):(t=e[1],n=e[2],s=e[3],o=e[4]);const i=o===void 0?"h2":o;let a;e[5]!==n?(a=me(n,Q.BannerTitle),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==i||e[8]!==t||e[9]!==s||e[10]!==a?(l=m.jsx(i,{...s,className:a,"data-banner-title":"",children:t}),e[7]=i,e[8]=t,e[9]=s,e[10]=a,e[11]=l):l=e[11],l}function wt(r){const e=ge.c(10);let t,n,s;e[0]!==r?({children:t,className:n,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s):(t=e[1],n=e[2],s=e[3]);let o;e[4]!==n?(o=me("BannerDescription",n),e[4]=n,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==s||e[8]!==o?(i=m.jsx("div",{...s,className:o,children:t}),e[6]=t,e[7]=s,e[8]=o,e[9]=i):i=e[9],i}function Vn(r){const e=ge.c(9),{primaryAction:t,secondaryAction:n}=r,s=n??null,o=t??null;let i;e[0]!==s||e[1]!==o?(i=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"trailing",children:[s,o]}),e[0]=s,e[1]=o,e[2]=i):i=e[2];const a=t??null,l=n??null;let d;e[3]!==a||e[4]!==l?(d=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"leading",children:[a,l]}),e[3]=a,e[4]=l,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==d?(c=m.jsxs("div",{className:Q.BannerActions,children:[i,d]}),e[6]=i,e[7]=d,e[8]=c):c=e[8],c}const kt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"default",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});kt.displayName="BannerPrimaryAction";const xt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"link",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});xt.displayName="BannerSecondaryAction";const Hn=Object.assign(Wn,{Title:He,Description:wt,PrimaryAction:kt,SecondaryAction:xt}),_e=Rt.define({combine(r){return r[r.length-1]}}),Gn=je.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip.jp-remote-userInfo":{color:"var(--fgColor-onEmphasis, #ffffff)",padding:"0px 2px"}});function qe(r,e){const t=r?.username||r?.display_name||r?.name||String(e),{theme:n,colorMode:s}=Bt.getState(),o=s==="auto"?typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":s;return In(t,n,o)}const Ie=Ot.define();class St{style;marker;constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,n]of Object.entries(this.style))e.style[t]=n;return e}eq(e){return this.marker.eq(e.marker)&&V.deepEqual(this.style,e.style)}update(e,t){for(const[n,s]of Object.entries(this.style))e.style[n]=s;return this.marker.update(e,t.marker)}}const $n=ft({above:!0,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if(!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h=l.primary??!0?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",u=Ue.cursor(c.index,c.index>d.index?-1:1);for(const f of gt.forRange(r,h,u))s.push(new St({borderLeftColor:qe(o.user,i)},f))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-cursors"});function at(r){const e=new Array,{awareness:t,ytext:n}=r.facet(_e),s=n.doc;for(const[o,i]of t.getStates())if(o!==t.doc.clientID)for(const a of i.cursors??[]){if(!a?.head)continue;const l=ue(a.head,s);l?.type===n&&e.push({pos:l.index,above:!0,create:()=>{const d=document.createElement("div");return d.classList.add("jp-remote-userInfo"),d.style.backgroundColor=qe(i.user,o),d.textContent=i.user?.display_name??"Anonymous",{dom:d}}})}return e}const zn=mt.define({create:at,update(r,e){return e.annotation(Ie)?at(e.state):r},provide(r){return Ft.computeN([r],e=>e.field(r))}}),Kn=ft({above:!1,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if((l.empty??!0)||!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h="jp-remote-selection";for(const u of gt.forRange(r,h,Ue.range(d.index,c.index)))s.push(new St({backgroundColor:qe(o.user,i)},u))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-selections"}),Un=Nt.fromClass(class{editorAwareness;_listener;constructor(r){this.editorAwareness=r.state.facet(_e),this._listener=({added:e,updated:t,removed:n})=>{e.concat(t).concat(n).findIndex(o=>o!==this.editorAwareness.awareness.doc.clientID)>=0&&r.dispatch({annotations:[Ie.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(r){if(!r.docChanged&&!r.selectionSet)return;const{awareness:e,ytext:t}=this.editorAwareness,n=e.getLocalState();if(n){const s=r.view.hasFocus&&r.view.dom.ownerDocument.hasFocus(),o=r.state.selection,i=new Array;if(s&&o){for(const a of o.ranges){const l=a===o.main,d=Qe(t,a.anchor),c=Qe(t,a.head);i.push({anchor:d,head:c,primary:l,empty:a.empty})}if(!n.cursors||i.length>0){const a=n.cursors?.map(l=>({...l,anchor:l?.anchor?et(l.anchor):null,head:l?.head?et(l.head):null}));V.deepEqual(i,a)||e.setLocalStateField("cursors",i)}}}}},{provide:()=>[Gn,$n,Kn,zn,Lt({position:"absolute",parent:document.body})]});function qn(r){return[_e.of(r),Un]}class Ne extends Wt{constructor(e={}){var t;super(),this.version="2.0.0",this.ymeta=this.ydoc.getMap("meta"),this._onMetaChanged=n=>{const s=n.find(i=>i.target===this.ymeta.get("metadata"));if(s){const i=s.changes.keys,a=this.ymeta.get("metadata");s.changes.keys.forEach((l,d)=>{switch(l.action){case"add":this._metadataChanged.emit({key:d,type:"add",newValue:a.get(d)});break;case"delete":this._metadataChanged.emit({key:d,type:"remove",oldValue:l.oldValue});break;case"update":{const c=a.get(d),h=l.oldValue;let u=!0;typeof h=="object"&&typeof c=="object"?u=V.deepEqual(h,c):u=h===c,u||this._metadataChanged.emit({key:d,type:"change",oldValue:h,newValue:c})}break}}),this._changed.emit({metadataChange:i})}const o=n.find(i=>i.target===this.ymeta);if(o){if(o.keysChanged.has("metadata")){const i=o.changes.keys.get("metadata");if(i?.action==="add"&&!i.oldValue){const a=new Map;for(const l of Object.keys(this.metadata))a.set(l,{action:"add",oldValue:void 0}),this._metadataChanged.emit({key:l,type:"add",newValue:this.getMetadata(l)});this._changed.emit({metadataChange:a})}}if(o.keysChanged.has("nbformat")){const i=o.changes.keys.get("nbformat"),a={key:"nbformat",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat};this._changed.emit({nbformatChanged:a})}if(o.keysChanged.has("nbformat_minor")){const i=o.changes.keys.get("nbformat_minor"),a={key:"nbformat_minor",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat_minor};this._changed.emit({nbformatChanged:a})}}},this._onYCellsChanged=n=>{n.changes.added.forEach(i=>{const a=i.content.type;if(!this._ycellMapping.has(a)){const l=tt(a,{notebook:this});this._ycellMapping.set(a,l)}}),n.changes.deleted.forEach(i=>{const a=i.content.type,l=this._ycellMapping.get(a);l&&(l.dispose(),this._ycellMapping.delete(a))});let s=0;const o=[];n.changes.delta.forEach(i=>{if(i.insert!=null){const a=i.insert.map(l=>this._ycellMapping.get(l));o.push({insert:a}),this.cells.splice(s,0,...a),s+=i.insert.length}else i.delete!=null?(o.push(i),this.cells.splice(s,i.delete)):i.retain!=null&&(o.push(i),s+=i.retain)}),this._changed.emit({cellsChange:o})},this._metadataChanged=new N(this),this._ycells=this.ydoc.getArray("cells"),this._ycellMapping=new WeakMap,this._disableDocumentWideUndoRedo=(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1,this.cells=this._ycells.toArray().map(n=>(this._ycellMapping.has(n)||this._ycellMapping.set(n,tt(n,{notebook:this})),this._ycellMapping.get(n))),this.undoManager.addToScope(this._ycells),this._ycells.observe(this._onYCellsChanged),this.ymeta.observeDeep(this._onMetaChanged)}static create(e={}){var t,n,s,o,i,a,l,d,c;const h=new Ne({disableDocumentWideUndoRedo:(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1}),u={cells:(s=(n=e.data)===null||n===void 0?void 0:n.cells)!==null&&s!==void 0?s:[],nbformat:(i=(o=e.data)===null||o===void 0?void 0:o.nbformat)!==null&&i!==void 0?i:4,nbformat_minor:(l=(a=e.data)===null||a===void 0?void 0:a.nbformat_minor)!==null&&l!==void 0?l:5,metadata:(c=(d=e.data)===null||d===void 0?void 0:d.metadata)!==null&&c!==void 0?c:{}};return h.setSource(u),h}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}get metadata(){return this.getMetadata()}set metadata(e){this.setMetadata(e)}get metadataChanged(){return this._metadataChanged}get nbformat(){return this.ymeta.get("nbformat")}set nbformat(e){this.transact(()=>{this.ymeta.set("nbformat",e)},!1)}get nbformat_minor(){return this.ymeta.get("nbformat_minor")}set nbformat_minor(e){this.transact(()=>{this.ymeta.set("nbformat_minor",e)},!1)}dispose(){this.isDisposed||(this._ycells.unobserve(this._onYCellsChanged),this.ymeta.unobserveDeep(this._onMetaChanged),super.dispose())}getCell(e){return this.cells[e]}addCell(e){return this.insertCell(this._ycells.length,e)}insertCell(e,t){return this.insertCells(e,[t])[0]}insertCells(e,t){const n=t.map(s=>{const o=nt(s,this);return this._ycellMapping.set(o.ymodel,o),o});return this.transact(()=>{this._ycells.insert(e,n.map(s=>s.ymodel))}),this.dirty=!0,n}moveCell(e,t){this.moveCells(e,t)}moveCells(e,t,n=1){const s=new Array(n).fill(!0).map((o,i)=>this.getCell(e+i).toJSON());this.transact(()=>{this._ycells.delete(e,n),this._ycells.insert(e>t?t:t-n+1,s.map(o=>nt(o,this).ymodel))}),this.dirty=!0}deleteCell(e){this.deleteCellRange(e,e+1)}deleteCellRange(e,t){this.transact(()=>{this._ycells.delete(e,t-e)}),this.dirty=!0}deleteMetadata(e){if(typeof this.getMetadata(e)>"u")return;const t=this.metadata;delete t[e],this.setMetadata(t)}getMetadata(e){const t=this.ymeta.get("metadata");if(t!==void 0)if(typeof e=="string"){const n=t.get(e);return typeof n>"u"?void 0:V.deepCopy(n)}else return V.deepCopy(t.toJSON())}setMetadata(e,t){var n;if(typeof e=="string"){if(typeof t>"u")throw new TypeError(`Metadata value for ${e} cannot be 'undefined'; use deleteMetadata.`);if(V.deepEqual((n=this.getMetadata(e))!==null&&n!==void 0?n:null,t))return;const s={};s[e]=t,this.updateMetadata(s)}else if(!this.metadata||!V.deepEqual(this.metadata,e)){const s=V.deepCopy(e),o=this.ymeta.get("metadata");if(o===void 0)return;this.transact(()=>{o.clear();for(const[i,a]of Object.entries(s))o.set(i,a)}),this.dirty=!0}}updateMetadata(e){const t=V.deepCopy(e),n=this.ymeta.get("metadata");n!==void 0&&(this.transact(()=>{for(const[s,o]of Object.entries(t))n.set(s,o)}),this.dirty=!0)}getSource(){return this.toJSON()}setSource(e){this.fromJSON(e),this.dirty=!1}fromJSON(e){this.transact(()=>{this.nbformat=e.nbformat,this.nbformat_minor=e.nbformat_minor;const t=e.metadata;if(t.orig_nbformat!==void 0&&delete t.orig_nbformat,this.metadata)this.metadata=t;else{const o=new fe;for(const[i,a]of Object.entries(t))o.set(i,a);this.ymeta.set("metadata",o)}const n=e.nbformat===4&&e.nbformat_minor>=5,s=e.cells.map(o=>(n||delete o.id,o));this.insertCells(this.cells.length,s),this.deleteCellRange(0,this.cells.length)})}toJSON(){const e=this.nbformat===4&&this.nbformat_minor<=4;return Ge({metadata:this.metadata,nbformat_minor:this.nbformat_minor,nbformat:this.nbformat,cells:this.cells.map(t=>{const n=t.toJSON();return e&&delete n.id,n})})}}function Ge(r){if(Array.isArray(r))return r.map(e=>Ge(e));if(r!==null&&typeof r=="object"){const e={},t=Object.entries(r).sort(([n],[s])=>n<s?-1:n>s?1:0);for(const[n,s]of t)Object.defineProperty(e,n,{value:Ge(s),enumerable:!0,writable:!0,configurable:!0});return e}return r}class Jn{constructor(e){this.model=e,this._cellMap=new WeakMap,this._changed=new N(this),this._isDisposed=!1,this._insertCells(0,this.model.cells),this.model.changed.connect(this._onSharedModelChanged,this)}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get length(){return this.model.cells.length}*[Symbol.iterator](){for(const e of this.model.cells)yield this._cellMap.get(e)}dispose(){var e;if(!this._isDisposed){this._isDisposed=!0;for(const t of this.model.cells)(e=this._cellMap.get(t))===null||e===void 0||e.dispose();N.clearData(this)}}get(e){return this._cellMap.get(this.model.cells[e])}_insertCells(e,t){return t.forEach(n=>{let s;switch(n.cell_type){case"code":{s=new Gt({sharedModel:n});break}case"markdown":{s=new Ht({sharedModel:n});break}default:s=new Vt({sharedModel:n})}this._cellMap.set(n,s),n.disposed.connect(()=>{s.dispose(),this._cellMap.delete(n)})}),this.length}_onSharedModelChanged(e,t){var n;let s=0;const o=new Array;(n=t.cellsChange)===null||n===void 0||n.forEach(i=>{i.insert!=null?(this._insertCells(s,i.insert),o.push({type:"add",newIndex:s,newValues:i.insert.map(a=>this._cellMap.get(a)),oldIndex:-2,oldValues:[]}),s+=i.insert.length):i.delete!=null?o.push({type:"remove",newIndex:-1,newValues:[],oldIndex:s,oldValues:new Array(i.delete).fill(void 0)}):i.retain!=null&&(s+=i.retain)}),o.forEach(i=>this._changed.emit(i))}}class Yn{constructor(e){this._requestBatchSize=10,this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._kernelSession="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[],this._kernel=null,this._sessionContext=e.sessionContext,this._trans=(e.translator||pe).load("jupyterlab"),this._toRequest=this._requestBatchSize,this._handleKernel().then(()=>{this._sessionContext.kernelChanged.connect(this._handleKernel,this)})}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&t.model.sharedModel.changed.disconnect(this.onTextChange,this),this._editor=e,e&&e.model.sharedModel.changed.connect(this.onTextChange,this)}get placeholder(){return this._placeholder}get kernelSession(){return this._kernelSession}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,N.clearData(this)}async checkSession(e){var t;this._hasSession||(await this._retrieveHistory(),this._hasSession=!0,this.editor=e.editor,this._placeholder=((t=this._editor)===null||t===void 0?void 0:t.model.sharedModel.getSource())||"",this.setFilter(this._placeholder),this._cursor=this._filtered.length-1)}async back(e){return await this.checkSession(e),--this._cursor,this._cursor<0&&await this.fetchBatch(),this._cursor=Math.max(0,this._cursor),this._filtered[this._cursor]}async forward(e){return await this.checkSession(e),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor),this._filtered[this._cursor]}updateEditor(e,t){var n,s;if(e){const o=(n=e.editor)===null||n===void 0?void 0:n.model,i=o?.sharedModel.getSource();if(this.isDisposed||!t||i===t)return;this._setByHistory=!0,o?.sharedModel.setSource(t);let a=0;a=t.indexOf(`
1
+ import{r as v,J as Xe,j as m,k3 as Dt,I as J,f3 as Ke,cI as me,bt as ge,v as Y,fx as At,fr as Ze,fI as jt,k4 as It,k5 as Nt,k6 as Qe,k7 as et,cn as V,k8 as Lt,k9 as Rt,ka as Ot,bT as je,kb as ft,kc as mt,kd as Ft,ke as ue,aN as Bt,bU as Ue,kf as gt,kg as Wt,kh as tt,a9 as N,ki as nt,kj as fe,kk as Vt,kl as Ht,km as Gt,aD as pe,kn as Le,ko as st,aE as ke,aF as ee,bg as $t,eJ as zt,ck as U,j$ as Kt,ay as Ut,ct as qt,aA as Z,dB as Jt,d_ as Yt,iH as We,iF as pt,kp as xe,eu as Se,kq as be,kr as Xt,ks as Zt,aI as Qt,aB as en,jZ as tn,kt as _t,ir as K,ku as nn,kv as R,kw as sn,dv as on,kx as vt,ky as rn,kz as an,kA as ln,Y as ne,B as he,dI as dn,_ as cn,au as hn,ey as ot,ez as de,eA as un,cy as fn,k as mn,kB as gn,kC as yt,gJ as pn,kD as ae,bs as D,z as le,dl as it,bE as Ct,e6 as _n,dr as vn,bB as Me,U as yn,P as Cn,aJ as bn,aQ as wn}from"../datalayer-app-main.js";import{b as kn,c as xn,f as ce,P as Re,d as Sn,W as Mn,r as En,g as Tn,h as Pn,i as Dn,C as An,a as jn}from"./index-6zxBQeM_.js";import{c as In,N as Ve}from"./NotebookSkeleton-BkzTMhIX.js";import{H as Nn}from"./hoverbox-CStlKQWE.js";import{R as bt,L as Ln}from"./index-9wJFadG-.js";import{a as Rn,W as rt}from"./renderer-8__rsP1H.js";import{C as Ee,S as Te}from"./SquareIcon-Dy3l3VdH.js";function On(...r){return v.useCallback(e=>{for(const t of r)typeof t=="function"?t(e):t&&(t.current=e)},r)}var Q={Banner:"prc-Banner-Banner-IR8eJ",BannerContainer:"prc-Banner-BannerContainer-lbx3d",BannerContent:"prc-Banner-BannerContent-zTITK",BannerActions:"prc-Banner-BannerActions-XCfHL",BannerTitle:"prc-Banner-BannerTitle-TcuJl",BannerIcon:"prc-Banner-BannerIcon-WuOyf",BannerDismiss:"prc-Banner-BannerDismiss-uBZVm",BannerActionsContainer:"prc-Banner-BannerActionsContainer-ukGMH"};const Fn={critical:m.jsx(It,{}),info:m.jsx(Ze,{}),success:m.jsx(jt,{}),upsell:m.jsx(Ze,{}),warning:m.jsx(At,{})},Bn={critical:"Critical",info:"Information",success:"Success",upsell:"Recommendation",warning:"Warning"},Wn=Xe.forwardRef(function({"aria-label":e,children:t,className:n,description:s,hideTitle:o,icon:i,onDismiss:a,primaryAction:l,secondaryAction:d,title:c,variant:h="info",...u},f){const _=!!a,y=l||d,A=Xe.useRef(null),j=On(f,A),p=h==="info"||h==="upsell";return m.jsxs("section",{...u,"aria-label":e??Bn[h],className:me(n,Q.Banner),"data-dismissible":a?"":void 0,"data-title-hidden":o?"":void 0,"data-variant":h,tabIndex:-1,ref:j,children:[m.jsx("div",{className:Q.BannerIcon,children:i&&p?i:Fn[h]}),m.jsxs("div",{className:Q.BannerContainer,children:[m.jsxs("div",{className:Q.BannerContent,children:[c?o?m.jsx(Dt,{children:m.jsx(He,{children:c})}):m.jsx(He,{children:c}):null,s?m.jsx(wt,{children:s}):null,t]}),y?m.jsx(Vn,{primaryAction:l,secondaryAction:d}):null]}),_?m.jsx(J,{"aria-label":"Dismiss banner",onClick:a,className:Q.BannerDismiss,icon:Ke,variant:"invisible"}):null]})});function He(r){const e=ge.c(12);let t,n,s,o;e[0]!==r?({as:o,className:n,children:t,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s,e[4]=o):(t=e[1],n=e[2],s=e[3],o=e[4]);const i=o===void 0?"h2":o;let a;e[5]!==n?(a=me(n,Q.BannerTitle),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==i||e[8]!==t||e[9]!==s||e[10]!==a?(l=m.jsx(i,{...s,className:a,"data-banner-title":"",children:t}),e[7]=i,e[8]=t,e[9]=s,e[10]=a,e[11]=l):l=e[11],l}function wt(r){const e=ge.c(10);let t,n,s;e[0]!==r?({children:t,className:n,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s):(t=e[1],n=e[2],s=e[3]);let o;e[4]!==n?(o=me("BannerDescription",n),e[4]=n,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==s||e[8]!==o?(i=m.jsx("div",{...s,className:o,children:t}),e[6]=t,e[7]=s,e[8]=o,e[9]=i):i=e[9],i}function Vn(r){const e=ge.c(9),{primaryAction:t,secondaryAction:n}=r,s=n??null,o=t??null;let i;e[0]!==s||e[1]!==o?(i=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"trailing",children:[s,o]}),e[0]=s,e[1]=o,e[2]=i):i=e[2];const a=t??null,l=n??null;let d;e[3]!==a||e[4]!==l?(d=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"leading",children:[a,l]}),e[3]=a,e[4]=l,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==d?(c=m.jsxs("div",{className:Q.BannerActions,children:[i,d]}),e[6]=i,e[7]=d,e[8]=c):c=e[8],c}const kt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"default",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});kt.displayName="BannerPrimaryAction";const xt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"link",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});xt.displayName="BannerSecondaryAction";const Hn=Object.assign(Wn,{Title:He,Description:wt,PrimaryAction:kt,SecondaryAction:xt}),_e=Rt.define({combine(r){return r[r.length-1]}}),Gn=je.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip.jp-remote-userInfo":{color:"var(--fgColor-onEmphasis, #ffffff)",padding:"0px 2px"}});function qe(r,e){const t=r?.username||r?.display_name||r?.name||String(e),{theme:n,colorMode:s}=Bt.getState(),o=s==="auto"?typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":s;return In(t,n,o)}const Ie=Ot.define();class St{style;marker;constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,n]of Object.entries(this.style))e.style[t]=n;return e}eq(e){return this.marker.eq(e.marker)&&V.deepEqual(this.style,e.style)}update(e,t){for(const[n,s]of Object.entries(this.style))e.style[n]=s;return this.marker.update(e,t.marker)}}const $n=ft({above:!0,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if(!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h=l.primary??!0?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",u=Ue.cursor(c.index,c.index>d.index?-1:1);for(const f of gt.forRange(r,h,u))s.push(new St({borderLeftColor:qe(o.user,i)},f))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-cursors"});function at(r){const e=new Array,{awareness:t,ytext:n}=r.facet(_e),s=n.doc;for(const[o,i]of t.getStates())if(o!==t.doc.clientID)for(const a of i.cursors??[]){if(!a?.head)continue;const l=ue(a.head,s);l?.type===n&&e.push({pos:l.index,above:!0,create:()=>{const d=document.createElement("div");return d.classList.add("jp-remote-userInfo"),d.style.backgroundColor=qe(i.user,o),d.textContent=i.user?.display_name??"Anonymous",{dom:d}}})}return e}const zn=mt.define({create:at,update(r,e){return e.annotation(Ie)?at(e.state):r},provide(r){return Ft.computeN([r],e=>e.field(r))}}),Kn=ft({above:!1,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if((l.empty??!0)||!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h="jp-remote-selection";for(const u of gt.forRange(r,h,Ue.range(d.index,c.index)))s.push(new St({backgroundColor:qe(o.user,i)},u))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-selections"}),Un=Nt.fromClass(class{editorAwareness;_listener;constructor(r){this.editorAwareness=r.state.facet(_e),this._listener=({added:e,updated:t,removed:n})=>{e.concat(t).concat(n).findIndex(o=>o!==this.editorAwareness.awareness.doc.clientID)>=0&&r.dispatch({annotations:[Ie.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(r){if(!r.docChanged&&!r.selectionSet)return;const{awareness:e,ytext:t}=this.editorAwareness,n=e.getLocalState();if(n){const s=r.view.hasFocus&&r.view.dom.ownerDocument.hasFocus(),o=r.state.selection,i=new Array;if(s&&o){for(const a of o.ranges){const l=a===o.main,d=Qe(t,a.anchor),c=Qe(t,a.head);i.push({anchor:d,head:c,primary:l,empty:a.empty})}if(!n.cursors||i.length>0){const a=n.cursors?.map(l=>({...l,anchor:l?.anchor?et(l.anchor):null,head:l?.head?et(l.head):null}));V.deepEqual(i,a)||e.setLocalStateField("cursors",i)}}}}},{provide:()=>[Gn,$n,Kn,zn,Lt({position:"absolute",parent:document.body})]});function qn(r){return[_e.of(r),Un]}class Ne extends Wt{constructor(e={}){var t;super(),this.version="2.0.0",this.ymeta=this.ydoc.getMap("meta"),this._onMetaChanged=n=>{const s=n.find(i=>i.target===this.ymeta.get("metadata"));if(s){const i=s.changes.keys,a=this.ymeta.get("metadata");s.changes.keys.forEach((l,d)=>{switch(l.action){case"add":this._metadataChanged.emit({key:d,type:"add",newValue:a.get(d)});break;case"delete":this._metadataChanged.emit({key:d,type:"remove",oldValue:l.oldValue});break;case"update":{const c=a.get(d),h=l.oldValue;let u=!0;typeof h=="object"&&typeof c=="object"?u=V.deepEqual(h,c):u=h===c,u||this._metadataChanged.emit({key:d,type:"change",oldValue:h,newValue:c})}break}}),this._changed.emit({metadataChange:i})}const o=n.find(i=>i.target===this.ymeta);if(o){if(o.keysChanged.has("metadata")){const i=o.changes.keys.get("metadata");if(i?.action==="add"&&!i.oldValue){const a=new Map;for(const l of Object.keys(this.metadata))a.set(l,{action:"add",oldValue:void 0}),this._metadataChanged.emit({key:l,type:"add",newValue:this.getMetadata(l)});this._changed.emit({metadataChange:a})}}if(o.keysChanged.has("nbformat")){const i=o.changes.keys.get("nbformat"),a={key:"nbformat",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat};this._changed.emit({nbformatChanged:a})}if(o.keysChanged.has("nbformat_minor")){const i=o.changes.keys.get("nbformat_minor"),a={key:"nbformat_minor",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat_minor};this._changed.emit({nbformatChanged:a})}}},this._onYCellsChanged=n=>{n.changes.added.forEach(i=>{const a=i.content.type;if(!this._ycellMapping.has(a)){const l=tt(a,{notebook:this});this._ycellMapping.set(a,l)}}),n.changes.deleted.forEach(i=>{const a=i.content.type,l=this._ycellMapping.get(a);l&&(l.dispose(),this._ycellMapping.delete(a))});let s=0;const o=[];n.changes.delta.forEach(i=>{if(i.insert!=null){const a=i.insert.map(l=>this._ycellMapping.get(l));o.push({insert:a}),this.cells.splice(s,0,...a),s+=i.insert.length}else i.delete!=null?(o.push(i),this.cells.splice(s,i.delete)):i.retain!=null&&(o.push(i),s+=i.retain)}),this._changed.emit({cellsChange:o})},this._metadataChanged=new N(this),this._ycells=this.ydoc.getArray("cells"),this._ycellMapping=new WeakMap,this._disableDocumentWideUndoRedo=(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1,this.cells=this._ycells.toArray().map(n=>(this._ycellMapping.has(n)||this._ycellMapping.set(n,tt(n,{notebook:this})),this._ycellMapping.get(n))),this.undoManager.addToScope(this._ycells),this._ycells.observe(this._onYCellsChanged),this.ymeta.observeDeep(this._onMetaChanged)}static create(e={}){var t,n,s,o,i,a,l,d,c;const h=new Ne({disableDocumentWideUndoRedo:(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1}),u={cells:(s=(n=e.data)===null||n===void 0?void 0:n.cells)!==null&&s!==void 0?s:[],nbformat:(i=(o=e.data)===null||o===void 0?void 0:o.nbformat)!==null&&i!==void 0?i:4,nbformat_minor:(l=(a=e.data)===null||a===void 0?void 0:a.nbformat_minor)!==null&&l!==void 0?l:5,metadata:(c=(d=e.data)===null||d===void 0?void 0:d.metadata)!==null&&c!==void 0?c:{}};return h.setSource(u),h}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}get metadata(){return this.getMetadata()}set metadata(e){this.setMetadata(e)}get metadataChanged(){return this._metadataChanged}get nbformat(){return this.ymeta.get("nbformat")}set nbformat(e){this.transact(()=>{this.ymeta.set("nbformat",e)},!1)}get nbformat_minor(){return this.ymeta.get("nbformat_minor")}set nbformat_minor(e){this.transact(()=>{this.ymeta.set("nbformat_minor",e)},!1)}dispose(){this.isDisposed||(this._ycells.unobserve(this._onYCellsChanged),this.ymeta.unobserveDeep(this._onMetaChanged),super.dispose())}getCell(e){return this.cells[e]}addCell(e){return this.insertCell(this._ycells.length,e)}insertCell(e,t){return this.insertCells(e,[t])[0]}insertCells(e,t){const n=t.map(s=>{const o=nt(s,this);return this._ycellMapping.set(o.ymodel,o),o});return this.transact(()=>{this._ycells.insert(e,n.map(s=>s.ymodel))}),this.dirty=!0,n}moveCell(e,t){this.moveCells(e,t)}moveCells(e,t,n=1){const s=new Array(n).fill(!0).map((o,i)=>this.getCell(e+i).toJSON());this.transact(()=>{this._ycells.delete(e,n),this._ycells.insert(e>t?t:t-n+1,s.map(o=>nt(o,this).ymodel))}),this.dirty=!0}deleteCell(e){this.deleteCellRange(e,e+1)}deleteCellRange(e,t){this.transact(()=>{this._ycells.delete(e,t-e)}),this.dirty=!0}deleteMetadata(e){if(typeof this.getMetadata(e)>"u")return;const t=this.metadata;delete t[e],this.setMetadata(t)}getMetadata(e){const t=this.ymeta.get("metadata");if(t!==void 0)if(typeof e=="string"){const n=t.get(e);return typeof n>"u"?void 0:V.deepCopy(n)}else return V.deepCopy(t.toJSON())}setMetadata(e,t){var n;if(typeof e=="string"){if(typeof t>"u")throw new TypeError(`Metadata value for ${e} cannot be 'undefined'; use deleteMetadata.`);if(V.deepEqual((n=this.getMetadata(e))!==null&&n!==void 0?n:null,t))return;const s={};s[e]=t,this.updateMetadata(s)}else if(!this.metadata||!V.deepEqual(this.metadata,e)){const s=V.deepCopy(e),o=this.ymeta.get("metadata");if(o===void 0)return;this.transact(()=>{o.clear();for(const[i,a]of Object.entries(s))o.set(i,a)}),this.dirty=!0}}updateMetadata(e){const t=V.deepCopy(e),n=this.ymeta.get("metadata");n!==void 0&&(this.transact(()=>{for(const[s,o]of Object.entries(t))n.set(s,o)}),this.dirty=!0)}getSource(){return this.toJSON()}setSource(e){this.fromJSON(e),this.dirty=!1}fromJSON(e){this.transact(()=>{this.nbformat=e.nbformat,this.nbformat_minor=e.nbformat_minor;const t=e.metadata;if(t.orig_nbformat!==void 0&&delete t.orig_nbformat,this.metadata)this.metadata=t;else{const o=new fe;for(const[i,a]of Object.entries(t))o.set(i,a);this.ymeta.set("metadata",o)}const n=e.nbformat===4&&e.nbformat_minor>=5,s=e.cells.map(o=>(n||delete o.id,o));this.insertCells(this.cells.length,s),this.deleteCellRange(0,this.cells.length)})}toJSON(){const e=this.nbformat===4&&this.nbformat_minor<=4;return Ge({metadata:this.metadata,nbformat_minor:this.nbformat_minor,nbformat:this.nbformat,cells:this.cells.map(t=>{const n=t.toJSON();return e&&delete n.id,n})})}}function Ge(r){if(Array.isArray(r))return r.map(e=>Ge(e));if(r!==null&&typeof r=="object"){const e={},t=Object.entries(r).sort(([n],[s])=>n<s?-1:n>s?1:0);for(const[n,s]of t)Object.defineProperty(e,n,{value:Ge(s),enumerable:!0,writable:!0,configurable:!0});return e}return r}class Jn{constructor(e){this.model=e,this._cellMap=new WeakMap,this._changed=new N(this),this._isDisposed=!1,this._insertCells(0,this.model.cells),this.model.changed.connect(this._onSharedModelChanged,this)}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get length(){return this.model.cells.length}*[Symbol.iterator](){for(const e of this.model.cells)yield this._cellMap.get(e)}dispose(){var e;if(!this._isDisposed){this._isDisposed=!0;for(const t of this.model.cells)(e=this._cellMap.get(t))===null||e===void 0||e.dispose();N.clearData(this)}}get(e){return this._cellMap.get(this.model.cells[e])}_insertCells(e,t){return t.forEach(n=>{let s;switch(n.cell_type){case"code":{s=new Gt({sharedModel:n});break}case"markdown":{s=new Ht({sharedModel:n});break}default:s=new Vt({sharedModel:n})}this._cellMap.set(n,s),n.disposed.connect(()=>{s.dispose(),this._cellMap.delete(n)})}),this.length}_onSharedModelChanged(e,t){var n;let s=0;const o=new Array;(n=t.cellsChange)===null||n===void 0||n.forEach(i=>{i.insert!=null?(this._insertCells(s,i.insert),o.push({type:"add",newIndex:s,newValues:i.insert.map(a=>this._cellMap.get(a)),oldIndex:-2,oldValues:[]}),s+=i.insert.length):i.delete!=null?o.push({type:"remove",newIndex:-1,newValues:[],oldIndex:s,oldValues:new Array(i.delete).fill(void 0)}):i.retain!=null&&(s+=i.retain)}),o.forEach(i=>this._changed.emit(i))}}class Yn{constructor(e){this._requestBatchSize=10,this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._kernelSession="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[],this._kernel=null,this._sessionContext=e.sessionContext,this._trans=(e.translator||pe).load("jupyterlab"),this._toRequest=this._requestBatchSize,this._handleKernel().then(()=>{this._sessionContext.kernelChanged.connect(this._handleKernel,this)})}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&t.model.sharedModel.changed.disconnect(this.onTextChange,this),this._editor=e,e&&e.model.sharedModel.changed.connect(this.onTextChange,this)}get placeholder(){return this._placeholder}get kernelSession(){return this._kernelSession}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,N.clearData(this)}async checkSession(e){var t;this._hasSession||(await this._retrieveHistory(),this._hasSession=!0,this.editor=e.editor,this._placeholder=((t=this._editor)===null||t===void 0?void 0:t.model.sharedModel.getSource())||"",this.setFilter(this._placeholder),this._cursor=this._filtered.length-1)}async back(e){return await this.checkSession(e),--this._cursor,this._cursor<0&&await this.fetchBatch(),this._cursor=Math.max(0,this._cursor),this._filtered[this._cursor]}async forward(e){return await this.checkSession(e),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor),this._filtered[this._cursor]}updateEditor(e,t){var n,s;if(e){const o=(n=e.editor)===null||n===void 0?void 0:n.model,i=o?.sharedModel.getSource();if(this.isDisposed||!t||i===t)return;this._setByHistory=!0,o?.sharedModel.setSource(t);let a=0;a=t.indexOf(`
2
2
  `),a<0&&(a=t.length),(s=e.editor)===null||s===void 0||s.setCursorPosition({line:0,column:a})}}reset(){this._hasSession=!1,this._placeholder="",this._toRequest=this._requestBatchSize}async fetchBatch(){this._toRequest+=this._requestBatchSize;let e=this._filtered.slice().reverse(),t=this._history.slice();await this._retrieveHistory().then(()=>{this.setFilter(this._placeholder);let n=0,s=this._filtered.slice().reverse();for(let o=0;o<e.length;o++){let i=e[o];for(let a=o+n;a<s.length&&i!==s[a];a++)n+=1}this._cursor=this._filtered.length-(e.length+1)-n}),this._cursor<0&&this._history.length>t.length&&await this.fetchBatch()}onHistory(e,t){this._history.length=0;let n=["","",""],s=["","",""],o="";if(e.content.status==="ok"){for(let i=0;i<e.content.history.length;i++)s=e.content.history[i],s!==n&&(o=e.content.history[i][0],this._history.push(n=s));this.kernelSession||s[2]==t?.model.sharedModel.getSource()&&(this._kernelSession=o)}}onTextChange(){if(this._setByHistory){this._setByHistory=!1;return}this.reset()}async _handleKernel(){var e;if(this._kernel=(e=this._sessionContext.session)===null||e===void 0?void 0:e.kernel,!this._kernel){this._history.length=0;return}await this._retrieveHistory().catch()}async _retrieveHistory(e){var t;return await((t=this._kernel)===null||t===void 0?void 0:t.requestHistory(Xn(this._toRequest)).then(n=>{this.onHistory(n,e)}).catch(()=>{console.warn(this._trans.__("History was unable to be retrieved"))}))}setFilter(e=""){this._filtered.length=0;let t="",n="";for(let s=0;s<this._history.length;s++)n=this._history[s][2],n!==t&&e!==n&&this._filtered.push(t=n);this._filtered.push(e)}}function Xn(r){return{output:!1,raw:!0,hist_access_type:"tail",n:r}}class $e{constructor(e={}){var t,n;this.standaloneModel=!1,this._readOnly=!1,this._contentChanged=new N(this),this._stateChanged=new N(this),this._isDisposed=!1,this._metadataChanged=new N(this),this.standaloneModel=typeof e.sharedModel>"u",e.sharedModel?this.sharedModel=e.sharedModel:this.sharedModel=Ne.create({disableDocumentWideUndoRedo:(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!0,data:{nbformat:st,nbformat_minor:Le,metadata:{kernelspec:{name:"",display_name:""},language_info:{name:(n=e.languagePreference)!==null&&n!==void 0?n:""}}}}),this._cells=new Jn(this.sharedModel),this._trans=(e.translator||pe).load("jupyterlab"),this._deletedCells=[],this._collaborationEnabled=!!e?.collaborationEnabled,this._cells.changed.connect(this._onCellsChanged,this),this.sharedModel.changed.connect(this._onStateChanged,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get contentChanged(){return this._contentChanged}get metadataChanged(){return this._metadataChanged}get stateChanged(){return this._stateChanged}get cells(){return this._cells}get dirty(){return this.sharedModel.dirty}set dirty(e){const t=this.dirty;e!==t&&(this.sharedModel.dirty=e)}get readOnly(){return this._readOnly}set readOnly(e){if(e===this._readOnly)return;const t=this._readOnly;this._readOnly=e,this.triggerStateChange({name:"readOnly",oldValue:t,newValue:e})}get metadata(){return this.sharedModel.metadata}get nbformat(){return this.sharedModel.nbformat}get nbformatMinor(){return this.sharedModel.nbformat_minor}get defaultKernelName(){var e;const t=this.getMetadata("kernelspec");return(e=t?.name)!==null&&e!==void 0?e:""}get deletedCells(){return this._deletedCells}get defaultKernelLanguage(){var e;const t=this.getMetadata("language_info");return(e=t?.name)!==null&&e!==void 0?e:""}get collaborative(){return this._collaborationEnabled}dispose(){if(this.isDisposed)return;this._isDisposed=!0;const e=this.cells;this._cells=null,e.dispose(),this.standaloneModel&&this.sharedModel.dispose(),N.clearData(this)}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){typeof t>"u"?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toString(){return JSON.stringify(this.toJSON())}fromString(e){this.fromJSON(JSON.parse(e))}toJSON(){return this._ensureMetadata(),this.sharedModel.toJSON()}fromJSON(e){var t,n;const s=V.deepCopy(e),o=e.metadata.orig_nbformat;if(s.nbformat=Math.max(e.nbformat,st),(s.nbformat!==e.nbformat||s.nbformat_minor<Le)&&(s.nbformat_minor=Le),o!==void 0&&s.nbformat!==o){const i=s.nbformat>o;let a;i?a=this._trans.__(`This notebook has been converted from an older notebook format (v%1)
3
3
  to the current notebook format (v%2).
4
4
  The next time you save this notebook, the current notebook format (v%2) will be used.
@@ -1 +1 @@
1
- import{aa as t,r as i}from"../datalayer-app-main.js";import{I as l,r}from"./JupyterLexicalExtension-BtjDYMne.js";import{$ as k,a as q,b as v,c as w,d as y,e as z,C as F,f as G,g as H}from"./JupyterLexicalExtension-BtjDYMne.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"./Output-BfmeU6C2.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-BKAeSGYJ.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";import"./LexicalToolRegistry-LfEpCrfD.js";function R(){const[o]=t();return i.useEffect(()=>r(o),[o]),null}export{k as $createCollapsibleContainerNode,q as $createCollapsibleContentNode,v as $createCollapsibleTitleNode,w as $isCollapsibleContainerNode,y as $isCollapsibleContentNode,z as $isCollapsibleTitleNode,F as CollapsibleContainerNode,G as CollapsibleContentNode,R as CollapsiblePlugin,H as CollapsibleTitleNode,l as INSERT_COLLAPSIBLE_COMMAND,R as default};
1
+ import{aa as t,r as i}from"../datalayer-app-main.js";import{I as l,r}from"./JupyterLexicalExtension-CEBuhvME.js";import{$ as k,a as q,b as v,c as w,d as y,e as z,C as F,f as G,g as H}from"./JupyterLexicalExtension-CEBuhvME.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"./Output-C6ZHZSBH.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";import"./LexicalToolRegistry-LfEpCrfD.js";function R(){const[o]=t();return i.useEffect(()=>r(o),[o]),null}export{k as $createCollapsibleContainerNode,q as $createCollapsibleContentNode,v as $createCollapsibleTitleNode,w as $isCollapsibleContainerNode,y as $isCollapsibleContentNode,z as $isCollapsibleTitleNode,F as CollapsibleContainerNode,G as CollapsibleContentNode,R as CollapsiblePlugin,H as CollapsibleTitleNode,l as INSERT_COLLAPSIBLE_COMMAND,R as default};
@@ -1,4 +1,4 @@
1
- import{cJ as Mt,cK as je,cL as We,cM as Qe,cN as Ke,cO as Xe,cP as Ze,cQ as Je,cR as et,cS as tt,cT as xe,r as Q,j as S,aN as Tr,_ as vr,kF as Cr,aa as yr,cg as Rr,I as Nr,ch as Or,D as Ar,gI as Ir,bE as ua,T as xr}from"../datalayer-app-main.js";import{x as Dr,B as wr,N as kr}from"./JupyterLexicalExtension-BtjDYMne.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"./Output-BfmeU6C2.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-BKAeSGYJ.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";import"./LexicalToolRegistry-LfEpCrfD.js";const pa={datalayer:{light:{primary:xe.greenAccent,secondary:xe.greenText,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenBrand]},dark:{primary:xe.greenBright,secondary:xe.greenAccent,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenText]}},spatial:{light:{primary:tt.indigoBrand,secondary:tt.indigoText,textColor:tt.gray,primaryGradient:[tt.indigoBright,tt.indigoBrand],secondaryGradient:[tt.indigoHover,tt.indigoAccent]},dark:{primary:tt.indigoBright,secondary:tt.indigoAccent,textColor:tt.gray,primaryGradient:[tt.indigoBright,tt.indigoBrand],secondaryGradient:[tt.indigoHover,tt.indigoAccent]}},lovely:{light:{primary:et.roseBrand,secondary:et.roseText,textColor:et.gray,primaryGradient:[et.roseBright,et.roseBrand],secondaryGradient:[et.roseHover,et.roseAccent]},dark:{primary:et.roseBright,secondary:et.roseAccent,textColor:et.gray,primaryGradient:[et.roseBright,et.roseBrand],secondaryGradient:[et.roseHover,et.roseAccent]}},matrix:{light:{primary:Je.greenBrand,secondary:Je.greenText,textColor:Je.gray,primaryGradient:[Je.greenGlow,Je.greenBrand],secondaryGradient:[Je.greenHover,Je.greenAccent]},dark:{primary:Je.greenGlow,secondary:Je.greenPhosphor,textColor:Je.gray,primaryGradient:[Je.greenGlow,Je.greenBrand],secondaryGradient:[Je.greenHover,Je.greenAccent]}},earth:{light:{primary:Ze.oceanBrand,secondary:Ze.oceanText,textColor:Ze.gray,primaryGradient:[Ze.oceanAccent,Ze.oceanBrand],secondaryGradient:[Ze.oceanHover,Ze.oceanText]},dark:{primary:Ze.oceanBright,secondary:Ze.oceanAccent,textColor:Ze.gray,primaryGradient:[Ze.oceanBright,Ze.oceanBrand],secondaryGradient:[Ze.oceanHover,Ze.oceanAccent]}},sand:{light:{primary:Xe.sandBrand,secondary:Xe.sandText,textColor:Xe.gray,primaryGradient:[Xe.sandAccent,Xe.sandBrand],secondaryGradient:[Xe.sandHover,Xe.sandText]},dark:{primary:Xe.sandBright,secondary:Xe.sandAccent,textColor:Xe.gray,primaryGradient:[Xe.sandBright,Xe.sandBrand],secondaryGradient:[Xe.sandHover,Xe.sandAccent]}},ivory:{light:{primary:Ke.ivoryBrand,secondary:Ke.ivoryText,textColor:Ke.gray,primaryGradient:[Ke.ivoryAccent,Ke.ivoryBrand],secondaryGradient:[Ke.ivoryHover,Ke.ivoryText]},dark:{primary:Ke.ivoryBright,secondary:Ke.ivoryAccent,textColor:Ke.gray,primaryGradient:[Ke.ivoryBright,Ke.ivoryBrand],secondaryGradient:[Ke.ivoryHover,Ke.ivoryAccent]}},sun:{light:{primary:Qe.sunBrand,secondary:Qe.sunText,textColor:Qe.gray,primaryGradient:[Qe.sunAccent,Qe.sunBrand],secondaryGradient:[Qe.sunHover,Qe.sunText]},dark:{primary:Qe.sunBright,secondary:Qe.sunAccent,textColor:Qe.gray,primaryGradient:[Qe.sunBright,Qe.sunBrand],secondaryGradient:[Qe.sunHover,Qe.sunAccent]}},loop:{light:{primary:We.loopAccent,secondary:We.ink,textColor:We.gray,primaryGradient:[We.loopAccent,We.loopAccent],secondaryGradient:[We.ink,We.ink]},dark:{primary:We.loopBrand,secondary:We.inkDark,textColor:We.grayDark,primaryGradient:[We.loopBrand,We.loopBrand],secondaryGradient:[We.inkDark,We.inkDark]}},metal:{light:{primary:je.steelFrom,secondary:je.ink,textColor:je.gray,primaryGradient:[je.steelFrom,je.steelTo],secondaryGradient:[je.ink,je.ink]},dark:{primary:je.metalBright,secondary:je.inkDark,textColor:je.grayDark,primaryGradient:[je.metalBright,je.brightPop],secondaryGradient:[je.inkDark,je.inkDark]}},vscode:{light:{primary:Mt.vscodeText,secondary:"#3B3B3B",textColor:"#767676",primaryGradient:[Mt.vscodeText,Mt.vscodeText],secondaryGradient:["#3B3B3B","#3B3B3B"]},dark:{primary:Mt.vscodeAccent,secondary:"#CCCCCC",textColor:Mt.gray,primaryGradient:[Mt.vscodeAccent,Mt.vscodeAccent],secondaryGradient:["#CCCCCC","#CCCCCC"]}}};function Va(i="datalayer",t="light"){const n=t==="auto"?"light":t;return pa[i]?.[n]??pa.datalayer.light}const ma=25,Mr=[{y:0,secondaryWidth:30,primaryWidth:70},{y:37.5,secondaryWidth:50,primaryWidth:50},{y:75,secondaryWidth:70,primaryWidth:30}];Q.forwardRef(function({size:t=16,variant:n="datalayer",colorMode:e="light",primaryColor:a,secondaryColor:r,primaryGradient:s,secondaryGradient:o,gradient:l=!0,...c},d){const _=Va(n,e),u=a??_.primary,m=r??_.secondary,p=Q.useId().replace(/:/g,""),[g,b]=s??_.primaryGradient,[C,y]=o??_.secondaryGradient;return S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:t,height:t,"aria-hidden":"true",ref:d,...c,children:[l&&S.jsxs("defs",{children:[S.jsxs("linearGradient",{id:`${p}-p`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:g}),S.jsx("stop",{offset:"1",stopColor:b})]}),S.jsxs("linearGradient",{id:`${p}-s`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:C}),S.jsx("stop",{offset:"1",stopColor:y})]})]}),Mr.map(({y:N,secondaryWidth:O,primaryWidth:v})=>S.jsxs("g",{children:[S.jsx("rect",{x:0,y:N,width:O,height:ma,fill:l?`url(#${p}-p)`:u}),S.jsx("rect",{x:O,y:N,width:v,height:ma,fill:l?`url(#${p}-s)`:m})]},N))]})});const za=new Map,In=i=>za.get(i),sn=i=>za.has(i),Lr=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|==[^=]+==)/g,ie=i=>i.split(Lr).map((t,n)=>{const e=`${n}-${t}`;if(t.startsWith("**")&&t.endsWith("**"))return S.jsx("strong",{children:ie(t.slice(2,-2))},e);if(t.startsWith("`")&&t.endsWith("`"))return S.jsx("code",{children:t.slice(1,-1)},e);if(t.startsWith("==")&&t.endsWith("=="))return S.jsx("mark",{className:"dla-alert",children:t.slice(2,-2)},e);const a=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(t);return a?S.jsx("a",{href:a[2],target:"_blank",rel:"noopener noreferrer",children:a[1]},e):t}),Pr=i=>i.trim().split(/\n\s*\n/).map((t,n)=>S.jsx("p",{children:ie(t.trim())},`${n}-${t.slice(0,24)}`)),Fr=()=>{const{theme:i,colorMode:t}=Tr();return{theme:i,colorMode:t}},Ur={useTheme:Fr},Br=Q.createContext(Ur),qa=()=>Q.useContext(Br),$a=()=>{const{useTheme:i}=qa();return i()},xn=({footer:i,theme:t,index:n,total:e})=>{const{colorMode:a,theme:r}=$a(),{Logo:s}=qa(),o=a==="auto"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a,l=Va(r,o),c=new Date().getFullYear(),d=i.since&&i.since<c?`${i.since}–${c}`:`${c}`;return S.jsxs("div",{className:"dla-slide-footer",children:[i.logo&&S.jsx("a",{className:"dla-slide-footer-logo",href:i.href,target:"_blank",rel:"noopener noreferrer","aria-label":`${i.holder} — ${i.href}`,children:s?S.jsx(s,{height:26,variant:r,colorMode:a,inverse:t.logo.inverse,colored:t.logo.colored,primaryColor:t.logo.primaryColor??l.primary,secondaryColor:t.logo.secondaryColor??l.secondary,textColor:t.logo.textColor??l.textColor}):S.jsx("span",{className:"dla-slide-footer-holder",children:i.holder})}),i.note&&S.jsx("div",{className:"dla-slide-footer-note",children:i.note}),S.jsxs("div",{className:"dla-slide-footer-legal",children:[S.jsx("a",{href:i.href,target:"_blank",rel:"noopener noreferrer",children:i.href.replace(/^https?:\/\//,"")}),S.jsxs("span",{children:["© ",d," ",i.holder]}),i.slideNumbers&&S.jsxs("span",{className:"dla-slide-footer-number",children:[n," / ",e]})]})]})},Dn=({name:i})=>{if(!i)return null;const t=In(i);return t?S.jsx("div",{className:"dla-slide-backdrop","aria-hidden":!0,children:S.jsx(t,{})}):null},Le=({theme:i,footer:t,index:n,total:e,eyebrow:a,title:r,subtitle:s,layout:o,variant:l,backdrop:c,children:d})=>{const _=["dla-slide"];return l&&_.push(`dla-slide--${l}`),(o==="centered"||o==="full-bleed")&&_.push(`dla-slide--${o}`),S.jsxs("div",{className:_.join(" "),children:[S.jsx(Dn,{name:c}),S.jsxs("div",{className:"dla-slide-head",children:[a&&S.jsx("div",{className:"dla-slide-eyebrow",children:a}),r&&S.jsx("h2",{className:"dla-slide-title",children:ie(r)}),s&&S.jsx("p",{className:"dla-slide-subtitle",children:ie(s)})]}),S.jsx("div",{className:"dla-slide-body",children:d}),t&&S.jsx(xn,{footer:t,theme:i,index:n,total:e})]})};var Qt=(i,t)=>{for(let n in t)i[n]=t[n];return i},j=(i,t)=>Array.from(i.querySelectorAll(t)),Pn=(i,t,n)=>{n?i.classList.add(t):i.classList.remove(t)},Wt=i=>{if(typeof i=="string"){if(i==="null")return null;if(i==="true")return!0;if(i==="false")return!1;if(i.match(/^-?[\d\.]+$/))return parseFloat(i)}return i},Nt=(i,t)=>{i.style.transform=t},Rn=(i,t)=>{let n=i.matches||i.matchesSelector||i.msMatchesSelector;return!!(n&&n.call(i,t))},De=(i,t)=>{if(i&&typeof i.closest=="function")return i.closest(t);for(;i;){if(Rn(i,t))return i;i=i.parentElement}return null},ja=i=>{i=i||document.documentElement;let t=i.requestFullscreen||i.webkitRequestFullscreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullscreen;t&&t.apply(i)},Gr=(i,t,n,e="")=>{let a=i.querySelectorAll("."+n);for(let s=0;s<a.length;s++){let o=a[s];if(o.parentNode===i)return o}let r=document.createElement(t);return r.className=n,r.innerHTML=e,i.appendChild(r),r},zn=i=>{let t=document.createElement("style");return i&&i.length>0&&t.appendChild(document.createTextNode(i)),document.head.appendChild(t),t},ga=()=>{let i={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split("=").shift(),e=t.split("=").pop();return n&&e!==void 0&&(i[n]=e),t});for(let t in i){let n=i[t];i[t]=Wt(unescape(n))}return i.dependencies!==void 0&&delete i.dependencies,i},Yr=(i,t=0)=>{if(i){var n;let e,a=i.style.height;return i.style.height="0px",i.parentElement&&(i.parentElement.style.height="auto"),e=t-(((n=i.parentElement)==null?void 0:n.offsetHeight)||0),i.style.height=a+"px",i.parentElement&&i.parentElement.style.removeProperty("height"),e}return t},Hr={mp4:"video/mp4",m4a:"video/mp4",ogv:"video/ogg",mpeg:"video/mpeg",webm:"video/webm"},Vr=(i="")=>{let t=i.split(".").pop();return t?Hr[t]:void 0},zr=(i="")=>encodeURI(i).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Wa=navigator.userAgent,Ft=/(iphone|ipod|ipad|android)/gi.test(Wa)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Qa=/android/gi.test(Wa),qr=(function(i){if(i){var t=function(R){return[].slice.call(R)},n=0,e=1,a=2,r=3,s=[],o=null,l="requestAnimationFrame"in i?function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};i.cancelAnimationFrame(o);var U=function(){return d(s.filter((function(z){return z.dirty&&z.active})))};if(R.sync)return U();o=i.requestAnimationFrame(U)}:function(){},c=function(R){return function(U){s.forEach((function(z){return z.dirty=R})),l(U)}},d=function(R){R.filter((function(z){return!z.styleComputed})).forEach((function(z){z.styleComputed=p(z)})),R.filter(g).forEach(b);var U=R.filter(m);U.forEach(u),U.forEach((function(z){b(z),_(z)})),U.forEach(C)},_=function(R){return R.dirty=n},u=function(R){R.availableWidth=R.element.parentNode.clientWidth,R.currentWidth=R.element.scrollWidth,R.previousFontSize=R.currentFontSize,R.currentFontSize=Math.min(Math.max(R.minSize,R.availableWidth/R.currentWidth*R.previousFontSize),R.maxSize),R.whiteSpace=R.multiLine&&R.currentFontSize===R.minSize?"normal":"nowrap"},m=function(R){return R.dirty!==a||R.dirty===a&&R.element.parentNode.clientWidth!==R.availableWidth},p=function(R){var U=i.getComputedStyle(R.element,null);return R.currentFontSize=parseFloat(U.getPropertyValue("font-size")),R.display=U.getPropertyValue("display"),R.whiteSpace=U.getPropertyValue("white-space"),!0},g=function(R){var U=!1;return!R.preStyleTestCompleted&&(/inline-/.test(R.display)||(U=!0,R.display="inline-block"),R.whiteSpace!=="nowrap"&&(U=!0,R.whiteSpace="nowrap"),R.preStyleTestCompleted=!0,U)},b=function(R){R.element.style.whiteSpace=R.whiteSpace,R.element.style.display=R.display,R.element.style.fontSize=R.currentFontSize+"px"},C=function(R){R.element.dispatchEvent(new CustomEvent("fit",{detail:{oldValue:R.previousFontSize,newValue:R.currentFontSize,scaleFactor:R.currentFontSize/R.previousFontSize}}))},y=function(R,U){return function(z){R.dirty=U,R.active&&l(z)}},N=function(R){return function(){s=s.filter((function(U){return U.element!==R.element})),R.observeMutations&&R.observer.disconnect(),R.element.style.whiteSpace=R.originalStyle.whiteSpace,R.element.style.display=R.originalStyle.display,R.element.style.fontSize=R.originalStyle.fontSize}},O=function(R){return function(){R.active||(R.active=!0,l())}},v=function(R){return function(){return R.active=!1}},A=function(R){R.observeMutations&&(R.observer=new MutationObserver(y(R,e)),R.observer.observe(R.element,R.observeMutations))},M={minSize:16,maxSize:512,multiLine:!0,observeMutations:"MutationObserver"in i&&{subtree:!0,childList:!0,characterData:!0}},F=null,Y=function(){i.clearTimeout(F),F=i.setTimeout(c(a),B.observeWindowDelay)},x=["resize","orientationchange"];return Object.defineProperty(B,"observeWindow",{set:function(R){var U=`${R?"add":"remove"}EventListener`;x.forEach((function(z){i[U](z,Y)}))}}),B.observeWindow=!0,B.observeWindowDelay=100,B.fitAll=c(r),B}function K(R,U){var z=Object.assign({},M,U),Z=R.map((function(te){var se=Object.assign({},z,{element:te,active:!0});return(function(ae){ae.originalStyle={whiteSpace:ae.element.style.whiteSpace,display:ae.element.style.display,fontSize:ae.element.style.fontSize},A(ae),ae.newbie=!0,ae.dirty=!0,s.push(ae)})(se),{element:te,fit:y(se,r),unfreeze:O(se),freeze:v(se),unsubscribe:N(se)}}));return l(),Z}function B(R){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof R=="string"?K(t(document.querySelectorAll(R)),U):K([R],U)[0]}})(typeof window>"u"?null:window);function dn(i){"@babel/helpers - typeof";return dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(i)}function $r(i,t){if(dn(i)!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var e=n.call(i,t);if(dn(e)!="object")return e;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function jr(i){var t=$r(i,"string");return dn(t)=="symbol"?t:t+""}function Zn(i,t,n){return(t=jr(t))in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}var Wr=class{constructor(t){Zn(this,"allowedToPlayAudio",null),this.Reveal=t,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement("button"),this.mediaPlayButton.className="r-overlay-button r-media-play-button",this.mediaPlayButton.addEventListener("click",()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{this.startEmbeddedMedia({target:t})}),this.clearMediaPlaybackErrors()})}shouldPreload(t){if(this.Reveal.isScrollView())return!0;let n=this.Reveal.getConfig().preloadIframes;return typeof n!="boolean"&&(n=t.hasAttribute("data-preload")),n}load(t,n={}){let e=this.Reveal.getConfig().display;if(e.includes("!important")){let r=e.replace(/\s*!important\s*$/,"").trim();t.style.setProperty("display",r,"important")}else t.style.display=e;j(t,"img[data-src], video[data-src], audio[data-src], iframe[data-src]").forEach(r=>{let s=r.tagName==="IFRAME";(!s||this.shouldPreload(r))&&(r.setAttribute("src",r.getAttribute("data-src")),r.setAttribute("data-lazy-loaded",""),r.removeAttribute("data-src"),s&&r.addEventListener("load",this.preventIframeAutoFocus))}),j(t,"video, audio").forEach(r=>{let s=0;j(r,"source[data-src]").forEach(o=>{o.setAttribute("src",o.getAttribute("data-src")),o.removeAttribute("data-src"),o.setAttribute("data-lazy-loaded",""),s+=1}),Ft&&r.tagName==="VIDEO"&&r.setAttribute("playsinline",""),s>0&&r.load()});let a=t.slideBackgroundElement;if(a){a.style.display="block";let r=t.slideBackgroundContentElement,s=t.getAttribute("data-background-iframe");if(a.hasAttribute("data-loaded")===!1){a.setAttribute("data-loaded","true");let l=t.getAttribute("data-background-image"),c=t.getAttribute("data-background-video"),d=t.hasAttribute("data-background-video-loop"),_=t.hasAttribute("data-background-video-muted");if(l)/^data:/.test(l.trim())?r.style.backgroundImage=`url(${l.trim()})`:r.style.backgroundImage=l.split(",").map(u=>`url(${zr(decodeURI(u.trim()))})`).join(",");else if(c){let u=document.createElement("video");d&&u.setAttribute("loop",""),(_||this.Reveal.isSpeakerNotes())&&(u.muted=!0),Ft&&u.setAttribute("playsinline",""),c.split(",").forEach(m=>{let p=document.createElement("source");p.setAttribute("src",m);let g=Vr(m);g&&p.setAttribute("type",g),u.appendChild(p)}),r.appendChild(u)}else if(s&&n.excludeIframes!==!0){let u=document.createElement("iframe");u.setAttribute("allowfullscreen",""),u.setAttribute("mozallowfullscreen",""),u.setAttribute("webkitallowfullscreen",""),u.setAttribute("allow","autoplay"),u.setAttribute("data-src",s),u.style.width="100%",u.style.height="100%",u.style.maxHeight="100%",u.style.maxWidth="100%",r.appendChild(u)}}let o=r.querySelector("iframe[data-src]");o&&this.shouldPreload(a)&&!/autoplay=(1|true|yes)/gi.test(s)&&o.getAttribute("src")!==s&&o.setAttribute("src",s)}this.layout(t)}layout(t){Array.from(t.querySelectorAll(".r-fit-text")).forEach(n=>{qr(n,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(t){t.style.display="none";let n=this.Reveal.getSlideBackground(t);n&&(n.style.display="none",j(n,"iframe[src]").forEach(e=>{e.removeAttribute("src")})),j(t,"video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")}),j(t,"video[data-lazy-loaded] source[src], audio source[src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")})}formatEmbeddedContent(){let t=(n,e,a)=>{j(this.Reveal.getSlidesElement(),"iframe["+n+'*="'+e+'"]').forEach(r=>{let s=r.getAttribute(n);s&&s.indexOf(a)===-1&&r.setAttribute(n,s+(/\?/.test(s)?"&":"?")+a)})};t("src","youtube.com/embed/","enablejsapi=1"),t("data-src","youtube.com/embed/","enablejsapi=1"),t("src","player.vimeo.com/","api=1"),t("data-src","player.vimeo.com/","api=1")}startEmbeddedContent(t){if(t){let n=this.Reveal.isSpeakerNotes();j(t,'img[src$=".gif"]').forEach(e=>{e.setAttribute("src",e.getAttribute("src"))}),j(t,"video, audio").forEach(e=>{if(De(e,".fragment")&&!De(e,".fragment.visible"))return;let a=this.Reveal.getConfig().autoPlayMedia;if(typeof a!="boolean"&&(a=e.hasAttribute("data-autoplay")||!!De(e,".slide-background")),a&&typeof e.play=="function"){if(n&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):Ft?(e.addEventListener("canplay",this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener("loadeddata",this.startEmbeddedMedia),e.addEventListener("loadeddata",this.startEmbeddedMedia))}}),n||(j(t,"iframe[src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||this.startEmbeddedIframe({target:e})}),j(t,"iframe[data-src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||e.getAttribute("src")!==e.getAttribute("data-src")&&(e.removeEventListener("load",this.startEmbeddedIframe),e.addEventListener("load",this.startEmbeddedIframe),e.setAttribute("src",e.getAttribute("data-src")))}))}}ensureMobileMediaPlaying(t){let n=t.target;typeof n.getVideoPlaybackQuality=="function"&&setTimeout(()=>{let e=n.paused===!1,a=n.getVideoPlaybackQuality().totalVideoFrames;e&&a===0&&(n.load(),n.play())},1e3)}startEmbeddedMedia(t){let n=!!De(t.target,"html"),e=!!De(t.target,".present");n&&e&&(t.target.paused||t.target.ended)&&(t.target.currentTime=0,this.playMediaElement(t.target)),t.target.removeEventListener("loadeddata",this.startEmbeddedMedia)}playMediaElement(t){let n=t.play();n&&typeof n.catch=="function"&&n.then(()=>{t.muted||(this.allowedToPlayAudio=!0)}).catch(e=>{if(e.name==="NotAllowedError")if(this.allowedToPlayAudio=!1,t.tagName==="VIDEO"){this.onVideoPlaybackNotAllowed(t);let a=!!De(t,"html"),r=!!De(t,".present"),s=t.muted;a&&r&&!s&&(t.setAttribute("data-muted-by-reveal","true"),t.muted=!0,t.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(t)}))}else t.tagName==="AUDIO"&&this.onAudioPlaybackNotAllowed(t)})}startEmbeddedIframe(t){let n=t.target;if(this.preventIframeAutoFocus(t),n&&n.contentWindow){let e=!!De(t.target,"html"),a=!!De(t.target,".present");if(e&&a){let r=this.Reveal.getConfig().autoPlayMedia;typeof r!="boolean"&&(r=n.hasAttribute("data-autoplay")||!!De(n,".slide-background")),/youtube\.com\/embed\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*"):/player\.vimeo\.com\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"method":"play"}',"*"):n.contentWindow.postMessage("slide:start","*")}}}stopEmbeddedContent(t,n={}){n=Qt({unloadIframes:!0},n),t&&t.parentNode&&(j(t,"video, audio").forEach(e=>{!e.hasAttribute("data-ignore")&&typeof e.pause=="function"&&(e.setAttribute("data-paused-by-reveal",""),e.pause(),Ft&&e.removeEventListener("canplay",this.ensureMobileMediaPlaying))}),j(t,"iframe").forEach(e=>{e.contentWindow&&e.contentWindow.postMessage("slide:stop","*"),e.removeEventListener("load",this.preventIframeAutoFocus),e.removeEventListener("load",this.startEmbeddedIframe)}),j(t,'iframe[src*="youtube.com/embed/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),j(t,'iframe[src*="player.vimeo.com/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"method":"pause"}',"*")}),n.unloadIframes===!0&&j(t,"iframe[data-src]").forEach(e=>{e.setAttribute("src","about:blank"),e.removeAttribute("src")}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let t=this.failedAudioPlaybackTargets.size,n=this.failedVideoPlaybackTargets.size,e=this.failedMutedVideoPlaybackTargets.size,a="Play media";e>0?a="Play video":n>0?a="Unmute video":t>0&&(a="Play audio"),this.mediaPlayButton.textContent=a,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(t){this.failedAudioPlaybackTargets.add(t),this.showPlayOrUnmuteButton(t)}onVideoPlaybackNotAllowed(t){this.failedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(t){this.failedMutedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{t.hasAttribute("data-muted-by-reveal")&&(t.muted=!1,t.removeAttribute("data-muted-by-reveal"))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(t){let n=t.target;if(n&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,a=()=>{document.activeElement===n?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(a,100))};setTimeout(a,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Ot=".slides section",bt=".slides>section",Fn=".slides>section.present>section",Qr=".backgrounds>.slide-background",Kr=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Xr=class{constructor(t){this.Reveal=t}render(){this.element=document.createElement("div"),this.element.className="slide-number",this.Reveal.getRevealElement().appendChild(this.element)}configure(t,n){let e="none";t.slideNumber&&!this.Reveal.isPrintView()&&(t.showSlideNumber==="all"||t.showSlideNumber==="speaker"&&this.Reveal.isSpeakerNotes())&&(e="block"),this.element.style.display=e}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(t=this.Reveal.getCurrentSlide()){let n=this.Reveal.getConfig(),e,a="h.v";if(typeof n.slideNumber=="function")e=n.slideNumber(t);else{typeof n.slideNumber=="string"&&(a=n.slideNumber),!/c/.test(a)&&this.Reveal.getHorizontalSlides().length===1&&(a="c");let s=t&&t.dataset.visibility==="uncounted"?0:1;switch(e=[],a){case"c":e.push(this.Reveal.getSlidePastCount(t)+s);break;case"c/t":e.push(this.Reveal.getSlidePastCount(t)+s,"/",this.Reveal.getTotalSlides());break;default:let o=this.Reveal.getIndices(t);e.push(o.h+s);let l=a==="h/v"?"/":".";this.Reveal.isVerticalSlide(t)&&e.push(l,o.v+1)}}let r="#"+this.Reveal.location.getHash(t);return this.formatNumber(e[0],e[1],e[2],r)}formatNumber(t,n,e,a="#"+this.Reveal.location.getHash()){return typeof e=="number"&&!isNaN(e)?`<a href="${a}">
1
+ import{cJ as Mt,cK as je,cL as We,cM as Qe,cN as Ke,cO as Xe,cP as Ze,cQ as Je,cR as et,cS as tt,cT as xe,r as Q,j as S,aN as Tr,_ as vr,kF as Cr,aa as yr,cg as Rr,I as Nr,ch as Or,D as Ar,gI as Ir,bE as ua,T as xr}from"../datalayer-app-main.js";import{x as Dr,B as wr,N as kr}from"./JupyterLexicalExtension-CEBuhvME.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"./Output-C6ZHZSBH.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";import"./LexicalToolRegistry-LfEpCrfD.js";const pa={datalayer:{light:{primary:xe.greenAccent,secondary:xe.greenText,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenBrand]},dark:{primary:xe.greenBright,secondary:xe.greenAccent,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenText]}},spatial:{light:{primary:tt.indigoBrand,secondary:tt.indigoText,textColor:tt.gray,primaryGradient:[tt.indigoBright,tt.indigoBrand],secondaryGradient:[tt.indigoHover,tt.indigoAccent]},dark:{primary:tt.indigoBright,secondary:tt.indigoAccent,textColor:tt.gray,primaryGradient:[tt.indigoBright,tt.indigoBrand],secondaryGradient:[tt.indigoHover,tt.indigoAccent]}},lovely:{light:{primary:et.roseBrand,secondary:et.roseText,textColor:et.gray,primaryGradient:[et.roseBright,et.roseBrand],secondaryGradient:[et.roseHover,et.roseAccent]},dark:{primary:et.roseBright,secondary:et.roseAccent,textColor:et.gray,primaryGradient:[et.roseBright,et.roseBrand],secondaryGradient:[et.roseHover,et.roseAccent]}},matrix:{light:{primary:Je.greenBrand,secondary:Je.greenText,textColor:Je.gray,primaryGradient:[Je.greenGlow,Je.greenBrand],secondaryGradient:[Je.greenHover,Je.greenAccent]},dark:{primary:Je.greenGlow,secondary:Je.greenPhosphor,textColor:Je.gray,primaryGradient:[Je.greenGlow,Je.greenBrand],secondaryGradient:[Je.greenHover,Je.greenAccent]}},earth:{light:{primary:Ze.oceanBrand,secondary:Ze.oceanText,textColor:Ze.gray,primaryGradient:[Ze.oceanAccent,Ze.oceanBrand],secondaryGradient:[Ze.oceanHover,Ze.oceanText]},dark:{primary:Ze.oceanBright,secondary:Ze.oceanAccent,textColor:Ze.gray,primaryGradient:[Ze.oceanBright,Ze.oceanBrand],secondaryGradient:[Ze.oceanHover,Ze.oceanAccent]}},sand:{light:{primary:Xe.sandBrand,secondary:Xe.sandText,textColor:Xe.gray,primaryGradient:[Xe.sandAccent,Xe.sandBrand],secondaryGradient:[Xe.sandHover,Xe.sandText]},dark:{primary:Xe.sandBright,secondary:Xe.sandAccent,textColor:Xe.gray,primaryGradient:[Xe.sandBright,Xe.sandBrand],secondaryGradient:[Xe.sandHover,Xe.sandAccent]}},ivory:{light:{primary:Ke.ivoryBrand,secondary:Ke.ivoryText,textColor:Ke.gray,primaryGradient:[Ke.ivoryAccent,Ke.ivoryBrand],secondaryGradient:[Ke.ivoryHover,Ke.ivoryText]},dark:{primary:Ke.ivoryBright,secondary:Ke.ivoryAccent,textColor:Ke.gray,primaryGradient:[Ke.ivoryBright,Ke.ivoryBrand],secondaryGradient:[Ke.ivoryHover,Ke.ivoryAccent]}},sun:{light:{primary:Qe.sunBrand,secondary:Qe.sunText,textColor:Qe.gray,primaryGradient:[Qe.sunAccent,Qe.sunBrand],secondaryGradient:[Qe.sunHover,Qe.sunText]},dark:{primary:Qe.sunBright,secondary:Qe.sunAccent,textColor:Qe.gray,primaryGradient:[Qe.sunBright,Qe.sunBrand],secondaryGradient:[Qe.sunHover,Qe.sunAccent]}},loop:{light:{primary:We.loopAccent,secondary:We.ink,textColor:We.gray,primaryGradient:[We.loopAccent,We.loopAccent],secondaryGradient:[We.ink,We.ink]},dark:{primary:We.loopBrand,secondary:We.inkDark,textColor:We.grayDark,primaryGradient:[We.loopBrand,We.loopBrand],secondaryGradient:[We.inkDark,We.inkDark]}},metal:{light:{primary:je.steelFrom,secondary:je.ink,textColor:je.gray,primaryGradient:[je.steelFrom,je.steelTo],secondaryGradient:[je.ink,je.ink]},dark:{primary:je.metalBright,secondary:je.inkDark,textColor:je.grayDark,primaryGradient:[je.metalBright,je.brightPop],secondaryGradient:[je.inkDark,je.inkDark]}},vscode:{light:{primary:Mt.vscodeText,secondary:"#3B3B3B",textColor:"#767676",primaryGradient:[Mt.vscodeText,Mt.vscodeText],secondaryGradient:["#3B3B3B","#3B3B3B"]},dark:{primary:Mt.vscodeAccent,secondary:"#CCCCCC",textColor:Mt.gray,primaryGradient:[Mt.vscodeAccent,Mt.vscodeAccent],secondaryGradient:["#CCCCCC","#CCCCCC"]}}};function Va(i="datalayer",t="light"){const n=t==="auto"?"light":t;return pa[i]?.[n]??pa.datalayer.light}const ma=25,Mr=[{y:0,secondaryWidth:30,primaryWidth:70},{y:37.5,secondaryWidth:50,primaryWidth:50},{y:75,secondaryWidth:70,primaryWidth:30}];Q.forwardRef(function({size:t=16,variant:n="datalayer",colorMode:e="light",primaryColor:a,secondaryColor:r,primaryGradient:s,secondaryGradient:o,gradient:l=!0,...c},d){const _=Va(n,e),u=a??_.primary,m=r??_.secondary,p=Q.useId().replace(/:/g,""),[g,b]=s??_.primaryGradient,[C,y]=o??_.secondaryGradient;return S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:t,height:t,"aria-hidden":"true",ref:d,...c,children:[l&&S.jsxs("defs",{children:[S.jsxs("linearGradient",{id:`${p}-p`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:g}),S.jsx("stop",{offset:"1",stopColor:b})]}),S.jsxs("linearGradient",{id:`${p}-s`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:C}),S.jsx("stop",{offset:"1",stopColor:y})]})]}),Mr.map(({y:N,secondaryWidth:O,primaryWidth:v})=>S.jsxs("g",{children:[S.jsx("rect",{x:0,y:N,width:O,height:ma,fill:l?`url(#${p}-p)`:u}),S.jsx("rect",{x:O,y:N,width:v,height:ma,fill:l?`url(#${p}-s)`:m})]},N))]})});const za=new Map,In=i=>za.get(i),sn=i=>za.has(i),Lr=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|==[^=]+==)/g,ie=i=>i.split(Lr).map((t,n)=>{const e=`${n}-${t}`;if(t.startsWith("**")&&t.endsWith("**"))return S.jsx("strong",{children:ie(t.slice(2,-2))},e);if(t.startsWith("`")&&t.endsWith("`"))return S.jsx("code",{children:t.slice(1,-1)},e);if(t.startsWith("==")&&t.endsWith("=="))return S.jsx("mark",{className:"dla-alert",children:t.slice(2,-2)},e);const a=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(t);return a?S.jsx("a",{href:a[2],target:"_blank",rel:"noopener noreferrer",children:a[1]},e):t}),Pr=i=>i.trim().split(/\n\s*\n/).map((t,n)=>S.jsx("p",{children:ie(t.trim())},`${n}-${t.slice(0,24)}`)),Fr=()=>{const{theme:i,colorMode:t}=Tr();return{theme:i,colorMode:t}},Ur={useTheme:Fr},Br=Q.createContext(Ur),qa=()=>Q.useContext(Br),$a=()=>{const{useTheme:i}=qa();return i()},xn=({footer:i,theme:t,index:n,total:e})=>{const{colorMode:a,theme:r}=$a(),{Logo:s}=qa(),o=a==="auto"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a,l=Va(r,o),c=new Date().getFullYear(),d=i.since&&i.since<c?`${i.since}–${c}`:`${c}`;return S.jsxs("div",{className:"dla-slide-footer",children:[i.logo&&S.jsx("a",{className:"dla-slide-footer-logo",href:i.href,target:"_blank",rel:"noopener noreferrer","aria-label":`${i.holder} — ${i.href}`,children:s?S.jsx(s,{height:26,variant:r,colorMode:a,inverse:t.logo.inverse,colored:t.logo.colored,primaryColor:t.logo.primaryColor??l.primary,secondaryColor:t.logo.secondaryColor??l.secondary,textColor:t.logo.textColor??l.textColor}):S.jsx("span",{className:"dla-slide-footer-holder",children:i.holder})}),i.note&&S.jsx("div",{className:"dla-slide-footer-note",children:i.note}),S.jsxs("div",{className:"dla-slide-footer-legal",children:[S.jsx("a",{href:i.href,target:"_blank",rel:"noopener noreferrer",children:i.href.replace(/^https?:\/\//,"")}),S.jsxs("span",{children:["© ",d," ",i.holder]}),i.slideNumbers&&S.jsxs("span",{className:"dla-slide-footer-number",children:[n," / ",e]})]})]})},Dn=({name:i})=>{if(!i)return null;const t=In(i);return t?S.jsx("div",{className:"dla-slide-backdrop","aria-hidden":!0,children:S.jsx(t,{})}):null},Le=({theme:i,footer:t,index:n,total:e,eyebrow:a,title:r,subtitle:s,layout:o,variant:l,backdrop:c,children:d})=>{const _=["dla-slide"];return l&&_.push(`dla-slide--${l}`),(o==="centered"||o==="full-bleed")&&_.push(`dla-slide--${o}`),S.jsxs("div",{className:_.join(" "),children:[S.jsx(Dn,{name:c}),S.jsxs("div",{className:"dla-slide-head",children:[a&&S.jsx("div",{className:"dla-slide-eyebrow",children:a}),r&&S.jsx("h2",{className:"dla-slide-title",children:ie(r)}),s&&S.jsx("p",{className:"dla-slide-subtitle",children:ie(s)})]}),S.jsx("div",{className:"dla-slide-body",children:d}),t&&S.jsx(xn,{footer:t,theme:i,index:n,total:e})]})};var Qt=(i,t)=>{for(let n in t)i[n]=t[n];return i},j=(i,t)=>Array.from(i.querySelectorAll(t)),Pn=(i,t,n)=>{n?i.classList.add(t):i.classList.remove(t)},Wt=i=>{if(typeof i=="string"){if(i==="null")return null;if(i==="true")return!0;if(i==="false")return!1;if(i.match(/^-?[\d\.]+$/))return parseFloat(i)}return i},Nt=(i,t)=>{i.style.transform=t},Rn=(i,t)=>{let n=i.matches||i.matchesSelector||i.msMatchesSelector;return!!(n&&n.call(i,t))},De=(i,t)=>{if(i&&typeof i.closest=="function")return i.closest(t);for(;i;){if(Rn(i,t))return i;i=i.parentElement}return null},ja=i=>{i=i||document.documentElement;let t=i.requestFullscreen||i.webkitRequestFullscreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullscreen;t&&t.apply(i)},Gr=(i,t,n,e="")=>{let a=i.querySelectorAll("."+n);for(let s=0;s<a.length;s++){let o=a[s];if(o.parentNode===i)return o}let r=document.createElement(t);return r.className=n,r.innerHTML=e,i.appendChild(r),r},zn=i=>{let t=document.createElement("style");return i&&i.length>0&&t.appendChild(document.createTextNode(i)),document.head.appendChild(t),t},ga=()=>{let i={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split("=").shift(),e=t.split("=").pop();return n&&e!==void 0&&(i[n]=e),t});for(let t in i){let n=i[t];i[t]=Wt(unescape(n))}return i.dependencies!==void 0&&delete i.dependencies,i},Yr=(i,t=0)=>{if(i){var n;let e,a=i.style.height;return i.style.height="0px",i.parentElement&&(i.parentElement.style.height="auto"),e=t-(((n=i.parentElement)==null?void 0:n.offsetHeight)||0),i.style.height=a+"px",i.parentElement&&i.parentElement.style.removeProperty("height"),e}return t},Hr={mp4:"video/mp4",m4a:"video/mp4",ogv:"video/ogg",mpeg:"video/mpeg",webm:"video/webm"},Vr=(i="")=>{let t=i.split(".").pop();return t?Hr[t]:void 0},zr=(i="")=>encodeURI(i).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Wa=navigator.userAgent,Ft=/(iphone|ipod|ipad|android)/gi.test(Wa)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Qa=/android/gi.test(Wa),qr=(function(i){if(i){var t=function(R){return[].slice.call(R)},n=0,e=1,a=2,r=3,s=[],o=null,l="requestAnimationFrame"in i?function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};i.cancelAnimationFrame(o);var U=function(){return d(s.filter((function(z){return z.dirty&&z.active})))};if(R.sync)return U();o=i.requestAnimationFrame(U)}:function(){},c=function(R){return function(U){s.forEach((function(z){return z.dirty=R})),l(U)}},d=function(R){R.filter((function(z){return!z.styleComputed})).forEach((function(z){z.styleComputed=p(z)})),R.filter(g).forEach(b);var U=R.filter(m);U.forEach(u),U.forEach((function(z){b(z),_(z)})),U.forEach(C)},_=function(R){return R.dirty=n},u=function(R){R.availableWidth=R.element.parentNode.clientWidth,R.currentWidth=R.element.scrollWidth,R.previousFontSize=R.currentFontSize,R.currentFontSize=Math.min(Math.max(R.minSize,R.availableWidth/R.currentWidth*R.previousFontSize),R.maxSize),R.whiteSpace=R.multiLine&&R.currentFontSize===R.minSize?"normal":"nowrap"},m=function(R){return R.dirty!==a||R.dirty===a&&R.element.parentNode.clientWidth!==R.availableWidth},p=function(R){var U=i.getComputedStyle(R.element,null);return R.currentFontSize=parseFloat(U.getPropertyValue("font-size")),R.display=U.getPropertyValue("display"),R.whiteSpace=U.getPropertyValue("white-space"),!0},g=function(R){var U=!1;return!R.preStyleTestCompleted&&(/inline-/.test(R.display)||(U=!0,R.display="inline-block"),R.whiteSpace!=="nowrap"&&(U=!0,R.whiteSpace="nowrap"),R.preStyleTestCompleted=!0,U)},b=function(R){R.element.style.whiteSpace=R.whiteSpace,R.element.style.display=R.display,R.element.style.fontSize=R.currentFontSize+"px"},C=function(R){R.element.dispatchEvent(new CustomEvent("fit",{detail:{oldValue:R.previousFontSize,newValue:R.currentFontSize,scaleFactor:R.currentFontSize/R.previousFontSize}}))},y=function(R,U){return function(z){R.dirty=U,R.active&&l(z)}},N=function(R){return function(){s=s.filter((function(U){return U.element!==R.element})),R.observeMutations&&R.observer.disconnect(),R.element.style.whiteSpace=R.originalStyle.whiteSpace,R.element.style.display=R.originalStyle.display,R.element.style.fontSize=R.originalStyle.fontSize}},O=function(R){return function(){R.active||(R.active=!0,l())}},v=function(R){return function(){return R.active=!1}},A=function(R){R.observeMutations&&(R.observer=new MutationObserver(y(R,e)),R.observer.observe(R.element,R.observeMutations))},M={minSize:16,maxSize:512,multiLine:!0,observeMutations:"MutationObserver"in i&&{subtree:!0,childList:!0,characterData:!0}},F=null,Y=function(){i.clearTimeout(F),F=i.setTimeout(c(a),B.observeWindowDelay)},x=["resize","orientationchange"];return Object.defineProperty(B,"observeWindow",{set:function(R){var U=`${R?"add":"remove"}EventListener`;x.forEach((function(z){i[U](z,Y)}))}}),B.observeWindow=!0,B.observeWindowDelay=100,B.fitAll=c(r),B}function K(R,U){var z=Object.assign({},M,U),Z=R.map((function(te){var se=Object.assign({},z,{element:te,active:!0});return(function(ae){ae.originalStyle={whiteSpace:ae.element.style.whiteSpace,display:ae.element.style.display,fontSize:ae.element.style.fontSize},A(ae),ae.newbie=!0,ae.dirty=!0,s.push(ae)})(se),{element:te,fit:y(se,r),unfreeze:O(se),freeze:v(se),unsubscribe:N(se)}}));return l(),Z}function B(R){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof R=="string"?K(t(document.querySelectorAll(R)),U):K([R],U)[0]}})(typeof window>"u"?null:window);function dn(i){"@babel/helpers - typeof";return dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(i)}function $r(i,t){if(dn(i)!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var e=n.call(i,t);if(dn(e)!="object")return e;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function jr(i){var t=$r(i,"string");return dn(t)=="symbol"?t:t+""}function Zn(i,t,n){return(t=jr(t))in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}var Wr=class{constructor(t){Zn(this,"allowedToPlayAudio",null),this.Reveal=t,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement("button"),this.mediaPlayButton.className="r-overlay-button r-media-play-button",this.mediaPlayButton.addEventListener("click",()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{this.startEmbeddedMedia({target:t})}),this.clearMediaPlaybackErrors()})}shouldPreload(t){if(this.Reveal.isScrollView())return!0;let n=this.Reveal.getConfig().preloadIframes;return typeof n!="boolean"&&(n=t.hasAttribute("data-preload")),n}load(t,n={}){let e=this.Reveal.getConfig().display;if(e.includes("!important")){let r=e.replace(/\s*!important\s*$/,"").trim();t.style.setProperty("display",r,"important")}else t.style.display=e;j(t,"img[data-src], video[data-src], audio[data-src], iframe[data-src]").forEach(r=>{let s=r.tagName==="IFRAME";(!s||this.shouldPreload(r))&&(r.setAttribute("src",r.getAttribute("data-src")),r.setAttribute("data-lazy-loaded",""),r.removeAttribute("data-src"),s&&r.addEventListener("load",this.preventIframeAutoFocus))}),j(t,"video, audio").forEach(r=>{let s=0;j(r,"source[data-src]").forEach(o=>{o.setAttribute("src",o.getAttribute("data-src")),o.removeAttribute("data-src"),o.setAttribute("data-lazy-loaded",""),s+=1}),Ft&&r.tagName==="VIDEO"&&r.setAttribute("playsinline",""),s>0&&r.load()});let a=t.slideBackgroundElement;if(a){a.style.display="block";let r=t.slideBackgroundContentElement,s=t.getAttribute("data-background-iframe");if(a.hasAttribute("data-loaded")===!1){a.setAttribute("data-loaded","true");let l=t.getAttribute("data-background-image"),c=t.getAttribute("data-background-video"),d=t.hasAttribute("data-background-video-loop"),_=t.hasAttribute("data-background-video-muted");if(l)/^data:/.test(l.trim())?r.style.backgroundImage=`url(${l.trim()})`:r.style.backgroundImage=l.split(",").map(u=>`url(${zr(decodeURI(u.trim()))})`).join(",");else if(c){let u=document.createElement("video");d&&u.setAttribute("loop",""),(_||this.Reveal.isSpeakerNotes())&&(u.muted=!0),Ft&&u.setAttribute("playsinline",""),c.split(",").forEach(m=>{let p=document.createElement("source");p.setAttribute("src",m);let g=Vr(m);g&&p.setAttribute("type",g),u.appendChild(p)}),r.appendChild(u)}else if(s&&n.excludeIframes!==!0){let u=document.createElement("iframe");u.setAttribute("allowfullscreen",""),u.setAttribute("mozallowfullscreen",""),u.setAttribute("webkitallowfullscreen",""),u.setAttribute("allow","autoplay"),u.setAttribute("data-src",s),u.style.width="100%",u.style.height="100%",u.style.maxHeight="100%",u.style.maxWidth="100%",r.appendChild(u)}}let o=r.querySelector("iframe[data-src]");o&&this.shouldPreload(a)&&!/autoplay=(1|true|yes)/gi.test(s)&&o.getAttribute("src")!==s&&o.setAttribute("src",s)}this.layout(t)}layout(t){Array.from(t.querySelectorAll(".r-fit-text")).forEach(n=>{qr(n,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(t){t.style.display="none";let n=this.Reveal.getSlideBackground(t);n&&(n.style.display="none",j(n,"iframe[src]").forEach(e=>{e.removeAttribute("src")})),j(t,"video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")}),j(t,"video[data-lazy-loaded] source[src], audio source[src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")})}formatEmbeddedContent(){let t=(n,e,a)=>{j(this.Reveal.getSlidesElement(),"iframe["+n+'*="'+e+'"]').forEach(r=>{let s=r.getAttribute(n);s&&s.indexOf(a)===-1&&r.setAttribute(n,s+(/\?/.test(s)?"&":"?")+a)})};t("src","youtube.com/embed/","enablejsapi=1"),t("data-src","youtube.com/embed/","enablejsapi=1"),t("src","player.vimeo.com/","api=1"),t("data-src","player.vimeo.com/","api=1")}startEmbeddedContent(t){if(t){let n=this.Reveal.isSpeakerNotes();j(t,'img[src$=".gif"]').forEach(e=>{e.setAttribute("src",e.getAttribute("src"))}),j(t,"video, audio").forEach(e=>{if(De(e,".fragment")&&!De(e,".fragment.visible"))return;let a=this.Reveal.getConfig().autoPlayMedia;if(typeof a!="boolean"&&(a=e.hasAttribute("data-autoplay")||!!De(e,".slide-background")),a&&typeof e.play=="function"){if(n&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):Ft?(e.addEventListener("canplay",this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener("loadeddata",this.startEmbeddedMedia),e.addEventListener("loadeddata",this.startEmbeddedMedia))}}),n||(j(t,"iframe[src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||this.startEmbeddedIframe({target:e})}),j(t,"iframe[data-src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||e.getAttribute("src")!==e.getAttribute("data-src")&&(e.removeEventListener("load",this.startEmbeddedIframe),e.addEventListener("load",this.startEmbeddedIframe),e.setAttribute("src",e.getAttribute("data-src")))}))}}ensureMobileMediaPlaying(t){let n=t.target;typeof n.getVideoPlaybackQuality=="function"&&setTimeout(()=>{let e=n.paused===!1,a=n.getVideoPlaybackQuality().totalVideoFrames;e&&a===0&&(n.load(),n.play())},1e3)}startEmbeddedMedia(t){let n=!!De(t.target,"html"),e=!!De(t.target,".present");n&&e&&(t.target.paused||t.target.ended)&&(t.target.currentTime=0,this.playMediaElement(t.target)),t.target.removeEventListener("loadeddata",this.startEmbeddedMedia)}playMediaElement(t){let n=t.play();n&&typeof n.catch=="function"&&n.then(()=>{t.muted||(this.allowedToPlayAudio=!0)}).catch(e=>{if(e.name==="NotAllowedError")if(this.allowedToPlayAudio=!1,t.tagName==="VIDEO"){this.onVideoPlaybackNotAllowed(t);let a=!!De(t,"html"),r=!!De(t,".present"),s=t.muted;a&&r&&!s&&(t.setAttribute("data-muted-by-reveal","true"),t.muted=!0,t.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(t)}))}else t.tagName==="AUDIO"&&this.onAudioPlaybackNotAllowed(t)})}startEmbeddedIframe(t){let n=t.target;if(this.preventIframeAutoFocus(t),n&&n.contentWindow){let e=!!De(t.target,"html"),a=!!De(t.target,".present");if(e&&a){let r=this.Reveal.getConfig().autoPlayMedia;typeof r!="boolean"&&(r=n.hasAttribute("data-autoplay")||!!De(n,".slide-background")),/youtube\.com\/embed\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*"):/player\.vimeo\.com\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"method":"play"}',"*"):n.contentWindow.postMessage("slide:start","*")}}}stopEmbeddedContent(t,n={}){n=Qt({unloadIframes:!0},n),t&&t.parentNode&&(j(t,"video, audio").forEach(e=>{!e.hasAttribute("data-ignore")&&typeof e.pause=="function"&&(e.setAttribute("data-paused-by-reveal",""),e.pause(),Ft&&e.removeEventListener("canplay",this.ensureMobileMediaPlaying))}),j(t,"iframe").forEach(e=>{e.contentWindow&&e.contentWindow.postMessage("slide:stop","*"),e.removeEventListener("load",this.preventIframeAutoFocus),e.removeEventListener("load",this.startEmbeddedIframe)}),j(t,'iframe[src*="youtube.com/embed/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),j(t,'iframe[src*="player.vimeo.com/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"method":"pause"}',"*")}),n.unloadIframes===!0&&j(t,"iframe[data-src]").forEach(e=>{e.setAttribute("src","about:blank"),e.removeAttribute("src")}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let t=this.failedAudioPlaybackTargets.size,n=this.failedVideoPlaybackTargets.size,e=this.failedMutedVideoPlaybackTargets.size,a="Play media";e>0?a="Play video":n>0?a="Unmute video":t>0&&(a="Play audio"),this.mediaPlayButton.textContent=a,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(t){this.failedAudioPlaybackTargets.add(t),this.showPlayOrUnmuteButton(t)}onVideoPlaybackNotAllowed(t){this.failedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(t){this.failedMutedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{t.hasAttribute("data-muted-by-reveal")&&(t.muted=!1,t.removeAttribute("data-muted-by-reveal"))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(t){let n=t.target;if(n&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,a=()=>{document.activeElement===n?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(a,100))};setTimeout(a,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Ot=".slides section",bt=".slides>section",Fn=".slides>section.present>section",Qr=".backgrounds>.slide-background",Kr=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Xr=class{constructor(t){this.Reveal=t}render(){this.element=document.createElement("div"),this.element.className="slide-number",this.Reveal.getRevealElement().appendChild(this.element)}configure(t,n){let e="none";t.slideNumber&&!this.Reveal.isPrintView()&&(t.showSlideNumber==="all"||t.showSlideNumber==="speaker"&&this.Reveal.isSpeakerNotes())&&(e="block"),this.element.style.display=e}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(t=this.Reveal.getCurrentSlide()){let n=this.Reveal.getConfig(),e,a="h.v";if(typeof n.slideNumber=="function")e=n.slideNumber(t);else{typeof n.slideNumber=="string"&&(a=n.slideNumber),!/c/.test(a)&&this.Reveal.getHorizontalSlides().length===1&&(a="c");let s=t&&t.dataset.visibility==="uncounted"?0:1;switch(e=[],a){case"c":e.push(this.Reveal.getSlidePastCount(t)+s);break;case"c/t":e.push(this.Reveal.getSlidePastCount(t)+s,"/",this.Reveal.getTotalSlides());break;default:let o=this.Reveal.getIndices(t);e.push(o.h+s);let l=a==="h/v"?"/":".";this.Reveal.isVerticalSlide(t)&&e.push(l,o.v+1)}}let r="#"+this.Reveal.location.getHash(t);return this.formatNumber(e[0],e[1],e[2],r)}formatNumber(t,n,e,a="#"+this.Reveal.location.getHash()){return typeof e=="number"&&!isNaN(e)?`<a href="${a}">
2
2
  <span class="slide-number-a">${t}</span>
3
3
  <span class="slide-number-delimiter">${n}</span>
4
4
  <span class="slide-number-b">${e}</span>
@@ -1,3 +1,3 @@
1
- import{a0 as b,a1 as I,a6 as v,r as E,j as i,B as c,T as N,bG as j,bH as T,bI as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-CAXNOtEL.js";import{O as _,b as P,u as D}from"./openingNotebook-Ds1zZ-Z7.js";import{P as d}from"./PrismCss-DQMhvzcI.js";import"./lexicalHooks-BtjglRXO.js";import"./LexicalToolRegistry-LfEpCrfD.js";import"./useProgressTask-RwobsaO6.js";import"./JupyterLexicalExtension-BtjDYMne.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"./Output-BfmeU6C2.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-BKAeSGYJ.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";const M="Quarterly revenue by region",S="Six rows of revenue, two quarters, three regions. The cell below loads them and shows the frame; run it, change it, or ask an agent to take it further — the code and its output live in this document, beside the words about them.",l="opening-document-input",w="opening-document-output",g=e=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1}),u=(e,o,t={})=>({children:o,direction:"ltr",format:"",indent:0,type:e,version:1,...t}),h={type:"linebreak",version:1},s=(e,o)=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"jupyter-input-highlight",version:1,highlightType:o}),f=e=>e.flatMap(o=>{if(typeof o=="string")return o.split(`
1
+ import{a0 as b,a1 as I,a6 as v,r as E,j as i,B as c,T as N,bG as j,bH as T,bI as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-CPSZcPKd.js";import{O as _,b as P,u as D}from"./openingNotebook-Ds1zZ-Z7.js";import{P as d}from"./PrismCss-DQMhvzcI.js";import"./lexicalHooks-BtjglRXO.js";import"./LexicalToolRegistry-LfEpCrfD.js";import"./useProgressTask-RwobsaO6.js";import"./JupyterLexicalExtension-CEBuhvME.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"./Output-C6ZHZSBH.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";const M="Quarterly revenue by region",S="Six rows of revenue, two quarters, three regions. The cell below loads them and shows the frame; run it, change it, or ask an agent to take it further — the code and its output live in this document, beside the words about them.",l="opening-document-input",w="opening-document-output",g=e=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1}),u=(e,o,t={})=>({children:o,direction:"ltr",format:"",indent:0,type:e,version:1,...t}),h={type:"linebreak",version:1},s=(e,o)=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"jupyter-input-highlight",version:1,highlightType:o}),f=e=>e.flatMap(o=>{if(typeof o=="string")return o.split(`
2
2
  `).flatMap((n,m)=>[...m>0?[h]:[],...n.length>0?[s(n)]:[]]);const{content:t,type:r}=o;return typeof t=="string"?[s(t,r)]:Array.isArray(t)?t.length===1&&typeof t[0]=="string"?[s(t[0],r)]:f(t):[]}),k=e=>{const o=d.languages.python;return o?f(d.tokenize(e,o)):e.split(`
3
3
  `).flatMap((t,r)=>[...r>0?[h]:[],...t.length>0?[s(t)]:[]])};function A(){const e=_.join("");return{root:{children:[u("heading",[g(M)],{tag:"h1"}),u("paragraph",[g(S)],{textFormat:0,textStyle:""}),u("jupyter-input",k(e),{language:"python",jupyterInputNodeUuid:l}),{type:"jupyter-output",version:1,format:"",source:e,outputs:[{output_type:"execute_result",execution_count:1,data:{"text/plain":P},metadata:{}}],jupyterInputNodeUuid:l,jupyterOutputNodeUuid:w}],direction:"ltr",format:"",indent:0,type:"root",version:1}}}function gt({workspace:e}){const o=b(),t=I(o.snapshot),r=e.surfaceId,n=D(T,j,{workspace:e,editorId:r}),a=v(U)[0]?.value,y=E.useMemo(()=>JSON.stringify((a?.document??A)()),[a]),x=a?.autoFocus??!0;if(t.state!=="running")return i.jsx(c,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:4,textAlign:"center",children:i.jsx(N,{children:"The document needs a running sandbox for its code blocks. Open the Sandbox view to see what it is doing."})});const p=o.getServiceManager()??void 0;return i.jsx(c,{height:"100%",minHeight:0,children:i.jsx(O,{inheritTheme:!0,documentId:r,content:y,autoFocus:x,serviceManager:p,showToolbar:n.present,toolbarExtraItems:n.items,kernelId:p?t.kernelId:void 0,runtimeOverride:!p&&t.jupyterUrl?{baseUrl:t.jupyterUrl,token:t.jupyterToken}:void 0})})}export{gt as default};
@@ -1 +1 @@
1
- import{r,aL as ke,aM as Se,aN as je,aO as we,aP as ve,j as e,B as M,aQ as Ce,aR as be,aS as Ee,aT as Re,aU as V,k as $,aV as Me,aW as Te,aX as Pe,aa as T,aY as Ne,aZ as Y,a_ as q,a$ as De,b0 as Ue}from"../datalayer-app-main.js";import{useLexicalTools as He}from"./lexicalHooks-BtjglRXO.js";import{u as Le}from"./useProgressTask-RwobsaO6.js";import{L as We,j as Be,T as Ie,k as Ae,l as _e,m as Fe,D as K,n as Je,o as ze,p as Ve,q as $e,J as Ye,s as qe,F as Ke,t as Qe,u as Xe,v as Ze,w as Ge}from"./JupyterLexicalExtension-BtjDYMne.js";import"./LexicalToolRegistry-LfEpCrfD.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"./Output-BfmeU6C2.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-BKAeSGYJ.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";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=Y();t.getChildrenSize()===0&&t.append(q())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=Y();t.clear(),t.append(q())},{tag:"history-merge"})}}},[o,s]),null}function et({disabled:o}){const[s]=T();return r.useEffect(()=>{Ne(s,De).output.disabled.value=o},[s,o]),null}function tt({setIsLinkEditMode:o,extraItems:s}){const[l]=T(),[t,d]=r.useState(l);return e.jsx(Ge,{editor:l,activeEditor:t,setActiveEditor:d,setIsLinkEditMode:o,extraItems:s})}function Q({inherit:o,colorMode:s,themeConfig:l,children:t}){return o?e.jsx(e.Fragment,{children:t}):e.jsx(Te,{colorMode:s,theme:l.primerTheme,themeStyles:l.themeStyles,children:t})}function Ht({documentId:o,runtimeName:s,runtimeOverride:l,serviceManager:t,kernelId:d,themeVariant:X,colorMode:Z,content:P,onContentChange:w,onToolsReady:N,onKernelChange:v,collaboration:n,toolbarExtraItems:G,showToolbar:O=!0,inheritTheme:D=!1,autoFocus:U=!0}){const h=!!(n?.websocketUrl&&n?.roomId),ee=n?.identity?.displayName||n?.identity?.handle||n?.identity?.userId,te=n?.identity?.color,ne=r.useMemo(()=>({user:{id:n?.identity?.userId,username:n?.identity?.userId||n?.identity?.handle||n?.identity?.displayName,name:n?.identity?.handle||n?.identity?.displayName,display_name:n?.identity?.displayName||n?.identity?.handle,initials:n?.identity?.initials,color:n?.identity?.color,avatar_url:n?.identity?.avatarUrl,handle:n?.identity?.handle}}),[n?.identity]),H=r.useRef(P),L=r.useRef(o);L.current!==o&&(L.current=o,H.current=P);const W=H.current,B=r.useRef(W??""),I=He(o);r.useEffect(()=>{N?.(I)},[I,N]);const{runtimes:A,refetchRuntimes:C}=ke(),m=r.useMemo(()=>{const i=String(l?.baseUrl||"").trim();if(i)return{url:i,wsUrl:String(l?.wsUrl||"").trim()||void 0,token:String(l?.token||"").trim(),runtime_name:String(l?.runtimeName||"").trim()||"agent-node-proxy"};const a=String(s||"").trim();if(a)return A.find(j=>String(j?.runtime_name||"")===a)},[l,s,A]),_=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!_)return;C();const i=window.setInterval(()=>{C()},1e3);return()=>{window.clearInterval(i)}},[_,C]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,j=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const E=String(m?.url||"").trim();if(!E){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||E.replace(/^http/,"ws"),xe=$.ServerConnection.makeSettings({baseUrl:E,wsUrl:pe,token:u,appendToken:!0});a=new $.ServiceManager({serverSettings:xe}),j=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,j?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(v?.(p?.connection??null),()=>{v?.(null)}),[p,v]);const b=re,F=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!b);Le(`ephemeral-document-start-${o}`,F);const oe=r.useMemo(()=>Se({name:"@datalayer/agent-runtimes/EphemeralDocument",namespace:`ephemeral-document-${o}`,theme:Ze,dependencies:[Xe,...U?[Pe]:[]],onError(i){console.error("[EphemeralDocument]",i)}}),[o,U]),ie=r.useCallback(i=>{if(!w)return;const a=JSON.stringify(i.toJSON());a!==B.current&&(B.current=a,w(a))},[w]),[x,se]=r.useState(null),[,J]=r.useState(!1),y=h?n?.roomId:void 0,[ae,le]=r.useState(),ce=y===void 0||ae===y,me=r.useCallback(i=>le(i?y:void 0),[y]),de=i=>{i!==null&&se(i)},{colorMode:ue,theme:he}=je(),k=Z??ue,ge=X??he,fe=we(),S=ve(ge),z=k==="auto"?fe:k,c=(z==="dark"?S.themeStyles.dark:S.themeStyles.light).backgroundColor??"";return e.jsx(M,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:b?e.jsx(Q,{inherit:D,colorMode:k,themeConfig:S,children:e.jsx(Ce,{colormode:z,backgroundColor:c,children:e.jsx(M,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",overscrollBehaviorY:"contain",padding:2,backgroundColor:c,"--bgColor-default":c,"& .editor-shell":{backgroundColor:c,borderRadius:2,display:"flex",flexDirection:"column",minHeight:0,flex:1,maxWidth:"none",width:"100%",margin:0},"& .editor-container":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none",margin:0},"& .editor-inner":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none"},"& .editor-scroller":{minHeight:0,flex:1,overflow:"auto",width:"100%",maxWidth:"none"},"& .editor":{minHeight:"100%",width:"100%",maxWidth:"none",margin:0},"& .editor-input":{backgroundColor:c,width:"100%",maxWidth:"none",margin:0},"& .ContentEditable__root":{width:"100%",maxWidth:"none",margin:0},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:c}},children:e.jsx(We,{lexicalId:o,serviceManager:b,children:e.jsx(be,{extension:oe,contentEditable:null,children:e.jsx(Be,{children:e.jsx(Ie,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:J,extraItems:G}):null,e.jsx("div",{className:"editor-container",children:e.jsxs("div",{className:"editor-inner",children:[h&&n?e.jsx(Ae,{id:n.roomId,providerFactory:_e,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(Fe,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(Ee,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(K,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:W}),e.jsx(Je,{}),e.jsx(ze,{}),e.jsx(Ve,{}),e.jsx($e,{kernel:p}),e.jsx(Ye,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{anchorElem:x}),e.jsx(Ke,{anchorElem:x,setIsLinkEditMode:J}),e.jsx(Qe,{anchorElem:x})]})]})})]})})})})})})})}):F?e.jsx(Q,{inherit:D,colorMode:k,themeConfig:S,children:e.jsx(M,{position:"absolute",inset:0,display:"flex",flexDirection:"column",padding:2,backgroundColor:c,children:e.jsx(K,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ht as EphemeralDocument,Ht as default};
1
+ import{r,aL as ke,aM as Se,aN as je,aO as we,aP as ve,j as e,B as M,aQ as Ce,aR as be,aS as Ee,aT as Re,aU as V,k as $,aV as Me,aW as Te,aX as Pe,aa as T,aY as Ne,aZ as Y,a_ as q,a$ as De,b0 as Ue}from"../datalayer-app-main.js";import{useLexicalTools as He}from"./lexicalHooks-BtjglRXO.js";import{u as Le}from"./useProgressTask-RwobsaO6.js";import{L as We,j as Be,T as Ie,k as Ae,l as _e,m as Fe,D as K,n as Je,o as ze,p as Ve,q as $e,J as Ye,s as qe,F as Ke,t as Qe,u as Xe,v as Ze,w as Ge}from"./JupyterLexicalExtension-CEBuhvME.js";import"./LexicalToolRegistry-LfEpCrfD.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"./Output-C6ZHZSBH.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";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=Y();t.getChildrenSize()===0&&t.append(q())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=Y();t.clear(),t.append(q())},{tag:"history-merge"})}}},[o,s]),null}function et({disabled:o}){const[s]=T();return r.useEffect(()=>{Ne(s,De).output.disabled.value=o},[s,o]),null}function tt({setIsLinkEditMode:o,extraItems:s}){const[l]=T(),[t,d]=r.useState(l);return e.jsx(Ge,{editor:l,activeEditor:t,setActiveEditor:d,setIsLinkEditMode:o,extraItems:s})}function Q({inherit:o,colorMode:s,themeConfig:l,children:t}){return o?e.jsx(e.Fragment,{children:t}):e.jsx(Te,{colorMode:s,theme:l.primerTheme,themeStyles:l.themeStyles,children:t})}function Ht({documentId:o,runtimeName:s,runtimeOverride:l,serviceManager:t,kernelId:d,themeVariant:X,colorMode:Z,content:P,onContentChange:w,onToolsReady:N,onKernelChange:v,collaboration:n,toolbarExtraItems:G,showToolbar:O=!0,inheritTheme:D=!1,autoFocus:U=!0}){const h=!!(n?.websocketUrl&&n?.roomId),ee=n?.identity?.displayName||n?.identity?.handle||n?.identity?.userId,te=n?.identity?.color,ne=r.useMemo(()=>({user:{id:n?.identity?.userId,username:n?.identity?.userId||n?.identity?.handle||n?.identity?.displayName,name:n?.identity?.handle||n?.identity?.displayName,display_name:n?.identity?.displayName||n?.identity?.handle,initials:n?.identity?.initials,color:n?.identity?.color,avatar_url:n?.identity?.avatarUrl,handle:n?.identity?.handle}}),[n?.identity]),H=r.useRef(P),L=r.useRef(o);L.current!==o&&(L.current=o,H.current=P);const W=H.current,B=r.useRef(W??""),I=He(o);r.useEffect(()=>{N?.(I)},[I,N]);const{runtimes:A,refetchRuntimes:C}=ke(),m=r.useMemo(()=>{const i=String(l?.baseUrl||"").trim();if(i)return{url:i,wsUrl:String(l?.wsUrl||"").trim()||void 0,token:String(l?.token||"").trim(),runtime_name:String(l?.runtimeName||"").trim()||"agent-node-proxy"};const a=String(s||"").trim();if(a)return A.find(j=>String(j?.runtime_name||"")===a)},[l,s,A]),_=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!_)return;C();const i=window.setInterval(()=>{C()},1e3);return()=>{window.clearInterval(i)}},[_,C]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,j=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const E=String(m?.url||"").trim();if(!E){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||E.replace(/^http/,"ws"),xe=$.ServerConnection.makeSettings({baseUrl:E,wsUrl:pe,token:u,appendToken:!0});a=new $.ServiceManager({serverSettings:xe}),j=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,j?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(v?.(p?.connection??null),()=>{v?.(null)}),[p,v]);const b=re,F=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!b);Le(`ephemeral-document-start-${o}`,F);const oe=r.useMemo(()=>Se({name:"@datalayer/agent-runtimes/EphemeralDocument",namespace:`ephemeral-document-${o}`,theme:Ze,dependencies:[Xe,...U?[Pe]:[]],onError(i){console.error("[EphemeralDocument]",i)}}),[o,U]),ie=r.useCallback(i=>{if(!w)return;const a=JSON.stringify(i.toJSON());a!==B.current&&(B.current=a,w(a))},[w]),[x,se]=r.useState(null),[,J]=r.useState(!1),y=h?n?.roomId:void 0,[ae,le]=r.useState(),ce=y===void 0||ae===y,me=r.useCallback(i=>le(i?y:void 0),[y]),de=i=>{i!==null&&se(i)},{colorMode:ue,theme:he}=je(),k=Z??ue,ge=X??he,fe=we(),S=ve(ge),z=k==="auto"?fe:k,c=(z==="dark"?S.themeStyles.dark:S.themeStyles.light).backgroundColor??"";return e.jsx(M,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:b?e.jsx(Q,{inherit:D,colorMode:k,themeConfig:S,children:e.jsx(Ce,{colormode:z,backgroundColor:c,children:e.jsx(M,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",overscrollBehaviorY:"contain",padding:2,backgroundColor:c,"--bgColor-default":c,"& .editor-shell":{backgroundColor:c,borderRadius:2,display:"flex",flexDirection:"column",minHeight:0,flex:1,maxWidth:"none",width:"100%",margin:0},"& .editor-container":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none",margin:0},"& .editor-inner":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none"},"& .editor-scroller":{minHeight:0,flex:1,overflow:"auto",width:"100%",maxWidth:"none"},"& .editor":{minHeight:"100%",width:"100%",maxWidth:"none",margin:0},"& .editor-input":{backgroundColor:c,width:"100%",maxWidth:"none",margin:0},"& .ContentEditable__root":{width:"100%",maxWidth:"none",margin:0},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:c}},children:e.jsx(We,{lexicalId:o,serviceManager:b,children:e.jsx(be,{extension:oe,contentEditable:null,children:e.jsx(Be,{children:e.jsx(Ie,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:J,extraItems:G}):null,e.jsx("div",{className:"editor-container",children:e.jsxs("div",{className:"editor-inner",children:[h&&n?e.jsx(Ae,{id:n.roomId,providerFactory:_e,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(Fe,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(Ee,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(K,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:W}),e.jsx(Je,{}),e.jsx(ze,{}),e.jsx(Ve,{}),e.jsx($e,{kernel:p}),e.jsx(Ye,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{anchorElem:x}),e.jsx(Ke,{anchorElem:x,setIsLinkEditMode:J}),e.jsx(Qe,{anchorElem:x})]})]})})]})})})})})})})}):F?e.jsx(Q,{inherit:D,colorMode:k,themeConfig:S,children:e.jsx(M,{position:"absolute",inset:0,display:"flex",flexDirection:"column",padding:2,backgroundColor:c,children:e.jsx(K,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ht as EphemeralDocument,Ht as default};
@@ -1,2 +1,2 @@
1
- import{cn as I,bg as be,k as x,ck as O,bf as Ee,e_ as _e,e$ as Re,f0 as Ce,r as f,Y as ne,aL as Me,f1 as Ue,j as v,aN as je,aO as qe,aP as Te,B as Q,aQ as Ae,aV as Ne,aW as Oe,b0 as Ie}from"../datalayer-app-main.js";import{u as Le}from"./useProgressTask-RwobsaO6.js";import{a as De}from"./NotebookToolbar-BMjQTGrr.js";import{C as Je,a as Pe,N as $e}from"./CellSidebarExtension-C6l8SYJ5.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./index-6zxBQeM_.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./index-BKAeSGYJ.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./renderer-D_wPFwb6.js";import"./SquareIcon-Dy3l3VdH.js";const H="jupyter_server_nbmodel",Be=new WeakSet;function We(e){return Be.has(e)}function re(e){const n=e.model.getMetadata(H);return n?.kernelId&&n.requestId&&n.requestUrl?n:void 0}function oe(e,n){e.model.setMetadata(H,n)}function Z(e){e.model.deleteMetadata(H)}function se(e){return(typeof e=="string"?JSON.parse(e):e).reduce((r,t)=>{const o=r[r.length-1];if(t.output_type==="stream"&&o?.output_type==="stream"&&o.name===t.name){const s=Array.isArray(o.text)?o.text.join(""):o.text??"",a=Array.isArray(t.text)?t.text.join(""):t.text??"";o.text=s+a}else r.push(t);return r},[])}function j(e){return Array.isArray(e.text)?e.text.join(""):e.text??""}function Ke(e,n){return e?.output_type==="stream"&&n?.output_type==="stream"&&e.name===n.name&&j(n).startsWith(j(e))}function He(e,n){return e.length>n.length?!1:e.every((r,t)=>I.deepEqual(r,n[t])||t===e.length-1&&Ke(r,n[t]))}function Fe(e,n){const r=Math.min(e.length,n.length);for(let t=0;t<r;t+=1){const o=e[t],s=n[t];if(I.deepEqual(o,s))continue;if(!(o?.output_type==="stream"&&s?.output_type==="stream"&&o.name===s.name))return-1;const i=j(o),u=j(s);if(!u.startsWith(i)&&!i.startsWith(u)||t<r-1)return-1}return r}function Ve(e,n,r){let t=n.length;if(n.length>0&&r.length>=n.length){const o=n.length-1,s=n[o],a=r[o];if(!I.deepEqual(s,a)){const i=j(a).slice(j(s).length);i&&e.outputArea.model.add({...a,text:i})}}for(;t<r.length;)e.outputArea.model.add(r[t]),t+=1}function ae(e,n,r){const t=e.model.sharedModel,o=t.getOutputs();if(I.deepEqual(o,n))return;if(n.length===0){r?.length&&o.length&&e.outputArea.model.clear();return}if(He(n,o))return;console.debug("[jupyter-server-nbmodel] Applying pending output snapshot",{cellId:t.getId(),outputCount:n.length});const s=Fe(o,n);s>=0?Ve(e,o.slice(0,s),n):t.setOutputs(n)}const Ge=1e3;async function Ye(e,n,r){let t;try{t=await n.json()}catch{return}if(t.request_id&&t.kernel_id){const a=n.headers.get("Location")??t.request_url;a&&(r.requestUrl=a),a&&r.recoverOutputs&&oe(e,{kernelId:t.kernel_id,requestId:t.request_id,requestUrl:a}),r.accepted||(r.accepted=!0,r.onAccepted?.())}if(t.outputs===void 0||!r.recoverOutputs)return;const o=se(t.outputs),s=r.serverOutputs;r.serverOutputs=o,ae(e,o,s)}async function K(e,n,r,t,o,s=100,a={}){const i=new be;return x.ServerConnection.makeRequest(n,r,t).then(async u=>{if(u.ok)if(u.status===202){await Ye(e,u,a);let c=u.headers.get("Location")||a.requestUrl||n;c.startsWith(t.baseUrl)||(c=O.URLExt.join(t.baseUrl,c)),setTimeout(async(_,w,m,M,k,U,p)=>{try{const h=await K(_,w,m,M,k,U,p);i.resolve(h)}catch(h){i.reject(h)}},s,e,c,{method:"GET"},t,o,Math.min(Ge,s*2),a)}else i.resolve(u);else if(u.status===300){let c=u.headers.get("Location")||"";if(!c){const p=n.match(/^(.*\/api\/kernels\/[^/?]+)/);c=p?`${p[1]}/input`:""}if(!c){i.reject(new Error(`The kernel asked for an input, and where to send it could not be determined: no Location header, and the polled URL names no kernel (${n}).`));return}c.startsWith(t.baseUrl)||(c=O.URLExt.join(t.baseUrl,c));const{parent_header:_,input_request:w}=await u.json(),m=new Ee;m.addClass("jp-OutputArea-child"),m.addClass("jp-OutputArea-stdin-item");const M=new _e;M.addClass("jp-OutputArea-prompt"),m.addWidget(M);const k=new Re({future:Object.freeze({sendInputReply:(p,h)=>{x.ServerConnection.makeRequest(c,{method:"POST",body:JSON.stringify({input:p.value})},t).catch(b=>{console.error(`Failed to set input to ${JSON.stringify(p)}.`,b)})}}),parent_header:_,password:w.password,prompt:w.prompt,translator:o});k.addClass("jp-OutputArea-output"),m.addWidget(k);const U=k.node.getElementsByTagName("input")[0];k.value.then(p=>{m.addClass("jp-OutputArea-stdin-hiding"),e.outputArea.model.add({output_type:"stream",name:"stdin",text:p+`
1
+ import{cn as I,bg as be,k as x,ck as O,bf as Ee,e_ as _e,e$ as Re,f0 as Ce,r as f,Y as ne,aL as Me,f1 as Ue,j as v,aN as je,aO as qe,aP as Te,B as Q,aQ as Ae,aV as Ne,aW as Oe,b0 as Ie}from"../datalayer-app-main.js";import{u as Le}from"./useProgressTask-RwobsaO6.js";import{a as De}from"./NotebookToolbar-BMjQTGrr.js";import{C as Je,a as Pe,N as $e}from"./CellSidebarExtension-D7aXShZc.js";import"./RepoPushIcon-BtXQRhLa.js";import"./Toolbar-BncUh2ly.js";import"./KebabHorizontalIcon-D6AY8pIS.js";import"./index-6zxBQeM_.js";import"./hoverbox-CStlKQWE.js";import"./NotebookSkeleton-BkzTMhIX.js";import"./Avatar-MNx1kN3F.js";import"./index-9wJFadG-.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BYxXubsX.js";import"./d3-color-Jd8hXty2.js";import"./renderer-8__rsP1H.js";import"./SquareIcon-Dy3l3VdH.js";const H="jupyter_server_nbmodel",Be=new WeakSet;function We(e){return Be.has(e)}function re(e){const n=e.model.getMetadata(H);return n?.kernelId&&n.requestId&&n.requestUrl?n:void 0}function oe(e,n){e.model.setMetadata(H,n)}function Z(e){e.model.deleteMetadata(H)}function se(e){return(typeof e=="string"?JSON.parse(e):e).reduce((r,t)=>{const o=r[r.length-1];if(t.output_type==="stream"&&o?.output_type==="stream"&&o.name===t.name){const s=Array.isArray(o.text)?o.text.join(""):o.text??"",a=Array.isArray(t.text)?t.text.join(""):t.text??"";o.text=s+a}else r.push(t);return r},[])}function j(e){return Array.isArray(e.text)?e.text.join(""):e.text??""}function Ke(e,n){return e?.output_type==="stream"&&n?.output_type==="stream"&&e.name===n.name&&j(n).startsWith(j(e))}function He(e,n){return e.length>n.length?!1:e.every((r,t)=>I.deepEqual(r,n[t])||t===e.length-1&&Ke(r,n[t]))}function Fe(e,n){const r=Math.min(e.length,n.length);for(let t=0;t<r;t+=1){const o=e[t],s=n[t];if(I.deepEqual(o,s))continue;if(!(o?.output_type==="stream"&&s?.output_type==="stream"&&o.name===s.name))return-1;const i=j(o),u=j(s);if(!u.startsWith(i)&&!i.startsWith(u)||t<r-1)return-1}return r}function Ve(e,n,r){let t=n.length;if(n.length>0&&r.length>=n.length){const o=n.length-1,s=n[o],a=r[o];if(!I.deepEqual(s,a)){const i=j(a).slice(j(s).length);i&&e.outputArea.model.add({...a,text:i})}}for(;t<r.length;)e.outputArea.model.add(r[t]),t+=1}function ae(e,n,r){const t=e.model.sharedModel,o=t.getOutputs();if(I.deepEqual(o,n))return;if(n.length===0){r?.length&&o.length&&e.outputArea.model.clear();return}if(He(n,o))return;console.debug("[jupyter-server-nbmodel] Applying pending output snapshot",{cellId:t.getId(),outputCount:n.length});const s=Fe(o,n);s>=0?Ve(e,o.slice(0,s),n):t.setOutputs(n)}const Ge=1e3;async function Ye(e,n,r){let t;try{t=await n.json()}catch{return}if(t.request_id&&t.kernel_id){const a=n.headers.get("Location")??t.request_url;a&&(r.requestUrl=a),a&&r.recoverOutputs&&oe(e,{kernelId:t.kernel_id,requestId:t.request_id,requestUrl:a}),r.accepted||(r.accepted=!0,r.onAccepted?.())}if(t.outputs===void 0||!r.recoverOutputs)return;const o=se(t.outputs),s=r.serverOutputs;r.serverOutputs=o,ae(e,o,s)}async function K(e,n,r,t,o,s=100,a={}){const i=new be;return x.ServerConnection.makeRequest(n,r,t).then(async u=>{if(u.ok)if(u.status===202){await Ye(e,u,a);let c=u.headers.get("Location")||a.requestUrl||n;c.startsWith(t.baseUrl)||(c=O.URLExt.join(t.baseUrl,c)),setTimeout(async(_,w,m,M,k,U,p)=>{try{const h=await K(_,w,m,M,k,U,p);i.resolve(h)}catch(h){i.reject(h)}},s,e,c,{method:"GET"},t,o,Math.min(Ge,s*2),a)}else i.resolve(u);else if(u.status===300){let c=u.headers.get("Location")||"";if(!c){const p=n.match(/^(.*\/api\/kernels\/[^/?]+)/);c=p?`${p[1]}/input`:""}if(!c){i.reject(new Error(`The kernel asked for an input, and where to send it could not be determined: no Location header, and the polled URL names no kernel (${n}).`));return}c.startsWith(t.baseUrl)||(c=O.URLExt.join(t.baseUrl,c));const{parent_header:_,input_request:w}=await u.json(),m=new Ee;m.addClass("jp-OutputArea-child"),m.addClass("jp-OutputArea-stdin-item");const M=new _e;M.addClass("jp-OutputArea-prompt"),m.addWidget(M);const k=new Re({future:Object.freeze({sendInputReply:(p,h)=>{x.ServerConnection.makeRequest(c,{method:"POST",body:JSON.stringify({input:p.value})},t).catch(b=>{console.error(`Failed to set input to ${JSON.stringify(p)}.`,b)})}}),parent_header:_,password:w.password,prompt:w.prompt,translator:o});k.addClass("jp-OutputArea-output"),m.addWidget(k);const U=k.node.getElementsByTagName("input")[0];k.value.then(p=>{m.addClass("jp-OutputArea-stdin-hiding"),e.outputArea.model.add({output_type:"stream",name:"stdin",text:p+`
2
2
  `}),U.focus(),window.setTimeout(async()=>{const h=document.activeElement;m.dispose(),h&&h instanceof HTMLElement&&h.focus();try{const b=await K(e,n,r,t,o,100,a);i.resolve(b)}catch(b){i.reject(b)}},500)}),e.outputArea.layout.addWidget(m)}else i.reject(await x.ServerConnection.ResponseError.create(u))}).catch(u=>{i.reject(new x.ServerConnection.NetworkError(u))}),i.promise}async function ze(e,n,r,t,o,s=100,a,i=!1){return K(e,n,r,t,o,s,{onAccepted:a,recoverOutputs:i})}async function Xe(e,n,r){const t=e.model.sharedModel;t.executionState="running";try{const s=await(await ze(e,n,{method:"GET"},r,void 0,100,void 0,!0)).json(),a=se(s.outputs??"[]");return ae(e,a),t.execution_count=s.execution_count??null,t.executionState="idle",Z(e),s.status==="ok"}catch(o){if(o instanceof x.ServerConnection.ResponseError&&o.response.status===404)return Z(e),t.executionState="idle",!1;throw o}}const N=new Set;function Qe(e,n){if(e.startsWith(n.baseUrl))return e;const r=e.startsWith("http")?new URL(e).pathname:e;return O.URLExt.join(n.baseUrl,r)}function Ze(e,n){if(We(e))return!1;const r=re(e);if(!r||N.has(r.requestId)||e.isDisposed||!e.model)return!1;N.add(r.requestId);const t=Qe(r.requestUrl,n);return console.info("[agent-runtimes] Resuming a server execution",{cellId:e.model.sharedModel.getId(),requestId:r.requestId,requestUrl:t}),Xe(e,t,n).catch(o=>{if(e.isDisposed){N.delete(r.requestId);return}console.warn(`[agent-runtimes] Failed to resume the execution ${r.requestId}.`,o)}),!0}const W=new Set;async function et(e,n,r){const t=`${r.baseUrl}#${n.id}`;if(W.has(t))return 0;const o=await x.ServerConnection.makeRequest(O.URLExt.join(r.baseUrl,`api/kernels/${n.id}/execute`),{method:"GET"},r);if(o.status===404)return W.add(t),0;if(!o.ok)throw await x.ServerConnection.ResponseError.create(o).catch(()=>new Error(`Invalid response: ${o.status} ${o.statusText}`.trim()));W.add(t);const s=await o.json();let a=0;for(const i of s.requests??[]){if(!i.cell_id||N.has(i.request_id))continue;const u=e.find(c=>c.model?.sharedModel.getId()===i.cell_id);!u||u.isDisposed||re(u)||(oe(u,{kernelId:i.kernel_id,requestId:i.request_id,requestUrl:i.request_url}),a+=1)}return a}async function tt(e){if(e.isDisposed)return 0;const n=e.sessionContext?.session?.kernel,r=n?.serverSettings;if(!n||!r)return 0;const t=e.content.widgets.filter(s=>s instanceof Ce);if(t.length===0)return 0;try{await et(t,n,r)}catch(s){console.warn("[agent-runtimes] Failed to discover the active executions of the kernel.",s)}let o=0;for(const s of t)Ze(s,r)&&(o+=1);return o}const ee=1e3,nt=3e4;function rt(e,n){f.useEffect(()=>{if(!e||!n)return;let r=0;const t=()=>{const a=ne.getState().selectNotebook(e)?.adapter?.panel;!a||a.isDisposed||tt(a)};t();const o=window.setInterval(()=>{if(r+=ee,r>=nt){window.clearInterval(o);return}t()},ee);return()=>{window.clearInterval(o)}},[e,n])}const te={cells:[{cell_type:"code",source:[""],metadata:{},outputs:[],execution_count:null}],metadata:{kernelspec:{display_name:"Python 3",language:"python",name:"python3"},language_info:{name:"python"}},nbformat:4,nbformat_minor:5};function ot({inherit:e,colorMode:n,themeConfig:r,children:t}){return e?v.jsx(v.Fragment,{children:t}):v.jsx(Oe,{colorMode:n,theme:r.primerTheme,themeStyles:r.themeStyles,children:t})}function bt({notebookId:e,runtimeName:n,runtimeOverride:r,serviceManager:t,inheritTheme:o=!1,kernelId:s,cellSidebarMargin:a=120,nbformat:i,onNbformatChange:u,toolbarComponent:c,toolbarExtraItems:_,showToolbar:w=!0,showSaveItem:m=!1,themeVariant:M,colorMode:k,collaborationProvider:U}){const p=f.useRef(i??te),h=f.useRef(e);h.current!==e&&(h.current=e,p.current=i??te);const b=p.current,F=f.useRef(JSON.stringify(b)),{runtimes:V,refetchRuntimes:L}=Me(void 0,{enabled:!!String(n||"").trim()&&!t&&!String(r?.baseUrl||"").trim()}),G=f.useMemo(()=>{const l=String(n||"").trim();if(l)return V.find(d=>String(d?.runtime_name||"")===l)},[n,V]),S=f.useMemo(()=>{const l=String(r?.baseUrl||"").trim();return l?{url:l,wsUrl:String(r?.wsUrl||"").trim()||void 0,token:String(r?.token||"").trim(),runtime_name:String(r?.runtimeName||"").trim()||"agent-node-proxy"}:G},[r,G]),Y=!!(!r?.baseUrl&&String(n||"").trim()&&!S);f.useEffect(()=>{if(!Y)return;L();const l=window.setInterval(()=>{L()},1e3);return()=>{window.clearInterval(l)}},[Y,L]);const[ie,D]=f.useState(null),[ue,J]=f.useState(void 0),[le,P]=f.useState(!1);f.useEffect(()=>{let l=!1,d=null,E=null;const y=async()=>{const R=String(S?.url||"").trim();if(!R){l||(D(null),J(void 0),P(!1));return}try{const A=String(S?.token||"").trim(),we=String(S?.wsUrl||"").trim()||R.replace(/^http/,"ws"),ke=x.ServerConnection.makeSettings({baseUrl:R,wsUrl:we,token:A,appendToken:!0}),C=new x.ServiceManager({serverSettings:ke});if(d=C,E=Ne(String(S?.runtime_name||""),d),l){g(C);return}await C.ready,await C.kernels.refreshRunning();const X=[...C.kernels.running()][0];if(l){g(C);return}D(C),J(X?.id),P(!X)}catch(A){d&&(g(d),d=null),l||(console.warn(`[agent-runtimes] Could not reach the sandbox at ${R}.`,A),D(null),J(void 0),P(!1))}},g=R=>{E?.(),E=null,Ie(R)};return y(),()=>{l=!0,d?(g(d),d=null):(E?.(),E=null)}},[S?.runtime_name,S?.url,S?.token,S?.wsUrl]);const q=t??ie,ce=Ue(),de=s??ue,fe=t?!s:le,me=f.useMemo(()=>{if(!w)return;const l=c||De,d=m?void 0:["notebook-save","notebook-divider-file"];return!_?.length&&!d?l:function(y){return v.jsx(l,{...y,extraItems:_,hiddenItems:d})}},[w,m,c,_]),pe=!!((String(n||"").trim()||String(r?.baseUrl||"").trim())&&!q);Le(`ephemeral-notebook-start-${e}`,pe),rt(e,q??void 0),f.useEffect(()=>{if(U)return;const l=()=>{const g=ne.getState().selectNotebook(e)?.adapter;return(g?.notebook?.model??g?.panel?.content?.model??null)?.toJSON?.()??null},d=()=>{const y=l();if(!y||!Array.isArray(y.cells))return;const g=JSON.stringify(y);g!==F.current&&(F.current=g,u?.(y))},E=window.setInterval(d,500);return()=>{window.clearInterval(E),d()}},[q,e,u]);const{colorMode:he,theme:ge}=je(),$=k??he,Se=M??ge,ye=qe(),B=Te(Se),z=$==="auto"?ye:$,T=(z==="dark"?B.themeStyles.dark:B.themeStyles.light).backgroundColor??"",ve=f.useMemo(()=>[new Je({factory:Pe})],[]),xe=f.useMemo(()=>`.datalayer/${e}.ipynb`,[e]);return v.jsx(Q,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:q&&ce?v.jsx(ot,{inherit:o,colorMode:$,themeConfig:B,children:v.jsx(Ae,{colormode:z,backgroundColor:T,children:v.jsx(Q,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",overflow:"hidden",overscrollBehaviorY:"contain",overflowAnchor:"none",padding:2,backgroundColor:T,"& #dla-Jupyter-Notebook":{display:"flex",flexDirection:"column"},...w?{"& #dla-Jupyter-Notebook > :first-of-type":{position:"sticky",top:0,zIndex:2,flex:"0 0 auto",backgroundColor:T}}:{"& .datalayer-NotebookPanel-header":{display:"none",minHeight:0}},"& #dla-Jupyter-Notebook > .dla-Box-Notebook":{flex:"1 1 auto",minHeight:0},'& [role="toolbar"][aria-label="Notebook toolbar"]':{backgroundColor:T}},children:v.jsx($e,{nbformat:b,id:e,path:xe,serviceManager:q,startDefaultKernel:fe,kernelId:de,height:"100%",cellSidebarMargin:a,extensions:ve,Toolbar:me,collaborationProvider:U})})})}):null})}export{bt as EphemeralNotebook,bt as default};
@@ -1 +1 @@
1
- import{r as o,j as p,aa as N,cc as z,cd as L,ce as T,cf as F,cg as R,I as O,ch as _}from"../datalayer-app-main.js";import{x as U,y as W,z as $,A as M}from"./JupyterLexicalExtension-BtjDYMne.js";import H from"./ExcalidrawModal-KB4MTQbk.js";import{r as X}from"./percentages-BXMCSKIN-B5BZ64UL.js";import{u as J}from"./ThemeContext-D9ztCaU3.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"./Output-BfmeU6C2.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-BKAeSGYJ.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";import"./LexicalToolRegistry-LfEpCrfD.js";import"./extends-CF3RwP-h.js";import"./index-C0d-d3s4.js";import"./index-DoBkwclg.js";const P=e=>{const n=e?.firstElementChild?.firstElementChild,g=e.getAttribute("viewBox");if(g!=null){const a=g.split(" ");e.setAttribute("width",a[2]),e.setAttribute("height",a[3])}n&&n.tagName==="style"&&n.remove()};function V({elements:e,files:n,imageContainerRef:g,appState:a,rootClassName:s=null,width:c="inherit",height:C="inherit"}){const[h,S]=o.useState(null),{theme:E}=J(h),[B,u]=o.useState(null),[v,w]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(x=>{for(const b of x)if(b.type==="attributes"&&(b.attributeName==="style"||b.attributeName==="class")){w(l=>l+1);break}});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),r.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),()=>r.disconnect()},[]),o.useEffect(()=>{(async()=>{await new Promise(D=>setTimeout(D,150));const x=["#ffffff","#000000","transparent",""],b=a?.viewBackgroundColor||"transparent",l=x.includes(b.toLowerCase()),A={...a,viewBackgroundColor:l?"transparent":a?.viewBackgroundColor,exportBackground:!l,exportWithDarkMode:E==="dark"},m=await X({appState:A,elements:e,files:n});P(m),m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("display","block"),u(m)})()},[e,n,a,E,v]);const f={};c!=="inherit"&&(f.width=`${c}px`),C!=="inherit"&&(f.height=`${C}px`);const k=a?.viewBackgroundColor||"transparent";if(["#ffffff","#000000","transparent",""].includes(k.toLowerCase())){const r=E==="dark"?"#1e1e1e":"#ffffff";f.backgroundColor=`var(--bgColor-default, var(--jp-layout-color0, var(--vscode-editor-background, ${r})))`}return p.jsx("div",{ref:r=>{S(r),r&&g&&(g.current=r)},className:s??"",style:f,dangerouslySetInnerHTML:{__html:B?.outerHTML??""}})}function Dt({nodeKey:e,data:n,width:g,height:a}){const[s]=N(),c=U(),[C,h]=o.useState(n==="[]"&&s.isEditable()),S=o.useRef(null),E=o.useRef(null),B=o.useRef(null),[u,v,w]=W(e),[f,k]=o.useState(!1);o.useEffect(()=>{if(!c){u&&w();return}return z(s.registerCommand(L,t=>{const d=E.current,i=t.target;return f?!0:d!==null&&T(i)&&d.contains(i)?(t.shiftKey||w(),v(!u),t.detail>1&&h(!0),!0):!1},F))},[w,s,u,f,v,c]);const j=o.useCallback(()=>(h(!1),s.update(()=>{const t=R(e);t&&t.remove()})),[s,e]),I=(t,d,i)=>s.update(()=>{const y=R(e);M(y)&&(t&&t.length>0||Object.keys(i).length>0?y.setData(JSON.stringify({appState:d,elements:t,files:i})):y.remove())}),r=()=>{k(!0)},x=(t,d)=>{setTimeout(()=>{k(!1)},200),s.update(()=>{const i=R(e);M(i)&&(i.setWidth(t),i.setHeight(d))})},b=o.useCallback(()=>{h(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),D=o.useCallback(()=>{h(!1),l.length===0&&s.update(()=>{const t=R(e);t&&t.remove()})},[s,e,l.length]);return p.jsxs(p.Fragment,{children:[c&&C&&p.jsx(H,{initialElements:l,initialFiles:A,initialAppState:m,isShown:C,onDelete:j,onClose:D,onSave:(t,d,i)=>{I(t,d,i),h(!1)},closeOnClickOutside:!1}),l.length>0&&p.jsxs("button",{ref:E,className:`excalidraw-button ${u?"selected":""}`,children:[p.jsx(V,{imageContainerRef:S,className:"image",elements:l,files:A,appState:m,width:g,height:a}),u&&c&&p.jsx(O,{icon:_,"aria-label":"Edit the drawing",size:"small",variant:"default",sx:{position:"absolute",top:8,right:8,zIndex:10},onMouseDown:t=>t.preventDefault(),onClick:b}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:S,editor:s,onResizeStart:r,onResizeEnd:x})]})]})}export{Dt as default};
1
+ import{r as o,j as p,aa as N,cc as z,cd as L,ce as T,cf as F,cg as R,I as O,ch as _}from"../datalayer-app-main.js";import{x as U,y as W,z as $,A as M}from"./JupyterLexicalExtension-CEBuhvME.js";import H from"./ExcalidrawModal-CDiyt5M-.js";import{r as X}from"./percentages-BXMCSKIN-B5xVDaSp.js";import{u as J}from"./ThemeContext-D9ztCaU3.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"./Output-C6ZHZSBH.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";import"./LexicalToolRegistry-LfEpCrfD.js";import"./extends-CF3RwP-h.js";import"./index-C0d-d3s4.js";import"./index-DoBkwclg.js";const P=e=>{const n=e?.firstElementChild?.firstElementChild,g=e.getAttribute("viewBox");if(g!=null){const a=g.split(" ");e.setAttribute("width",a[2]),e.setAttribute("height",a[3])}n&&n.tagName==="style"&&n.remove()};function V({elements:e,files:n,imageContainerRef:g,appState:a,rootClassName:s=null,width:c="inherit",height:C="inherit"}){const[h,S]=o.useState(null),{theme:E}=J(h),[B,u]=o.useState(null),[v,w]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(x=>{for(const b of x)if(b.type==="attributes"&&(b.attributeName==="style"||b.attributeName==="class")){w(l=>l+1);break}});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),r.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),()=>r.disconnect()},[]),o.useEffect(()=>{(async()=>{await new Promise(D=>setTimeout(D,150));const x=["#ffffff","#000000","transparent",""],b=a?.viewBackgroundColor||"transparent",l=x.includes(b.toLowerCase()),A={...a,viewBackgroundColor:l?"transparent":a?.viewBackgroundColor,exportBackground:!l,exportWithDarkMode:E==="dark"},m=await X({appState:A,elements:e,files:n});P(m),m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("display","block"),u(m)})()},[e,n,a,E,v]);const f={};c!=="inherit"&&(f.width=`${c}px`),C!=="inherit"&&(f.height=`${C}px`);const k=a?.viewBackgroundColor||"transparent";if(["#ffffff","#000000","transparent",""].includes(k.toLowerCase())){const r=E==="dark"?"#1e1e1e":"#ffffff";f.backgroundColor=`var(--bgColor-default, var(--jp-layout-color0, var(--vscode-editor-background, ${r})))`}return p.jsx("div",{ref:r=>{S(r),r&&g&&(g.current=r)},className:s??"",style:f,dangerouslySetInnerHTML:{__html:B?.outerHTML??""}})}function Dt({nodeKey:e,data:n,width:g,height:a}){const[s]=N(),c=U(),[C,h]=o.useState(n==="[]"&&s.isEditable()),S=o.useRef(null),E=o.useRef(null),B=o.useRef(null),[u,v,w]=W(e),[f,k]=o.useState(!1);o.useEffect(()=>{if(!c){u&&w();return}return z(s.registerCommand(L,t=>{const d=E.current,i=t.target;return f?!0:d!==null&&T(i)&&d.contains(i)?(t.shiftKey||w(),v(!u),t.detail>1&&h(!0),!0):!1},F))},[w,s,u,f,v,c]);const j=o.useCallback(()=>(h(!1),s.update(()=>{const t=R(e);t&&t.remove()})),[s,e]),I=(t,d,i)=>s.update(()=>{const y=R(e);M(y)&&(t&&t.length>0||Object.keys(i).length>0?y.setData(JSON.stringify({appState:d,elements:t,files:i})):y.remove())}),r=()=>{k(!0)},x=(t,d)=>{setTimeout(()=>{k(!1)},200),s.update(()=>{const i=R(e);M(i)&&(i.setWidth(t),i.setHeight(d))})},b=o.useCallback(()=>{h(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),D=o.useCallback(()=>{h(!1),l.length===0&&s.update(()=>{const t=R(e);t&&t.remove()})},[s,e,l.length]);return p.jsxs(p.Fragment,{children:[c&&C&&p.jsx(H,{initialElements:l,initialFiles:A,initialAppState:m,isShown:C,onDelete:j,onClose:D,onSave:(t,d,i)=>{I(t,d,i),h(!1)},closeOnClickOutside:!1}),l.length>0&&p.jsxs("button",{ref:E,className:`excalidraw-button ${u?"selected":""}`,children:[p.jsx(V,{imageContainerRef:S,className:"image",elements:l,files:A,appState:m,width:g,height:a}),u&&c&&p.jsx(O,{icon:_,"aria-label":"Edit the drawing",size:"small",variant:"default",sx:{position:"absolute",top:8,right:8,zIndex:10},onMouseDown:t=>t.preventDefault(),onClick:b}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:S,editor:s,onResizeStart:r,onResizeEnd:x})]})]})}export{Dt as default};
@@ -1 +1 @@
1
- import{r as t,j as o,D as u,bE as h,v as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-B5BZ64UL.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-BtjDYMne.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"./Output-BfmeU6C2.js";import"./index--S8WFITA.js";import"./hoverbox-CStlKQWE.js";import"./index-6zxBQeM_.js";import"./index-BKAeSGYJ.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";import"./LexicalToolRegistry-LfEpCrfD.js";import"./extends-CF3RwP-h.js";import"./index-C0d-d3s4.js";import"./index-DoBkwclg.js";function ue({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:E}=z(w),m=t.useRef(null),b=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[D,S]=t.useState(d);t.useEffect(()=>{m.current?.focus()},[]),t.useEffect(()=>{if(!r||!n)return;const e=()=>r.refresh(),a=requestAnimationFrame(e),s=setTimeout(e,300);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(a),clearTimeout(s),window.removeEventListener("resize",e)}},[r,n]);const A=()=>{if(p?.some(e=>!e.isDeleted)){const e=r?.getAppState(),a={exportBackground:e?.exportBackground,exportScale:e?.exportScale,exportWithDarkMode:e?.theme==="dark",isBindingEnabled:e?.isBindingEnabled,isLoading:e?.isLoading,name:e?.name,theme:e?.theme,viewBackgroundColor:e?.viewBackgroundColor,viewModeEnabled:e?.viewModeEnabled,zenModeEnabled:e?.zenModeEnabled,zoom:e?.zoom};x(p,a,D)}else v()},B=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),S(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:b,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:E})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:B,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:A,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{ue as default};
1
+ import{r as t,j as o,D as u,bE as h,v as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-B5xVDaSp.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-CEBuhvME.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"./Output-C6ZHZSBH.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";import"./LexicalToolRegistry-LfEpCrfD.js";import"./extends-CF3RwP-h.js";import"./index-C0d-d3s4.js";import"./index-DoBkwclg.js";function ue({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:E}=z(w),m=t.useRef(null),b=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[D,S]=t.useState(d);t.useEffect(()=>{m.current?.focus()},[]),t.useEffect(()=>{if(!r||!n)return;const e=()=>r.refresh(),a=requestAnimationFrame(e),s=setTimeout(e,300);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(a),clearTimeout(s),window.removeEventListener("resize",e)}},[r,n]);const A=()=>{if(p?.some(e=>!e.isDeleted)){const e=r?.getAppState(),a={exportBackground:e?.exportBackground,exportScale:e?.exportScale,exportWithDarkMode:e?.theme==="dark",isBindingEnabled:e?.isBindingEnabled,isLoading:e?.isLoading,name:e?.name,theme:e?.theme,viewBackgroundColor:e?.viewBackgroundColor,viewModeEnabled:e?.viewModeEnabled,zenModeEnabled:e?.zenModeEnabled,zoom:e?.zoom};x(p,a,D)}else v()},B=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),S(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:b,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:E})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:B,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:A,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{ue as default};