@mxenabled/connect-widget 2.17.1 → 2.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -5269,23 +5269,39 @@ function baseFindIndex$2(array, predicate, fromIndex, fromRight) {
5269
5269
  }
5270
5270
  var _baseFindIndex = baseFindIndex$2;
5271
5271
 
5272
- var reWhitespace = /\s/;
5273
- function trimmedEndIndex$1(string) {
5274
- var index = string.length;
5275
- while (index-- && reWhitespace.test(string.charAt(index))) {
5276
- }
5277
- return index;
5272
+ var _trimmedEndIndex;
5273
+ var hasRequired_trimmedEndIndex;
5274
+
5275
+ function require_trimmedEndIndex () {
5276
+ if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
5277
+ hasRequired_trimmedEndIndex = 1;
5278
+ var reWhitespace = /\s/;
5279
+ function trimmedEndIndex(string) {
5280
+ var index = string.length;
5281
+ while (index-- && reWhitespace.test(string.charAt(index))) {
5282
+ }
5283
+ return index;
5284
+ }
5285
+ _trimmedEndIndex = trimmedEndIndex;
5286
+ return _trimmedEndIndex;
5278
5287
  }
5279
- var _trimmedEndIndex = trimmedEndIndex$1;
5280
5288
 
5281
- var trimmedEndIndex = _trimmedEndIndex;
5282
- var reTrimStart = /^\s+/;
5283
- function baseTrim$1(string) {
5284
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5289
+ var _baseTrim;
5290
+ var hasRequired_baseTrim;
5291
+
5292
+ function require_baseTrim () {
5293
+ if (hasRequired_baseTrim) return _baseTrim;
5294
+ hasRequired_baseTrim = 1;
5295
+ var trimmedEndIndex = require_trimmedEndIndex();
5296
+ var reTrimStart = /^\s+/;
5297
+ function baseTrim(string) {
5298
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
5299
+ }
5300
+ _baseTrim = baseTrim;
5301
+ return _baseTrim;
5285
5302
  }
5286
- var _baseTrim = baseTrim$1;
5287
5303
 
5288
- var baseTrim = _baseTrim, isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5304
+ var baseTrim = require_baseTrim(), isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
5289
5305
  var NAN = 0 / 0;
5290
5306
  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
5291
5307
  var reIsBinary = /^0b[01]+$/i;
@@ -8767,7 +8783,7 @@ var hasRequiredTrim;
8767
8783
  function requireTrim () {
8768
8784
  if (hasRequiredTrim) return trim_1;
8769
8785
  hasRequiredTrim = 1;
8770
- var baseToString = _baseToString, baseTrim = _baseTrim, castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8786
+ var baseToString = _baseToString, baseTrim = require_baseTrim(), castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
8771
8787
  function trim(string, chars, guard) {
8772
8788
  string = toString(string);
8773
8789
  if (string && (guard || chars === void 0)) {
@@ -55636,6 +55652,8 @@ const AnalyticEvents = {
55636
55652
  ENTERED_LOGIN: "entered_login",
55637
55653
  ENTERED_PASSWORD: "entered_password",
55638
55654
  INITIAL_DATA_READY: "initial_data_ready",
55655
+ LOAD_CONNECT_MODE_NOT_ENABLED: "mode_not_enabled",
55656
+ LOAD_CONNECT_FEATURE_NOT_AVAILABLE: "feature_not_available",
55639
55657
  LOGIN_ERROR_CLICKED_GET_HELP: "login_error_clicked_get_help",
55640
55658
  MFA_CLICKED_GET_HELP: "mfa_clicked_get_help",
55641
55659
  MFA_ENTERED_INPUT: "mfa_entered_input",
@@ -62260,12 +62278,15 @@ const Environments = Object.freeze({
62260
62278
  });
62261
62279
 
62262
62280
  const PRIVACY_POLICY_URL = "https://www.mx.com/privacy/";
62281
+ const PRIVACY_POLICY_URL_FR = "https://www.mx.com/fr/privacy/";
62263
62282
  const PrivacyPolicy = ({ onCancel } = {}) => {
62264
62283
  useAnalyticsPath(...PageviewInfo.CONNECT_DISCLOSURE_PRIVACY_POLICY);
62265
62284
  const [isLeavingUrl, setIsLeavingUrl] = useState(null);
62266
62285
  const getNextDelay = getDelay();
62267
62286
  useEffect(() => {
62268
- setIsLeavingUrl(PRIVACY_POLICY_URL);
62287
+ const locale = getLocale();
62288
+ const privacyUrl = locale === "fr-ca" ? PRIVACY_POLICY_URL_FR : PRIVACY_POLICY_URL;
62289
+ setIsLeavingUrl(privacyUrl);
62269
62290
  }, []);
62270
62291
  if (isLeavingUrl) {
62271
62292
  return /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -87244,6 +87265,24 @@ const Connect$2 = ({
87244
87265
  dispatch(resetConnect$1());
87245
87266
  };
87246
87267
  }, []);
87268
+ useEffect(() => {
87269
+ if (loadError && loadError.type === "config" && onAnalyticEvent) {
87270
+ const config = connectConfig;
87271
+ if (loadError.title && loadError.title.includes("Mode not enabled")) {
87272
+ onAnalyticEvent(`connect_${AnalyticEvents.LOAD_CONNECT_MODE_NOT_ENABLED}`, {
87273
+ ...defaultEventMetadata,
87274
+ mode: config.mode,
87275
+ requested_products: config?.data_request?.products
87276
+ });
87277
+ } else if (loadError.title && loadError.title.includes("Feature not available")) {
87278
+ onAnalyticEvent(`connect_${AnalyticEvents.LOAD_CONNECT_FEATURE_NOT_AVAILABLE}`, {
87279
+ ...defaultEventMetadata,
87280
+ resource: loadError.resource,
87281
+ requested_products: config?.data_request?.products
87282
+ });
87283
+ }
87284
+ }
87285
+ }, [loadError, connectConfig, onAnalyticEvent]);
87247
87286
  useEffect(() => {
87248
87287
  const isFirstTimeLoading = prevProps?.isLoading && !isLoading;
87249
87288
  if (isFirstTimeLoading) {