const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_context = require("../../../context.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/appointmentBooking/components/Cart/Item/Total.tsx
const Total = ({ className, isFooter }) => {
	const { summary, symbolic } = require_context.useAppointmentBookingContext();
	const { taxTitle, totalTaxFee, isPriceIncludeTax, total, deposit } = summary;
	return /* @__PURE__ */ react.default.createElement("div", { className: `appointment-total-wrap ${className} ${(deposit === null || deposit === void 0 ? void 0 : deposit.hasDeposit) ? "appointment-total-deposit-wrap" : ""}` }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ react.default.createElement("div", { className: "gst-wrap" }, /* @__PURE__ */ react.default.createElement("span", null, taxTitle, isFooter ? ": " : ""), /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText.Amount, {
		value: totalTaxFee,
		showCurrencySymbol: true
	})) : null, /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)("event-total", { [["total-gst-wrap"]]: !isPriceIncludeTax && Number(totalTaxFee) > 0 }) }, /* @__PURE__ */ react.default.createElement("div", { className: "left" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("span", null, (deposit === null || deposit === void 0 ? void 0 : deposit.hasDeposit) && isFooter ? _pisell_utils.locales.getText("pisell2.appointment.deposit") : _pisell_utils.locales.getText("pisell2.event.total"), isFooter ? ": " : ""), isFooter ? /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText.Amount, {
		value: (deposit === null || deposit === void 0 ? void 0 : deposit.hasDeposit) ? deposit === null || deposit === void 0 ? void 0 : deposit.total : total,
		showCurrencySymbol: true,
		className: "event-amount"
	}) : null), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ react.default.createElement("span", { className: "gst" }, _pisell_utils.locales.getText("pisell2.event.total.gst")(`${isFooter ? `${taxTitle}: ` : taxTitle}`, `${symbolic}${totalTaxFee}`)) : null), !isFooter ? /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText.Amount, {
		value: total,
		showCurrencySymbol: true,
		className: "event-amount"
	}) : null));
};
//#endregion
exports.default = Total;
