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/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.ts
var serve_exports = {};
__export(serve_exports, {
  defaultCodes: () => defaultCodes,
  getCountries: () => getCountries
});
module.exports = __toCommonJS(serve_exports);
var import_utils = require("../../../../../utils");
var import_utils2 = require("@pisell/utils");
var formatData = (data) => {
  return data.map((item, i) => {
    return {
      label: `${item.name} (+${item.calling_code})`,
      value: "+" + item.calling_code,
      key: i
    };
  });
};
var defaultCodes = formatData([
  {
    "name": "Mexico",
    "code": "MX",
    "calling_code": "52",
    "currency_code": "MXN"
  },
  {
    "name": "美国",
    "code": "US",
    "calling_code": "1",
    "currency_code": "USD"
  },
  {
    "name": "加拿大",
    "code": "CA",
    "calling_code": "1",
    "currency_code": "CAD"
  },
  {
    "name": "澳大利亚",
    "code": "AU",
    "calling_code": "61",
    "currency_code": "AUD"
  },
  {
    "name": "新西兰",
    "code": "NZ",
    "calling_code": "64",
    "currency_code": "NZD"
  },
  {
    "name": "新加坡",
    "code": "SG",
    "calling_code": "65",
    "currency_code": "SGD"
  },
  {
    "name": "香港特别行政区",
    "code": "HK",
    "calling_code": "852",
    "currency_code": "HKD"
  },
  {
    "name": "中国",
    "code": "CN",
    "calling_code": "86",
    "currency_code": "AUD"
  },
  {
    "name": "日本",
    "code": "JP",
    "calling_code": "81",
    "currency_code": "JPY"
  },
  {
    "name": "马来西亚",
    "code": "MY",
    "calling_code": "60",
    "currency_code": "USD"
  },
  {
    "name": "英国",
    "code": "GB",
    "calling_code": "44",
    "currency_code": "GBP"
  },
  {
    "name": "法国",
    "code": "FR",
    "calling_code": "33",
    "currency_code": "EUR"
  },
  {
    "name": "意大利",
    "code": "IT",
    "calling_code": "39",
    "currency_code": "EUR"
  },
  {
    "name": "Ireland",
    "code": "IE",
    "calling_code": "353",
    "currency_code": "EUR"
  },
  {
    "name": "Netherlands",
    "code": "NL",
    "calling_code": "31",
    "currency_code": "EUR"
  },
  {
    "name": "Germany",
    "code": "DE",
    "calling_code": "49",
    "currency_code": "EUR"
  },
  {
    "name": "Spain",
    "code": "ES",
    "calling_code": "34",
    "currency_code": "EUR"
  },
  {
    "name": "India",
    "code": "IND",
    "calling_code": "91",
    "currency_code": "INR"
  },
  {
    "name": "Nigeria",
    "code": "NG",
    "calling_code": "234",
    "currency_code": "NGN"
  },
  {
    "name": "Islamic Republic of Pakistan‎",
    "code": "PAK",
    "calling_code": "92",
    "currency_code": "PRK"
  },
  {
    "name": "Philippines",
    "code": "PH",
    "calling_code": "63",
    "currency_code": "PHP"
  },
  {
    "name": "Thailand",
    "code": "TH",
    "calling_code": "66",
    "currency_code": "THB"
  },
  {
    "name": "South Africa",
    "code": "ZA",
    "calling_code": "27",
    "currency_code": "ZAR"
  }
]);
var getCountries = async (params) => {
  import_utils.request.getRequest().get("/shop/area/country", { "translate-locale": import_utils2.locales.formatLocale(localStorage.getItem("umi_locale") || "en") }, { abort: true, useCache: true }).then((res) => {
    localStorage.setItem("pisell2_data_countries", JSON.stringify(formatData(res.data || [])));
  });
  let data = localStorage.getItem("pisell2_data_countries");
  if (data) {
    data = JSON.parse(data);
    return data;
  } else {
    return defaultCodes;
  }
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  defaultCodes,
  getCountries
});
