import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
import Callout from '@bigbinary/neetoui/Callout';
import { Trans } from 'react-i18next';
import { useLocation } from 'react-router-dom';
import { U as UAParser } from './ua-parser-rRwDJPFB.js';
import { jsx } from 'react/jsx-runtime';

var MOBILE_PLATFORMS = ["Android", "iOS", "Windows Phone"];

var DownloadMobileAppCallout = function DownloadMobileAppCallout(_ref) {
  var _globalProps$appName;
  var excludePathRegex = _ref.excludePathRegex;
  var _useLocation = useLocation(),
    pathname = _useLocation.pathname;
  var parser = new UAParser(navigator.userAgent);
  var result = parser.getResult();
  var isMobilePlatform = MOBILE_PLATFORMS.includes(result.os.name);
  if (!isMobilePlatform) return null;
  var shouldExcludePath = excludePathRegex && excludePathRegex.test(pathname);
  if (shouldExcludePath) return null;
  var appName = (_globalProps$appName = globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.toLowerCase();
  var mobileAppDownloadUrl = "https://www.neeto.com/".concat(appName, "/mobile");
  return /*#__PURE__*/jsx(Callout, {
    className: "m-4 block",
    style: "warning",
    children: /*#__PURE__*/jsx(Trans, {
      i18nKey: "neetoMolecules.downloadMobileAppCallout.message",
      components: {
        a: /*#__PURE__*/jsx("a", {
          className: "neeto-ui-btn--style-link",
          href: mobileAppDownloadUrl,
          rel: "noreferrer",
          target: "_blank"
        })
      }
    })
  });
};

export { DownloadMobileAppCallout as default };
//# sourceMappingURL=DownloadMobileAppCallout.js.map
