// ../shared/src/lib/currency-converter/constants.ts
var CURRENCY_RECORD = {
  AFN: "Afghan Afghani",
  ALL: "Albanian Lek",
  DZD: "Algerian Dinar",
  AOA: "Angolan Kwanza",
  ARS: "Argentine Peso",
  AMD: "Armenian Dram",
  AWG: "Aruban Florin",
  AUD: "Australian Dollar",
  AZN: "Azerbaijani M anat",
  BSD: "Bahamian Dollar",
  BHD: "Bahraini Dinar",
  BBD: "Bajan Dollar",
  BDT: "Bangladeshi Taka",
  BYN: "Belarusian Ruble",
  BZD: "Belize Dollar",
  BMD: "Bermudan Dollar",
  BTN: "Bhutan currency",
  BOB: "Bolivian Boliviano",
  BAM: "Bosnia-Herzegovina Convertible Mark",
  BWP: "Botswanan Pula",
  BRL: "Brazilian Real",
  BND: "Brunei Dollar",
  BGN: "Bulgarian Lev",
  BIF: "Burundian Fra nc",
  XPF: "CFP Franc",
  KHR: "Cambodian riel",
  CAD: "Canadian Dollar",
  CVE: "Cape Verdean Escudo",
  KYD: "Cayman Islands Dollar",
  FCFA: "Central African CFA Franc",
  CLP: "Chilean Peso",
  CLF: "Chilean Unit of Account (UF)",
  CNY: "Chinese Yuan",
  COP: "Colombian Peso",
  KMF: "Comorian Franc",
  CDF: "Congolese Franc",
  CRC: "Costa Rican Col\xF3n",
  HRK: "Croatian Kuna",
  CUC: "Cuban Peso",
  CZK: "Czech Koruna",
  DKK: "Danish Krone",
  DJF: "Djiboutian Franc",
  DOP: "Dominican Pe so",
  XCD: "East Caribbean Dollar",
  EGP: "Egyptian Pound",
  ETB: "Ethiopian Birr",
  FJD: "Fijian Dollar",
  GMD: "Gambian dalasi",
  GEL: "Georgian Lari",
  GHS: "Ghanaian Cedi",
  GTQ: "Guatemalan Quetzal",
  GNF: "Guinean Franc",
  GYD: "Guyanaese Dollar",
  HTG: "Haitian Gourde",
  HNL: "Honduran Lempira",
  HKD: "Hong Kong Dollar",
  HUF: "Hungarian Forint",
  ISK: "Icelandic Kr\xF3na",
  INR: "Indian Rupee",
  IDR: "Indonesian Rupiah",
  IRR: "Iranian Rial",
  IQD: "Iraqi Dinar",
  ILS: "Israeli New Shekel",
  JMD: "Jamaican Dollar",
  JPY: "Japanese Yen",
  JOD: "Jordanian Dinar",
  KZT: "Kazakhstani Tenge",
  KES: "Kenyan Shilling",
  KWD: "Kuwaiti Dinar",
  KGS: "Kyrgystani Som",
  LAK: "Laotian Kip",
  LBP: "Lebanese pound",
  LSL: "Lesotho Loti",
  LRD: "Liberian Dollar",
  LYD: "Libyan Dinar",
  MOP: "Macanese Pataca",
  MKD: "Macedonian Denar",
  MGA: "Malagasy Ariary",
  MWK: "Malawian Kwacha",
  MYR: "Malaysian Ringgit",
  MVR: "Maldivian Rufiyaa",
  MRO: "Mauritanian Ouguiya",
  MUR: "Mauritian Rupee",
  MXN: "Mexican Peso",
  MDL: "Moldovan Leu",
  MAD: "Moroccan Dirham",
  MZN: "Mozambican metical",
  MMK: "Myanmar Kyat",
  NAD: "Namibian dol lar",
  NPR: "Nepalese Rupee",
  ANG: "Netherlands Antillean Guilder",
  NZD: "New Zealand Dollar",
  NIO: "Nicaraguan C\xF3rdoba",
  NGN: "Nigerian Naira",
  NOK: "Norwegian Krone",
  OMR: "Omani Rial",
  PKR: "Pakistani Rupee",
  PAB: "Panamanian Balboa",
  PGK: "Papua New Guinean Kina",
  PYG: "Paraguayan Guarani",
  PHP: "Philippine peso",
  PLN: "Poland Z\u0142oty",
  GBP: "Pound sterling",
  QAR: "Qatari Rial",
  RON: "Romania n Leu",
  RUB: "Russian Ruble",
  RWF: "Rwandan franc",
  SVC: "Salvadoran Col\xF3n",
  SAR: "Saudi Riyal",
  RSD: "Serbian Dinar",
  SCR: "Seychellois Rupee",
  SLL: "Sierra Leonean Leone",
  SGD: "Singapore Dollar",
  SBD: "Solomon Islands Dollar",
  SOS: "Somali Shilling",
  ZAR: "South African Rand",
  KRW: "South Korean won",
  VES: "Sovereign Bolivar",
  LKR: "Sri Lankan Rupee",
  SDG: "Sudanese pound",
  SRD: "Surinamese Dollar",
  SZL: "Swazi Lilangeni",
  SEK: "Swedish Krona",
  CF: "Swiss Franc",
  CHF: "Swiss Franc",
  TJS: "Tajikistani Somoni",
  TZS: "Tanzanian Shilling",
  THB: "Thai Baht",
  TOP: 'Tongan Pa"anga',
  TTD: "Trinidad and Tobago Dollar",
  TND: "Tunisian Dinar",
  TRY: "Turkish lira",
  TMT: "Turkmenistan manat",
  UGX: "Ugandan Shilling",
  UAH: "Ukrainian hryvnia",
  AED: "United Arab Emirates Dirham",
  USD: "United States Dollar",
  UYU: "Uruguayan Peso",
  UZS: "Uzbekistani Som",
  VND: "Vietnamese dong",
  XOF: "West African CFA franc",
  YER: "Yemeni Rial",
  ZMW: "Zambian Kwacha",
  XBT: "Bitcoin",
  ETH: "Ether",
  EUR: "Euro",
  LTC: "Litecoin",
  TWD: "NT$",
  PEN: "Peruvian Sol"
};
var CURRENCY_CODES = Object.keys(CURRENCY_RECORD);

// ../shared/src/lib/currency-converter/currency-converter.ts
import axios from "axios";
var CurrencyConverter = class {
  currencyRecord = CURRENCY_RECORD;
  currencyCodes = CURRENCY_CODES;
  currencyFrom;
  currencyTo;
  currencyAmount;
  convertedValue;
  isDecimalComma;
  isRatesCaching;
  ratesCacheDuration;
  ratesCache;
  constructor(options = {}) {
    this.currencyFrom = "";
    this.currencyTo = "";
    this.currencyAmount = 1;
    this.convertedValue = 0;
    this.isDecimalComma = false;
    this.isRatesCaching = false;
    this.ratesCacheDuration = 0;
    this.ratesCache = {};
    if (options) {
      if (options.from) this.from(options.from);
      if (options.to) this.to(options.to);
      if (options.amount) this.amount(options.amount);
      if (options.isDecimalComma !== void 0) this.setDecimalComma(options.isDecimalComma);
    }
  }
  from(currencyFrom) {
    if (typeof currencyFrom !== "string") throw new TypeError("currency code should be a string");
    if (!this.currencyCodes.includes(currencyFrom)) throw new Error(`${currencyFrom} is not a valid currency code`);
    this.currencyFrom = currencyFrom.toUpperCase();
    return this;
  }
  to(currencyTo) {
    if (typeof currencyTo !== "string") throw new TypeError("currency code should be a string");
    if (!this.currencyCodes.includes(currencyTo)) throw new Error(`${currencyTo} is not a valid currency code`);
    this.currencyTo = currencyTo;
    return this;
  }
  amount(currencyAmount) {
    if (typeof currencyAmount !== "number") throw new TypeError("amount should be a number");
    if (currencyAmount <= 0) throw new Error("amount should be a positive number");
    this.currencyAmount = currencyAmount;
    return this;
  }
  setDecimalComma(isDecimalComma) {
    if (typeof isDecimalComma !== "boolean") throw new TypeError("isDecimalComma should be a boolean");
    this.isDecimalComma = isDecimalComma;
    return this;
  }
  replaceAll(text, queryString, replaceString) {
    let text_ = "";
    for (let i = 0; i < text.length; i++) {
      if (text[i] === queryString) {
        text_ += replaceString;
      } else {
        text_ += text[i];
      }
    }
    return text_;
  }
  setupRatesCache(ratesCacheOptions) {
    if (typeof ratesCacheOptions !== "object") throw new TypeError("ratesCacheOptions should be an object");
    if (ratesCacheOptions.isRatesCaching === void 0)
      throw new Error(`ratesCacheOptions should have a property called isRatesCaching`);
    if (typeof ratesCacheOptions.isRatesCaching !== "boolean")
      throw new TypeError("ratesCacheOptions.isRatesCaching should be a boolean");
    if (typeof ratesCacheOptions.ratesCacheDuration !== "number")
      throw new TypeError("ratesCacheOptions.ratesCacheDuration should be a number");
    if (ratesCacheOptions.ratesCacheDuration <= 0)
      throw new Error("ratesCacheOptions.ratesCacheDuration should be a positive number of seconds");
    this.isRatesCaching = ratesCacheOptions.isRatesCaching;
    if (!ratesCacheOptions.ratesCacheDuration)
      this.ratesCacheDuration = 3600;
    else this.ratesCacheDuration = ratesCacheOptions.ratesCacheDuration;
    return this;
  }
  async rates() {
    if (this.currencyFrom === this.currencyTo) return 1;
    const currencyPair = this.currencyFrom.toUpperCase() + "_" + this.currencyTo.toUpperCase();
    const now = /* @__PURE__ */ new Date();
    if (currencyPair in this.ratesCache && now < this.ratesCache[currencyPair].expiryDate) {
      return this.ratesCache[currencyPair].rate;
    }
    const response = await axios.get(
      `https://www.google.com/search?q=${this.currencyAmount}+${this.currencyFrom}+to+${this.currencyTo}+&hl=en`
    );
    const { load } = await import("cheerio");
    const $ = load(response.data);
    let ratesText = $(".dDoNo").text().split(" ")[0];
    if (this.isDecimalComma) {
      if (ratesText.includes(".")) ratesText = this.replaceAll(ratesText, ".", "");
      if (ratesText.includes(",")) ratesText = this.replaceAll(ratesText, ",", ".");
    } else {
      if (ratesText.includes(",")) ratesText = this.replaceAll(ratesText, ",", "");
    }
    const rates = parseFloat(ratesText) / this.currencyAmount;
    if (this.isRatesCaching) {
      this.addRateToRatesCache(currencyPair, rates);
    }
    return rates;
  }
  async convert(currencyAmount) {
    if (currencyAmount) {
      this.amount(currencyAmount);
    }
    if (!this.currencyFrom) throw new Error("currency code cannot be an empty string");
    if (!this.currencyTo) throw new Error("currency code cannot be an empty string");
    if (!this.currencyAmount) throw new Error("currency amount should be a positive value");
    const rates = await this.rates();
    this.convertedValue = rates * this.currencyAmount;
    return this.convertedValue;
  }
  getCurrencyName(currencyCode) {
    if (typeof currencyCode !== "string") throw new TypeError("currency code should be a string");
    if (!this.currencyCodes.includes(currencyCode)) throw new Error(`${currencyCode} is not a valid currency code`);
    return this.currencyRecord[currencyCode];
  }
  addRateToRatesCache(currencyPair, rate) {
    if (typeof currencyPair !== "string") throw new TypeError("currency pair should be a string");
    if (typeof rate !== "number") throw new TypeError("rate should be a number");
    const now = /* @__PURE__ */ new Date();
    if (currencyPair in this.ratesCache) {
      if (now > this.ratesCache[currencyPair].expiryDate) {
        const newExpiry = /* @__PURE__ */ new Date();
        newExpiry.setSeconds(newExpiry.getSeconds() + this.ratesCacheDuration);
        this.ratesCache[currencyPair] = {
          rate,
          expiryDate: newExpiry
        };
      }
    } else {
      const newExpiry = /* @__PURE__ */ new Date();
      newExpiry.setSeconds(newExpiry.getSeconds() + this.ratesCacheDuration);
      this.ratesCache[currencyPair] = {
        rate,
        expiryDate: newExpiry
      };
    }
  }
};
var defaultCurrencyConverter = new CurrencyConverter();

// ../shared/src/lib/format/helper.ts
var getDefaultDateFormat = () => {
  const now = /* @__PURE__ */ new Date();
  const options = {
    year: "numeric",
    month: "2-digit",
    day: "2-digit"
  };
  const currentLocaleDate = now.toLocaleDateString(void 0, options);
  const date = now.getDate();
  const twoDigitDate = `${date}`.length === 1 ? `0${date}` : date;
  const month = now.getMonth() + 1;
  const twoDigitMonth = `${month}`.length === 1 ? `0${month}` : month;
  const year = now.getFullYear();
  const localeDateFormat = currentLocaleDate.replace(`${twoDigitDate}`, "dd").replace(`${twoDigitMonth}`, "MM").replace(`${year}`, "yyyy");
  return localeDateFormat;
};
var getLocale = async (locale) => {
  if (!locale) return;
  try {
    const data = await import("date-fns/locale");
    return data[locale];
  } catch (error) {
    console.warn(`Locale ${locale} not found. Using en-US`);
    return;
  }
};
var getLocalCountryBasedFormat = () => {
  const defaultLocale = Intl.DateTimeFormat().resolvedOptions().locale?.replace(/-/g, "");
  const locale = defaultLocale;
  const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
  const dateFormat = getDefaultDateFormat();
  const dateTimeFormat = `${dateFormat} hh:mm a`;
  return {
    dateFormat,
    dateTimeFormat,
    locale: locale || "enUS",
    timeZone,
    currency: "USD"
  };
};

// ../shared/src/lib/format/constants.ts
var DEFAULT_LOCAL_VALUE = "LOCAL";
var DEFAULT_COUNTRY_BASED_FORMAT_OPTIONS = {
  LOCAL: getLocalCountryBasedFormat(),
  US: {
    dateFormat: "d MMMM yyyy",
    dateTimeFormat: "d MMMM yyyy HH:mm",
    currency: "USD",
    locale: "enUS",
    timeZone: "America/Los_Angeles"
  },
  IN: {
    dateFormat: "MMMM d, yyyy",
    dateTimeFormat: "MMMM d, yyyy HH:mm",
    currency: "INR",
    locale: "enIN",
    timeZone: "Asia/Kolkata"
  }
};

// ../shared/src/lib/format/currency.ts
var CurrencyIntl = class extends CurrencyConverter {
  currency;
  fallback;
  locale;
  /**
   * Constructs a new instance of the CurrencyIntl class.
   * @param options - The options for configuring the currency formatter.
   */
  constructor({ locale, currency, from, fallback, ...options }) {
    super({ ...options, from: from || currency });
    this.currency = currency;
    this.locale = locale || void 0;
    this.fallback = fallback ?? "N/A";
  }
  /**
   * Formats the given value into a currency string.
   * @param value - The value to format.
   * @param currency - The currency code to use for formatting. Defaults to the currency specified in the constructor.
   * @returns The formatted currency string.
   */
  format(value, currency = this.currency) {
    if (!this.isValid(value)) return this.fallback;
    return new Intl.NumberFormat(this.locale, {
      currency,
      currencyDisplay: "symbol",
      minimumFractionDigits: 2,
      style: "currency"
    }).format(Number(value));
  }
  isValid(value) {
    if (!value && value !== 0 || Number.isNaN(value) || Number.isNaN(Number(value))) {
      return false;
    }
    return true;
  }
};
var currencyIntl = new CurrencyIntl({ currency: "USD", locale: "en-US" });

// ../shared/src/lib/format/date.ts
import { formatRelative, isAfter, isValid } from "date-fns";
import { formatInTimeZone, fromZonedTime, toZonedTime } from "date-fns-tz";
var DateTransformer = class {
  parse(value, timeZone) {
    return toZonedTime(value, timeZone);
  }
  convert(value, timeZone) {
    return fromZonedTime(value, timeZone).toISOString();
  }
};
var DateIntl = class {
  /**
   * The locale to be used for formatting.
   * @example 'en-US'
   */
  locale;
  /**
   * The format string for date-only formatting.
   * @example 'yyyy-MM-dd'
   * @url https://date-fns.org/v3.6.0/docs/format
   */
  dateFormat;
  /**
   * The format string for date and time formatting.
   * @example 'yyyy-MM-dd hh:mm a'
   * @url https://date-fns.org/v3.6.0/docs/format
   */
  dateTimeFormat;
  /**
   * The transformer used for parsing and converting dates.
   */
  transformer;
  /**
   * The fallback string to be used when formatting fails.
   * @example 'N/A'
   */
  fallback;
  /**
   * The time zone to be used for formatting.
   * @example 'America/Los_Angeles'
   */
  timeZone;
  /**
   * Constructs a new instance of the DateIntl class.
   * @param options - The options for configuring the DateIntl instance.
   */
  constructor({ locale, dateFormat, dateTimeFormat, transformer, timeZone, fallback }) {
    const defaultTimeZone = getLocalCountryBasedFormat().timeZone;
    this.locale = locale || void 0;
    this.dateFormat = dateFormat;
    this.dateTimeFormat = dateTimeFormat;
    this.transformer = transformer || dateTransformer;
    this.timeZone = timeZone === "LOCAL" ? defaultTimeZone : timeZone || defaultTimeZone;
    this.fallback = fallback || "N/A";
  }
  /**
   * Formats the given date value using the specified options.
   * @param value - The date value to format.
   * @param options - The options for formatting the date. Can be a string or an object. If a string is provided, it will be used as the date format. If an object is provided, it will be used as the options for formatting the date.
   * @returns The formatted date string.
   */
  format(value, options) {
    if (typeof options === "string") {
      if (!this.isValid(value)) return this.fallback;
      return formatInTimeZone(this.toDate(value), this.timeZone, options, { locale: this.locale });
    }
    const {
      dateFormat = this.dateFormat,
      timeZone = this.timeZone,
      locale = this.locale,
      fallback = this.fallback
    } = options ?? {};
    if (!this.isValid(value)) return fallback;
    return formatInTimeZone(this.toDate(value), timeZone, dateFormat, { locale });
  }
  /**
   * Formats the given date value as a date string using the specified options.
   * @param value - The date value to format.
   * @param options - The options for formatting the date. Can be a string or an object. If a string is provided, it will be used as the date format. If an object is provided, it will be used as the options for formatting the date.
   * @returns The formatted date string.
   */
  formatDate(value, options) {
    return this.format(value, options);
  }
  /**
   * Formats the given date value as a date and time string using the specified options.
   * @param value - The date value to format.
   * @param options - The options for formatting the date and time. Can be a string or an object. If a string is provided, it will be used as the date format. If an object is provided, it will be used as the options for formatting the date and time.
   * @returns The formatted date and time string.
   */
  formatDateTime(value, options) {
    if (typeof options === "string") {
      return this.format(value, options);
    }
    return this.format(value, {
      ...options,
      dateFormat: options?.dateFormat || this.dateTimeFormat
    });
  }
  /**
   * Formats the given date value as a relative time string.
   * @param value - The date value to format.
   * @param baseDate - The base date to calculate the relative time from.
   * @param options - The options for formatting the relative time.
   * @returns The formatted relative time string.
   */
  formatRelativeTime(value, baseDate, options) {
    if (!this.isValid(value)) return this.fallback;
    return formatRelative(this.toDate(value), this.toDate(baseDate || /* @__PURE__ */ new Date()), {
      locale: options?.locale || this.locale,
      ...options
    });
  }
  /**
   * Converts the given date value to a string representation.
   * @param date - The date value to convert.
   * @returns The string representation of the date.
   */
  given(date) {
    return this.toInput(date);
  }
  /**
   * Gets the current date and time as a string representation.
   * @returns The string representation of the current date and time.
   */
  now() {
    return this.toInput(/* @__PURE__ */ new Date());
  }
  /**
   * Gets a past date as a string representation.
   * @param minDate - The minimum date to generate the range from.
   * @returns The string representation of the past date.
   */
  past(minDate) {
    const today = /* @__PURE__ */ new Date();
    return this.range(minDate ?? new Date(today.getFullYear() - 1, today.getMonth()), today);
  }
  /**
   * Gets a future date as a string representation.
   * @param maxDate - The maximum date to generate the range to.
   * @returns The string representation of the future date.
   */
  future(maxDate) {
    const today = /* @__PURE__ */ new Date();
    return this.range(today, maxDate ?? new Date(today.getFullYear() + 1, today.getMonth()));
  }
  /**
   * Generates a random date within the specified range and returns it as a string representation.
   * @param minDate - The minimum date of the range.
   * @param maxDate - The maximum date of the range.
   * @returns The string representation of the random date.
   * @throws An error if the maxDate is not greater than the minDate.
   */
  range(minDate, maxDate) {
    if (isAfter(this.toDate(minDate), this.toDate(maxDate))) {
      throw new Error("maxDate should be greater than minDate");
    }
    const minValue = this.toDate(minDate).getTime();
    const maxValue = this.toDate(maxDate).getTime();
    const timestamp = Math.floor(Math.random() * (maxValue - minValue + 1) + minValue);
    return this.toInput(new Date(timestamp));
  }
  /**
   * Checks if the given value is a valid date.
   * @param value - The value to check.
   * @returns True if the value is a valid date, false otherwise.
   */
  isValid(value) {
    if (!value || isNaN(Date.parse(value.toString())) && !isValid(value)) {
      return false;
    }
    return true;
  }
  /**
   * Checks if two dates are the same day.
   * @param date1 - The first date to compare.
   * @param date2 - The second date to compare.
   * @returns True if the dates are the same day, false otherwise.
   */
  isSameDay(date1, date2) {
    const day1 = this.toDate(date1).getDate();
    const day2 = this.toDate(date2).getDate();
    return day1 === day2;
  }
  isDate(value) {
    return value instanceof Date;
  }
  toDate(value) {
    if (!this.isValid(value)) {
      throw new Error("Invalid date");
    }
    return this.isDate(value) ? value : this.transformer.parse(value, this.timeZone, this.locale);
  }
  toInput(value) {
    const date = this.toDate(value);
    return this.transformer.convert(date, this.timeZone, this.locale);
  }
};
var dateTransformer = new DateTransformer();
var defaultOptions = getLocalCountryBasedFormat();
var DEFAULT_DATE_OPTIONS = {
  dateFormat: defaultOptions.dateFormat,
  dateTimeFormat: defaultOptions.dateTimeFormat,
  timeZone: defaultOptions.timeZone,
  fallback: "-"
};
var dateIntl = new DateIntl(DEFAULT_DATE_OPTIONS);

// ../shared/src/lib/format/number.ts
var NumberIntl = class {
  locale;
  fallback;
  /**
   * Creates an instance of NumberIntl.
   * @param options - The options for configuring the NumberIntl instance.
   */
  constructor({ locale, fallback } = {}) {
    this.locale = locale || void 0;
    this.fallback = fallback ?? "N/A";
  }
  /**
   * Formats the given value as a string based on the provided options.
   * @param value - The value to be formatted.
   * @param options - The options for formatting the number.
   * @returns The formatted number as a string.
   */
  format(value, options = {}) {
    if (!this.isValid(value)) return this.fallback;
    return new Intl.NumberFormat(this.locale, options).format(Number(value));
  }
  isValid(value) {
    if (!value && value !== 0 || Number.isNaN(value) || Number.isNaN(Number(value))) {
      return false;
    }
    return true;
  }
};
var numberIntl = new NumberIntl({
  locale: "en-US"
});

// ../shared/src/lib/format/time-zones.ts
var TIME_ZONE_LISTS = [
  "LOCAL",
  "UTC",
  "Africa/Abidjan",
  "Africa/Nairobi",
  "Africa/Algiers",
  "Africa/Lagos",
  "Africa/Bissau",
  "Africa/Maputo",
  "Africa/Cairo",
  "Africa/Casablanca",
  "Africa/Ceuta",
  "Africa/El_Aaiun",
  "Africa/Johannesburg",
  "Africa/Juba",
  "Africa/Khartoum",
  "Africa/Monrovia",
  "Africa/Ndjamena",
  "Africa/Sao_Tome",
  "Africa/Tripoli",
  "Africa/Tunis",
  "Africa/Windhoek",
  "America/Adak",
  "America/Anchorage",
  "America/Puerto_Rico",
  "America/Araguaina",
  "America/Argentina/Buenos_Aires",
  "America/Argentina/Catamarca",
  "America/Argentina/Cordoba",
  "America/Argentina/Jujuy",
  "America/Argentina/La_Rioja",
  "America/Argentina/Mendoza",
  "America/Argentina/Rio_Gallegos",
  "America/Argentina/Salta",
  "America/Argentina/San_Juan",
  "America/Argentina/San_Luis",
  "America/Argentina/Tucuman",
  "America/Argentina/Ushuaia",
  "America/Asuncion",
  "America/Panama",
  "America/Bahia_Banderas",
  "America/Bahia",
  "America/Barbados",
  "America/Belem",
  "America/Belize",
  "America/Boa_Vista",
  "America/Bogota",
  "America/Boise",
  "America/Cambridge_Bay",
  "America/Campo_Grande",
  "America/Cancun",
  "America/Caracas",
  "America/Cayenne",
  "America/Chicago",
  "America/Chihuahua",
  "America/Costa_Rica",
  "America/Phoenix",
  "America/Cuiaba",
  "America/Danmarkshavn",
  "America/Dawson_Creek",
  "America/Dawson",
  "America/Denver",
  "America/Detroit",
  "America/Edmonton",
  "America/Eirunepe",
  "America/El_Salvador",
  "America/Tijuana",
  "America/Fort_Nelson",
  "America/Fort_Wayne",
  "America/Fortaleza",
  "America/Glace_Bay",
  "America/Godthab",
  "America/Goose_Bay",
  "America/Grand_Turk",
  "America/Guatemala",
  "America/Guayaquil",
  "America/Guyana",
  "America/Halifax",
  "America/Havana",
  "America/Hermosillo",
  "America/Indiana/Knox",
  "America/Indiana/Marengo",
  "America/Indiana/Petersburg",
  "America/Indiana/Tell_City",
  "America/Indiana/Vevay",
  "America/Indiana/Vincennes",
  "America/Indiana/Winamac",
  "America/Inuvik",
  "America/Iqaluit",
  "America/Jamaica",
  "America/Juneau",
  "America/Kentucky/Louisville",
  "America/Kentucky/Monticello",
  "America/La_Paz",
  "America/Lima",
  "America/Los_Angeles",
  "America/Maceio",
  "America/Managua",
  "America/Manaus",
  "America/Martinique",
  "America/Matamoros",
  "America/Mazatlan",
  "America/Menominee",
  "America/Merida",
  "America/Metlakatla",
  "America/Mexico_City",
  "America/Miquelon",
  "America/Moncton",
  "America/Monterrey",
  "America/Montevideo",
  "America/Toronto",
  "America/New_York",
  "America/Nome",
  "America/Noronha",
  "America/North_Dakota/Beulah",
  "America/North_Dakota/Center",
  "America/North_Dakota/New_Salem",
  "America/Ojinaga",
  "America/Pangnirtung",
  "America/Paramaribo",
  "America/Port-au-Prince",
  "America/Rio_Branco",
  "America/Porto_Velho",
  "America/Punta_Arenas",
  "America/Winnipeg",
  "America/Rankin_Inlet",
  "America/Recife",
  "America/Regina",
  "America/Resolute",
  "America/Santarem",
  "America/Santiago",
  "America/Santo_Domingo",
  "America/Sao_Paulo",
  "America/Scoresbysund",
  "America/Sitka",
  "America/St_Johns",
  "America/Swift_Current",
  "America/Tegucigalpa",
  "America/Thule",
  "America/Vancouver",
  "America/Whitehorse",
  "America/Yakutat",
  "America/Yellowknife",
  "Antarctica/Casey",
  "Antarctica/Davis",
  "Pacific/Port_Moresby",
  "Antarctica/Macquarie",
  "Antarctica/Mawson",
  "Pacific/Auckland",
  "Antarctica/Palmer",
  "Antarctica/Rothera",
  "Asia/Riyadh",
  "Antarctica/Troll",
  "Asia/Urumqi",
  "Europe/Berlin",
  "Asia/Almaty",
  "Asia/Amman",
  "Asia/Anadyr",
  "Asia/Aqtau",
  "Asia/Aqtobe",
  "Asia/Ashgabat",
  "Asia/Atyrau",
  "Asia/Baghdad",
  "Asia/Qatar",
  "Asia/Baku",
  "Asia/Bangkok",
  "Asia/Barnaul",
  "Asia/Beirut",
  "Asia/Bishkek",
  "Asia/Brunei",
  "Asia/Kolkata",
  "Asia/Chita",
  "Asia/Choibalsan",
  "Asia/Shanghai",
  "Asia/Colombo",
  "Asia/Dhaka",
  "Asia/Damascus",
  "Asia/Dili",
  "Asia/Dubai",
  "Asia/Dushanbe",
  "Asia/Famagusta",
  "Asia/Gaza",
  "Asia/Hebron",
  "Asia/Ho_Chi_Minh",
  "Asia/Hong_Kong",
  "Asia/Hovd",
  "Asia/Irkutsk",
  "Europe/Istanbul",
  "Asia/Jakarta",
  "Asia/Jayapura",
  "Asia/Jerusalem",
  "Asia/Kabul",
  "Asia/Kamchatka",
  "Asia/Karachi",
  "Asia/Kathmandu",
  "Asia/Khandyga",
  "Asia/Krasnoyarsk",
  "Asia/Kuala_Lumpur",
  "Asia/Macau",
  "Asia/Magadan",
  "Asia/Makassar",
  "Asia/Manila",
  "Asia/Nicosia",
  "Asia/Novokuznetsk",
  "Asia/Novosibirsk",
  "Asia/Omsk",
  "Asia/Oral",
  "Asia/Pontianak",
  "Asia/Pyongyang",
  "Asia/Qostanay",
  "Asia/Qyzylorda",
  "Asia/Rangoon",
  "Asia/Sakhalin",
  "Asia/Samarkand",
  "Asia/Seoul",
  "Asia/Srednekolymsk",
  "Asia/Taipei",
  "Asia/Tashkent",
  "Asia/Tbilisi",
  "Asia/Tehran",
  "Asia/Thimphu",
  "Asia/Tokyo",
  "Asia/Tomsk",
  "Asia/Ulaanbaatar",
  "Asia/Ust-Nera",
  "Asia/Vladivostok",
  "Asia/Yakutsk",
  "Asia/Yekaterinburg",
  "Asia/Yerevan",
  "Atlantic/Azores",
  "Atlantic/Bermuda",
  "Atlantic/Canary",
  "Atlantic/Cape_Verde",
  "Atlantic/Faroe",
  "Atlantic/Madeira",
  "Atlantic/South_Georgia",
  "Atlantic/Stanley",
  "Australia/Sydney",
  "Australia/Adelaide",
  "Australia/Brisbane",
  "Australia/Broken_Hill",
  "Australia/Hobart",
  "Australia/Darwin",
  "Australia/Eucla",
  "Australia/Lord_Howe",
  "Australia/Lindeman",
  "Australia/Melbourne",
  "Australia/Perth",
  "CET",
  "Pacific/Easter",
  "CST6CDT",
  "EET",
  "Europe/Dublin",
  "EST",
  "EST5EDT",
  "Etc/GMT-0",
  "Etc/GMT-1",
  "Etc/GMT-10",
  "Etc/GMT-11",
  "Etc/GMT-12",
  "Etc/GMT-13",
  "Etc/GMT-14",
  "Etc/GMT-2",
  "Etc/GMT-3",
  "Etc/GMT-4",
  "Etc/GMT-5",
  "Etc/GMT-6",
  "Etc/GMT-7",
  "Etc/GMT-8",
  "Etc/GMT-9",
  "Etc/GMT+1",
  "Etc/GMT+10",
  "Etc/GMT+11",
  "Etc/GMT+12",
  "Etc/GMT+2",
  "Etc/GMT+3",
  "Etc/GMT+4",
  "Etc/GMT+5",
  "Etc/GMT+6",
  "Etc/GMT+7",
  "Etc/GMT+8",
  "Etc/GMT+9",
  "Etc/UTC",
  "Europe/Brussels",
  "Europe/Andorra",
  "Europe/Astrakhan",
  "Europe/Athens",
  "Europe/London",
  "Europe/Belgrade",
  "Europe/Prague",
  "Europe/Bucharest",
  "Europe/Budapest",
  "Europe/Zurich",
  "Europe/Chisinau",
  "Europe/Gibraltar",
  "Europe/Helsinki",
  "Europe/Kaliningrad",
  "Europe/Kiev",
  "Europe/Kirov",
  "Europe/Lisbon",
  "Europe/Madrid",
  "Europe/Malta",
  "Europe/Minsk",
  "Europe/Paris",
  "Europe/Moscow",
  "Europe/Riga",
  "Europe/Rome",
  "Europe/Samara",
  "Europe/Saratov",
  "Europe/Simferopol",
  "Europe/Sofia",
  "Europe/Tallinn",
  "Europe/Tirane",
  "Europe/Ulyanovsk",
  "Europe/Vienna",
  "Europe/Vilnius",
  "Europe/Volgograd",
  "Europe/Warsaw",
  "HST",
  "Indian/Chagos",
  "Indian/Maldives",
  "Indian/Mauritius",
  "Pacific/Kwajalein",
  "MET",
  "MST",
  "MST7MDT",
  "Pacific/Chatham",
  "Pacific/Apia",
  "Pacific/Bougainville",
  "Pacific/Efate",
  "Pacific/Enderbury",
  "Pacific/Fakaofo",
  "Pacific/Fiji",
  "Pacific/Tarawa",
  "Pacific/Galapagos",
  "Pacific/Gambier",
  "Pacific/Guadalcanal",
  "Pacific/Guam",
  "Pacific/Honolulu",
  "Pacific/Kiritimati",
  "Pacific/Kosrae",
  "Pacific/Marquesas",
  "Pacific/Pago_Pago",
  "Pacific/Nauru",
  "Pacific/Niue",
  "Pacific/Norfolk",
  "Pacific/Noumea",
  "Pacific/Palau",
  "Pacific/Pitcairn",
  "Pacific/Rarotonga",
  "Pacific/Tahiti",
  "Pacific/Tongatapu",
  "PST8PDT",
  "WET"
];

// ../../node_modules/@formatjs/fast-memoize/index.js
function memoize(fn, options) {
  const cache = options && options.cache ? options.cache : cacheDefault;
  const serializer = options && options.serializer ? options.serializer : serializerDefault;
  return (options && options.strategy ? options.strategy : strategyDefault)(fn, {
    cache,
    serializer
  });
}
function isPrimitive(value) {
  return value == null || typeof value === "number" || typeof value === "boolean";
}
function monadic(fn, cache, serializer, arg) {
  const cacheKey = isPrimitive(arg) ? arg : serializer(arg);
  let computedValue = cache.get(cacheKey);
  if (typeof computedValue === "undefined") {
    computedValue = fn.call(this, arg);
    cache.set(cacheKey, computedValue);
  }
  return computedValue;
}
function variadic(fn, cache, serializer) {
  const args = Array.prototype.slice.call(arguments, 3);
  const cacheKey = serializer(args);
  let computedValue = cache.get(cacheKey);
  if (typeof computedValue === "undefined") {
    computedValue = fn.apply(this, args);
    cache.set(cacheKey, computedValue);
  }
  return computedValue;
}
function assemble(fn, context, strategy, cache, serialize) {
  return strategy.bind(context, fn, cache, serialize);
}
function strategyDefault(fn, options) {
  const strategy = fn.length === 1 ? monadic : variadic;
  return assemble(fn, this, strategy, options.cache.create(), options.serializer);
}
var serializerDefault = function() {
  return JSON.stringify(arguments);
};
var ObjectWithoutPrototypeCache = class {
  constructor() {
    this.cache = /* @__PURE__ */ Object.create(null);
  }
  get(key) {
    return this.cache[key];
  }
  set(key, value) {
    this.cache[key] = value;
  }
};
var cacheDefault = { create: function create() {
  return new ObjectWithoutPrototypeCache();
} };

// ../shared/src/lib/format/translate.ts
import { IntlMessageFormat } from "intl-messageformat";
var formatters = {
  getNumberFormat: memoize((locale, opts) => new Intl.NumberFormat(locale, opts)),
  getDateTimeFormat: memoize((locale, opts) => new Intl.DateTimeFormat(locale, opts)),
  getPluralRules: memoize((locale, opts) => new Intl.PluralRules(locale, opts))
};
var t = (message, values, locale) => {
  try {
    return new IntlMessageFormat(message, locale, void 0, { formatters }).format(values);
  } catch (error) {
    console.error(error);
    return message;
  }
};

// ../shared/src/lib/http/AxiosClient.ts
import axios4 from "axios";

// ../shared/src/lib/http/handlers.ts
import axios3 from "axios";

// ../shared/src/constants/colors.ts
import { cva } from "class-variance-authority";
var TAILWIND_COLOR_VARIANTS = [
  "gray",
  "red",
  "orange",
  "amber",
  "yellow",
  "lime",
  "green",
  "emerald",
  "teal",
  "cyan",
  "sky",
  "blue",
  "indigo",
  "violet",
  "purple",
  "fuchsia",
  "pink",
  "rose"
];
var COLOR_VARIANTS = [
  "primary",
  "secondary",
  "tertiary",
  "destructive",
  "info",
  "success",
  "warning",
  "danger",
  "muted",
  "accent"
];
var ALL_COLOR_VARIANTS = [...TAILWIND_COLOR_VARIANTS, ...COLOR_VARIANTS];
var BOX_COLOR_VARIANTS = [
  ...ALL_COLOR_VARIANTS,
  "muted",
  "black",
  "white",
  "transparent",
  "background",
  "foreground",
  "inherit",
  "currentColor",
  "dimmed"
];
var tailwindBoxVariants = cva("", {
  variants: {
    bg: {
      gray: "bg-gray-600",
      red: "bg-red-600",
      orange: "bg-orange-600",
      amber: "bg-amber-600",
      yellow: "bg-yellow-600",
      lime: "bg-lime-600",
      green: "bg-green-600",
      emerald: "bg-emerald-600",
      teal: "bg-teal-600",
      cyan: "bg-cyan-600",
      sky: "bg-sky-600",
      blue: "bg-blue-600",
      indigo: "bg-indigo-600",
      violet: "bg-violet-600",
      purple: "bg-purple-600",
      fuchsia: "bg-fuchsia-600",
      pink: "bg-pink-600",
      rose: "bg-rose-600",
      black: "bg-black",
      white: "bg-white",
      transparent: "bg-transparent",
      background: "bg-background",
      foreground: "bg-foreground",
      inherit: "bg-inherit",
      primary: "bg-primary",
      secondary: "bg-secondary",
      tertiary: "bg-tertiary",
      destructive: "bg-destructive",
      info: "bg-info",
      success: "bg-success",
      warning: "bg-warning",
      danger: "bg-danger",
      muted: "bg-muted",
      accent: "bg-accent",
      currentColor: "bg-current",
      dimmed: "bg-gray-500"
    },
    textColor: {
      gray: "text-gray-600",
      red: "text-red-600",
      orange: "text-orange-600",
      amber: "text-amber-600",
      yellow: "text-yellow-600",
      lime: "text-lime-600",
      green: "text-green-600",
      emerald: "text-emerald-600",
      teal: "text-teal-600",
      cyan: "text-cyan-600",
      sky: "text-sky-600",
      blue: "text-blue-600",
      indigo: "text-indigo-600",
      violet: "text-violet-600",
      purple: "text-purple-600",
      fuchsia: "text-fuchsia-600",
      pink: "text-pink-600",
      rose: "text-rose-600",
      black: "text-black",
      white: "text-white",
      transparent: "text-transparent",
      background: "text-background",
      foreground: "text-foreground",
      inherit: "text-inherit",
      primary: "text-primary",
      secondary: "text-secondary",
      tertiary: "text-tertiary",
      destructive: "text-destructive",
      info: "text-info",
      success: "text-success",
      warning: "text-warning",
      danger: "text-danger",
      muted: "text-muted",
      accent: "text-accent",
      currentColor: "text-current",
      dimmed: "text-gray-500"
    },
    borderColor: {
      gray: "border-gray-600",
      red: "border-red-600",
      orange: "border-orange-600",
      amber: "border-amber-600",
      yellow: "border-yellow-600",
      lime: "border-lime-600",
      green: "border-green-600",
      emerald: "border-emerald-600",
      teal: "border-teal-600",
      cyan: "border-cyan-600",
      sky: "border-sky-600",
      blue: "border-blue-600",
      indigo: "border-indigo-600",
      violet: "border-violet-600",
      purple: "border-purple-600",
      fuchsia: "border-fuchsia-600",
      pink: "border-pink-600",
      rose: "border-rose-600",
      black: "border-black",
      white: "border-white",
      transparent: "border-transparent",
      background: "border-background",
      foreground: "border-foreground",
      inherit: "border-inherit",
      primary: "border-primary",
      secondary: "border-secondary",
      tertiary: "border-tertiary",
      destructive: "border-destructive",
      info: "border-info",
      success: "border-success",
      warning: "border-warning",
      danger: "border-danger",
      muted: "border-muted",
      accent: "border-accent",
      currentColor: "border-current",
      dimmed: "border-gray-500"
    },
    fontSize: {
      xs: "text-xs",
      "2xs": "text-2xs",
      "3xs": "text-3xs",
      tiny: "text-tiny",
      sm: "text-sm",
      base: "text-base",
      lg: "text-lg",
      xl: "text-xl",
      "2xl": "text-2xl",
      "3xl": "text-3xl",
      "4xl": "text-4xl",
      "5xl": "text-5xl",
      "6xl": "text-6xl",
      "7xl": "text-7xl",
      "8xl": "text-8xl",
      "9xl": "text-9xl"
    }
  },
  defaultVariants: {}
});

// ../shared/src/utils/helper.ts
var jsonParser = (value) => {
  if (!value) return null;
  try {
    return JSON.parse(value);
  } catch (error) {
    return null;
  }
};

// ../shared/src/lib/http/ErrorHandlerRegistry.ts
import axios2 from "axios";
import { isFunction, isObject, isString } from "lodash-es";
var isErrorHandlerObject = (value) => {
  if (!isObject(value)) return false;
  return ["message", "after", "before", "notify"].some((k) => k in value);
};
var ErrorHandlerRegistry = class {
  handlers = /* @__PURE__ */ new Map();
  parent = null;
  constructor(parent, input) {
    if (parent) this.parent = parent;
    if (input) this.registerMany(input);
  }
  register(key, handler) {
    this.handlers.set(key, handler);
    return this;
  }
  unregister(key) {
    this.handlers.delete(key);
    return this;
  }
  find(seek) {
    const handler = this.handlers.get(seek);
    if (handler) return handler;
    return this.parent?.find(seek);
  }
  registerMany(input) {
    for (const [key, value] of Object.entries(input)) {
      this.register(key, value);
    }
    return this;
  }
  handleError(seek, error, silent) {
    if (Array.isArray(seek)) {
      return seek.some((key) => {
        if (key) return this.handleError(`${key}`, error, silent);
      });
    }
    const handler = this.handlers.get(`${seek}`);
    if (!handler) {
      return false;
    } else if (isString(handler)) {
      return this.handleErrorObject(error, { message: handler }, silent);
    } else if (isFunction(handler)) {
      const result = handler(error);
      if (isErrorHandlerObject(result)) return this.handleErrorObject(error, result, silent);
      return !!result;
    } else if (isErrorHandlerObject(handler)) {
      return this.handleErrorObject(error, handler, silent);
    }
    return false;
  }
  handleErrorObject(error, options = {}, silent) {
    options?.before?.(error, options);
    if (!silent) {
    }
    return true;
  }
  responseErrorHandler(error, direct) {
    if (axios2.isAxiosError(error)) {
      const response = error?.response;
      const config = error?.config;
      const configData = jsonParser(config?.data);
      const errorData = response?.data;
      if (!direct && configData?.raw) throw error;
      const seekers = [errorData?.code, error.code, error?.name, `${response?.status}`];
      const result = this.handleError(seekers, error, configData?.silent);
      if (!result) {
        if (errorData?.message) {
          this.handleErrorObject(
            error,
            {
              message: errorData?.message
            },
            configData?.silent
          );
        } else {
          this.handleErrorObject(
            error,
            {
              message: error.message
            },
            configData?.silent
          );
        }
      }
    } else if (error instanceof Error) {
      return this.handleError(error.name, error);
    } else {
      throw new Error("Unknown error occurred! Please try again later.");
    }
  }
};

// ../shared/src/lib/http/exceptions/InternalServerException.ts
import { HttpStatusCode as HttpStatusCode2 } from "axios";

// ../shared/src/lib/http/HttpError.ts
import { AxiosError, HttpStatusCode } from "axios";
var HttpError = class _HttpError extends AxiosError {
  message;
  status;
  name;
  constructor(message, { status = HttpStatusCode.BadRequest, code, config, request, response, name } = {}) {
    super(message, code, config, request, response);
    this.status = status;
    this.message = message ?? response?.data?.message ?? "Http error message not provided";
    this.name = name ?? "HttpAxiosError";
    Object.setPrototypeOf(this, _HttpError.prototype);
  }
};

// ../shared/src/lib/http/InternalErrorCode.ts
var HTTP_SERVER_ERROR_CODE = {
  E400: "BAD_REQUEST",
  E401: "UNAUTHORIZED",
  E403: "FORBIDDEN",
  E404: "RESOURCE_NOT_FOUND",
  E500: "INTERNAL_SERVER_ERROR"
};

// ../shared/src/lib/http/exceptions/InternalServerException.ts
var InternalServerException = class extends HttpError {
  constructor(options) {
    const message = `Unknown internal server error occurred`;
    super(message, {
      ...options,
      code: HTTP_SERVER_ERROR_CODE.E500,
      status: HttpStatusCode2.InternalServerError
    });
    this.name = "InternalServerException";
  }
};

// ../shared/src/lib/http/exceptions/ResourceNotFoundException.ts
import { HttpStatusCode as HttpStatusCode3 } from "axios";
var ResourceNotFoundException = class extends HttpError {
  constructor(options, resourceId) {
    const message = resourceId ? `Resource with ${resourceId} id not found` : "Resource was not found";
    super(message, {
      ...options,
      code: HTTP_SERVER_ERROR_CODE.E404,
      status: HttpStatusCode3.NotFound
    });
    this.name = "ResourceNotFoundException";
  }
};

// ../shared/src/lib/logger/ConsoleLogger.ts
var ConsoleLogger = class _ConsoleLogger {
  static methodMap = {
    DEBUG: console.debug,
    ERROR: console.error,
    INFO: console.info,
    WARN: console.warn
  };
  log(level, message, params) {
    _ConsoleLogger.methodMap[level](`${level.toUpperCase()}: ${message}`, params ?? "");
  }
  debug(message, params) {
    console.debug(`DEBUG: ${message}`, params ?? "");
  }
  info(message, params) {
    console.info(`INFO: ${message}`, params ?? "");
  }
  warn(message, params) {
    console.warn(`WARN: ${message}`, params ?? "");
  }
  error(message, params) {
    console.error(`ERROR: ${message}`, params ?? "");
  }
};

// ../shared/src/lib/logger/MockLogger.ts
function createSpy() {
  const calls = [];
  const spy = (...args) => {
    calls.push(args);
  };
  spy.calls = calls;
  spy.reset = () => {
    calls.length = 0;
  };
  return spy;
}
var MockLogger = class {
  name = "MockLogger";
  log = createSpy();
  debug(message, params) {
    this.log("DEBUG", message, params);
  }
  info(message, params) {
    this.log("INFO", message, params);
  }
  warn(message, params) {
    this.log("WARN", message, params);
  }
  error(message, params) {
    this.log("ERROR", message, params);
  }
  /** Convenience: assert on recorded calls in tests. */
  get calls() {
    return this.log.calls;
  }
  reset() {
    this.log.reset();
  }
};

// ../shared/src/lib/logger/index.ts
var ProdConsoleLogger = ConsoleLogger;
var loggers = {
  ["dev" /* Dev */]: ConsoleLogger,
  ["prod" /* Prod */]: ProdConsoleLogger,
  ["test" /* Test */]: MockLogger
};
function detectEnv() {
  if (typeof process !== "undefined" && "development") {
    const env = "development";
    if (env === "test") return "test";
    if (env === "development") return "development";
    return "production";
  }
  const viteEnv = typeof import.meta !== "undefined" ? import.meta.env : void 0;
  if (viteEnv?.TEST || viteEnv?.MODE === "test") return "test";
  if (viteEnv?.DEV || viteEnv?.MODE === "development") return "development";
  return "production";
}
var Logger = class {
  _client;
  constructor() {
    this.init();
  }
  log(...args) {
    this.getClient().log(...args);
  }
  debug(...args) {
    this.getClient().debug(...args);
  }
  info(...args) {
    this.getClient().info(...args);
  }
  warn(...args) {
    this.getClient().warn(...args);
  }
  error(...args) {
    this.getClient().error(...args);
  }
  getClient() {
    if (!this._client) {
      this.init();
    }
    return this._client;
  }
  init() {
    if (this._client === void 0) {
      const env = detectEnv();
      if (env === "test") {
        return this._client = new loggers["test" /* Test */]();
      }
      if (env === "development") {
        return this._client = new loggers["dev" /* Dev */]();
      }
      this._client = new loggers["prod" /* Prod */]();
    }
  }
};
var logger = new Logger();

// ../shared/src/lib/http/global-http-error.ts
var GLOBAL_HTTP_ERROR_VALIDATION = {
  "404": { message: "Data not found" },
  "500": { message: "Internal Server Error" },
  INVALID_LOGIN: {
    message: "Invalid Login!"
  },
  LOGIN_REQUIRED: {
    after: () => logger.info("Go TO /login"),
    message: "Login required"
  },
  NO_INPUT_DATA: { message: "No Input data" },
  VALIDATION_ERROR: {
    message: "Validation error!"
  },
  WRONG_KEY: {
    after: () => logger.info("Go TO /login")
  }
};

// ../shared/src/lib/http/handlers.ts
var responseSuccessHandler = (response) => {
  const config = response?.config;
  const configData = jsonParser(config.data);
  if (configData?.raw) {
    return response;
  }
  if (response.status !== 200) {
    throw new HttpError("Response status is not 200!");
  }
  const data = response?.data;
  if (!data) {
    throw new HttpError("Response data is not provided!");
  }
  return data;
};
var responseErrorHandler = (error, direct) => {
  if (axios3.isAxiosError(error)) {
    const { status } = error.response ?? {};
    if (status === 404) {
      error = new ResourceNotFoundException(error);
    }
  }
  return globalHttpErrorHandlers.responseErrorHandler(error, direct);
};
var globalHttpErrorHandlers = new ErrorHandlerRegistry();
globalHttpErrorHandlers.registerMany({ ...GLOBAL_HTTP_ERROR_VALIDATION });

// ../shared/src/lib/http/AxiosClient.ts
var AxiosClient = class {
  config;
  axiosInstance;
  constructor(config) {
    this.config = config;
    this.axiosInstance = axios4.create(config);
    this.axiosInstance.interceptors.response.use(responseSuccessHandler, responseErrorHandler);
  }
  get(url, config) {
    return this.axiosInstance.get(url, config);
  }
  post(url, body, config) {
    return this.axiosInstance.post(url, body, config);
  }
  put(url, body, config) {
    return this.axiosInstance.put(
      url,
      body,
      config
    );
  }
  patch(url, body, config) {
    return this.axiosInstance.patch(url, body, config);
  }
  delete(url, config) {
    return this.axiosInstance.delete(url, config);
  }
};

// ../shared/src/lib/http/HttpClient.ts
import { merge } from "lodash-es";
var HttpClient = class {
  client;
  constructor(client) {
    this.client = client;
  }
  get(url, config) {
    return this.client.get(url, config);
  }
  post(url, body, config) {
    return this.client.post(url, body, config);
  }
  put(url, body, config) {
    return this.client.put(url, body, config);
  }
  patch(url, body, config) {
    return this.client.patch(url, body, config);
  }
  delete(url, config) {
    return this.client.delete(url, this.configure(config));
  }
  configure(customConfig) {
    return { ...merge(this.client.config, customConfig) };
  }
};

// ../shared/src/lib/http/index.ts
var axiosDefaultConfig = {};
var httpClient = new HttpClient(new AxiosClient(axiosDefaultConfig));

// ../shared/src/lib/utils/index.ts
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
var cn = (...inputs) => {
  return twMerge(clsx(inputs));
};
export {
  CURRENCY_CODES,
  CURRENCY_RECORD,
  CurrencyConverter,
  CurrencyIntl,
  DEFAULT_COUNTRY_BASED_FORMAT_OPTIONS,
  DEFAULT_DATE_OPTIONS,
  DEFAULT_LOCAL_VALUE,
  DateIntl,
  HttpError,
  InternalServerException,
  NumberIntl,
  ResourceNotFoundException,
  TIME_ZONE_LISTS,
  axiosDefaultConfig,
  cn,
  currencyIntl,
  dateIntl,
  defaultCurrencyConverter,
  getDefaultDateFormat,
  getLocalCountryBasedFormat,
  getLocale,
  httpClient,
  logger,
  numberIntl,
  t
};
