require("./Link.css");
var $5eb75e0c130e0669$exports = require("../icons/Skeleton.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $7PkpH$reactjsxruntime = require("react/jsx-runtime");
var $7PkpH$reactariacomponents = require("react-aria-components");
var $7PkpH$react = require("react");
var $7PkpH$reactspectrumutils = require("@react-spectrum/utils");
var $7PkpH$reactariautils = require("@react-aria/utils");


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

$parcel$export(module.exports, "LinkContext", () => $064658f378a85eef$export$e2509388b49734e7);
$parcel$export(module.exports, "Link", () => $064658f378a85eef$export$a6c7ac8248d6e38a);
/*
 * 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 $064658f378a85eef$export$e2509388b49734e7 = /*#__PURE__*/ (0, $7PkpH$react.createContext)(null);
const $064658f378a85eef$var$link = function anonymous(props, overrides) {
    let rules = " ";
    rules += ((overrides || '').match(/(?:^|\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) || []).join('');
    if (props.isFocusVisible) rules += ' _Lf1';
    else rules += ' _Le1';
    if (props.isStaticColor) rules += ' Oe1';
    else rules += ' Oh1';
    rules += ' Olc1';
    rules += ' _Mc1';
    rules += ' _Kd1';
    if (props.staticColor === "white") rules += ' -Ovbhqd-gcwrnr1';
    else if (props.staticColor === "black") rules += ' -Ovbhqd-g4hn3s1';
    rules += ' oa1';
    rules += ' na1';
    rules += ' ka1';
    rules += ' ja1';
    if (props.isStandalone) {
        rules += ' uk1';
        rules += ' ucJ9TBTb1';
        rules += ' ud3Euai1';
        rules += ' uea1';
        rules += ' ugb1';
        rules += ' uhd1';
        rules += ' uje1';
        rules += ' u2NhKxcl1';
        rules += ' uic1';
    }
    if (props.isStandalone) {
        rules += ' -_6BNtrc-c1';
        rules += ' vx1';
    }
    if (props.isStandalone) {
        rules += ' xc1';
        rules += ' _xa1';
    }
    if (props.isStandalone) {
        rules += ' _Fd1';
        rules += ' _FnuYUweb1';
    }
    if (props.isStaticColor) rules += ' pl1';
    else if (props.variant === "secondary") {
        if (props.isPressed) rules += ' po1';
        else if (props.isFocusVisible) rules += ' po1';
        else if (props.isHovered) rules += ' po1';
        else rules += ' pt1';
    } else if (props.variant === "primary") {
        if (props.isPressed) rules += ' ps1';
        else if (props.isFocusVisible) rules += ' ps1';
        else if (props.isHovered) rules += ' ps1';
        else rules += ' pu1';
    }
    rules += ' plf1';
    rules += ' Yd1';
    rules += ' Xb1';
    rules += ' _2b1';
    if (props.isStandalone) {
        if (props.isQuiet) {
            if (props.isFocusVisible) {
                rules += ' _Xb1';
                rules += ' __Va1';
            } else if (props.isHovered) {
                rules += ' _Xb1';
                rules += ' __Va1';
            } else rules += ' _Xa1';
        }
    } else {
        rules += ' _Xb1';
        rules += ' __Va1';
    }
    rules += ' __ca1';
    return rules;
};
const $064658f378a85eef$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $7PkpH$react.forwardRef)(function Link(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $064658f378a85eef$export$e2509388b49734e7);
    let { variant: variant = 'primary', staticColor: staticColor, isQuiet: isQuiet, isStandalone: isStandalone, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', styles: styles, children: children } = props;
    let domRef = (0, $7PkpH$reactspectrumutils.useFocusableRef)(ref);
    let isSkeleton = (0, $7PkpH$react.useContext)((0, $5eb75e0c130e0669$exports.SkeletonContext)) || false;
    [children, UNSAFE_style] = (0, $5eb75e0c130e0669$exports.useSkeletonText)(children, UNSAFE_style);
    (0, $7PkpH$reactariautils.useLayoutEffect)(()=>{
        if (domRef.current) // TODO: should RAC Link pass through inert?
        domRef.current.inert = isSkeleton;
    }, [
        domRef,
        isSkeleton
    ]);
    return /*#__PURE__*/ (0, $7PkpH$reactjsxruntime.jsx)((0, $7PkpH$reactariacomponents.Link), {
        ...props,
        ref: domRef,
        style: UNSAFE_style,
        className: (renderProps)=>UNSAFE_className + $064658f378a85eef$var$link({
                ...renderProps,
                variant: variant,
                staticColor: staticColor,
                isStaticColor: !!staticColor,
                isQuiet: isQuiet,
                isStandalone: isStandalone,
                isSkeleton: isSkeleton
            }, styles),
        children: children
    });
});


//# sourceMappingURL=Link.cjs.map
