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/components/pisellInput/components/BankCard/utils.ts
var utils_exports = {};
__export(utils_exports, {
  bankTypeMap: () => bankTypeMap,
  getBankCardTypeImg: () => getBankCardTypeImg,
  getCardImgByType: () => getCardImgByType,
  getCardType: () => getCardType
});
module.exports = __toCommonJS(utils_exports);
var import_JCB = __toESM(require("./cardPng/JCB.png"));
var import_AMEX = __toESM(require("./cardPng/AMEX.png"));
var import_MasterCard = __toESM(require("./cardPng/MasterCard.png"));
var import_VISA = __toESM(require("./cardPng/VISA.png"));
var import_UnionPay = __toESM(require("./cardPng/UnionPay.png"));
var import_Discover = __toESM(require("./cardPng/Discover.png"));
var isJcb = (str) => {
  return str.startsWith("35");
};
var isAmex = (str) => {
  return str.startsWith("34") || str.startsWith("37");
};
var isMasterCard = (str) => {
  return str.startsWith("51") || str.startsWith("52") || str.startsWith("53") || str.startsWith("54") || str.startsWith("55") || str.startsWith("22") || str.startsWith("23") || str.startsWith("24") || str.startsWith("25") || str.startsWith("26") || str.startsWith("27");
};
var isVisa = (str) => {
  return str.startsWith("4");
};
var isUnionPay = (str) => {
  return str.startsWith("62") || str.startsWith("81");
};
var isDiscover = (str) => {
  return str.startsWith("60") || str.startsWith("64") || str.startsWith("65");
};
var getCardType = (str) => {
  if (isJcb(str)) {
    return "jcb";
  }
  if (isAmex(str)) {
    return "amex";
  }
  if (isVisa(str)) {
    return "visa";
  }
  if (isMasterCard(str)) {
    return "masterCard";
  }
  if (isUnionPay(str)) {
    return "unionPay";
  }
  if (isDiscover(str)) {
    return "discover";
  }
};
var bankTypeMap = {
  jcb: import_JCB.default,
  amex: import_AMEX.default,
  masterCard: import_MasterCard.default,
  visa: import_VISA.default,
  unionPay: import_UnionPay.default,
  discover: import_Discover.default
};
var getCardImgByType = (type) => {
  return bankTypeMap[type] || "";
};
var getBankCardTypeImg = (val) => {
  const type = getCardType(`${val || ""}`);
  return type ? bankTypeMap[type] : null;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  bankTypeMap,
  getBankCardTypeImg,
  getCardImgByType,
  getCardType
});
