"use strict";(self.webpackChunk_stlite_desktop=self.webpackChunk_stlite_desktop||[]).push([[2940],{12940:(o,r,e)=>{e.r(r),e.d(r,{default:()=>p});e(5057);var t=e(44088),i=e(92649),l=e(29968),s=e(82160),a=e(59990);function d(o,r){switch(o){case t.V5.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case t.V5.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case t.V5.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const n=(0,s.Z)("a",{target:"e16zdaao2"})((o=>{let{fluidWidth:r,size:e,theme:t}=o;const i="number"==typeof r?`${r}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:t.fontWeights.normal,padding:`${t.spacing.xs} ${t.spacing.md}`,borderRadius:t.radii.default,minHeight:t.sizes.minElementHeight,margin:0,lineHeight:t.lineHeights.base,color:t.colors.primary,textDecoration:"none",width:r?i:"auto",userSelect:"none","&:visited":{color:t.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,a.DZ)(t.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...d(e,t)}}),""),c=(0,s.Z)(n,{target:"e16zdaao1"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.primary,color:r.colors.white,border:`${r.sizes.borderWidth} solid ${r.colors.primary}`,"&:hover":{backgroundColor:(0,a._j)(r.colors.primary,.05),color:r.colors.white},"&:active":{backgroundColor:"transparent",color:r.colors.primary},"&:visited:not(:active)":{color:r.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),""),u=(0,s.Z)(n,{target:"e16zdaao0"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.lightenedBg05,color:r.colors.bodyText,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,"&:visited":{color:r.colors.bodyText},"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),"");var b=e(96266);const h=function(o){let{kind:r,size:e,disabled:i,fluidWidth:l,children:s,autoFocus:a,href:d,rel:n,target:h,onClick:p}=o,g=c;return r===t.nW.SECONDARY&&(g=u),(0,b.jsx)(g,{kind:r,size:e||t.V5.MEDIUM,fluidWidth:l||!1,disabled:i||!1,autoFocus:a||!1,href:d,target:h,rel:n,onClick:p,tabIndex:i?-1:0,children:s})};const p=function(o){const{disabled:r,element:e,width:s}=o,a={width:s},d="primary"===e.type?t.nW.PRIMARY:t.nW.SECONDARY,n=!e.help||s;return(0,b.jsx)("div",{className:"stLinkButton","data-testid":"stLinkButton",style:a,children:(0,b.jsx)(i.t,{help:e.help,children:(0,b.jsx)(h,{kind:d,size:t.V5.SMALL,disabled:r,onClick:r=>{o.disabled&&r.preventDefault()},fluidWidth:!!e.useContainerWidth&&n,href:e.url,target:"_blank",rel:"noreferrer","aria-disabled":r,children:(0,b.jsx)(l.D,{icon:e.icon,label:e.label})})})})}}}]);