require("./Badge.css");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
var $5eb75e0c130e0669$exports = require("../icons/Skeleton.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $26Nq1$reactjsxruntime = require("react/jsx-runtime");
var $26Nq1$reactariacomponents = require("react-aria-components");
var $26Nq1$reactariautils = require("@react-aria/utils");
var $26Nq1$react = require("react");
var $26Nq1$reactspectrumutils = require("@react-spectrum/utils");


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "BadgeContext", () => $660a621e3a266afc$export$1d4627584e49159a);
$parcel$export(module.exports, "Badge", () => $660a621e3a266afc$export$37acb3580601e69a);
/*
 * Copyright 2024 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 









const $660a621e3a266afc$export$1d4627584e49159a = /*#__PURE__*/ (0, $26Nq1$react.createContext)(null);
const $660a621e3a266afc$var$badge = function anonymous(props, overrides) {
    let rules = " ";
    let minWidth = false;
    let matches = String(overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "N") minWidth = true;
        rules += p[0];
    }
    if (props.size === "XL") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "L") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "S") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "XS") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a11';
        rules += ' vx11';
    } else {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    }
    if (props.size === "XL") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "L") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "S") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "XS") {
        rules += ' xb11';
        rules += ' _xa11';
    } else {
        rules += ' xb11';
        rules += ' _xa11';
    }
    if (props.size === "XL") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "L") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "S") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "XS") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    }
    if (props.fillStyle === "outline") rules += ' pm11';
    else if (props.fillStyle === "subtle") rules += ' pm11';
    else if (props.fillStyle === "bold") {
        if (props.variant === "celery") rules += ' pg11';
        else if (props.variant === "chartreuse") rules += ' pg11';
        else if (props.variant === "yellow") rules += ' pg11';
        else if (props.variant === "orange") rules += ' pg11';
        else if (props.variant === "notice") rules += ' pg11';
        else rules += ' px11';
    }
    rules += ' sd11';
    rules += ' ea11';
    rules += ' egLWx3bb11';
    rules += ' _oa11';
    rules += ' Sv11';
    rules += ' SgLWx3bd11';
    rules += ' Rv11';
    rules += ' RgLWx3bd11';
    if (props.size === "XL") {
        if (!minWidth) rules += ' Nl11';
    } else if (props.size === "L") {
        if (!minWidth) rules += ' Nj11';
    } else if (props.size === "S") {
        if (!minWidth) rules += ' Nf11';
    } else if (props.size === "XS") {
        if (!minWidth) rules += ' Ne11';
    } else if (!minWidth) rules += ' Nk11';
    if (props.size === "XL") rules += ' -SFnbic-_JaP8ec11';
    else if (props.size === "L") rules += ' -SFnbic-_J0K2hn11';
    else if (props.size === "S") rules += ' -SFnbic-_JJOW22b11';
    else if (props.size === "XS") rules += ' -SFnbic-_JICefdd11';
    else rules += ' -SFnbic-_Jb11';
    rules += ' -Bu7z1c-ob11';
    rules += ' oj11';
    rules += ' nj11';
    rules += ' kj11';
    rules += ' jj11';
    rules += ' qc11';
    rules += ' qsd11';
    rules += ' -Qg41Lb-IAxCW0c11';
    rules += ' -Qg41Lb-gLWx3bIy11';
    rules += ' MAyFGYc11';
    rules += ' Td11';
    rules += ' Qd11';
    rules += ' -aRvJDd-Tu7Fubd11';
    rules += ' _Ca11';
    if (props.fillStyle === "outline") rules += ' g_g11';
    else if (props.fillStyle === "subtle") {
        if (props.variant === "silver") rules += ' g_f11';
        else if (props.variant === "cinnamon") rules += ' gP11';
        else if (props.variant === "brown") rules += ' gO11';
        else if (props.variant === "turquoise") rules += ' gy11';
        else if (props.variant === "pink") rules += ' gT11';
        else if (props.variant === "magenta") rules += ' gS11';
        else if (props.variant === "fuchsia") rules += ' gR11';
        else if (props.variant === "purple") rules += ' gM11';
        else if (props.variant === "indigo") rules += ' gK11';
        else if (props.variant === "blue") rules += ' gG11';
        else if (props.variant === "cyan") rules += ' gC11';
        else if (props.variant === "seafoam") rules += ' gz11';
        else if (props.variant === "green") rules += ' gA11';
        else if (props.variant === "celery") rules += ' gv11';
        else if (props.variant === "chartreuse") rules += ' gJ11';
        else if (props.variant === "yellow") rules += ' gW11';
        else if (props.variant === "orange") rules += ' gV11';
        else if (props.variant === "red") rules += ' gU11';
        else if (props.variant === "gray") rules += ' gI11';
        else if (props.variant === "negative") rules += ' gU11';
        else if (props.variant === "notice") rules += ' gV11';
        else if (props.variant === "positive") rules += ' gA11';
        else if (props.variant === "neutral") rules += ' gI11';
        else if (props.variant === "informative") rules += ' gG11';
        else if (props.variant === "accent") rules += ' gG11';
    } else if (props.fillStyle === "bold") {
        if (props.variant === "silver") rules += ' gm11';
        else if (props.variant === "cinnamon") rules += ' gq11';
        else if (props.variant === "brown") rules += ' gn11';
        else if (props.variant === "turquoise") rules += ' g511';
        else if (props.variant === "pink") rules += ' gx11';
        else if (props.variant === "magenta") rules += ' gD11';
        else if (props.variant === "fuchsia") rules += ' gr11';
        else if (props.variant === "purple") rules += ' go11';
        else if (props.variant === "indigo") rules += ' gl11';
        else if (props.variant === "blue") rules += ' g211';
        else if (props.variant === "cyan") rules += ' gk11';
        else if (props.variant === "seafoam") rules += ' g411';
        else if (props.variant === "green") rules += ' g111';
        else if (props.variant === "celery") rules += ' g711';
        else if (props.variant === "chartreuse") rules += ' gp11';
        else if (props.variant === "yellow") rules += ' gN11';
        else if (props.variant === "orange") rules += ' gQ11';
        else if (props.variant === "red") rules += ' gB11';
        else if (props.variant === "gray") rules += ' g611';
        else if (props.variant === "negative") rules += ' gB11';
        else if (props.variant === "notice") rules += ' gQ11';
        else if (props.variant === "positive") rules += ' g111';
        else if (props.variant === "neutral") rules += ' g611';
        else if (props.variant === "informative") rules += ' g211';
        else if (props.variant === "accent") rules += ' g211';
    }
    rules += ' _jf11';
    rules += ' _kJ8iPYd11';
    rules += ' hXMFGYc11';
    rules += ' mc11';
    rules += ' lc11';
    if (props.fillStyle === "outline") {
        if (props.variant === "negative") rules += ' iFLVMS11';
        else if (props.variant === "notice") rules += ' i9VrKkd11';
        else if (props.variant === "positive") rules += ' ip17Jm11';
        else if (props.variant === "neutral") rules += ' i0ruhAb11';
        else if (props.variant === "informative") rules += ' iG1ze4d11';
        else if (props.variant === "accent") rules += ' iG1ze4d11';
    } else rules += ' iA11';
    rules += ' -_8sjo0b-t5ZbAob11';
    if (props.size === "XL") rules += ' -M_-Mk11';
    else if (props.size === "L") rules += ' -M_-Mh11';
    else if (props.size === "S") rules += ' -M_-Mg11';
    else if (props.size === "XS") rules += ' -M_-Mf11';
    else rules += ' -M_-Mi11';
    rules += ' -_k_-_kc11';
    rules += ' -h_-hc11';
    return rules;
};
const $660a621e3a266afc$export$37acb3580601e69a = /*#__PURE__*/ (0, $26Nq1$react.forwardRef)(function Badge(props1, ref) {
    [props1, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props1, ref, $660a621e3a266afc$export$1d4627584e49159a);
    let { children: children, variant: variant = 'neutral', size: size = 'S', fillStyle: fillStyle = 'bold', overflowMode: overflowMode = 'wrap', ...otherProps } = props1; // useProviderProps(props) in v3
    let domRef = (0, $26Nq1$reactspectrumutils.useDOMRef)(ref);
    let isTextOnly = (0, ($parcel$interopDefault($26Nq1$react))).Children.toArray(props1.children).every((c)=>!/*#__PURE__*/ (0, ($parcel$interopDefault($26Nq1$react))).isValidElement(c));
    return /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $26Nq1$reactariacomponents.Provider), {
        values: [
            [
                (0, $6367bc87eb7d24ad$exports.TextContext),
                {
                    styles: function anonymous(props) {
                        let rules = " ";
                        rules += ' TAzEcG11';
                        rules += ' QAzEcG11';
                        rules += ' _Jb11';
                        rules += ' _Nc11';
                        rules += ' Pc11';
                        rules += ' _Yb11';
                        if (props.overflowMode === "wrap") rules += ' _7b11';
                        else if (props.overflowMode === "truncate") rules += ' _7c11';
                        return rules;
                    }({
                        overflowMode: overflowMode
                    })
                }
            ],
            [
                (0, $26Nq1$reactariacomponents.TextContext),
                {}
            ],
            [
                (0, $bde97c91243ed164$exports.IconContext),
                {
                    render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                        slot: 'icon',
                        styles: " _Ja11"
                    }),
                    styles: " ZuUmpre11 FuUmpre11 I67logd11 _va11"
                }
            ]
        ],
        children: /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $5eb75e0c130e0669$exports.SkeletonWrapper), {
            children: /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)("span", {
                ...(0, $26Nq1$reactariautils.filterDOMProps)(otherProps),
                role: "presentation",
                className: (props1.UNSAFE_className || '') + $660a621e3a266afc$var$badge({
                    variant: variant,
                    size: size,
                    fillStyle: fillStyle
                }, props1.styles),
                style: props1.UNSAFE_style,
                ref: domRef,
                children: typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                    children: children
                }) : children
            })
        })
    });
});


//# sourceMappingURL=Badge.cjs.map
