import "./Modal.css";
import {ColorSchemeContext as $9affbfa4e13b9582$export$374e0245597d19a3} from "./Provider.mjs";
import {jsx as $fdAcL$jsx} from "react/jsx-runtime";
import {forwardRef as $fdAcL$forwardRef, useContext as $fdAcL$useContext, useCallback as $fdAcL$useCallback} from "react";
import {useLocale as $fdAcL$useLocale, ModalOverlay as $fdAcL$ModalOverlay, Modal as $fdAcL$Modal} from "react-aria-components";
import {useDOMRef as $fdAcL$useDOMRef} from "@react-spectrum/utils";

/*
 * 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 $c46d159bd615e407$var$modalOverlayStyles = function anonymous(props) {
    let rules = " ";
    if (props.colorScheme === "dark") rules += ' _pa12';
    else if (props.colorScheme === "light") rules += ' _pb12';
    else if (props.colorScheme === "light dark") rules += ' _pc12';
    else rules += ' _pN79Hzc12';
    rules += ' _Pa12';
    rules += ' Wr12';
    rules += ' _Er12';
    rules += ' Za12';
    rules += ' FKem6Ob12';
    rules += ' _Bb12';
    rules += ' g812';
    if (props.isExiting) rules += ' _Ia12';
    else if (props.isEntering) rules += ' _Ia12';
    rules += ' Yf12';
    if (props.isExiting) rules += ' Xa12';
    else rules += ' Xd12';
    rules += ' _2b12';
    return rules;
};
const $c46d159bd615e407$var$modalWrapper = function anonymous(props) {
    let rules = " ";
    rules += ' _Pe12';
    rules += ' Wr12';
    rules += ' _Er12';
    rules += ' Za12';
    rules += ' FE9bXU12';
    rules += ' sd12';
    if (props.size === "fullscreenTakeover") rules += ' ed12';
    else rules += ' eb12';
    rules += ' _Ca12';
    return rules;
};
const $c46d159bd615e407$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $fdAcL$forwardRef)(function Modal(props1, ref) {
    let domRef = (0, $fdAcL$useDOMRef)(ref);
    let colorScheme = (0, $fdAcL$useContext)((0, $9affbfa4e13b9582$export$374e0245597d19a3));
    let { locale: locale, direction: direction } = (0, $fdAcL$useLocale)();
    // TODO: should we pass through lang and dir props in RAC?
    let modalRef = (0, $fdAcL$useCallback)((el)=>{
        domRef.current = el;
        if (el) {
            el.lang = locale;
            el.dir = direction;
        }
    }, [
        locale,
        direction,
        domRef
    ]);
    return /*#__PURE__*/ (0, $fdAcL$jsx)((0, $fdAcL$ModalOverlay), {
        ...props1,
        className: (renderProps)=>$c46d159bd615e407$var$modalOverlayStyles({
                ...renderProps,
                colorScheme: colorScheme
            }),
        children: /*#__PURE__*/ (0, $fdAcL$jsx)("div", {
            className: $c46d159bd615e407$var$modalWrapper({
                size: props1.size
            }),
            style: {
                containerType: 'size'
            },
            children: /*#__PURE__*/ (0, $fdAcL$jsx)((0, $fdAcL$Modal), {
                ...props1,
                ref: modalRef,
                className: (renderProps)=>(function anonymous(props) {
                        let rules = " ";
                        rules += ' sd12';
                        rules += ' _ta12';
                        if (props.size === "fullscreenTakeover") rules += ' od12';
                        else rules += ' oe12';
                        if (props.size === "fullscreenTakeover") rules += ' nd12';
                        else rules += ' ne12';
                        if (props.size === "fullscreenTakeover") rules += ' kd12';
                        else rules += ' ke12';
                        if (props.size === "fullscreenTakeover") rules += ' jd12';
                        else rules += ' je12';
                        if (props.size === "fullscreenTakeover") rules += ' Za12';
                        else if (props.size === "fullscreen") rules += ' ZGqsG7b12';
                        else if (props.size === "XL") rules += ' ZbRWaYd12';
                        else if (props.size === "L") rules += ' Zb4QY412';
                        else if (props.size === "M") rules += ' ZILqIYb12';
                        else if (props.size === "S") rules += ' ZA12';
                        if (props.size === "fullscreenTakeover") rules += ' Fb12';
                        else if (props.size === "fullscreen") rules += ' FGqsG7b12';
                        if (props.size === "fullscreenTakeover") rules += ' Lp12';
                        else if (props.size === "fullscreen") rules += ' Lp12';
                        else rules += ' Lc12';
                        if (props.size === "fullscreenTakeover") rules += ' Ki12';
                        else if (props.size === "fullscreen") rules += ' Ki12';
                        else rules += ' KjVOfn12';
                        if (props.size === "fullscreenTakeover") rules += ' QILlin12';
                        rules += ' -Ovbhqd-g_g12';
                        rules += ' gEzkoQe12';
                        if (props.isExiting) rules += ' _Ia12';
                        else if (props.isEntering) rules += ' _Ia12';
                        if (props.isEntering) {
                            rules += ' -_8PloMd-w12';
                            rules += ' __Ya12';
                        }
                        rules += ' YmenWad12';
                        if (props.isExiting) rules += ' Xa12';
                        else rules += ' Xd12';
                        rules += ' _2b12';
                        if (props.isExiting) rules += ' _1a12';
                        else rules += ' _1b12';
                        rules += ' _Lf12';
                        rules += ' _Mb12';
                        rules += ' Oj12';
                        return rules;
                    })({
                        ...renderProps,
                        size: props1.size
                    })
            })
        })
    });
});


export {$c46d159bd615e407$export$2b77a92f1a5ad772 as Modal};
//# sourceMappingURL=Modal.mjs.map
