var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/solution/BookingTicket/utils/scan/formatGlobalScan.ts
var formatGlobalScan_exports = {};
__export(formatGlobalScan_exports, {
  formatGlobalScanResult: () => formatGlobalScanResult
});
module.exports = __toCommonJS(formatGlobalScan_exports);
function formatGlobalScanResult(raw, scanCode) {
  var _a;
  if (!(raw == null ? void 0 : raw.searchType))
    return null;
  const { searchType } = raw;
  const { data: resultData, code } = raw.response || {};
  if (code !== 200 && searchType !== "local_product") {
    return null;
  }
  if (searchType === "wallet") {
    return { searchType, data: resultData == null ? void 0 : resultData.customer, scanCode };
  }
  if (searchType === "walletPass") {
    return { searchType, data: (_a = resultData == null ? void 0 : resultData[0]) == null ? void 0 : _a.customer, scanCode };
  }
  if (searchType === "product" || searchType === "local_product") {
    return { searchType, data: resultData, scanCode };
  }
  if (searchType === "order") {
    return { searchType, data: resultData, scanCode };
  }
  return null;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  formatGlobalScanResult
});
