var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/saleDetail/tmpl/A/index.tsx
var A_exports = {};
__export(A_exports, {
  SaleDetailTemplateA: () => SaleDetailTemplateA
});
module.exports = __toCommonJS(A_exports);
var import_react = __toESM(require("react"));
var import_materials = require("@pisell/materials");
var import_components = require("../../components");
var import_hooks = require("../../hooks");
var import_index = require("./index.less");
function SaleDetailTemplateAMain({ dataSource }) {
  var _a, _b;
  return /* @__PURE__ */ import_react.default.createElement("main", { className: "pisell-sale-detail-main" }, /* @__PURE__ */ import_react.default.createElement(import_components.Client, { dataSource: dataSource.customer.selected }), ((_a = dataSource.sales.tempOrder) == null ? void 0 : _a.note) ? /* @__PURE__ */ import_react.default.createElement(import_components.OrderNote, { dataSource: dataSource.sales.tempOrder.note }) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-sale-detail-scroll-content" }, /* @__PURE__ */ import_react.default.createElement(import_components.Contact, { dataSource: (_b = dataSource.sales.tempOrder) == null ? void 0 : _b.contacts_info }), /* @__PURE__ */ import_react.default.createElement(import_components.CartItems, { dataSource: dataSource.cart, sales: dataSource.sales })));
}
function SaleDetailTemplateA({ dataSource }) {
  const actionButtonGroupList = (0, import_hooks.useSaleDetailActions)({
    dataSource,
    actions: [
      {
        name: "print-receipts",
        row: 1,
        order: 10
      },
      {
        name: "edit",
        row: 1,
        order: 20
      },
      {
        name: "cancel",
        row: 1,
        order: 30
      },
      {
        name: "checkout",
        row: 2,
        order: 40
      }
    ]
  });
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-sale-detail-tmpl-a" }, /* @__PURE__ */ import_react.default.createElement(
    import_components.SaleOverview,
    {
      className: "pisell-sale-detail-tmpl-overview",
      dataSource
    }
  ), /* @__PURE__ */ import_react.default.createElement("main", { className: "pisell-sale-detail-tmpl-body" }, /* @__PURE__ */ import_react.default.createElement("section", { className: "pisell-sale-detail-tmpl-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-sale-detail-inline-layout" }, /* @__PURE__ */ import_react.default.createElement(SaleDetailTemplateAMain, { dataSource }), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-sale-detail-footer" }, /* @__PURE__ */ import_react.default.createElement(
    import_components.AmountDetails,
    {
      dataSource: {
        sales: dataSource.sales,
        summary: dataSource.summary
      }
    }
  ), actionButtonGroupList.length ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-sale-detail-button-actions" }, /* @__PURE__ */ import_react.default.createElement(import_materials.ButtonGroupPreview, { buttonGroupList: actionButtonGroupList })) : null)))));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  SaleDetailTemplateA
});
