require("./Avatar.css");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $053b76ed3d29e13b$exports = require("./Image.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $1YWJ0$reactjsxruntime = require("react/jsx-runtime");
var $1YWJ0$react = require("react");
var $1YWJ0$reactariautils = require("@react-aria/utils");
var $1YWJ0$reactspectrumutils = require("@react-spectrum/utils");


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

$parcel$export(module.exports, "AvatarContext", () => $38071d9ce246d4cf$export$a20dad690e1279e2);
$parcel$export(module.exports, "Avatar", () => $38071d9ce246d4cf$export$e2255cf6045e8d47);
/*
 * 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 $38071d9ce246d4cf$var$imageStyles = function anonymous(props, overrides) {
    let rules = " ";
    let flexShrink = false;
    let flexGrow = false;
    let matches = (overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "_v") flexShrink = true;
        if (p[1] === "_u") flexGrow = true;
        rules += p[0];
    }
    rules += ' sd12';
    rules += ' eb12';
    rules += ' og12';
    rules += ' ng12';
    rules += ' kg12';
    rules += ' jg12';
    rules += ' Zm12';
    rules += ' Fn12';
    if (!flexShrink) rules += ' _va12';
    if (!flexGrow) rules += ' _ua12';
    rules += ' __ca12';
    if (props.isOverBackground) rules += ' _Lf12';
    else rules += ' _Le12';
    rules += ' OEzkoQe12';
    if (props.isLarge) rules += ' _Mc12';
    else rules += ' _Mb12';
    return rules;
};
const $38071d9ce246d4cf$export$a20dad690e1279e2 = /*#__PURE__*/ (0, $1YWJ0$react.createContext)(null);
const $38071d9ce246d4cf$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $1YWJ0$react.forwardRef)(function Avatar(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $38071d9ce246d4cf$export$a20dad690e1279e2);
    let domRef = (0, $1YWJ0$reactspectrumutils.useDOMRef)(ref);
    let { alt: alt = '', src: src, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', size: size = 24, isOverBackground: isOverBackground, slot: slot = 'avatar', ...otherProps } = props;
    const domProps = (0, $1YWJ0$reactariautils.filterDOMProps)(otherProps);
    let remSize = size / 16 + 'rem';
    let isLarge = size >= 64;
    return /*#__PURE__*/ (0, $1YWJ0$reactjsxruntime.jsx)((0, $053b76ed3d29e13b$exports.Image), {
        ...domProps,
        ref: domRef,
        slot: slot,
        alt: alt,
        UNSAFE_style: {
            ...UNSAFE_style,
            width: remSize,
            height: remSize
        },
        UNSAFE_className: UNSAFE_className + ' ' + (0, $e991cbcdf82ced71$exports.centerBaselineBefore),
        styles: $38071d9ce246d4cf$var$imageStyles({
            isOverBackground: isOverBackground,
            isLarge: isLarge
        }, props.styles),
        src: src
    });
});


//# sourceMappingURL=Avatar.cjs.map
