"use client";
'use strict';

var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var React = require('react');
var icon = require('@page-speed/icon');
var jsxRuntime = require('react/jsx-runtime');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);

function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
var DynamicIcon = React__namespace.memo(function DynamicIcon2({
  apiKey,
  ...props
}) {
  return /* @__PURE__ */ jsxRuntime.jsx(icon.Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
});
DynamicIcon.displayName = "DynamicIcon";
var paymentIconMap = {
  visa: "cib/cc-visa",
  mastercard: "cib/cc-mastercard",
  amex: "cib/cc-amex",
  apple: "cib/apple-pay",
  google: "cib/google-pay",
  paypal: "cib/cc-paypal",
  amazon: "cib/cc-amazon-pay",
  samsung: "cib/samsung-pay",
  upi: "material-symbols/upi-pay",
  afterpay: "simple-icons/afterpay",
  venmo: "cib/venmo",
  cashapp: "cib/cashapp",
  bitcoin: "cib/bitcoin",
  contactless: "mdi/contactless-payment-circle",
  square: "logos/square",
  unknown: "majesticons/creditcard"
};
function PaymentPlatformIcon({
  platform,
  size = 28,
  color,
  className,
  iconClassName
}) {
  const iconName = paymentIconMap[platform] || paymentIconMap.unknown;
  return /* @__PURE__ */ jsxRuntime.jsx(
    "span",
    {
      className: cn("inline-flex items-center justify-center", className),
      "aria-label": platform,
      children: /* @__PURE__ */ jsxRuntime.jsx(
        DynamicIcon,
        {
          name: iconName,
          size,
          color,
          className: iconClassName,
          alt: platform
        }
      )
    }
  );
}

exports.PaymentPlatformIcon = PaymentPlatformIcon;
