@marimo-team/frontend 0.19.3-dev30 → 0.19.3-dev34

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 (81) hide show
  1. package/dist/assets/{CellStatus-CGsC_xni.js → CellStatus-C99xWY-n.js} +1 -1
  2. package/dist/assets/{JsonOutput-CCSLhScI.js → JsonOutput-vgVa8Uqm.js} +2 -2
  3. package/dist/assets/{MarimoErrorOutput-CDtUiLzW.js → MarimoErrorOutput-BheMLw1Y.js} +1 -1
  4. package/dist/assets/{RenderHTML-B1PnGgGU.js → RenderHTML-BE1SeEPf.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-DG5ez5tQ.js → add-cell-with-ai-BQ3faBMp.js} +1 -1
  6. package/dist/assets/{add-database-form-BDC4sw5d.js → add-database-form-Cd6r_tKJ.js} +1 -1
  7. package/dist/assets/{agent-panel-DvdoiTMc.js → agent-panel-B6jmJILp.js} +1 -1
  8. package/dist/assets/{ai-model-dropdown-DSzuccWn.js → ai-model-dropdown-Dv-MPaCU.js} +1 -1
  9. package/dist/assets/{app-config-button-DrOOXwCm.js → app-config-button-Dc-Pr3EG.js} +1 -1
  10. package/dist/assets/{cell-editor-Bowbis7w.js → cell-editor-6RFkGM2j.js} +3 -3
  11. package/dist/assets/cell-link--tfL3CA1.js +1 -0
  12. package/dist/assets/{cells-4S-e0VcC.js → cells-Ba_KE9BT.js} +1 -1
  13. package/dist/assets/{chat-components-Bs4IxADW.js → chat-components-gFovWg-D.js} +1 -1
  14. package/dist/assets/{chat-display-CPq1j1yR.js → chat-display-DnPj1KhL.js} +1 -1
  15. package/dist/assets/{chat-panel-dvZilXEF.js → chat-panel-47KIpqX3.js} +1 -1
  16. package/dist/assets/{client-DdSTQs8P.js → client-ptbakt_D.js} +1 -1
  17. package/dist/assets/{column-preview-DtHgotrc.js → column-preview-DhROBSPD.js} +1 -1
  18. package/dist/assets/{command-NXYtUgbp.js → command-D-UJxuGK.js} +1 -1
  19. package/dist/assets/{command-palette-85dl4RPg.js → command-palette-6sH9E7Dw.js} +1 -1
  20. package/dist/assets/{common-DTmoX7TD.js → common-CTqesfI3.js} +1 -1
  21. package/dist/assets/config-DFDEcYvy.js +1 -0
  22. package/dist/assets/{datasource-CPVUAqzI.js → datasource-D4Z8tdLQ.js} +1 -1
  23. package/dist/assets/{dependency-graph-panel-VYsYCQNm.js → dependency-graph-panel-xSFZomKN.js} +1 -1
  24. package/dist/assets/{documentation-panel-CwAtyJSz.js → documentation-panel-Dm3ob6Ir.js} +1 -1
  25. package/dist/assets/{download-BcXr1SQk.js → download-BjwKjWNy.js} +1 -1
  26. package/dist/assets/{edit-page-CCa1yDjZ.js → edit-page-CZh8JbX5.js} +6 -6
  27. package/dist/assets/{error-panel-BbbZ1gDy.js → error-panel-DMBUp0y7.js} +1 -1
  28. package/dist/assets/{es-B3NV9-gC.js → es-CHi7dcFm.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-JB9Lb6XZ.js → file-explorer-panel-DjUhUpSF.js} +1 -1
  30. package/dist/assets/{floating-outline-BDIr9Bbt.js → floating-outline-ftqqU4Np.js} +1 -1
  31. package/dist/assets/{focus-DAgLzXHM.js → focus-DZZOzpQD.js} +1 -1
  32. package/dist/assets/{form-DVkjQxq_.js → form-CnZqs8Bn.js} +1 -1
  33. package/dist/assets/{globals-BJD8iIVw.js → globals-Dh1hxKNk.js} +1 -1
  34. package/dist/assets/{home-page-5ew0gT8b.js → home-page-BMu2cQgR.js} +1 -1
  35. package/dist/assets/{index-D2zgBMLw.js → index-B41y3eqf.js} +22 -22
  36. package/dist/assets/{kiosk-mode-Cev1VOAm.js → kiosk-mode-lfj9N4vd.js} +1 -1
  37. package/dist/assets/{layout-CurIookF.js → layout-0e9X02ON.js} +1 -1
  38. package/dist/assets/links-DbDrjRnm.js +1 -0
  39. package/dist/assets/{logs-panel-CLsE2AN1.js → logs-panel-pc8_rMGL.js} +1 -1
  40. package/dist/assets/{markdown-renderer-Cc0PiY-K.js → markdown-renderer-DOsqiCxS.js} +1 -1
  41. package/dist/assets/{mode-B3tNMXH2.js → mode-BCyUhVQM.js} +1 -1
  42. package/dist/assets/{name-cell-input-lkGsSC32.js → name-cell-input-DwI5DL4H.js} +1 -1
  43. package/dist/assets/{outline-panel-CR_3Njth.js → outline-panel-BkVymtAn.js} +1 -1
  44. package/dist/assets/{packages-panel-D2JfrhoE.js → packages-panel-C2AcLZfz.js} +1 -1
  45. package/dist/assets/{panels-CpuHPy5a.js → panels-Bw1r9qwY.js} +1 -1
  46. package/dist/assets/{process-output-rKnBuRRW.js → process-output-C46Mdai2.js} +1 -1
  47. package/dist/assets/{readonly-python-code-D7ixCdRP.js → readonly-python-code-C5OixNOu.js} +1 -1
  48. package/dist/assets/{run-page-UbtG3woR.js → run-page-gAREGgIk.js} +1 -1
  49. package/dist/assets/{scratchpad-panel-Bvg9Sbf8.js → scratchpad-panel-CCfSlzxc.js} +1 -1
  50. package/dist/assets/{session-panel-CE7qRaFP.js → session-panel-BuxKOamF.js} +1 -1
  51. package/dist/assets/{snippets-panel-CiNTJKw4.js → snippets-panel-B6_Edpel.js} +1 -1
  52. package/dist/assets/{state-CZqgb3sC.js → state-CSQYiEJY.js} +1 -1
  53. package/dist/assets/{state-lX2Tur1r.js → state-CW2XRi_v.js} +1 -1
  54. package/dist/assets/{switch-utDdERLs.js → switch-eOpIZoDX.js} +1 -1
  55. package/dist/assets/{terminal-BWM0fOMh.js → terminal-BbAhzgnR.js} +1 -1
  56. package/dist/assets/{textarea-CuGxnSJT.js → textarea-niGA0rfg.js} +1 -1
  57. package/dist/assets/{tracing-CfhQiEJB.js → tracing-DkpVk4o4.js} +1 -1
  58. package/dist/assets/{tracing-panel-BES8ykC_.js → tracing-panel-BIncP1rT.js} +2 -2
  59. package/dist/assets/{types-BqIUl7zM.js → types-VIX1OCSW.js} +1 -1
  60. package/dist/assets/{useAddCell-B5Yugh3r.js → useAddCell-B_xjsTBs.js} +1 -1
  61. package/dist/assets/useBoolean-CyOFPk5r.js +1 -0
  62. package/dist/assets/{useCellActionButton-BNKqQ1-h.js → useCellActionButton-Ds3zG2vC.js} +1 -1
  63. package/dist/assets/{useDeleteCell-ChzEFH8j.js → useDeleteCell-BHcO82VK.js} +1 -1
  64. package/dist/assets/{useDependencyPanelTab-MCxvkAot.js → useDependencyPanelTab-D-cjUX7M.js} +1 -1
  65. package/dist/assets/{useNotebookActions-BRPD06EX.js → useNotebookActions-BR0qaiDG.js} +1 -1
  66. package/dist/assets/{useRunCells-Dgv3VAFX.js → useRunCells-DNyvw4YU.js} +1 -1
  67. package/dist/assets/{useSplitCell-_rfoF197.js → useSplitCell-PfU2seYs.js} +1 -1
  68. package/dist/assets/{utilities.esm-C0AZu44u.js → utilities.esm-B52GCDdx.js} +2 -2
  69. package/dist/assets/{vega-component-BoLFf7jF.js → vega-component-dUiiVmIx.js} +1 -1
  70. package/dist/index.html +33 -33
  71. package/package.json +1 -1
  72. package/src/__tests__/mount.test.ts +128 -0
  73. package/src/components/data-table/column-header.tsx +1 -1
  74. package/src/components/editor/alerts/connecting-alert.tsx +33 -6
  75. package/src/core/network/__tests__/requests-network.test.ts +0 -18
  76. package/src/core/network/requests-network.ts +2 -7
  77. package/src/mount.tsx +6 -0
  78. package/dist/assets/cell-link-DXYH8FLx.js +0 -1
  79. package/dist/assets/config-Ba3eeYri.js +0 -1
  80. package/dist/assets/links-Bpd4gqTj.js +0 -1
  81. package/dist/assets/useBoolean-DI-eW-xX.js +0 -1
@@ -1,4 +1,4 @@
1
- import{s as G}from"./chunk-LvLJmgfZ.js";import{d as ye,f as ve,l as Ne,u as be}from"./useEvent-DlWF5OMa.js";import{t as we}from"./react-BGmjiNul.js";import{C as ke,Fr as J,Kr as Ie,Pn as $e,Pr as _e,fn as Fe,in as Ae,q as Te,v as Ce}from"./cells-4S-e0VcC.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{t as Se}from"./invariant-C6yE60hi.js";import{r as Me}from"./utils-CJJIceVn.js";import{t as qe}from"./jsx-runtime-DN_bIXfG.js";import{r as X,t as $}from"./button-B8cGZzP5.js";import{t as Y}from"./cn-C1rgT0yh.js";import{t as H}from"./createLucideIcon-CW2xpJ57.js";import{_ as ze}from"./select-D9lTzMzP.js";import{a as Ee,p as Pe,r as Le,t as We}from"./dropdown-menu-BP4_BZLr.js";import{a as Ve,n as Be}from"./state-lX2Tur1r.js";import{c as Z,n as Qe}from"./datasource-CPVUAqzI.js";import{a as De}from"./dist-RKnr9SNh.js";import{t as ee}from"./tooltip-CvjcEpZC.js";import{a as Oe,i as He,n as Ue,r as Ke}from"./multi-map-CQd4MZr5.js";import{t as te}from"./kbd-Czc5z_04.js";import{t as A}from"./links-DNmjkr65.js";import{r as Re,t as Ge}from"./alert-BEdExd6A.js";import{o as Je,t as Xe}from"./useInstallPackage-RldLPyJs.js";import{n as b}from"./cell-link-DXYH8FLx.js";var Ye=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),re=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function Ze(r){let e=null,s=r.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function et(r){let e=r.split(`
1
+ import{s as G}from"./chunk-LvLJmgfZ.js";import{d as ye,f as ve,l as Ne,u as be}from"./useEvent-DlWF5OMa.js";import{t as we}from"./react-BGmjiNul.js";import{C as ke,Fr as J,Kr as Ie,Pn as $e,Pr as _e,fn as Fe,in as Ae,q as Te,v as Ce}from"./cells-Ba_KE9BT.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{t as Se}from"./invariant-C6yE60hi.js";import{r as Me}from"./utils-CJJIceVn.js";import{t as qe}from"./jsx-runtime-DN_bIXfG.js";import{r as X,t as $}from"./button-B8cGZzP5.js";import{t as Y}from"./cn-C1rgT0yh.js";import{t as H}from"./createLucideIcon-CW2xpJ57.js";import{_ as ze}from"./select-D9lTzMzP.js";import{a as Ee,p as Pe,r as Le,t as We}from"./dropdown-menu-BP4_BZLr.js";import{a as Ve,n as Be}from"./state-CW2XRi_v.js";import{c as Z,n as Qe}from"./datasource-D4Z8tdLQ.js";import{a as De}from"./dist-RKnr9SNh.js";import{t as ee}from"./tooltip-CvjcEpZC.js";import{a as Oe,i as He,n as Ue,r as Ke}from"./multi-map-CQd4MZr5.js";import{t as te}from"./kbd-Czc5z_04.js";import{t as A}from"./links-DNmjkr65.js";import{r as Re,t as Ge}from"./alert-BEdExd6A.js";import{o as Je,t as Xe}from"./useInstallPackage-RldLPyJs.js";import{n as b}from"./cell-link--tfL3CA1.js";var Ye=H("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=H("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),re=H("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);function Ze(r){let e=null,s=r.cursor();do s.name==="ExpressionStatement"&&(e=s.node);while(s.next());return e}function et(r){let e=r.split(`
2
2
  `),s=" ",n=Ze(De.parse(r));if(!n)return["def _():",...U(e,s),`${s}return`,"","","_()"].join(`
3
3
  `);let i=r.slice(0,n.from).trim(),l=r.slice(n.from).trim(),a=i.split(`
4
4
  `),c=l.split(`
@@ -1 +1 @@
1
- import{s as v}from"./chunk-LvLJmgfZ.js";import{p as x,u as j}from"./useEvent-DlWF5OMa.js";import{t as _}from"./react-BGmjiNul.js";import{Fr as u,Pr as w}from"./cells-4S-e0VcC.js";import{t as y}from"./compiler-runtime-DeeZ7FnK.js";import{o as N}from"./utils-CJJIceVn.js";import{t as R}from"./jsx-runtime-DN_bIXfG.js";import{t as z}from"./mode-B3tNMXH2.js";import{t as C}from"./usePress-DTwIUo40.js";import{t as F}from"./copy-icon-jWsqdLn1.js";import{t as E}from"./purify.es-N-2faAGj.js";import{t as H}from"./useRunCells-Dgv3VAFX.js";var k=y(),m=v(_(),1),s=v(R(),1);const M=e=>{let t=(0,k.c)(16),r,a,i;t[0]===e?(r=t[1],a=t[2],i=t[3]):({href:a,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=i);let o=(0,m.useRef)(null),l;t[4]===a?l=t[5]:(l=()=>{let d=new URL(globalThis.location.href);d.hash=a,globalThis.history.pushState({},"",d.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let S=a.slice(1),A=document.getElementById(S);A&&A.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=a,t[5]=l);let n=l,c;t[6]===n?c=t[7]:(c={onPress:()=>{n()}},t[6]=n,t[7]=c);let{pressProps:b}=C(c),f;t[8]===n?f=t[9]:(f=d=>{d.preventDefault(),n()},t[8]=n,t[9]=f);let g=f,h;return t[10]!==r||t[11]!==g||t[12]!==a||t[13]!==b||t[14]!==i?(h=(0,s.jsx)("a",{ref:o,href:a,...b,onClick:g,...i,children:r}),t[10]=r,t[11]=g,t[12]=a,t[13]=b,t[14]=i,t[15]=h):h=t[15],h};var T=x(e=>{let t=e(H),r=e(N);if(t||r)return!1;let a=!0;try{a=z()==="read"}catch{return!0}return!a});function L(){return j(T)}var p="data-temp-href-target";E.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&(e.hasAttribute("target")||e.setAttribute("target","_self"),e.hasAttribute("target")&&e.setAttribute(p,e.getAttribute("target")||""))}),E.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(p)&&(e.setAttribute("target",e.getAttribute(p)||""),e.removeAttribute(p),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"))});function O(e){let t={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return E.sanitize(e,t)}var I=y(),D=e=>{if(e instanceof u.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return m.createElement(m.Fragment)},P=(e,t)=>{if(t instanceof u.Element&&t.name==="body"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},V=(e,t)=>{if(t instanceof u.Element&&t.name==="html"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},W=e=>{if(e instanceof u.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,a])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,a)}),(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},$=e=>{if(e instanceof u.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!document.querySelector(`script[src="${t}"]`)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,s.jsx)(s.Fragment,{})}},U=(e,t)=>{if(t instanceof u.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let a=null;return(0,m.isValidElement)(e)&&"props"in e&&(a=e.props.children),(0,s.jsx)(M,{href:r,...t.attribs,children:a})}}},Z=(e,t,r)=>{var a,i;if(t instanceof u.Element&&t.name==="div"&&((i=(a=t.attribs)==null?void 0:a.class)!=null&&i.includes("codehilite")))return(0,s.jsx)(B,{children:e},r)},B=e=>{let t=(0,I.c)(3),{children:r}=e,a=(0,m.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(F,{tooltip:!1,className:"p-1",value:()=>{var n;let l=(n=a.current)==null?void 0:n.firstChild;return l&&l.textContent||""}})}),t[0]=i):i=t[0];let o;return t[1]===r?o=t[2]:(o=(0,s.jsxs)("div",{className:"relative group codehilite-wrapper",ref:a,children:[r,i]}),t[1]=r,t[2]=o),o};const q=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,s.jsx)(G,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var G=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let a=L();return X({html:(0,m.useMemo)(()=>r||a?O(e):e,[e,r,a]),additionalReplacements:t})};function X({html:e,additionalReplacements:t=[]}){let r=[D,W,$,...t],a=[Z,U,P,V];return w(e,{replace:(i,o)=>{for(let l of r){let n=l(i,o);if(n)return n}return i},transform:(i,o,l)=>{for(let n of a){let c=n(i,o,l);if(c)return c}return i}})}export{q as t};
1
+ import{s as v}from"./chunk-LvLJmgfZ.js";import{p as x,u as j}from"./useEvent-DlWF5OMa.js";import{t as _}from"./react-BGmjiNul.js";import{Fr as u,Pr as w}from"./cells-Ba_KE9BT.js";import{t as y}from"./compiler-runtime-DeeZ7FnK.js";import{o as N}from"./utils-CJJIceVn.js";import{t as R}from"./jsx-runtime-DN_bIXfG.js";import{t as z}from"./mode-BCyUhVQM.js";import{t as C}from"./usePress-DTwIUo40.js";import{t as F}from"./copy-icon-jWsqdLn1.js";import{t as E}from"./purify.es-N-2faAGj.js";import{t as H}from"./useRunCells-DNyvw4YU.js";var k=y(),m=v(_(),1),s=v(R(),1);const M=e=>{let t=(0,k.c)(16),r,a,i;t[0]===e?(r=t[1],a=t[2],i=t[3]):({href:a,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=i);let o=(0,m.useRef)(null),l;t[4]===a?l=t[5]:(l=()=>{let d=new URL(globalThis.location.href);d.hash=a,globalThis.history.pushState({},"",d.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let S=a.slice(1),A=document.getElementById(S);A&&A.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=a,t[5]=l);let n=l,c;t[6]===n?c=t[7]:(c={onPress:()=>{n()}},t[6]=n,t[7]=c);let{pressProps:b}=C(c),f;t[8]===n?f=t[9]:(f=d=>{d.preventDefault(),n()},t[8]=n,t[9]=f);let g=f,h;return t[10]!==r||t[11]!==g||t[12]!==a||t[13]!==b||t[14]!==i?(h=(0,s.jsx)("a",{ref:o,href:a,...b,onClick:g,...i,children:r}),t[10]=r,t[11]=g,t[12]=a,t[13]=b,t[14]=i,t[15]=h):h=t[15],h};var T=x(e=>{let t=e(H),r=e(N);if(t||r)return!1;let a=!0;try{a=z()==="read"}catch{return!0}return!a});function L(){return j(T)}var p="data-temp-href-target";E.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&(e.hasAttribute("target")||e.setAttribute("target","_self"),e.hasAttribute("target")&&e.setAttribute(p,e.getAttribute("target")||""))}),E.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(p)&&(e.setAttribute("target",e.getAttribute(p)||""),e.removeAttribute(p),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer"))});function O(e){let t={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return E.sanitize(e,t)}var I=y(),D=e=>{if(e instanceof u.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return m.createElement(m.Fragment)},P=(e,t)=>{if(t instanceof u.Element&&t.name==="body"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},V=(e,t)=>{if(t instanceof u.Element&&t.name==="html"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},W=e=>{if(e instanceof u.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,a])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,a)}),(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},$=e=>{if(e instanceof u.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!document.querySelector(`script[src="${t}"]`)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,s.jsx)(s.Fragment,{})}},U=(e,t)=>{if(t instanceof u.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let a=null;return(0,m.isValidElement)(e)&&"props"in e&&(a=e.props.children),(0,s.jsx)(M,{href:r,...t.attribs,children:a})}}},Z=(e,t,r)=>{var a,i;if(t instanceof u.Element&&t.name==="div"&&((i=(a=t.attribs)==null?void 0:a.class)!=null&&i.includes("codehilite")))return(0,s.jsx)(B,{children:e},r)},B=e=>{let t=(0,I.c)(3),{children:r}=e,a=(0,m.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(F,{tooltip:!1,className:"p-1",value:()=>{var n;let l=(n=a.current)==null?void 0:n.firstChild;return l&&l.textContent||""}})}),t[0]=i):i=t[0];let o;return t[1]===r?o=t[2]:(o=(0,s.jsxs)("div",{className:"relative group codehilite-wrapper",ref:a,children:[r,i]}),t[1]=r,t[2]=o),o};const q=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,s.jsx)(G,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var G=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let a=L();return X({html:(0,m.useMemo)(()=>r||a?O(e):e,[e,r,a]),additionalReplacements:t})};function X({html:e,additionalReplacements:t=[]}){let r=[D,W,$,...t],a=[Z,U,P,V];return w(e,{replace:(i,o)=>{for(let l of r){let n=l(i,o);if(n)return n}return i},transform:(i,o,l)=>{for(let n of a){let c=n(i,o,l);if(c)return c}return i}})}export{q as t};
@@ -1,4 +1,4 @@
1
- var Un=Object.defineProperty;var Vn=(t,e,a)=>e in t?Un(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var $=(t,e,a)=>Vn(t,typeof e!="symbol"?e+"":e,a);import{s as ka,t as qn}from"./chunk-LvLJmgfZ.js";import{f as Rr,i as Nr,l as Bn,n as Wn,o as Jn,u as Kn}from"./useEvent-DlWF5OMa.js";import{t as Yn}from"./react-BGmjiNul.js";import{$n as Mr,$r as Hn,At as Gn,Bn as Qn,Br as Xn,C as Pr,Cn as ei,Kr as ti,Qn as ai,Qr as jr,Sr as ri,Tt as $r,Wr as si,Xn as ni,d as ii,fn as oi,hn as li,i as di,it as Ca,pt as ui,v as Ge,yr as ci}from"./cells-4S-e0VcC.js";import{B as Te,D as pi,E as Lr,H as mi,I as It,J as Dr,L as ee,N as Zr,O as hi,P as Q,R as k,S as fi,T as de,V as Ue,W as Fr,b as Bt,k as N,w as Ve,x as Wt}from"./zod-Cg4WLWh2.js";import{t as Ea}from"./compiler-runtime-DeeZ7FnK.js";import{i as zr}from"./useLifecycle-CmDXEyIC.js";import{d as oe,s as gi}from"./hotkeys-uKX61F1_.js";import{o as yi}from"./config-Ba3eeYri.js";import{t as vi}from"./jsx-runtime-DN_bIXfG.js";import{t as Qe}from"./button-B8cGZzP5.js";import{t as Ur}from"./cn-C1rgT0yh.js";import{Bt as _i,Jt,St as Kt,Ut as Vr,Vt as bi,Xt as xi,at as qr,ct as wi,lt as Br,qt as Yt,rt as Ta,xt as ki}from"./dist-CAcX026F.js";import{t as Ci}from"./createReducer-DDa-hVe3.js";import{h as Ei,n as Ti,o as Ii,r as Si}from"./dist-DKNOF5xd.js";import{r as Oi,t as Ai}from"./requests-C0HaHO6a.js";import{t as Ia}from"./createLucideIcon-CW2xpJ57.js";import{t as Ri}from"./ai-model-dropdown-DSzuccWn.js";import{h as Ni}from"./select-D9lTzMzP.js";import{f as Mi,n as Pi,u as Wr}from"./markdown-renderer-Cc0PiY-K.js";import{a as Jr,c as ji,p as $i,r as Li,t as Di}from"./dropdown-menu-BP4_BZLr.js";import{t as Zi}from"./play-BJDBXApx.js";import{n as Fi}from"./spinner-C1czjtp7.js";import{a as zi}from"./state-lX2Tur1r.js";import{a as St,i as yt,o as Ot,r as vt,s as Ui,t as Vi}from"./datasource-CPVUAqzI.js";import{a as qi}from"./dist-HGZzCB0y.js";import{t as Kr}from"./use-toast-Bzf3rpev.js";import{r as Bi}from"./useTheme-DfP1CWaW.js";import{t as Wi}from"./tooltip-CvjcEpZC.js";import{s as Ji}from"./popover-DtnzNVk-.js";import{a as Ki}from"./error-banner-DvT0IGDZ.js";import{n as Yi}from"./useRunCells-Dgv3VAFX.js";import{i as Sa}from"./cell-link-DXYH8FLx.js";import{r as Hi,t as Gi}from"./es-B3NV9-gC.js";import{n as Oa}from"./renderShortcut-D0Pei-OA.js";import{t as Qi}from"./process-output-rKnBuRRW.js";import{t as Xi}from"./blob-Dg_vNTSs.js";import{t as eo}from"./useDeleteCell-ChzEFH8j.js";import{r as to,t as ao}from"./esm-B3JckBtM.js";import{n as ro}from"./icons-D4lB4En9.js";var so=Ia("at-sign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),no=Ia("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),io=Ia("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),Yr="vercel.ai.error",oo=Symbol.for(Yr),Hr,Gr,Xe=class Pn extends(Gr=Error,Hr=oo,Gr){constructor({name:e,message:a,cause:r}){super(a),this[Hr]=!0,this.name=e,this.cause=r}static isInstance(e){return Pn.hasMarker(e,Yr)}static hasMarker(e,a){let r=Symbol.for(a);return typeof e=="object"&&!!e&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Qr(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Xr="AI_InvalidArgumentError",es=`vercel.ai.error.${Xr}`,lo=Symbol.for(es),ts,as,uo=class extends(as=Xe,ts=lo,as){constructor({message:t,cause:e,argument:a}){super({name:Xr,message:t,cause:e}),this[ts]=!0,this.argument=a}static isInstance(t){return Xe.hasMarker(t,es)}},rs="AI_JSONParseError",ss=`vercel.ai.error.${rs}`,co=Symbol.for(ss),ns,is,os=class extends(is=Xe,ns=co,is){constructor({text:t,cause:e}){super({name:rs,message:`JSON parsing failed: Text: ${t}.
1
+ var Un=Object.defineProperty;var Vn=(t,e,a)=>e in t?Un(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var $=(t,e,a)=>Vn(t,typeof e!="symbol"?e+"":e,a);import{s as ka,t as qn}from"./chunk-LvLJmgfZ.js";import{f as Rr,i as Nr,l as Bn,n as Wn,o as Jn,u as Kn}from"./useEvent-DlWF5OMa.js";import{t as Yn}from"./react-BGmjiNul.js";import{$n as Mr,$r as Hn,At as Gn,Bn as Qn,Br as Xn,C as Pr,Cn as ei,Kr as ti,Qn as ai,Qr as jr,Sr as ri,Tt as $r,Wr as si,Xn as ni,d as ii,fn as oi,hn as li,i as di,it as Ca,pt as ui,v as Ge,yr as ci}from"./cells-Ba_KE9BT.js";import{B as Te,D as pi,E as Lr,H as mi,I as It,J as Dr,L as ee,N as Zr,O as hi,P as Q,R as k,S as fi,T as de,V as Ue,W as Fr,b as Bt,k as N,w as Ve,x as Wt}from"./zod-Cg4WLWh2.js";import{t as Ea}from"./compiler-runtime-DeeZ7FnK.js";import{i as zr}from"./useLifecycle-CmDXEyIC.js";import{d as oe,s as gi}from"./hotkeys-uKX61F1_.js";import{o as yi}from"./config-DFDEcYvy.js";import{t as vi}from"./jsx-runtime-DN_bIXfG.js";import{t as Qe}from"./button-B8cGZzP5.js";import{t as Ur}from"./cn-C1rgT0yh.js";import{Bt as _i,Jt,St as Kt,Ut as Vr,Vt as bi,Xt as xi,at as qr,ct as wi,lt as Br,qt as Yt,rt as Ta,xt as ki}from"./dist-CAcX026F.js";import{t as Ci}from"./createReducer-DDa-hVe3.js";import{h as Ei,n as Ti,o as Ii,r as Si}from"./dist-DKNOF5xd.js";import{r as Oi,t as Ai}from"./requests-C0HaHO6a.js";import{t as Ia}from"./createLucideIcon-CW2xpJ57.js";import{t as Ri}from"./ai-model-dropdown-Dv-MPaCU.js";import{h as Ni}from"./select-D9lTzMzP.js";import{f as Mi,n as Pi,u as Wr}from"./markdown-renderer-DOsqiCxS.js";import{a as Jr,c as ji,p as $i,r as Li,t as Di}from"./dropdown-menu-BP4_BZLr.js";import{t as Zi}from"./play-BJDBXApx.js";import{n as Fi}from"./spinner-C1czjtp7.js";import{a as zi}from"./state-CW2XRi_v.js";import{a as St,i as yt,o as Ot,r as vt,s as Ui,t as Vi}from"./datasource-D4Z8tdLQ.js";import{a as qi}from"./dist-HGZzCB0y.js";import{t as Kr}from"./use-toast-Bzf3rpev.js";import{r as Bi}from"./useTheme-DfP1CWaW.js";import{t as Wi}from"./tooltip-CvjcEpZC.js";import{s as Ji}from"./popover-DtnzNVk-.js";import{a as Ki}from"./error-banner-DvT0IGDZ.js";import{n as Yi}from"./useRunCells-DNyvw4YU.js";import{i as Sa}from"./cell-link--tfL3CA1.js";import{r as Hi,t as Gi}from"./es-CHi7dcFm.js";import{n as Oa}from"./renderShortcut-D0Pei-OA.js";import{t as Qi}from"./process-output-C46Mdai2.js";import{t as Xi}from"./blob-Dg_vNTSs.js";import{t as eo}from"./useDeleteCell-BHcO82VK.js";import{r as to,t as ao}from"./esm-B3JckBtM.js";import{n as ro}from"./icons-D4lB4En9.js";var so=Ia("at-sign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),no=Ia("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),io=Ia("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),Yr="vercel.ai.error",oo=Symbol.for(Yr),Hr,Gr,Xe=class Pn extends(Gr=Error,Hr=oo,Gr){constructor({name:e,message:a,cause:r}){super(a),this[Hr]=!0,this.name=e,this.cause=r}static isInstance(e){return Pn.hasMarker(e,Yr)}static hasMarker(e,a){let r=Symbol.for(a);return typeof e=="object"&&!!e&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Qr(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Xr="AI_InvalidArgumentError",es=`vercel.ai.error.${Xr}`,lo=Symbol.for(es),ts,as,uo=class extends(as=Xe,ts=lo,as){constructor({message:t,cause:e,argument:a}){super({name:Xr,message:t,cause:e}),this[ts]=!0,this.argument=a}static isInstance(t){return Xe.hasMarker(t,es)}},rs="AI_JSONParseError",ss=`vercel.ai.error.${rs}`,co=Symbol.for(ss),ns,is,os=class extends(is=Xe,ns=co,is){constructor({text:t,cause:e}){super({name:rs,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Qr(e)}`,cause:e}),this[ns]=!0,this.text=t}static isInstance(t){return Xe.hasMarker(t,ss)}},ls="AI_TypeValidationError",ds=`vercel.ai.error.${ls}`,po=Symbol.for(ds),us,cs,Ht=class Er extends(cs=Xe,us=po,cs){constructor({value:e,cause:a}){super({name:ls,message:`Type validation failed: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Qr(a)}`,cause:a}),this[us]=!0,this.value=e}static isInstance(e){return Xe.hasMarker(e,ds)}static wrap({value:e,cause:a}){return Er.isInstance(a)&&a.value===e?a:new Er({value:e,cause:a})}},ps=class extends Error{constructor(t,e){super(t),this.name="ParseError",this.type=e.type,this.field=e.field,this.value=e.value,this.line=e.line}};function Aa(t){}function mo(t){if(typeof t=="function")throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=Aa,onError:a=Aa,onRetry:r=Aa,onComment:s}=t,n="",o=!0,i,l="",d="";function u(f){let c=o?f.replace(/^\xEF\xBB\xBF/,""):f,[m,_]=ho(`${n}${c}`);for(let E of m)p(E);n=_,o=!1}function p(f){if(f===""){h();return}if(f.startsWith(":")){s&&s(f.slice(f.startsWith(": ")?2:1));return}let c=f.indexOf(":");if(c!==-1){let m=f.slice(0,c),_=f[c+1]===" "?2:1;g(m,f.slice(c+_),f);return}g(f,"",f)}function g(f,c,m){switch(f){case"event":d=c;break;case"data":l=`${l}${c}
4
4
  `;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?r(parseInt(c,10)):a(new ps(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:m}));break;default:a(new ps(`Unknown field "${f.length>20?`${f.slice(0,20)}\u2026`:f}"`,{type:"unknown-field",field:f,value:c,line:m}));break}}function h(){l.length>0&&e({id:i,event:d||void 0,data:l.endsWith(`
@@ -1,4 +1,4 @@
1
- var Ue=Object.defineProperty;var Ke=(t,e,s)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ne=(t,e,s)=>Ke(t,typeof e!="symbol"?e+"":e,s);import{s as me}from"./chunk-LvLJmgfZ.js";import{t as We}from"./react-BGmjiNul.js";import{C as He,dt as Me,yn as h}from"./cells-4S-e0VcC.js";import{D as oe,P as p,R as d,T as v,_ as ue,i as Qe,k as m,m as Ge}from"./zod-Cg4WLWh2.js";import{t as be}from"./compiler-runtime-DeeZ7FnK.js";import{S as Ve}from"./_Uint8Array-BGESiCQL.js";import{r as re}from"./useLifecycle-CmDXEyIC.js";import{r as ze,t as Je}from"./_baseEach-BH6a1vAB.js";import{f as Ye}from"./hotkeys-uKX61F1_.js";import{t as Xe}from"./jsx-runtime-DN_bIXfG.js";import{t as ie}from"./button-B8cGZzP5.js";import{t as fe}from"./cn-C1rgT0yh.js";import{c as Ze,i as et,n as tt,r as st,s as nt,t as ot}from"./select-D9lTzMzP.js";import{t as rt}from"./circle-plus-D1IRnTdM.js";import{a as ae,c as ge,o as it,p as at,r as ct,t as lt}from"./dropdown-menu-BP4_BZLr.js";import{n as dt}from"./DeferredRequestRegistry-B3BENoUa.js";import{o as ht,r as pt}from"./input-B80Yt1uu.js";import{a as mt,c as ut,d as bt,g as ft,l as gt,o as yt,p as St,s as _t,u as wt}from"./textarea-CuGxnSJT.js";import{a as xt,c as $t,l as kt,n as Ct,r as At,t as jt}from"./dialog-CF5DtF1E.js";import{n as vt}from"./ImperativeModal-DVhvP4lH.js";import{t as Rt}from"./links-DNmjkr65.js";import{n as It}from"./useAsyncData-BJJJOr9W.js";import{o as Tt}from"./focus-DAgLzXHM.js";import{o as Dt,t as qt,u as i}from"./form-DVkjQxq_.js";import{t as Lt}from"./request-registry-CAqj3mAX.js";import{n as Pt,t as Nt}from"./write-secret-modal-hOetwavI.js";function Ft(t,e,s,o){for(var n=-1,a=t==null?0:t.length;++n<a;){var c=t[n];e(o,c,s(c),t)}return o}var Et=Ft;function Bt(t,e,s,o){return Je(t,function(n,a,c){e(o,n,s(n),c)}),o}var Ot=Bt;function Ut(t,e){return function(s,o){var n=Ve(s)?Et:Ot,a=e?e():{};return n(s,t,ze(o,2),a)}}var Kt=Ut(function(t,e,s){t[s?0:1].push(e)},function(){return[[],[]]});function $(){return d().optional().describe(i.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ce(t,e){let s=d();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function G(){return d().optional().describe(i.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function le(t,e){let s=d();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:".*uri.*"}))}function x(t){return d().nonempty().describe(i.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function w(){return d().describe(i.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Wt(){return d().describe(i.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function k(){return d().nonempty().describe(i.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function C(t){let e=Qe().describe(i.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ye(){return v().default(!1).describe(i.of({label:"Read Only"}))}const Se=p({type:m("postgres"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),_e=p({type:m("mysql"),host:x(),port:C(3306),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),we=p({type:m("sqlite"),database:w().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),xe=p({type:m("duckdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),$e=p({type:m("motherduck"),database:w().default("my_db").describe(i.of({label:"Database Name"})),token:ce()}).describe(i.of({direction:"two-columns"})),ke=p({type:m("snowflake"),account:d().nonempty().describe(i.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:d().optional().describe(i.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:w(),schema:d().optional().describe(i.of({label:"Schema",optionRegex:".*snowflake.*"})),username:k(),password:$(),role:d().optional().describe(i.of({label:"Role"}))}).describe(i.of({direction:"two-columns"})),Ce=p({type:m("bigquery"),project:d().nonempty().describe(i.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:d().nonempty().describe(i.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:d().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),Ae=p({type:m("clickhouse_connect"),host:x(),port:C(8123).optional(),username:k(),password:$(),secure:v().default(!1).describe(i.of({label:"Use HTTPs"}))}).describe(i.of({direction:"two-columns"})),je=p({type:m("timeplus"),host:x().default("localhost"),port:C(8123).optional(),username:k().default("default"),password:$().default("")}).describe(i.of({direction:"two-columns"})),ve=p({type:m("chdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),Re=p({type:m("trino"),host:x(),port:C(8080),database:w(),schema:Wt().optional(),username:k(),password:$(),async_support:v().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Ie=p({type:m("iceberg"),name:d().describe(i.of({label:"Catalog Name"})),catalog:oe("type",[p({type:m("REST"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ce()}),p({type:m("SQL"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),p({type:m("Hive"),warehouse:G(),uri:le()}),p({type:m("Glue"),warehouse:G(),uri:le()}),p({type:m("DynamoDB"),"dynamodb.profile-name":d().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":d().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":d().optional().describe(i.of({label:"Access Key ID"})),"dynamodb.secret-access-key":d().optional().describe(i.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":d().optional().describe(i.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Te=p({type:m("datafusion"),sessionContext:v().optional().describe(i.of({label:"Use Session Context"}))}),De=p({type:m("pyspark"),host:x().optional(),port:C().optional()}),qe=p({type:m("redshift"),host:x(),port:C(5439),connectionType:oe("type",[p({type:m("IAM credentials"),region:d().describe(i.of({label:"Region"})),aws_access_key_id:d().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:d().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:d().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),p({type:m("DB credentials"),user:k(),password:$()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:w()}).describe(i.of({direction:"two-columns"})),Le=p({type:m("databricks"),access_token:ce("Access Token",!0),server_hostname:x("Server Hostname"),http_path:le("HTTP Path",!0),catalog:d().optional().describe(i.of({label:"Catalog"})),schema:d().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),Pe=p({type:m("supabase"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),disable_client_pooling:v().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Ht=oe("type",[Se,_e,we,xe,$e,ke,Ce,Ae,je,ve,Re,Ie,Te,De,qe,Le,Pe]);var de="env:";function tn(t){return t}function V(t){return typeof t=="string"?t.startsWith(de):!1}function he(t){return`${de}${t}`}function Mt(t){return t.replace(de,"")}const Ne={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var y=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},Qt=t=>`_${t}`,Gt=class{constructor(){ne(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Qt(t),V(e)){let o=Mt(e),n=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=n,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?U(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return U(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let n=s?this.printInFString.bind(this):this.print.bind(this);return V(t)?n(o||"password",t):n(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
1
+ var Ue=Object.defineProperty;var Ke=(t,e,s)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var ne=(t,e,s)=>Ke(t,typeof e!="symbol"?e+"":e,s);import{s as me}from"./chunk-LvLJmgfZ.js";import{t as We}from"./react-BGmjiNul.js";import{C as He,dt as Me,yn as h}from"./cells-Ba_KE9BT.js";import{D as oe,P as p,R as d,T as v,_ as ue,i as Qe,k as m,m as Ge}from"./zod-Cg4WLWh2.js";import{t as be}from"./compiler-runtime-DeeZ7FnK.js";import{S as Ve}from"./_Uint8Array-BGESiCQL.js";import{r as re}from"./useLifecycle-CmDXEyIC.js";import{r as ze,t as Je}from"./_baseEach-BH6a1vAB.js";import{f as Ye}from"./hotkeys-uKX61F1_.js";import{t as Xe}from"./jsx-runtime-DN_bIXfG.js";import{t as ie}from"./button-B8cGZzP5.js";import{t as fe}from"./cn-C1rgT0yh.js";import{c as Ze,i as et,n as tt,r as st,s as nt,t as ot}from"./select-D9lTzMzP.js";import{t as rt}from"./circle-plus-D1IRnTdM.js";import{a as ae,c as ge,o as it,p as at,r as ct,t as lt}from"./dropdown-menu-BP4_BZLr.js";import{n as dt}from"./DeferredRequestRegistry-B3BENoUa.js";import{o as ht,r as pt}from"./input-B80Yt1uu.js";import{a as mt,c as ut,d as bt,g as ft,l as gt,o as yt,p as St,s as _t,u as wt}from"./textarea-niGA0rfg.js";import{a as xt,c as $t,l as kt,n as Ct,r as At,t as jt}from"./dialog-CF5DtF1E.js";import{n as vt}from"./ImperativeModal-DVhvP4lH.js";import{t as Rt}from"./links-DNmjkr65.js";import{n as It}from"./useAsyncData-BJJJOr9W.js";import{o as Tt}from"./focus-DZZOzpQD.js";import{o as Dt,t as qt,u as i}from"./form-CnZqs8Bn.js";import{t as Lt}from"./request-registry-CAqj3mAX.js";import{n as Pt,t as Nt}from"./write-secret-modal-hOetwavI.js";function Ft(t,e,s,o){for(var n=-1,a=t==null?0:t.length;++n<a;){var c=t[n];e(o,c,s(c),t)}return o}var Et=Ft;function Bt(t,e,s,o){return Je(t,function(n,a,c){e(o,n,s(n),c)}),o}var Ot=Bt;function Ut(t,e){return function(s,o){var n=Ve(s)?Et:Ot,a=e?e():{};return n(s,t,ze(o,2),a)}}var Kt=Ut(function(t,e,s){t[s?0:1].push(e)},function(){return[[],[]]});function $(){return d().optional().describe(i.of({label:"Password",inputType:"password",placeholder:"password",optionRegex:".*password.*"}))}function ce(t,e){let s=d();return s=e?s.nonempty():s.optional(),s=s.describe(i.of({label:t||"Token",inputType:"password",placeholder:"token",optionRegex:".*token.*"})),s}function G(){return d().optional().describe(i.of({label:"Warehouse Name",placeholder:"warehouse",optionRegex:".*warehouse.*"}))}function le(t,e){let s=d();return s=e?s.nonempty():s.optional(),s.describe(i.of({label:t||"URI",optionRegex:".*uri.*"}))}function x(t){return d().nonempty().describe(i.of({label:t||"Host",placeholder:"localhost",optionRegex:".*host.*"}))}function w(){return d().describe(i.of({label:"Database",placeholder:"db name",optionRegex:".*database.*"}))}function Wt(){return d().describe(i.of({label:"Schema",placeholder:"schema name",optionRegex:".*schema.*"}))}function k(){return d().nonempty().describe(i.of({label:"Username",placeholder:"username",optionRegex:".*username.*"}))}function C(t){let e=Qe().describe(i.of({label:"Port",inputType:"number",placeholder:t==null?void 0:t.toString()})).transform(Number).refine(s=>s>=0&&s<=65535,{message:"Port must be between 0 and 65535"});return t===void 0?e:e.default(t)}function ye(){return v().default(!1).describe(i.of({label:"Read Only"}))}const Se=p({type:m("postgres"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),_e=p({type:m("mysql"),host:x(),port:C(3306),database:w(),username:k(),password:$(),ssl:v().default(!1).describe(i.of({label:"Use SSL"}))}).describe(i.of({direction:"two-columns"})),we=p({type:m("sqlite"),database:w().describe(i.of({label:"Database Path"}))}).describe(i.of({direction:"two-columns"})),xe=p({type:m("duckdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),$e=p({type:m("motherduck"),database:w().default("my_db").describe(i.of({label:"Database Name"})),token:ce()}).describe(i.of({direction:"two-columns"})),ke=p({type:m("snowflake"),account:d().nonempty().describe(i.of({label:"Account",optionRegex:".*snowflake.*"})),warehouse:d().optional().describe(i.of({label:"Warehouse",optionRegex:".*snowflake.*"})),database:w(),schema:d().optional().describe(i.of({label:"Schema",optionRegex:".*snowflake.*"})),username:k(),password:$(),role:d().optional().describe(i.of({label:"Role"}))}).describe(i.of({direction:"two-columns"})),Ce=p({type:m("bigquery"),project:d().nonempty().describe(i.of({label:"Project ID",optionRegex:".*bigquery.*"})),dataset:d().nonempty().describe(i.of({label:"Dataset",optionRegex:".*bigquery.*"})),credentials_json:d().describe(i.of({label:"Credentials JSON",inputType:"textarea"}))}).describe(i.of({direction:"two-columns"})),Ae=p({type:m("clickhouse_connect"),host:x(),port:C(8123).optional(),username:k(),password:$(),secure:v().default(!1).describe(i.of({label:"Use HTTPs"}))}).describe(i.of({direction:"two-columns"})),je=p({type:m("timeplus"),host:x().default("localhost"),port:C(8123).optional(),username:k().default("default"),password:$().default("")}).describe(i.of({direction:"two-columns"})),ve=p({type:m("chdb"),database:w().describe(i.of({label:"Database Path"})),read_only:ye()}).describe(i.of({direction:"two-columns"})),Re=p({type:m("trino"),host:x(),port:C(8080),database:w(),schema:Wt().optional(),username:k(),password:$(),async_support:v().default(!1).describe(i.of({label:"Async Support"}))}).describe(i.of({direction:"two-columns"})),Ie=p({type:m("iceberg"),name:d().describe(i.of({label:"Catalog Name"})),catalog:oe("type",[p({type:m("REST"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"https://",optionRegex:".*uri.*"})),token:ce()}),p({type:m("SQL"),warehouse:G(),uri:d().optional().describe(i.of({label:"URI",placeholder:"jdbc:iceberg://host:port/database",optionRegex:".*uri.*"}))}),p({type:m("Hive"),warehouse:G(),uri:le()}),p({type:m("Glue"),warehouse:G(),uri:le()}),p({type:m("DynamoDB"),"dynamodb.profile-name":d().optional().describe(i.of({label:"Profile Name"})),"dynamodb.region":d().optional().describe(i.of({label:"Region"})),"dynamodb.access-key-id":d().optional().describe(i.of({label:"Access Key ID"})),"dynamodb.secret-access-key":d().optional().describe(i.of({label:"Secret Access Key",inputType:"password"})),"dynamodb.session-token":d().optional().describe(i.of({label:"Session Token",inputType:"password"}))})]).default({type:"REST",token:void 0}).describe(i.of({special:"tabs"}))}),Te=p({type:m("datafusion"),sessionContext:v().optional().describe(i.of({label:"Use Session Context"}))}),De=p({type:m("pyspark"),host:x().optional(),port:C().optional()}),qe=p({type:m("redshift"),host:x(),port:C(5439),connectionType:oe("type",[p({type:m("IAM credentials"),region:d().describe(i.of({label:"Region"})),aws_access_key_id:d().nonempty().describe(i.of({label:"AWS Access Key ID",inputType:"password",optionRegex:".*aws_access_key_id.*"})),aws_secret_access_key:d().nonempty().describe(i.of({label:"AWS Secret Access Key",inputType:"password",optionRegex:".*aws_secret_access_key.*"})),aws_session_token:d().optional().describe(i.of({label:"AWS Session Token",inputType:"password",optionRegex:".*aws_session_token.*"}))}),p({type:m("DB credentials"),user:k(),password:$()})]).default({type:"IAM credentials",aws_access_key_id:"",aws_secret_access_key:"",region:""}),database:w()}).describe(i.of({direction:"two-columns"})),Le=p({type:m("databricks"),access_token:ce("Access Token",!0),server_hostname:x("Server Hostname"),http_path:le("HTTP Path",!0),catalog:d().optional().describe(i.of({label:"Catalog"})),schema:d().optional().describe(i.of({label:"Schema"}))}).describe(i.of({direction:"two-columns"})),Pe=p({type:m("supabase"),host:x(),port:C(5432).optional(),database:w(),username:k(),password:$(),disable_client_pooling:v().default(!1).describe(i.of({label:"Disable Client-Side Pooling"}))}).describe(i.of({direction:"two-columns"})),Ht=oe("type",[Se,_e,we,xe,$e,ke,Ce,Ae,je,ve,Re,Ie,Te,De,qe,Le,Pe]);var de="env:";function tn(t){return t}function V(t){return typeof t=="string"?t.startsWith(de):!1}function he(t){return`${de}${t}`}function Mt(t){return t.replace(de,"")}const Ne={sqlmodel:"SQLModel",sqlalchemy:"SQLAlchemy",duckdb:"DuckDB",clickhouse_connect:"ClickHouse Connect",chdb:"chDB",pyiceberg:"PyIceberg",ibis:"Ibis",motherduck:"MotherDuck",redshift:"Redshift",databricks:"Databricks"};var y=class{constructor(t,e,s){this.connection=t,this.orm=e,this.secrets=s}get imports(){let t=new Set(this.generateImports());switch(this.orm){case"sqlalchemy":t.add("import sqlalchemy");break;case"sqlmodel":t.add("import sqlmodel");break;case"duckdb":t.add("import duckdb");break;case"ibis":t.add("import ibis");break}return t}},Qt=t=>`_${t}`,Gt=class{constructor(){ne(this,"secrets",{})}get imports(){return Object.keys(this.secrets).length===0?new Set:new Set(["import os"])}print(t,e,s){if(t=Qt(t),V(e)){let o=Mt(e),n=s?`os.environ.get("${o}", "${s}")`:`os.environ.get("${o}")`;return this.secrets[t]=n,t}if(s!=null){let o=`os.environ.get("${e}", "${s}")`;return this.secrets[t]=o,t}return typeof e=="number"||typeof e=="number"?`${e}`:typeof e=="boolean"?U(e):e?`"${e}"`:""}printInFString(t,e,s){if(e===void 0)return"";if(typeof e=="number")return`${e}`;if(typeof e=="boolean")return U(e);let o=this.print(t,e,s);return o.startsWith('"')&&o.endsWith('"')?o.slice(1,-1):`{${o}}`}printPassword(t,e,s,o){let n=s?this.printInFString.bind(this):this.print.bind(this);return V(t)?n(o||"password",t):n(o||"password",e,t)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?"":Object.entries(this.secrets).map(([t,e])=>`${t} = ${e}`).join(`
2
2
  `)}},Vt=class extends y{generateImports(){return[]}generateConnectionCode(){let t=this.connection.ssl?", connect_args={'sslmode': 'require'}":"",e=this.secrets.printPassword(this.connection.password,"POSTGRES_PASSWORD",!0);return h(`
3
3
  DATABASE_URL = f"postgresql://${this.secrets.printInFString("username",this.connection.username)}:${e}@${this.secrets.printInFString("host",this.connection.host)}:${this.secrets.printInFString("port",this.connection.port)}/${this.secrets.printInFString("database",this.connection.database)}"
4
4
  engine = ${this.orm}.create_engine(DATABASE_URL${t})