const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
const require_useEngineContext = require("../../../../../../hooks/useEngineContext.js");
const require_index = require("../../../../../Sales/Cart/index.js");
const require_index$1 = require("../../../../../Sales/Summary/index.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/eventBooking/components/Provider/Cart/Item/Total.tsx
const Total = ({ className, isFooter }) => {
	var _context$appHelper, _context$appHelper$ge, _cartData$cartItems, _cartData$cartItems2, _context$appHelper2, _context$appHelper2$g;
	const { cartData } = require_index.useCart();
	const { taxTitle, totalTaxFee, isPriceIncludeTax, total, deposit } = require_index$1.useSummary();
	const context = require_useEngineContext.default();
	console.log(taxTitle, isPriceIncludeTax, totalTaxFee, total, context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getSymbolic) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper), deposit, "wh97978");
	const showDeposit = (cartData === null || cartData === void 0 || (_cartData$cartItems = cartData.cartItems) === null || _cartData$cartItems === void 0 ? void 0 : _cartData$cartItems.length) > 0 && (deposit === null || deposit === void 0 ? void 0 : deposit.hasDeposit);
	return /* @__PURE__ */ react.default.createElement("div", { className: `event-total-wrap ${className}` }, !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, isFooter && showDeposit ? _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: (cartData === null || cartData === void 0 || (_cartData$cartItems2 = cartData.cartItems) === null || _cartData$cartItems2 === void 0 ? void 0 : _cartData$cartItems2.length) > 0 && (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}`, `${context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 || (_context$appHelper2$g = _context$appHelper2.getSymbolic) === null || _context$appHelper2$g === void 0 ? void 0 : _context$appHelper2$g.call(_context$appHelper2)}${totalTaxFee}`)) : null), !isFooter ? /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText.Amount, {
		value: total,
		showCurrencySymbol: true,
		className: "event-amount"
	}) : null));
};
//#endregion
exports.default = Total;
