require("./Link.css");
var $5eb75e0c130e0669$exports = require("../../icons/Skeleton.cjs");
var $150382364eecc4bc$exports = require("./useDOMRef.cjs");
var $ac757a4c2bd72aee$exports = require("../../icons/useSpectrumContextProps.cjs");
var $7PkpH$reactjsxruntime = require("react/jsx-runtime");
var $7PkpH$react = require("react");
var $7PkpH$reactariacomponentsLink = require("react-aria-components/Link");
var $7PkpH$reactariaprivateutilsuseLayoutEffect = require("react-aria/private/utils/useLayoutEffect");


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 += (String(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 += ' _Lf12';
    else rules += ' _Le12';
    if (props.isStaticColor) rules += ' Oe12';
    else rules += ' Oh12';
    rules += ' Olc12';
    rules += ' _Mc12';
    rules += ' _Kd12';
    if (props.staticColor === "white") rules += ' -Ovbhqd-gcwrnr12';
    else if (props.staticColor === "black") rules += ' -Ovbhqd-g4hn3s12';
    rules += ' oa12';
    rules += ' na12';
    rules += ' ka12';
    rules += ' ja12';
    if (props.isStandalone) {
        rules += ' uk12';
        rules += ' ucJ9TBTb12';
        rules += ' ud3Euai12';
        rules += ' uea12';
        rules += ' ugb12';
        rules += ' uhd12';
        rules += ' uje12';
        rules += ' u2NhKxcl12';
        rules += ' uic12';
    }
    if (props.isStandalone) {
        rules += ' -_6BNtrc-c12';
        rules += ' vx12';
    }
    if (props.isStandalone) {
        rules += ' xc12';
        rules += ' _xa12';
    }
    if (props.isStandalone) {
        rules += ' _Fd12';
        rules += ' _FnuYUweb12';
    }
    if (props.isStaticColor) rules += ' pl12';
    else if (props.variant === "secondary") {
        if (props.isPressed) rules += ' po12';
        else if (props.isFocusVisible) rules += ' po12';
        else if (props.isHovered) rules += ' po12';
        else rules += ' pt12';
    } else if (props.variant === "primary") {
        if (props.isPressed) rules += ' ps12';
        else if (props.isFocusVisible) rules += ' ps12';
        else if (props.isHovered) rules += ' ps12';
        else rules += ' pu12';
    }
    rules += ' plf12';
    rules += ' Yd12';
    rules += ' Xb12';
    rules += ' _2b12';
    if (props.isStandalone) {
        if (props.isQuiet) {
            if (props.isFocusVisible) {
                rules += ' _Xb12';
                rules += ' __Va12';
            } else if (props.isHovered) {
                rules += ' _Xb12';
                rules += ' __Va12';
            } else rules += ' _Xa12';
        }
    } else {
        rules += ' _Xb12';
        rules += ' __Va12';
    }
    rules += ' __ca12';
    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, $150382364eecc4bc$exports.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$reactariaprivateutilsuseLayoutEffect.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$reactariacomponentsLink.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
