import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{c as n}from"./emotion-styled.browser.esm.DmHEQgFq.js";import{v as r}from"./StreamlitMarkdown.DgiZKHgf.js";import{n as i,t as a}from"./styled-components.BfB5_lgd.js";import{t as o}from"./BaseButton.CtdrcmcQ.js";import{en as s,nn as c,tn as l}from"./index.D3kRk1xg.js";import{t as u}from"./iconPosition.DWeCxQ7w.js";var d=e(t(),1);function f(e){let{disabled:t,element:f,widgetMgr:p,fragmentId:m}=e,h=f.shortcut?f.shortcut:void 0,g=a.SECONDARY;f.type===`primary`?g=a.PRIMARY:f.type===`tertiary`&&(g=a.TERTIARY);let _=(0,d.useCallback)(()=>{t||p.setTriggerValue(f,{fromUi:!0},m)},[t,p,f,m]);return l({shortcut:h,disabled:t,onActivate:_}),n(r,{className:`stButton`,"data-testid":`stButton`,children:n(c,{help:f.help,containerWidth:!0,children:n(o,{kind:g,size:i.SMALL,disabled:t,containerWidth:!0,onClick:_,children:n(s,{icon:f.icon,iconPosition:u(f.iconPosition),label:f.label,shortcut:h})})})})}var p=(0,d.memo)(f);export{p as default};