'use strict';

var tslib_es6 = require('./tslib.es6-725c4637.js');
var React = require('react');
var core = require('@mantine/core');
var dates = require('@mantine/dates');
var index = require('./index-fdbb9e7c.js');
require('./index-c4c60437.js');
var index$2 = require('./index-21f68464.js');
var index$1 = require('./index-7ba9a85c.js');
var Locale = require('./Locale-a7d28fb5.js');

function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

// Omit<MantineDatePickerInputProps, 'value'>
const DatePicker = (_a) => {
    var _b;
    var { value, fullWidth = true } = _a, rest = tslib_es6.__rest(_a, ["value", "fullWidth"]);
    const theme = core.useMantineTheme();
    const isMarryBaby = theme.other.template === 'mb';
    const valueFormat = (_b = index.ISO_FORMAT[process.env.UNIFY_LOCALE || Locale.LOCALE.Vietnam]) === null || _b === void 0 ? void 0 : _b.dateFormat;
    return (React__default["default"].createElement(dates.DatePickerInput, Object.assign({ locale: index$1.MAPPED_LOCALE[process.env.UNIFY_LOCALE || Locale.LOCALE.Vietnam], valueFormat: valueFormat, size: "md", clearable: false, popoverProps: fullWidth
            ? {
                styles: {
                    dropdown: {
                        minWidth: '100%',
                        display: 'flex',
                        justifyContent: 'center',
                        alignItems: 'center',
                    },
                },
            }
            : {}, styles: {
            root: {
                position: 'relative',
            },
            rightSection: { pointerEvents: 'none', cursor: 'default' },
        }, rightSection: React__default["default"].createElement(core.Image, { src: index$2.CommonGAssets.getAssetPath(isMarryBaby ? 'MB-calendar.svg' : 'OutlineCalendar.svg'), width: 18, height: 18 }), value: value, placeholder: valueFormat }, rest, { className: `input-control ${(rest === null || rest === void 0 ? void 0 : rest.className) || ''}` })));
};

exports.DatePicker = DatePicker;
