@pelcro/react-pelcro-js 4.0.0-alpha.42 → 4.0.0-alpha.44
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 +901 -92
- package/dist/index.esm.js +901 -92
- package/package.json +2 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7371,6 +7371,53 @@ function _defineProperty$3(obj, key, value) {
|
|
|
7371
7371
|
return obj;
|
|
7372
7372
|
}
|
|
7373
7373
|
|
|
7374
|
+
// Polyfill
|
|
7375
|
+
(() => {
|
|
7376
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
7377
|
+
|
|
7378
|
+
function CustomEvent(event, params = {
|
|
7379
|
+
bubbles: false,
|
|
7380
|
+
cancelable: false,
|
|
7381
|
+
detail: undefined
|
|
7382
|
+
}) {
|
|
7383
|
+
const evt = document.createEvent("CustomEvent");
|
|
7384
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
7385
|
+
return evt;
|
|
7386
|
+
}
|
|
7387
|
+
|
|
7388
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
7389
|
+
window.CustomEvent = CustomEvent;
|
|
7390
|
+
})();
|
|
7391
|
+
/**
|
|
7392
|
+
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
7393
|
+
*/
|
|
7394
|
+
|
|
7395
|
+
|
|
7396
|
+
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
7397
|
+
/**
|
|
7398
|
+
* Should fire when an item added to the cart and expects the added item to be sent
|
|
7399
|
+
*/
|
|
7400
|
+
|
|
7401
|
+
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
7402
|
+
/**
|
|
7403
|
+
* Should fire when an item removed from the cart and expects the removed item to be sent
|
|
7404
|
+
*/
|
|
7405
|
+
|
|
7406
|
+
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
7407
|
+
/**
|
|
7408
|
+
* Check if the browser support custom events
|
|
7409
|
+
*/
|
|
7410
|
+
|
|
7411
|
+
function createCustomEvent(name, detail) {
|
|
7412
|
+
try {
|
|
7413
|
+
return new CustomEvent(name, {
|
|
7414
|
+
detail
|
|
7415
|
+
});
|
|
7416
|
+
} catch (e) {
|
|
7417
|
+
console.warn("Pelcro - Events are not supported in the browser");
|
|
7418
|
+
}
|
|
7419
|
+
}
|
|
7420
|
+
|
|
7374
7421
|
function warn(s) {
|
|
7375
7422
|
console.warn('[react-ga]', s);
|
|
7376
7423
|
}
|
|
@@ -8222,57 +8269,789 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8222
8269
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
8223
8270
|
OutboundLink$1.trackLink = outboundLink;
|
|
8224
8271
|
var OutboundLink = OutboundLink$1;
|
|
8225
|
-
var
|
|
8272
|
+
var ReactGA1 = _objectSpread({}, Defaults, {
|
|
8226
8273
|
OutboundLink: OutboundLink
|
|
8227
8274
|
});
|
|
8228
8275
|
|
|
8229
|
-
|
|
8230
|
-
(() => {
|
|
8231
|
-
if (typeof window.CustomEvent === "function") return false;
|
|
8276
|
+
var gtag_1 = createCommonjsModule(function (module, exports) {
|
|
8232
8277
|
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8278
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8279
|
+
value: true
|
|
8280
|
+
});
|
|
8281
|
+
exports["default"] = void 0;
|
|
8282
|
+
|
|
8283
|
+
var gtag = function gtag() {
|
|
8284
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8285
|
+
args[_key] = arguments[_key];
|
|
8241
8286
|
}
|
|
8242
8287
|
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
})();
|
|
8246
|
-
/**
|
|
8247
|
-
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
8248
|
-
*/
|
|
8288
|
+
if (typeof window !== "undefined") {
|
|
8289
|
+
var _window;
|
|
8249
8290
|
|
|
8291
|
+
if (typeof window.gtag === "undefined") {
|
|
8292
|
+
window.dataLayer = window.dataLayer || [];
|
|
8293
|
+
|
|
8294
|
+
window.gtag = function gtag() {
|
|
8295
|
+
window.dataLayer.push(arguments);
|
|
8296
|
+
};
|
|
8297
|
+
}
|
|
8298
|
+
|
|
8299
|
+
(_window = window).gtag.apply(_window, args);
|
|
8300
|
+
}
|
|
8301
|
+
};
|
|
8302
|
+
|
|
8303
|
+
var _default = gtag;
|
|
8304
|
+
exports["default"] = _default;
|
|
8305
|
+
});
|
|
8306
|
+
|
|
8307
|
+
unwrapExports(gtag_1);
|
|
8308
|
+
|
|
8309
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
8310
|
+
|
|
8311
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8312
|
+
value: true
|
|
8313
|
+
});
|
|
8314
|
+
exports["default"] = format;
|
|
8315
|
+
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
8316
|
+
|
|
8317
|
+
function toTitleCase(string) {
|
|
8318
|
+
return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
|
|
8319
|
+
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) {
|
|
8320
|
+
return match.toLowerCase();
|
|
8321
|
+
}
|
|
8322
|
+
|
|
8323
|
+
if (match.substr(1).search(/[A-Z]|\../) > -1) {
|
|
8324
|
+
return match;
|
|
8325
|
+
}
|
|
8326
|
+
|
|
8327
|
+
return match.charAt(0).toUpperCase() + match.substr(1);
|
|
8328
|
+
});
|
|
8329
|
+
} // See if s could be an email address. We don't want to send personal data like email.
|
|
8330
|
+
// https://support.google.com/analytics/answer/2795983?hl=en
|
|
8331
|
+
|
|
8332
|
+
|
|
8333
|
+
function mightBeEmail(s) {
|
|
8334
|
+
// There's no point trying to validate rfc822 fully, just look for ...@...
|
|
8335
|
+
return typeof s === "string" && s.indexOf("@") !== -1;
|
|
8336
|
+
}
|
|
8337
|
+
|
|
8338
|
+
var redacted = "REDACTED (Potential Email Address)";
|
|
8339
|
+
|
|
8340
|
+
function redactEmail(string) {
|
|
8341
|
+
if (mightBeEmail(string)) {
|
|
8342
|
+
console.warn("This arg looks like an email address, redacting.");
|
|
8343
|
+
return redacted;
|
|
8344
|
+
}
|
|
8345
|
+
|
|
8346
|
+
return string;
|
|
8347
|
+
}
|
|
8348
|
+
|
|
8349
|
+
function format() {
|
|
8350
|
+
var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8351
|
+
var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8352
|
+
var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
8353
|
+
|
|
8354
|
+
var _str = s || "";
|
|
8355
|
+
|
|
8356
|
+
if (titleCase) {
|
|
8357
|
+
_str = toTitleCase(s);
|
|
8358
|
+
}
|
|
8359
|
+
|
|
8360
|
+
if (redactingEmail) {
|
|
8361
|
+
_str = redactEmail(_str);
|
|
8362
|
+
}
|
|
8363
|
+
|
|
8364
|
+
return _str;
|
|
8365
|
+
}
|
|
8366
|
+
});
|
|
8367
|
+
|
|
8368
|
+
unwrapExports(format_1);
|
|
8369
|
+
|
|
8370
|
+
var ga4 = createCommonjsModule(function (module, exports) {
|
|
8371
|
+
|
|
8372
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8373
|
+
value: true
|
|
8374
|
+
});
|
|
8375
|
+
exports["default"] = exports.GA4 = void 0;
|
|
8376
|
+
|
|
8377
|
+
var _gtag = _interopRequireDefault(gtag_1);
|
|
8378
|
+
|
|
8379
|
+
var _format = _interopRequireDefault(format_1);
|
|
8380
|
+
|
|
8381
|
+
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
|
|
8382
|
+
_excluded2 = ["title", "location"],
|
|
8383
|
+
_excluded3 = ["page", "hitType"],
|
|
8384
|
+
_excluded4 = ["action", "category", "label", "value", "nonInteraction", "transport"];
|
|
8385
|
+
|
|
8386
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8387
|
+
|
|
8388
|
+
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; }
|
|
8389
|
+
|
|
8390
|
+
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; }
|
|
8391
|
+
|
|
8392
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
8393
|
+
|
|
8394
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8395
|
+
|
|
8396
|
+
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."); }
|
|
8397
|
+
|
|
8398
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8399
|
+
|
|
8400
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8401
|
+
|
|
8402
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8403
|
+
|
|
8404
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8405
|
+
|
|
8406
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8407
|
+
|
|
8408
|
+
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."); }
|
|
8409
|
+
|
|
8410
|
+
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); }
|
|
8411
|
+
|
|
8412
|
+
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; }
|
|
8413
|
+
|
|
8414
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
8415
|
+
|
|
8416
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8417
|
+
|
|
8418
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8419
|
+
|
|
8420
|
+
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, descriptor.key, descriptor); } }
|
|
8421
|
+
|
|
8422
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8423
|
+
|
|
8424
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8425
|
+
|
|
8426
|
+
/*
|
|
8427
|
+
Links
|
|
8428
|
+
https://developers.google.com/gtagjs/reference/api
|
|
8429
|
+
https://developers.google.com/tag-platform/gtagjs/reference
|
|
8430
|
+
*/
|
|
8250
8431
|
|
|
8251
|
-
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
8252
8432
|
/**
|
|
8253
|
-
*
|
|
8433
|
+
* @typedef GaOptions
|
|
8434
|
+
* @type {Object}
|
|
8435
|
+
* @property {boolean} [cookieUpdate=true]
|
|
8436
|
+
* @property {number} [cookieExpires=63072000] Default two years
|
|
8437
|
+
* @property {string} [cookieDomain="auto"]
|
|
8438
|
+
* @property {string} [cookieFlags]
|
|
8439
|
+
* @property {string} [userId]
|
|
8440
|
+
* @property {string} [clientId]
|
|
8441
|
+
* @property {boolean} [anonymizeIp]
|
|
8442
|
+
* @property {string} [contentGroup1]
|
|
8443
|
+
* @property {string} [contentGroup2]
|
|
8444
|
+
* @property {string} [contentGroup3]
|
|
8445
|
+
* @property {string} [contentGroup4]
|
|
8446
|
+
* @property {string} [contentGroup5]
|
|
8447
|
+
* @property {boolean} [allowAdFeatures=true]
|
|
8448
|
+
* @property {boolean} [allowAdPersonalizationSignals]
|
|
8449
|
+
* @property {boolean} [nonInteraction]
|
|
8450
|
+
* @property {string} [page]
|
|
8254
8451
|
*/
|
|
8255
8452
|
|
|
8256
|
-
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
8257
8453
|
/**
|
|
8258
|
-
*
|
|
8454
|
+
* @typedef UaEventOptions
|
|
8455
|
+
* @type {Object}
|
|
8456
|
+
* @property {string} action
|
|
8457
|
+
* @property {string} category
|
|
8458
|
+
* @property {string} [label]
|
|
8459
|
+
* @property {number} [value]
|
|
8460
|
+
* @property {boolean} [nonInteraction]
|
|
8461
|
+
* @property {('beacon'|'xhr'|'image')} [transport]
|
|
8259
8462
|
*/
|
|
8260
8463
|
|
|
8261
|
-
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
8262
8464
|
/**
|
|
8263
|
-
*
|
|
8465
|
+
* @typedef InitOptions
|
|
8466
|
+
* @type {Object}
|
|
8467
|
+
* @property {string} trackingId
|
|
8468
|
+
* @property {GaOptions|any} [gaOptions]
|
|
8469
|
+
* @property {Object} [gtagOptions] New parameter
|
|
8264
8470
|
*/
|
|
8471
|
+
var GA4 = /*#__PURE__*/function () {
|
|
8472
|
+
function GA4() {
|
|
8473
|
+
var _this = this;
|
|
8265
8474
|
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8475
|
+
_classCallCheck(this, GA4);
|
|
8476
|
+
|
|
8477
|
+
_defineProperty(this, "reset", function () {
|
|
8478
|
+
_this.isInitialized = false;
|
|
8479
|
+
_this._testMode = false;
|
|
8480
|
+
_this._currentMeasurementId;
|
|
8481
|
+
_this._hasLoadedGA = false;
|
|
8482
|
+
_this._isQueuing = false;
|
|
8483
|
+
_this._queueGtag = [];
|
|
8270
8484
|
});
|
|
8271
|
-
|
|
8272
|
-
|
|
8485
|
+
|
|
8486
|
+
_defineProperty(this, "_gtag", function () {
|
|
8487
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8488
|
+
args[_key] = arguments[_key];
|
|
8489
|
+
}
|
|
8490
|
+
|
|
8491
|
+
if (!_this._testMode) {
|
|
8492
|
+
if (_this._isQueuing) {
|
|
8493
|
+
_this._queueGtag.push(args);
|
|
8494
|
+
} else {
|
|
8495
|
+
_gtag["default"].apply(void 0, args);
|
|
8496
|
+
}
|
|
8497
|
+
} else {
|
|
8498
|
+
_this._queueGtag.push(args);
|
|
8499
|
+
}
|
|
8500
|
+
});
|
|
8501
|
+
|
|
8502
|
+
_defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
|
|
8503
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
8504
|
+
return;
|
|
8505
|
+
}
|
|
8506
|
+
|
|
8507
|
+
if (!_this._hasLoadedGA) {
|
|
8508
|
+
// Global Site Tag (gtag.js) - Google Analytics
|
|
8509
|
+
var script = document.createElement("script");
|
|
8510
|
+
script.async = true;
|
|
8511
|
+
script.src = "https://www.googletagmanager.com/gtag/js?id=".concat(GA_MEASUREMENT_ID);
|
|
8512
|
+
|
|
8513
|
+
if (nonce) {
|
|
8514
|
+
script.setAttribute("nonce", nonce);
|
|
8515
|
+
}
|
|
8516
|
+
|
|
8517
|
+
document.body.appendChild(script);
|
|
8518
|
+
window.dataLayer = window.dataLayer || [];
|
|
8519
|
+
|
|
8520
|
+
window.gtag = function gtag() {
|
|
8521
|
+
window.dataLayer.push(arguments);
|
|
8522
|
+
};
|
|
8523
|
+
|
|
8524
|
+
_this._hasLoadedGA = true;
|
|
8525
|
+
}
|
|
8526
|
+
});
|
|
8527
|
+
|
|
8528
|
+
_defineProperty(this, "_toGtagOptions", function (gaOptions) {
|
|
8529
|
+
if (!gaOptions) {
|
|
8530
|
+
return;
|
|
8531
|
+
}
|
|
8532
|
+
|
|
8533
|
+
var mapFields = {
|
|
8534
|
+
// Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
|
|
8535
|
+
// New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
|
|
8536
|
+
cookieUpdate: "cookie_update",
|
|
8537
|
+
cookieExpires: "cookie_expires",
|
|
8538
|
+
cookieDomain: "cookie_domain",
|
|
8539
|
+
cookieFlags: "cookie_flags",
|
|
8540
|
+
// must be in set method?
|
|
8541
|
+
userId: "user_id",
|
|
8542
|
+
clientId: "client_id",
|
|
8543
|
+
anonymizeIp: "anonymize_ip",
|
|
8544
|
+
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
8545
|
+
contentGroup1: "content_group1",
|
|
8546
|
+
contentGroup2: "content_group2",
|
|
8547
|
+
contentGroup3: "content_group3",
|
|
8548
|
+
contentGroup4: "content_group4",
|
|
8549
|
+
contentGroup5: "content_group5",
|
|
8550
|
+
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
8551
|
+
allowAdFeatures: "allow_google_signals",
|
|
8552
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
8553
|
+
nonInteraction: "non_interaction",
|
|
8554
|
+
page: "page_path",
|
|
8555
|
+
hitCallback: "event_callback"
|
|
8556
|
+
};
|
|
8557
|
+
var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
|
|
8558
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
8559
|
+
key = _ref2[0],
|
|
8560
|
+
value = _ref2[1];
|
|
8561
|
+
|
|
8562
|
+
if (mapFields[key]) {
|
|
8563
|
+
prev[mapFields[key]] = value;
|
|
8564
|
+
} else {
|
|
8565
|
+
prev[key] = value;
|
|
8566
|
+
}
|
|
8567
|
+
|
|
8568
|
+
return prev;
|
|
8569
|
+
}, {});
|
|
8570
|
+
return gtagOptions;
|
|
8571
|
+
});
|
|
8572
|
+
|
|
8573
|
+
_defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
|
|
8574
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8575
|
+
|
|
8576
|
+
if (!GA_MEASUREMENT_ID) {
|
|
8577
|
+
throw new Error("Require GA_MEASUREMENT_ID");
|
|
8578
|
+
}
|
|
8579
|
+
|
|
8580
|
+
var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
|
|
8581
|
+
trackingId: GA_MEASUREMENT_ID
|
|
8582
|
+
}] : GA_MEASUREMENT_ID;
|
|
8583
|
+
_this._currentMeasurementId = initConfigs[0].trackingId;
|
|
8584
|
+
var gaOptions = options.gaOptions,
|
|
8585
|
+
gtagOptions = options.gtagOptions,
|
|
8586
|
+
_options$legacyDimens = options.legacyDimensionMetric,
|
|
8587
|
+
legacyDimensionMetric = _options$legacyDimens === void 0 ? true : _options$legacyDimens,
|
|
8588
|
+
nonce = options.nonce,
|
|
8589
|
+
_options$testMode = options.testMode,
|
|
8590
|
+
testMode = _options$testMode === void 0 ? false : _options$testMode;
|
|
8591
|
+
_this._testMode = testMode;
|
|
8592
|
+
|
|
8593
|
+
if (!testMode) {
|
|
8594
|
+
_this._loadGA(_this._currentMeasurementId, nonce);
|
|
8595
|
+
}
|
|
8596
|
+
|
|
8597
|
+
if (!_this.isInitialized) {
|
|
8598
|
+
_this._gtag("js", new Date());
|
|
8599
|
+
|
|
8600
|
+
initConfigs.forEach(function (config) {
|
|
8601
|
+
var mergedGtagOptions = _this._appendCustomMap(_objectSpread(_objectSpread(_objectSpread({
|
|
8602
|
+
// https://developers.google.com/analytics/devguides/collection/gtagjs/pages#disable_pageview_measurement
|
|
8603
|
+
send_page_view: false
|
|
8604
|
+
}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions), legacyDimensionMetric);
|
|
8605
|
+
|
|
8606
|
+
_this._gtag("config", config.trackingId, mergedGtagOptions);
|
|
8607
|
+
});
|
|
8608
|
+
}
|
|
8609
|
+
|
|
8610
|
+
_this.isInitialized = true;
|
|
8611
|
+
|
|
8612
|
+
if (!testMode) {
|
|
8613
|
+
var queues = _toConsumableArray(_this._queueGtag);
|
|
8614
|
+
|
|
8615
|
+
_this._queueGtag = [];
|
|
8616
|
+
_this._isQueuing = false;
|
|
8617
|
+
|
|
8618
|
+
while (queues.length) {
|
|
8619
|
+
var queue = queues.shift();
|
|
8620
|
+
|
|
8621
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8622
|
+
|
|
8623
|
+
if (queue[0] === "get") {
|
|
8624
|
+
_this._isQueuing = true;
|
|
8625
|
+
}
|
|
8626
|
+
}
|
|
8627
|
+
}
|
|
8628
|
+
});
|
|
8629
|
+
|
|
8630
|
+
_defineProperty(this, "set", function (fieldsObject) {
|
|
8631
|
+
if (!fieldsObject) {
|
|
8632
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
8633
|
+
return;
|
|
8634
|
+
}
|
|
8635
|
+
|
|
8636
|
+
if (_typeof(fieldsObject) !== "object") {
|
|
8637
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
8638
|
+
return;
|
|
8639
|
+
}
|
|
8640
|
+
|
|
8641
|
+
if (Object.keys(fieldsObject).length === 0) {
|
|
8642
|
+
console.warn("empty `fieldsObject` given to .set()");
|
|
8643
|
+
}
|
|
8644
|
+
|
|
8645
|
+
_this._gaCommand("set", fieldsObject);
|
|
8646
|
+
});
|
|
8647
|
+
|
|
8648
|
+
_defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
|
|
8649
|
+
_this._gtag("event", eventAction, _objectSpread(_objectSpread({
|
|
8650
|
+
event_category: eventCategory,
|
|
8651
|
+
event_label: eventLabel,
|
|
8652
|
+
value: eventValue
|
|
8653
|
+
}, fieldsObject && {
|
|
8654
|
+
non_interaction: fieldsObject.nonInteraction
|
|
8655
|
+
}), _this._toGtagOptions(fieldsObject)));
|
|
8656
|
+
});
|
|
8657
|
+
|
|
8658
|
+
_defineProperty(this, "_gaCommandSendEventParameters", function () {
|
|
8659
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8660
|
+
args[_key2] = arguments[_key2];
|
|
8661
|
+
}
|
|
8662
|
+
|
|
8663
|
+
if (typeof args[0] === "string") {
|
|
8664
|
+
_this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8665
|
+
} else {
|
|
8666
|
+
var _args$ = args[0],
|
|
8667
|
+
eventCategory = _args$.eventCategory,
|
|
8668
|
+
eventAction = _args$.eventAction,
|
|
8669
|
+
eventLabel = _args$.eventLabel,
|
|
8670
|
+
eventValue = _args$.eventValue;
|
|
8671
|
+
_args$.hitType;
|
|
8672
|
+
var rest = _objectWithoutProperties(_args$, _excluded);
|
|
8673
|
+
|
|
8674
|
+
_this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
|
|
8675
|
+
}
|
|
8676
|
+
});
|
|
8677
|
+
|
|
8678
|
+
_defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
|
|
8679
|
+
_this._gtag("event", "timing_complete", {
|
|
8680
|
+
name: timingVar,
|
|
8681
|
+
value: timingValue,
|
|
8682
|
+
event_category: timingCategory,
|
|
8683
|
+
event_label: timingLabel
|
|
8684
|
+
});
|
|
8685
|
+
});
|
|
8686
|
+
|
|
8687
|
+
_defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
|
|
8688
|
+
if (fieldsObject && Object.keys(fieldsObject).length) {
|
|
8689
|
+
var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
|
|
8690
|
+
title = _this$_toGtagOptions.title,
|
|
8691
|
+
location = _this$_toGtagOptions.location,
|
|
8692
|
+
rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
|
|
8693
|
+
|
|
8694
|
+
_this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
|
|
8695
|
+
page_path: page
|
|
8696
|
+
}), title && {
|
|
8697
|
+
page_title: title
|
|
8698
|
+
}), location && {
|
|
8699
|
+
page_location: location
|
|
8700
|
+
}), rest));
|
|
8701
|
+
} else if (page) {
|
|
8702
|
+
_this._gtag("event", "page_view", {
|
|
8703
|
+
page_path: page
|
|
8704
|
+
});
|
|
8705
|
+
} else {
|
|
8706
|
+
_this._gtag("event", "page_view");
|
|
8707
|
+
}
|
|
8708
|
+
});
|
|
8709
|
+
|
|
8710
|
+
_defineProperty(this, "_gaCommandSendPageviewParameters", function () {
|
|
8711
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8712
|
+
args[_key3] = arguments[_key3];
|
|
8713
|
+
}
|
|
8714
|
+
|
|
8715
|
+
if (typeof args[0] === "string") {
|
|
8716
|
+
_this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8717
|
+
} else {
|
|
8718
|
+
var _args$2 = args[0],
|
|
8719
|
+
page = _args$2.page;
|
|
8720
|
+
_args$2.hitType;
|
|
8721
|
+
var rest = _objectWithoutProperties(_args$2, _excluded3);
|
|
8722
|
+
|
|
8723
|
+
_this._gaCommandSendPageview(page, rest);
|
|
8724
|
+
}
|
|
8725
|
+
});
|
|
8726
|
+
|
|
8727
|
+
_defineProperty(this, "_gaCommandSend", function () {
|
|
8728
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
8729
|
+
args[_key4] = arguments[_key4];
|
|
8730
|
+
}
|
|
8731
|
+
|
|
8732
|
+
var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
|
|
8733
|
+
|
|
8734
|
+
switch (hitType) {
|
|
8735
|
+
case "event":
|
|
8736
|
+
_this._gaCommandSendEventParameters.apply(_this, args);
|
|
8737
|
+
|
|
8738
|
+
break;
|
|
8739
|
+
|
|
8740
|
+
case "pageview":
|
|
8741
|
+
_this._gaCommandSendPageviewParameters.apply(_this, args);
|
|
8742
|
+
|
|
8743
|
+
break;
|
|
8744
|
+
|
|
8745
|
+
case "timing":
|
|
8746
|
+
_this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8747
|
+
|
|
8748
|
+
break;
|
|
8749
|
+
|
|
8750
|
+
case "screenview":
|
|
8751
|
+
case "transaction":
|
|
8752
|
+
case "item":
|
|
8753
|
+
case "social":
|
|
8754
|
+
case "exception":
|
|
8755
|
+
console.warn("Unsupported send command: ".concat(hitType));
|
|
8756
|
+
break;
|
|
8757
|
+
|
|
8758
|
+
default:
|
|
8759
|
+
console.warn("Send command doesn't exist: ".concat(hitType));
|
|
8760
|
+
}
|
|
8761
|
+
});
|
|
8762
|
+
|
|
8763
|
+
_defineProperty(this, "_gaCommandSet", function () {
|
|
8764
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8765
|
+
args[_key5] = arguments[_key5];
|
|
8766
|
+
}
|
|
8767
|
+
|
|
8768
|
+
if (typeof args[0] === "string") {
|
|
8769
|
+
args[0] = _defineProperty({}, args[0], args[1]);
|
|
8770
|
+
}
|
|
8771
|
+
|
|
8772
|
+
_this._gtag("set", _this._toGtagOptions(args[0]));
|
|
8773
|
+
});
|
|
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
|
+
|
|
8780
|
+
switch (command) {
|
|
8781
|
+
case "send":
|
|
8782
|
+
_this._gaCommandSend.apply(_this, args);
|
|
8783
|
+
|
|
8784
|
+
break;
|
|
8785
|
+
|
|
8786
|
+
case "set":
|
|
8787
|
+
_this._gaCommandSet.apply(_this, args);
|
|
8788
|
+
|
|
8789
|
+
break;
|
|
8790
|
+
|
|
8791
|
+
default:
|
|
8792
|
+
console.warn("Command doesn't exist: ".concat(command));
|
|
8793
|
+
}
|
|
8794
|
+
});
|
|
8795
|
+
|
|
8796
|
+
_defineProperty(this, "ga", function () {
|
|
8797
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8798
|
+
args[_key7] = arguments[_key7];
|
|
8799
|
+
}
|
|
8800
|
+
|
|
8801
|
+
if (typeof args[0] === "string") {
|
|
8802
|
+
_this._gaCommand.apply(_this, args);
|
|
8803
|
+
} else {
|
|
8804
|
+
var readyCallback = args[0];
|
|
8805
|
+
|
|
8806
|
+
_this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
|
|
8807
|
+
_this._isQueuing = false;
|
|
8808
|
+
var queues = _this._queueGtag;
|
|
8809
|
+
readyCallback({
|
|
8810
|
+
get: function get(property) {
|
|
8811
|
+
return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
|
|
8812
|
+
}
|
|
8813
|
+
});
|
|
8814
|
+
|
|
8815
|
+
while (queues.length) {
|
|
8816
|
+
var queue = queues.shift();
|
|
8817
|
+
|
|
8818
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8819
|
+
}
|
|
8820
|
+
});
|
|
8821
|
+
|
|
8822
|
+
_this._isQueuing = true;
|
|
8823
|
+
}
|
|
8824
|
+
|
|
8825
|
+
return _this.ga;
|
|
8826
|
+
});
|
|
8827
|
+
|
|
8828
|
+
_defineProperty(this, "event", function (optionsOrName, params) {
|
|
8829
|
+
if (typeof optionsOrName === "string") {
|
|
8830
|
+
_this._gtag("event", optionsOrName, _this._toGtagOptions(params));
|
|
8831
|
+
} else {
|
|
8832
|
+
var action = optionsOrName.action,
|
|
8833
|
+
category = optionsOrName.category,
|
|
8834
|
+
label = optionsOrName.label,
|
|
8835
|
+
value = optionsOrName.value,
|
|
8836
|
+
nonInteraction = optionsOrName.nonInteraction,
|
|
8837
|
+
transport = optionsOrName.transport,
|
|
8838
|
+
rest = _objectWithoutProperties(optionsOrName, _excluded4);
|
|
8839
|
+
|
|
8840
|
+
if (!category || !action) {
|
|
8841
|
+
console.warn("args.category AND args.action are required in event()");
|
|
8842
|
+
return;
|
|
8843
|
+
} // Required Fields
|
|
8844
|
+
|
|
8845
|
+
|
|
8846
|
+
var fieldObject = {
|
|
8847
|
+
hitType: "event",
|
|
8848
|
+
eventCategory: (0, _format["default"])(category),
|
|
8849
|
+
eventAction: (0, _format["default"])(action)
|
|
8850
|
+
}; // Optional Fields
|
|
8851
|
+
|
|
8852
|
+
if (label) {
|
|
8853
|
+
fieldObject.eventLabel = (0, _format["default"])(label);
|
|
8854
|
+
}
|
|
8855
|
+
|
|
8856
|
+
if (typeof value !== "undefined") {
|
|
8857
|
+
if (typeof value !== "number") {
|
|
8858
|
+
console.warn("Expected `args.value` arg to be a Number.");
|
|
8859
|
+
} else {
|
|
8860
|
+
fieldObject.eventValue = value;
|
|
8861
|
+
}
|
|
8862
|
+
}
|
|
8863
|
+
|
|
8864
|
+
if (typeof nonInteraction !== "undefined") {
|
|
8865
|
+
if (typeof nonInteraction !== "boolean") {
|
|
8866
|
+
console.warn("`args.nonInteraction` must be a boolean.");
|
|
8867
|
+
} else {
|
|
8868
|
+
fieldObject.nonInteraction = nonInteraction;
|
|
8869
|
+
}
|
|
8870
|
+
}
|
|
8871
|
+
|
|
8872
|
+
if (typeof transport !== "undefined") {
|
|
8873
|
+
if (typeof transport !== "string") {
|
|
8874
|
+
console.warn("`args.transport` must be a string.");
|
|
8875
|
+
} else {
|
|
8876
|
+
if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
|
|
8877
|
+
console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
|
|
8878
|
+
}
|
|
8879
|
+
|
|
8880
|
+
fieldObject.transport = transport;
|
|
8881
|
+
}
|
|
8882
|
+
}
|
|
8883
|
+
|
|
8884
|
+
Object.keys(rest).filter(function (key) {
|
|
8885
|
+
return key.substr(0, "dimension".length) === "dimension";
|
|
8886
|
+
}).forEach(function (key) {
|
|
8887
|
+
fieldObject[key] = rest[key];
|
|
8888
|
+
});
|
|
8889
|
+
Object.keys(rest).filter(function (key) {
|
|
8890
|
+
return key.substr(0, "metric".length) === "metric";
|
|
8891
|
+
}).forEach(function (key) {
|
|
8892
|
+
fieldObject[key] = rest[key];
|
|
8893
|
+
});
|
|
8894
|
+
|
|
8895
|
+
_this._gaCommand("send", fieldObject);
|
|
8896
|
+
}
|
|
8897
|
+
});
|
|
8898
|
+
|
|
8899
|
+
_defineProperty(this, "send", function (fieldObject) {
|
|
8900
|
+
_this._gaCommand("send", fieldObject);
|
|
8901
|
+
});
|
|
8902
|
+
|
|
8903
|
+
_defineProperty(this, "pageview", function (path, _, title) {
|
|
8904
|
+
var pathTrim = path === null || path === void 0 ? void 0 : path.trim();
|
|
8905
|
+
|
|
8906
|
+
if (pathTrim === "") {
|
|
8907
|
+
console.warn("path cannot be an empty string in .pageview()");
|
|
8908
|
+
return;
|
|
8909
|
+
}
|
|
8910
|
+
|
|
8911
|
+
_this._gaCommand("send", "pageview", pathTrim, {
|
|
8912
|
+
title: title
|
|
8913
|
+
});
|
|
8914
|
+
});
|
|
8915
|
+
|
|
8916
|
+
this.reset();
|
|
8273
8917
|
}
|
|
8274
|
-
}
|
|
8275
8918
|
|
|
8919
|
+
_createClass(GA4, [{
|
|
8920
|
+
key: "gtag",
|
|
8921
|
+
value: function gtag() {
|
|
8922
|
+
this._gtag.apply(this, arguments);
|
|
8923
|
+
}
|
|
8924
|
+
}, {
|
|
8925
|
+
key: "_appendCustomMap",
|
|
8926
|
+
value: function _appendCustomMap(options) {
|
|
8927
|
+
var legacyDimensionMetric = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8928
|
+
|
|
8929
|
+
if (!legacyDimensionMetric) {
|
|
8930
|
+
return options;
|
|
8931
|
+
}
|
|
8932
|
+
|
|
8933
|
+
if (!options.custom_map) {
|
|
8934
|
+
options.custom_map = {};
|
|
8935
|
+
}
|
|
8936
|
+
|
|
8937
|
+
for (var i = 1; i <= 200; i++) {
|
|
8938
|
+
if (!options.custom_map["dimension".concat(i)]) {
|
|
8939
|
+
options.custom_map["dimension".concat(i)] = "dimension".concat(i);
|
|
8940
|
+
}
|
|
8941
|
+
|
|
8942
|
+
if (!options.custom_map["metric".concat(i)]) {
|
|
8943
|
+
options.custom_map["metric".concat(i)] = "metric".concat(i);
|
|
8944
|
+
}
|
|
8945
|
+
}
|
|
8946
|
+
|
|
8947
|
+
return options;
|
|
8948
|
+
}
|
|
8949
|
+
/**
|
|
8950
|
+
* @since v1.0.2
|
|
8951
|
+
* @param {string} [path="location.href"]
|
|
8952
|
+
* @param {string[]} [_] unsupported
|
|
8953
|
+
* @param {string} [title="location.pathname"]
|
|
8954
|
+
* @deprecated Use `.send("pageview")` instead
|
|
8955
|
+
*/
|
|
8956
|
+
|
|
8957
|
+
}, {
|
|
8958
|
+
key: "outboundLink",
|
|
8959
|
+
value:
|
|
8960
|
+
/**
|
|
8961
|
+
* @since v1.0.6
|
|
8962
|
+
* @param {Object} options
|
|
8963
|
+
* @param {string} options.label
|
|
8964
|
+
* @param {function} hitCallback
|
|
8965
|
+
* @deprecated Use `enhanced measurement` feature in Google Analytics.
|
|
8966
|
+
*/
|
|
8967
|
+
function outboundLink(_ref3, hitCallback) {
|
|
8968
|
+
var label = _ref3.label;
|
|
8969
|
+
|
|
8970
|
+
if (typeof hitCallback !== "function") {
|
|
8971
|
+
console.warn("hitCallback function is required");
|
|
8972
|
+
return;
|
|
8973
|
+
}
|
|
8974
|
+
|
|
8975
|
+
if (!label) {
|
|
8976
|
+
console.warn("args.label is required in outboundLink()");
|
|
8977
|
+
return;
|
|
8978
|
+
} // Required Fields
|
|
8979
|
+
|
|
8980
|
+
|
|
8981
|
+
var fieldObject = {
|
|
8982
|
+
hitType: "event",
|
|
8983
|
+
eventCategory: "Outbound",
|
|
8984
|
+
eventAction: "Click",
|
|
8985
|
+
eventLabel: (0, _format["default"])(label)
|
|
8986
|
+
};
|
|
8987
|
+
var safetyCallbackCalled = false;
|
|
8988
|
+
|
|
8989
|
+
var safetyCallback = function safetyCallback() {
|
|
8990
|
+
// This prevents a delayed response from GA
|
|
8991
|
+
// causing hitCallback from being fired twice
|
|
8992
|
+
safetyCallbackCalled = true;
|
|
8993
|
+
hitCallback();
|
|
8994
|
+
}; // Using a timeout to ensure the execution of critical application code
|
|
8995
|
+
// in the case when the GA server might be down
|
|
8996
|
+
// or an ad blocker prevents sending the data
|
|
8997
|
+
// register safety net timeout:
|
|
8998
|
+
|
|
8999
|
+
|
|
9000
|
+
var t = setTimeout(safetyCallback, 250);
|
|
9001
|
+
|
|
9002
|
+
var clearableCallbackForGA = function clearableCallbackForGA() {
|
|
9003
|
+
clearTimeout(t);
|
|
9004
|
+
|
|
9005
|
+
if (!safetyCallbackCalled) {
|
|
9006
|
+
hitCallback();
|
|
9007
|
+
}
|
|
9008
|
+
};
|
|
9009
|
+
|
|
9010
|
+
fieldObject.hitCallback = clearableCallbackForGA;
|
|
9011
|
+
|
|
9012
|
+
this._gaCommand("send", fieldObject);
|
|
9013
|
+
}
|
|
9014
|
+
}]);
|
|
9015
|
+
|
|
9016
|
+
return GA4;
|
|
9017
|
+
}();
|
|
9018
|
+
|
|
9019
|
+
exports.GA4 = GA4;
|
|
9020
|
+
|
|
9021
|
+
var _default = new GA4();
|
|
9022
|
+
|
|
9023
|
+
exports["default"] = _default;
|
|
9024
|
+
});
|
|
9025
|
+
|
|
9026
|
+
unwrapExports(ga4);
|
|
9027
|
+
ga4.GA4;
|
|
9028
|
+
|
|
9029
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
9030
|
+
|
|
9031
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
9032
|
+
|
|
9033
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9034
|
+
value: true
|
|
9035
|
+
});
|
|
9036
|
+
exports["default"] = exports.ReactGAImplementation = void 0;
|
|
9037
|
+
|
|
9038
|
+
var _ga = _interopRequireWildcard(ga4);
|
|
9039
|
+
|
|
9040
|
+
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); }
|
|
9041
|
+
|
|
9042
|
+
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; }
|
|
9043
|
+
|
|
9044
|
+
var ReactGAImplementation = _ga.GA4;
|
|
9045
|
+
exports.ReactGAImplementation = ReactGAImplementation;
|
|
9046
|
+
var _default = _ga["default"];
|
|
9047
|
+
exports["default"] = _default;
|
|
9048
|
+
});
|
|
9049
|
+
|
|
9050
|
+
var ReactGA4 = unwrapExports(dist);
|
|
9051
|
+
dist.ReactGAImplementation;
|
|
9052
|
+
|
|
9053
|
+
var _window$f, _window$Pelcro$f, _window$Pelcro$uiSett$f;
|
|
9054
|
+
const ReactGA$f = (_window$f = window) !== null && _window$f !== void 0 && (_window$Pelcro$f = _window$f.Pelcro) !== null && _window$Pelcro$f !== void 0 && (_window$Pelcro$uiSett$f = _window$Pelcro$f.uiSettings) !== null && _window$Pelcro$uiSett$f !== void 0 && _window$Pelcro$uiSett$f.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
8276
9055
|
class PelcroActions {
|
|
8277
9056
|
constructor(storeSetter, storeGetter) {
|
|
8278
9057
|
_defineProperty$3(this, "resetState", () => {
|
|
@@ -8507,7 +9286,7 @@ class PelcroActions {
|
|
|
8507
9286
|
}
|
|
8508
9287
|
|
|
8509
9288
|
window.Pelcro.user.logout();
|
|
8510
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
9289
|
+
ReactGA$f === null || ReactGA$f === void 0 ? void 0 : (_ReactGA$event = ReactGA$f.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$f, {
|
|
8511
9290
|
category: "ACTIONS",
|
|
8512
9291
|
action: "Logged out",
|
|
8513
9292
|
nonInteraction: true
|
|
@@ -8757,6 +9536,8 @@ if (process.env.NODE_ENV === "development") {
|
|
|
8757
9536
|
c$1("Pelcro Store", usePelcro);
|
|
8758
9537
|
}
|
|
8759
9538
|
|
|
9539
|
+
var _window$e, _window$Pelcro$e, _window$Pelcro$uiSett$e;
|
|
9540
|
+
const ReactGA$e = (_window$e = window) !== null && _window$e !== void 0 && (_window$Pelcro$e = _window$e.Pelcro) !== null && _window$Pelcro$e !== void 0 && (_window$Pelcro$uiSett$e = _window$Pelcro$e.uiSettings) !== null && _window$Pelcro$uiSett$e !== void 0 && _window$Pelcro$uiSett$e.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
8760
9541
|
/**
|
|
8761
9542
|
* List of zero-decimal currencies.
|
|
8762
9543
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8838,9 +9619,9 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8838
9619
|
*/
|
|
8839
9620
|
|
|
8840
9621
|
const getPageOrDefaultLanguage = () => {
|
|
8841
|
-
var _window$Pelcro$helper, _window$
|
|
9622
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
8842
9623
|
|
|
8843
|
-
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$
|
|
9624
|
+
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);
|
|
8844
9625
|
};
|
|
8845
9626
|
/**
|
|
8846
9627
|
* Returns a formatted price string depending on locale
|
|
@@ -8895,10 +9676,10 @@ const isValidViewFromURL = viewID => {
|
|
|
8895
9676
|
*/
|
|
8896
9677
|
|
|
8897
9678
|
function hasValidNewsletterUpdateUrl() {
|
|
8898
|
-
var _window$
|
|
9679
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8899
9680
|
|
|
8900
9681
|
if (viewID !== "newsletter-update") return false;
|
|
8901
|
-
const newsletters = (_window$
|
|
9682
|
+
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;
|
|
8902
9683
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8903
9684
|
|
|
8904
9685
|
if (!siteHasNewslettersDefined) {
|
|
@@ -8975,16 +9756,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
8975
9756
|
}
|
|
8976
9757
|
|
|
8977
9758
|
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;
|
|
8978
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$set = ReactGA.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA, {
|
|
9759
|
+
ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$set = ReactGA$e.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA$e, {
|
|
8979
9760
|
currencyCode: currencyCode
|
|
8980
9761
|
});
|
|
8981
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin = ReactGA.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", {
|
|
9762
|
+
ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$e.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", {
|
|
8982
9763
|
id: lastSubscriptionId,
|
|
8983
9764
|
affiliation: "Pelcro",
|
|
8984
9765
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
8985
9766
|
coupon: couponCode
|
|
8986
9767
|
});
|
|
8987
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA.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", {
|
|
9768
|
+
ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA$e.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", {
|
|
8988
9769
|
id: lastSubscriptionId,
|
|
8989
9770
|
name: product.name,
|
|
8990
9771
|
category: product.description,
|
|
@@ -8992,8 +9773,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
8992
9773
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
8993
9774
|
quantity: 1
|
|
8994
9775
|
});
|
|
8995
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA.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");
|
|
8996
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
9776
|
+
ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA$e.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");
|
|
9777
|
+
ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$event = ReactGA$e.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$e, {
|
|
8997
9778
|
category: "ACTIONS",
|
|
8998
9779
|
action: "Subscribed",
|
|
8999
9780
|
nonInteraction: true
|
|
@@ -9084,9 +9865,9 @@ function getDateWithoutTime(dateObject) {
|
|
|
9084
9865
|
return date;
|
|
9085
9866
|
}
|
|
9086
9867
|
function userMustVerifyEmail() {
|
|
9087
|
-
var _window$Pelcro$site$
|
|
9868
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9088
9869
|
|
|
9089
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9870
|
+
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;
|
|
9090
9871
|
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;
|
|
9091
9872
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9092
9873
|
}
|
|
@@ -9095,12 +9876,12 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9095
9876
|
//load bugsnag CDN
|
|
9096
9877
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9097
9878
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9098
|
-
var _window$Pelcro$enviro, _window$
|
|
9879
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
9099
9880
|
|
|
9100
9881
|
Bugsnag.start({
|
|
9101
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9882
|
+
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",
|
|
9102
9883
|
autoDetectErrors: false,
|
|
9103
|
-
releaseStage: (_window$
|
|
9884
|
+
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,
|
|
9104
9885
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9105
9886
|
...startOptions
|
|
9106
9887
|
});
|
|
@@ -9274,6 +10055,9 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9274
10055
|
return descriptor.value;
|
|
9275
10056
|
}
|
|
9276
10057
|
|
|
10058
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
10059
|
+
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;
|
|
10060
|
+
|
|
9277
10061
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9278
10062
|
|
|
9279
10063
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
@@ -9432,7 +10216,7 @@ class SaveToMetadataButtonClass {
|
|
|
9432
10216
|
|
|
9433
10217
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9434
10218
|
|
|
9435
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
10219
|
+
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, {
|
|
9436
10220
|
category: "ACTIONS",
|
|
9437
10221
|
action: "Save/Follow",
|
|
9438
10222
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9470,7 +10254,7 @@ class SaveToMetadataButtonClass {
|
|
|
9470
10254
|
|
|
9471
10255
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9472
10256
|
|
|
9473
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
10257
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$d.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$d, {
|
|
9474
10258
|
category: "ACTIONS",
|
|
9475
10259
|
action: "Unsave/Unfollow",
|
|
9476
10260
|
label: title
|
|
@@ -11204,6 +11988,8 @@ function getSiteCardProcessor() {
|
|
|
11204
11988
|
return "stripe";
|
|
11205
11989
|
}
|
|
11206
11990
|
|
|
11991
|
+
var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
|
|
11992
|
+
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;
|
|
11207
11993
|
/**
|
|
11208
11994
|
* @typedef {Object} OptionsType
|
|
11209
11995
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -11336,13 +12122,13 @@ const initSecuritySdk = () => {
|
|
|
11336
12122
|
const initGATracking = () => {
|
|
11337
12123
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
11338
12124
|
|
|
11339
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$initialize = ReactGA.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA, window.Pelcro.site.read().google_analytics_id);
|
|
11340
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin = ReactGA.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");
|
|
12125
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$initialize = ReactGA$c.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA$c, window.Pelcro.site.read().google_analytics_id);
|
|
12126
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$c.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");
|
|
11341
12127
|
};
|
|
11342
12128
|
const dispatchModalDisplayEvents = modalName => {
|
|
11343
12129
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
11344
12130
|
|
|
11345
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
12131
|
+
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, {
|
|
11346
12132
|
category: "VIEWS",
|
|
11347
12133
|
action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
|
|
11348
12134
|
nonInteraction: true
|
|
@@ -12198,6 +12984,8 @@ const CANCEL_SUBSCRIPTION = "CANCEL_SUBSCRIPTION";
|
|
|
12198
12984
|
const UNSUSPEND_SUBSCRIPTION = "UNSUSPEND_SUBSCRIPTION";
|
|
12199
12985
|
const REACTIVATE_SUBSCRIPTION = "REACTIVATE_SUBSCRIPTION"; //========
|
|
12200
12986
|
|
|
12987
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
12988
|
+
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;
|
|
12201
12989
|
const initialState$n = {
|
|
12202
12990
|
email: "",
|
|
12203
12991
|
username: "",
|
|
@@ -12254,7 +13042,7 @@ const LoginContainer = ({
|
|
|
12254
13042
|
var _ReactGA$event;
|
|
12255
13043
|
|
|
12256
13044
|
onSuccess(res);
|
|
12257
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
13045
|
+
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, {
|
|
12258
13046
|
category: "ACTIONS",
|
|
12259
13047
|
action: "Logged in",
|
|
12260
13048
|
nonInteraction: true
|
|
@@ -12653,12 +13441,14 @@ function ConfirmPassword({
|
|
|
12653
13441
|
}, otherProps));
|
|
12654
13442
|
}
|
|
12655
13443
|
|
|
13444
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
13445
|
+
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;
|
|
12656
13446
|
const Logout = props => {
|
|
12657
13447
|
const handleLogout = () => {
|
|
12658
13448
|
var _ReactGA$event;
|
|
12659
13449
|
|
|
12660
13450
|
window.Pelcro.user.logout();
|
|
12661
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
13451
|
+
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, {
|
|
12662
13452
|
category: "ACTIONS",
|
|
12663
13453
|
action: "Logged out",
|
|
12664
13454
|
nonInteraction: true
|
|
@@ -13606,6 +14396,10 @@ function Modal({
|
|
|
13606
14396
|
children,
|
|
13607
14397
|
...props
|
|
13608
14398
|
}) {
|
|
14399
|
+
React.useEffect(() => {
|
|
14400
|
+
onDisplay === null || onDisplay === void 0 ? void 0 : onDisplay();
|
|
14401
|
+
dispatchModalDisplayEvents(id);
|
|
14402
|
+
}, []);
|
|
13609
14403
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13610
14404
|
className: "pelcro-modal-overlay"
|
|
13611
14405
|
}, /*#__PURE__*/React__default['default'].createElement("div", Object.assign({
|
|
@@ -13637,10 +14431,6 @@ const ModalHeader = ({
|
|
|
13637
14431
|
var _window$Pelcro, _window$Pelcro$site$r;
|
|
13638
14432
|
|
|
13639
14433
|
const resetView = usePelcro(state => state.resetView);
|
|
13640
|
-
React.useEffect(() => {
|
|
13641
|
-
onDisplay === null || onDisplay === void 0 ? void 0 : onDisplay();
|
|
13642
|
-
dispatchModalDisplayEvents(id);
|
|
13643
|
-
}, []);
|
|
13644
14434
|
|
|
13645
14435
|
const onClose = () => {
|
|
13646
14436
|
var _props$onClose;
|
|
@@ -14106,6 +14896,8 @@ const RegisterCompany = props => {
|
|
|
14106
14896
|
}, props));
|
|
14107
14897
|
};
|
|
14108
14898
|
|
|
14899
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
14900
|
+
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;
|
|
14109
14901
|
/**
|
|
14110
14902
|
*
|
|
14111
14903
|
*/
|
|
@@ -14138,7 +14930,7 @@ function RegisterModal(props) {
|
|
|
14138
14930
|
const handleAfterRegistrationLogic = () => {
|
|
14139
14931
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
14140
14932
|
|
|
14141
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
14933
|
+
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, {
|
|
14142
14934
|
category: "ACTIONS",
|
|
14143
14935
|
action: "Registered",
|
|
14144
14936
|
nonInteraction: true
|
|
@@ -19022,6 +19814,8 @@ function SvgArrowLeft(props) {
|
|
|
19022
19814
|
})));
|
|
19023
19815
|
}
|
|
19024
19816
|
|
|
19817
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
19818
|
+
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;
|
|
19025
19819
|
/**
|
|
19026
19820
|
*
|
|
19027
19821
|
*/
|
|
@@ -19131,12 +19925,12 @@ class SelectModal extends React.Component {
|
|
|
19131
19925
|
document.addEventListener("keydown", this.handleSubmit);
|
|
19132
19926
|
|
|
19133
19927
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
19134
|
-
var _window$
|
|
19928
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
19135
19929
|
|
|
19136
|
-
const userCurrency = (_window$
|
|
19137
|
-
const userCountry = (_window$
|
|
19138
|
-
const userLanguage = (_window$
|
|
19139
|
-
const productsMatchingUserCurrency = (_window$
|
|
19930
|
+
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;
|
|
19931
|
+
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;
|
|
19932
|
+
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;
|
|
19933
|
+
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 => {
|
|
19140
19934
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
19141
19935
|
if (filteredPlans.length) return filteredPlans;
|
|
19142
19936
|
});
|
|
@@ -19150,13 +19944,13 @@ class SelectModal extends React.Component {
|
|
|
19150
19944
|
});
|
|
19151
19945
|
notifyBugsnag(() => {
|
|
19152
19946
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
19153
|
-
var _window$
|
|
19947
|
+
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;
|
|
19154
19948
|
|
|
19155
19949
|
event.addMetadata("MetaData", {
|
|
19156
|
-
site: (_window$
|
|
19157
|
-
user: (_window$
|
|
19158
|
-
uiVersion: (_window$
|
|
19159
|
-
environment: (_window$
|
|
19950
|
+
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(),
|
|
19951
|
+
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(),
|
|
19952
|
+
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,
|
|
19953
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
19160
19954
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
19161
19955
|
productListState: this.state.productList,
|
|
19162
19956
|
methods: {
|
|
@@ -19167,8 +19961,8 @@ class SelectModal extends React.Component {
|
|
|
19167
19961
|
userCurrency: userCurrency,
|
|
19168
19962
|
userCountry: userCountry,
|
|
19169
19963
|
userLanguage: userLanguage,
|
|
19170
|
-
siteLanguage: (_window$
|
|
19171
|
-
products: (_window$
|
|
19964
|
+
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(),
|
|
19965
|
+
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,
|
|
19172
19966
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
19173
19967
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
19174
19968
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -19527,7 +20321,7 @@ class SelectModal extends React.Component {
|
|
|
19527
20321
|
if (this.state.mode === "product") {
|
|
19528
20322
|
var _ReactGA$event;
|
|
19529
20323
|
|
|
19530
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20324
|
+
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, {
|
|
19531
20325
|
category: "VIEWS",
|
|
19532
20326
|
action: "Product Modal Viewed",
|
|
19533
20327
|
nonInteraction: true
|
|
@@ -19535,7 +20329,7 @@ class SelectModal extends React.Component {
|
|
|
19535
20329
|
} else if (this.state.mode === "plan") {
|
|
19536
20330
|
var _ReactGA$event2;
|
|
19537
20331
|
|
|
19538
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
20332
|
+
ReactGA$8 === null || ReactGA$8 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$8.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$8, {
|
|
19539
20333
|
category: "VIEWS",
|
|
19540
20334
|
action: "Plan Modal Viewed",
|
|
19541
20335
|
nonInteraction: true
|
|
@@ -24453,6 +25247,8 @@ const SubscriptionRenewView = ({
|
|
|
24453
25247
|
}));
|
|
24454
25248
|
};
|
|
24455
25249
|
|
|
25250
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
25251
|
+
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;
|
|
24456
25252
|
/**
|
|
24457
25253
|
*
|
|
24458
25254
|
*/
|
|
@@ -24473,7 +25269,7 @@ function SubscriptionRenewModal({
|
|
|
24473
25269
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
24474
25270
|
|
|
24475
25271
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
24476
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
25272
|
+
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, {
|
|
24477
25273
|
category: "ACTIONS",
|
|
24478
25274
|
action: "Renewed",
|
|
24479
25275
|
nonInteraction: true
|
|
@@ -24485,7 +25281,7 @@ function SubscriptionRenewModal({
|
|
|
24485
25281
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
24486
25282
|
|
|
24487
25283
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
24488
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
25284
|
+
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, {
|
|
24489
25285
|
category: "ACTIONS",
|
|
24490
25286
|
action: "Renewed Gift",
|
|
24491
25287
|
nonInteraction: true
|
|
@@ -24669,6 +25465,8 @@ function SvgSubscription(props) {
|
|
|
24669
25465
|
}))))));
|
|
24670
25466
|
}
|
|
24671
25467
|
|
|
25468
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
25469
|
+
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;
|
|
24672
25470
|
const SubscriptionCancelNowButton = ({
|
|
24673
25471
|
subscription,
|
|
24674
25472
|
onClick,
|
|
@@ -24702,7 +25500,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
24702
25500
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
24703
25501
|
}
|
|
24704
25502
|
|
|
24705
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
25503
|
+
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, {
|
|
24706
25504
|
category: "ACTIONS",
|
|
24707
25505
|
action: "Canceled",
|
|
24708
25506
|
nonInteraction: true
|
|
@@ -24741,6 +25539,8 @@ const SubscriptionCancelNowButton = ({
|
|
|
24741
25539
|
}, t("messages.cancelNow"));
|
|
24742
25540
|
};
|
|
24743
25541
|
|
|
25542
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
25543
|
+
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;
|
|
24744
25544
|
const SubscriptionCancelLaterButton = ({
|
|
24745
25545
|
subscription,
|
|
24746
25546
|
onClick,
|
|
@@ -24774,7 +25574,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
24774
25574
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
24775
25575
|
}
|
|
24776
25576
|
|
|
24777
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
25577
|
+
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, {
|
|
24778
25578
|
category: "ACTIONS",
|
|
24779
25579
|
action: "Canceled",
|
|
24780
25580
|
nonInteraction: true
|
|
@@ -24989,6 +25789,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
24989
25789
|
}, props));
|
|
24990
25790
|
};
|
|
24991
25791
|
|
|
25792
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
25793
|
+
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;
|
|
24992
25794
|
const SubscriptionSuspendButton = ({
|
|
24993
25795
|
subscription,
|
|
24994
25796
|
onClick,
|
|
@@ -25021,7 +25823,7 @@ const SubscriptionSuspendButton = ({
|
|
|
25021
25823
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
25022
25824
|
}
|
|
25023
25825
|
|
|
25024
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
25826
|
+
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, {
|
|
25025
25827
|
category: "ACTIONS",
|
|
25026
25828
|
action: "Suspended",
|
|
25027
25829
|
nonInteraction: true
|
|
@@ -27878,6 +28680,8 @@ const AddressCreateLine2 = props => {
|
|
|
27878
28680
|
}, props));
|
|
27879
28681
|
};
|
|
27880
28682
|
|
|
28683
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
28684
|
+
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;
|
|
27881
28685
|
const initialState$e = {
|
|
27882
28686
|
isSubmitting: false,
|
|
27883
28687
|
firstName: "",
|
|
@@ -28027,7 +28831,7 @@ const AddressUpdateContainer = ({
|
|
|
28027
28831
|
}
|
|
28028
28832
|
});
|
|
28029
28833
|
onSuccess(res);
|
|
28030
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
28834
|
+
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, {
|
|
28031
28835
|
category: "ACTIONS",
|
|
28032
28836
|
action: "Updated address",
|
|
28033
28837
|
nonInteraction: true
|
|
@@ -28574,6 +29378,8 @@ function PaymentMethodUpdateView(props) {
|
|
|
28574
29378
|
}));
|
|
28575
29379
|
}
|
|
28576
29380
|
|
|
29381
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
29382
|
+
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;
|
|
28577
29383
|
const PaymentMethodUpdateModal = props => {
|
|
28578
29384
|
const {
|
|
28579
29385
|
t
|
|
@@ -28583,7 +29389,7 @@ const PaymentMethodUpdateModal = props => {
|
|
|
28583
29389
|
var _props$onSuccess, _ReactGA$event;
|
|
28584
29390
|
|
|
28585
29391
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
28586
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
29392
|
+
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, {
|
|
28587
29393
|
category: "ACTIONS",
|
|
28588
29394
|
action: "Updated payment card",
|
|
28589
29395
|
nonInteraction: true
|
|
@@ -31340,7 +32146,8 @@ const PaymentMethodSelectModal = ({
|
|
|
31340
32146
|
};
|
|
31341
32147
|
PaymentMethodSelectModal.viewId = "payment-method-select";
|
|
31342
32148
|
|
|
31343
|
-
var _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
32149
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1, _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
32150
|
+
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;
|
|
31344
32151
|
const initialState$4 = {
|
|
31345
32152
|
isOpen: false,
|
|
31346
32153
|
activeDashboardLink: null,
|
|
@@ -31374,7 +32181,7 @@ const DashboardContainer = ({
|
|
|
31374
32181
|
window.Pelcro.insight.track("Modal Displayed", {
|
|
31375
32182
|
name: "dashboard"
|
|
31376
32183
|
});
|
|
31377
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
32184
|
+
ReactGA$1 === null || ReactGA$1 === void 0 ? void 0 : (_ReactGA$event = ReactGA$1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$1, {
|
|
31378
32185
|
category: "VIEWS",
|
|
31379
32186
|
action: "Dashboard Modal Viewed",
|
|
31380
32187
|
nonInteraction: true
|
|
@@ -31389,9 +32196,9 @@ const DashboardContainer = ({
|
|
|
31389
32196
|
return () => {};
|
|
31390
32197
|
}, []);
|
|
31391
32198
|
/**
|
|
31392
|
-
*
|
|
31393
|
-
* @param {*} payload
|
|
31394
|
-
* @param {*} dispatch
|
|
32199
|
+
*
|
|
32200
|
+
* @param {*} payload
|
|
32201
|
+
* @param {*} dispatch
|
|
31395
32202
|
*/
|
|
31396
32203
|
|
|
31397
32204
|
const cancelSubscription = ({
|
|
@@ -31414,7 +32221,7 @@ const DashboardContainer = ({
|
|
|
31414
32221
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
31415
32222
|
}
|
|
31416
32223
|
|
|
31417
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
32224
|
+
ReactGA$1 === null || ReactGA$1 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$1.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$1, {
|
|
31418
32225
|
category: "ACTIONS",
|
|
31419
32226
|
action: "Canceled",
|
|
31420
32227
|
nonInteraction: true
|
|
@@ -31423,9 +32230,9 @@ const DashboardContainer = ({
|
|
|
31423
32230
|
});
|
|
31424
32231
|
};
|
|
31425
32232
|
/**
|
|
31426
|
-
*
|
|
31427
|
-
* @param {*} payload
|
|
31428
|
-
* @param {*} dispatch
|
|
32233
|
+
*
|
|
32234
|
+
* @param {*} payload
|
|
32235
|
+
* @param {*} dispatch
|
|
31429
32236
|
*/
|
|
31430
32237
|
|
|
31431
32238
|
|
|
@@ -31450,7 +32257,7 @@ const DashboardContainer = ({
|
|
|
31450
32257
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
31451
32258
|
}
|
|
31452
32259
|
|
|
31453
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event3 = ReactGA.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA, {
|
|
32260
|
+
ReactGA$1 === null || ReactGA$1 === void 0 ? void 0 : (_ReactGA$event3 = ReactGA$1.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA$1, {
|
|
31454
32261
|
category: "ACTIONS",
|
|
31455
32262
|
action: "UnSuspended",
|
|
31456
32263
|
nonInteraction: true
|
|
@@ -31459,9 +32266,9 @@ const DashboardContainer = ({
|
|
|
31459
32266
|
});
|
|
31460
32267
|
};
|
|
31461
32268
|
/**
|
|
31462
|
-
*
|
|
31463
|
-
* @param {*} payload
|
|
31464
|
-
* @param {*} dispatch
|
|
32269
|
+
*
|
|
32270
|
+
* @param {*} payload
|
|
32271
|
+
* @param {*} dispatch
|
|
31465
32272
|
*/
|
|
31466
32273
|
|
|
31467
32274
|
|
|
@@ -32704,6 +33511,8 @@ const Card = ({
|
|
|
32704
33511
|
})), children);
|
|
32705
33512
|
};
|
|
32706
33513
|
|
|
33514
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
33515
|
+
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;
|
|
32707
33516
|
const SavedItemsMenu = () => {
|
|
32708
33517
|
const {
|
|
32709
33518
|
t
|