@pelcro/react-pelcro-js 3.23.0-beta.1 → 3.23.0-beta.11
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.cjs.js +705 -121
- package/dist/index.esm.js +705 -121
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -7470,6 +7470,51 @@ function _defineProperty$3(obj, key, value) {
|
|
|
7470
7470
|
return obj;
|
|
7471
7471
|
}
|
|
7472
7472
|
|
|
7473
|
+
// Polyfill
|
|
7474
|
+
(() => {
|
|
7475
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
7476
|
+
function CustomEvent(event) {
|
|
7477
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
7478
|
+
bubbles: false,
|
|
7479
|
+
cancelable: false,
|
|
7480
|
+
detail: undefined
|
|
7481
|
+
};
|
|
7482
|
+
const evt = document.createEvent("CustomEvent");
|
|
7483
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
7484
|
+
return evt;
|
|
7485
|
+
}
|
|
7486
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
7487
|
+
window.CustomEvent = CustomEvent;
|
|
7488
|
+
})();
|
|
7489
|
+
|
|
7490
|
+
/**
|
|
7491
|
+
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
7492
|
+
*/
|
|
7493
|
+
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
7494
|
+
|
|
7495
|
+
/**
|
|
7496
|
+
* Should fire when an item added to the cart and expects the added item to be sent
|
|
7497
|
+
*/
|
|
7498
|
+
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
7499
|
+
|
|
7500
|
+
/**
|
|
7501
|
+
* Should fire when an item removed from the cart and expects the removed item to be sent
|
|
7502
|
+
*/
|
|
7503
|
+
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
7504
|
+
|
|
7505
|
+
/**
|
|
7506
|
+
* Check if the browser support custom events
|
|
7507
|
+
*/
|
|
7508
|
+
function createCustomEvent(name, detail) {
|
|
7509
|
+
try {
|
|
7510
|
+
return new CustomEvent(name, {
|
|
7511
|
+
detail
|
|
7512
|
+
});
|
|
7513
|
+
} catch (e) {
|
|
7514
|
+
console.warn("Pelcro - Events are not supported in the browser");
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7517
|
+
|
|
7473
7518
|
function warn(s) {
|
|
7474
7519
|
console.warn('[react-ga]', s);
|
|
7475
7520
|
}
|
|
@@ -8321,55 +8366,547 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8321
8366
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
8322
8367
|
OutboundLink$1.trackLink = outboundLink;
|
|
8323
8368
|
var OutboundLink = OutboundLink$1;
|
|
8324
|
-
var
|
|
8369
|
+
var ReactGA1 = _objectSpread({}, Defaults, {
|
|
8325
8370
|
OutboundLink: OutboundLink
|
|
8326
8371
|
});
|
|
8327
8372
|
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
const evt = document.createEvent("CustomEvent");
|
|
8338
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
8339
|
-
return evt;
|
|
8373
|
+
var gtag_1 = createCommonjsModule(function (module, exports) {
|
|
8374
|
+
|
|
8375
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8376
|
+
value: true
|
|
8377
|
+
});
|
|
8378
|
+
exports["default"] = void 0;
|
|
8379
|
+
var gtag = function gtag() {
|
|
8380
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8381
|
+
args[_key] = arguments[_key];
|
|
8340
8382
|
}
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8383
|
+
if (typeof window !== "undefined") {
|
|
8384
|
+
var _window;
|
|
8385
|
+
if (typeof window.gtag === "undefined") {
|
|
8386
|
+
window.dataLayer = window.dataLayer || [];
|
|
8387
|
+
window.gtag = function gtag() {
|
|
8388
|
+
window.dataLayer.push(arguments);
|
|
8389
|
+
};
|
|
8390
|
+
}
|
|
8391
|
+
(_window = window).gtag.apply(_window, args);
|
|
8392
|
+
}
|
|
8393
|
+
};
|
|
8394
|
+
var _default = gtag;
|
|
8395
|
+
exports["default"] = _default;
|
|
8396
|
+
});
|
|
8344
8397
|
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8398
|
+
unwrapExports(gtag_1);
|
|
8399
|
+
|
|
8400
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
8401
|
+
|
|
8402
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8403
|
+
value: true
|
|
8404
|
+
});
|
|
8405
|
+
exports["default"] = format;
|
|
8406
|
+
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
8407
|
+
function toTitleCase(string) {
|
|
8408
|
+
return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
|
|
8409
|
+
if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && (title.charAt(index + match.length) !== "-" || title.charAt(index - 1) === "-") && title.charAt(index - 1).search(/[^\s-]/) < 0) {
|
|
8410
|
+
return match.toLowerCase();
|
|
8411
|
+
}
|
|
8412
|
+
if (match.substr(1).search(/[A-Z]|\../) > -1) {
|
|
8413
|
+
return match;
|
|
8414
|
+
}
|
|
8415
|
+
return match.charAt(0).toUpperCase() + match.substr(1);
|
|
8416
|
+
});
|
|
8417
|
+
}
|
|
8349
8418
|
|
|
8419
|
+
// See if s could be an email address. We don't want to send personal data like email.
|
|
8420
|
+
// https://support.google.com/analytics/answer/2795983?hl=en
|
|
8421
|
+
function mightBeEmail(s) {
|
|
8422
|
+
// There's no point trying to validate rfc822 fully, just look for ...@...
|
|
8423
|
+
return typeof s === "string" && s.indexOf("@") !== -1;
|
|
8424
|
+
}
|
|
8425
|
+
var redacted = "REDACTED (Potential Email Address)";
|
|
8426
|
+
function redactEmail(string) {
|
|
8427
|
+
if (mightBeEmail(string)) {
|
|
8428
|
+
console.warn("This arg looks like an email address, redacting.");
|
|
8429
|
+
return redacted;
|
|
8430
|
+
}
|
|
8431
|
+
return string;
|
|
8432
|
+
}
|
|
8433
|
+
function format() {
|
|
8434
|
+
var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8435
|
+
var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8436
|
+
var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
8437
|
+
var _str = s || "";
|
|
8438
|
+
if (titleCase) {
|
|
8439
|
+
_str = toTitleCase(s);
|
|
8440
|
+
}
|
|
8441
|
+
if (redactingEmail) {
|
|
8442
|
+
_str = redactEmail(_str);
|
|
8443
|
+
}
|
|
8444
|
+
return _str;
|
|
8445
|
+
}
|
|
8446
|
+
});
|
|
8447
|
+
|
|
8448
|
+
unwrapExports(format_1);
|
|
8449
|
+
|
|
8450
|
+
var ga4 = createCommonjsModule(function (module, exports) {
|
|
8451
|
+
|
|
8452
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8453
|
+
value: true
|
|
8454
|
+
});
|
|
8455
|
+
exports["default"] = exports.GA4 = void 0;
|
|
8456
|
+
var _gtag = _interopRequireDefault(gtag_1);
|
|
8457
|
+
var _format = _interopRequireDefault(format_1);
|
|
8458
|
+
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
|
|
8459
|
+
_excluded2 = ["title", "location"],
|
|
8460
|
+
_excluded3 = ["page", "hitType"];
|
|
8461
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8462
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8463
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8464
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8465
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8466
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8467
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8468
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8469
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8470
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8471
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8472
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8473
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8474
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8475
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
8476
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8477
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8478
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
8479
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8480
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8481
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8482
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8483
|
+
/*
|
|
8484
|
+
Links
|
|
8485
|
+
https://developers.google.com/gtagjs/reference/api
|
|
8486
|
+
https://developers.google.com/tag-platform/gtagjs/reference
|
|
8487
|
+
*/
|
|
8350
8488
|
/**
|
|
8351
|
-
*
|
|
8489
|
+
* @typedef GaOptions
|
|
8490
|
+
* @type {Object}
|
|
8491
|
+
* @property {boolean} [cookieUpdate=true]
|
|
8492
|
+
* @property {number} [cookieExpires=63072000] Default two years
|
|
8493
|
+
* @property {string} [cookieDomain="auto"]
|
|
8494
|
+
* @property {string} [cookieFlags]
|
|
8495
|
+
* @property {string} [userId]
|
|
8496
|
+
* @property {string} [clientId]
|
|
8497
|
+
* @property {boolean} [anonymizeIp]
|
|
8498
|
+
* @property {string} [contentGroup1]
|
|
8499
|
+
* @property {string} [contentGroup2]
|
|
8500
|
+
* @property {string} [contentGroup3]
|
|
8501
|
+
* @property {string} [contentGroup4]
|
|
8502
|
+
* @property {string} [contentGroup5]
|
|
8503
|
+
* @property {boolean} [allowAdFeatures=true]
|
|
8504
|
+
* @property {boolean} [allowAdPersonalizationSignals]
|
|
8505
|
+
* @property {boolean} [nonInteraction]
|
|
8506
|
+
* @property {string} [page]
|
|
8352
8507
|
*/
|
|
8353
|
-
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
8354
|
-
|
|
8355
8508
|
/**
|
|
8356
|
-
*
|
|
8509
|
+
* @typedef UaEventOptions
|
|
8510
|
+
* @type {Object}
|
|
8511
|
+
* @property {string} action
|
|
8512
|
+
* @property {string} category
|
|
8513
|
+
* @property {string} [label]
|
|
8514
|
+
* @property {number} [value]
|
|
8515
|
+
* @property {boolean} [nonInteraction]
|
|
8516
|
+
* @property {('beacon'|'xhr'|'image')} [transport]
|
|
8357
8517
|
*/
|
|
8358
|
-
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
8359
|
-
|
|
8360
8518
|
/**
|
|
8361
|
-
*
|
|
8519
|
+
* @typedef InitOptions
|
|
8520
|
+
* @type {Object}
|
|
8521
|
+
* @property {string} trackingId
|
|
8522
|
+
* @property {GaOptions|any} [gaOptions]
|
|
8523
|
+
* @property {Object} [gtagOptions] New parameter
|
|
8362
8524
|
*/
|
|
8363
|
-
function
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8525
|
+
var GA4 = /*#__PURE__*/function () {
|
|
8526
|
+
function GA4() {
|
|
8527
|
+
var _this = this;
|
|
8528
|
+
_classCallCheck(this, GA4);
|
|
8529
|
+
_defineProperty(this, "reset", function () {
|
|
8530
|
+
_this.isInitialized = false;
|
|
8531
|
+
_this._testMode = false;
|
|
8532
|
+
_this._currentMeasurementId;
|
|
8533
|
+
_this._hasLoadedGA = false;
|
|
8534
|
+
_this._isQueuing = false;
|
|
8535
|
+
_this._queueGtag = [];
|
|
8536
|
+
});
|
|
8537
|
+
_defineProperty(this, "_gtag", function () {
|
|
8538
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8539
|
+
args[_key] = arguments[_key];
|
|
8540
|
+
}
|
|
8541
|
+
if (!_this._testMode) {
|
|
8542
|
+
if (_this._isQueuing) {
|
|
8543
|
+
_this._queueGtag.push(args);
|
|
8544
|
+
} else {
|
|
8545
|
+
_gtag["default"].apply(void 0, args);
|
|
8546
|
+
}
|
|
8547
|
+
} else {
|
|
8548
|
+
_this._queueGtag.push(args);
|
|
8549
|
+
}
|
|
8367
8550
|
});
|
|
8368
|
-
|
|
8369
|
-
|
|
8551
|
+
_defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
|
|
8552
|
+
var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "https://www.googletagmanager.com/gtag/js";
|
|
8553
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
8554
|
+
return;
|
|
8555
|
+
}
|
|
8556
|
+
if (!_this._hasLoadedGA) {
|
|
8557
|
+
// Global Site Tag (gtag.js) - Google Analytics
|
|
8558
|
+
var script = document.createElement("script");
|
|
8559
|
+
script.async = true;
|
|
8560
|
+
script.src = "".concat(gtagUrl, "?id=").concat(GA_MEASUREMENT_ID);
|
|
8561
|
+
if (nonce) {
|
|
8562
|
+
script.setAttribute("nonce", nonce);
|
|
8563
|
+
}
|
|
8564
|
+
document.body.appendChild(script);
|
|
8565
|
+
window.dataLayer = window.dataLayer || [];
|
|
8566
|
+
window.gtag = function gtag() {
|
|
8567
|
+
window.dataLayer.push(arguments);
|
|
8568
|
+
};
|
|
8569
|
+
_this._hasLoadedGA = true;
|
|
8570
|
+
}
|
|
8571
|
+
});
|
|
8572
|
+
_defineProperty(this, "_toGtagOptions", function (gaOptions) {
|
|
8573
|
+
if (!gaOptions) {
|
|
8574
|
+
return;
|
|
8575
|
+
}
|
|
8576
|
+
var mapFields = {
|
|
8577
|
+
// Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
|
|
8578
|
+
// New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
|
|
8579
|
+
cookieUpdate: "cookie_update",
|
|
8580
|
+
cookieExpires: "cookie_expires",
|
|
8581
|
+
cookieDomain: "cookie_domain",
|
|
8582
|
+
cookieFlags: "cookie_flags",
|
|
8583
|
+
// must be in set method?
|
|
8584
|
+
userId: "user_id",
|
|
8585
|
+
clientId: "client_id",
|
|
8586
|
+
anonymizeIp: "anonymize_ip",
|
|
8587
|
+
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
8588
|
+
contentGroup1: "content_group1",
|
|
8589
|
+
contentGroup2: "content_group2",
|
|
8590
|
+
contentGroup3: "content_group3",
|
|
8591
|
+
contentGroup4: "content_group4",
|
|
8592
|
+
contentGroup5: "content_group5",
|
|
8593
|
+
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
8594
|
+
allowAdFeatures: "allow_google_signals",
|
|
8595
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
8596
|
+
nonInteraction: "non_interaction",
|
|
8597
|
+
page: "page_path",
|
|
8598
|
+
hitCallback: "event_callback"
|
|
8599
|
+
};
|
|
8600
|
+
var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
|
|
8601
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
8602
|
+
key = _ref2[0],
|
|
8603
|
+
value = _ref2[1];
|
|
8604
|
+
if (mapFields[key]) {
|
|
8605
|
+
prev[mapFields[key]] = value;
|
|
8606
|
+
} else {
|
|
8607
|
+
prev[key] = value;
|
|
8608
|
+
}
|
|
8609
|
+
return prev;
|
|
8610
|
+
}, {});
|
|
8611
|
+
return gtagOptions;
|
|
8612
|
+
});
|
|
8613
|
+
_defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
|
|
8614
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8615
|
+
if (!GA_MEASUREMENT_ID) {
|
|
8616
|
+
throw new Error("Require GA_MEASUREMENT_ID");
|
|
8617
|
+
}
|
|
8618
|
+
var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
|
|
8619
|
+
trackingId: GA_MEASUREMENT_ID
|
|
8620
|
+
}] : GA_MEASUREMENT_ID;
|
|
8621
|
+
_this._currentMeasurementId = initConfigs[0].trackingId;
|
|
8622
|
+
var gaOptions = options.gaOptions,
|
|
8623
|
+
gtagOptions = options.gtagOptions,
|
|
8624
|
+
nonce = options.nonce,
|
|
8625
|
+
_options$testMode = options.testMode,
|
|
8626
|
+
testMode = _options$testMode === void 0 ? false : _options$testMode,
|
|
8627
|
+
gtagUrl = options.gtagUrl;
|
|
8628
|
+
_this._testMode = testMode;
|
|
8629
|
+
if (!testMode) {
|
|
8630
|
+
_this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);
|
|
8631
|
+
}
|
|
8632
|
+
if (!_this.isInitialized) {
|
|
8633
|
+
_this._gtag("js", new Date());
|
|
8634
|
+
initConfigs.forEach(function (config) {
|
|
8635
|
+
var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);
|
|
8636
|
+
if (Object.keys(mergedGtagOptions).length) {
|
|
8637
|
+
_this._gtag("config", config.trackingId, mergedGtagOptions);
|
|
8638
|
+
} else {
|
|
8639
|
+
_this._gtag("config", config.trackingId);
|
|
8640
|
+
}
|
|
8641
|
+
});
|
|
8642
|
+
}
|
|
8643
|
+
_this.isInitialized = true;
|
|
8644
|
+
if (!testMode) {
|
|
8645
|
+
var queues = _toConsumableArray(_this._queueGtag);
|
|
8646
|
+
_this._queueGtag = [];
|
|
8647
|
+
_this._isQueuing = false;
|
|
8648
|
+
while (queues.length) {
|
|
8649
|
+
var queue = queues.shift();
|
|
8650
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8651
|
+
if (queue[0] === "get") {
|
|
8652
|
+
_this._isQueuing = true;
|
|
8653
|
+
}
|
|
8654
|
+
}
|
|
8655
|
+
}
|
|
8656
|
+
});
|
|
8657
|
+
_defineProperty(this, "set", function (fieldsObject) {
|
|
8658
|
+
if (!fieldsObject) {
|
|
8659
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
8660
|
+
return;
|
|
8661
|
+
}
|
|
8662
|
+
if (_typeof(fieldsObject) !== "object") {
|
|
8663
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
8664
|
+
return;
|
|
8665
|
+
}
|
|
8666
|
+
if (Object.keys(fieldsObject).length === 0) {
|
|
8667
|
+
console.warn("empty `fieldsObject` given to .set()");
|
|
8668
|
+
}
|
|
8669
|
+
_this._gaCommand("set", fieldsObject);
|
|
8670
|
+
});
|
|
8671
|
+
_defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
|
|
8672
|
+
_this._gtag("event", eventAction, _objectSpread(_objectSpread({
|
|
8673
|
+
event_category: eventCategory,
|
|
8674
|
+
event_label: eventLabel,
|
|
8675
|
+
value: eventValue
|
|
8676
|
+
}, fieldsObject && {
|
|
8677
|
+
non_interaction: fieldsObject.nonInteraction
|
|
8678
|
+
}), _this._toGtagOptions(fieldsObject)));
|
|
8679
|
+
});
|
|
8680
|
+
_defineProperty(this, "_gaCommandSendEventParameters", function () {
|
|
8681
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8682
|
+
args[_key2] = arguments[_key2];
|
|
8683
|
+
}
|
|
8684
|
+
if (typeof args[0] === "string") {
|
|
8685
|
+
_this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8686
|
+
} else {
|
|
8687
|
+
var _args$ = args[0],
|
|
8688
|
+
eventCategory = _args$.eventCategory,
|
|
8689
|
+
eventAction = _args$.eventAction,
|
|
8690
|
+
eventLabel = _args$.eventLabel,
|
|
8691
|
+
eventValue = _args$.eventValue;
|
|
8692
|
+
_args$.hitType;
|
|
8693
|
+
var rest = _objectWithoutProperties(_args$, _excluded);
|
|
8694
|
+
_this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
|
|
8695
|
+
}
|
|
8696
|
+
});
|
|
8697
|
+
_defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
|
|
8698
|
+
_this._gtag("event", "timing_complete", {
|
|
8699
|
+
name: timingVar,
|
|
8700
|
+
value: timingValue,
|
|
8701
|
+
event_category: timingCategory,
|
|
8702
|
+
event_label: timingLabel
|
|
8703
|
+
});
|
|
8704
|
+
});
|
|
8705
|
+
_defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
|
|
8706
|
+
if (fieldsObject && Object.keys(fieldsObject).length) {
|
|
8707
|
+
var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
|
|
8708
|
+
title = _this$_toGtagOptions.title,
|
|
8709
|
+
location = _this$_toGtagOptions.location,
|
|
8710
|
+
rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
|
|
8711
|
+
_this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
|
|
8712
|
+
page_path: page
|
|
8713
|
+
}), title && {
|
|
8714
|
+
page_title: title
|
|
8715
|
+
}), location && {
|
|
8716
|
+
page_location: location
|
|
8717
|
+
}), rest));
|
|
8718
|
+
} else if (page) {
|
|
8719
|
+
_this._gtag("event", "page_view", {
|
|
8720
|
+
page_path: page
|
|
8721
|
+
});
|
|
8722
|
+
} else {
|
|
8723
|
+
_this._gtag("event", "page_view");
|
|
8724
|
+
}
|
|
8725
|
+
});
|
|
8726
|
+
_defineProperty(this, "_gaCommandSendPageviewParameters", function () {
|
|
8727
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8728
|
+
args[_key3] = arguments[_key3];
|
|
8729
|
+
}
|
|
8730
|
+
if (typeof args[0] === "string") {
|
|
8731
|
+
_this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8732
|
+
} else {
|
|
8733
|
+
var _args$2 = args[0],
|
|
8734
|
+
page = _args$2.page;
|
|
8735
|
+
_args$2.hitType;
|
|
8736
|
+
var rest = _objectWithoutProperties(_args$2, _excluded3);
|
|
8737
|
+
_this._gaCommandSendPageview(page, rest);
|
|
8738
|
+
}
|
|
8739
|
+
});
|
|
8740
|
+
_defineProperty(this, "_gaCommandSend", function () {
|
|
8741
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
8742
|
+
args[_key4] = arguments[_key4];
|
|
8743
|
+
}
|
|
8744
|
+
var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
|
|
8745
|
+
switch (hitType) {
|
|
8746
|
+
case "event":
|
|
8747
|
+
_this._gaCommandSendEventParameters.apply(_this, args);
|
|
8748
|
+
break;
|
|
8749
|
+
case "pageview":
|
|
8750
|
+
_this._gaCommandSendPageviewParameters.apply(_this, args);
|
|
8751
|
+
break;
|
|
8752
|
+
case "timing":
|
|
8753
|
+
_this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8754
|
+
break;
|
|
8755
|
+
case "screenview":
|
|
8756
|
+
case "transaction":
|
|
8757
|
+
case "item":
|
|
8758
|
+
case "social":
|
|
8759
|
+
case "exception":
|
|
8760
|
+
console.warn("Unsupported send command: ".concat(hitType));
|
|
8761
|
+
break;
|
|
8762
|
+
default:
|
|
8763
|
+
console.warn("Send command doesn't exist: ".concat(hitType));
|
|
8764
|
+
}
|
|
8765
|
+
});
|
|
8766
|
+
_defineProperty(this, "_gaCommandSet", function () {
|
|
8767
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8768
|
+
args[_key5] = arguments[_key5];
|
|
8769
|
+
}
|
|
8770
|
+
if (typeof args[0] === "string") {
|
|
8771
|
+
args[0] = _defineProperty({}, args[0], args[1]);
|
|
8772
|
+
}
|
|
8773
|
+
_this._gtag("set", _this._toGtagOptions(args[0]));
|
|
8774
|
+
});
|
|
8775
|
+
_defineProperty(this, "_gaCommand", function (command) {
|
|
8776
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
8777
|
+
args[_key6 - 1] = arguments[_key6];
|
|
8778
|
+
}
|
|
8779
|
+
switch (command) {
|
|
8780
|
+
case "send":
|
|
8781
|
+
_this._gaCommandSend.apply(_this, args);
|
|
8782
|
+
break;
|
|
8783
|
+
case "set":
|
|
8784
|
+
_this._gaCommandSet.apply(_this, args);
|
|
8785
|
+
break;
|
|
8786
|
+
default:
|
|
8787
|
+
console.warn("Command doesn't exist: ".concat(command));
|
|
8788
|
+
}
|
|
8789
|
+
});
|
|
8790
|
+
_defineProperty(this, "ga", function () {
|
|
8791
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8792
|
+
args[_key7] = arguments[_key7];
|
|
8793
|
+
}
|
|
8794
|
+
if (typeof args[0] === "string") {
|
|
8795
|
+
_this._gaCommand.apply(_this, args);
|
|
8796
|
+
} else {
|
|
8797
|
+
var readyCallback = args[0];
|
|
8798
|
+
_this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
|
|
8799
|
+
_this._isQueuing = false;
|
|
8800
|
+
var queues = _this._queueGtag;
|
|
8801
|
+
readyCallback({
|
|
8802
|
+
get: function get(property) {
|
|
8803
|
+
return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
|
|
8804
|
+
}
|
|
8805
|
+
});
|
|
8806
|
+
while (queues.length) {
|
|
8807
|
+
var queue = queues.shift();
|
|
8808
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8809
|
+
}
|
|
8810
|
+
});
|
|
8811
|
+
_this._isQueuing = true;
|
|
8812
|
+
}
|
|
8813
|
+
return _this.ga;
|
|
8814
|
+
});
|
|
8815
|
+
_defineProperty(this, "event", function (optionsOrName, params) {
|
|
8816
|
+
if (typeof optionsOrName === "string") {
|
|
8817
|
+
_this._gtag("event", optionsOrName, _this._toGtagOptions(params));
|
|
8818
|
+
} else {
|
|
8819
|
+
var action = optionsOrName.action,
|
|
8820
|
+
category = optionsOrName.category,
|
|
8821
|
+
label = optionsOrName.label,
|
|
8822
|
+
value = optionsOrName.value,
|
|
8823
|
+
nonInteraction = optionsOrName.nonInteraction,
|
|
8824
|
+
transport = optionsOrName.transport;
|
|
8825
|
+
if (!category || !action) {
|
|
8826
|
+
console.warn("args.category AND args.action are required in event()");
|
|
8827
|
+
return;
|
|
8828
|
+
}
|
|
8829
|
+
|
|
8830
|
+
// Required Fields
|
|
8831
|
+
var fieldObject = {
|
|
8832
|
+
hitType: "event",
|
|
8833
|
+
eventCategory: (0, _format["default"])(category),
|
|
8834
|
+
eventAction: (0, _format["default"])(action)
|
|
8835
|
+
};
|
|
8836
|
+
|
|
8837
|
+
// Optional Fields
|
|
8838
|
+
if (label) {
|
|
8839
|
+
fieldObject.eventLabel = (0, _format["default"])(label);
|
|
8840
|
+
}
|
|
8841
|
+
if (typeof value !== "undefined") {
|
|
8842
|
+
if (typeof value !== "number") {
|
|
8843
|
+
console.warn("Expected `args.value` arg to be a Number.");
|
|
8844
|
+
} else {
|
|
8845
|
+
fieldObject.eventValue = value;
|
|
8846
|
+
}
|
|
8847
|
+
}
|
|
8848
|
+
if (typeof nonInteraction !== "undefined") {
|
|
8849
|
+
if (typeof nonInteraction !== "boolean") {
|
|
8850
|
+
console.warn("`args.nonInteraction` must be a boolean.");
|
|
8851
|
+
} else {
|
|
8852
|
+
fieldObject.nonInteraction = nonInteraction;
|
|
8853
|
+
}
|
|
8854
|
+
}
|
|
8855
|
+
if (typeof transport !== "undefined") {
|
|
8856
|
+
if (typeof transport !== "string") {
|
|
8857
|
+
console.warn("`args.transport` must be a string.");
|
|
8858
|
+
} else {
|
|
8859
|
+
if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
|
|
8860
|
+
console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
|
|
8861
|
+
}
|
|
8862
|
+
fieldObject.transport = transport;
|
|
8863
|
+
}
|
|
8864
|
+
}
|
|
8865
|
+
_this._gaCommand("send", fieldObject);
|
|
8866
|
+
}
|
|
8867
|
+
});
|
|
8868
|
+
_defineProperty(this, "send", function (fieldObject) {
|
|
8869
|
+
_this._gaCommand("send", fieldObject);
|
|
8870
|
+
});
|
|
8871
|
+
this.reset();
|
|
8370
8872
|
}
|
|
8371
|
-
|
|
8873
|
+
_createClass(GA4, [{
|
|
8874
|
+
key: "gtag",
|
|
8875
|
+
value: function gtag() {
|
|
8876
|
+
this._gtag.apply(this, arguments);
|
|
8877
|
+
}
|
|
8878
|
+
}]);
|
|
8879
|
+
return GA4;
|
|
8880
|
+
}();
|
|
8881
|
+
exports.GA4 = GA4;
|
|
8882
|
+
var _default = new GA4();
|
|
8883
|
+
exports["default"] = _default;
|
|
8884
|
+
});
|
|
8885
|
+
|
|
8886
|
+
unwrapExports(ga4);
|
|
8887
|
+
ga4.GA4;
|
|
8888
|
+
|
|
8889
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
8890
|
+
|
|
8891
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8892
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8893
|
+
value: true
|
|
8894
|
+
});
|
|
8895
|
+
exports["default"] = exports.ReactGAImplementation = void 0;
|
|
8896
|
+
var _ga = _interopRequireWildcard(ga4);
|
|
8897
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
8898
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
8899
|
+
var ReactGAImplementation = _ga.GA4;
|
|
8900
|
+
exports.ReactGAImplementation = ReactGAImplementation;
|
|
8901
|
+
var _default = _ga["default"];
|
|
8902
|
+
exports["default"] = _default;
|
|
8903
|
+
});
|
|
8904
|
+
|
|
8905
|
+
var ReactGA4 = unwrapExports(dist);
|
|
8906
|
+
dist.ReactGAImplementation;
|
|
8372
8907
|
|
|
8908
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
8909
|
+
const ReactGA$d = (_window$d = window) !== null && _window$d !== void 0 && (_window$Pelcro$d = _window$d.Pelcro) !== null && _window$Pelcro$d !== void 0 && (_window$Pelcro$uiSett$d = _window$Pelcro$d.uiSettings) !== null && _window$Pelcro$uiSett$d !== void 0 && _window$Pelcro$uiSett$d.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
8373
8910
|
class PelcroActions {
|
|
8374
8911
|
constructor(storeSetter, storeGetter) {
|
|
8375
8912
|
var _this = this;
|
|
@@ -8561,7 +9098,7 @@ class PelcroActions {
|
|
|
8561
9098
|
return console.warn("You are already logged out.");
|
|
8562
9099
|
}
|
|
8563
9100
|
window.Pelcro.user.logout();
|
|
8564
|
-
ReactGA$
|
|
9101
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$event = ReactGA$d.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$d, {
|
|
8565
9102
|
category: "ACTIONS",
|
|
8566
9103
|
action: "Logged out",
|
|
8567
9104
|
nonInteraction: true
|
|
@@ -8790,6 +9327,9 @@ if (process.env.NODE_ENV === "development") {
|
|
|
8790
9327
|
c$1("Pelcro Store", usePelcro);
|
|
8791
9328
|
}
|
|
8792
9329
|
|
|
9330
|
+
var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
|
|
9331
|
+
const ReactGA$c = (_window$c = window) !== null && _window$c !== void 0 && (_window$Pelcro$c = _window$c.Pelcro) !== null && _window$Pelcro$c !== void 0 && (_window$Pelcro$uiSett$c = _window$Pelcro$c.uiSettings) !== null && _window$Pelcro$uiSett$c !== void 0 && _window$Pelcro$uiSett$c.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
9332
|
+
|
|
8793
9333
|
/**
|
|
8794
9334
|
* List of zero-decimal currencies.
|
|
8795
9335
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8804,16 +9344,19 @@ const ZERO_DECIMAL_CURRENCIES = ["BIF", "CLP", "DJF", "GNF", "JPY", "KMF", "KRW"
|
|
|
8804
9344
|
const isCurrencyZeroDecimal = currency => ZERO_DECIMAL_CURRENCIES.includes(currency.toUpperCase());
|
|
8805
9345
|
const sortCountries = countries => {
|
|
8806
9346
|
const sortable = [];
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
9347
|
+
const {
|
|
9348
|
+
CA,
|
|
9349
|
+
US,
|
|
9350
|
+
...rest
|
|
9351
|
+
} = countries;
|
|
9352
|
+
for (const abbr in rest) {
|
|
9353
|
+
sortable.push([abbr, rest[abbr]]);
|
|
8811
9354
|
}
|
|
8812
9355
|
sortable.sort((a, b) => {
|
|
8813
9356
|
if (a[1] > b[1]) return 1;
|
|
8814
9357
|
return -1;
|
|
8815
9358
|
});
|
|
8816
|
-
sortable.unshift(["US",
|
|
9359
|
+
sortable.unshift(["US", US], ["CA", CA]);
|
|
8817
9360
|
return sortable;
|
|
8818
9361
|
};
|
|
8819
9362
|
|
|
@@ -8872,8 +9415,8 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8872
9415
|
* @return {string | undefined}
|
|
8873
9416
|
*/
|
|
8874
9417
|
const getPageOrDefaultLanguage = () => {
|
|
8875
|
-
var _window$Pelcro$helper, _window$
|
|
8876
|
-
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$
|
|
9418
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
9419
|
+
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$site = _window$Pelcro2.site) === null || _window$Pelcro2$site === void 0 ? void 0 : (_window$Pelcro2$site$ = _window$Pelcro2$site.read) === null || _window$Pelcro2$site$ === void 0 ? void 0 : (_window$Pelcro2$site$2 = _window$Pelcro2$site$.call(_window$Pelcro2$site)) === null || _window$Pelcro2$site$2 === void 0 ? void 0 : _window$Pelcro2$site$2.default_locale);
|
|
8877
9420
|
};
|
|
8878
9421
|
|
|
8879
9422
|
/**
|
|
@@ -8926,9 +9469,9 @@ const isValidViewFromURL = viewID => {
|
|
|
8926
9469
|
*
|
|
8927
9470
|
*/
|
|
8928
9471
|
function hasValidNewsletterUpdateUrl() {
|
|
8929
|
-
var _window$
|
|
9472
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8930
9473
|
if (viewID !== "newsletter-update") return false;
|
|
8931
|
-
const newsletters = (_window$
|
|
9474
|
+
const newsletters = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.newsletters;
|
|
8932
9475
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8933
9476
|
if (!siteHasNewslettersDefined) {
|
|
8934
9477
|
return false;
|
|
@@ -8993,16 +9536,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
8993
9536
|
return;
|
|
8994
9537
|
}
|
|
8995
9538
|
const currencyCode = (_window$Pelcro$user$r5 = (_window$Pelcro$user$r6 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r6 === void 0 ? void 0 : _window$Pelcro$user$r6.currency) !== null && _window$Pelcro$user$r5 !== void 0 ? _window$Pelcro$user$r5 : plan.currency;
|
|
8996
|
-
ReactGA$
|
|
9539
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$set = ReactGA$c.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA$c, {
|
|
8997
9540
|
currencyCode: currencyCode
|
|
8998
9541
|
});
|
|
8999
|
-
ReactGA$
|
|
9542
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$c.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$execu = _ReactGA$plugin.execute) === null || _ReactGA$plugin$execu === void 0 ? void 0 : _ReactGA$plugin$execu.call(_ReactGA$plugin, "ecommerce", "addTransaction", {
|
|
9000
9543
|
id: lastSubscriptionId,
|
|
9001
9544
|
affiliation: "Pelcro",
|
|
9002
9545
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9003
9546
|
coupon: couponCode
|
|
9004
9547
|
});
|
|
9005
|
-
ReactGA$
|
|
9548
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA$c.plugin) === null || _ReactGA$plugin2 === void 0 ? void 0 : (_ReactGA$plugin2$exec = _ReactGA$plugin2.execute) === null || _ReactGA$plugin2$exec === void 0 ? void 0 : _ReactGA$plugin2$exec.call(_ReactGA$plugin2, "ecommerce", "addItem", {
|
|
9006
9549
|
id: lastSubscriptionId,
|
|
9007
9550
|
name: product.name,
|
|
9008
9551
|
category: product.description,
|
|
@@ -9010,8 +9553,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
9010
9553
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9011
9554
|
quantity: 1
|
|
9012
9555
|
});
|
|
9013
|
-
ReactGA$
|
|
9014
|
-
ReactGA$
|
|
9556
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA$c.plugin) === null || _ReactGA$plugin3 === void 0 ? void 0 : (_ReactGA$plugin3$exec = _ReactGA$plugin3.execute) === null || _ReactGA$plugin3$exec === void 0 ? void 0 : _ReactGA$plugin3$exec.call(_ReactGA$plugin3, "ecommerce", "send");
|
|
9557
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$event = ReactGA$c.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$c, {
|
|
9015
9558
|
category: "ACTIONS",
|
|
9016
9559
|
action: "Subscribed",
|
|
9017
9560
|
nonInteraction: true
|
|
@@ -9099,8 +9642,8 @@ function getDateWithoutTime(dateObject) {
|
|
|
9099
9642
|
return date;
|
|
9100
9643
|
}
|
|
9101
9644
|
function userMustVerifyEmail() {
|
|
9102
|
-
var _window$Pelcro$site$
|
|
9103
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9645
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9646
|
+
const isEmailVerificationEnabled = (_window$Pelcro$site$r = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.email_verify_enabled) !== null && _window$Pelcro$site$r !== void 0 ? _window$Pelcro$site$r : false;
|
|
9104
9647
|
const isUserEmailVerified = (_window$Pelcro$user$r9 = (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.email_confirm) !== null && _window$Pelcro$user$r9 !== void 0 ? _window$Pelcro$user$r9 : false;
|
|
9105
9648
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9106
9649
|
}
|
|
@@ -9109,11 +9652,11 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9109
9652
|
//load bugsnag CDN
|
|
9110
9653
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9111
9654
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9112
|
-
var _window$Pelcro$enviro, _window$
|
|
9655
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
9113
9656
|
Bugsnag.start({
|
|
9114
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9657
|
+
apiKey: (_window$Pelcro$enviro = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$envir = _window$Pelcro4.environment) === null || _window$Pelcro4$envir === void 0 ? void 0 : _window$Pelcro4$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
|
|
9115
9658
|
autoDetectErrors: false,
|
|
9116
|
-
releaseStage: (_window$
|
|
9659
|
+
releaseStage: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$envir = _window$Pelcro5.environment) === null || _window$Pelcro5$envir === void 0 ? void 0 : _window$Pelcro5$envir.bugsnagReleaseStage,
|
|
9117
9660
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9118
9661
|
...startOptions
|
|
9119
9662
|
});
|
|
@@ -9123,6 +9666,17 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9123
9666
|
}
|
|
9124
9667
|
callback();
|
|
9125
9668
|
}
|
|
9669
|
+
|
|
9670
|
+
//create a safe and strong password string with special characters
|
|
9671
|
+
function generatePassword() {
|
|
9672
|
+
const length = 16;
|
|
9673
|
+
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+{}|:<>?`~";
|
|
9674
|
+
let retVal = "";
|
|
9675
|
+
for (let i = 0, n = charset.length; i < length; ++i) {
|
|
9676
|
+
retVal += charset.charAt(Math.floor(Math.random() * n));
|
|
9677
|
+
}
|
|
9678
|
+
return retVal;
|
|
9679
|
+
}
|
|
9126
9680
|
function isStringValid(str) {
|
|
9127
9681
|
// Define the regular expression to match only letters, numbers and spaces
|
|
9128
9682
|
var regex = /^[a-zA-Z0-9\s]+$/;
|
|
@@ -9464,8 +10018,10 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9464
10018
|
return descriptor.value;
|
|
9465
10019
|
}
|
|
9466
10020
|
|
|
10021
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
9467
10022
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
9468
10023
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
10024
|
+
const ReactGA$b = (_window$b = window) !== null && _window$b !== void 0 && (_window$Pelcro$b = _window$b.Pelcro) !== null && _window$Pelcro$b !== void 0 && (_window$Pelcro$uiSett$b = _window$Pelcro$b.uiSettings) !== null && _window$Pelcro$uiSett$b !== void 0 && _window$Pelcro$uiSett$b.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
9469
10025
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9470
10026
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
9471
10027
|
var _removeLoadingState = /*#__PURE__*/new WeakMap();
|
|
@@ -9588,7 +10144,7 @@ class SaveToMetadataButtonClass {
|
|
|
9588
10144
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9589
10145
|
}
|
|
9590
10146
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9591
|
-
ReactGA$
|
|
10147
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$event = ReactGA$b.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$b, {
|
|
9592
10148
|
category: "ACTIONS",
|
|
9593
10149
|
action: "Save/Follow",
|
|
9594
10150
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9620,7 +10176,7 @@ class SaveToMetadataButtonClass {
|
|
|
9620
10176
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9621
10177
|
}
|
|
9622
10178
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9623
|
-
ReactGA$
|
|
10179
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$b.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$b, {
|
|
9624
10180
|
category: "ACTIONS",
|
|
9625
10181
|
action: "Unsave/Unfollow",
|
|
9626
10182
|
label: title
|
|
@@ -11147,6 +11703,9 @@ function getSiteCardProcessor() {
|
|
|
11147
11703
|
return "stripe";
|
|
11148
11704
|
}
|
|
11149
11705
|
|
|
11706
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
11707
|
+
const ReactGA$a = (_window$a = window) !== null && _window$a !== void 0 && (_window$Pelcro$a = _window$a.Pelcro) !== null && _window$Pelcro$a !== void 0 && (_window$Pelcro$uiSett$a = _window$Pelcro$a.uiSettings) !== null && _window$Pelcro$uiSett$a !== void 0 && _window$Pelcro$uiSett$a.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
11708
|
+
|
|
11150
11709
|
/**
|
|
11151
11710
|
* @typedef {Object} OptionsType
|
|
11152
11711
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -11270,12 +11829,12 @@ const initSecuritySdk = () => {
|
|
|
11270
11829
|
};
|
|
11271
11830
|
const initGATracking = () => {
|
|
11272
11831
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
11273
|
-
ReactGA$
|
|
11274
|
-
ReactGA$
|
|
11832
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$initialize = ReactGA$a.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA$a, window.Pelcro.site.read().google_analytics_id);
|
|
11833
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$a.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$requi = _ReactGA$plugin.require) === null || _ReactGA$plugin$requi === void 0 ? void 0 : _ReactGA$plugin$requi.call(_ReactGA$plugin, "ecommerce");
|
|
11275
11834
|
};
|
|
11276
11835
|
const dispatchModalDisplayEvents = modalName => {
|
|
11277
11836
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
11278
|
-
ReactGA$
|
|
11837
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$event = ReactGA$a.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$a, {
|
|
11279
11838
|
category: "VIEWS",
|
|
11280
11839
|
action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
|
|
11281
11840
|
nonInteraction: true
|
|
@@ -12207,9 +12766,9 @@ const LoginContainer = _ref => {
|
|
|
12207
12766
|
});
|
|
12208
12767
|
onFailure(err);
|
|
12209
12768
|
} else {
|
|
12210
|
-
var _ReactGA
|
|
12769
|
+
var _ReactGA$event;
|
|
12211
12770
|
onSuccess(res);
|
|
12212
|
-
|
|
12771
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
12213
12772
|
category: "ACTIONS",
|
|
12214
12773
|
action: "Logged in",
|
|
12215
12774
|
nonInteraction: true
|
|
@@ -12599,11 +13158,13 @@ function ConfirmPassword(_ref) {
|
|
|
12599
13158
|
}, otherProps));
|
|
12600
13159
|
}
|
|
12601
13160
|
|
|
13161
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
13162
|
+
const ReactGA$9 = (_window$9 = window) !== null && _window$9 !== void 0 && (_window$Pelcro$9 = _window$9.Pelcro) !== null && _window$Pelcro$9 !== void 0 && (_window$Pelcro$uiSett$9 = _window$Pelcro$9.uiSettings) !== null && _window$Pelcro$uiSett$9 !== void 0 && _window$Pelcro$uiSett$9.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
12602
13163
|
const Logout = props => {
|
|
12603
13164
|
const handleLogout = () => {
|
|
12604
13165
|
var _ReactGA$event;
|
|
12605
13166
|
window.Pelcro.user.logout();
|
|
12606
|
-
ReactGA$
|
|
13167
|
+
ReactGA$9 === null || ReactGA$9 === void 0 ? void 0 : (_ReactGA$event = ReactGA$9.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$9, {
|
|
12607
13168
|
category: "ACTIONS",
|
|
12608
13169
|
action: "Logged out",
|
|
12609
13170
|
nonInteraction: true
|
|
@@ -14165,6 +14726,9 @@ const RegisterCompany = props => {
|
|
|
14165
14726
|
}, props));
|
|
14166
14727
|
};
|
|
14167
14728
|
|
|
14729
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
14730
|
+
const ReactGA$8 = (_window$8 = window) !== null && _window$8 !== void 0 && (_window$Pelcro$8 = _window$8.Pelcro) !== null && _window$Pelcro$8 !== void 0 && (_window$Pelcro$uiSett$8 = _window$Pelcro$8.uiSettings) !== null && _window$Pelcro$uiSett$8 !== void 0 && _window$Pelcro$uiSett$8.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
14731
|
+
|
|
14168
14732
|
/**
|
|
14169
14733
|
*
|
|
14170
14734
|
*/
|
|
@@ -14190,7 +14754,7 @@ function RegisterModal(props) {
|
|
|
14190
14754
|
};
|
|
14191
14755
|
const handleAfterRegistrationLogic = () => {
|
|
14192
14756
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
14193
|
-
ReactGA$
|
|
14757
|
+
ReactGA$8 === null || ReactGA$8 === void 0 ? void 0 : (_ReactGA$event = ReactGA$8.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$8, {
|
|
14194
14758
|
category: "ACTIONS",
|
|
14195
14759
|
action: "Registered",
|
|
14196
14760
|
nonInteraction: true
|
|
@@ -14281,6 +14845,9 @@ function Radio(_ref) {
|
|
|
14281
14845
|
}, children));
|
|
14282
14846
|
}
|
|
14283
14847
|
|
|
14848
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
14849
|
+
const ReactGA$7 = (_window$7 = window) !== null && _window$7 !== void 0 && (_window$Pelcro$7 = _window$7.Pelcro) !== null && _window$Pelcro$7 !== void 0 && (_window$Pelcro$uiSett$7 = _window$Pelcro$7.uiSettings) !== null && _window$Pelcro$uiSett$7 !== void 0 && _window$Pelcro$uiSett$7.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
14850
|
+
|
|
14284
14851
|
/**
|
|
14285
14852
|
*
|
|
14286
14853
|
*/
|
|
@@ -14374,11 +14941,11 @@ class SelectModal extends Component {
|
|
|
14374
14941
|
}
|
|
14375
14942
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14376
14943
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14377
|
-
var _window$
|
|
14378
|
-
const userCurrency = (_window$
|
|
14379
|
-
const userCountry = (_window$
|
|
14380
|
-
const userLanguage = (_window$
|
|
14381
|
-
const productsMatchingUserCurrency = (_window$
|
|
14944
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
14945
|
+
const userCurrency = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read().currency;
|
|
14946
|
+
const userCountry = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$user = _window$Pelcro3.user) === null || _window$Pelcro3$user === void 0 ? void 0 : _window$Pelcro3$user.location.countryCode;
|
|
14947
|
+
const userLanguage = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$user = _window$Pelcro4.user) === null || _window$Pelcro4$user === void 0 ? void 0 : _window$Pelcro4$user.read().language;
|
|
14948
|
+
const productsMatchingUserCurrency = (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read().products.filter(product => {
|
|
14382
14949
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14383
14950
|
if (filteredPlans.length) return filteredPlans;
|
|
14384
14951
|
});
|
|
@@ -14391,12 +14958,12 @@ class SelectModal extends Component {
|
|
|
14391
14958
|
});
|
|
14392
14959
|
notifyBugsnag(() => {
|
|
14393
14960
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14394
|
-
var _window$
|
|
14961
|
+
var _window$Pelcro6, _window$Pelcro6$site, _window$Pelcro7, _window$Pelcro7$user, _window$Pelcro8, _window$Pelcro8$uiSet, _window$Pelcro9, _this$props, _window$Pelcro10, _window$Pelcro10$help, _window$Pelcro11, _window$Pelcro11$site;
|
|
14395
14962
|
event.addMetadata("MetaData", {
|
|
14396
|
-
site: (_window$
|
|
14397
|
-
user: (_window$
|
|
14398
|
-
uiVersion: (_window$
|
|
14399
|
-
environment: (_window$
|
|
14963
|
+
site: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$site = _window$Pelcro6.site) === null || _window$Pelcro6$site === void 0 ? void 0 : _window$Pelcro6$site.read(),
|
|
14964
|
+
user: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$user = _window$Pelcro7.user) === null || _window$Pelcro7$user === void 0 ? void 0 : _window$Pelcro7$user.read(),
|
|
14965
|
+
uiVersion: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : (_window$Pelcro8$uiSet = _window$Pelcro8.uiSettings) === null || _window$Pelcro8$uiSet === void 0 ? void 0 : _window$Pelcro8$uiSet.uiVersion,
|
|
14966
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
14400
14967
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14401
14968
|
productListState: this.state.productList,
|
|
14402
14969
|
methods: {
|
|
@@ -14407,8 +14974,8 @@ class SelectModal extends Component {
|
|
|
14407
14974
|
userCurrency: userCurrency,
|
|
14408
14975
|
userCountry: userCountry,
|
|
14409
14976
|
userLanguage: userLanguage,
|
|
14410
|
-
siteLanguage: (_window$
|
|
14411
|
-
products: (_window$
|
|
14977
|
+
siteLanguage: (_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$help = _window$Pelcro10.helpers) === null || _window$Pelcro10$help === void 0 ? void 0 : _window$Pelcro10$help.getHtmlLanguageAttribute(),
|
|
14978
|
+
products: (_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : (_window$Pelcro11$site = _window$Pelcro11.site) === null || _window$Pelcro11$site === void 0 ? void 0 : _window$Pelcro11$site.read().products.length,
|
|
14412
14979
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
14413
14980
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
14414
14981
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -14628,14 +15195,14 @@ class SelectModal extends Component {
|
|
|
14628
15195
|
} = this.props;
|
|
14629
15196
|
if (this.state.mode === "product") {
|
|
14630
15197
|
var _ReactGA$event;
|
|
14631
|
-
ReactGA$
|
|
15198
|
+
ReactGA$7 === null || ReactGA$7 === void 0 ? void 0 : (_ReactGA$event = ReactGA$7.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$7, {
|
|
14632
15199
|
category: "VIEWS",
|
|
14633
15200
|
action: "Product Modal Viewed",
|
|
14634
15201
|
nonInteraction: true
|
|
14635
15202
|
});
|
|
14636
15203
|
} else if (this.state.mode === "plan") {
|
|
14637
15204
|
var _ReactGA$event2;
|
|
14638
|
-
ReactGA$
|
|
15205
|
+
ReactGA$7 === null || ReactGA$7 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$7.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$7, {
|
|
14639
15206
|
category: "VIEWS",
|
|
14640
15207
|
action: "Plan Modal Viewed",
|
|
14641
15208
|
nonInteraction: true
|
|
@@ -15070,14 +15637,14 @@ class DonationModal extends Component {
|
|
|
15070
15637
|
this.props;
|
|
15071
15638
|
if (this.state.mode === "product") {
|
|
15072
15639
|
var _ReactGA$event;
|
|
15073
|
-
|
|
15640
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
15074
15641
|
category: "VIEWS",
|
|
15075
15642
|
action: "Product Modal Viewed",
|
|
15076
15643
|
nonInteraction: true
|
|
15077
15644
|
});
|
|
15078
15645
|
} else if (this.state.mode === "plan") {
|
|
15079
15646
|
var _ReactGA$event2;
|
|
15080
|
-
|
|
15647
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA1.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA1, {
|
|
15081
15648
|
category: "VIEWS",
|
|
15082
15649
|
action: "Plan Modal Viewed",
|
|
15083
15650
|
nonInteraction: true
|
|
@@ -17397,19 +17964,25 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17397
17964
|
|
|
17398
17965
|
/*====== Start Cybersource integration ========*/
|
|
17399
17966
|
const cybersourceErrorHandle = err => {
|
|
17400
|
-
var _err$details, _err$details$response;
|
|
17401
|
-
|
|
17967
|
+
var _err$details, _err$details$response, _err$details$response2;
|
|
17968
|
+
if ((err === null || err === void 0 ? void 0 : (_err$details = err.details) === null || _err$details === void 0 ? void 0 : (_err$details$response = _err$details.responseStatus) === null || _err$details$response === void 0 ? void 0 : (_err$details$response2 = _err$details$response.details) === null || _err$details$response2 === void 0 ? void 0 : _err$details$response2.length) > 0) {
|
|
17969
|
+
var _err$details2, _err$details2$respons;
|
|
17970
|
+
const errorMessages = [];
|
|
17402
17971
|
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17406
|
-
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
|
|
17972
|
+
// enumerable error (ex: validation errors)
|
|
17973
|
+
Object.values(err === null || err === void 0 ? void 0 : (_err$details2 = err.details) === null || _err$details2 === void 0 ? void 0 : (_err$details2$respons = _err$details2.responseStatus) === null || _err$details2$respons === void 0 ? void 0 : _err$details2$respons.details).forEach(_ref2 => {
|
|
17974
|
+
let {
|
|
17975
|
+
message
|
|
17976
|
+
} = _ref2;
|
|
17977
|
+
errorMessages.push(message);
|
|
17978
|
+
});
|
|
17410
17979
|
|
|
17411
|
-
|
|
17412
|
-
|
|
17980
|
+
// convert to multiline string
|
|
17981
|
+
return errorMessages.join("\n");
|
|
17982
|
+
} else {
|
|
17983
|
+
var _err$details3;
|
|
17984
|
+
return getErrorMessages(err === null || err === void 0 ? void 0 : (_err$details3 = err.details) === null || _err$details3 === void 0 ? void 0 : _err$details3.responseStatus);
|
|
17985
|
+
}
|
|
17413
17986
|
};
|
|
17414
17987
|
const submitUsingCybersource = (state, dispatch) => {
|
|
17415
17988
|
var _cybersourceInstanceR;
|
|
@@ -18857,7 +19430,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18857
19430
|
const sendRegisterRequest = (state, callback) => {
|
|
18858
19431
|
window.Pelcro.user.register({
|
|
18859
19432
|
email: state.email,
|
|
18860
|
-
password:
|
|
19433
|
+
password: generatePassword()
|
|
18861
19434
|
}, (err, res) => {
|
|
18862
19435
|
if (err) {
|
|
18863
19436
|
var _err$response, _err$response$data;
|
|
@@ -19591,12 +20164,12 @@ const CheckoutForm = () => {
|
|
|
19591
20164
|
className: "plc-w-6/12 plc-pr-4"
|
|
19592
20165
|
}, /*#__PURE__*/React__default.createElement(MonthSelect, {
|
|
19593
20166
|
store: store$k,
|
|
19594
|
-
placeholder: "Exp Month"
|
|
20167
|
+
placeholder: "Exp Month *"
|
|
19595
20168
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
19596
20169
|
className: "plc-w-6/12"
|
|
19597
20170
|
}, /*#__PURE__*/React__default.createElement(YearSelect, {
|
|
19598
20171
|
store: store$k,
|
|
19599
|
-
placeholder: "Exp Year"
|
|
20172
|
+
placeholder: "Exp Year *"
|
|
19600
20173
|
}))));
|
|
19601
20174
|
}
|
|
19602
20175
|
if (cardProcessor === "stripe") {
|
|
@@ -19659,7 +20232,7 @@ const DiscountedPrice = props => {
|
|
|
19659
20232
|
};
|
|
19660
20233
|
|
|
19661
20234
|
const SubmitPaymentMethod = _ref => {
|
|
19662
|
-
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
|
|
20235
|
+
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
19663
20236
|
let {
|
|
19664
20237
|
onClick,
|
|
19665
20238
|
...otherProps
|
|
@@ -19667,7 +20240,8 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19667
20240
|
const {
|
|
19668
20241
|
plan,
|
|
19669
20242
|
selectedDonationAmount,
|
|
19670
|
-
customDonationAmount
|
|
20243
|
+
customDonationAmount,
|
|
20244
|
+
selectedPaymentMethodId
|
|
19671
20245
|
} = usePelcro();
|
|
19672
20246
|
const {
|
|
19673
20247
|
t
|
|
@@ -19685,13 +20259,16 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19685
20259
|
phone,
|
|
19686
20260
|
disableSubmit,
|
|
19687
20261
|
isLoading,
|
|
19688
|
-
updatedPrice
|
|
20262
|
+
updatedPrice,
|
|
20263
|
+
month,
|
|
20264
|
+
year
|
|
19689
20265
|
}
|
|
19690
20266
|
} = useContext(store$k);
|
|
19691
20267
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
19692
20268
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
19693
20269
|
const priceFormatted = (plan === null || plan === void 0 ? void 0 : plan.type) === "donation" && (selectedDonationAmount || customDonationAmount) ? getFormattedPriceByLocal(selectedDonationAmount ? selectedDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity2 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity2 !== void 0 ? _plan$quantity2 : 1) : customDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity3 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity3 !== void 0 ? _plan$quantity3 : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()) : getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
19694
20270
|
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
20271
|
+
const supportsCybersource = Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.cybersource_gateway_settings);
|
|
19695
20272
|
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
19696
20273
|
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
19697
20274
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
@@ -19700,9 +20277,9 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19700
20277
|
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
19701
20278
|
setDisabled(disableSubmit);
|
|
19702
20279
|
} else {
|
|
19703
|
-
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError);
|
|
20280
|
+
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !selectedPaymentMethodId && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !selectedPaymentMethodId && !(year !== null && year !== void 0 && year.length));
|
|
19704
20281
|
}
|
|
19705
|
-
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError]);
|
|
20282
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
|
|
19706
20283
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
19707
20284
|
role: "submit",
|
|
19708
20285
|
className: "plc-w-full plc-py-3",
|
|
@@ -20341,10 +20918,6 @@ const DonationEmail = props => /*#__PURE__*/React__default.createElement(Email,
|
|
|
20341
20918
|
store: store$k
|
|
20342
20919
|
}, props));
|
|
20343
20920
|
|
|
20344
|
-
const DonationPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
|
|
20345
|
-
store: store$k
|
|
20346
|
-
}, props));
|
|
20347
|
-
|
|
20348
20921
|
/**
|
|
20349
20922
|
*
|
|
20350
20923
|
*/
|
|
@@ -20431,11 +21004,6 @@ function PaymentMethodView(_ref) {
|
|
|
20431
21004
|
label: t("labels.email"),
|
|
20432
21005
|
required: true,
|
|
20433
21006
|
autoFocus: true
|
|
20434
|
-
}), /*#__PURE__*/React__default.createElement(DonationPassword, {
|
|
20435
|
-
id: "pelcro-input-password",
|
|
20436
|
-
errorId: "pelcro-input-password-error",
|
|
20437
|
-
label: t("labels.password"),
|
|
20438
|
-
required: true
|
|
20439
21007
|
})), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement("div", {
|
|
20440
21008
|
className: "plc-mb-2"
|
|
20441
21009
|
}, /*#__PURE__*/React__default.createElement(CouponCode, null), /*#__PURE__*/React__default.createElement(DiscountedPrice, null)), /*#__PURE__*/React__default.createElement(TaxAmount, null), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -20498,6 +21066,9 @@ const SubscriptionRenewView = _ref => {
|
|
|
20498
21066
|
}));
|
|
20499
21067
|
};
|
|
20500
21068
|
|
|
21069
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
21070
|
+
const ReactGA$6 = (_window$6 = window) !== null && _window$6 !== void 0 && (_window$Pelcro$6 = _window$6.Pelcro) !== null && _window$Pelcro$6 !== void 0 && (_window$Pelcro$uiSett$6 = _window$Pelcro$6.uiSettings) !== null && _window$Pelcro$uiSett$6 !== void 0 && _window$Pelcro$uiSett$6.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
21071
|
+
|
|
20501
21072
|
/**
|
|
20502
21073
|
*
|
|
20503
21074
|
*/
|
|
@@ -20513,7 +21084,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20513
21084
|
const onSuccess = res => {
|
|
20514
21085
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
20515
21086
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
20516
|
-
ReactGA$
|
|
21087
|
+
ReactGA$6 === null || ReactGA$6 === void 0 ? void 0 : (_ReactGA$event = ReactGA$6.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$6, {
|
|
20517
21088
|
category: "ACTIONS",
|
|
20518
21089
|
action: "Renewed",
|
|
20519
21090
|
nonInteraction: true
|
|
@@ -20523,7 +21094,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20523
21094
|
const onGiftRenewalSuccess = () => {
|
|
20524
21095
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
20525
21096
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
20526
|
-
ReactGA$
|
|
21097
|
+
ReactGA$6 === null || ReactGA$6 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$6.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$6, {
|
|
20527
21098
|
category: "ACTIONS",
|
|
20528
21099
|
action: "Renewed Gift",
|
|
20529
21100
|
nonInteraction: true
|
|
@@ -20697,6 +21268,8 @@ function SvgSubscription(props) {
|
|
|
20697
21268
|
}))))));
|
|
20698
21269
|
}
|
|
20699
21270
|
|
|
21271
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
21272
|
+
const ReactGA$5 = (_window$5 = window) !== null && _window$5 !== void 0 && (_window$Pelcro$5 = _window$5.Pelcro) !== null && _window$Pelcro$5 !== void 0 && (_window$Pelcro$uiSett$5 = _window$Pelcro$5.uiSettings) !== null && _window$Pelcro$uiSett$5 !== void 0 && _window$Pelcro$uiSett$5.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
20700
21273
|
const SubscriptionCancelNowButton = _ref => {
|
|
20701
21274
|
let {
|
|
20702
21275
|
subscription,
|
|
@@ -20728,7 +21301,7 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20728
21301
|
if (err) {
|
|
20729
21302
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20730
21303
|
}
|
|
20731
|
-
ReactGA$
|
|
21304
|
+
ReactGA$5 === null || ReactGA$5 === void 0 ? void 0 : (_ReactGA$event = ReactGA$5.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$5, {
|
|
20732
21305
|
category: "ACTIONS",
|
|
20733
21306
|
action: "Canceled",
|
|
20734
21307
|
nonInteraction: true
|
|
@@ -20767,6 +21340,8 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20767
21340
|
}, t("messages.cancelNow"));
|
|
20768
21341
|
};
|
|
20769
21342
|
|
|
21343
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
21344
|
+
const ReactGA$4 = (_window$4 = window) !== null && _window$4 !== void 0 && (_window$Pelcro$4 = _window$4.Pelcro) !== null && _window$Pelcro$4 !== void 0 && (_window$Pelcro$uiSett$4 = _window$Pelcro$4.uiSettings) !== null && _window$Pelcro$uiSett$4 !== void 0 && _window$Pelcro$uiSett$4.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
20770
21345
|
const SubscriptionCancelLaterButton = _ref => {
|
|
20771
21346
|
let {
|
|
20772
21347
|
subscription,
|
|
@@ -20798,7 +21373,7 @@ const SubscriptionCancelLaterButton = _ref => {
|
|
|
20798
21373
|
if (err) {
|
|
20799
21374
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20800
21375
|
}
|
|
20801
|
-
ReactGA$
|
|
21376
|
+
ReactGA$4 === null || ReactGA$4 === void 0 ? void 0 : (_ReactGA$event = ReactGA$4.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$4, {
|
|
20802
21377
|
category: "ACTIONS",
|
|
20803
21378
|
action: "Canceled",
|
|
20804
21379
|
nonInteraction: true
|
|
@@ -21007,6 +21582,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
21007
21582
|
}, props));
|
|
21008
21583
|
};
|
|
21009
21584
|
|
|
21585
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
21586
|
+
const ReactGA$3 = (_window$3 = window) !== null && _window$3 !== void 0 && (_window$Pelcro$3 = _window$3.Pelcro) !== null && _window$Pelcro$3 !== void 0 && (_window$Pelcro$uiSett$3 = _window$Pelcro$3.uiSettings) !== null && _window$Pelcro$uiSett$3 !== void 0 && _window$Pelcro$uiSett$3.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
21010
21587
|
const SubscriptionSuspendButton = _ref => {
|
|
21011
21588
|
let {
|
|
21012
21589
|
subscription,
|
|
@@ -21037,7 +21614,7 @@ const SubscriptionSuspendButton = _ref => {
|
|
|
21037
21614
|
if (err) {
|
|
21038
21615
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
21039
21616
|
}
|
|
21040
|
-
ReactGA$
|
|
21617
|
+
ReactGA$3 === null || ReactGA$3 === void 0 ? void 0 : (_ReactGA$event = ReactGA$3.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$3, {
|
|
21041
21618
|
category: "ACTIONS",
|
|
21042
21619
|
action: "Suspended",
|
|
21043
21620
|
nonInteraction: true
|
|
@@ -23887,7 +24464,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23887
24464
|
});
|
|
23888
24465
|
onFailure(err);
|
|
23889
24466
|
} else {
|
|
23890
|
-
var _ReactGA
|
|
24467
|
+
var _ReactGA$event;
|
|
23891
24468
|
dispatch({
|
|
23892
24469
|
type: SHOW_ALERT,
|
|
23893
24470
|
payload: {
|
|
@@ -23896,7 +24473,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23896
24473
|
}
|
|
23897
24474
|
});
|
|
23898
24475
|
onSuccess(res);
|
|
23899
|
-
|
|
24476
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
23900
24477
|
category: "ACTIONS",
|
|
23901
24478
|
action: "Updated address",
|
|
23902
24479
|
nonInteraction: true
|
|
@@ -24424,11 +25001,13 @@ function PaymentMethodUpdateView(props) {
|
|
|
24424
25001
|
}));
|
|
24425
25002
|
}
|
|
24426
25003
|
|
|
25004
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
25005
|
+
const ReactGA$2 = (_window$2 = window) !== null && _window$2 !== void 0 && (_window$Pelcro$2 = _window$2.Pelcro) !== null && _window$Pelcro$2 !== void 0 && (_window$Pelcro$uiSett$2 = _window$Pelcro$2.uiSettings) !== null && _window$Pelcro$uiSett$2 !== void 0 && _window$Pelcro$uiSett$2.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
24427
25006
|
const PaymentMethodUpdateModal = props => {
|
|
24428
25007
|
const onSuccess = res => {
|
|
24429
25008
|
var _props$onSuccess, _ReactGA$event;
|
|
24430
25009
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
24431
|
-
ReactGA$
|
|
25010
|
+
ReactGA$2 === null || ReactGA$2 === void 0 ? void 0 : (_ReactGA$event = ReactGA$2.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$2, {
|
|
24432
25011
|
category: "ACTIONS",
|
|
24433
25012
|
action: "Updated payment card",
|
|
24434
25013
|
nonInteraction: true
|
|
@@ -26344,6 +26923,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26344
26923
|
payload: false
|
|
26345
26924
|
});
|
|
26346
26925
|
if (err) {
|
|
26926
|
+
var _err$response, _err$response$data, _err$response$data$er;
|
|
26347
26927
|
dispatch({
|
|
26348
26928
|
type: SHOW_ALERT,
|
|
26349
26929
|
payload: {
|
|
@@ -26351,7 +26931,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26351
26931
|
content: getErrorMessages(err)
|
|
26352
26932
|
}
|
|
26353
26933
|
});
|
|
26354
|
-
if (
|
|
26934
|
+
if ((_err$response = err.response) !== null && _err$response !== void 0 && (_err$response$data = _err$response.data) !== null && _err$response$data !== void 0 && (_err$response$data$er = _err$response$data.errors) !== null && _err$response$data$er !== void 0 && _err$response$data$er.address_id) {
|
|
26355
26935
|
switchToAddressView();
|
|
26356
26936
|
} else {
|
|
26357
26937
|
return onFailure(err);
|
|
@@ -28318,6 +28898,8 @@ const OrderItems = _ref => {
|
|
|
28318
28898
|
});
|
|
28319
28899
|
};
|
|
28320
28900
|
|
|
28901
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1;
|
|
28902
|
+
const ReactGA$1 = (_window$1 = window) !== null && _window$1 !== void 0 && (_window$Pelcro$1 = _window$1.Pelcro) !== null && _window$Pelcro$1 !== void 0 && (_window$Pelcro$uiSett$1 = _window$Pelcro$1.uiSettings) !== null && _window$Pelcro$uiSett$1 !== void 0 && _window$Pelcro$uiSett$1.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
28321
28903
|
const SavedItemsMenu = () => {
|
|
28322
28904
|
const {
|
|
28323
28905
|
t
|
|
@@ -29339,6 +29921,8 @@ function getMemberShipStatus(status) {
|
|
|
29339
29921
|
};
|
|
29340
29922
|
}
|
|
29341
29923
|
|
|
29924
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
29925
|
+
const ReactGA = (_window = window) !== null && _window !== void 0 && (_window$Pelcro = _window.Pelcro) !== null && _window$Pelcro !== void 0 && (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) !== null && _window$Pelcro$uiSett !== void 0 && _window$Pelcro$uiSett.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
29342
29926
|
const SUB_MENUS = {
|
|
29343
29927
|
PROFILE: "profile",
|
|
29344
29928
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -29403,7 +29987,7 @@ class Dashboard extends Component {
|
|
|
29403
29987
|
window.Pelcro.insight.track("Modal Displayed", {
|
|
29404
29988
|
name: "dashboard"
|
|
29405
29989
|
});
|
|
29406
|
-
ReactGA
|
|
29990
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
29407
29991
|
category: "VIEWS",
|
|
29408
29992
|
action: "Dashboard Modal Viewed",
|
|
29409
29993
|
nonInteraction: true
|
|
@@ -29439,7 +30023,7 @@ class Dashboard extends Component {
|
|
|
29439
30023
|
if (err) {
|
|
29440
30024
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29441
30025
|
}
|
|
29442
|
-
ReactGA
|
|
30026
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
29443
30027
|
category: "ACTIONS",
|
|
29444
30028
|
action: "Canceled",
|
|
29445
30029
|
nonInteraction: true
|
|
@@ -29457,7 +30041,7 @@ class Dashboard extends Component {
|
|
|
29457
30041
|
if (err) {
|
|
29458
30042
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29459
30043
|
}
|
|
29460
|
-
ReactGA
|
|
30044
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event3 = ReactGA.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA, {
|
|
29461
30045
|
category: "ACTIONS",
|
|
29462
30046
|
action: "UnSuspended",
|
|
29463
30047
|
nonInteraction: true
|
|
@@ -29748,13 +30332,13 @@ class Dashboard extends Component {
|
|
|
29748
30332
|
this.menuRef = /*#__PURE__*/React__default.createRef();
|
|
29749
30333
|
}
|
|
29750
30334
|
render() {
|
|
29751
|
-
var _window$Pelcro$user$r3, _window$
|
|
30335
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
29752
30336
|
const {
|
|
29753
30337
|
isOpen
|
|
29754
30338
|
} = this.state;
|
|
29755
30339
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
29756
30340
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
29757
|
-
const newsletters = (_window$
|
|
30341
|
+
const newsletters = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.newsletters;
|
|
29758
30342
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
29759
30343
|
return /*#__PURE__*/React__default.createElement(Transition, {
|
|
29760
30344
|
className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full plc-max-w-xl plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
|