import{o as e}from"./chunk.DuxOD-Sk.js";import{r as t}from"./emotion-is-prop-valid.esm.DV_OErv-.js";import{c as n}from"./emotion-styled.browser.esm.CEYoudG7.js";import"./loglevel.H4SN4KQm.js";import"./isLength.Dot76Eow.js";import"./getColors.Llt-1DRT.js";import"./protobuf.GnXEZo24.js";import{It as r,Lt as i,Rt as a,_t as o,ft as s,ht as c,vt as l}from"./src.CIyydb94.js";import"./utils.C1Nidt8_.js";import"./utils.VFl7c69J.js";import"./ErrorElement.K-kvHExv.js";import"./v4.C6ecLp5d.js";import"./utils.B6lSy2ZF.js";import"./UriUtil.BJr0dLQG.js";import"./useCopyToClipboard.CUBg6ZxJ.js";import"./useWindowDimensionsContext.jnKliU5K.js";import"./katex.min.DyoqhKgf.js";import{t as u}from"./iconPosition.DZs5QWnP.js";var d=e(t());function f(e){let{disabled:t,element:f,widgetMgr:p,fragmentId:m}=e,h=f.shortcut?f.shortcut:void 0,g=i.SECONDARY;f.type===`primary`?g=i.PRIMARY:f.type===`tertiary`&&(g=i.TERTIARY);let _=(0,d.useCallback)(()=>{t||p.setTriggerValue(f,{fromUi:!0},m)},[t,p,f,m]);return c({shortcut:h,disabled:t,onActivate:_}),n(l,{className:`stButton`,"data-testid":`stButton`,children:n(o,{help:f.help,containerWidth:!0,children:n(r,{kind:g,size:a.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};