import e from"../../node_modules/classnames/index.js";import o from"../../node_modules/lodash/isNil.js";import r,{useMemo as t}from"react";import n from"../../node_modules/reactstrap/esm/Button.js";import a from"../Anchor/Anchor.js";import i from"../../node_modules/@phosphor-icons/react/dist/icons/CircleNotch.es.js";import s from"../Icon/IconAnimation.js";import m from"../colors.js";import c from"../Stack/Stack.js";import l from"../Text/Text.js";import{getAriaLabelFromProps as p,convertTextStylePropsToClassNames as d}from"../utils.js";const f=r.forwardRef((({align:f="center",children:h,color:j="primary",disabled:u,external:x,href:g,icon:E,id:b,legacyColor:k,loading:w,nowrap:y=!0,onClick:C,size:I="md",tight:_,...A},N)=>{const z=p({...A,children:h}),R=t((()=>"secondary"===j?"link":j),[j]),S=r.createElement(n,{"aria-label":z,className:e(d({align:f}),{"p-0":_,"text-nowrap":y,[`text-${k}`]:k}),color:R,disabled:u||w,id:b,onClick:C,size:I,...A,innerRef:N},r.createElement(c,{alignItems:"start",justifyContent:"center",row:!0,spacing:2},w&&r.createElement(l,{component:"span"},r.createElement(s,{"aria-label":"Loading",duration:.75,icon:i,type:"spin"})),!w&&E&&r.createElement(l,{component:"span"},r.createElement(E,{color:k?m[k]:void 0})),!o(h)&&r.createElement(l,{component:"span",nowrap:y},h)));return o(g)?S:r.createElement(a,{external:x,href:g,tabIndex:-1},S)}));export{f as default};
//# sourceMappingURL=Button.js.map
