import e from"react";import r from"../../prop-types/index.js";import o from"../../classnames/index.js";import{tagPropType as t,isObject as n,mapToCssModules as c}from"./utils.js";var a=["className","cssModule","hidden","widths","tag","check","size","for"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},l.apply(this,arguments)}function s(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function i(e,r){if(null==e)return{};var o,t,n=function(e,r){if(null==e)return{};var o,t,n={},c=Object.keys(e);for(t=0;t<c.length;t++)o=c[t],r.indexOf(o)>=0||(n[o]=e[o]);return n}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(t=0;t<c.length;t++)o=c[t],r.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var f=["xs","sm","md","lg","xl","xxl"],u=r.oneOfType([r.number,r.string]),d=r.oneOfType([r.bool,r.string,r.number,r.shape({size:u,order:u,offset:u})]),m={children:r.node,hidden:r.bool,check:r.bool,size:r.string,for:r.string,tag:t,className:r.string,cssModule:r.object,xs:d,sm:d,md:d,lg:d,xl:d,xxl:d,widths:r.array},p=function(e,r,o){return!0===o||""===o?e?"col":"col-".concat(r):"auto"===o?e?"col-auto":"col-".concat(r,"-auto"):e?"col-".concat(o):"col-".concat(r,"-").concat(o)};function b(r){var t=r.className,u=r.cssModule,d=r.hidden,m=r.widths,b=void 0===m?f:m,h=r.tag,g=void 0===h?"label":h,v=r.check,y=r.size,O=r.for,x=i(r,a),j=[];b.forEach((function(e,t){var a=r[e];if(delete x[e],a||""===a){var l,i=!t;if(n(a)){var f,d=i?"-":"-".concat(e,"-");l=p(i,e,a.size),j.push(c(o((s(f={},l,a.size||""===a.size),s(f,"order".concat(d).concat(a.order),a.order||0===a.order),s(f,"offset".concat(d).concat(a.offset),a.offset||0===a.offset),f))),u)}else l=p(i,e,a),j.push(l)}}));var w=y||j.length,z=!(v||w),k=c(o(t,!!d&&"visually-hidden",!!v&&"form-check-label",!!y&&"col-form-label-".concat(y),j,!!w&&"col-form-label",!!z&&"form-label"),u);return e.createElement(g,l({htmlFor:O},x,{className:k}))}b.propTypes=m;export{b as default};
//# sourceMappingURL=Label.js.map
