import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import CompensatedPisellContainer from "../../../../pro/compensatedPisellContainer/index.js";
import withResponsive from "../../../../responsive/withResponsive.js";
import VoucherCard from "../voucher/index.js";
import React from "react";
import "./index.less";
//#region src/components/booking/components/voucherModal/index.tsx
const VoucherModal = ({ visible, onClose, state, dispatch, source, variant }) => {
	var _state$service, _state$addons, _state$client;
	const isPhoneVariant = variant === "phone";
	return /* @__PURE__ */ React.createElement(CompensatedPisellContainer, {
		renderType: isPhoneVariant ? "drawer" : "modal",
		showHandlerBar: isPhoneVariant,
		onHandlerBarClick: onClose,
		props: isPhoneVariant ? {
			title: null,
			open: visible,
			placement: "bottom",
			width: "100%",
			height: "auto",
			onClose,
			footer: null,
			className: `pisell-voucher-modal ${!visible ? "pisell-voucher-modal--hidden" : ""}`,
			bodyStyle: { padding: "0 12px calc(12px + env(safe-area-inset-bottom))" },
			forceRender: true
		} : {
			title: null,
			open: visible,
			onCancel: onClose,
			footer: null,
			width: 600,
			className: `pisell-voucher-modal ${!visible ? "pisell-voucher-modal--hidden" : ""}`,
			forceRender: true
		}
	}, /* @__PURE__ */ React.createElement("div", { className: "pisell-voucher-modal-content" }, /* @__PURE__ */ React.createElement(VoucherCard, {
		state: _objectSpread2(_objectSpread2({}, state), {}, {
			service: _objectSpread2(_objectSpread2({}, state.service || {}), {}, { value: ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || [] }),
			addons: _objectSpread2(_objectSpread2({}, state.addons || {}), {}, { value: ((_state$addons = state.addons) === null || _state$addons === void 0 ? void 0 : _state$addons.value) || [] }),
			client: _objectSpread2(_objectSpread2({}, state.client || {}), {}, { value: ((_state$client = state.client) === null || _state$client === void 0 ? void 0 : _state$client.value) || {} })
		}),
		dispatch,
		source,
		isInModal: true
	})));
};
VoucherModal.displayName = "VoucherModal";
var voucherModal_default = withResponsive(VoucherModal);
//#endregion
export { voucherModal_default as default };
