@pelcro/react-pelcro-js 3.23.0 → 3.24.0
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 +649 -81
- package/dist/index.esm.js +649 -81
- package/package.json +2 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7278,6 +7278,51 @@ function _defineProperty$3(obj, key, value) {
|
|
|
7278
7278
|
return obj;
|
|
7279
7279
|
}
|
|
7280
7280
|
|
|
7281
|
+
// Polyfill
|
|
7282
|
+
(() => {
|
|
7283
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
7284
|
+
function CustomEvent(event) {
|
|
7285
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
7286
|
+
bubbles: false,
|
|
7287
|
+
cancelable: false,
|
|
7288
|
+
detail: undefined
|
|
7289
|
+
};
|
|
7290
|
+
const evt = document.createEvent("CustomEvent");
|
|
7291
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
7292
|
+
return evt;
|
|
7293
|
+
}
|
|
7294
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
7295
|
+
window.CustomEvent = CustomEvent;
|
|
7296
|
+
})();
|
|
7297
|
+
|
|
7298
|
+
/**
|
|
7299
|
+
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
7300
|
+
*/
|
|
7301
|
+
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
7302
|
+
|
|
7303
|
+
/**
|
|
7304
|
+
* Should fire when an item added to the cart and expects the added item to be sent
|
|
7305
|
+
*/
|
|
7306
|
+
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
7307
|
+
|
|
7308
|
+
/**
|
|
7309
|
+
* Should fire when an item removed from the cart and expects the removed item to be sent
|
|
7310
|
+
*/
|
|
7311
|
+
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
7312
|
+
|
|
7313
|
+
/**
|
|
7314
|
+
* Check if the browser support custom events
|
|
7315
|
+
*/
|
|
7316
|
+
function createCustomEvent(name, detail) {
|
|
7317
|
+
try {
|
|
7318
|
+
return new CustomEvent(name, {
|
|
7319
|
+
detail
|
|
7320
|
+
});
|
|
7321
|
+
} catch (e) {
|
|
7322
|
+
console.warn("Pelcro - Events are not supported in the browser");
|
|
7323
|
+
}
|
|
7324
|
+
}
|
|
7325
|
+
|
|
7281
7326
|
function warn(s) {
|
|
7282
7327
|
console.warn('[react-ga]', s);
|
|
7283
7328
|
}
|
|
@@ -8129,55 +8174,547 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8129
8174
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
8130
8175
|
OutboundLink$1.trackLink = outboundLink;
|
|
8131
8176
|
var OutboundLink = OutboundLink$1;
|
|
8132
|
-
var
|
|
8177
|
+
var ReactGA1 = _objectSpread({}, Defaults, {
|
|
8133
8178
|
OutboundLink: OutboundLink
|
|
8134
8179
|
});
|
|
8135
8180
|
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
const evt = document.createEvent("CustomEvent");
|
|
8146
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
8147
|
-
return evt;
|
|
8181
|
+
var gtag_1 = createCommonjsModule(function (module, exports) {
|
|
8182
|
+
|
|
8183
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8184
|
+
value: true
|
|
8185
|
+
});
|
|
8186
|
+
exports["default"] = void 0;
|
|
8187
|
+
var gtag = function gtag() {
|
|
8188
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8189
|
+
args[_key] = arguments[_key];
|
|
8148
8190
|
}
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8191
|
+
if (typeof window !== "undefined") {
|
|
8192
|
+
var _window;
|
|
8193
|
+
if (typeof window.gtag === "undefined") {
|
|
8194
|
+
window.dataLayer = window.dataLayer || [];
|
|
8195
|
+
window.gtag = function gtag() {
|
|
8196
|
+
window.dataLayer.push(arguments);
|
|
8197
|
+
};
|
|
8198
|
+
}
|
|
8199
|
+
(_window = window).gtag.apply(_window, args);
|
|
8200
|
+
}
|
|
8201
|
+
};
|
|
8202
|
+
var _default = gtag;
|
|
8203
|
+
exports["default"] = _default;
|
|
8204
|
+
});
|
|
8152
8205
|
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8206
|
+
unwrapExports(gtag_1);
|
|
8207
|
+
|
|
8208
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
8209
|
+
|
|
8210
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8211
|
+
value: true
|
|
8212
|
+
});
|
|
8213
|
+
exports["default"] = format;
|
|
8214
|
+
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
8215
|
+
function toTitleCase(string) {
|
|
8216
|
+
return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
|
|
8217
|
+
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) {
|
|
8218
|
+
return match.toLowerCase();
|
|
8219
|
+
}
|
|
8220
|
+
if (match.substr(1).search(/[A-Z]|\../) > -1) {
|
|
8221
|
+
return match;
|
|
8222
|
+
}
|
|
8223
|
+
return match.charAt(0).toUpperCase() + match.substr(1);
|
|
8224
|
+
});
|
|
8225
|
+
}
|
|
8157
8226
|
|
|
8227
|
+
// See if s could be an email address. We don't want to send personal data like email.
|
|
8228
|
+
// https://support.google.com/analytics/answer/2795983?hl=en
|
|
8229
|
+
function mightBeEmail(s) {
|
|
8230
|
+
// There's no point trying to validate rfc822 fully, just look for ...@...
|
|
8231
|
+
return typeof s === "string" && s.indexOf("@") !== -1;
|
|
8232
|
+
}
|
|
8233
|
+
var redacted = "REDACTED (Potential Email Address)";
|
|
8234
|
+
function redactEmail(string) {
|
|
8235
|
+
if (mightBeEmail(string)) {
|
|
8236
|
+
console.warn("This arg looks like an email address, redacting.");
|
|
8237
|
+
return redacted;
|
|
8238
|
+
}
|
|
8239
|
+
return string;
|
|
8240
|
+
}
|
|
8241
|
+
function format() {
|
|
8242
|
+
var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8243
|
+
var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8244
|
+
var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
8245
|
+
var _str = s || "";
|
|
8246
|
+
if (titleCase) {
|
|
8247
|
+
_str = toTitleCase(s);
|
|
8248
|
+
}
|
|
8249
|
+
if (redactingEmail) {
|
|
8250
|
+
_str = redactEmail(_str);
|
|
8251
|
+
}
|
|
8252
|
+
return _str;
|
|
8253
|
+
}
|
|
8254
|
+
});
|
|
8255
|
+
|
|
8256
|
+
unwrapExports(format_1);
|
|
8257
|
+
|
|
8258
|
+
var ga4 = createCommonjsModule(function (module, exports) {
|
|
8259
|
+
|
|
8260
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8261
|
+
value: true
|
|
8262
|
+
});
|
|
8263
|
+
exports["default"] = exports.GA4 = void 0;
|
|
8264
|
+
var _gtag = _interopRequireDefault(gtag_1);
|
|
8265
|
+
var _format = _interopRequireDefault(format_1);
|
|
8266
|
+
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
|
|
8267
|
+
_excluded2 = ["title", "location"],
|
|
8268
|
+
_excluded3 = ["page", "hitType"];
|
|
8269
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8270
|
+
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; }
|
|
8271
|
+
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; }
|
|
8272
|
+
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); }
|
|
8273
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8274
|
+
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."); }
|
|
8275
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8276
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8277
|
+
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; }
|
|
8278
|
+
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; }
|
|
8279
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8280
|
+
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."); }
|
|
8281
|
+
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); }
|
|
8282
|
+
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; }
|
|
8283
|
+
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; } }
|
|
8284
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8285
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8286
|
+
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); } }
|
|
8287
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8288
|
+
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; }
|
|
8289
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8290
|
+
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); }
|
|
8291
|
+
/*
|
|
8292
|
+
Links
|
|
8293
|
+
https://developers.google.com/gtagjs/reference/api
|
|
8294
|
+
https://developers.google.com/tag-platform/gtagjs/reference
|
|
8295
|
+
*/
|
|
8158
8296
|
/**
|
|
8159
|
-
*
|
|
8297
|
+
* @typedef GaOptions
|
|
8298
|
+
* @type {Object}
|
|
8299
|
+
* @property {boolean} [cookieUpdate=true]
|
|
8300
|
+
* @property {number} [cookieExpires=63072000] Default two years
|
|
8301
|
+
* @property {string} [cookieDomain="auto"]
|
|
8302
|
+
* @property {string} [cookieFlags]
|
|
8303
|
+
* @property {string} [userId]
|
|
8304
|
+
* @property {string} [clientId]
|
|
8305
|
+
* @property {boolean} [anonymizeIp]
|
|
8306
|
+
* @property {string} [contentGroup1]
|
|
8307
|
+
* @property {string} [contentGroup2]
|
|
8308
|
+
* @property {string} [contentGroup3]
|
|
8309
|
+
* @property {string} [contentGroup4]
|
|
8310
|
+
* @property {string} [contentGroup5]
|
|
8311
|
+
* @property {boolean} [allowAdFeatures=true]
|
|
8312
|
+
* @property {boolean} [allowAdPersonalizationSignals]
|
|
8313
|
+
* @property {boolean} [nonInteraction]
|
|
8314
|
+
* @property {string} [page]
|
|
8160
8315
|
*/
|
|
8161
|
-
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
8162
|
-
|
|
8163
8316
|
/**
|
|
8164
|
-
*
|
|
8317
|
+
* @typedef UaEventOptions
|
|
8318
|
+
* @type {Object}
|
|
8319
|
+
* @property {string} action
|
|
8320
|
+
* @property {string} category
|
|
8321
|
+
* @property {string} [label]
|
|
8322
|
+
* @property {number} [value]
|
|
8323
|
+
* @property {boolean} [nonInteraction]
|
|
8324
|
+
* @property {('beacon'|'xhr'|'image')} [transport]
|
|
8165
8325
|
*/
|
|
8166
|
-
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
8167
|
-
|
|
8168
8326
|
/**
|
|
8169
|
-
*
|
|
8327
|
+
* @typedef InitOptions
|
|
8328
|
+
* @type {Object}
|
|
8329
|
+
* @property {string} trackingId
|
|
8330
|
+
* @property {GaOptions|any} [gaOptions]
|
|
8331
|
+
* @property {Object} [gtagOptions] New parameter
|
|
8170
8332
|
*/
|
|
8171
|
-
function
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8333
|
+
var GA4 = /*#__PURE__*/function () {
|
|
8334
|
+
function GA4() {
|
|
8335
|
+
var _this = this;
|
|
8336
|
+
_classCallCheck(this, GA4);
|
|
8337
|
+
_defineProperty(this, "reset", function () {
|
|
8338
|
+
_this.isInitialized = false;
|
|
8339
|
+
_this._testMode = false;
|
|
8340
|
+
_this._currentMeasurementId;
|
|
8341
|
+
_this._hasLoadedGA = false;
|
|
8342
|
+
_this._isQueuing = false;
|
|
8343
|
+
_this._queueGtag = [];
|
|
8344
|
+
});
|
|
8345
|
+
_defineProperty(this, "_gtag", function () {
|
|
8346
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8347
|
+
args[_key] = arguments[_key];
|
|
8348
|
+
}
|
|
8349
|
+
if (!_this._testMode) {
|
|
8350
|
+
if (_this._isQueuing) {
|
|
8351
|
+
_this._queueGtag.push(args);
|
|
8352
|
+
} else {
|
|
8353
|
+
_gtag["default"].apply(void 0, args);
|
|
8354
|
+
}
|
|
8355
|
+
} else {
|
|
8356
|
+
_this._queueGtag.push(args);
|
|
8357
|
+
}
|
|
8175
8358
|
});
|
|
8176
|
-
|
|
8177
|
-
|
|
8359
|
+
_defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
|
|
8360
|
+
var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "https://www.googletagmanager.com/gtag/js";
|
|
8361
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
8362
|
+
return;
|
|
8363
|
+
}
|
|
8364
|
+
if (!_this._hasLoadedGA) {
|
|
8365
|
+
// Global Site Tag (gtag.js) - Google Analytics
|
|
8366
|
+
var script = document.createElement("script");
|
|
8367
|
+
script.async = true;
|
|
8368
|
+
script.src = "".concat(gtagUrl, "?id=").concat(GA_MEASUREMENT_ID);
|
|
8369
|
+
if (nonce) {
|
|
8370
|
+
script.setAttribute("nonce", nonce);
|
|
8371
|
+
}
|
|
8372
|
+
document.body.appendChild(script);
|
|
8373
|
+
window.dataLayer = window.dataLayer || [];
|
|
8374
|
+
window.gtag = function gtag() {
|
|
8375
|
+
window.dataLayer.push(arguments);
|
|
8376
|
+
};
|
|
8377
|
+
_this._hasLoadedGA = true;
|
|
8378
|
+
}
|
|
8379
|
+
});
|
|
8380
|
+
_defineProperty(this, "_toGtagOptions", function (gaOptions) {
|
|
8381
|
+
if (!gaOptions) {
|
|
8382
|
+
return;
|
|
8383
|
+
}
|
|
8384
|
+
var mapFields = {
|
|
8385
|
+
// Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
|
|
8386
|
+
// New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
|
|
8387
|
+
cookieUpdate: "cookie_update",
|
|
8388
|
+
cookieExpires: "cookie_expires",
|
|
8389
|
+
cookieDomain: "cookie_domain",
|
|
8390
|
+
cookieFlags: "cookie_flags",
|
|
8391
|
+
// must be in set method?
|
|
8392
|
+
userId: "user_id",
|
|
8393
|
+
clientId: "client_id",
|
|
8394
|
+
anonymizeIp: "anonymize_ip",
|
|
8395
|
+
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
8396
|
+
contentGroup1: "content_group1",
|
|
8397
|
+
contentGroup2: "content_group2",
|
|
8398
|
+
contentGroup3: "content_group3",
|
|
8399
|
+
contentGroup4: "content_group4",
|
|
8400
|
+
contentGroup5: "content_group5",
|
|
8401
|
+
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
8402
|
+
allowAdFeatures: "allow_google_signals",
|
|
8403
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
8404
|
+
nonInteraction: "non_interaction",
|
|
8405
|
+
page: "page_path",
|
|
8406
|
+
hitCallback: "event_callback"
|
|
8407
|
+
};
|
|
8408
|
+
var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
|
|
8409
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
8410
|
+
key = _ref2[0],
|
|
8411
|
+
value = _ref2[1];
|
|
8412
|
+
if (mapFields[key]) {
|
|
8413
|
+
prev[mapFields[key]] = value;
|
|
8414
|
+
} else {
|
|
8415
|
+
prev[key] = value;
|
|
8416
|
+
}
|
|
8417
|
+
return prev;
|
|
8418
|
+
}, {});
|
|
8419
|
+
return gtagOptions;
|
|
8420
|
+
});
|
|
8421
|
+
_defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
|
|
8422
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8423
|
+
if (!GA_MEASUREMENT_ID) {
|
|
8424
|
+
throw new Error("Require GA_MEASUREMENT_ID");
|
|
8425
|
+
}
|
|
8426
|
+
var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
|
|
8427
|
+
trackingId: GA_MEASUREMENT_ID
|
|
8428
|
+
}] : GA_MEASUREMENT_ID;
|
|
8429
|
+
_this._currentMeasurementId = initConfigs[0].trackingId;
|
|
8430
|
+
var gaOptions = options.gaOptions,
|
|
8431
|
+
gtagOptions = options.gtagOptions,
|
|
8432
|
+
nonce = options.nonce,
|
|
8433
|
+
_options$testMode = options.testMode,
|
|
8434
|
+
testMode = _options$testMode === void 0 ? false : _options$testMode,
|
|
8435
|
+
gtagUrl = options.gtagUrl;
|
|
8436
|
+
_this._testMode = testMode;
|
|
8437
|
+
if (!testMode) {
|
|
8438
|
+
_this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);
|
|
8439
|
+
}
|
|
8440
|
+
if (!_this.isInitialized) {
|
|
8441
|
+
_this._gtag("js", new Date());
|
|
8442
|
+
initConfigs.forEach(function (config) {
|
|
8443
|
+
var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);
|
|
8444
|
+
if (Object.keys(mergedGtagOptions).length) {
|
|
8445
|
+
_this._gtag("config", config.trackingId, mergedGtagOptions);
|
|
8446
|
+
} else {
|
|
8447
|
+
_this._gtag("config", config.trackingId);
|
|
8448
|
+
}
|
|
8449
|
+
});
|
|
8450
|
+
}
|
|
8451
|
+
_this.isInitialized = true;
|
|
8452
|
+
if (!testMode) {
|
|
8453
|
+
var queues = _toConsumableArray(_this._queueGtag);
|
|
8454
|
+
_this._queueGtag = [];
|
|
8455
|
+
_this._isQueuing = false;
|
|
8456
|
+
while (queues.length) {
|
|
8457
|
+
var queue = queues.shift();
|
|
8458
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8459
|
+
if (queue[0] === "get") {
|
|
8460
|
+
_this._isQueuing = true;
|
|
8461
|
+
}
|
|
8462
|
+
}
|
|
8463
|
+
}
|
|
8464
|
+
});
|
|
8465
|
+
_defineProperty(this, "set", function (fieldsObject) {
|
|
8466
|
+
if (!fieldsObject) {
|
|
8467
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
8468
|
+
return;
|
|
8469
|
+
}
|
|
8470
|
+
if (_typeof(fieldsObject) !== "object") {
|
|
8471
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
8472
|
+
return;
|
|
8473
|
+
}
|
|
8474
|
+
if (Object.keys(fieldsObject).length === 0) {
|
|
8475
|
+
console.warn("empty `fieldsObject` given to .set()");
|
|
8476
|
+
}
|
|
8477
|
+
_this._gaCommand("set", fieldsObject);
|
|
8478
|
+
});
|
|
8479
|
+
_defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
|
|
8480
|
+
_this._gtag("event", eventAction, _objectSpread(_objectSpread({
|
|
8481
|
+
event_category: eventCategory,
|
|
8482
|
+
event_label: eventLabel,
|
|
8483
|
+
value: eventValue
|
|
8484
|
+
}, fieldsObject && {
|
|
8485
|
+
non_interaction: fieldsObject.nonInteraction
|
|
8486
|
+
}), _this._toGtagOptions(fieldsObject)));
|
|
8487
|
+
});
|
|
8488
|
+
_defineProperty(this, "_gaCommandSendEventParameters", function () {
|
|
8489
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8490
|
+
args[_key2] = arguments[_key2];
|
|
8491
|
+
}
|
|
8492
|
+
if (typeof args[0] === "string") {
|
|
8493
|
+
_this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8494
|
+
} else {
|
|
8495
|
+
var _args$ = args[0],
|
|
8496
|
+
eventCategory = _args$.eventCategory,
|
|
8497
|
+
eventAction = _args$.eventAction,
|
|
8498
|
+
eventLabel = _args$.eventLabel,
|
|
8499
|
+
eventValue = _args$.eventValue;
|
|
8500
|
+
_args$.hitType;
|
|
8501
|
+
var rest = _objectWithoutProperties(_args$, _excluded);
|
|
8502
|
+
_this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
|
|
8503
|
+
}
|
|
8504
|
+
});
|
|
8505
|
+
_defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
|
|
8506
|
+
_this._gtag("event", "timing_complete", {
|
|
8507
|
+
name: timingVar,
|
|
8508
|
+
value: timingValue,
|
|
8509
|
+
event_category: timingCategory,
|
|
8510
|
+
event_label: timingLabel
|
|
8511
|
+
});
|
|
8512
|
+
});
|
|
8513
|
+
_defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
|
|
8514
|
+
if (fieldsObject && Object.keys(fieldsObject).length) {
|
|
8515
|
+
var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
|
|
8516
|
+
title = _this$_toGtagOptions.title,
|
|
8517
|
+
location = _this$_toGtagOptions.location,
|
|
8518
|
+
rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
|
|
8519
|
+
_this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
|
|
8520
|
+
page_path: page
|
|
8521
|
+
}), title && {
|
|
8522
|
+
page_title: title
|
|
8523
|
+
}), location && {
|
|
8524
|
+
page_location: location
|
|
8525
|
+
}), rest));
|
|
8526
|
+
} else if (page) {
|
|
8527
|
+
_this._gtag("event", "page_view", {
|
|
8528
|
+
page_path: page
|
|
8529
|
+
});
|
|
8530
|
+
} else {
|
|
8531
|
+
_this._gtag("event", "page_view");
|
|
8532
|
+
}
|
|
8533
|
+
});
|
|
8534
|
+
_defineProperty(this, "_gaCommandSendPageviewParameters", function () {
|
|
8535
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8536
|
+
args[_key3] = arguments[_key3];
|
|
8537
|
+
}
|
|
8538
|
+
if (typeof args[0] === "string") {
|
|
8539
|
+
_this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8540
|
+
} else {
|
|
8541
|
+
var _args$2 = args[0],
|
|
8542
|
+
page = _args$2.page;
|
|
8543
|
+
_args$2.hitType;
|
|
8544
|
+
var rest = _objectWithoutProperties(_args$2, _excluded3);
|
|
8545
|
+
_this._gaCommandSendPageview(page, rest);
|
|
8546
|
+
}
|
|
8547
|
+
});
|
|
8548
|
+
_defineProperty(this, "_gaCommandSend", function () {
|
|
8549
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
8550
|
+
args[_key4] = arguments[_key4];
|
|
8551
|
+
}
|
|
8552
|
+
var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
|
|
8553
|
+
switch (hitType) {
|
|
8554
|
+
case "event":
|
|
8555
|
+
_this._gaCommandSendEventParameters.apply(_this, args);
|
|
8556
|
+
break;
|
|
8557
|
+
case "pageview":
|
|
8558
|
+
_this._gaCommandSendPageviewParameters.apply(_this, args);
|
|
8559
|
+
break;
|
|
8560
|
+
case "timing":
|
|
8561
|
+
_this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8562
|
+
break;
|
|
8563
|
+
case "screenview":
|
|
8564
|
+
case "transaction":
|
|
8565
|
+
case "item":
|
|
8566
|
+
case "social":
|
|
8567
|
+
case "exception":
|
|
8568
|
+
console.warn("Unsupported send command: ".concat(hitType));
|
|
8569
|
+
break;
|
|
8570
|
+
default:
|
|
8571
|
+
console.warn("Send command doesn't exist: ".concat(hitType));
|
|
8572
|
+
}
|
|
8573
|
+
});
|
|
8574
|
+
_defineProperty(this, "_gaCommandSet", function () {
|
|
8575
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8576
|
+
args[_key5] = arguments[_key5];
|
|
8577
|
+
}
|
|
8578
|
+
if (typeof args[0] === "string") {
|
|
8579
|
+
args[0] = _defineProperty({}, args[0], args[1]);
|
|
8580
|
+
}
|
|
8581
|
+
_this._gtag("set", _this._toGtagOptions(args[0]));
|
|
8582
|
+
});
|
|
8583
|
+
_defineProperty(this, "_gaCommand", function (command) {
|
|
8584
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
8585
|
+
args[_key6 - 1] = arguments[_key6];
|
|
8586
|
+
}
|
|
8587
|
+
switch (command) {
|
|
8588
|
+
case "send":
|
|
8589
|
+
_this._gaCommandSend.apply(_this, args);
|
|
8590
|
+
break;
|
|
8591
|
+
case "set":
|
|
8592
|
+
_this._gaCommandSet.apply(_this, args);
|
|
8593
|
+
break;
|
|
8594
|
+
default:
|
|
8595
|
+
console.warn("Command doesn't exist: ".concat(command));
|
|
8596
|
+
}
|
|
8597
|
+
});
|
|
8598
|
+
_defineProperty(this, "ga", function () {
|
|
8599
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8600
|
+
args[_key7] = arguments[_key7];
|
|
8601
|
+
}
|
|
8602
|
+
if (typeof args[0] === "string") {
|
|
8603
|
+
_this._gaCommand.apply(_this, args);
|
|
8604
|
+
} else {
|
|
8605
|
+
var readyCallback = args[0];
|
|
8606
|
+
_this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
|
|
8607
|
+
_this._isQueuing = false;
|
|
8608
|
+
var queues = _this._queueGtag;
|
|
8609
|
+
readyCallback({
|
|
8610
|
+
get: function get(property) {
|
|
8611
|
+
return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
|
|
8612
|
+
}
|
|
8613
|
+
});
|
|
8614
|
+
while (queues.length) {
|
|
8615
|
+
var queue = queues.shift();
|
|
8616
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8617
|
+
}
|
|
8618
|
+
});
|
|
8619
|
+
_this._isQueuing = true;
|
|
8620
|
+
}
|
|
8621
|
+
return _this.ga;
|
|
8622
|
+
});
|
|
8623
|
+
_defineProperty(this, "event", function (optionsOrName, params) {
|
|
8624
|
+
if (typeof optionsOrName === "string") {
|
|
8625
|
+
_this._gtag("event", optionsOrName, _this._toGtagOptions(params));
|
|
8626
|
+
} else {
|
|
8627
|
+
var action = optionsOrName.action,
|
|
8628
|
+
category = optionsOrName.category,
|
|
8629
|
+
label = optionsOrName.label,
|
|
8630
|
+
value = optionsOrName.value,
|
|
8631
|
+
nonInteraction = optionsOrName.nonInteraction,
|
|
8632
|
+
transport = optionsOrName.transport;
|
|
8633
|
+
if (!category || !action) {
|
|
8634
|
+
console.warn("args.category AND args.action are required in event()");
|
|
8635
|
+
return;
|
|
8636
|
+
}
|
|
8637
|
+
|
|
8638
|
+
// Required Fields
|
|
8639
|
+
var fieldObject = {
|
|
8640
|
+
hitType: "event",
|
|
8641
|
+
eventCategory: (0, _format["default"])(category),
|
|
8642
|
+
eventAction: (0, _format["default"])(action)
|
|
8643
|
+
};
|
|
8644
|
+
|
|
8645
|
+
// Optional Fields
|
|
8646
|
+
if (label) {
|
|
8647
|
+
fieldObject.eventLabel = (0, _format["default"])(label);
|
|
8648
|
+
}
|
|
8649
|
+
if (typeof value !== "undefined") {
|
|
8650
|
+
if (typeof value !== "number") {
|
|
8651
|
+
console.warn("Expected `args.value` arg to be a Number.");
|
|
8652
|
+
} else {
|
|
8653
|
+
fieldObject.eventValue = value;
|
|
8654
|
+
}
|
|
8655
|
+
}
|
|
8656
|
+
if (typeof nonInteraction !== "undefined") {
|
|
8657
|
+
if (typeof nonInteraction !== "boolean") {
|
|
8658
|
+
console.warn("`args.nonInteraction` must be a boolean.");
|
|
8659
|
+
} else {
|
|
8660
|
+
fieldObject.nonInteraction = nonInteraction;
|
|
8661
|
+
}
|
|
8662
|
+
}
|
|
8663
|
+
if (typeof transport !== "undefined") {
|
|
8664
|
+
if (typeof transport !== "string") {
|
|
8665
|
+
console.warn("`args.transport` must be a string.");
|
|
8666
|
+
} else {
|
|
8667
|
+
if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
|
|
8668
|
+
console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
|
|
8669
|
+
}
|
|
8670
|
+
fieldObject.transport = transport;
|
|
8671
|
+
}
|
|
8672
|
+
}
|
|
8673
|
+
_this._gaCommand("send", fieldObject);
|
|
8674
|
+
}
|
|
8675
|
+
});
|
|
8676
|
+
_defineProperty(this, "send", function (fieldObject) {
|
|
8677
|
+
_this._gaCommand("send", fieldObject);
|
|
8678
|
+
});
|
|
8679
|
+
this.reset();
|
|
8178
8680
|
}
|
|
8179
|
-
|
|
8681
|
+
_createClass(GA4, [{
|
|
8682
|
+
key: "gtag",
|
|
8683
|
+
value: function gtag() {
|
|
8684
|
+
this._gtag.apply(this, arguments);
|
|
8685
|
+
}
|
|
8686
|
+
}]);
|
|
8687
|
+
return GA4;
|
|
8688
|
+
}();
|
|
8689
|
+
exports.GA4 = GA4;
|
|
8690
|
+
var _default = new GA4();
|
|
8691
|
+
exports["default"] = _default;
|
|
8692
|
+
});
|
|
8693
|
+
|
|
8694
|
+
unwrapExports(ga4);
|
|
8695
|
+
ga4.GA4;
|
|
8696
|
+
|
|
8697
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
8698
|
+
|
|
8699
|
+
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); }
|
|
8700
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8701
|
+
value: true
|
|
8702
|
+
});
|
|
8703
|
+
exports["default"] = exports.ReactGAImplementation = void 0;
|
|
8704
|
+
var _ga = _interopRequireWildcard(ga4);
|
|
8705
|
+
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); }
|
|
8706
|
+
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; }
|
|
8707
|
+
var ReactGAImplementation = _ga.GA4;
|
|
8708
|
+
exports.ReactGAImplementation = ReactGAImplementation;
|
|
8709
|
+
var _default = _ga["default"];
|
|
8710
|
+
exports["default"] = _default;
|
|
8711
|
+
});
|
|
8180
8712
|
|
|
8713
|
+
var ReactGA4 = unwrapExports(dist);
|
|
8714
|
+
dist.ReactGAImplementation;
|
|
8715
|
+
|
|
8716
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
8717
|
+
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;
|
|
8181
8718
|
class PelcroActions {
|
|
8182
8719
|
constructor(storeSetter, storeGetter) {
|
|
8183
8720
|
var _this = this;
|
|
@@ -8369,7 +8906,7 @@ class PelcroActions {
|
|
|
8369
8906
|
return console.warn("You are already logged out.");
|
|
8370
8907
|
}
|
|
8371
8908
|
window.Pelcro.user.logout();
|
|
8372
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
8909
|
+
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, {
|
|
8373
8910
|
category: "ACTIONS",
|
|
8374
8911
|
action: "Logged out",
|
|
8375
8912
|
nonInteraction: true
|
|
@@ -8595,6 +9132,9 @@ if (process.env.NODE_ENV === "development") {
|
|
|
8595
9132
|
c$1("Pelcro Store", usePelcro);
|
|
8596
9133
|
}
|
|
8597
9134
|
|
|
9135
|
+
var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
|
|
9136
|
+
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;
|
|
9137
|
+
|
|
8598
9138
|
/**
|
|
8599
9139
|
* List of zero-decimal currencies.
|
|
8600
9140
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8677,8 +9217,8 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8677
9217
|
* @return {string | undefined}
|
|
8678
9218
|
*/
|
|
8679
9219
|
const getPageOrDefaultLanguage = () => {
|
|
8680
|
-
var _window$Pelcro$helper, _window$
|
|
8681
|
-
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$
|
|
9220
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
9221
|
+
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);
|
|
8682
9222
|
};
|
|
8683
9223
|
|
|
8684
9224
|
/**
|
|
@@ -8731,9 +9271,9 @@ const isValidViewFromURL = viewID => {
|
|
|
8731
9271
|
*
|
|
8732
9272
|
*/
|
|
8733
9273
|
function hasValidNewsletterUpdateUrl() {
|
|
8734
|
-
var _window$
|
|
9274
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8735
9275
|
if (viewID !== "newsletter-update") return false;
|
|
8736
|
-
const newsletters = (_window$
|
|
9276
|
+
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;
|
|
8737
9277
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8738
9278
|
if (!siteHasNewslettersDefined) {
|
|
8739
9279
|
return false;
|
|
@@ -8798,16 +9338,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
8798
9338
|
return;
|
|
8799
9339
|
}
|
|
8800
9340
|
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;
|
|
8801
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$set = ReactGA.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA, {
|
|
9341
|
+
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, {
|
|
8802
9342
|
currencyCode: currencyCode
|
|
8803
9343
|
});
|
|
8804
|
-
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", {
|
|
9344
|
+
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", {
|
|
8805
9345
|
id: lastSubscriptionId,
|
|
8806
9346
|
affiliation: "Pelcro",
|
|
8807
9347
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
8808
9348
|
coupon: couponCode
|
|
8809
9349
|
});
|
|
8810
|
-
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", {
|
|
9350
|
+
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", {
|
|
8811
9351
|
id: lastSubscriptionId,
|
|
8812
9352
|
name: product.name,
|
|
8813
9353
|
category: product.description,
|
|
@@ -8815,8 +9355,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
8815
9355
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
8816
9356
|
quantity: 1
|
|
8817
9357
|
});
|
|
8818
|
-
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");
|
|
8819
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
9358
|
+
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");
|
|
9359
|
+
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, {
|
|
8820
9360
|
category: "ACTIONS",
|
|
8821
9361
|
action: "Subscribed",
|
|
8822
9362
|
nonInteraction: true
|
|
@@ -8904,8 +9444,8 @@ function getDateWithoutTime(dateObject) {
|
|
|
8904
9444
|
return date;
|
|
8905
9445
|
}
|
|
8906
9446
|
function userMustVerifyEmail() {
|
|
8907
|
-
var _window$Pelcro$site$
|
|
8908
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9447
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9448
|
+
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;
|
|
8909
9449
|
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;
|
|
8910
9450
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
8911
9451
|
}
|
|
@@ -8914,11 +9454,11 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
8914
9454
|
//load bugsnag CDN
|
|
8915
9455
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
8916
9456
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
8917
|
-
var _window$Pelcro$enviro, _window$
|
|
9457
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
8918
9458
|
Bugsnag.start({
|
|
8919
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9459
|
+
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",
|
|
8920
9460
|
autoDetectErrors: false,
|
|
8921
|
-
releaseStage: (_window$
|
|
9461
|
+
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,
|
|
8922
9462
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
8923
9463
|
...startOptions
|
|
8924
9464
|
});
|
|
@@ -9089,8 +9629,10 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9089
9629
|
return descriptor.value;
|
|
9090
9630
|
}
|
|
9091
9631
|
|
|
9632
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
9092
9633
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
9093
9634
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9635
|
+
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;
|
|
9094
9636
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9095
9637
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
9096
9638
|
var _removeLoadingState = /*#__PURE__*/new WeakMap();
|
|
@@ -9213,7 +9755,7 @@ class SaveToMetadataButtonClass {
|
|
|
9213
9755
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9214
9756
|
}
|
|
9215
9757
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9216
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
9758
|
+
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, {
|
|
9217
9759
|
category: "ACTIONS",
|
|
9218
9760
|
action: "Save/Follow",
|
|
9219
9761
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9245,7 +9787,7 @@ class SaveToMetadataButtonClass {
|
|
|
9245
9787
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9246
9788
|
}
|
|
9247
9789
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9248
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
9790
|
+
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, {
|
|
9249
9791
|
category: "ACTIONS",
|
|
9250
9792
|
action: "Unsave/Unfollow",
|
|
9251
9793
|
label: title
|
|
@@ -10890,6 +11432,9 @@ function getSiteCardProcessor() {
|
|
|
10890
11432
|
return "stripe";
|
|
10891
11433
|
}
|
|
10892
11434
|
|
|
11435
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
11436
|
+
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;
|
|
11437
|
+
|
|
10893
11438
|
/**
|
|
10894
11439
|
* @typedef {Object} OptionsType
|
|
10895
11440
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -11017,12 +11562,12 @@ const initSecuritySdk = () => {
|
|
|
11017
11562
|
};
|
|
11018
11563
|
const initGATracking = () => {
|
|
11019
11564
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
11020
|
-
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);
|
|
11021
|
-
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");
|
|
11565
|
+
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);
|
|
11566
|
+
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");
|
|
11022
11567
|
};
|
|
11023
11568
|
const dispatchModalDisplayEvents = modalName => {
|
|
11024
11569
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
11025
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
11570
|
+
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, {
|
|
11026
11571
|
category: "VIEWS",
|
|
11027
11572
|
action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
|
|
11028
11573
|
nonInteraction: true
|
|
@@ -11888,7 +12433,7 @@ const LoginContainer = _ref => {
|
|
|
11888
12433
|
} else {
|
|
11889
12434
|
var _ReactGA$event;
|
|
11890
12435
|
onSuccess(res);
|
|
11891
|
-
|
|
12436
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
11892
12437
|
category: "ACTIONS",
|
|
11893
12438
|
action: "Logged in",
|
|
11894
12439
|
nonInteraction: true
|
|
@@ -12278,11 +12823,13 @@ function ConfirmPassword(_ref) {
|
|
|
12278
12823
|
}, otherProps));
|
|
12279
12824
|
}
|
|
12280
12825
|
|
|
12826
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
12827
|
+
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;
|
|
12281
12828
|
const Logout = props => {
|
|
12282
12829
|
const handleLogout = () => {
|
|
12283
12830
|
var _ReactGA$event;
|
|
12284
12831
|
window.Pelcro.user.logout();
|
|
12285
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
12832
|
+
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, {
|
|
12286
12833
|
category: "ACTIONS",
|
|
12287
12834
|
action: "Logged out",
|
|
12288
12835
|
nonInteraction: true
|
|
@@ -13844,6 +14391,9 @@ const RegisterCompany = props => {
|
|
|
13844
14391
|
}, props));
|
|
13845
14392
|
};
|
|
13846
14393
|
|
|
14394
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
14395
|
+
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;
|
|
14396
|
+
|
|
13847
14397
|
/**
|
|
13848
14398
|
*
|
|
13849
14399
|
*/
|
|
@@ -13869,7 +14419,7 @@ function RegisterModal(props) {
|
|
|
13869
14419
|
};
|
|
13870
14420
|
const handleAfterRegistrationLogic = () => {
|
|
13871
14421
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
13872
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
14422
|
+
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, {
|
|
13873
14423
|
category: "ACTIONS",
|
|
13874
14424
|
action: "Registered",
|
|
13875
14425
|
nonInteraction: true
|
|
@@ -13960,6 +14510,9 @@ function Radio(_ref) {
|
|
|
13960
14510
|
}, children));
|
|
13961
14511
|
}
|
|
13962
14512
|
|
|
14513
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
14514
|
+
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;
|
|
14515
|
+
|
|
13963
14516
|
/**
|
|
13964
14517
|
*
|
|
13965
14518
|
*/
|
|
@@ -14053,11 +14606,11 @@ class SelectModal extends React.Component {
|
|
|
14053
14606
|
}
|
|
14054
14607
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14055
14608
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14056
|
-
var _window$
|
|
14057
|
-
const userCurrency = (_window$
|
|
14058
|
-
const userCountry = (_window$
|
|
14059
|
-
const userLanguage = (_window$
|
|
14060
|
-
const productsMatchingUserCurrency = (_window$
|
|
14609
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
14610
|
+
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;
|
|
14611
|
+
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;
|
|
14612
|
+
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;
|
|
14613
|
+
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 => {
|
|
14061
14614
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14062
14615
|
if (filteredPlans.length) return filteredPlans;
|
|
14063
14616
|
});
|
|
@@ -14070,12 +14623,12 @@ class SelectModal extends React.Component {
|
|
|
14070
14623
|
});
|
|
14071
14624
|
notifyBugsnag(() => {
|
|
14072
14625
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14073
|
-
var _window$
|
|
14626
|
+
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;
|
|
14074
14627
|
event.addMetadata("MetaData", {
|
|
14075
|
-
site: (_window$
|
|
14076
|
-
user: (_window$
|
|
14077
|
-
uiVersion: (_window$
|
|
14078
|
-
environment: (_window$
|
|
14628
|
+
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(),
|
|
14629
|
+
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(),
|
|
14630
|
+
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,
|
|
14631
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
14079
14632
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14080
14633
|
productListState: this.state.productList,
|
|
14081
14634
|
methods: {
|
|
@@ -14086,8 +14639,8 @@ class SelectModal extends React.Component {
|
|
|
14086
14639
|
userCurrency: userCurrency,
|
|
14087
14640
|
userCountry: userCountry,
|
|
14088
14641
|
userLanguage: userLanguage,
|
|
14089
|
-
siteLanguage: (_window$
|
|
14090
|
-
products: (_window$
|
|
14642
|
+
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(),
|
|
14643
|
+
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,
|
|
14091
14644
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
14092
14645
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
14093
14646
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -14306,14 +14859,14 @@ class SelectModal extends React.Component {
|
|
|
14306
14859
|
} = this.props;
|
|
14307
14860
|
if (this.state.mode === "product") {
|
|
14308
14861
|
var _ReactGA$event;
|
|
14309
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
14862
|
+
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, {
|
|
14310
14863
|
category: "VIEWS",
|
|
14311
14864
|
action: "Product Modal Viewed",
|
|
14312
14865
|
nonInteraction: true
|
|
14313
14866
|
});
|
|
14314
14867
|
} else if (this.state.mode === "plan") {
|
|
14315
14868
|
var _ReactGA$event2;
|
|
14316
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
14869
|
+
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, {
|
|
14317
14870
|
category: "VIEWS",
|
|
14318
14871
|
action: "Plan Modal Viewed",
|
|
14319
14872
|
nonInteraction: true
|
|
@@ -19616,6 +20169,9 @@ const SubscriptionRenewView = _ref => {
|
|
|
19616
20169
|
}));
|
|
19617
20170
|
};
|
|
19618
20171
|
|
|
20172
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
20173
|
+
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;
|
|
20174
|
+
|
|
19619
20175
|
/**
|
|
19620
20176
|
*
|
|
19621
20177
|
*/
|
|
@@ -19631,7 +20187,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
19631
20187
|
const onSuccess = res => {
|
|
19632
20188
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
19633
20189
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
19634
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20190
|
+
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, {
|
|
19635
20191
|
category: "ACTIONS",
|
|
19636
20192
|
action: "Renewed",
|
|
19637
20193
|
nonInteraction: true
|
|
@@ -19641,7 +20197,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
19641
20197
|
const onGiftRenewalSuccess = () => {
|
|
19642
20198
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
19643
20199
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
19644
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
20200
|
+
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, {
|
|
19645
20201
|
category: "ACTIONS",
|
|
19646
20202
|
action: "Renewed Gift",
|
|
19647
20203
|
nonInteraction: true
|
|
@@ -19815,6 +20371,8 @@ function SvgSubscription(props) {
|
|
|
19815
20371
|
}))))));
|
|
19816
20372
|
}
|
|
19817
20373
|
|
|
20374
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
20375
|
+
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;
|
|
19818
20376
|
const SubscriptionCancelNowButton = _ref => {
|
|
19819
20377
|
let {
|
|
19820
20378
|
subscription,
|
|
@@ -19846,7 +20404,7 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
19846
20404
|
if (err) {
|
|
19847
20405
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
19848
20406
|
}
|
|
19849
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20407
|
+
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, {
|
|
19850
20408
|
category: "ACTIONS",
|
|
19851
20409
|
action: "Canceled",
|
|
19852
20410
|
nonInteraction: true
|
|
@@ -19885,6 +20443,8 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
19885
20443
|
}, t("messages.cancelNow"));
|
|
19886
20444
|
};
|
|
19887
20445
|
|
|
20446
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
20447
|
+
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;
|
|
19888
20448
|
const SubscriptionCancelLaterButton = _ref => {
|
|
19889
20449
|
let {
|
|
19890
20450
|
subscription,
|
|
@@ -19916,7 +20476,7 @@ const SubscriptionCancelLaterButton = _ref => {
|
|
|
19916
20476
|
if (err) {
|
|
19917
20477
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
19918
20478
|
}
|
|
19919
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20479
|
+
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, {
|
|
19920
20480
|
category: "ACTIONS",
|
|
19921
20481
|
action: "Canceled",
|
|
19922
20482
|
nonInteraction: true
|
|
@@ -20125,6 +20685,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
20125
20685
|
}, props));
|
|
20126
20686
|
};
|
|
20127
20687
|
|
|
20688
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
20689
|
+
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;
|
|
20128
20690
|
const SubscriptionSuspendButton = _ref => {
|
|
20129
20691
|
let {
|
|
20130
20692
|
subscription,
|
|
@@ -20155,7 +20717,7 @@ const SubscriptionSuspendButton = _ref => {
|
|
|
20155
20717
|
if (err) {
|
|
20156
20718
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20157
20719
|
}
|
|
20158
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20720
|
+
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, {
|
|
20159
20721
|
category: "ACTIONS",
|
|
20160
20722
|
action: "Suspended",
|
|
20161
20723
|
nonInteraction: true
|
|
@@ -23012,7 +23574,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23012
23574
|
}
|
|
23013
23575
|
});
|
|
23014
23576
|
onSuccess(res);
|
|
23015
|
-
|
|
23577
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
23016
23578
|
category: "ACTIONS",
|
|
23017
23579
|
action: "Updated address",
|
|
23018
23580
|
nonInteraction: true
|
|
@@ -23540,11 +24102,13 @@ function PaymentMethodUpdateView(props) {
|
|
|
23540
24102
|
}));
|
|
23541
24103
|
}
|
|
23542
24104
|
|
|
24105
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
24106
|
+
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;
|
|
23543
24107
|
const PaymentMethodUpdateModal = props => {
|
|
23544
24108
|
const onSuccess = res => {
|
|
23545
24109
|
var _props$onSuccess, _ReactGA$event;
|
|
23546
24110
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
23547
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
24111
|
+
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, {
|
|
23548
24112
|
category: "ACTIONS",
|
|
23549
24113
|
action: "Updated payment card",
|
|
23550
24114
|
nonInteraction: true
|
|
@@ -27424,6 +27988,8 @@ const OrderItems = _ref => {
|
|
|
27424
27988
|
});
|
|
27425
27989
|
};
|
|
27426
27990
|
|
|
27991
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1;
|
|
27992
|
+
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;
|
|
27427
27993
|
const SavedItemsMenu = () => {
|
|
27428
27994
|
const {
|
|
27429
27995
|
t
|
|
@@ -27488,7 +28054,7 @@ const SavedItems = _ref3 => {
|
|
|
27488
28054
|
return;
|
|
27489
28055
|
}
|
|
27490
28056
|
setItems(response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.metadata);
|
|
27491
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
28057
|
+
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, {
|
|
27492
28058
|
category: "ACTIONS",
|
|
27493
28059
|
action: "Unsave/Unfollow",
|
|
27494
28060
|
label: title
|
|
@@ -28435,6 +29001,8 @@ function getMemberShipStatus(status) {
|
|
|
28435
29001
|
};
|
|
28436
29002
|
}
|
|
28437
29003
|
|
|
29004
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
29005
|
+
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;
|
|
28438
29006
|
const SUB_MENUS = {
|
|
28439
29007
|
PROFILE: "profile",
|
|
28440
29008
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -28836,13 +29404,13 @@ class Dashboard extends React.Component {
|
|
|
28836
29404
|
this.menuRef = /*#__PURE__*/React__default['default'].createRef();
|
|
28837
29405
|
}
|
|
28838
29406
|
render() {
|
|
28839
|
-
var _window$Pelcro$user$r3, _window$
|
|
29407
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
28840
29408
|
const {
|
|
28841
29409
|
isOpen
|
|
28842
29410
|
} = this.state;
|
|
28843
29411
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
28844
29412
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
28845
|
-
const newsletters = (_window$
|
|
29413
|
+
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;
|
|
28846
29414
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
28847
29415
|
return /*#__PURE__*/React__default['default'].createElement(Transition, {
|
|
28848
29416
|
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",
|