import e,{useCallback as o}from"react";import t from"../../prop-types/index.js";import n from"../../classnames/index.js";import{tagPropType as r,mapToCssModules as l}from"./utils.js";import i from"./CloseButton.js";var a=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},c.apply(this,arguments)}function s(e,o){if(null==e)return{};var t,n,r=function(e,o){if(null==e)return{};var t,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)t=l[n],o.indexOf(t)>=0||(r[t]=e[t]);return r}(e,o);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)t=l[n],o.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var b={active:t.bool,"aria-label":t.string,block:t.bool,children:t.node,className:t.string,cssModule:t.object,close:t.bool,color:t.string,disabled:t.bool,innerRef:t.oneOfType([t.object,t.func,t.string]),onClick:t.func,outline:t.bool,size:t.string,tag:r};function u(t){var r=o((function(e){if(!t.disabled)return t.onClick?t.onClick(e):void 0;e.preventDefault()}),[t.onClick,t.disabled]),b=t.active,u=t["aria-label"],f=t.block,d=t.className,p=t.close,m=t.cssModule,v=t.color,g=void 0===v?"secondary":v,y=t.outline,j=t.size,O=t.tag,k=void 0===O?"button":O,h=t.innerRef,C=s(t,a);if(p)return e.createElement(i,C);var x="btn".concat(y?"-outline":"","-").concat(g),w=l(n(d,"btn",x,!!j&&"btn-".concat(j),!!f&&"d-block w-100",{active:b,disabled:t.disabled}),m);return C.href&&"button"===k&&(k="a"),e.createElement(k,c({type:"button"===k&&C.onClick?"button":void 0},C,{className:w,ref:h,onClick:r,"aria-label":u}))}u.propTypes=b;export{u as default};
//# sourceMappingURL=Button.js.map
