import{Ja as e,Qa as t,Qt as n,Xt as r,Yt as i,an as a,er as o,in as s,io as c,nr as l,on as u,rn as d,tr as f}from"./index.dkY5s53S.js";import{t as p}from"./iconPosition.CY47f4C7.js";var m=c(t(),1),h=(0,m.memo)(function(t){let{disabled:i,element:c,widgetMgr:h,fragmentId:g}=t,{formId:_}=c,v=c.shortcut?c.shortcut:void 0,{formsData:y}=r(n),b=y.formsWithUploads.has(_),x=f.SECONDARY_FORM_SUBMIT;c.type===`primary`?x=f.PRIMARY_FORM_SUBMIT:c.type===`tertiary`&&(x=f.TERTIARY_FORM_SUBMIT);let S=i||b;(0,m.useEffect)(()=>(h.addSubmitButton(_,c),()=>h.removeSubmitButton(_,c)),[h,_,c]);let C=(0,m.useCallback)(()=>{S||h.submitForm(c.formId,g,c)},[S,h,c,g]);return s({shortcut:v,disabled:S,onActivate:C}),e(u,{className:`stFormSubmitButton`,"data-testid":`stFormSubmitButton`,children:e(a,{help:c.help,containerWidth:!0,children:e(o,{kind:x,size:l.SMALL,containerWidth:!0,disabled:S,onClick:C,children:e(d,{icon:c.icon,iconPosition:p(c.iconPosition),label:c.label,shortcut:v})})})})});function g(t){return e(i,{children:e(h,{...t})})}export{g as FormSubmitContent};