import "./DropZone.css";
import {IllustratedMessageContext as $4950413ac998f607$export$d661ef89ad42d682} from "./IllustratedMessage.mjs";
import $4h9kk$intlStringsmjs from "./intlStrings.mjs";
import {useDOMRef as $80ecb974df713a30$export$c2c55ef9111cafd8} from "./useDOMRef.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../../icons/useSpectrumContextProps.mjs";
import {jsx as $4h9kk$jsx, jsxs as $4h9kk$jsxs, Fragment as $4h9kk$Fragment} from "react/jsx-runtime";
import {createContext as $4h9kk$createContext, forwardRef as $4h9kk$forwardRef} from "react";
import {DropZone as $4h9kk$DropZone} from "react-aria-components/DropZone";
import {useLocalizedStringFormatter as $4h9kk$useLocalizedStringFormatter} from "react-aria/useLocalizedStringFormatter";


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
/*
 * 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 $fb6e45fba2483f65$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $4h9kk$createContext)(null);
const $fb6e45fba2483f65$var$dropzone = function anonymous(props, overrides) {
    let rules = " ";
    let position = 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|F|M|K)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "_P") position = true;
        rules += p[0];
    }
    rules += ' sd12';
    rules += ' _Ca12';
    rules += ' eb12';
    if (!position) rules += ' _Pc12';
    rules += ' uk12';
    rules += ' ucJ9TBTb12';
    rules += ' ud3Euai12';
    rules += ' uea12';
    rules += ' ugb12';
    rules += ' uhd12';
    rules += ' uje12';
    rules += ' u2NhKxcl12';
    rules += ' uic12';
    rules += ' po12';
    if (props.isDropTarget) rules += ' _jf12';
    else rules += ' _ja12';
    if (props.isDropTarget) rules += ' g_e12';
    rules += ' _kc12';
    rules += ' hc12';
    rules += ' mc12';
    rules += ' lc12';
    if (props.isFocusVisible) rules += ' ix12';
    else if (props.isDropTarget) rules += ' ix12';
    else rules += ' iq12';
    rules += ' oc12';
    rules += ' nc12';
    rules += ' kc12';
    rules += ' jc12';
    rules += ' Th12';
    rules += ' Qh12';
    rules += ' Sh12';
    rules += ' Rh12';
    rules += ' _oa12';
    return rules;
};
const $fb6e45fba2483f65$var$banner = function anonymous(props) {
    let rules = " ";
    rules += ' _Pa12';
    rules += ' _Er12';
    rules += ' _Rr12';
    rules += ' IM12';
    rules += ' HM12';
    rules += ' sd12';
    rules += ' eb12';
    rules += ' _Ca12';
    rules += ' MAyFGYc12';
    rules += ' ZJ12';
    if (props.size === "L") rules += ' Lg12';
    else if (props.size === "S") rules += ' Le12';
    else rules += ' Lf12';
    rules += ' g212';
    rules += ' ob12';
    rules += ' nb12';
    rules += ' kb12';
    rules += ' jb12';
    rules += ' px12';
    rules += ' xd12';
    rules += ' _xa12';
    rules += ' xX0cczbc12';
    rules += ' _xX0cczba12';
    rules += ' T85xBjb12';
    rules += ' Q85xBjb12';
    rules += ' S85xBjb12';
    rules += ' R85xBjb12';
    rules += ' -M_-Mf12';
    return rules;
};
const $fb6e45fba2483f65$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $4h9kk$forwardRef)(function DropZone(props, ref) {
    let stringFormatter = (0, $4h9kk$useLocalizedStringFormatter)((0, ($parcel$interopDefault($4h9kk$intlStringsmjs))), '@react-spectrum/s2');
    [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $fb6e45fba2483f65$export$14a72053295ff9a6);
    let { size: size = 'M' } = props;
    let domRef = (0, $80ecb974df713a30$export$c2c55ef9111cafd8)(ref);
    return /*#__PURE__*/ (0, $4h9kk$jsx)((0, $4h9kk$DropZone), {
        ...props,
        ref: domRef,
        style: props.UNSAFE_style,
        className: (renderProps)=>(props.UNSAFE_className || '') + $fb6e45fba2483f65$var$dropzone(renderProps, props.styles),
        children: (renderProps)=>/*#__PURE__*/ (0, $4h9kk$jsxs)((0, $4h9kk$Fragment), {
                children: [
                    /*#__PURE__*/ (0, $4h9kk$jsx)((0, $4950413ac998f607$export$d661ef89ad42d682).Provider, {
                        value: {
                            isInDropZone: true,
                            isDropTarget: renderProps.isDropTarget,
                            size: size
                        },
                        children: props.children
                    }),
                    renderProps.isDropTarget && props.isFilled && /*#__PURE__*/ (0, $4h9kk$jsx)("div", {
                        className: $fb6e45fba2483f65$var$banner({
                            size: size
                        }),
                        children: /*#__PURE__*/ (0, $4h9kk$jsx)("span", {
                            children: props.replaceMessage ? props.replaceMessage : stringFormatter.format('dropzone.replaceMessage')
                        })
                    })
                ]
            })
    });
});


export {$fb6e45fba2483f65$export$14a72053295ff9a6 as DropZoneContext, $fb6e45fba2483f65$export$3c6489d84dc98b6 as DropZone};
//# sourceMappingURL=DropZone.mjs.map
