require("./DropZone.css");
var $55f1b8940d3e02db$exports = require("./IllustratedMessage.cjs");
var $4526404114e78c80$exports = require("./intlStrings.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $faaBC$reactjsxruntime = require("react/jsx-runtime");
var $faaBC$reactariacomponents = require("react-aria-components");
var $faaBC$react = require("react");
var $faaBC$reactspectrumutils = require("@react-spectrum/utils");
var $faaBC$reactariai18n = require("@react-aria/i18n");


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

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

$parcel$export(module.exports, "DropZoneContext", () => $797cda10ca96fc86$export$14a72053295ff9a6);
$parcel$export(module.exports, "DropZone", () => $797cda10ca96fc86$export$3c6489d84dc98b6);
/*
 * 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 $797cda10ca96fc86$export$14a72053295ff9a6 = /*#__PURE__*/ (0, $faaBC$react.createContext)(null);
const $797cda10ca96fc86$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 += ' sd11';
    rules += ' _Ca11';
    rules += ' eb11';
    if (!position) rules += ' _Pc11';
    rules += ' uk11';
    rules += ' ucJ9TBTb11';
    rules += ' ud3Euai11';
    rules += ' uea11';
    rules += ' ugb11';
    rules += ' uhd11';
    rules += ' uje11';
    rules += ' u2NhKxcl11';
    rules += ' uic11';
    rules += ' po11';
    if (props.isDropTarget) rules += ' _jf11';
    else rules += ' _ja11';
    if (props.isDropTarget) rules += ' g_e11';
    rules += ' _kc11';
    rules += ' hc11';
    rules += ' mc11';
    rules += ' lc11';
    if (props.isFocusVisible) rules += ' ix11';
    else if (props.isDropTarget) rules += ' ix11';
    else rules += ' iq11';
    rules += ' oc11';
    rules += ' nc11';
    rules += ' kc11';
    rules += ' jc11';
    rules += ' Th11';
    rules += ' Qh11';
    rules += ' Sh11';
    rules += ' Rh11';
    rules += ' _oa11';
    return rules;
};
const $797cda10ca96fc86$var$banner = function anonymous(props) {
    let rules = " ";
    rules += ' _Pa11';
    rules += ' _Er11';
    rules += ' _Rr11';
    rules += ' IM11';
    rules += ' HM11';
    rules += ' sd11';
    rules += ' eb11';
    rules += ' _Ca11';
    rules += ' MAyFGYc11';
    rules += ' ZJ11';
    if (props.size === "L") rules += ' Lg11';
    else if (props.size === "S") rules += ' Le11';
    else rules += ' Lf11';
    rules += ' g211';
    rules += ' ob11';
    rules += ' nb11';
    rules += ' kb11';
    rules += ' jb11';
    rules += ' px11';
    rules += ' xd11';
    rules += ' _xa11';
    rules += ' xX0cczbc11';
    rules += ' _xX0cczba11';
    rules += ' T85xBjb11';
    rules += ' Q85xBjb11';
    rules += ' S85xBjb11';
    rules += ' R85xBjb11';
    rules += ' -M_-Mf11';
    return rules;
};
const $797cda10ca96fc86$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $faaBC$react.forwardRef)(function DropZone(props, ref) {
    let stringFormatter = (0, $faaBC$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($4526404114e78c80$exports))), '@react-spectrum/s2');
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $797cda10ca96fc86$export$14a72053295ff9a6);
    let { size: size = 'M' } = props;
    let domRef = (0, $faaBC$reactspectrumutils.useDOMRef)(ref);
    return /*#__PURE__*/ (0, $faaBC$reactjsxruntime.jsx)((0, $faaBC$reactariacomponents.DropZone), {
        ...props,
        ref: domRef,
        style: props.UNSAFE_style,
        className: (renderProps)=>(props.UNSAFE_className || '') + $797cda10ca96fc86$var$dropzone(renderProps, props.styles),
        children: (renderProps)=>/*#__PURE__*/ (0, $faaBC$reactjsxruntime.jsxs)((0, $faaBC$reactjsxruntime.Fragment), {
                children: [
                    /*#__PURE__*/ (0, $faaBC$reactjsxruntime.jsx)((0, $55f1b8940d3e02db$exports.IllustratedMessageContext).Provider, {
                        value: {
                            isInDropZone: true,
                            isDropTarget: renderProps.isDropTarget,
                            size: size
                        },
                        children: props.children
                    }),
                    renderProps.isDropTarget && props.isFilled && /*#__PURE__*/ (0, $faaBC$reactjsxruntime.jsx)("div", {
                        className: $797cda10ca96fc86$var$banner({
                            size: size
                        }),
                        children: /*#__PURE__*/ (0, $faaBC$reactjsxruntime.jsx)("span", {
                            children: props.replaceMessage ? props.replaceMessage : stringFormatter.format('dropzone.replaceMessage')
                        })
                    })
                ]
            })
    });
});


//# sourceMappingURL=DropZone.cjs.map
