@datalayer/agent-runtimes 1.5.84 → 1.5.85

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 (79) hide show
  1. package/dist-embed/assets/{loro_wasm_bg-BNbm0Hvh.wasm → loro_wasm_bg-XW642dR7.wasm} +0 -0
  2. package/dist-embed/chunks/{DeckComponent-BsX0HZ91.js → DeckComponent-YdJOxQXT.js} +1 -1
  3. package/dist-embed/chunks/{DocumentView-BmxyGq4g.js → DocumentView-DM-hlTc_.js} +1 -1
  4. package/dist-embed/chunks/{EphemeralDocument-CcVCBncn.js → EphemeralDocument-B72SGhNu.js} +1 -1
  5. package/dist-embed/chunks/{ExcalidrawComponent-cxp7jL5I.js → ExcalidrawComponent-DdlI5Tll.js} +1 -1
  6. package/dist-embed/chunks/{ExcalidrawModal-Z5qScZ8e.js → ExcalidrawModal-DbGpgFBD.js} +1 -1
  7. package/dist-embed/chunks/{JupyterLexicalExtension-l3kTi3SD.js → JupyterLexicalExtension-BXeUUzz7.js} +5 -5
  8. package/dist-embed/chunks/{YouTubePlugin-Dxt6iAKR.js → YouTubePlugin-BZneOR95.js} +1 -1
  9. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-Cu47S0ZT.js → ar-SA-G6X2FPQ2-BamUG1DS.js} +1 -1
  10. package/dist-embed/chunks/{az-AZ-76LH7QW2-CT2mpVMp.js → az-AZ-76LH7QW2-Dj8Unmrc.js} +1 -1
  11. package/dist-embed/chunks/{bg-BG-XCXSNQG7-BiE1sIiQ.js → bg-BG-XCXSNQG7-D5eDDJTP.js} +1 -1
  12. package/dist-embed/chunks/{bn-BD-2XOGV67Q--7mObGxR.js → bn-BD-2XOGV67Q-BtdKy5Qj.js} +1 -1
  13. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-0munSsTm.js → ca-ES-6MX7JW3Y-B1_G67dI.js} +1 -1
  14. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-GtdOA9j7.js → cs-CZ-2BRQDIVT-cvUFGqN3.js} +1 -1
  15. package/dist-embed/chunks/{da-DK-5WZEPLOC-BzuoZSIU.js → da-DK-5WZEPLOC-B0GASd9Y.js} +1 -1
  16. package/dist-embed/chunks/{de-DE-XR44H4JA-BrKnOZry.js → de-DE-XR44H4JA-BXX-hBxk.js} +1 -1
  17. package/dist-embed/chunks/{el-GR-BZB4AONW-CD2Y-ocb.js → el-GR-BZB4AONW-CmOubvn_.js} +1 -1
  18. package/dist-embed/chunks/{es-ES-U4NZUMDT-B5uAri6Y.js → es-ES-U4NZUMDT-CUXrz6y_.js} +1 -1
  19. package/dist-embed/chunks/{eu-ES-A7QVB2H4-DsuJKD1Y.js → eu-ES-A7QVB2H4-UidDpFzE.js} +1 -1
  20. package/dist-embed/chunks/{fa-IR-HGAKTJCU-BKCZcc-T.js → fa-IR-HGAKTJCU-c14o5fY5.js} +1 -1
  21. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-JKchQy9X.js → fi-FI-Z5N7JZ37-C2N4F3P9.js} +1 -1
  22. package/dist-embed/chunks/{fr-FR-RHASNOE6-BYK0tD37.js → fr-FR-RHASNOE6-Docsp2bQ.js} +1 -1
  23. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-Ddzv-7Ry.js → gl-ES-HMX3MZ6V-ChUFEvG4.js} +1 -1
  24. package/dist-embed/chunks/{he-IL-6SHJWFNN-suSvxj4e.js → he-IL-6SHJWFNN-Dm7uysTx.js} +1 -1
  25. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-DFSqIUiD.js → hi-IN-IWLTKZ5I-CeY2Albs.js} +1 -1
  26. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-C_jNBqIH.js → hu-HU-A5ZG7DT2-DCDid3ls.js} +1 -1
  27. package/dist-embed/chunks/{id-ID-SAP4L64H-DUSLAWps.js → id-ID-SAP4L64H-Cu9nTzN4.js} +1 -1
  28. package/dist-embed/chunks/{index-BkiAyyFt.js → index-BlWhVENa.js} +1 -1
  29. package/dist-embed/chunks/{index-B9aUulrU.js → index-DNxREKJB.js} +1 -1
  30. package/dist-embed/chunks/{it-IT-JPQ66NNP-ByLNFdoz.js → it-IT-JPQ66NNP-BFikXjfD.js} +1 -1
  31. package/dist-embed/chunks/{ja-JP-DBVTYXUO-BC1Z8utO.js → ja-JP-DBVTYXUO-BmKD-yse.js} +1 -1
  32. package/dist-embed/chunks/{kaa-6HZHGXH3-DJG4AKJf.js → kaa-6HZHGXH3-Db041Jip.js} +1 -1
  33. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-CKPg6g8j.js → kab-KAB-ZGHBKWFO-BCvIk325.js} +1 -1
  34. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-ClOu1LU-.js → kk-KZ-P5N5QNE5-BuOKPJvy.js} +1 -1
  35. package/dist-embed/chunks/{km-KH-HSX4SM5Z-GQCLal1T.js → km-KH-HSX4SM5Z-BMHxKgUF.js} +1 -1
  36. package/dist-embed/chunks/{ko-KR-MTYHY66A-CY1h30YG.js → ko-KR-MTYHY66A-CrGHLzSs.js} +1 -1
  37. package/dist-embed/chunks/{ku-TR-6OUDTVRD-Buvmyjwr.js → ku-TR-6OUDTVRD-OWTQ-E4j.js} +1 -1
  38. package/dist-embed/chunks/{lt-LT-XHIRWOB4-BLYTzVmh.js → lt-LT-XHIRWOB4-cWU3pPV4.js} +1 -1
  39. package/dist-embed/chunks/{lv-LV-5QDEKY6T-ChlIH28N.js → lv-LV-5QDEKY6T-BxDTvB6y.js} +1 -1
  40. package/dist-embed/chunks/{mr-IN-CRQNXWMA-BP4GrhX4.js → mr-IN-CRQNXWMA-CqyfFYLc.js} +1 -1
  41. package/dist-embed/chunks/{my-MM-5M5IBNSE-D1045-lE.js → my-MM-5M5IBNSE-Cx7zaUxn.js} +1 -1
  42. package/dist-embed/chunks/{nb-NO-T6EIAALU-BPsL3nSR.js → nb-NO-T6EIAALU-B2mtxO3c.js} +1 -1
  43. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-fVmvrYwv.js → nl-NL-IS3SIHDZ-CXUwM9QK.js} +1 -1
  44. package/dist-embed/chunks/{nn-NO-6E72VCQL-C8hJ8Vnn.js → nn-NO-6E72VCQL-CHyB0wsS.js} +1 -1
  45. package/dist-embed/chunks/{oc-FR-POXYY2M6-vnwtHDEJ.js → oc-FR-POXYY2M6-PWsq-UBi.js} +1 -1
  46. package/dist-embed/chunks/{pa-IN-N4M65BXN-BxONE3x2.js → pa-IN-N4M65BXN-CY1sLit6.js} +1 -1
  47. package/dist-embed/chunks/{percentages-BXMCSKIN-2rnvdhJs.js → percentages-BXMCSKIN-B8HDDw-F.js} +3 -3
  48. package/dist-embed/chunks/{pl-PL-T2D74RX3-BXHztEmP.js → pl-PL-T2D74RX3-BsM9Abo3.js} +1 -1
  49. package/dist-embed/chunks/{pt-BR-5N22H2LF-Bg7LF_vC.js → pt-BR-5N22H2LF-BNWoCeUd.js} +1 -1
  50. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-8yWtAI3t.js → pt-PT-UZXXM6DQ-DBoCufKc.js} +1 -1
  51. package/dist-embed/chunks/{ro-RO-JPDTUUEW-DBHu7U0r.js → ro-RO-JPDTUUEW-K_k74TtF.js} +1 -1
  52. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-DltJQHCk.js → ru-RU-B4JR7IUQ-CGEGiyDu.js} +1 -1
  53. package/dist-embed/chunks/{si-LK-N5RQ5JYF-Ce9hG-1K.js → si-LK-N5RQ5JYF-BViNwnfQ.js} +1 -1
  54. package/dist-embed/chunks/{sk-SK-C5VTKIMK-DU_6r5xt.js → sk-SK-C5VTKIMK-DU3L7Dsq.js} +1 -1
  55. package/dist-embed/chunks/{sl-SI-NN7IZMDC-CPGKI4cy.js → sl-SI-NN7IZMDC-DKaPsJRy.js} +1 -1
  56. package/dist-embed/chunks/{subset-shared.chunk-BAYtuzFM.js → subset-shared.chunk-BMSr0xzY.js} +1 -1
  57. package/dist-embed/chunks/{subset-worker.chunk-DfQddq4p.js → subset-worker.chunk-CtzfGuvc.js} +1 -1
  58. package/dist-embed/chunks/{sv-SE-XGPEYMSR-CZJrL1on.js → sv-SE-XGPEYMSR-CIE6pYzb.js} +1 -1
  59. package/dist-embed/chunks/{ta-IN-2NMHFXQM-D7JO_N6W.js → ta-IN-2NMHFXQM-n0YSquYB.js} +1 -1
  60. package/dist-embed/chunks/{th-TH-HPSO5L25-BZvbjpfz.js → th-TH-HPSO5L25-Dqs6nDFF.js} +1 -1
  61. package/dist-embed/chunks/{tr-TR-DEFEU3FU-BAGBU7xX.js → tr-TR-DEFEU3FU-DV00_VI-.js} +1 -1
  62. package/dist-embed/chunks/{uk-UA-QMV73CPH-BOVTOMU-.js → uk-UA-QMV73CPH-Brc-9Imh.js} +1 -1
  63. package/dist-embed/chunks/{vi-VN-M7AON7JQ-B-3kWBiP.js → vi-VN-M7AON7JQ-Dpi-23XP.js} +1 -1
  64. package/dist-embed/chunks/{zh-CN-LNUGB5OW-0--X2bBG.js → zh-CN-LNUGB5OW-OieOX5TM.js} +1 -1
  65. package/dist-embed/chunks/{zh-HK-E62DVLB3-Ds42fL5V.js → zh-HK-E62DVLB3-DXp_54pc.js} +1 -1
  66. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-B4qCaZBc.js → zh-TW-RAJ6MFWO-DGPCsgPG.js} +1 -1
  67. package/dist-embed/datalayer-app-main.js +12 -12
  68. package/lib/apps/apps/appspec.js +1 -0
  69. package/lib/chat/base/ChatBase.js +2 -2
  70. package/lib/chat/base/conversationItems.d.ts +7 -0
  71. package/lib/chat/base/conversationItems.js +30 -0
  72. package/lib/portable/semantic-events.json +117 -2
  73. package/lib/portable/semantic.d.ts +13 -1
  74. package/lib/portable/semantic.js +1 -12
  75. package/lib/portable/semanticOfAgUi.js +15 -3
  76. package/lib/specs/appspecSchema.js +2 -1
  77. package/lib/types/agentspecs.d.ts +1 -1
  78. package/lib/types/tools.d.ts +6 -0
  79. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{jP as kt,jQ as je,jR as We,jS as Qe,jT as Ke,jU as Xe,jV as Ze,jW as Je,jX as et,jY as xe,r as Q,j as S,aK as fr,_ as Tr,jZ as vr,a9 as Cr,cd as yr,I as Rr,ce as Nr,D as Or,fY as Ar,bB as _a,T as Ir}from"../datalayer-app-main.js";import{x as xr,B as Dr,N as wr}from"./JupyterLexicalExtension-l3kTi3SD.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-Cny2pu7J.js";const ua={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:et.indigoBrand,secondary:et.indigoText,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]},dark:{primary:et.indigoBright,secondary:et.indigoAccent,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]}},lovely:{light:{primary:Je.roseBrand,secondary:Je.roseText,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]},dark:{primary:Je.roseBright,secondary:Je.roseAccent,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]}},matrix:{light:{primary:Ze.greenBrand,secondary:Ze.greenText,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]},dark:{primary:Ze.greenGlow,secondary:Ze.greenPhosphor,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]}},earth:{light:{primary:Xe.oceanBrand,secondary:Xe.oceanText,textColor:Xe.gray,primaryGradient:[Xe.oceanAccent,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanText]},dark:{primary:Xe.oceanBright,secondary:Xe.oceanAccent,textColor:Xe.gray,primaryGradient:[Xe.oceanBright,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanAccent]}},sand:{light:{primary:Ke.sandBrand,secondary:Ke.sandText,textColor:Ke.gray,primaryGradient:[Ke.sandAccent,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandText]},dark:{primary:Ke.sandBright,secondary:Ke.sandAccent,textColor:Ke.gray,primaryGradient:[Ke.sandBright,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandAccent]}},ivory:{light:{primary:Qe.ivoryBrand,secondary:Qe.ivoryText,textColor:Qe.gray,primaryGradient:[Qe.ivoryAccent,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryText]},dark:{primary:Qe.ivoryBright,secondary:Qe.ivoryAccent,textColor:Qe.gray,primaryGradient:[Qe.ivoryBright,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryAccent]}},sun:{light:{primary:We.sunBrand,secondary:We.sunText,textColor:We.gray,primaryGradient:[We.sunAccent,We.sunBrand],secondaryGradient:[We.sunHover,We.sunText]},dark:{primary:We.sunBright,secondary:We.sunAccent,textColor:We.gray,primaryGradient:[We.sunBright,We.sunBrand],secondaryGradient:[We.sunHover,We.sunAccent]}},loop:{light:{primary:je.loopAccent,secondary:je.ink,textColor:je.gray,primaryGradient:[je.loopAccent,je.loopAccent],secondaryGradient:[je.ink,je.ink]},dark:{primary:je.loopBrand,secondary:je.inkDark,textColor:je.grayDark,primaryGradient:[je.loopBrand,je.loopBrand],secondaryGradient:[je.inkDark,je.inkDark]}},vscode:{light:{primary:kt.vscodeText,secondary:"#3B3B3B",textColor:"#767676",primaryGradient:[kt.vscodeText,kt.vscodeText],secondaryGradient:["#3B3B3B","#3B3B3B"]},dark:{primary:kt.vscodeAccent,secondary:"#CCCCCC",textColor:kt.gray,primaryGradient:[kt.vscodeAccent,kt.vscodeAccent],secondaryGradient:["#CCCCCC","#CCCCCC"]}}};function Ha(i="datalayer",t="light"){const n=t==="auto"?"light":t;return ua[i]?.[n]??ua.datalayer.light}const pa=25,kr=[{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 _=Ha(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})]})]}),kr.map(({y:N,secondaryWidth:O,primaryWidth:v})=>S.jsxs("g",{children:[S.jsx("rect",{x:0,y:N,width:O,height:pa,fill:l?`url(#${p}-p)`:u}),S.jsx("rect",{x:O,y:N,width:v,height:pa,fill:l?`url(#${p}-s)`:m})]},N))]})});const Va=new Map,An=i=>Va.get(i),rn=i=>Va.has(i),Mr=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|==[^=]+==)/g,ie=i=>i.split(Mr).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}),Lr=i=>i.trim().split(/\n\s*\n/).map((t,n)=>S.jsx("p",{children:ie(t.trim())},`${n}-${t.slice(0,24)}`)),Pr=()=>{const{theme:i,colorMode:t}=fr();return{theme:i,colorMode:t}},Fr={useTheme:Pr},Ur=Q.createContext(Fr),za=()=>Q.useContext(Ur),qa=()=>{const{useTheme:i}=za();return i()},In=({footer:i,theme:t,index:n,total:e})=>{const{colorMode:a,theme:r}=qa(),{Logo:s}=za(),o=a==="auto"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a,l=Ha(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]})]})]})},xn=({name:i})=>{if(!i)return null;const t=An(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(xn,{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(In,{footer:t,theme:i,index:n,total:e})]})};var Wt=(i,t)=>{for(let n in t)i[n]=t[n];return i},j=(i,t)=>Array.from(i.querySelectorAll(t)),Ln=(i,t,n)=>{n?i.classList.add(t):i.classList.remove(t)},jt=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},Rt=(i,t)=>{i.style.transform=t},yn=(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(yn(i,t))return i;i=i.parentElement}return null},$a=i=>{i=i||document.documentElement;let t=i.requestFullscreen||i.webkitRequestFullscreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullscreen;t&&t.apply(i)},Br=(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},Vn=i=>{let t=document.createElement("style");return i&&i.length>0&&t.appendChild(document.createTextNode(i)),document.head.appendChild(t),t},ma=()=>{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]=jt(unescape(n))}return i.dependencies!==void 0&&delete i.dependencies,i},Gr=(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},Yr={mp4:"video/mp4",m4a:"video/mp4",ogv:"video/ogg",mpeg:"video/mpeg",webm:"video/webm"},Hr=(i="")=>{let t=i.split(".").pop();return t?Yr[t]:void 0},Vr=(i="")=>encodeURI(i).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),ja=navigator.userAgent,Pt=/(iphone|ipod|ipad|android)/gi.test(ja)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Wa=/android/gi.test(ja),zr=(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 cn(i){"@babel/helpers - typeof";return cn=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},cn(i)}function qr(i,t){if(cn(i)!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var e=n.call(i,t);if(cn(e)!="object")return e;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function $r(i){var t=qr(i,"string");return cn(t)=="symbol"?t:t+""}function Xn(i,t,n){return(t=$r(t))in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}var jr=class{constructor(t){Xn(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}),Pt&&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(${Vr(decodeURI(u.trim()))})`).join(",");else if(c){let u=document.createElement("video");d&&u.setAttribute("loop",""),(_||this.Reveal.isSpeakerNotes())&&(u.muted=!0),Pt&&u.setAttribute("playsinline",""),c.split(",").forEach(m=>{let p=document.createElement("source");p.setAttribute("src",m);let g=Hr(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=>{zr(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}):Pt?(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=Wt({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(),Pt&&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()}},Nt=".slides section",ht=".slides>section",Pn=".slides>section.present>section",Wr=".backgrounds>.slide-background",Qr=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Kr=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{jP as kt,jQ as je,jR as We,jS as Qe,jT as Ke,jU as Xe,jV as Ze,jW as Je,jX as et,jY as xe,r as Q,j as S,aK as fr,_ as Tr,jZ as vr,a9 as Cr,cd as yr,I as Rr,ce as Nr,D as Or,fY as Ar,bB as _a,T as Ir}from"../datalayer-app-main.js";import{x as xr,B as Dr,N as wr}from"./JupyterLexicalExtension-BXeUUzz7.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-Cny2pu7J.js";const ua={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:et.indigoBrand,secondary:et.indigoText,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]},dark:{primary:et.indigoBright,secondary:et.indigoAccent,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]}},lovely:{light:{primary:Je.roseBrand,secondary:Je.roseText,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]},dark:{primary:Je.roseBright,secondary:Je.roseAccent,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]}},matrix:{light:{primary:Ze.greenBrand,secondary:Ze.greenText,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]},dark:{primary:Ze.greenGlow,secondary:Ze.greenPhosphor,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]}},earth:{light:{primary:Xe.oceanBrand,secondary:Xe.oceanText,textColor:Xe.gray,primaryGradient:[Xe.oceanAccent,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanText]},dark:{primary:Xe.oceanBright,secondary:Xe.oceanAccent,textColor:Xe.gray,primaryGradient:[Xe.oceanBright,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanAccent]}},sand:{light:{primary:Ke.sandBrand,secondary:Ke.sandText,textColor:Ke.gray,primaryGradient:[Ke.sandAccent,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandText]},dark:{primary:Ke.sandBright,secondary:Ke.sandAccent,textColor:Ke.gray,primaryGradient:[Ke.sandBright,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandAccent]}},ivory:{light:{primary:Qe.ivoryBrand,secondary:Qe.ivoryText,textColor:Qe.gray,primaryGradient:[Qe.ivoryAccent,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryText]},dark:{primary:Qe.ivoryBright,secondary:Qe.ivoryAccent,textColor:Qe.gray,primaryGradient:[Qe.ivoryBright,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryAccent]}},sun:{light:{primary:We.sunBrand,secondary:We.sunText,textColor:We.gray,primaryGradient:[We.sunAccent,We.sunBrand],secondaryGradient:[We.sunHover,We.sunText]},dark:{primary:We.sunBright,secondary:We.sunAccent,textColor:We.gray,primaryGradient:[We.sunBright,We.sunBrand],secondaryGradient:[We.sunHover,We.sunAccent]}},loop:{light:{primary:je.loopAccent,secondary:je.ink,textColor:je.gray,primaryGradient:[je.loopAccent,je.loopAccent],secondaryGradient:[je.ink,je.ink]},dark:{primary:je.loopBrand,secondary:je.inkDark,textColor:je.grayDark,primaryGradient:[je.loopBrand,je.loopBrand],secondaryGradient:[je.inkDark,je.inkDark]}},vscode:{light:{primary:kt.vscodeText,secondary:"#3B3B3B",textColor:"#767676",primaryGradient:[kt.vscodeText,kt.vscodeText],secondaryGradient:["#3B3B3B","#3B3B3B"]},dark:{primary:kt.vscodeAccent,secondary:"#CCCCCC",textColor:kt.gray,primaryGradient:[kt.vscodeAccent,kt.vscodeAccent],secondaryGradient:["#CCCCCC","#CCCCCC"]}}};function Ha(i="datalayer",t="light"){const n=t==="auto"?"light":t;return ua[i]?.[n]??ua.datalayer.light}const pa=25,kr=[{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 _=Ha(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})]})]}),kr.map(({y:N,secondaryWidth:O,primaryWidth:v})=>S.jsxs("g",{children:[S.jsx("rect",{x:0,y:N,width:O,height:pa,fill:l?`url(#${p}-p)`:u}),S.jsx("rect",{x:O,y:N,width:v,height:pa,fill:l?`url(#${p}-s)`:m})]},N))]})});const Va=new Map,An=i=>Va.get(i),rn=i=>Va.has(i),Mr=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|==[^=]+==)/g,ie=i=>i.split(Mr).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}),Lr=i=>i.trim().split(/\n\s*\n/).map((t,n)=>S.jsx("p",{children:ie(t.trim())},`${n}-${t.slice(0,24)}`)),Pr=()=>{const{theme:i,colorMode:t}=fr();return{theme:i,colorMode:t}},Fr={useTheme:Pr},Ur=Q.createContext(Fr),za=()=>Q.useContext(Ur),qa=()=>{const{useTheme:i}=za();return i()},In=({footer:i,theme:t,index:n,total:e})=>{const{colorMode:a,theme:r}=qa(),{Logo:s}=za(),o=a==="auto"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a,l=Ha(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]})]})]})},xn=({name:i})=>{if(!i)return null;const t=An(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(xn,{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(In,{footer:t,theme:i,index:n,total:e})]})};var Wt=(i,t)=>{for(let n in t)i[n]=t[n];return i},j=(i,t)=>Array.from(i.querySelectorAll(t)),Ln=(i,t,n)=>{n?i.classList.add(t):i.classList.remove(t)},jt=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},Rt=(i,t)=>{i.style.transform=t},yn=(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(yn(i,t))return i;i=i.parentElement}return null},$a=i=>{i=i||document.documentElement;let t=i.requestFullscreen||i.webkitRequestFullscreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullscreen;t&&t.apply(i)},Br=(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},Vn=i=>{let t=document.createElement("style");return i&&i.length>0&&t.appendChild(document.createTextNode(i)),document.head.appendChild(t),t},ma=()=>{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]=jt(unescape(n))}return i.dependencies!==void 0&&delete i.dependencies,i},Gr=(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},Yr={mp4:"video/mp4",m4a:"video/mp4",ogv:"video/ogg",mpeg:"video/mpeg",webm:"video/webm"},Hr=(i="")=>{let t=i.split(".").pop();return t?Yr[t]:void 0},Vr=(i="")=>encodeURI(i).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),ja=navigator.userAgent,Pt=/(iphone|ipod|ipad|android)/gi.test(ja)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Wa=/android/gi.test(ja),zr=(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 cn(i){"@babel/helpers - typeof";return cn=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},cn(i)}function qr(i,t){if(cn(i)!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var e=n.call(i,t);if(cn(e)!="object")return e;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function $r(i){var t=qr(i,"string");return cn(t)=="symbol"?t:t+""}function Xn(i,t,n){return(t=$r(t))in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}var jr=class{constructor(t){Xn(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}),Pt&&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(${Vr(decodeURI(u.trim()))})`).join(",");else if(c){let u=document.createElement("video");d&&u.setAttribute("loop",""),(_||this.Reveal.isSpeakerNotes())&&(u.muted=!0),Pt&&u.setAttribute("playsinline",""),c.split(",").forEach(m=>{let p=document.createElement("source");p.setAttribute("src",m);let g=Hr(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=>{zr(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}):Pt?(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=Wt({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(),Pt&&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()}},Nt=".slides section",ht=".slides>section",Pn=".slides>section.present>section",Wr=".backgrounds>.slide-background",Qr=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Kr=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{$ as b,a0 as E,a5 as v,r as I,j as i,B as c,T as N,bD as j,bE as T,bF as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-CcVCBncn.js";import{O as _,b as D,u as P}from"./openingNotebook-BBToQOSy.js";import{P as d}from"./PrismCss-sPywsCAF.js";import"./lexicalHooks-BDhCatfY.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./useProgressTask-CkYoDUBo.js";import"./JupyterLexicalExtension-l3kTi3SD.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.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{$ as b,a0 as E,a5 as v,r as I,j as i,B as c,T as N,bD as j,bE as T,bF as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-B72SGhNu.js";import{O as _,b as D,u as P}from"./openingNotebook-BBToQOSy.js";import{P as d}from"./PrismCss-sPywsCAF.js";import"./lexicalHooks-BDhCatfY.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./useProgressTask-CkYoDUBo.js";import"./JupyterLexicalExtension-BXeUUzz7.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.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":D},metadata:{}}],jupyterInputNodeUuid:l,jupyterOutputNodeUuid:w}],direction:"ltr",format:"",indent:0,type:"root",version:1}}}function lt({workspace:e}){const o=b(),t=E(o.snapshot),r=e.surfaceId,n=P(T,j,{workspace:e,editorId:r}),a=v(U)[0]?.value,y=I.useMemo(()=>JSON.stringify((a?.document??A)()),[a]),x=a?.autoFocus??!0;if(t.state!=="running")return i.jsx(c,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:4,textAlign:"center",children:i.jsx(N,{children:"The document needs a running sandbox for its code blocks. Open the Sandbox view to see what it is doing."})});const p=o.getServiceManager()??void 0;return i.jsx(c,{height:"100%",minHeight:0,children:i.jsx(O,{inheritTheme:!0,documentId:r,content:y,autoFocus:x,serviceManager:p,showToolbar:n.present,toolbarExtraItems:n.items,kernelId:p?t.kernelId:void 0,runtimeOverride:!p&&t.jupyterUrl?{baseUrl:t.jupyterUrl,token:t.jupyterToken}:void 0})})}export{lt as default};
@@ -1 +1 @@
1
- import{r,aI as ke,aJ as Se,aK as je,aL as we,aM as ve,j as e,B as M,aN as Ce,aO as Ee,aP as be,aQ as Re,aR as V,k as K,aS as Me,aT as Te,aU as Pe,a9 as T,aV as Ne,aW as Y,aX as $,aY as De,aZ as Ue}from"../datalayer-app-main.js";import{useLexicalTools as He}from"./lexicalHooks-BDhCatfY.js";import{u as Ie}from"./useProgressTask-CkYoDUBo.js";import{L as Le,j as We,T as Be,k as Ae,l as Je,m as _e,D as q,n as Fe,o as ze,p as Ve,q as Ke,J as Ye,s as $e,F as qe,t as Qe,u as Xe,v as Ze,w as Ge}from"./JupyterLexicalExtension-l3kTi3SD.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=Y();t.getChildrenSize()===0&&t.append($())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=Y();t.clear(),t.append($())},{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 Ut({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),I=r.useRef(o);I.current!==o&&(I.current=o,H.current=P);const L=H.current,W=r.useRef(L??""),B=He(o);r.useEffect(()=>{N?.(B)},[B,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]),J=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!J)return;C();const i=window.setInterval(()=>{C()},1e3);return()=>{window.clearInterval(i)}},[J,C]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,j=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const b=String(m?.url||"").trim();if(!b){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||b.replace(/^http/,"ws"),xe=K.ServerConnection.makeSettings({baseUrl:b,wsUrl:pe,token:u,appendToken:!0});a=new K.ServiceManager({serverSettings:xe}),j=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,j?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(v?.(p?.connection??null),()=>{v?.(null)}),[p,v]);const E=re,_=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!E);Ie(`ephemeral-document-start-${o}`,_);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!==W.current&&(W.current=a,w(a))},[w]),[x,se]=r.useState(null),[,F]=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:E?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(Le,{lexicalId:o,serviceManager:E,children:e.jsx(Ee,{extension:oe,contentEditable:null,children:e.jsx(We,{children:e.jsx(Be,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:F,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:Je,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(_e,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(be,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(q,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:L}),e.jsx(Fe,{}),e.jsx(ze,{}),e.jsx(Ve,{}),e.jsx(Ke,{kernel:p}),e.jsx(Ye,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx($e,{anchorElem:x}),e.jsx(qe,{anchorElem:x,setIsLinkEditMode:F}),e.jsx(Qe,{anchorElem:x})]})]})})]})})})})})})})}):_?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(q,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ut as EphemeralDocument,Ut as default};
1
+ import{r,aI as ke,aJ as Se,aK as je,aL as we,aM as ve,j as e,B as M,aN as Ce,aO as Ee,aP as be,aQ as Re,aR as V,k as K,aS as Me,aT as Te,aU as Pe,a9 as T,aV as Ne,aW as Y,aX as $,aY as De,aZ as Ue}from"../datalayer-app-main.js";import{useLexicalTools as He}from"./lexicalHooks-BDhCatfY.js";import{u as Ie}from"./useProgressTask-CkYoDUBo.js";import{L as Le,j as We,T as Be,k as Ae,l as Je,m as _e,D as q,n as Fe,o as ze,p as Ve,q as Ke,J as Ye,s as $e,F as qe,t as Qe,u as Xe,v as Ze,w as Ge}from"./JupyterLexicalExtension-BXeUUzz7.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=Y();t.getChildrenSize()===0&&t.append($())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=Y();t.clear(),t.append($())},{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 Ut({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),I=r.useRef(o);I.current!==o&&(I.current=o,H.current=P);const L=H.current,W=r.useRef(L??""),B=He(o);r.useEffect(()=>{N?.(B)},[B,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]),J=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!J)return;C();const i=window.setInterval(()=>{C()},1e3);return()=>{window.clearInterval(i)}},[J,C]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,j=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const b=String(m?.url||"").trim();if(!b){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||b.replace(/^http/,"ws"),xe=K.ServerConnection.makeSettings({baseUrl:b,wsUrl:pe,token:u,appendToken:!0});a=new K.ServiceManager({serverSettings:xe}),j=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,j?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(v?.(p?.connection??null),()=>{v?.(null)}),[p,v]);const E=re,_=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!E);Ie(`ephemeral-document-start-${o}`,_);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!==W.current&&(W.current=a,w(a))},[w]),[x,se]=r.useState(null),[,F]=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:E?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(Le,{lexicalId:o,serviceManager:E,children:e.jsx(Ee,{extension:oe,contentEditable:null,children:e.jsx(We,{children:e.jsx(Be,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:F,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:Je,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(_e,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(be,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(q,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:L}),e.jsx(Fe,{}),e.jsx(ze,{}),e.jsx(Ve,{}),e.jsx(Ke,{kernel:p}),e.jsx(Ye,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx($e,{anchorElem:x}),e.jsx(qe,{anchorElem:x,setIsLinkEditMode:F}),e.jsx(Qe,{anchorElem:x})]})]})})]})})})})})})})}):_?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(q,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ut as EphemeralDocument,Ut as default};
@@ -1 +1 @@
1
- import{r as o,j as p,a9 as N,c9 as z,ca as L,cb as T,cc as F,cd as R,I as O,ce as _}from"../datalayer-app-main.js";import{x as U,y as W,z as $,A as M}from"./JupyterLexicalExtension-l3kTi3SD.js";import H from"./ExcalidrawModal-Z5qScZ8e.js";import{r as X}from"./percentages-BXMCSKIN-2rnvdhJs.js";import{u as J}from"./ThemeContext-D9ztCaU3.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./extends-CF3RwP-h.js";import"./index-TsE1d0nj.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[b,S]=o.useState(null),{theme:E}=J(b),[B,u]=o.useState(null),[v,w]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(x=>{for(const h of x)if(h.type==="attributes"&&(h.attributeName==="style"||h.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",""],h=a?.viewBackgroundColor||"transparent",l=x.includes(h.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 Bt({nodeKey:e,data:n,width:g,height:a}){const[s]=N(),c=U(),[C,b]=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&&b(!0),!0):!1},F))},[w,s,u,f,v,c]);const j=o.useCallback(()=>(b(!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))})},h=o.useCallback(()=>{b(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),D=o.useCallback(()=>{b(!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),b(!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:h}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:S,editor:s,onResizeStart:r,onResizeEnd:x})]})]})}export{Bt as default};
1
+ import{r as o,j as p,a9 as N,c9 as z,ca as L,cb as T,cc as F,cd as R,I as O,ce as _}from"../datalayer-app-main.js";import{x as U,y as W,z as $,A as M}from"./JupyterLexicalExtension-BXeUUzz7.js";import H from"./ExcalidrawModal-DbGpgFBD.js";import{r as X}from"./percentages-BXMCSKIN-B8HDDw-F.js";import{u as J}from"./ThemeContext-D9ztCaU3.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./extends-CF3RwP-h.js";import"./index-TsE1d0nj.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[b,S]=o.useState(null),{theme:E}=J(b),[B,u]=o.useState(null),[v,w]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(x=>{for(const h of x)if(h.type==="attributes"&&(h.attributeName==="style"||h.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",""],h=a?.viewBackgroundColor||"transparent",l=x.includes(h.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 Bt({nodeKey:e,data:n,width:g,height:a}){const[s]=N(),c=U(),[C,b]=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&&b(!0),!0):!1},F))},[w,s,u,f,v,c]);const j=o.useCallback(()=>(b(!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))})},h=o.useCallback(()=>{b(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),D=o.useCallback(()=>{b(!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),b(!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:h}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:S,editor:s,onResizeStart:r,onResizeEnd:x})]})]})}export{Bt as default};
@@ -1 +1 @@
1
- import{r as t,j as o,D as u,bB as h,v as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-2rnvdhJs.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-l3kTi3SD.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./extends-CF3RwP-h.js";import"./index-TsE1d0nj.js";import"./index-DoBkwclg.js";function pe({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:b}=z(w),m=t.useRef(null),E=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[B,D]=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 S=()=>{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,B)}else v()},A=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),D(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:E,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:b})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:A,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:S,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{pe as default};
1
+ import{r as t,j as o,D as u,bB as h,v as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-B8HDDw-F.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-BXeUUzz7.js";import"./NotebookSkeleton-CMjtj893.js";import"./Avatar-BdEm_dq2.js";import"./url-CyLVEV11.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-ClANP_40.js";import"./LinkIcon-D2NHA8tm.js";import"./Toolbar-F7vDq6YI.js";import"./KebabHorizontalIcon-DD3W5tPT.js";import"./ArrowUpIcon-DfyinHM7.js";import"./SortDescIcon-DoqEaF0Z.js";import"./PaintbrushIcon-uSa0SObK.js";import"./PrismCss-sPywsCAF.js";import"./Output-dIfCcUVM.js";import"./index-By5Ku2wm.js";import"./hoverbox-CStlKQWE.js";import"./index-D5M1gm36.js";import"./index-C6uCxQft.js";import"./color-CG7_7V2-.js";import"./isEqual-B_c_I9Ri.js";import"./defaultLocale-5voVPcsN.js";import"./index-N9VP4Lh3.js";import"./index-aWforeu6.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-Cny2pu7J.js";import"./extends-CF3RwP-h.js";import"./index-TsE1d0nj.js";import"./index-DoBkwclg.js";function pe({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:b}=z(w),m=t.useRef(null),E=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[B,D]=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 S=()=>{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,B)}else v()},A=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),D(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:E,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:b})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:A,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:S,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{pe as default};