@pelcro/react-pelcro-js 3.23.0-beta.1 → 3.23.0-beta.10
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 +697 -116
- package/dist/index.esm.js +697 -116
- package/package.json +2 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7500,6 +7500,51 @@ function _defineProperty$3(obj, key, value) {
|
|
|
7500
7500
|
return obj;
|
|
7501
7501
|
}
|
|
7502
7502
|
|
|
7503
|
+
// Polyfill
|
|
7504
|
+
(() => {
|
|
7505
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
7506
|
+
function CustomEvent(event) {
|
|
7507
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
7508
|
+
bubbles: false,
|
|
7509
|
+
cancelable: false,
|
|
7510
|
+
detail: undefined
|
|
7511
|
+
};
|
|
7512
|
+
const evt = document.createEvent("CustomEvent");
|
|
7513
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
7514
|
+
return evt;
|
|
7515
|
+
}
|
|
7516
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
7517
|
+
window.CustomEvent = CustomEvent;
|
|
7518
|
+
})();
|
|
7519
|
+
|
|
7520
|
+
/**
|
|
7521
|
+
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
7522
|
+
*/
|
|
7523
|
+
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
7524
|
+
|
|
7525
|
+
/**
|
|
7526
|
+
* Should fire when an item added to the cart and expects the added item to be sent
|
|
7527
|
+
*/
|
|
7528
|
+
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
7529
|
+
|
|
7530
|
+
/**
|
|
7531
|
+
* Should fire when an item removed from the cart and expects the removed item to be sent
|
|
7532
|
+
*/
|
|
7533
|
+
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
7534
|
+
|
|
7535
|
+
/**
|
|
7536
|
+
* Check if the browser support custom events
|
|
7537
|
+
*/
|
|
7538
|
+
function createCustomEvent(name, detail) {
|
|
7539
|
+
try {
|
|
7540
|
+
return new CustomEvent(name, {
|
|
7541
|
+
detail
|
|
7542
|
+
});
|
|
7543
|
+
} catch (e) {
|
|
7544
|
+
console.warn("Pelcro - Events are not supported in the browser");
|
|
7545
|
+
}
|
|
7546
|
+
}
|
|
7547
|
+
|
|
7503
7548
|
function warn(s) {
|
|
7504
7549
|
console.warn('[react-ga]', s);
|
|
7505
7550
|
}
|
|
@@ -8351,55 +8396,547 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8351
8396
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
8352
8397
|
OutboundLink$1.trackLink = outboundLink;
|
|
8353
8398
|
var OutboundLink = OutboundLink$1;
|
|
8354
|
-
var
|
|
8399
|
+
var ReactGA1 = _objectSpread({}, Defaults, {
|
|
8355
8400
|
OutboundLink: OutboundLink
|
|
8356
8401
|
});
|
|
8357
8402
|
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
const evt = document.createEvent("CustomEvent");
|
|
8368
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
8369
|
-
return evt;
|
|
8403
|
+
var gtag_1 = createCommonjsModule(function (module, exports) {
|
|
8404
|
+
|
|
8405
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8406
|
+
value: true
|
|
8407
|
+
});
|
|
8408
|
+
exports["default"] = void 0;
|
|
8409
|
+
var gtag = function gtag() {
|
|
8410
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8411
|
+
args[_key] = arguments[_key];
|
|
8370
8412
|
}
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8413
|
+
if (typeof window !== "undefined") {
|
|
8414
|
+
var _window;
|
|
8415
|
+
if (typeof window.gtag === "undefined") {
|
|
8416
|
+
window.dataLayer = window.dataLayer || [];
|
|
8417
|
+
window.gtag = function gtag() {
|
|
8418
|
+
window.dataLayer.push(arguments);
|
|
8419
|
+
};
|
|
8420
|
+
}
|
|
8421
|
+
(_window = window).gtag.apply(_window, args);
|
|
8422
|
+
}
|
|
8423
|
+
};
|
|
8424
|
+
var _default = gtag;
|
|
8425
|
+
exports["default"] = _default;
|
|
8426
|
+
});
|
|
8374
8427
|
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8428
|
+
unwrapExports(gtag_1);
|
|
8429
|
+
|
|
8430
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
8431
|
+
|
|
8432
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8433
|
+
value: true
|
|
8434
|
+
});
|
|
8435
|
+
exports["default"] = format;
|
|
8436
|
+
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
8437
|
+
function toTitleCase(string) {
|
|
8438
|
+
return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
|
|
8439
|
+
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) {
|
|
8440
|
+
return match.toLowerCase();
|
|
8441
|
+
}
|
|
8442
|
+
if (match.substr(1).search(/[A-Z]|\../) > -1) {
|
|
8443
|
+
return match;
|
|
8444
|
+
}
|
|
8445
|
+
return match.charAt(0).toUpperCase() + match.substr(1);
|
|
8446
|
+
});
|
|
8447
|
+
}
|
|
8448
|
+
|
|
8449
|
+
// See if s could be an email address. We don't want to send personal data like email.
|
|
8450
|
+
// https://support.google.com/analytics/answer/2795983?hl=en
|
|
8451
|
+
function mightBeEmail(s) {
|
|
8452
|
+
// There's no point trying to validate rfc822 fully, just look for ...@...
|
|
8453
|
+
return typeof s === "string" && s.indexOf("@") !== -1;
|
|
8454
|
+
}
|
|
8455
|
+
var redacted = "REDACTED (Potential Email Address)";
|
|
8456
|
+
function redactEmail(string) {
|
|
8457
|
+
if (mightBeEmail(string)) {
|
|
8458
|
+
console.warn("This arg looks like an email address, redacting.");
|
|
8459
|
+
return redacted;
|
|
8460
|
+
}
|
|
8461
|
+
return string;
|
|
8462
|
+
}
|
|
8463
|
+
function format() {
|
|
8464
|
+
var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8465
|
+
var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8466
|
+
var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
8467
|
+
var _str = s || "";
|
|
8468
|
+
if (titleCase) {
|
|
8469
|
+
_str = toTitleCase(s);
|
|
8470
|
+
}
|
|
8471
|
+
if (redactingEmail) {
|
|
8472
|
+
_str = redactEmail(_str);
|
|
8473
|
+
}
|
|
8474
|
+
return _str;
|
|
8475
|
+
}
|
|
8476
|
+
});
|
|
8379
8477
|
|
|
8478
|
+
unwrapExports(format_1);
|
|
8479
|
+
|
|
8480
|
+
var ga4 = createCommonjsModule(function (module, exports) {
|
|
8481
|
+
|
|
8482
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8483
|
+
value: true
|
|
8484
|
+
});
|
|
8485
|
+
exports["default"] = exports.GA4 = void 0;
|
|
8486
|
+
var _gtag = _interopRequireDefault(gtag_1);
|
|
8487
|
+
var _format = _interopRequireDefault(format_1);
|
|
8488
|
+
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
|
|
8489
|
+
_excluded2 = ["title", "location"],
|
|
8490
|
+
_excluded3 = ["page", "hitType"];
|
|
8491
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8492
|
+
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; }
|
|
8493
|
+
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; }
|
|
8494
|
+
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); }
|
|
8495
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8496
|
+
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."); }
|
|
8497
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8498
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8499
|
+
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; }
|
|
8500
|
+
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; }
|
|
8501
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8502
|
+
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."); }
|
|
8503
|
+
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); }
|
|
8504
|
+
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; }
|
|
8505
|
+
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; } }
|
|
8506
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8507
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8508
|
+
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); } }
|
|
8509
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8510
|
+
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; }
|
|
8511
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8512
|
+
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); }
|
|
8513
|
+
/*
|
|
8514
|
+
Links
|
|
8515
|
+
https://developers.google.com/gtagjs/reference/api
|
|
8516
|
+
https://developers.google.com/tag-platform/gtagjs/reference
|
|
8517
|
+
*/
|
|
8380
8518
|
/**
|
|
8381
|
-
*
|
|
8519
|
+
* @typedef GaOptions
|
|
8520
|
+
* @type {Object}
|
|
8521
|
+
* @property {boolean} [cookieUpdate=true]
|
|
8522
|
+
* @property {number} [cookieExpires=63072000] Default two years
|
|
8523
|
+
* @property {string} [cookieDomain="auto"]
|
|
8524
|
+
* @property {string} [cookieFlags]
|
|
8525
|
+
* @property {string} [userId]
|
|
8526
|
+
* @property {string} [clientId]
|
|
8527
|
+
* @property {boolean} [anonymizeIp]
|
|
8528
|
+
* @property {string} [contentGroup1]
|
|
8529
|
+
* @property {string} [contentGroup2]
|
|
8530
|
+
* @property {string} [contentGroup3]
|
|
8531
|
+
* @property {string} [contentGroup4]
|
|
8532
|
+
* @property {string} [contentGroup5]
|
|
8533
|
+
* @property {boolean} [allowAdFeatures=true]
|
|
8534
|
+
* @property {boolean} [allowAdPersonalizationSignals]
|
|
8535
|
+
* @property {boolean} [nonInteraction]
|
|
8536
|
+
* @property {string} [page]
|
|
8382
8537
|
*/
|
|
8383
|
-
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
8384
|
-
|
|
8385
8538
|
/**
|
|
8386
|
-
*
|
|
8539
|
+
* @typedef UaEventOptions
|
|
8540
|
+
* @type {Object}
|
|
8541
|
+
* @property {string} action
|
|
8542
|
+
* @property {string} category
|
|
8543
|
+
* @property {string} [label]
|
|
8544
|
+
* @property {number} [value]
|
|
8545
|
+
* @property {boolean} [nonInteraction]
|
|
8546
|
+
* @property {('beacon'|'xhr'|'image')} [transport]
|
|
8387
8547
|
*/
|
|
8388
|
-
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
8389
|
-
|
|
8390
8548
|
/**
|
|
8391
|
-
*
|
|
8549
|
+
* @typedef InitOptions
|
|
8550
|
+
* @type {Object}
|
|
8551
|
+
* @property {string} trackingId
|
|
8552
|
+
* @property {GaOptions|any} [gaOptions]
|
|
8553
|
+
* @property {Object} [gtagOptions] New parameter
|
|
8392
8554
|
*/
|
|
8393
|
-
function
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8555
|
+
var GA4 = /*#__PURE__*/function () {
|
|
8556
|
+
function GA4() {
|
|
8557
|
+
var _this = this;
|
|
8558
|
+
_classCallCheck(this, GA4);
|
|
8559
|
+
_defineProperty(this, "reset", function () {
|
|
8560
|
+
_this.isInitialized = false;
|
|
8561
|
+
_this._testMode = false;
|
|
8562
|
+
_this._currentMeasurementId;
|
|
8563
|
+
_this._hasLoadedGA = false;
|
|
8564
|
+
_this._isQueuing = false;
|
|
8565
|
+
_this._queueGtag = [];
|
|
8566
|
+
});
|
|
8567
|
+
_defineProperty(this, "_gtag", function () {
|
|
8568
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8569
|
+
args[_key] = arguments[_key];
|
|
8570
|
+
}
|
|
8571
|
+
if (!_this._testMode) {
|
|
8572
|
+
if (_this._isQueuing) {
|
|
8573
|
+
_this._queueGtag.push(args);
|
|
8574
|
+
} else {
|
|
8575
|
+
_gtag["default"].apply(void 0, args);
|
|
8576
|
+
}
|
|
8577
|
+
} else {
|
|
8578
|
+
_this._queueGtag.push(args);
|
|
8579
|
+
}
|
|
8397
8580
|
});
|
|
8398
|
-
|
|
8399
|
-
|
|
8581
|
+
_defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
|
|
8582
|
+
var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "https://www.googletagmanager.com/gtag/js";
|
|
8583
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
8584
|
+
return;
|
|
8585
|
+
}
|
|
8586
|
+
if (!_this._hasLoadedGA) {
|
|
8587
|
+
// Global Site Tag (gtag.js) - Google Analytics
|
|
8588
|
+
var script = document.createElement("script");
|
|
8589
|
+
script.async = true;
|
|
8590
|
+
script.src = "".concat(gtagUrl, "?id=").concat(GA_MEASUREMENT_ID);
|
|
8591
|
+
if (nonce) {
|
|
8592
|
+
script.setAttribute("nonce", nonce);
|
|
8593
|
+
}
|
|
8594
|
+
document.body.appendChild(script);
|
|
8595
|
+
window.dataLayer = window.dataLayer || [];
|
|
8596
|
+
window.gtag = function gtag() {
|
|
8597
|
+
window.dataLayer.push(arguments);
|
|
8598
|
+
};
|
|
8599
|
+
_this._hasLoadedGA = true;
|
|
8600
|
+
}
|
|
8601
|
+
});
|
|
8602
|
+
_defineProperty(this, "_toGtagOptions", function (gaOptions) {
|
|
8603
|
+
if (!gaOptions) {
|
|
8604
|
+
return;
|
|
8605
|
+
}
|
|
8606
|
+
var mapFields = {
|
|
8607
|
+
// Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
|
|
8608
|
+
// New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
|
|
8609
|
+
cookieUpdate: "cookie_update",
|
|
8610
|
+
cookieExpires: "cookie_expires",
|
|
8611
|
+
cookieDomain: "cookie_domain",
|
|
8612
|
+
cookieFlags: "cookie_flags",
|
|
8613
|
+
// must be in set method?
|
|
8614
|
+
userId: "user_id",
|
|
8615
|
+
clientId: "client_id",
|
|
8616
|
+
anonymizeIp: "anonymize_ip",
|
|
8617
|
+
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
8618
|
+
contentGroup1: "content_group1",
|
|
8619
|
+
contentGroup2: "content_group2",
|
|
8620
|
+
contentGroup3: "content_group3",
|
|
8621
|
+
contentGroup4: "content_group4",
|
|
8622
|
+
contentGroup5: "content_group5",
|
|
8623
|
+
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
8624
|
+
allowAdFeatures: "allow_google_signals",
|
|
8625
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
8626
|
+
nonInteraction: "non_interaction",
|
|
8627
|
+
page: "page_path",
|
|
8628
|
+
hitCallback: "event_callback"
|
|
8629
|
+
};
|
|
8630
|
+
var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
|
|
8631
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
8632
|
+
key = _ref2[0],
|
|
8633
|
+
value = _ref2[1];
|
|
8634
|
+
if (mapFields[key]) {
|
|
8635
|
+
prev[mapFields[key]] = value;
|
|
8636
|
+
} else {
|
|
8637
|
+
prev[key] = value;
|
|
8638
|
+
}
|
|
8639
|
+
return prev;
|
|
8640
|
+
}, {});
|
|
8641
|
+
return gtagOptions;
|
|
8642
|
+
});
|
|
8643
|
+
_defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
|
|
8644
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8645
|
+
if (!GA_MEASUREMENT_ID) {
|
|
8646
|
+
throw new Error("Require GA_MEASUREMENT_ID");
|
|
8647
|
+
}
|
|
8648
|
+
var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
|
|
8649
|
+
trackingId: GA_MEASUREMENT_ID
|
|
8650
|
+
}] : GA_MEASUREMENT_ID;
|
|
8651
|
+
_this._currentMeasurementId = initConfigs[0].trackingId;
|
|
8652
|
+
var gaOptions = options.gaOptions,
|
|
8653
|
+
gtagOptions = options.gtagOptions,
|
|
8654
|
+
nonce = options.nonce,
|
|
8655
|
+
_options$testMode = options.testMode,
|
|
8656
|
+
testMode = _options$testMode === void 0 ? false : _options$testMode,
|
|
8657
|
+
gtagUrl = options.gtagUrl;
|
|
8658
|
+
_this._testMode = testMode;
|
|
8659
|
+
if (!testMode) {
|
|
8660
|
+
_this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);
|
|
8661
|
+
}
|
|
8662
|
+
if (!_this.isInitialized) {
|
|
8663
|
+
_this._gtag("js", new Date());
|
|
8664
|
+
initConfigs.forEach(function (config) {
|
|
8665
|
+
var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);
|
|
8666
|
+
if (Object.keys(mergedGtagOptions).length) {
|
|
8667
|
+
_this._gtag("config", config.trackingId, mergedGtagOptions);
|
|
8668
|
+
} else {
|
|
8669
|
+
_this._gtag("config", config.trackingId);
|
|
8670
|
+
}
|
|
8671
|
+
});
|
|
8672
|
+
}
|
|
8673
|
+
_this.isInitialized = true;
|
|
8674
|
+
if (!testMode) {
|
|
8675
|
+
var queues = _toConsumableArray(_this._queueGtag);
|
|
8676
|
+
_this._queueGtag = [];
|
|
8677
|
+
_this._isQueuing = false;
|
|
8678
|
+
while (queues.length) {
|
|
8679
|
+
var queue = queues.shift();
|
|
8680
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8681
|
+
if (queue[0] === "get") {
|
|
8682
|
+
_this._isQueuing = true;
|
|
8683
|
+
}
|
|
8684
|
+
}
|
|
8685
|
+
}
|
|
8686
|
+
});
|
|
8687
|
+
_defineProperty(this, "set", function (fieldsObject) {
|
|
8688
|
+
if (!fieldsObject) {
|
|
8689
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
8690
|
+
return;
|
|
8691
|
+
}
|
|
8692
|
+
if (_typeof(fieldsObject) !== "object") {
|
|
8693
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
8694
|
+
return;
|
|
8695
|
+
}
|
|
8696
|
+
if (Object.keys(fieldsObject).length === 0) {
|
|
8697
|
+
console.warn("empty `fieldsObject` given to .set()");
|
|
8698
|
+
}
|
|
8699
|
+
_this._gaCommand("set", fieldsObject);
|
|
8700
|
+
});
|
|
8701
|
+
_defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
|
|
8702
|
+
_this._gtag("event", eventAction, _objectSpread(_objectSpread({
|
|
8703
|
+
event_category: eventCategory,
|
|
8704
|
+
event_label: eventLabel,
|
|
8705
|
+
value: eventValue
|
|
8706
|
+
}, fieldsObject && {
|
|
8707
|
+
non_interaction: fieldsObject.nonInteraction
|
|
8708
|
+
}), _this._toGtagOptions(fieldsObject)));
|
|
8709
|
+
});
|
|
8710
|
+
_defineProperty(this, "_gaCommandSendEventParameters", function () {
|
|
8711
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8712
|
+
args[_key2] = arguments[_key2];
|
|
8713
|
+
}
|
|
8714
|
+
if (typeof args[0] === "string") {
|
|
8715
|
+
_this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8716
|
+
} else {
|
|
8717
|
+
var _args$ = args[0],
|
|
8718
|
+
eventCategory = _args$.eventCategory,
|
|
8719
|
+
eventAction = _args$.eventAction,
|
|
8720
|
+
eventLabel = _args$.eventLabel,
|
|
8721
|
+
eventValue = _args$.eventValue;
|
|
8722
|
+
_args$.hitType;
|
|
8723
|
+
var rest = _objectWithoutProperties(_args$, _excluded);
|
|
8724
|
+
_this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
|
|
8725
|
+
}
|
|
8726
|
+
});
|
|
8727
|
+
_defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
|
|
8728
|
+
_this._gtag("event", "timing_complete", {
|
|
8729
|
+
name: timingVar,
|
|
8730
|
+
value: timingValue,
|
|
8731
|
+
event_category: timingCategory,
|
|
8732
|
+
event_label: timingLabel
|
|
8733
|
+
});
|
|
8734
|
+
});
|
|
8735
|
+
_defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
|
|
8736
|
+
if (fieldsObject && Object.keys(fieldsObject).length) {
|
|
8737
|
+
var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
|
|
8738
|
+
title = _this$_toGtagOptions.title,
|
|
8739
|
+
location = _this$_toGtagOptions.location,
|
|
8740
|
+
rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
|
|
8741
|
+
_this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
|
|
8742
|
+
page_path: page
|
|
8743
|
+
}), title && {
|
|
8744
|
+
page_title: title
|
|
8745
|
+
}), location && {
|
|
8746
|
+
page_location: location
|
|
8747
|
+
}), rest));
|
|
8748
|
+
} else if (page) {
|
|
8749
|
+
_this._gtag("event", "page_view", {
|
|
8750
|
+
page_path: page
|
|
8751
|
+
});
|
|
8752
|
+
} else {
|
|
8753
|
+
_this._gtag("event", "page_view");
|
|
8754
|
+
}
|
|
8755
|
+
});
|
|
8756
|
+
_defineProperty(this, "_gaCommandSendPageviewParameters", function () {
|
|
8757
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8758
|
+
args[_key3] = arguments[_key3];
|
|
8759
|
+
}
|
|
8760
|
+
if (typeof args[0] === "string") {
|
|
8761
|
+
_this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8762
|
+
} else {
|
|
8763
|
+
var _args$2 = args[0],
|
|
8764
|
+
page = _args$2.page;
|
|
8765
|
+
_args$2.hitType;
|
|
8766
|
+
var rest = _objectWithoutProperties(_args$2, _excluded3);
|
|
8767
|
+
_this._gaCommandSendPageview(page, rest);
|
|
8768
|
+
}
|
|
8769
|
+
});
|
|
8770
|
+
_defineProperty(this, "_gaCommandSend", function () {
|
|
8771
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
8772
|
+
args[_key4] = arguments[_key4];
|
|
8773
|
+
}
|
|
8774
|
+
var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
|
|
8775
|
+
switch (hitType) {
|
|
8776
|
+
case "event":
|
|
8777
|
+
_this._gaCommandSendEventParameters.apply(_this, args);
|
|
8778
|
+
break;
|
|
8779
|
+
case "pageview":
|
|
8780
|
+
_this._gaCommandSendPageviewParameters.apply(_this, args);
|
|
8781
|
+
break;
|
|
8782
|
+
case "timing":
|
|
8783
|
+
_this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8784
|
+
break;
|
|
8785
|
+
case "screenview":
|
|
8786
|
+
case "transaction":
|
|
8787
|
+
case "item":
|
|
8788
|
+
case "social":
|
|
8789
|
+
case "exception":
|
|
8790
|
+
console.warn("Unsupported send command: ".concat(hitType));
|
|
8791
|
+
break;
|
|
8792
|
+
default:
|
|
8793
|
+
console.warn("Send command doesn't exist: ".concat(hitType));
|
|
8794
|
+
}
|
|
8795
|
+
});
|
|
8796
|
+
_defineProperty(this, "_gaCommandSet", function () {
|
|
8797
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8798
|
+
args[_key5] = arguments[_key5];
|
|
8799
|
+
}
|
|
8800
|
+
if (typeof args[0] === "string") {
|
|
8801
|
+
args[0] = _defineProperty({}, args[0], args[1]);
|
|
8802
|
+
}
|
|
8803
|
+
_this._gtag("set", _this._toGtagOptions(args[0]));
|
|
8804
|
+
});
|
|
8805
|
+
_defineProperty(this, "_gaCommand", function (command) {
|
|
8806
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
8807
|
+
args[_key6 - 1] = arguments[_key6];
|
|
8808
|
+
}
|
|
8809
|
+
switch (command) {
|
|
8810
|
+
case "send":
|
|
8811
|
+
_this._gaCommandSend.apply(_this, args);
|
|
8812
|
+
break;
|
|
8813
|
+
case "set":
|
|
8814
|
+
_this._gaCommandSet.apply(_this, args);
|
|
8815
|
+
break;
|
|
8816
|
+
default:
|
|
8817
|
+
console.warn("Command doesn't exist: ".concat(command));
|
|
8818
|
+
}
|
|
8819
|
+
});
|
|
8820
|
+
_defineProperty(this, "ga", function () {
|
|
8821
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8822
|
+
args[_key7] = arguments[_key7];
|
|
8823
|
+
}
|
|
8824
|
+
if (typeof args[0] === "string") {
|
|
8825
|
+
_this._gaCommand.apply(_this, args);
|
|
8826
|
+
} else {
|
|
8827
|
+
var readyCallback = args[0];
|
|
8828
|
+
_this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
|
|
8829
|
+
_this._isQueuing = false;
|
|
8830
|
+
var queues = _this._queueGtag;
|
|
8831
|
+
readyCallback({
|
|
8832
|
+
get: function get(property) {
|
|
8833
|
+
return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
|
|
8834
|
+
}
|
|
8835
|
+
});
|
|
8836
|
+
while (queues.length) {
|
|
8837
|
+
var queue = queues.shift();
|
|
8838
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8839
|
+
}
|
|
8840
|
+
});
|
|
8841
|
+
_this._isQueuing = true;
|
|
8842
|
+
}
|
|
8843
|
+
return _this.ga;
|
|
8844
|
+
});
|
|
8845
|
+
_defineProperty(this, "event", function (optionsOrName, params) {
|
|
8846
|
+
if (typeof optionsOrName === "string") {
|
|
8847
|
+
_this._gtag("event", optionsOrName, _this._toGtagOptions(params));
|
|
8848
|
+
} else {
|
|
8849
|
+
var action = optionsOrName.action,
|
|
8850
|
+
category = optionsOrName.category,
|
|
8851
|
+
label = optionsOrName.label,
|
|
8852
|
+
value = optionsOrName.value,
|
|
8853
|
+
nonInteraction = optionsOrName.nonInteraction,
|
|
8854
|
+
transport = optionsOrName.transport;
|
|
8855
|
+
if (!category || !action) {
|
|
8856
|
+
console.warn("args.category AND args.action are required in event()");
|
|
8857
|
+
return;
|
|
8858
|
+
}
|
|
8859
|
+
|
|
8860
|
+
// Required Fields
|
|
8861
|
+
var fieldObject = {
|
|
8862
|
+
hitType: "event",
|
|
8863
|
+
eventCategory: (0, _format["default"])(category),
|
|
8864
|
+
eventAction: (0, _format["default"])(action)
|
|
8865
|
+
};
|
|
8866
|
+
|
|
8867
|
+
// Optional Fields
|
|
8868
|
+
if (label) {
|
|
8869
|
+
fieldObject.eventLabel = (0, _format["default"])(label);
|
|
8870
|
+
}
|
|
8871
|
+
if (typeof value !== "undefined") {
|
|
8872
|
+
if (typeof value !== "number") {
|
|
8873
|
+
console.warn("Expected `args.value` arg to be a Number.");
|
|
8874
|
+
} else {
|
|
8875
|
+
fieldObject.eventValue = value;
|
|
8876
|
+
}
|
|
8877
|
+
}
|
|
8878
|
+
if (typeof nonInteraction !== "undefined") {
|
|
8879
|
+
if (typeof nonInteraction !== "boolean") {
|
|
8880
|
+
console.warn("`args.nonInteraction` must be a boolean.");
|
|
8881
|
+
} else {
|
|
8882
|
+
fieldObject.nonInteraction = nonInteraction;
|
|
8883
|
+
}
|
|
8884
|
+
}
|
|
8885
|
+
if (typeof transport !== "undefined") {
|
|
8886
|
+
if (typeof transport !== "string") {
|
|
8887
|
+
console.warn("`args.transport` must be a string.");
|
|
8888
|
+
} else {
|
|
8889
|
+
if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
|
|
8890
|
+
console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
|
|
8891
|
+
}
|
|
8892
|
+
fieldObject.transport = transport;
|
|
8893
|
+
}
|
|
8894
|
+
}
|
|
8895
|
+
_this._gaCommand("send", fieldObject);
|
|
8896
|
+
}
|
|
8897
|
+
});
|
|
8898
|
+
_defineProperty(this, "send", function (fieldObject) {
|
|
8899
|
+
_this._gaCommand("send", fieldObject);
|
|
8900
|
+
});
|
|
8901
|
+
this.reset();
|
|
8400
8902
|
}
|
|
8401
|
-
|
|
8903
|
+
_createClass(GA4, [{
|
|
8904
|
+
key: "gtag",
|
|
8905
|
+
value: function gtag() {
|
|
8906
|
+
this._gtag.apply(this, arguments);
|
|
8907
|
+
}
|
|
8908
|
+
}]);
|
|
8909
|
+
return GA4;
|
|
8910
|
+
}();
|
|
8911
|
+
exports.GA4 = GA4;
|
|
8912
|
+
var _default = new GA4();
|
|
8913
|
+
exports["default"] = _default;
|
|
8914
|
+
});
|
|
8915
|
+
|
|
8916
|
+
unwrapExports(ga4);
|
|
8917
|
+
ga4.GA4;
|
|
8918
|
+
|
|
8919
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
8920
|
+
|
|
8921
|
+
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); }
|
|
8922
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8923
|
+
value: true
|
|
8924
|
+
});
|
|
8925
|
+
exports["default"] = exports.ReactGAImplementation = void 0;
|
|
8926
|
+
var _ga = _interopRequireWildcard(ga4);
|
|
8927
|
+
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); }
|
|
8928
|
+
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; }
|
|
8929
|
+
var ReactGAImplementation = _ga.GA4;
|
|
8930
|
+
exports.ReactGAImplementation = ReactGAImplementation;
|
|
8931
|
+
var _default = _ga["default"];
|
|
8932
|
+
exports["default"] = _default;
|
|
8933
|
+
});
|
|
8402
8934
|
|
|
8935
|
+
var ReactGA4 = unwrapExports(dist);
|
|
8936
|
+
dist.ReactGAImplementation;
|
|
8937
|
+
|
|
8938
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
8939
|
+
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;
|
|
8403
8940
|
class PelcroActions {
|
|
8404
8941
|
constructor(storeSetter, storeGetter) {
|
|
8405
8942
|
var _this = this;
|
|
@@ -8591,7 +9128,7 @@ class PelcroActions {
|
|
|
8591
9128
|
return console.warn("You are already logged out.");
|
|
8592
9129
|
}
|
|
8593
9130
|
window.Pelcro.user.logout();
|
|
8594
|
-
ReactGA$
|
|
9131
|
+
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, {
|
|
8595
9132
|
category: "ACTIONS",
|
|
8596
9133
|
action: "Logged out",
|
|
8597
9134
|
nonInteraction: true
|
|
@@ -8820,6 +9357,9 @@ if (process.env.NODE_ENV === "development") {
|
|
|
8820
9357
|
c$1("Pelcro Store", usePelcro);
|
|
8821
9358
|
}
|
|
8822
9359
|
|
|
9360
|
+
var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
|
|
9361
|
+
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;
|
|
9362
|
+
|
|
8823
9363
|
/**
|
|
8824
9364
|
* List of zero-decimal currencies.
|
|
8825
9365
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8902,8 +9442,8 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8902
9442
|
* @return {string | undefined}
|
|
8903
9443
|
*/
|
|
8904
9444
|
const getPageOrDefaultLanguage = () => {
|
|
8905
|
-
var _window$Pelcro$helper, _window$
|
|
8906
|
-
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$
|
|
9445
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
9446
|
+
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);
|
|
8907
9447
|
};
|
|
8908
9448
|
|
|
8909
9449
|
/**
|
|
@@ -8956,9 +9496,9 @@ const isValidViewFromURL = viewID => {
|
|
|
8956
9496
|
*
|
|
8957
9497
|
*/
|
|
8958
9498
|
function hasValidNewsletterUpdateUrl() {
|
|
8959
|
-
var _window$
|
|
9499
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8960
9500
|
if (viewID !== "newsletter-update") return false;
|
|
8961
|
-
const newsletters = (_window$
|
|
9501
|
+
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;
|
|
8962
9502
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8963
9503
|
if (!siteHasNewslettersDefined) {
|
|
8964
9504
|
return false;
|
|
@@ -9023,16 +9563,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
9023
9563
|
return;
|
|
9024
9564
|
}
|
|
9025
9565
|
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;
|
|
9026
|
-
ReactGA$
|
|
9566
|
+
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, {
|
|
9027
9567
|
currencyCode: currencyCode
|
|
9028
9568
|
});
|
|
9029
|
-
ReactGA$
|
|
9569
|
+
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", {
|
|
9030
9570
|
id: lastSubscriptionId,
|
|
9031
9571
|
affiliation: "Pelcro",
|
|
9032
9572
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9033
9573
|
coupon: couponCode
|
|
9034
9574
|
});
|
|
9035
|
-
ReactGA$
|
|
9575
|
+
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", {
|
|
9036
9576
|
id: lastSubscriptionId,
|
|
9037
9577
|
name: product.name,
|
|
9038
9578
|
category: product.description,
|
|
@@ -9040,8 +9580,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
9040
9580
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9041
9581
|
quantity: 1
|
|
9042
9582
|
});
|
|
9043
|
-
ReactGA$
|
|
9044
|
-
ReactGA$
|
|
9583
|
+
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");
|
|
9584
|
+
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, {
|
|
9045
9585
|
category: "ACTIONS",
|
|
9046
9586
|
action: "Subscribed",
|
|
9047
9587
|
nonInteraction: true
|
|
@@ -9129,8 +9669,8 @@ function getDateWithoutTime(dateObject) {
|
|
|
9129
9669
|
return date;
|
|
9130
9670
|
}
|
|
9131
9671
|
function userMustVerifyEmail() {
|
|
9132
|
-
var _window$Pelcro$site$
|
|
9133
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9672
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9673
|
+
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;
|
|
9134
9674
|
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;
|
|
9135
9675
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9136
9676
|
}
|
|
@@ -9139,11 +9679,11 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9139
9679
|
//load bugsnag CDN
|
|
9140
9680
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9141
9681
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9142
|
-
var _window$Pelcro$enviro, _window$
|
|
9682
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
9143
9683
|
Bugsnag.start({
|
|
9144
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9684
|
+
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",
|
|
9145
9685
|
autoDetectErrors: false,
|
|
9146
|
-
releaseStage: (_window$
|
|
9686
|
+
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,
|
|
9147
9687
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9148
9688
|
...startOptions
|
|
9149
9689
|
});
|
|
@@ -9153,6 +9693,17 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9153
9693
|
}
|
|
9154
9694
|
callback();
|
|
9155
9695
|
}
|
|
9696
|
+
|
|
9697
|
+
//create a safe and strong password string with special characters
|
|
9698
|
+
function generatePassword() {
|
|
9699
|
+
const length = 16;
|
|
9700
|
+
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+{}|:<>?`~";
|
|
9701
|
+
let retVal = "";
|
|
9702
|
+
for (let i = 0, n = charset.length; i < length; ++i) {
|
|
9703
|
+
retVal += charset.charAt(Math.floor(Math.random() * n));
|
|
9704
|
+
}
|
|
9705
|
+
return retVal;
|
|
9706
|
+
}
|
|
9156
9707
|
function isStringValid(str) {
|
|
9157
9708
|
// Define the regular expression to match only letters, numbers and spaces
|
|
9158
9709
|
var regex = /^[a-zA-Z0-9\s]+$/;
|
|
@@ -9494,8 +10045,10 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9494
10045
|
return descriptor.value;
|
|
9495
10046
|
}
|
|
9496
10047
|
|
|
10048
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
9497
10049
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
9498
10050
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
10051
|
+
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;
|
|
9499
10052
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9500
10053
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
9501
10054
|
var _removeLoadingState = /*#__PURE__*/new WeakMap();
|
|
@@ -9618,7 +10171,7 @@ class SaveToMetadataButtonClass {
|
|
|
9618
10171
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9619
10172
|
}
|
|
9620
10173
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9621
|
-
ReactGA$
|
|
10174
|
+
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, {
|
|
9622
10175
|
category: "ACTIONS",
|
|
9623
10176
|
action: "Save/Follow",
|
|
9624
10177
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9650,7 +10203,7 @@ class SaveToMetadataButtonClass {
|
|
|
9650
10203
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9651
10204
|
}
|
|
9652
10205
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9653
|
-
ReactGA$
|
|
10206
|
+
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, {
|
|
9654
10207
|
category: "ACTIONS",
|
|
9655
10208
|
action: "Unsave/Unfollow",
|
|
9656
10209
|
label: title
|
|
@@ -11177,6 +11730,9 @@ function getSiteCardProcessor() {
|
|
|
11177
11730
|
return "stripe";
|
|
11178
11731
|
}
|
|
11179
11732
|
|
|
11733
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
11734
|
+
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;
|
|
11735
|
+
|
|
11180
11736
|
/**
|
|
11181
11737
|
* @typedef {Object} OptionsType
|
|
11182
11738
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -11300,12 +11856,12 @@ const initSecuritySdk = () => {
|
|
|
11300
11856
|
};
|
|
11301
11857
|
const initGATracking = () => {
|
|
11302
11858
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
11303
|
-
ReactGA$
|
|
11304
|
-
ReactGA$
|
|
11859
|
+
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);
|
|
11860
|
+
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");
|
|
11305
11861
|
};
|
|
11306
11862
|
const dispatchModalDisplayEvents = modalName => {
|
|
11307
11863
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
11308
|
-
ReactGA$
|
|
11864
|
+
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, {
|
|
11309
11865
|
category: "VIEWS",
|
|
11310
11866
|
action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
|
|
11311
11867
|
nonInteraction: true
|
|
@@ -12237,9 +12793,9 @@ const LoginContainer = _ref => {
|
|
|
12237
12793
|
});
|
|
12238
12794
|
onFailure(err);
|
|
12239
12795
|
} else {
|
|
12240
|
-
var _ReactGA
|
|
12796
|
+
var _ReactGA$event;
|
|
12241
12797
|
onSuccess(res);
|
|
12242
|
-
|
|
12798
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
12243
12799
|
category: "ACTIONS",
|
|
12244
12800
|
action: "Logged in",
|
|
12245
12801
|
nonInteraction: true
|
|
@@ -12629,11 +13185,13 @@ function ConfirmPassword(_ref) {
|
|
|
12629
13185
|
}, otherProps));
|
|
12630
13186
|
}
|
|
12631
13187
|
|
|
13188
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
13189
|
+
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;
|
|
12632
13190
|
const Logout = props => {
|
|
12633
13191
|
const handleLogout = () => {
|
|
12634
13192
|
var _ReactGA$event;
|
|
12635
13193
|
window.Pelcro.user.logout();
|
|
12636
|
-
ReactGA$
|
|
13194
|
+
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, {
|
|
12637
13195
|
category: "ACTIONS",
|
|
12638
13196
|
action: "Logged out",
|
|
12639
13197
|
nonInteraction: true
|
|
@@ -14195,6 +14753,9 @@ const RegisterCompany = props => {
|
|
|
14195
14753
|
}, props));
|
|
14196
14754
|
};
|
|
14197
14755
|
|
|
14756
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
14757
|
+
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;
|
|
14758
|
+
|
|
14198
14759
|
/**
|
|
14199
14760
|
*
|
|
14200
14761
|
*/
|
|
@@ -14220,7 +14781,7 @@ function RegisterModal(props) {
|
|
|
14220
14781
|
};
|
|
14221
14782
|
const handleAfterRegistrationLogic = () => {
|
|
14222
14783
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
14223
|
-
ReactGA$
|
|
14784
|
+
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, {
|
|
14224
14785
|
category: "ACTIONS",
|
|
14225
14786
|
action: "Registered",
|
|
14226
14787
|
nonInteraction: true
|
|
@@ -14311,6 +14872,9 @@ function Radio(_ref) {
|
|
|
14311
14872
|
}, children));
|
|
14312
14873
|
}
|
|
14313
14874
|
|
|
14875
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
14876
|
+
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;
|
|
14877
|
+
|
|
14314
14878
|
/**
|
|
14315
14879
|
*
|
|
14316
14880
|
*/
|
|
@@ -14404,11 +14968,11 @@ class SelectModal extends React.Component {
|
|
|
14404
14968
|
}
|
|
14405
14969
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14406
14970
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14407
|
-
var _window$
|
|
14408
|
-
const userCurrency = (_window$
|
|
14409
|
-
const userCountry = (_window$
|
|
14410
|
-
const userLanguage = (_window$
|
|
14411
|
-
const productsMatchingUserCurrency = (_window$
|
|
14971
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
14972
|
+
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;
|
|
14973
|
+
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;
|
|
14974
|
+
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;
|
|
14975
|
+
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 => {
|
|
14412
14976
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14413
14977
|
if (filteredPlans.length) return filteredPlans;
|
|
14414
14978
|
});
|
|
@@ -14421,12 +14985,12 @@ class SelectModal extends React.Component {
|
|
|
14421
14985
|
});
|
|
14422
14986
|
notifyBugsnag(() => {
|
|
14423
14987
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14424
|
-
var _window$
|
|
14988
|
+
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;
|
|
14425
14989
|
event.addMetadata("MetaData", {
|
|
14426
|
-
site: (_window$
|
|
14427
|
-
user: (_window$
|
|
14428
|
-
uiVersion: (_window$
|
|
14429
|
-
environment: (_window$
|
|
14990
|
+
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(),
|
|
14991
|
+
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(),
|
|
14992
|
+
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,
|
|
14993
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
14430
14994
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14431
14995
|
productListState: this.state.productList,
|
|
14432
14996
|
methods: {
|
|
@@ -14437,8 +15001,8 @@ class SelectModal extends React.Component {
|
|
|
14437
15001
|
userCurrency: userCurrency,
|
|
14438
15002
|
userCountry: userCountry,
|
|
14439
15003
|
userLanguage: userLanguage,
|
|
14440
|
-
siteLanguage: (_window$
|
|
14441
|
-
products: (_window$
|
|
15004
|
+
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(),
|
|
15005
|
+
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,
|
|
14442
15006
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
14443
15007
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
14444
15008
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -14658,14 +15222,14 @@ class SelectModal extends React.Component {
|
|
|
14658
15222
|
} = this.props;
|
|
14659
15223
|
if (this.state.mode === "product") {
|
|
14660
15224
|
var _ReactGA$event;
|
|
14661
|
-
ReactGA$
|
|
15225
|
+
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, {
|
|
14662
15226
|
category: "VIEWS",
|
|
14663
15227
|
action: "Product Modal Viewed",
|
|
14664
15228
|
nonInteraction: true
|
|
14665
15229
|
});
|
|
14666
15230
|
} else if (this.state.mode === "plan") {
|
|
14667
15231
|
var _ReactGA$event2;
|
|
14668
|
-
ReactGA$
|
|
15232
|
+
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, {
|
|
14669
15233
|
category: "VIEWS",
|
|
14670
15234
|
action: "Plan Modal Viewed",
|
|
14671
15235
|
nonInteraction: true
|
|
@@ -15100,14 +15664,14 @@ class DonationModal extends React.Component {
|
|
|
15100
15664
|
this.props;
|
|
15101
15665
|
if (this.state.mode === "product") {
|
|
15102
15666
|
var _ReactGA$event;
|
|
15103
|
-
|
|
15667
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
15104
15668
|
category: "VIEWS",
|
|
15105
15669
|
action: "Product Modal Viewed",
|
|
15106
15670
|
nonInteraction: true
|
|
15107
15671
|
});
|
|
15108
15672
|
} else if (this.state.mode === "plan") {
|
|
15109
15673
|
var _ReactGA$event2;
|
|
15110
|
-
|
|
15674
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA1.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA1, {
|
|
15111
15675
|
category: "VIEWS",
|
|
15112
15676
|
action: "Plan Modal Viewed",
|
|
15113
15677
|
nonInteraction: true
|
|
@@ -17427,19 +17991,25 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17427
17991
|
|
|
17428
17992
|
/*====== Start Cybersource integration ========*/
|
|
17429
17993
|
const cybersourceErrorHandle = err => {
|
|
17430
|
-
var _err$details, _err$details$response;
|
|
17431
|
-
|
|
17994
|
+
var _err$details, _err$details$response, _err$details$response2;
|
|
17995
|
+
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) {
|
|
17996
|
+
var _err$details2, _err$details2$respons;
|
|
17997
|
+
const errorMessages = [];
|
|
17432
17998
|
|
|
17433
|
-
|
|
17434
|
-
|
|
17435
|
-
|
|
17436
|
-
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
|
|
17999
|
+
// enumerable error (ex: validation errors)
|
|
18000
|
+
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 => {
|
|
18001
|
+
let {
|
|
18002
|
+
message
|
|
18003
|
+
} = _ref2;
|
|
18004
|
+
errorMessages.push(message);
|
|
18005
|
+
});
|
|
17440
18006
|
|
|
17441
|
-
|
|
17442
|
-
|
|
18007
|
+
// convert to multiline string
|
|
18008
|
+
return errorMessages.join("\n");
|
|
18009
|
+
} else {
|
|
18010
|
+
var _err$details3;
|
|
18011
|
+
return getErrorMessages(err === null || err === void 0 ? void 0 : (_err$details3 = err.details) === null || _err$details3 === void 0 ? void 0 : _err$details3.responseStatus);
|
|
18012
|
+
}
|
|
17443
18013
|
};
|
|
17444
18014
|
const submitUsingCybersource = (state, dispatch) => {
|
|
17445
18015
|
var _cybersourceInstanceR;
|
|
@@ -18887,7 +19457,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18887
19457
|
const sendRegisterRequest = (state, callback) => {
|
|
18888
19458
|
window.Pelcro.user.register({
|
|
18889
19459
|
email: state.email,
|
|
18890
|
-
password:
|
|
19460
|
+
password: generatePassword()
|
|
18891
19461
|
}, (err, res) => {
|
|
18892
19462
|
if (err) {
|
|
18893
19463
|
var _err$response, _err$response$data;
|
|
@@ -19621,12 +20191,12 @@ const CheckoutForm = () => {
|
|
|
19621
20191
|
className: "plc-w-6/12 plc-pr-4"
|
|
19622
20192
|
}, /*#__PURE__*/React__default['default'].createElement(MonthSelect, {
|
|
19623
20193
|
store: store$k,
|
|
19624
|
-
placeholder: "Exp Month"
|
|
20194
|
+
placeholder: "Exp Month *"
|
|
19625
20195
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19626
20196
|
className: "plc-w-6/12"
|
|
19627
20197
|
}, /*#__PURE__*/React__default['default'].createElement(YearSelect, {
|
|
19628
20198
|
store: store$k,
|
|
19629
|
-
placeholder: "Exp Year"
|
|
20199
|
+
placeholder: "Exp Year *"
|
|
19630
20200
|
}))));
|
|
19631
20201
|
}
|
|
19632
20202
|
if (cardProcessor === "stripe") {
|
|
@@ -19689,7 +20259,7 @@ const DiscountedPrice = props => {
|
|
|
19689
20259
|
};
|
|
19690
20260
|
|
|
19691
20261
|
const SubmitPaymentMethod = _ref => {
|
|
19692
|
-
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
|
|
20262
|
+
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
19693
20263
|
let {
|
|
19694
20264
|
onClick,
|
|
19695
20265
|
...otherProps
|
|
@@ -19697,7 +20267,8 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19697
20267
|
const {
|
|
19698
20268
|
plan,
|
|
19699
20269
|
selectedDonationAmount,
|
|
19700
|
-
customDonationAmount
|
|
20270
|
+
customDonationAmount,
|
|
20271
|
+
selectedPaymentMethodId
|
|
19701
20272
|
} = usePelcro();
|
|
19702
20273
|
const {
|
|
19703
20274
|
t
|
|
@@ -19715,13 +20286,16 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19715
20286
|
phone,
|
|
19716
20287
|
disableSubmit,
|
|
19717
20288
|
isLoading,
|
|
19718
|
-
updatedPrice
|
|
20289
|
+
updatedPrice,
|
|
20290
|
+
month,
|
|
20291
|
+
year
|
|
19719
20292
|
}
|
|
19720
20293
|
} = React.useContext(store$k);
|
|
19721
20294
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
19722
20295
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
19723
20296
|
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());
|
|
19724
20297
|
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);
|
|
20298
|
+
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);
|
|
19725
20299
|
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
19726
20300
|
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
19727
20301
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
@@ -19730,9 +20304,9 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19730
20304
|
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
19731
20305
|
setDisabled(disableSubmit);
|
|
19732
20306
|
} else {
|
|
19733
|
-
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);
|
|
20307
|
+
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));
|
|
19734
20308
|
}
|
|
19735
|
-
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError]);
|
|
20309
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
|
|
19736
20310
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
19737
20311
|
role: "submit",
|
|
19738
20312
|
className: "plc-w-full plc-py-3",
|
|
@@ -20371,10 +20945,6 @@ const DonationEmail = props => /*#__PURE__*/React__default['default'].createElem
|
|
|
20371
20945
|
store: store$k
|
|
20372
20946
|
}, props));
|
|
20373
20947
|
|
|
20374
|
-
const DonationPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
|
|
20375
|
-
store: store$k
|
|
20376
|
-
}, props));
|
|
20377
|
-
|
|
20378
20948
|
/**
|
|
20379
20949
|
*
|
|
20380
20950
|
*/
|
|
@@ -20461,11 +21031,6 @@ function PaymentMethodView(_ref) {
|
|
|
20461
21031
|
label: t("labels.email"),
|
|
20462
21032
|
required: true,
|
|
20463
21033
|
autoFocus: true
|
|
20464
|
-
}), /*#__PURE__*/React__default['default'].createElement(DonationPassword, {
|
|
20465
|
-
id: "pelcro-input-password",
|
|
20466
|
-
errorId: "pelcro-input-password-error",
|
|
20467
|
-
label: t("labels.password"),
|
|
20468
|
-
required: true
|
|
20469
21034
|
})), /*#__PURE__*/React__default['default'].createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
20470
21035
|
className: "plc-mb-2"
|
|
20471
21036
|
}, /*#__PURE__*/React__default['default'].createElement(CouponCode, null), /*#__PURE__*/React__default['default'].createElement(DiscountedPrice, null)), /*#__PURE__*/React__default['default'].createElement(TaxAmount, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -20528,6 +21093,9 @@ const SubscriptionRenewView = _ref => {
|
|
|
20528
21093
|
}));
|
|
20529
21094
|
};
|
|
20530
21095
|
|
|
21096
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
21097
|
+
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;
|
|
21098
|
+
|
|
20531
21099
|
/**
|
|
20532
21100
|
*
|
|
20533
21101
|
*/
|
|
@@ -20543,7 +21111,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20543
21111
|
const onSuccess = res => {
|
|
20544
21112
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
20545
21113
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
20546
|
-
ReactGA$
|
|
21114
|
+
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, {
|
|
20547
21115
|
category: "ACTIONS",
|
|
20548
21116
|
action: "Renewed",
|
|
20549
21117
|
nonInteraction: true
|
|
@@ -20553,7 +21121,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20553
21121
|
const onGiftRenewalSuccess = () => {
|
|
20554
21122
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
20555
21123
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
20556
|
-
ReactGA$
|
|
21124
|
+
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, {
|
|
20557
21125
|
category: "ACTIONS",
|
|
20558
21126
|
action: "Renewed Gift",
|
|
20559
21127
|
nonInteraction: true
|
|
@@ -20727,6 +21295,8 @@ function SvgSubscription(props) {
|
|
|
20727
21295
|
}))))));
|
|
20728
21296
|
}
|
|
20729
21297
|
|
|
21298
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
21299
|
+
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;
|
|
20730
21300
|
const SubscriptionCancelNowButton = _ref => {
|
|
20731
21301
|
let {
|
|
20732
21302
|
subscription,
|
|
@@ -20758,7 +21328,7 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20758
21328
|
if (err) {
|
|
20759
21329
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20760
21330
|
}
|
|
20761
|
-
ReactGA$
|
|
21331
|
+
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, {
|
|
20762
21332
|
category: "ACTIONS",
|
|
20763
21333
|
action: "Canceled",
|
|
20764
21334
|
nonInteraction: true
|
|
@@ -20797,6 +21367,8 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20797
21367
|
}, t("messages.cancelNow"));
|
|
20798
21368
|
};
|
|
20799
21369
|
|
|
21370
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
21371
|
+
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;
|
|
20800
21372
|
const SubscriptionCancelLaterButton = _ref => {
|
|
20801
21373
|
let {
|
|
20802
21374
|
subscription,
|
|
@@ -20828,7 +21400,7 @@ const SubscriptionCancelLaterButton = _ref => {
|
|
|
20828
21400
|
if (err) {
|
|
20829
21401
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20830
21402
|
}
|
|
20831
|
-
ReactGA$
|
|
21403
|
+
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, {
|
|
20832
21404
|
category: "ACTIONS",
|
|
20833
21405
|
action: "Canceled",
|
|
20834
21406
|
nonInteraction: true
|
|
@@ -21037,6 +21609,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
21037
21609
|
}, props));
|
|
21038
21610
|
};
|
|
21039
21611
|
|
|
21612
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
21613
|
+
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;
|
|
21040
21614
|
const SubscriptionSuspendButton = _ref => {
|
|
21041
21615
|
let {
|
|
21042
21616
|
subscription,
|
|
@@ -21067,7 +21641,7 @@ const SubscriptionSuspendButton = _ref => {
|
|
|
21067
21641
|
if (err) {
|
|
21068
21642
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
21069
21643
|
}
|
|
21070
|
-
ReactGA$
|
|
21644
|
+
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, {
|
|
21071
21645
|
category: "ACTIONS",
|
|
21072
21646
|
action: "Suspended",
|
|
21073
21647
|
nonInteraction: true
|
|
@@ -23917,7 +24491,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23917
24491
|
});
|
|
23918
24492
|
onFailure(err);
|
|
23919
24493
|
} else {
|
|
23920
|
-
var _ReactGA
|
|
24494
|
+
var _ReactGA$event;
|
|
23921
24495
|
dispatch({
|
|
23922
24496
|
type: SHOW_ALERT,
|
|
23923
24497
|
payload: {
|
|
@@ -23926,7 +24500,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23926
24500
|
}
|
|
23927
24501
|
});
|
|
23928
24502
|
onSuccess(res);
|
|
23929
|
-
|
|
24503
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
23930
24504
|
category: "ACTIONS",
|
|
23931
24505
|
action: "Updated address",
|
|
23932
24506
|
nonInteraction: true
|
|
@@ -24454,11 +25028,13 @@ function PaymentMethodUpdateView(props) {
|
|
|
24454
25028
|
}));
|
|
24455
25029
|
}
|
|
24456
25030
|
|
|
25031
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
25032
|
+
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;
|
|
24457
25033
|
const PaymentMethodUpdateModal = props => {
|
|
24458
25034
|
const onSuccess = res => {
|
|
24459
25035
|
var _props$onSuccess, _ReactGA$event;
|
|
24460
25036
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
24461
|
-
ReactGA$
|
|
25037
|
+
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, {
|
|
24462
25038
|
category: "ACTIONS",
|
|
24463
25039
|
action: "Updated payment card",
|
|
24464
25040
|
nonInteraction: true
|
|
@@ -26374,6 +26950,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26374
26950
|
payload: false
|
|
26375
26951
|
});
|
|
26376
26952
|
if (err) {
|
|
26953
|
+
var _err$response, _err$response$data, _err$response$data$er;
|
|
26377
26954
|
dispatch({
|
|
26378
26955
|
type: SHOW_ALERT,
|
|
26379
26956
|
payload: {
|
|
@@ -26381,7 +26958,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26381
26958
|
content: getErrorMessages(err)
|
|
26382
26959
|
}
|
|
26383
26960
|
});
|
|
26384
|
-
if (
|
|
26961
|
+
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) {
|
|
26385
26962
|
switchToAddressView();
|
|
26386
26963
|
} else {
|
|
26387
26964
|
return onFailure(err);
|
|
@@ -28348,6 +28925,8 @@ const OrderItems = _ref => {
|
|
|
28348
28925
|
});
|
|
28349
28926
|
};
|
|
28350
28927
|
|
|
28928
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1;
|
|
28929
|
+
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;
|
|
28351
28930
|
const SavedItemsMenu = () => {
|
|
28352
28931
|
const {
|
|
28353
28932
|
t
|
|
@@ -29369,6 +29948,8 @@ function getMemberShipStatus(status) {
|
|
|
29369
29948
|
};
|
|
29370
29949
|
}
|
|
29371
29950
|
|
|
29951
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
29952
|
+
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;
|
|
29372
29953
|
const SUB_MENUS = {
|
|
29373
29954
|
PROFILE: "profile",
|
|
29374
29955
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -29433,7 +30014,7 @@ class Dashboard extends React.Component {
|
|
|
29433
30014
|
window.Pelcro.insight.track("Modal Displayed", {
|
|
29434
30015
|
name: "dashboard"
|
|
29435
30016
|
});
|
|
29436
|
-
ReactGA
|
|
30017
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
29437
30018
|
category: "VIEWS",
|
|
29438
30019
|
action: "Dashboard Modal Viewed",
|
|
29439
30020
|
nonInteraction: true
|
|
@@ -29469,7 +30050,7 @@ class Dashboard extends React.Component {
|
|
|
29469
30050
|
if (err) {
|
|
29470
30051
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29471
30052
|
}
|
|
29472
|
-
ReactGA
|
|
30053
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
29473
30054
|
category: "ACTIONS",
|
|
29474
30055
|
action: "Canceled",
|
|
29475
30056
|
nonInteraction: true
|
|
@@ -29487,7 +30068,7 @@ class Dashboard extends React.Component {
|
|
|
29487
30068
|
if (err) {
|
|
29488
30069
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29489
30070
|
}
|
|
29490
|
-
ReactGA
|
|
30071
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event3 = ReactGA.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA, {
|
|
29491
30072
|
category: "ACTIONS",
|
|
29492
30073
|
action: "UnSuspended",
|
|
29493
30074
|
nonInteraction: true
|
|
@@ -29778,13 +30359,13 @@ class Dashboard extends React.Component {
|
|
|
29778
30359
|
this.menuRef = /*#__PURE__*/React__default['default'].createRef();
|
|
29779
30360
|
}
|
|
29780
30361
|
render() {
|
|
29781
|
-
var _window$Pelcro$user$r3, _window$
|
|
30362
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
29782
30363
|
const {
|
|
29783
30364
|
isOpen
|
|
29784
30365
|
} = this.state;
|
|
29785
30366
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
29786
30367
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
29787
|
-
const newsletters = (_window$
|
|
30368
|
+
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;
|
|
29788
30369
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
29789
30370
|
return /*#__PURE__*/React__default['default'].createElement(Transition, {
|
|
29790
30371
|
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",
|