streamlit-nightly 1.53.1.dev20260116__py3-none-any.whl → 1.53.1.dev20260117__py3-none-any.whl

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 (96) hide show
  1. streamlit/static/index.html +1 -1
  2. streamlit/static/manifest.json +300 -300
  3. streamlit/static/static/js/{ErrorOutline.esm.CiSfK8ht.js → ErrorOutline.esm.CqVEQ-uJ.js} +1 -1
  4. streamlit/static/static/js/{FileDownload.esm.ItNjcEfs.js → FileDownload.esm.G-HJG6nt.js} +1 -1
  5. streamlit/static/static/js/{FileHelper.xS7f19FE.js → FileHelper.Bd4bPp0Y.js} +1 -1
  6. streamlit/static/static/js/{FormClearHelper.N8_BCinn.js → FormClearHelper.B74VElyu.js} +1 -1
  7. streamlit/static/static/js/{InputInstructions.CrsdK7CQ.js → InputInstructions.ClBLOwfm.js} +1 -1
  8. streamlit/static/static/js/{Particles.BDlTHC3I.js → Particles.CyYskark.js} +1 -1
  9. streamlit/static/static/js/{ProgressBar.Bk2qeHfS.js → ProgressBar.vWX1Igzt.js} +1 -1
  10. streamlit/static/static/js/{StreamlitSyntaxHighlighter.BcuPrPcw.js → StreamlitSyntaxHighlighter.BNhyeEtl.js} +1 -1
  11. streamlit/static/static/js/{TableChart.esm.CP7XPz8I.js → TableChart.esm.Mk-Hvy1t.js} +1 -1
  12. streamlit/static/static/js/{Toolbar.DCJcLwve.js → Toolbar.NhlhlTzK.js} +1 -1
  13. streamlit/static/static/js/{WidgetLabelHelpIconInline.BPqxu1b-.js → WidgetLabelHelpIconInline.Ch9VDnrM.js} +1 -1
  14. streamlit/static/static/js/{base-input.x4muJJ13.js → base-input.DSh9H2uv.js} +1 -1
  15. streamlit/static/static/js/{checkbox.C5r4AIaH.js → checkbox.DCFAQrRB.js} +1 -1
  16. streamlit/static/static/js/{createDownloadLinkElement.C83kkEeT.js → createDownloadLinkElement.D5zpcd24.js} +1 -1
  17. streamlit/static/static/js/{data-grid-overlay-editor.0sOWm4IB.js → data-grid-overlay-editor.GAqbIurd.js} +1 -1
  18. streamlit/static/static/js/{downloader.C_6FfoEv.js → downloader.C1MBZFo2.js} +1 -1
  19. streamlit/static/static/js/{embed.BnJ6-SK4.js → embed.CZG6oOsc.js} +1 -1
  20. streamlit/static/static/js/{es6.44_BWfFd.js → es6.toHnBzIb.js} +2 -2
  21. streamlit/static/static/js/{formatNumber.DhHZAosz.js → formatNumber.BsU-5o3V.js} +1 -1
  22. streamlit/static/static/js/{iconPosition.shOoQuRR.js → iconPosition.OKOYrH6A.js} +1 -1
  23. streamlit/static/static/js/{iframeResizer.contentWindow.savEE5Vs.js → iframeResizer.contentWindow.D6yxU4DL.js} +1 -1
  24. streamlit/static/static/js/{index.SjKkVSL7.js → index.-pgbbiGJ.js} +1 -1
  25. streamlit/static/static/js/{index.Dblsdn8d.js → index.0iCXW13-.js} +1 -1
  26. streamlit/static/static/js/{index.DfHm3P22.js → index.1sBZt_1I.js} +5 -5
  27. streamlit/static/static/js/{index.BCaCSVj6.js → index.5CwvMIZq.js} +1 -1
  28. streamlit/static/static/js/{index.CySNwKoN.js → index.AkleAg_w.js} +1 -1
  29. streamlit/static/static/js/{index.hX8_3tMP.js → index.B8mzpc1l.js} +1 -1
  30. streamlit/static/static/js/{index.Ch1TdQMG.js → index.BHWCIpbw.js} +1 -1
  31. streamlit/static/static/js/{index.BNzuyXeN.js → index.BU8aUWlo.js} +1 -1
  32. streamlit/static/static/js/{index.C6uOmY9O.js → index.BVbT0yWJ.js} +1 -1
  33. streamlit/static/static/js/{index.CQgiNpC7.js → index.BW0F_Pbs.js} +1 -1
  34. streamlit/static/static/js/{index.BYY3iuVE.js → index.BXqtIpgi.js} +1 -1
  35. streamlit/static/static/js/{index.SVJGpnpy.js → index.Bh0_7PvD.js} +1 -1
  36. streamlit/static/static/js/{index.BHpLZ7X6.js → index.Bhr3IHkD.js} +1 -1
  37. streamlit/static/static/js/{index.B6ewTTej.js → index.BkYhb--A.js} +1 -1
  38. streamlit/static/static/js/{index.DIsNrJpC.js → index.Blo8DAcU.js} +1 -1
  39. streamlit/static/static/js/{index.DcdD0ROn.js → index.Bs4E_0D7.js} +1 -1
  40. streamlit/static/static/js/{index.AdijUi9Z.js → index.C6LOxzFC.js} +1 -1
  41. streamlit/static/static/js/{index.B8Of3XXR.js → index.CGt5hnLi.js} +1 -1
  42. streamlit/static/static/js/{index.jZin0w6_.js → index.CJCEiqv2.js} +1 -1
  43. streamlit/static/static/js/{index.B5HlOnvq.js → index.COcj-WpN.js} +1 -1
  44. streamlit/static/static/js/{index.BNvP8E5Q.js → index.CV4niwLB.js} +1 -1
  45. streamlit/static/static/js/{index.C1coXTgf.js → index.CXLtvxrQ.js} +1 -1
  46. streamlit/static/static/js/{index.pzQTLx9j.js → index.C_w1nWis.js} +1 -1
  47. streamlit/static/static/js/{index.BZXk3Qxq.js → index.Ch4X_YdF.js} +1 -1
  48. streamlit/static/static/js/{index.DBtWixG1.js → index.CqywI2eW.js} +1 -1
  49. streamlit/static/static/js/{index.D_ziFad8.js → index.D0h2EJ_T.js} +1 -1
  50. streamlit/static/static/js/{index.D8BQH06Z.js → index.D7Hgmilz.js} +1 -1
  51. streamlit/static/static/js/{index.HjydQ4bj.js → index.D94k70Hg.js} +1 -1
  52. streamlit/static/static/js/{index.CF88nImM.js → index.DGrQJk9x.js} +1 -1
  53. streamlit/static/static/js/{index.CFlGfFvq.js → index.DJ8OTQbk.js} +1 -1
  54. streamlit/static/static/js/{index.BqtgAGnG.js → index.DR8Ty3j4.js} +1 -1
  55. streamlit/static/static/js/{index.BT7o4A9V.js → index.DRGDE5oo.js} +1 -1
  56. streamlit/static/static/js/{index.BhQvq6YD.js → index.DbCS2N3T.js} +1 -1
  57. streamlit/static/static/js/{index.BZI7jTDf.js → index.DhGqPx_f.js} +1 -1
  58. streamlit/static/static/js/{index.BkIReLGJ.js → index.Dl2MB5Tx.js} +1 -1
  59. streamlit/static/static/js/{index.BwnLQnAk.js → index.Dq0ZbGYZ.js} +1 -1
  60. streamlit/static/static/js/{index.DvZDNiBV.js → index.DwgEkDLk.js} +1 -1
  61. streamlit/static/static/js/{index.CrD2lwZG.js → index.E4x2UBkh.js} +1 -1
  62. streamlit/static/static/js/{index.D3LEkXqN.js → index.EOvPT8N-.js} +1 -1
  63. streamlit/static/static/js/{index.DO3HICut.js → index.MZ7ugsN-.js} +1 -1
  64. streamlit/static/static/js/{index.Bl7SMZUw.js → index.P0_E3iNi.js} +1 -1
  65. streamlit/static/static/js/{index.s44_OVd6.js → index.SBwNLdli.js} +1 -1
  66. streamlit/static/static/js/{index.BE7Rhig1.js → index.XgBfXgN1.js} +1 -1
  67. streamlit/static/static/js/{index.Ck2mQvBi.js → index.YRiVxrFw.js} +1 -1
  68. streamlit/static/static/js/{index.CZJkiRFm.js → index._t3w-7R0.js} +1 -1
  69. streamlit/static/static/js/{index.HsxzYHNf.js → index.dGk9EWLh.js} +1 -1
  70. streamlit/static/static/js/{index.pQvPlPcA.js → index.ia5Ub9p7.js} +1 -1
  71. streamlit/static/static/js/{index.DiwhD0Ic.js → index.qjO5OK90.js} +5 -5
  72. streamlit/static/static/js/{input.jAD-v9D6.js → input.Bavj6HHJ.js} +1 -1
  73. streamlit/static/static/js/{main.Cas0fuOs.js → main.dnUTEH_j.js} +1 -1
  74. streamlit/static/static/js/{memory.ENruL8Qk.js → memory.Czf1Sxzc.js} +1 -1
  75. streamlit/static/static/js/{number-overlay-editor.DAOTdulh.js → number-overlay-editor.CRQIke3a.js} +1 -1
  76. streamlit/static/static/js/{pandasStylerUtils.DChYgcPq.js → pandasStylerUtils.agmr-LQ2.js} +1 -1
  77. streamlit/static/static/js/{sandbox.DWZYRCm0.js → sandbox.BlCiIomw.js} +1 -1
  78. streamlit/static/static/js/{styled-components.3lwVqgRW.js → styled-components.Bz3KSbhj.js} +1 -1
  79. streamlit/static/static/js/{throttle.DfOW1Cns.js → throttle.B1o314FW.js} +1 -1
  80. streamlit/static/static/js/{timepicker.CXHgL5f9.js → timepicker.3x4ndo9E.js} +1 -1
  81. streamlit/static/static/js/{toConsumableArray.DiW0GSDV.js → toConsumableArray.BeHbBK8g.js} +1 -1
  82. streamlit/static/static/js/uniqueId.Zn1vZBLX.js +1 -0
  83. streamlit/static/static/js/{useBasicWidgetState.DnPEt_f3.js → useBasicWidgetState.CFP4_PTk.js} +1 -1
  84. streamlit/static/static/js/{useIntlLocale.BZEGSOVD.js → useIntlLocale.BJubkaPQ.js} +1 -1
  85. streamlit/static/static/js/{useTextInputAutoExpand.MGVZMqyt.js → useTextInputAutoExpand.DBGwhM4R.js} +1 -1
  86. streamlit/static/static/js/{useUpdateUiValue.CPl6CEx3.js → useUpdateUiValue.CyufNQfR.js} +1 -1
  87. streamlit/static/static/js/{useWaveformController.DOpzDyZu.js → useWaveformController.Dj5h0D8Y.js} +1 -1
  88. streamlit/static/static/js/{withCalculatedWidth.DgKFTeif.js → withCalculatedWidth.D0IRb-7w.js} +1 -1
  89. streamlit/static/static/js/{withFullScreenWrapper.K1jkwhPu.js → withFullScreenWrapper.CHBnw0Co.js} +1 -1
  90. {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/METADATA +1 -1
  91. {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/RECORD +95 -95
  92. streamlit/static/static/js/uniqueId.Dfi3SGKZ.js +0 -1
  93. {streamlit_nightly-1.53.1.dev20260116.data → streamlit_nightly-1.53.1.dev20260117.data}/scripts/streamlit.cmd +0 -0
  94. {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/WHEEL +0 -0
  95. {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/entry_points.txt +0 -0
  96. {streamlit_nightly-1.53.1.dev20260116.dist-info → streamlit_nightly-1.53.1.dev20260117.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- import{W as f,a6 as p,B as i,r as l,u as h,j as o,a as S,b as F,c as I,D as R,d as C,a7 as M}from"./index.DiwhD0Ic.js";import{a8 as D}from"./index.DiwhD0Ic.js";import{m as x}from"./iconPosition.shOoQuRR.js";import{F as E,u as O}from"./FormClearHelper.N8_BCinn.js";function y(a){const{disabled:d,element:t,widgetMgr:e,fragmentId:u}=a,{formId:s}=t,m=t.shortcut?t.shortcut:void 0,{formsData:B}=f(p),b=B.formsWithUploads.has(s);let n=i.SECONDARY_FORM_SUBMIT;t.type==="primary"?n=i.PRIMARY_FORM_SUBMIT:t.type==="tertiary"&&(n=i.TERTIARY_FORM_SUBMIT);const r=d||b;l.useEffect(()=>(e.addSubmitButton(s,t),()=>e.removeSubmitButton(s,t)),[e,s,t]);const c=l.useCallback(()=>{r||e.submitForm(t.formId,u,t)},[r,e,t,u]);return h({shortcut:m,disabled:r,onActivate:c}),o(C,{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",children:o(S,{help:t.help,containerWidth:!0,children:o(F,{kind:n,size:I.SMALL,containerWidth:!0,disabled:r,onClick:c,children:o(R,{icon:t.icon,iconPosition:x(t.iconPosition),label:t.label,shortcut:m})})})})}function _(a){return o(M,{children:o(y,{...a})})}export{E as FormClearHelper,y as FormSubmitButton,_ as FormSubmitContent,D as default,O as useFormClearHelper};
1
+ import{W as f,a6 as p,B as i,r as l,u as h,j as o,a as S,b as F,c as I,D as R,d as C,a7 as M}from"./index.qjO5OK90.js";import{a8 as D}from"./index.qjO5OK90.js";import{m as x}from"./iconPosition.OKOYrH6A.js";import{F as E,u as O}from"./FormClearHelper.B74VElyu.js";function y(a){const{disabled:d,element:t,widgetMgr:e,fragmentId:u}=a,{formId:s}=t,m=t.shortcut?t.shortcut:void 0,{formsData:B}=f(p),b=B.formsWithUploads.has(s);let n=i.SECONDARY_FORM_SUBMIT;t.type==="primary"?n=i.PRIMARY_FORM_SUBMIT:t.type==="tertiary"&&(n=i.TERTIARY_FORM_SUBMIT);const r=d||b;l.useEffect(()=>(e.addSubmitButton(s,t),()=>e.removeSubmitButton(s,t)),[e,s,t]);const c=l.useCallback(()=>{r||e.submitForm(t.formId,u,t)},[r,e,t,u]);return h({shortcut:m,disabled:r,onActivate:c}),o(C,{className:"stFormSubmitButton","data-testid":"stFormSubmitButton",children:o(S,{help:t.help,containerWidth:!0,children:o(F,{kind:n,size:I.SMALL,containerWidth:!0,disabled:r,onClick:c,children:o(R,{icon:t.icon,iconPosition:x(t.iconPosition),label:t.label,shortcut:m})})})})}function _(a){return o(M,{children:o(y,{...a})})}export{E as FormClearHelper,y as FormSubmitButton,_ as FormSubmitContent,D as default,O as useFormClearHelper};
@@ -1,2 +1,2 @@
1
- import{z as f,r,l as b,aI as y,j as c,aJ as S,aw as x,o as h,m as T,Y as R,aK as v,aL as B,aM as E}from"./index.DiwhD0Ic.js";import{l as J}from"./index.8HslT92O.js";import{R as k}from"./main.Cas0fuOs.js";const w=f("div",{target:"eem6pay0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"eem6pay1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),$=f("button",{target:"eem6pay2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:o.shadows.focusRing}})),I=f("div",{target:"eem6pay3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function P({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=r.useState(!0),s=b(),{colors:i,radii:a}=s,{isCopied:l,copyToClipboard:u,label:m}=y(),g=r.useCallback(()=>{n(!1),d()},[d]),C=r.useCallback(()=>{u(t)},[u,t]);return c(v,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[c("code",{children:t}),c($,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:c(R,{size:"sm",iconValue:l?":material/check:":":material/content_copy:"})})]}),placement:x.top,accessibilityType:S.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(s)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:c(I,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const j=r.memo(P);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const s=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${s}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function F(){const[o,e]=r.useState(null),t=r.useRef({x:0,y:0});r.useEffect(()=>{const n=s=>{t.current={x:s.clientX,y:s.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=r.useCallback(n=>{const{x:s,y:i}=t.current,a=[...n.namespace,n.name],l=z(a);e({path:l,x:s,y:i})},[]),p=r.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=F(),{copyToClipboard:n}=y(),s=r.useCallback(l=>{n(JSON.stringify(l.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(l){const u=B(l);try{i=J.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
1
+ import{z as f,r,l as b,aI as y,j as c,aJ as S,aw as x,o as h,m as T,Y as R,aK as v,aL as B,aM as E}from"./index.qjO5OK90.js";import{l as J}from"./index.8HslT92O.js";import{R as k}from"./main.dnUTEH_j.js";const w=f("div",{target:"eem6pay0"})(({theme:o})=>({overflowY:"auto",position:"relative",".react-json-view .copy-icon svg":{fontSize:"1em !important",marginRight:`${o.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),L=f("div",{target:"eem6pay1"})(({theme:o})=>({display:"flex",alignItems:"center",gap:o.spacing.sm,padding:o.spacing.sm,paddingLeft:o.spacing.md,fontFamily:o.genericFonts.codeFont,fontSize:o.fontSizes.twoSm,color:o.colors.bodyText,maxWidth:"90vw",wordBreak:"break-all"})),$=f("button",{target:"eem6pay2"})(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",padding:o.spacing.threeXS,backgroundColor:"transparent",border:"none",borderRadius:o.radii.md,cursor:"pointer",color:o.colors.fadedText60,transition:"color 0.15s ease, background-color 0.15s ease","&:hover":{backgroundColor:o.colors.darkenedBgMix15,color:o.colors.bodyText},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:o.shadows.focusRing}})),I=f("div",{target:"eem6pay3"})(({top:o,left:e})=>({position:"fixed",top:o,left:e}));function P({top:o,left:e,path:t,clearTooltip:d}){const[p,n]=r.useState(!0),s=b(),{colors:i,radii:a}=s,{isCopied:l,copyToClipboard:u,label:m}=y(),g=r.useCallback(()=>{n(!1),d()},[d]),C=r.useCallback(()=>{u(t)},[u,t]);return c(v,{content:h(L,{"data-testid":"stJsonPathTooltip",children:[c("code",{children:t}),c($,{onClick:C,title:m,"aria-label":m,autoFocus:!0,children:c(R,{size:"sm",iconValue:l?":material/check:":":material/content_copy:"})})]}),placement:x.top,accessibilityType:S.tooltip,showArrow:!1,popoverMargin:15,onClickOutside:g,onEsc:g,overrides:{Body:{style:{borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:T(s)?i.bgColor:i.secondaryBg,color:i.bodyText,borderTopLeftRadius:a.default,borderTopRightRadius:a.default,borderBottomLeftRadius:a.default,borderBottomRightRadius:a.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:p,children:c(I,{"data-testid":"stJsonPathTooltipTarget",top:o,left:e})})}const j=r.memo(P);function z(o){return o.length===0?"$":o.reduce((e,t,d)=>{if(t===null)return e;if(/^\d+$/.test(t))return`${e}[${t}]`;if(t===""||/[^a-zA-Z0-9_$]/.test(t)||/^\d/.test(t)){const s=t.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return`${e}["${s}"]`}return d===0||e===""?t:`${e}.${t}`},"")}function F(){const[o,e]=r.useState(null),t=r.useRef({x:0,y:0});r.useEffect(()=>{const n=s=>{t.current={x:s.clientX,y:s.clientY}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]);const d=r.useCallback(n=>{const{x:s,y:i}=t.current,a=[...n.namespace,n.name],l=z(a);e({path:l,x:s,y:i})},[]),p=r.useCallback(()=>{e(null)},[]);return{tooltip:o,handleSelect:d,clearTooltip:p}}function A({element:o}){const e=b(),{tooltip:t,handleSelect:d,clearTooltip:p}=F(),{copyToClipboard:n}=y(),s=r.useCallback(l=>{n(JSON.stringify(l.src))},[n]);let i;try{i=JSON.parse(o.body)}catch(l){const u=B(l);try{i=J.parse(o.body)}catch{const g=parseInt(u.message.replace(/[^0-9]/g,""),10);return u.message+=`
2
2
  ${o.body.substring(0,g+1)} ← here`,c(E,{name:"Json Parse Error",message:u.message})}}const a=T(e)?"rjv-default":"monokai";return h(w,{className:"stJson","data-testid":"stJson",children:[c(k,{src:i,collapsed:o.maxExpandDepth??!o.expanded,displayDataTypes:!1,displayObjectSize:!1,name:!1,theme:a,enableClipboard:s,onSelect:d,style:{fontFamily:e.genericFonts.codeFont,fontSize:e.fontSizes.codeFontSize,fontWeight:e.fontWeights.code,backgroundColor:e.colors.bgColor,whiteSpace:"pre-wrap"}}),t&&c(j,{top:t.y,left:t.x,path:t.path,clearTooltip:p})]})}const Y=r.memo(A);export{Y as default};
@@ -1 +1 @@
1
- import{z as p,M as o,r as C,N,o as g,j as s,O as u,q as T,Q as m}from"./index.DiwhD0Ic.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.DChYgcPq.js";import"./moment.C7qA8nIE.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";const x=p("div",{target:"e10e2fxn0"})(({theme:e})=>({fontSize:e.fontSizes.md,fontFamily:e.genericFonts.bodyFont,lineHeight:e.lineHeights.small,captionSide:"bottom"})),M=p("div",{target:"e10e2fxn1"})(({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,paddingTop:e.spacing.sm,paddingBottom:0,color:e.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),h=p("div",{target:"e10e2fxn2"})(({theme:e,borderMode:t})=>({border:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none",borderRadius:e.radii.default,overflow:"auto"})),O=p("table",{target:"e10e2fxn3"})(({theme:e})=>({width:e.sizes.full,color:e.colors.bodyText,borderSpacing:0})),S=(e,t=o.BorderMode.ALL)=>({borderBottom:t!==o.BorderMode.NONE?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:t===o.BorderMode.ALL||t===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:t===o.BorderMode.ALL?"none":void 0,paddingRight:t===o.BorderMode.NONE?"0":e.spacing.xs},verticalAlign:"middle",padding:`${e.spacing.twoXS} ${e.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.xs},"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.xs},fontWeight:e.fontWeights.normal}),b=p("td",{target:"e10e2fxn4"})(({theme:e,borderMode:t})=>S(e,t)),B=p("th",{target:"e10e2fxn5"})(({theme:e,borderMode:t})=>({...S(e,t),textAlign:"inherit",color:e.colors.fadedText60,"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.sm},"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.sm}})),H=p(b,{target:"e10e2fxn6"})(({theme:e})=>({color:e.colors.gray70,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}));function R(e){const t=e.data,{cssId:l,cssStyles:r,caption:d}=t.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=t.dimensions,n=N(c),i=e.element.borderMode;return g(x,{className:"stTable","data-testid":"stTable",children:[r&&s("style",{children:r}),s(h,{borderMode:i,children:g(O,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(t,i),s("tbody",{children:n.length===0?s("tr",{children:s(H,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):n.map(y=>z(t,y,a,i))})]})}),d&&s(M,{children:d})]})}function E(e,t){const l=t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL;return s("thead",{children:A(e).map((r,d)=>s("tr",{children:r.map((f,c)=>{let a="inherit";if(l&&e.dimensions.numDataRows>0){const{contentType:n}=e.getCell(0,c);a=u(n)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:t,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function z(e,t,l,r){return s("tr",{children:N(l).map(d=>$(e,t,d,r))},t)}function $(e,t,l,r){const{type:d,content:f,contentType:c}=e.getCell(t,l),a=L(e,t,l);let n=a?.displayContent||w(f,c),i=!1;const y={textAlign:u(c)?"right":"left"};switch(n?.endsWith('<span class="pd-t"></span>')&&(n=n.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case m.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);case m.DATA:return g(b,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const j=C.memo(R);export{j as default};
1
+ import{z as p,M as o,r as C,N,o as g,j as s,O as u,q as T,Q as m}from"./index.qjO5OK90.js";import{g as A,a as L,f as w}from"./pandasStylerUtils.agmr-LQ2.js";import"./moment.C7qA8nIE.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";const x=p("div",{target:"e10e2fxn0"})(({theme:e})=>({fontSize:e.fontSizes.md,fontFamily:e.genericFonts.bodyFont,lineHeight:e.lineHeights.small,captionSide:"bottom"})),M=p("div",{target:"e10e2fxn1"})(({theme:e})=>({fontFamily:e.genericFonts.bodyFont,fontSize:e.fontSizes.sm,paddingTop:e.spacing.sm,paddingBottom:0,color:e.colors.fadedText60,textAlign:"left",wordWrap:"break-word",display:"inline-block"})),h=p("div",{target:"e10e2fxn2"})(({theme:e,borderMode:t})=>({border:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none",borderRadius:e.radii.default,overflow:"auto"})),O=p("table",{target:"e10e2fxn3"})(({theme:e})=>({width:e.sizes.full,color:e.colors.bodyText,borderSpacing:0})),S=(e,t=o.BorderMode.ALL)=>({borderBottom:t!==o.BorderMode.NONE?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","tbody tr:last-child &":{borderBottom:t===o.BorderMode.ALL||t===o.BorderMode.HORIZONTAL?"none":void 0},borderRight:t===o.BorderMode.ALL?`${e.sizes.borderWidth} solid ${e.colors.dataframeBorderColor}`:"none","&:last-child":{borderRight:t===o.BorderMode.ALL?"none":void 0,paddingRight:t===o.BorderMode.NONE?"0":e.spacing.xs},verticalAlign:"middle",padding:`${e.spacing.twoXS} ${e.spacing.xs}`,"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.xs},"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.xs},fontWeight:e.fontWeights.normal}),b=p("td",{target:"e10e2fxn4"})(({theme:e,borderMode:t})=>S(e,t)),B=p("th",{target:"e10e2fxn5"})(({theme:e,borderMode:t})=>({...S(e,t),textAlign:"inherit",color:e.colors.fadedText60,"&:first-of-type":{paddingLeft:t===o.BorderMode.NONE?"0":e.spacing.sm},"&:not(:first-of-type)":{paddingLeft:t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL?e.spacing.lg:e.spacing.sm}})),H=p(b,{target:"e10e2fxn6"})(({theme:e})=>({color:e.colors.gray70,fontStyle:"italic",fontSize:e.fontSizes.md,textAlign:"center"}));function R(e){const t=e.data,{cssId:l,cssStyles:r,caption:d}=t.styler??{},{numHeaderRows:f,numDataRows:c,numColumns:a}=t.dimensions,n=N(c),i=e.element.borderMode;return g(x,{className:"stTable","data-testid":"stTable",children:[r&&s("style",{children:r}),s(h,{borderMode:i,children:g(O,{id:l,"data-testid":"stTableStyledTable",children:[f>0&&E(t,i),s("tbody",{children:n.length===0?s("tr",{children:s(H,{"data-testid":"stTableStyledEmptyTableCell",colSpan:a||1,borderMode:i,children:"empty"})}):n.map(y=>z(t,y,a,i))})]})}),d&&s(M,{children:d})]})}function E(e,t){const l=t===o.BorderMode.NONE||t===o.BorderMode.HORIZONTAL;return s("thead",{children:A(e).map((r,d)=>s("tr",{children:r.map((f,c)=>{let a="inherit";if(l&&e.dimensions.numDataRows>0){const{contentType:n}=e.getCell(0,c);a=u(n)?"right":"left"}return s(B,{className:f.cssClass,scope:"col",borderMode:t,style:{textAlign:a},children:s(T,{source:f.name||" ",allowHTML:!1})},c)})},d))})}function z(e,t,l,r){return s("tr",{children:N(l).map(d=>$(e,t,d,r))},t)}function $(e,t,l,r){const{type:d,content:f,contentType:c}=e.getCell(t,l),a=L(e,t,l);let n=a?.displayContent||w(f,c),i=!1;const y={textAlign:u(c)?"right":"left"};switch(n?.endsWith('<span class="pd-t"></span>')&&(n=n.replace(/<span class="pd-t"><\/span>$/,""),i=!0),d){case m.INDEX:return g(B,{scope:"row",id:a?.cssId,className:a?.cssClass,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);case m.DATA:return g(b,{id:a?.cssId,className:a?.cssClass,style:y,borderMode:r,children:[i&&s("span",{className:"pd-t"}),s(T,{source:n||" ",allowHTML:!1})]},l);default:throw new Error(`Cannot parse type "${d}".`)}}const j=C.memo(R);export{j as default};
@@ -1 +1 @@
1
- import{r as a,E as B,_ as $,l as X,e as L,Q,O as K,bd as z,be as j,bf as Y,bg as Z,n as k,bh as M,V as P,W as q,k as ee,b8 as te,bi as ne,j as R,o as re,b1 as se}from"./index.DiwhD0Ic.js";import{w as oe,E as ae}from"./withFullScreenWrapper.K1jkwhPu.js";import{a as _,S as H,T as ce}from"./Toolbar.DCJcLwve.js";import{R as ie}from"./index.DfHm3P22.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.BnJ6-SK4.js";import{u as he}from"./FormClearHelper.N8_BCinn.js";import{T as ge}from"./TableChart.esm.CP7XPz8I.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.DChYgcPq.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.Cas0fuOs.js";import"./throttle.DfOW1Cns.js";import"./formatNumber.DhHZAosz.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.C5r4AIaH.js";import"./createDownloadLinkElement.C83kkEeT.js";import"./toConsumableArray.DiW0GSDV.js";import"./FileDownload.esm.ItNjcEfs.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var U=a.forwardRef(function(n,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,$({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});U.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&L(e.select.encodings)&&(e.select.encodings=Object.keys(n.encoding)))})}const be=(n,e,s,r,u,l,f,p)=>{const t=JSON.parse(n);if(r==="streamlit"?t.config=J(t.config,l):t.usermeta?.embedOptions?.theme==="streamlit"?(t.config=J(t.config,l),t.usermeta.embedOptions.theme=void 0):t.config=le(t.config,l),t.title&&(typeof t.title=="string"&&(t.title={text:t.title}),t.title.limit=t.title.limit??Math.max(f-40,0)),s&&(t.height=p),e&&(t.width=f,"vconcat"in t&&t.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=f)})),t.padding||(t.padding={}),L(t.padding.bottom)&&(t.padding.bottom=Se),t.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&ye(t),t},we=(n,e,s,r,u)=>{const l=X(),{id:f,formId:p,spec:t,data:o,datasets:c,vegaLiteTheme:d,selectionMode:i}=n,h=a.useMemo(()=>i,[JSON.stringify(i)]),S=a.useMemo(()=>be(t,r,u,d,h,l,e,s),[t,r,u,d,h,l,e,s]);return{id:f,formId:p,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:c,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const e=I(n);if(L(e))return null;const s={};for(const[r,u]of Object.entries(e))s[r]=F(u);return s}function I(n){if(n?.length===0)return null;const e={};return n.forEach(s=>{if(!s)return;const r=s.hasName?s.name:null;e[r]=s.data}),e}function F(n,e=0){if(n.dimensions.numDataRows===0)return[];const s=[],{numDataRows:r,numDataColumns:u,numIndexColumns:l}=n.dimensions,f=n.columnTypes[0]??void 0,p=f?.type===Q.INDEX&&(K(f)||z(f)||j(f));for(let t=e;t<r;t++){const o={};if(p){const{content:c}=n.getCell(t,0);o[Ce.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<u;c++){const d=c+l,{content:i,contentType:h}=n.getCell(t,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(z(h)||j(h))&&!Y(h)){const S=new Date(i).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=i.valueOf()+S}else o[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}s.push(o)}return s}const Ve=150,De=P.getLogger("useVegaLiteSelections"),Oe=(n,e,s)=>{const{id:r,formId:u,selectionMode:l}=n,f=a.useCallback(t=>{l.forEach(c=>{t.addSignalListener(c,Z(Ve,(d,i)=>{const h=t.getState({data:(E,v)=>l.some(g=>`${g}_store`===E),recurse:!1});k(h)&&e.setElementState(r,"viewState",h);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const D={id:r,formId:u},N=JSON.parse(e.getStringValue(D)||"{}"),V={selection:{...N?.selection||{},[d]:S||{}}};M(N,V)||e.setStringValue(D,JSON.stringify(V),{fromUi:!0},s)}))});const o=e.getElementState(r,"viewState");if(k(o))try{return t.setState(o)}catch(c){De.warn("Failed to restore view state",c)}return t},[r,l,e,u,s]),p=a.useCallback(()=>{const t={selection:{}};l.forEach(i=>{t.selection[i]={}});const o={id:r,formId:u},c=e.getStringValue(o),d=c?JSON.parse(c):t;M(d,t)||e.setStringValue(o,JSON.stringify(t),{fromUi:!0},s)},[r,u,s,l,e]);return{maybeConfigureSelections:f,onFormCleared:p}},W="source",Te=P.getLogger("useVegaEmbed");function ve(n,e,s){const r=a.useRef(null),u=a.useRef(null),l=a.useRef(W),f=a.useRef(null),p=a.useRef([]),t=a.useRef(null),o=a.useRef([]),[c,d]=a.useState(!1),{maybeConfigureSelections:i,onFormCleared:h}=Oe(n,e,s);he({widgetMgr:e,element:n,onFormCleared:h});const{data:S,datasets:D}=n;a.useEffect(()=>{t.current=S,o.current=D,r.current===null&&(f.current=S,p.current=D)},[S,D]);const N=a.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),V=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{N();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:A,finalize:T}=await fe(g.current,b,w);r.current=i(A),u.current=T;const m=Ne(o.current),C=m?Object.keys(m):[];if(C.length===1){const[x]=C;l.current=x}else C.length===0&&y.data&&(l.current=W);const O=Ee(t.current);if(O&&r.current.insert(l.current,O),m)for(const[x,G]of Object.entries(m))r.current.insert(x,G);return await r.current.runAsync(),await r.current.resize().runAsync(),f.current=t.current,p.current=o.current,r.current}finally{d(!1)}},[N,i]),E=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),v=a.useCallback(async(g,b)=>{if(r.current===null||c)return null;const w=f.current,y=p.current;(w||g)&&E(r.current,l.current,w,g);const A=I(y)??{},T=I(b)??{};for(const[m,C]of Object.entries(T)){const O=m||l.current,x=A[O];E(r.current,O,x,C)}for(const m of Object.keys(A))!Object.hasOwn(T,m)&&m!==l.current&&E(r.current,m,null,null);return await r.current?.resize().runAsync(),f.current=g,p.current=b,r.current},[E,c]);return{createView:V,updateView:v,finalizeView:N}}function Ae(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!!(e.facet||e.encoding?.row||e.encoding?.column||e.encoding?.facet)}catch{return!1}}function Re(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in e)||!Array.isArray(e.vconcat)?!1:e.vconcat.some(s=>s!==null&&typeof s=="object"&&("hconcat"in s||"vconcat"in s||"concat"in s||"layer"in s))}catch{return!1}}const xe=({disableFullscreenMode:n,element:e,fragmentId:s,widgetMgr:r,widthConfig:u,heightConfig:l})=>{const[f,p]=a.useState(!1),[t,o]=a.useState(!1),{expanded:c,height:d,width:i,expand:h,collapse:S}=q(ae),{width:D,height:N,elementRef:V}=ee([f],0),E=te(u)||e.useContainerWidth,v=ne(l),g=Ae(e.spec),b=Re(e.spec),w=we(e,g?i??0:D,(c?d:N)??0,c&&!b?!0:E,c?!0:v),{createView:y,updateView:A,finalizeView:T}=ve(w,r,s),{data:m,datasets:C,spec:O}=w;return a.useLayoutEffect(()=>(V.current!==null&&y(V,O),T),[y,T,O,i,d,f,V]),a.useEffect(()=>{A(m,C)},[m,C]),a.useEffect(()=>{m||C?.[0]?.data?o(!0):o(!1)},[m,C]),f?R(ie,{data:m??C[0]?.data,height:d??N??void 0,width:u??void 0,customToolbarActions:[R(_,{label:"Show chart",icon:U,onClick:()=>{p(!1)}},"show-chart")]}):re(H,{height:v?c?d:"100%":d,useContainerWidth:c?!0:E,children:[R(ce,{target:H,isFullScreen:c,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:t&&R(_,{label:"Show data",icon:ge,onClick:()=>{p(!0)}})}),R(se,{styles:[me]}),R(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:E,useContainerHeight:v,ref:V})]})},Fe=oe(xe),st=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,st as default};
1
+ import{r as a,E as B,_ as $,l as X,e as L,Q,O as K,bd as z,be as j,bf as Y,bg as Z,n as k,bh as M,V as P,W as q,k as ee,b8 as te,bi as ne,j as R,o as re,b1 as se}from"./index.qjO5OK90.js";import{w as oe,E as ae}from"./withFullScreenWrapper.CHBnw0Co.js";import{a as _,S as H,T as ce}from"./Toolbar.NhlhlTzK.js";import{R as ie}from"./index.1sBZt_1I.js";import{a as J,c as le,b as ue,e as fe,t as de,S as me,d as pe}from"./embed.CZG6oOsc.js";import{u as he}from"./FormClearHelper.B74VElyu.js";import{T as ge}from"./TableChart.esm.Mk-Hvy1t.js";import"./moment.C7qA8nIE.js";import"./pandasStylerUtils.agmr-LQ2.js";import"./numbro.B9_PXfzp.js";import"./_baseIndexOf.BTknn6Gb.js";import"./index.8HslT92O.js";import"./main.dnUTEH_j.js";import"./throttle.B1o314FW.js";import"./formatNumber.BsU-5o3V.js";import"./sprintf.DpPCfzXw.js";import"./formatMoment.C6Hwn6X5.js";import"./checkbox.DCFAQrRB.js";import"./createDownloadLinkElement.D5zpcd24.js";import"./toConsumableArray.BeHbBK8g.js";import"./FileDownload.esm.G-HJG6nt.js";import"./_arrayIncludes.B19Iyn2B.js";import"./threshold.CUNQbqMA.js";import"./value.DaKxGC7O.js";import"./timer.BZio6gjG.js";var U=a.forwardRef(function(n,e){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,$({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});U.displayName="InsertChart";const Se=20;function ye(n){"params"in n&&"encoding"in n&&n.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&L(e.select.encodings)&&(e.select.encodings=Object.keys(n.encoding)))})}const be=(n,e,s,r,u,l,f,p)=>{const t=JSON.parse(n);if(r==="streamlit"?t.config=J(t.config,l):t.usermeta?.embedOptions?.theme==="streamlit"?(t.config=J(t.config,l),t.usermeta.embedOptions.theme=void 0):t.config=le(t.config,l),t.title&&(typeof t.title=="string"&&(t.title={text:t.title}),t.title.limit=t.title.limit??Math.max(f-40,0)),s&&(t.height=p),e&&(t.width=f,"vconcat"in t&&t.vconcat.forEach(o=>{o===null||typeof o!="object"||"hconcat"in o||"vconcat"in o||"concat"in o||"layer"in o||(o.width=f)})),t.padding||(t.padding={}),L(t.padding.bottom)&&(t.padding.bottom=Se),t.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&ye(t),t},we=(n,e,s,r,u)=>{const l=X(),{id:f,formId:p,spec:t,data:o,datasets:c,vegaLiteTheme:d,selectionMode:i}=n,h=a.useMemo(()=>i,[JSON.stringify(i)]),S=a.useMemo(()=>be(t,r,u,d,h,l,e,s),[t,r,u,d,h,l,e,s]);return{id:f,formId:p,vegaLiteTheme:d,spec:S,selectionMode:h,data:o,datasets:c,useContainerWidth:r}},Ce={DATAFRAME_INDEX:"(index)"};function Ee(n){return!n||n.dimensions.numDataRows===0?null:F(n)}function Ne(n){const e=I(n);if(L(e))return null;const s={};for(const[r,u]of Object.entries(e))s[r]=F(u);return s}function I(n){if(n?.length===0)return null;const e={};return n.forEach(s=>{if(!s)return;const r=s.hasName?s.name:null;e[r]=s.data}),e}function F(n,e=0){if(n.dimensions.numDataRows===0)return[];const s=[],{numDataRows:r,numDataColumns:u,numIndexColumns:l}=n.dimensions,f=n.columnTypes[0]??void 0,p=f?.type===Q.INDEX&&(K(f)||z(f)||j(f));for(let t=e;t<r;t++){const o={};if(p){const{content:c}=n.getCell(t,0);o[Ce.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<u;c++){const d=c+l,{content:i,contentType:h}=n.getCell(t,d);if((i instanceof Date||typeof i=="number"&&Number.isFinite(i))&&(z(h)||j(h))&&!Y(h)){const S=new Date(i).getTimezoneOffset()*60*1e3;o[n.columnNames[0][d]]=i.valueOf()+S}else o[n.columnNames[0][d]]=typeof i=="bigint"?Number(i):i}s.push(o)}return s}const Ve=150,De=P.getLogger("useVegaLiteSelections"),Oe=(n,e,s)=>{const{id:r,formId:u,selectionMode:l}=n,f=a.useCallback(t=>{l.forEach(c=>{t.addSignalListener(c,Z(Ve,(d,i)=>{const h=t.getState({data:(E,v)=>l.some(g=>`${g}_store`===E),recurse:!1});k(h)&&e.setElementState(r,"viewState",h);let S=i;"vlPoint"in i&&"or"in i.vlPoint&&(S=i.vlPoint.or);const D={id:r,formId:u},N=JSON.parse(e.getStringValue(D)||"{}"),V={selection:{...N?.selection||{},[d]:S||{}}};M(N,V)||e.setStringValue(D,JSON.stringify(V),{fromUi:!0},s)}))});const o=e.getElementState(r,"viewState");if(k(o))try{return t.setState(o)}catch(c){De.warn("Failed to restore view state",c)}return t},[r,l,e,u,s]),p=a.useCallback(()=>{const t={selection:{}};l.forEach(i=>{t.selection[i]={}});const o={id:r,formId:u},c=e.getStringValue(o),d=c?JSON.parse(c):t;M(d,t)||e.setStringValue(o,JSON.stringify(t),{fromUi:!0},s)},[r,u,s,l,e]);return{maybeConfigureSelections:f,onFormCleared:p}},W="source",Te=P.getLogger("useVegaEmbed");function ve(n,e,s){const r=a.useRef(null),u=a.useRef(null),l=a.useRef(W),f=a.useRef(null),p=a.useRef([]),t=a.useRef(null),o=a.useRef([]),[c,d]=a.useState(!1),{maybeConfigureSelections:i,onFormCleared:h}=Oe(n,e,s);he({widgetMgr:e,element:n,onFormCleared:h});const{data:S,datasets:D}=n;a.useEffect(()=>{t.current=S,o.current=D,r.current===null&&(f.current=S,p.current=D)},[S,D]);const N=a.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),V=a.useCallback(async(g,b)=>{if(g.current===null)throw new Error("Element missing.");d(!0);try{N();const w={ast:!0,expr:ue,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:A,finalize:T}=await fe(g.current,b,w);r.current=i(A),u.current=T;const m=Ne(o.current),C=m?Object.keys(m):[];if(C.length===1){const[x]=C;l.current=x}else C.length===0&&y.data&&(l.current=W);const O=Ee(t.current);if(O&&r.current.insert(l.current,O),m)for(const[x,G]of Object.entries(m))r.current.insert(x,G);return await r.current.runAsync(),await r.current.resize().runAsync(),f.current=t.current,p.current=o.current,r.current}finally{d(!1)}},[N,i]),E=a.useCallback((g,b,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{g.remove(b,de)}catch{}return}if(!w||w.dimensions.numDataRows===0){g.insert(b,F(y));return}y.hash!==w.hash&&(g.data(b,F(y)),Te.info(`Had to clear the ${b} dataset before inserting data through Vega view.`))},[]),v=a.useCallback(async(g,b)=>{if(r.current===null||c)return null;const w=f.current,y=p.current;(w||g)&&E(r.current,l.current,w,g);const A=I(y)??{},T=I(b)??{};for(const[m,C]of Object.entries(T)){const O=m||l.current,x=A[O];E(r.current,O,x,C)}for(const m of Object.keys(A))!Object.hasOwn(T,m)&&m!==l.current&&E(r.current,m,null,null);return await r.current?.resize().runAsync(),f.current=g,p.current=b,r.current},[E,c]);return{createView:V,updateView:v,finalizeView:N}}function Ae(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!!(e.facet||e.encoding?.row||e.encoding?.column||e.encoding?.facet)}catch{return!1}}function Re(n){try{const e=typeof n=="string"?JSON.parse(n):n;return!("vconcat"in e)||!Array.isArray(e.vconcat)?!1:e.vconcat.some(s=>s!==null&&typeof s=="object"&&("hconcat"in s||"vconcat"in s||"concat"in s||"layer"in s))}catch{return!1}}const xe=({disableFullscreenMode:n,element:e,fragmentId:s,widgetMgr:r,widthConfig:u,heightConfig:l})=>{const[f,p]=a.useState(!1),[t,o]=a.useState(!1),{expanded:c,height:d,width:i,expand:h,collapse:S}=q(ae),{width:D,height:N,elementRef:V}=ee([f],0),E=te(u)||e.useContainerWidth,v=ne(l),g=Ae(e.spec),b=Re(e.spec),w=we(e,g?i??0:D,(c?d:N)??0,c&&!b?!0:E,c?!0:v),{createView:y,updateView:A,finalizeView:T}=ve(w,r,s),{data:m,datasets:C,spec:O}=w;return a.useLayoutEffect(()=>(V.current!==null&&y(V,O),T),[y,T,O,i,d,f,V]),a.useEffect(()=>{A(m,C)},[m,C]),a.useEffect(()=>{m||C?.[0]?.data?o(!0):o(!1)},[m,C]),f?R(ie,{data:m??C[0]?.data,height:d??N??void 0,width:u??void 0,customToolbarActions:[R(_,{label:"Show chart",icon:U,onClick:()=>{p(!1)}},"show-chart")]}):re(H,{height:v?c?d:"100%":d,useContainerWidth:c?!0:E,children:[R(ce,{target:H,isFullScreen:c,onExpand:h,onCollapse:S,disableFullscreenMode:n,children:t&&R(_,{label:"Show data",icon:ge,onClick:()=>{p(!0)}})}),R(se,{styles:[me]}),R(pe,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:E,useContainerHeight:v,ref:V})]})},Fe=oe(xe),st=a.memo(Fe);export{me as StyledVegaLiteChartTooltips,J as applyStreamlitTheme,st as default};