"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[6141],{96141:(t,e,n)=>{n.r(e),n.d(e,{default:()=>u});var i=n(58878),l=n(84720),s=n(98350),a=n(36459),r=n(88987),d=n(84152),o=n(90782);const u=function(t){const{disabled:e,element:n,widgetMgr:u,width:c,endpoints:b,fragmentId:h}=t,p={width:c},{libConfig:{enforceDownloadInNewTab:f=!1}}=i.useContext(d.n),w="primary"===n.type?l.KX.PRIMARY:l.KX.SECONDARY,m=!n.help||c;return(0,o.jsx)("div",{className:"stDownloadButton","data-testid":"stDownloadButton",style:p,children:(0,o.jsx)(s.F,{help:n.help,children:(0,o.jsx)(a.Ay,{kind:w,size:l.Pj.SMALL,disabled:e,onClick:()=>{u.setTriggerValue(n,{fromUi:!0},h);const t=function(t,e,n){const i=document.createElement("a"),l=t.buildMediaURL(e);return i.setAttribute("href",l),n?i.setAttribute("target","_blank"):i.setAttribute("target","_self"),i.setAttribute("download",""),i}(b,n.url,f);t.click()},fluidWidth:!!n.useContainerWidth&&m,children:(0,o.jsx)(r.Y,{icon:n.icon,label:n.label})})})})}}}]);