apxor-qe 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apxor.qe.js.bak +331 -331
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -238,16 +238,16 @@
|
|
|
238
238
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
239
239
|
var _this = this;
|
|
240
240
|
_classCallCheck(this, Audience);
|
|
241
|
-
_defineProperty(this, "
|
|
242
|
-
_defineProperty(this, "
|
|
243
|
-
_defineProperty(this, "
|
|
241
|
+
_defineProperty(this, "pSoD", "ALL");
|
|
242
|
+
_defineProperty(this, "MNNc", []);
|
|
243
|
+
_defineProperty(this, "AZyK", []);
|
|
244
244
|
_defineProperty(this, "parse", function () {
|
|
245
245
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
246
246
|
try {
|
|
247
|
-
_this.
|
|
248
|
-
_this.
|
|
249
|
-
_this.
|
|
250
|
-
if (!Array.isArray(_this.
|
|
247
|
+
_this.pSoD = config.audience.audience_type;
|
|
248
|
+
_this.MNNc = config.audience.attributes.user;
|
|
249
|
+
_this.AZyK = config.audience.attributes.session;
|
|
250
|
+
if (!Array.isArray(_this.MNNc) || !Array.isArray(_this.AZyK)) {
|
|
251
251
|
Logger.error("No attributes");
|
|
252
252
|
return false;
|
|
253
253
|
}
|
|
@@ -259,12 +259,12 @@
|
|
|
259
259
|
});
|
|
260
260
|
_defineProperty(this, "validate", function (user, session) {
|
|
261
261
|
var status = true;
|
|
262
|
-
if (_this.
|
|
262
|
+
if (_this.pSoD === "FTU") {
|
|
263
263
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
264
264
|
}
|
|
265
|
-
return status && _this.
|
|
265
|
+
return status && _this.NqMe(user, _this.MNNc) && _this.NqMe(session, _this.AZyK);
|
|
266
266
|
});
|
|
267
|
-
_defineProperty(this, "
|
|
267
|
+
_defineProperty(this, "NqMe", function (attributes, expected) {
|
|
268
268
|
var length = expected.length;
|
|
269
269
|
var status = true;
|
|
270
270
|
try {
|
|
@@ -316,34 +316,34 @@
|
|
|
316
316
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
317
317
|
var _this = this;
|
|
318
318
|
_classCallCheck(this, Frequency);
|
|
319
|
-
_defineProperty(this, "
|
|
320
|
-
_defineProperty(this, "
|
|
321
|
-
_defineProperty(this, "
|
|
322
|
-
_defineProperty(this, "
|
|
323
|
-
_defineProperty(this, "
|
|
324
|
-
_defineProperty(this, "
|
|
319
|
+
_defineProperty(this, "zwQc", 0);
|
|
320
|
+
_defineProperty(this, "ZPtZ", 0);
|
|
321
|
+
_defineProperty(this, "WkRn", "SESSION");
|
|
322
|
+
_defineProperty(this, "SzTO", 0);
|
|
323
|
+
_defineProperty(this, "FWAX", 0);
|
|
324
|
+
_defineProperty(this, "czAG", 0);
|
|
325
325
|
_defineProperty(this, "parse", function () {
|
|
326
326
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
327
327
|
try {
|
|
328
|
-
_this.
|
|
329
|
-
_this.
|
|
330
|
-
_this.
|
|
331
|
-
_this.
|
|
332
|
-
_this.
|
|
328
|
+
_this.zwQc = config.frequency.count;
|
|
329
|
+
_this.czAG = _this.zwQc;
|
|
330
|
+
_this.ZPtZ = config.frequency.time_interval;
|
|
331
|
+
_this.WkRn = config.frequency.validity;
|
|
332
|
+
_this.FWAX = config.frequency.ses_lmt;
|
|
333
333
|
_this._dayCount = config.frequency.day_lmt;
|
|
334
334
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
335
335
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
336
336
|
var qe_state = CE.getInstance().getQeState();
|
|
337
337
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
338
|
-
if (_this.
|
|
339
|
-
_this.
|
|
340
|
-
if (_this.
|
|
338
|
+
if (_this.WkRn === "SESSION") {
|
|
339
|
+
_this.zwQc = parseInt(_this.zwQc) - parseInt(qe_state[config._id]["SESSION"]);
|
|
340
|
+
if (_this.zwQc <= 0) {
|
|
341
341
|
console.warn("Max count limit reached for session:" + config._id);
|
|
342
342
|
return false;
|
|
343
343
|
}
|
|
344
|
-
} else if (_this.
|
|
345
|
-
_this.
|
|
346
|
-
if (_this.
|
|
344
|
+
} else if (_this.WkRn === "OVERALL") {
|
|
345
|
+
_this.zwQc = parseInt(_this.zwQc) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
346
|
+
if (_this.zwQc <= 0) {
|
|
347
347
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
348
348
|
return false;
|
|
349
349
|
}
|
|
@@ -357,28 +357,28 @@
|
|
|
357
357
|
}
|
|
358
358
|
return true;
|
|
359
359
|
});
|
|
360
|
-
_defineProperty(this, "
|
|
361
|
-
_this.
|
|
360
|
+
_defineProperty(this, "IwRA", function () {
|
|
361
|
+
_this.zwQc = _this.zwQc - 1;
|
|
362
362
|
});
|
|
363
363
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
364
|
-
return _this.
|
|
364
|
+
return _this.zwQc;
|
|
365
365
|
});
|
|
366
|
-
_defineProperty(this, "
|
|
367
|
-
if (_this.
|
|
368
|
-
_this.
|
|
366
|
+
_defineProperty(this, "UYRW", function () {
|
|
367
|
+
if (_this.WkRn === "SESSION") {
|
|
368
|
+
_this.zwQc = _this.czAG;
|
|
369
369
|
Logger$1.info("Campaign Limit reset");
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
372
|
/**
|
|
373
|
-
* @function
|
|
373
|
+
* @function FwkM
|
|
374
374
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
375
375
|
* @param {string} Config id
|
|
376
376
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
377
377
|
* false - Otherwise
|
|
378
378
|
*/
|
|
379
|
-
_defineProperty(this, "
|
|
379
|
+
_defineProperty(this, "FwkM", function (id) {
|
|
380
380
|
try {
|
|
381
|
-
if (_this.
|
|
381
|
+
if (_this.zwQc <= 0) {
|
|
382
382
|
return false;
|
|
383
383
|
}
|
|
384
384
|
|
|
@@ -389,8 +389,8 @@
|
|
|
389
389
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
390
390
|
|
|
391
391
|
//If the config has a session count limit set
|
|
392
|
-
if (_this.
|
|
393
|
-
var sessionCountInConfig = parseInt(_this.
|
|
392
|
+
if (_this.FWAX !== 0) {
|
|
393
|
+
var sessionCountInConfig = parseInt(_this.FWAX);
|
|
394
394
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
395
395
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
396
396
|
return false;
|
|
@@ -417,14 +417,14 @@
|
|
|
417
417
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
418
418
|
var _this = this;
|
|
419
419
|
_classCallCheck(this, Meta);
|
|
420
|
-
_defineProperty(this, "
|
|
421
|
-
_defineProperty(this, "
|
|
420
|
+
_defineProperty(this, "XiTx", "");
|
|
421
|
+
_defineProperty(this, "pSoD", "");
|
|
422
422
|
_defineProperty(this, "parse", function () {
|
|
423
423
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
424
424
|
try {
|
|
425
425
|
var _config$meta;
|
|
426
|
-
_this.
|
|
427
|
-
_this.
|
|
426
|
+
_this.XiTx = config.meta.name;
|
|
427
|
+
_this.pSoD = config.meta.type;
|
|
428
428
|
_this._only_context = config.meta.only_context;
|
|
429
429
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
430
430
|
} catch (error) {
|
|
@@ -439,11 +439,11 @@
|
|
|
439
439
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
440
440
|
var _this = this;
|
|
441
441
|
_classCallCheck(this, Validity);
|
|
442
|
-
_defineProperty(this, "
|
|
443
|
-
_defineProperty(this, "
|
|
444
|
-
_defineProperty(this, "
|
|
445
|
-
_defineProperty(this, "
|
|
446
|
-
_defineProperty(this, "
|
|
442
|
+
_defineProperty(this, "Dpxa", -1);
|
|
443
|
+
_defineProperty(this, "YMiy", -1);
|
|
444
|
+
_defineProperty(this, "wPDl", -1);
|
|
445
|
+
_defineProperty(this, "SeqK", -1);
|
|
446
|
+
_defineProperty(this, "XgJJ", false);
|
|
447
447
|
_defineProperty(this, "parse", function () {
|
|
448
448
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
449
449
|
try {
|
|
@@ -451,17 +451,17 @@
|
|
|
451
451
|
Logger$2.error("Not valid dates");
|
|
452
452
|
return false;
|
|
453
453
|
}
|
|
454
|
-
_this.
|
|
455
|
-
_this.
|
|
454
|
+
_this.Dpxa = Date.parse(config.validity.start_date);
|
|
455
|
+
_this.YMiy = Date.parse(config.validity.end_date);
|
|
456
456
|
if (isDefined(config.time_limits_in_day)) {
|
|
457
|
-
_this.
|
|
458
|
-
if (_this.
|
|
457
|
+
_this.XgJJ = config.time_limits_in_day;
|
|
458
|
+
if (_this.XgJJ && isDefined(config.time_limits)) {
|
|
459
459
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
460
|
-
_this.
|
|
461
|
-
_this.
|
|
460
|
+
_this.wPDl = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
|
|
461
|
+
_this.SeqK = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
|
|
462
462
|
|
|
463
463
|
// If invalid format is passed, return false
|
|
464
|
-
if (isNaN(_this.
|
|
464
|
+
if (isNaN(_this.wPDl) || isNaN(_this.SeqK)) {
|
|
465
465
|
Logger$2.error("Not valid times");
|
|
466
466
|
return false;
|
|
467
467
|
}
|
|
@@ -475,8 +475,8 @@
|
|
|
475
475
|
});
|
|
476
476
|
_defineProperty(this, "validate", function () {
|
|
477
477
|
var currentTime = Date.now();
|
|
478
|
-
if (currentTime > _this.
|
|
479
|
-
return !_this.
|
|
478
|
+
if (currentTime > _this.Dpxa && currentTime < _this.YMiy) {
|
|
479
|
+
return !_this.XgJJ || currentTime >= _this.wPDl && currentTime <= _this.SeqK;
|
|
480
480
|
}
|
|
481
481
|
return false;
|
|
482
482
|
});
|
|
@@ -485,13 +485,13 @@
|
|
|
485
485
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
486
486
|
var _this = this;
|
|
487
487
|
_classCallCheck(this, Details);
|
|
488
|
-
_defineProperty(this, "
|
|
489
|
-
_defineProperty(this, "
|
|
488
|
+
_defineProperty(this, "XiTx", "");
|
|
489
|
+
_defineProperty(this, "BKuT", {});
|
|
490
490
|
_defineProperty(this, "parse", function () {
|
|
491
491
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
492
492
|
try {
|
|
493
|
-
_this.
|
|
494
|
-
_this.
|
|
493
|
+
_this.XiTx = details.name;
|
|
494
|
+
_this.BKuT = details.additional_info;
|
|
495
495
|
} catch (error) {
|
|
496
496
|
return false;
|
|
497
497
|
}
|
|
@@ -502,14 +502,14 @@
|
|
|
502
502
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
503
503
|
var _this = this;
|
|
504
504
|
_classCallCheck(this, Timebounds);
|
|
505
|
-
_defineProperty(this, "
|
|
506
|
-
_defineProperty(this, "
|
|
505
|
+
_defineProperty(this, "EDYb", 0);
|
|
506
|
+
_defineProperty(this, "qEcy", 0);
|
|
507
507
|
_defineProperty(this, "parse", function () {
|
|
508
508
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
509
509
|
try {
|
|
510
|
-
_this.
|
|
511
|
-
_this.
|
|
512
|
-
if (isNaN(_this.
|
|
510
|
+
_this.EDYb = Number(timeBounds.lower);
|
|
511
|
+
_this.qEcy = Number(timeBounds.upper);
|
|
512
|
+
if (isNaN(_this.EDYb) || isNaN(_this.qEcy)) {
|
|
513
513
|
return false;
|
|
514
514
|
}
|
|
515
515
|
} catch (error) {
|
|
@@ -522,17 +522,17 @@
|
|
|
522
522
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
523
523
|
var _this = this;
|
|
524
524
|
_classCallCheck(this, PreCondition);
|
|
525
|
-
_defineProperty(this, "
|
|
526
|
-
_defineProperty(this, "
|
|
527
|
-
_defineProperty(this, "
|
|
528
|
-
_defineProperty(this, "
|
|
529
|
-
_defineProperty(this, "
|
|
525
|
+
_defineProperty(this, "Psjs", 0);
|
|
526
|
+
_defineProperty(this, "phws", "");
|
|
527
|
+
_defineProperty(this, "nxGv", "");
|
|
528
|
+
_defineProperty(this, "UJWO", new Details());
|
|
529
|
+
_defineProperty(this, "YrXX", new Timebounds());
|
|
530
530
|
_defineProperty(this, "parse", function () {
|
|
531
531
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
532
532
|
try {
|
|
533
|
-
_this.
|
|
534
|
-
_this.
|
|
535
|
-
return _this.
|
|
533
|
+
_this.phws = precondition.event_type;
|
|
534
|
+
_this.nxGv = precondition.activity;
|
|
535
|
+
return _this.UJWO.parse(precondition.details) && _this.YrXX.parse(precondition.time_bounds);
|
|
536
536
|
} catch (error) {
|
|
537
537
|
return false;
|
|
538
538
|
}
|
|
@@ -543,29 +543,29 @@
|
|
|
543
543
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
544
544
|
var _this = this;
|
|
545
545
|
_classCallCheck(this, Condition);
|
|
546
|
-
_defineProperty(this, "
|
|
547
|
-
_defineProperty(this, "
|
|
548
|
-
_defineProperty(this, "
|
|
549
|
-
_defineProperty(this, "
|
|
550
|
-
_defineProperty(this, "
|
|
551
|
-
_defineProperty(this, "
|
|
552
|
-
_defineProperty(this, "
|
|
553
|
-
_defineProperty(this, "
|
|
554
|
-
_defineProperty(this, "
|
|
555
|
-
_defineProperty(this, "
|
|
556
|
-
_defineProperty(this, "
|
|
557
|
-
_defineProperty(this, "
|
|
546
|
+
_defineProperty(this, "Psjs", 0);
|
|
547
|
+
_defineProperty(this, "xJVh", -1);
|
|
548
|
+
_defineProperty(this, "zwQc", 0);
|
|
549
|
+
_defineProperty(this, "kxcj", "");
|
|
550
|
+
_defineProperty(this, "nxGv", "");
|
|
551
|
+
_defineProperty(this, "phws", "");
|
|
552
|
+
_defineProperty(this, "YrXX", new Timebounds());
|
|
553
|
+
_defineProperty(this, "UJWO", new Details());
|
|
554
|
+
_defineProperty(this, "pHAk", new PreCondition());
|
|
555
|
+
_defineProperty(this, "JJoS", "AND");
|
|
556
|
+
_defineProperty(this, "VNBK", false);
|
|
557
|
+
_defineProperty(this, "pSoD", void 0);
|
|
558
558
|
_defineProperty(this, "parse", function () {
|
|
559
559
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
560
560
|
try {
|
|
561
|
-
_this.
|
|
562
|
-
_this.
|
|
563
|
-
_this.
|
|
564
|
-
_this.
|
|
565
|
-
_this.
|
|
566
|
-
_this.
|
|
567
|
-
_this.
|
|
568
|
-
return _this.
|
|
561
|
+
_this.xJVh = condition.sequence;
|
|
562
|
+
_this.zwQc = condition.count_config.count;
|
|
563
|
+
_this.kxcj = condition.count_config.operator;
|
|
564
|
+
_this.nxGv = condition.activity;
|
|
565
|
+
_this.phws = condition.event_type;
|
|
566
|
+
_this.JJoS = condition.combine_operator;
|
|
567
|
+
_this.pSoD = condition.type;
|
|
568
|
+
return _this.UJWO.parse(condition.details) && _this.pHAk.parse(condition.trigger) && _this.YrXX.parse(condition.time_bounds);
|
|
569
569
|
} catch (error) {
|
|
570
570
|
Logger$3.error(error);
|
|
571
571
|
return false;
|
|
@@ -579,19 +579,19 @@
|
|
|
579
579
|
function ConditionValidator() {
|
|
580
580
|
var _this = this;
|
|
581
581
|
_classCallCheck(this, ConditionValidator);
|
|
582
|
-
_defineProperty(this, "
|
|
583
|
-
_defineProperty(this, "
|
|
584
|
-
_defineProperty(this, "
|
|
585
|
-
_defineProperty(this, "
|
|
586
|
-
_defineProperty(this, "
|
|
587
|
-
_defineProperty(this, "
|
|
588
|
-
_defineProperty(this, "
|
|
589
|
-
_defineProperty(this, "
|
|
590
|
-
_defineProperty(this, "
|
|
591
|
-
_defineProperty(this, "
|
|
592
|
-
_defineProperty(this, "
|
|
582
|
+
_defineProperty(this, "GFNv", 0);
|
|
583
|
+
_defineProperty(this, "Eusd", "");
|
|
584
|
+
_defineProperty(this, "FdIU", new Condition());
|
|
585
|
+
_defineProperty(this, "KoRY", false);
|
|
586
|
+
_defineProperty(this, "gCiS", false);
|
|
587
|
+
_defineProperty(this, "lVAx", 0);
|
|
588
|
+
_defineProperty(this, "JJoS", "AND");
|
|
589
|
+
_defineProperty(this, "Fqrt", -1);
|
|
590
|
+
_defineProperty(this, "IoCi", []);
|
|
591
|
+
_defineProperty(this, "bGlk", {});
|
|
592
|
+
_defineProperty(this, "PLjP", false);
|
|
593
593
|
/**
|
|
594
|
-
* If respectSequence is true, don't auto-
|
|
594
|
+
* If respectSequence is true, don't auto-alSx to events except for the condition whose index is 0
|
|
595
595
|
*
|
|
596
596
|
* @param condition
|
|
597
597
|
* @param type
|
|
@@ -606,155 +606,155 @@
|
|
|
606
606
|
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
607
607
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
608
608
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
609
|
-
_this.
|
|
610
|
-
_this.
|
|
611
|
-
_this.
|
|
612
|
-
var result = _this.
|
|
609
|
+
_this.Eusd = id;
|
|
610
|
+
_this.lVAx = index;
|
|
611
|
+
_this.IoCi = noKpiArray;
|
|
612
|
+
var result = _this.FdIU.parse(condition);
|
|
613
613
|
if (result) {
|
|
614
|
-
_this.
|
|
614
|
+
_this.JJoS = _this.FdIU.JJoS;
|
|
615
615
|
|
|
616
616
|
// FIXME: Why this code is written? Don't see any usecase
|
|
617
|
-
if (_this.
|
|
618
|
-
var eventName = _this.
|
|
617
|
+
if (_this.FdIU.VNBK) {
|
|
618
|
+
var eventName = _this.FdIU.UJWO.XiTx;
|
|
619
619
|
if (eventName === "APX_PAGE_OPENED") {
|
|
620
|
-
eventName = _this.
|
|
621
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
620
|
+
eventName = _this.FdIU.UJWO.BKuT["navigation_id"];
|
|
621
|
+
eventName = isDefined(eventName) ? eventName : _this.FdIU.UJWO.XiTx;
|
|
622
622
|
}
|
|
623
|
-
_this.
|
|
624
|
-
var count = _this.
|
|
625
|
-
var operator = _this.
|
|
626
|
-
_this.
|
|
627
|
-
_this.
|
|
628
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
623
|
+
_this.Fqrt = Apxor.getController().getEventCount(eventName);
|
|
624
|
+
var count = _this.FdIU.zwQc;
|
|
625
|
+
var operator = _this.FdIU.kxcj;
|
|
626
|
+
_this.gCiS = _this.HAgk(_this.Fqrt - 1, count, operator, false);
|
|
627
|
+
_this.KoRY = _this.gCiS;
|
|
628
|
+
// If the condition is already satisfied and if it is page view, no need to alSx
|
|
629
629
|
// This only applies for NAVIGATION_EVENTS
|
|
630
|
-
if (_this.
|
|
630
|
+
if (_this.gCiS && _this.FdIU.UJWO.XiTx === "APX_PAGE_OPENED") {
|
|
631
631
|
return true;
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
634
|
if (!respectSequence || index === 0) {
|
|
635
|
-
_this.
|
|
635
|
+
_this.alSx();
|
|
636
636
|
}
|
|
637
637
|
return true;
|
|
638
638
|
}
|
|
639
639
|
return false;
|
|
640
640
|
});
|
|
641
|
-
_defineProperty(this, "
|
|
642
|
-
var condition = _this.
|
|
643
|
-
var precondition = condition.
|
|
641
|
+
_defineProperty(this, "alSx", function () {
|
|
642
|
+
var condition = _this.FdIU;
|
|
643
|
+
var precondition = condition.pHAk;
|
|
644
644
|
var ceInstance = CE.getInstance();
|
|
645
|
-
if (precondition.
|
|
646
|
-
_this.
|
|
647
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
645
|
+
if (precondition.phws === "app_start") {
|
|
646
|
+
_this.KoRY = true;
|
|
647
|
+
ceInstance.registerForEvent(generateKey(condition.phws) + "___" + condition.UJWO.XiTx, _this.HcVn);
|
|
648
648
|
} else {
|
|
649
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
649
|
+
ceInstance.registerForEvent(generateKey(condition.phws) + "___" + precondition.UJWO.XiTx, _this.HcVn);
|
|
650
650
|
}
|
|
651
651
|
});
|
|
652
|
-
_defineProperty(this, "
|
|
653
|
-
var _this$
|
|
652
|
+
_defineProperty(this, "GNlE", function (type, name, time, additionalInfo) {
|
|
653
|
+
var _this$FdIU;
|
|
654
654
|
var eventTime = Date.now();
|
|
655
|
-
var time_differnce = (eventTime - _this.
|
|
656
|
-
var time_fromConfig = ((_this$
|
|
655
|
+
var time_differnce = (eventTime - _this.bGlk[name]) / 1000;
|
|
656
|
+
var time_fromConfig = ((_this$FdIU = _this.FdIU) === null || _this$FdIU === void 0 || (_this$FdIU = _this$FdIU.UJWO) === null || _this$FdIU === void 0 || (_this$FdIU = _this$FdIU.BKuT) === null || _this$FdIU === void 0 ? void 0 : _this$FdIU.time) / 1000;
|
|
657
657
|
if (time_fromConfig > time_differnce) {
|
|
658
658
|
_this._displayCampaign(time);
|
|
659
659
|
}
|
|
660
660
|
});
|
|
661
|
-
_defineProperty(this, "
|
|
661
|
+
_defineProperty(this, "zRAr", function (type, name, time, additionalInfo) {
|
|
662
662
|
var _this$_condition2, _this$_condition3;
|
|
663
|
-
_this.
|
|
663
|
+
_this.PLjP = true;
|
|
664
664
|
var currentTime = Date.now();
|
|
665
|
-
var eventName = (_this$_condition2 = _this.
|
|
666
|
-
var eventTime = _this.
|
|
665
|
+
var eventName = (_this$_condition2 = _this.FdIU) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.pHAk) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.UJWO.XiTx;
|
|
666
|
+
var eventTime = _this.bGlk[eventName];
|
|
667
667
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
668
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
668
|
+
var time_fromConfig = (_this$_condition3 = _this.FdIU) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.UJWO) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.BKuT) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
669
669
|
time_fromConfig = time_fromConfig / 1000;
|
|
670
670
|
if (time_fromConfig > time_differnce) {
|
|
671
671
|
_this._displayCampaign(time);
|
|
672
672
|
}
|
|
673
673
|
//unregister the event
|
|
674
674
|
});
|
|
675
|
-
_defineProperty(this, "
|
|
675
|
+
_defineProperty(this, "HcVn", function (type, name, time, additionalInfo) {
|
|
676
676
|
var ceInstance = CE.getInstance();
|
|
677
|
-
if (!_this.
|
|
677
|
+
if (!_this.KoRY) {
|
|
678
678
|
// Validate Precondition
|
|
679
|
-
_this.
|
|
680
|
-
if (_this.
|
|
681
|
-
var condition = _this.
|
|
682
|
-
var precondition = condition.
|
|
683
|
-
precondition.
|
|
679
|
+
_this.KoRY = _this.mAby(type, name, time, additionalInfo);
|
|
680
|
+
if (_this.KoRY) {
|
|
681
|
+
var condition = _this.FdIU;
|
|
682
|
+
var precondition = condition.pHAk;
|
|
683
|
+
precondition.Psjs = time;
|
|
684
684
|
//events will be registred by its type activity event_type: "activity_time"
|
|
685
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
686
|
-
var
|
|
687
|
-
var event_time = condition === null || condition === void 0 || (
|
|
688
|
-
if ((condition === null || condition === void 0 || (
|
|
685
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.phws) === "activity_time") {
|
|
686
|
+
var FdIU$UJWO, FdIU$_details2, FdIU$_details3;
|
|
687
|
+
var event_time = condition === null || condition === void 0 || (FdIU$UJWO = condition.UJWO) === null || FdIU$UJWO === void 0 || (FdIU$UJWO = FdIU$UJWO.BKuT) === null || FdIU$UJWO === void 0 ? void 0 : FdIU$UJWO.time;
|
|
688
|
+
if ((condition === null || condition === void 0 || (FdIU$_details2 = condition.UJWO) === null || FdIU$_details2 === void 0 || (FdIU$_details2 = FdIU$_details2.BKuT) === null || FdIU$_details2 === void 0 ? void 0 : FdIU$_details2.nkpi.length) > 0) {
|
|
689
689
|
setTimeout(function () {
|
|
690
|
-
if (!_this.
|
|
691
|
-
_this.
|
|
692
|
-
if (_this.
|
|
693
|
-
_this.
|
|
694
|
-
_this.
|
|
695
|
-
if (_this.
|
|
696
|
-
_this.
|
|
697
|
-
ceInstance.validate(_this.
|
|
690
|
+
if (!_this.PLjP) {
|
|
691
|
+
_this.gCiS = true;
|
|
692
|
+
if (_this.gCiS) {
|
|
693
|
+
_this.GFNv += 1;
|
|
694
|
+
_this.gCiS = _this.HAgk(_this.GFNv, _this.FdIU.zwQc, _this.FdIU.kxcj);
|
|
695
|
+
if (_this.gCiS) {
|
|
696
|
+
_this.FdIU.Psjs = time;
|
|
697
|
+
ceInstance.validate(_this.Eusd, _this.lVAx);
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
condition.
|
|
702
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
701
|
+
condition.UJWO.BKuT.nkpi.map(function (nokpi) {
|
|
702
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + nokpi, _this);
|
|
703
703
|
});
|
|
704
704
|
}, event_time);
|
|
705
|
-
condition.
|
|
706
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
705
|
+
condition.UJWO.BKuT.nkpi.map(function (nokpi) {
|
|
706
|
+
ceInstance.registerForEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + nokpi, _this.zRAr);
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
709
|
//it is for unregistering the events did case after completing the time imit
|
|
710
|
-
if ((condition === null || condition === void 0 || (
|
|
710
|
+
if ((condition === null || condition === void 0 || (FdIU$_details3 = condition.UJWO) === null || FdIU$_details3 === void 0 || (FdIU$_details3 = FdIU$_details3.BKuT) === null || FdIU$_details3 === void 0 ? void 0 : FdIU$_details3.kpi.length) > 0) {
|
|
711
711
|
setTimeout(function () {
|
|
712
|
-
condition.
|
|
713
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
712
|
+
condition.UJWO.BKuT.kpi.map(function (kpi) {
|
|
713
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + kpi, _this);
|
|
714
714
|
});
|
|
715
715
|
}, event_time);
|
|
716
|
-
condition.
|
|
717
|
-
if (kpi === condition.
|
|
716
|
+
condition.UJWO.BKuT.kpi.map(function (kpi) {
|
|
717
|
+
if (kpi === condition.pHAk.UJWO.XiTx) {
|
|
718
718
|
//unregister the previous event
|
|
719
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
720
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
719
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.phws) + "___" + precondition.UJWO.XiTx, _this);
|
|
720
|
+
ceInstance.registerForEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + kpi, _this.GNlE);
|
|
721
721
|
} else {
|
|
722
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
722
|
+
ceInstance.registerForEvent(toUpperCase(condition.UJWO.BKuT.et) + "___" + kpi, _this.zRAr);
|
|
723
723
|
}
|
|
724
724
|
});
|
|
725
725
|
}
|
|
726
726
|
} else {
|
|
727
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
728
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
727
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.phws) + "___" + precondition.UJWO.XiTx, _this);
|
|
728
|
+
ceInstance.registerForEvent(generateKey(condition.phws) + "___" + condition.UJWO.XiTx, _this);
|
|
729
729
|
}
|
|
730
|
-
_this.
|
|
730
|
+
_this.bGlk[name] = Date.now();
|
|
731
731
|
}
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
734
|
|
|
735
735
|
// Validate Condition
|
|
736
|
-
var validationStatus = generateKey(_this.
|
|
736
|
+
var validationStatus = generateKey(_this.FdIU.phws) === type && _this.INmv(time - _this.FdIU.pHAk.Psjs, _this.FdIU.YrXX) && _this.FdIU.UJWO.XiTx === name && _this.FRhW(_this.FdIU.UJWO.BKuT, additionalInfo);
|
|
737
737
|
if (validationStatus) {
|
|
738
|
-
_this.
|
|
739
|
-
_this.
|
|
740
|
-
if (_this.
|
|
741
|
-
_this.
|
|
742
|
-
ceInstance.validate(_this.
|
|
738
|
+
_this.GFNv += 1;
|
|
739
|
+
_this.gCiS = _this.HAgk(_this.GFNv, _this.FdIU.zwQc, _this.FdIU.kxcj);
|
|
740
|
+
if (_this.gCiS) {
|
|
741
|
+
_this.FdIU.Psjs = time;
|
|
742
|
+
ceInstance.validate(_this.Eusd, _this.lVAx);
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
});
|
|
746
|
-
_defineProperty(this, "
|
|
747
|
-
var precondition = _this.
|
|
748
|
-
return generateKey(precondition.
|
|
746
|
+
_defineProperty(this, "mAby", function (type, name, time, additionalInfo) {
|
|
747
|
+
var precondition = _this.FdIU.pHAk;
|
|
748
|
+
return generateKey(precondition.phws) === type && precondition.UJWO.XiTx === name && _this.INmv(time, precondition.YrXX) && _this.FRhW(precondition.UJWO.BKuT, additionalInfo);
|
|
749
749
|
});
|
|
750
|
-
_defineProperty(this, "
|
|
750
|
+
_defineProperty(this, "INmv", function (time, timeBounds) {
|
|
751
751
|
var currentTime = Math.ceil(time);
|
|
752
|
-
return currentTime > timeBounds.
|
|
752
|
+
return currentTime > timeBounds.EDYb && currentTime < timeBounds.qEcy;
|
|
753
753
|
});
|
|
754
|
-
_defineProperty(this, "
|
|
754
|
+
_defineProperty(this, "HAgk", function (current, required, operator) {
|
|
755
755
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
756
|
-
if (checkOld && _this.
|
|
757
|
-
current = current + _this.
|
|
756
|
+
if (checkOld && _this.FdIU.VNBK) {
|
|
757
|
+
current = current + _this.Fqrt;
|
|
758
758
|
}
|
|
759
759
|
switch (operator) {
|
|
760
760
|
case "EQ":
|
|
@@ -771,7 +771,7 @@
|
|
|
771
771
|
return false;
|
|
772
772
|
}
|
|
773
773
|
});
|
|
774
|
-
_defineProperty(this, "
|
|
774
|
+
_defineProperty(this, "FRhW", function (expected, received) {
|
|
775
775
|
var status = true;
|
|
776
776
|
try {
|
|
777
777
|
var _loop = function _loop() {
|
|
@@ -819,13 +819,13 @@
|
|
|
819
819
|
key: "_displayCampaign",
|
|
820
820
|
value: function _displayCampaign(time) {
|
|
821
821
|
var ceInstance = CE.getInstance();
|
|
822
|
-
this.
|
|
823
|
-
if (this.
|
|
824
|
-
this.
|
|
825
|
-
this.
|
|
826
|
-
if (this.
|
|
827
|
-
this.
|
|
828
|
-
ceInstance.validate(this.
|
|
822
|
+
this.gCiS = true;
|
|
823
|
+
if (this.gCiS) {
|
|
824
|
+
this.GFNv += 1;
|
|
825
|
+
this.gCiS = this.HAgk(this.GFNv, this.FdIU.zwQc, this.FdIU.kxcj);
|
|
826
|
+
if (this.gCiS) {
|
|
827
|
+
this.FdIU.Psjs = time;
|
|
828
|
+
ceInstance.validate(this.Eusd, this.lVAx);
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
831
|
}
|
|
@@ -842,20 +842,20 @@
|
|
|
842
842
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
843
843
|
var _this = this;
|
|
844
844
|
_classCallCheck(this, OverallConfig);
|
|
845
|
-
_defineProperty(this, "
|
|
845
|
+
_defineProperty(this, "VJYi", []);
|
|
846
846
|
_defineProperty(this, "_ret_day", {});
|
|
847
|
-
_defineProperty(this, "
|
|
848
|
-
_defineProperty(this, "
|
|
849
|
-
_defineProperty(this, "
|
|
847
|
+
_defineProperty(this, "EsoR", {});
|
|
848
|
+
_defineProperty(this, "sVml", false);
|
|
849
|
+
_defineProperty(this, "stSX", false);
|
|
850
850
|
_defineProperty(this, "parse", function () {
|
|
851
851
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
852
852
|
try {
|
|
853
|
-
_this.
|
|
853
|
+
_this.VJYi = config.overall_cfg.events;
|
|
854
854
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
855
|
-
_this.
|
|
856
|
-
_this.
|
|
857
|
-
_this.
|
|
858
|
-
_this.
|
|
855
|
+
_this.EsoR = config.overall_cfg.session;
|
|
856
|
+
_this.sVml = config.overall_cfg.toggleRetDay;
|
|
857
|
+
_this.VJYi = config.overall_cfg.events;
|
|
858
|
+
_this.stSX = config.overall_cfg.toggleSession;
|
|
859
859
|
} catch (error) {
|
|
860
860
|
Logger$5.error(error);
|
|
861
861
|
return false;
|
|
@@ -865,10 +865,10 @@
|
|
|
865
865
|
_defineProperty(this, "validate", function () {
|
|
866
866
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
867
867
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
868
|
-
if (_this.
|
|
868
|
+
if (_this.sVml && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
869
869
|
return false;
|
|
870
870
|
}
|
|
871
|
-
if (_this.
|
|
871
|
+
if (_this.stSX && !isNaN(retainedSession) && !(retainedSession >= _this.EsoR.from && retainedSession <= _this.EsoR.to)) {
|
|
872
872
|
return false;
|
|
873
873
|
}
|
|
874
874
|
try {
|
|
@@ -876,8 +876,8 @@
|
|
|
876
876
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
877
877
|
var siteid = Apxor.getSiteId();
|
|
878
878
|
var LtCountObjDecoded = JSON.parse(decode(siteid, data));
|
|
879
|
-
for (var i = 0; i < _this.
|
|
880
|
-
var evName = _this.
|
|
879
|
+
for (var i = 0; i < _this.VJYi.length; i++) {
|
|
880
|
+
var evName = _this.VJYi[i].name.replace("'", "").replace("’", "");
|
|
881
881
|
if (LtCountObjDecoded[evName]) {
|
|
882
882
|
return false;
|
|
883
883
|
}
|
|
@@ -893,15 +893,15 @@
|
|
|
893
893
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
894
894
|
var _this = this;
|
|
895
895
|
_classCallCheck(this, ConfigItem);
|
|
896
|
-
_defineProperty(this, "
|
|
897
|
-
_defineProperty(this, "
|
|
898
|
-
_defineProperty(this, "
|
|
899
|
-
_defineProperty(this, "
|
|
900
|
-
_defineProperty(this, "
|
|
901
|
-
_defineProperty(this, "
|
|
902
|
-
_defineProperty(this, "
|
|
903
|
-
_defineProperty(this, "
|
|
904
|
-
_defineProperty(this, "
|
|
896
|
+
_defineProperty(this, "HMDi", []);
|
|
897
|
+
_defineProperty(this, "Eusd", "");
|
|
898
|
+
_defineProperty(this, "TZgO", new Meta());
|
|
899
|
+
_defineProperty(this, "ygTF", new Audience());
|
|
900
|
+
_defineProperty(this, "WkRn", new Validity());
|
|
901
|
+
_defineProperty(this, "JOfv", new Frequency());
|
|
902
|
+
_defineProperty(this, "OLfY", new OverallConfig());
|
|
903
|
+
_defineProperty(this, "vZax", false);
|
|
904
|
+
_defineProperty(this, "fyZj", []);
|
|
905
905
|
_defineProperty(this, "parse", function () {
|
|
906
906
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
907
907
|
try {
|
|
@@ -918,7 +918,7 @@
|
|
|
918
918
|
}
|
|
919
919
|
|
|
920
920
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
921
|
-
if (!(_this.
|
|
921
|
+
if (!(_this.TZgO.parse(config) && _this.WkRn.parse(config) && _this.JOfv.parse(config) && _this.ygTF.parse(config) && _this.OLfY.parse(config))) {
|
|
922
922
|
return false;
|
|
923
923
|
}
|
|
924
924
|
|
|
@@ -927,9 +927,9 @@
|
|
|
927
927
|
Logger$6.error("No valid conditions", config.conditions);
|
|
928
928
|
return false;
|
|
929
929
|
}
|
|
930
|
-
_this.
|
|
931
|
-
_this.
|
|
932
|
-
if (_this.
|
|
930
|
+
_this.Eusd = config._id;
|
|
931
|
+
_this.vZax = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
932
|
+
if (_this.vZax) {
|
|
933
933
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
934
934
|
// We need to sort, if server sends them in orderless manner
|
|
935
935
|
config.conditions.sort(function (prev, current) {
|
|
@@ -941,17 +941,17 @@
|
|
|
941
941
|
var conditions = config.conditions;
|
|
942
942
|
var length = conditions.length;
|
|
943
943
|
for (var index = 0; index < length; index++) {
|
|
944
|
-
_this.
|
|
944
|
+
_this.fyZj = [];
|
|
945
945
|
var condition = conditions[index];
|
|
946
946
|
if (condition.type === "didn't") {
|
|
947
|
-
var
|
|
947
|
+
var FdIU$details;
|
|
948
948
|
var obj = {
|
|
949
949
|
trigger_key: condition.trigger.details.name,
|
|
950
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
950
|
+
no_kpi_array: condition === null || condition === void 0 || (FdIU$details = condition.details) === null || FdIU$details === void 0 || (FdIU$details = FdIU$details.additional_info) === null || FdIU$details === void 0 ? void 0 : FdIU$details.nkpi,
|
|
951
951
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
952
952
|
time_bounds: condition.time_bounds.upper
|
|
953
953
|
};
|
|
954
|
-
_this.
|
|
954
|
+
_this.fyZj = [].concat(_toConsumableArray(_this.fyZj), [obj]);
|
|
955
955
|
//this will be the key
|
|
956
956
|
//when event occur check this array and then then check the time
|
|
957
957
|
//check the time diffrence
|
|
@@ -960,57 +960,57 @@
|
|
|
960
960
|
}
|
|
961
961
|
|
|
962
962
|
var conditionValidator = new ConditionValidator();
|
|
963
|
-
if (conditionValidator.initialize(condition, _this.
|
|
964
|
-
_this.
|
|
963
|
+
if (conditionValidator.initialize(condition, _this.Eusd, index, _this.vZax, _this.fyZj)) {
|
|
964
|
+
_this.HMDi.push(conditionValidator);
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
return _this.
|
|
967
|
+
return _this.HMDi.length > 0;
|
|
968
968
|
} catch (error) {
|
|
969
969
|
Logger$6.error(error);
|
|
970
970
|
return false;
|
|
971
971
|
}
|
|
972
972
|
});
|
|
973
|
-
_defineProperty(this, "
|
|
973
|
+
_defineProperty(this, "ZsYF", function (index) {
|
|
974
974
|
if (index < 0) {
|
|
975
975
|
return;
|
|
976
976
|
}
|
|
977
|
-
if (_this.
|
|
978
|
-
var conditionValidator = _this.
|
|
979
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
977
|
+
if (_this.vZax) {
|
|
978
|
+
var conditionValidator = _this.HMDi[index];
|
|
979
|
+
if (isDefined(conditionValidator) && conditionValidator.gCiS) {
|
|
980
980
|
// Check if previous validator is satisfied
|
|
981
|
-
var prevValidator = _this.
|
|
982
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
981
|
+
var prevValidator = _this.HMDi[index - 1];
|
|
982
|
+
if (isDefined(prevValidator) && !prevValidator.gCiS) {
|
|
983
983
|
// TODO: If current index is satisfied before previous one, do something
|
|
984
984
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
var nextValidator = _this.
|
|
987
|
+
var nextValidator = _this.HMDi[index + 1];
|
|
988
988
|
if (!isDefined(nextValidator)) {
|
|
989
989
|
// It means this is the last condition
|
|
990
990
|
// Validate all conditions
|
|
991
|
-
_this.
|
|
991
|
+
_this.wcgW();
|
|
992
992
|
} else {
|
|
993
|
-
nextValidator.
|
|
993
|
+
nextValidator.alSx();
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
} else {
|
|
997
997
|
// Validate all conditions
|
|
998
|
-
_this.
|
|
998
|
+
_this.wcgW();
|
|
999
999
|
}
|
|
1000
1000
|
});
|
|
1001
|
-
_defineProperty(this, "
|
|
1001
|
+
_defineProperty(this, "wcgW", function () {
|
|
1002
1002
|
// Check If Audience, Validity is satisfied or not
|
|
1003
1003
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1004
1004
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1005
|
-
if (!_this.
|
|
1005
|
+
if (!_this.WkRn.validate() || !_this.ygTF.validate(userAttributes, sessionAttributes) || !_this.OLfY.validate()) {
|
|
1006
1006
|
return;
|
|
1007
1007
|
}
|
|
1008
|
-
var length = _this.
|
|
1008
|
+
var length = _this.HMDi.length;
|
|
1009
1009
|
var isSatisfied = length < 1;
|
|
1010
1010
|
var combineOperator = "";
|
|
1011
1011
|
for (var index = 0; index < length; index++) {
|
|
1012
|
-
var validator = _this.
|
|
1013
|
-
var currentResult = validator.
|
|
1012
|
+
var validator = _this.HMDi[index];
|
|
1013
|
+
var currentResult = validator.gCiS;
|
|
1014
1014
|
if (combineOperator.trim() === "") {
|
|
1015
1015
|
isSatisfied = currentResult;
|
|
1016
1016
|
} else {
|
|
@@ -1023,47 +1023,47 @@
|
|
|
1023
1023
|
break;
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
|
-
combineOperator = validator.
|
|
1026
|
+
combineOperator = validator.JJoS;
|
|
1027
1027
|
}
|
|
1028
1028
|
if (isSatisfied) {
|
|
1029
1029
|
console.debug("onCondition satisfied");
|
|
1030
1030
|
// Check if count reached it's maximum
|
|
1031
|
-
if (!_this.
|
|
1032
|
-
console.warn("Maximum limit reached", _this.
|
|
1031
|
+
if (!_this.JOfv.FwkM(_this.Eusd)) {
|
|
1032
|
+
console.warn("Maximum limit reached", _this.Eusd);
|
|
1033
1033
|
return;
|
|
1034
1034
|
}
|
|
1035
|
-
console.log("Dispatching event", _this.
|
|
1036
|
-
if (_this.
|
|
1037
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1038
|
-
message_name: _this.
|
|
1039
|
-
id: _this.
|
|
1035
|
+
console.log("Dispatching event", _this.TZgO.pSoD);
|
|
1036
|
+
if (_this.TZgO._only_context === true) {
|
|
1037
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.TZgO._attr), {}, {
|
|
1038
|
+
message_name: _this.TZgO.XiTx,
|
|
1039
|
+
id: _this.Eusd
|
|
1040
1040
|
}));
|
|
1041
1041
|
}
|
|
1042
1042
|
// Emit event
|
|
1043
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1044
|
-
name: _this.
|
|
1043
|
+
Apxor.getController().dispatchEvent(_this.TZgO.pSoD, {
|
|
1044
|
+
name: _this.TZgO.pSoD,
|
|
1045
1045
|
additional_info: {
|
|
1046
|
-
uuid: _this.
|
|
1047
|
-
name: _this.
|
|
1046
|
+
uuid: _this.Eusd,
|
|
1047
|
+
name: _this.TZgO.XiTx
|
|
1048
1048
|
}
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
1051
|
});
|
|
1052
|
-
_defineProperty(this, "
|
|
1053
|
-
_this.
|
|
1052
|
+
_defineProperty(this, "IwRA", function () {
|
|
1053
|
+
_this.JOfv.IwRA();
|
|
1054
1054
|
});
|
|
1055
1055
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1056
|
-
return _this.
|
|
1056
|
+
return _this.JOfv.getFrequencyCount();
|
|
1057
1057
|
});
|
|
1058
|
-
_defineProperty(this, "
|
|
1059
|
-
return _this.
|
|
1058
|
+
_defineProperty(this, "Dith", function () {
|
|
1059
|
+
return _this.JOfv.UYRW();
|
|
1060
1060
|
});
|
|
1061
1061
|
});
|
|
1062
1062
|
|
|
1063
1063
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1064
1064
|
var _this = this;
|
|
1065
1065
|
_classCallCheck(this, ConfigLookup);
|
|
1066
|
-
_defineProperty(this, "
|
|
1066
|
+
_defineProperty(this, "ooiv", {});
|
|
1067
1067
|
_defineProperty(this, "parse", function () {
|
|
1068
1068
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1069
1069
|
configs: []
|
|
@@ -1086,7 +1086,7 @@
|
|
|
1086
1086
|
var configId = _config._id;
|
|
1087
1087
|
var configItem = new ConfigItem();
|
|
1088
1088
|
if (configItem.parse(_config)) {
|
|
1089
|
-
_this.
|
|
1089
|
+
_this.ooiv[configId] = configItem;
|
|
1090
1090
|
} else {
|
|
1091
1091
|
console.warn("Failed to parse cfg", configId);
|
|
1092
1092
|
}
|
|
@@ -1094,31 +1094,31 @@
|
|
|
1094
1094
|
}
|
|
1095
1095
|
});
|
|
1096
1096
|
_defineProperty(this, "validate", function (id, index) {
|
|
1097
|
-
if (_this.
|
|
1098
|
-
var configItem = _this.
|
|
1099
|
-
configItem.
|
|
1097
|
+
if (_this.ooiv[id]) {
|
|
1098
|
+
var configItem = _this.ooiv[id];
|
|
1099
|
+
configItem.ZsYF(index);
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
1102
|
-
_defineProperty(this, "
|
|
1103
|
-
var campiagnConfig = _this.
|
|
1104
|
-
campiagnConfig.
|
|
1102
|
+
_defineProperty(this, "IwRA", function (id) {
|
|
1103
|
+
var campiagnConfig = _this.ooiv[id];
|
|
1104
|
+
campiagnConfig.IwRA();
|
|
1105
1105
|
});
|
|
1106
1106
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1107
|
-
var campiagnConfig = _this.
|
|
1107
|
+
var campiagnConfig = _this.ooiv[id];
|
|
1108
1108
|
return campiagnConfig.getFrequencyCount();
|
|
1109
1109
|
});
|
|
1110
1110
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1111
|
-
var configs = _this.
|
|
1111
|
+
var configs = _this.ooiv;
|
|
1112
1112
|
for (var configId in configs) {
|
|
1113
|
-
configs[configId].
|
|
1113
|
+
configs[configId].Dith();
|
|
1114
1114
|
}
|
|
1115
1115
|
});
|
|
1116
|
-
_defineProperty(this, "
|
|
1116
|
+
_defineProperty(this, "NrmJ", function (campaignId) {
|
|
1117
1117
|
try {
|
|
1118
|
-
if (_this.
|
|
1119
|
-
var configItem = _this.
|
|
1120
|
-
if (configItem && configItem.
|
|
1121
|
-
return configItem.
|
|
1118
|
+
if (_this.ooiv) {
|
|
1119
|
+
var configItem = _this.ooiv[campaignId];
|
|
1120
|
+
if (configItem && configItem.TZgO) {
|
|
1121
|
+
return configItem.TZgO;
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
} catch (e) {
|
|
@@ -1134,42 +1134,42 @@
|
|
|
1134
1134
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1135
1135
|
var _this = this;
|
|
1136
1136
|
_classCallCheck(this, EventsListener);
|
|
1137
|
-
_defineProperty(this, "
|
|
1138
|
-
_defineProperty(this, "
|
|
1139
|
-
_defineProperty(this, "
|
|
1137
|
+
_defineProperty(this, "fJga", {});
|
|
1138
|
+
_defineProperty(this, "mDlm", []);
|
|
1139
|
+
_defineProperty(this, "UAPh", false);
|
|
1140
1140
|
_defineProperty(this, "initialize", function () {
|
|
1141
1141
|
var controller = Apxor.getController();
|
|
1142
1142
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1143
|
-
return _this.
|
|
1143
|
+
return _this.IjTE(event, "AE");
|
|
1144
1144
|
});
|
|
1145
1145
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1146
|
-
return _this.
|
|
1146
|
+
return _this.IjTE(event, "CE");
|
|
1147
1147
|
});
|
|
1148
1148
|
});
|
|
1149
|
-
_defineProperty(this, "
|
|
1149
|
+
_defineProperty(this, "xcoZ", function () {
|
|
1150
1150
|
// Clear Buffer
|
|
1151
|
-
for (var item in _this.
|
|
1152
|
-
_this.
|
|
1151
|
+
for (var item in _this.mDlm) {
|
|
1152
|
+
_this.Ywjj(item.event, item.key, item.type);
|
|
1153
1153
|
}
|
|
1154
|
-
_this.
|
|
1154
|
+
_this.UAPh = true;
|
|
1155
1155
|
});
|
|
1156
|
-
_defineProperty(this, "
|
|
1156
|
+
_defineProperty(this, "Pdms", function (event, callback) {
|
|
1157
1157
|
if (!isFunction(callback)) {
|
|
1158
1158
|
return;
|
|
1159
1159
|
}
|
|
1160
1160
|
var listeners;
|
|
1161
|
-
if (_this.
|
|
1162
|
-
listeners = _this.
|
|
1161
|
+
if (_this.fJga[event]) {
|
|
1162
|
+
listeners = _this.fJga[event];
|
|
1163
1163
|
} else {
|
|
1164
1164
|
listeners = [];
|
|
1165
1165
|
}
|
|
1166
1166
|
listeners.push(callback);
|
|
1167
|
-
_this.
|
|
1168
|
-
Logger$7.debug("Listeners list: ", _this.
|
|
1167
|
+
_this.fJga[event] = listeners;
|
|
1168
|
+
Logger$7.debug("Listeners list: ", _this.fJga);
|
|
1169
1169
|
});
|
|
1170
1170
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1171
|
-
if (_this.
|
|
1172
|
-
var listeners = _this.
|
|
1171
|
+
if (_this.fJga[event]) {
|
|
1172
|
+
var listeners = _this.fJga[event];
|
|
1173
1173
|
var updatedListeners = [];
|
|
1174
1174
|
for (var index = 0; index < listeners.length; index++) {
|
|
1175
1175
|
var listener = listeners[index];
|
|
@@ -1177,25 +1177,25 @@
|
|
|
1177
1177
|
updatedListeners.push(listener);
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
_this.
|
|
1180
|
+
_this.fJga[event] = updatedListeners;
|
|
1181
1181
|
}
|
|
1182
1182
|
});
|
|
1183
|
-
_defineProperty(this, "
|
|
1183
|
+
_defineProperty(this, "IjTE", function (event) {
|
|
1184
1184
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1185
1185
|
var key = type + "___" + event.name;
|
|
1186
|
-
_this.
|
|
1186
|
+
_this.Ywjj(event, key, type);
|
|
1187
1187
|
});
|
|
1188
|
-
_defineProperty(this, "
|
|
1189
|
-
if (!_this.
|
|
1190
|
-
_this.
|
|
1188
|
+
_defineProperty(this, "Ywjj", function (event, key, type) {
|
|
1189
|
+
if (!_this.UAPh) {
|
|
1190
|
+
_this.mDlm.push({
|
|
1191
1191
|
event: event,
|
|
1192
1192
|
key: key,
|
|
1193
1193
|
type: type
|
|
1194
1194
|
});
|
|
1195
1195
|
} else {
|
|
1196
|
-
Logger$7.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1197
|
-
if (_this.
|
|
1198
|
-
var listeners = _this.
|
|
1196
|
+
Logger$7.debug("Notifying listeners for event: " + event + ", " + key, _this.fJga);
|
|
1197
|
+
if (_this.fJga[key]) {
|
|
1198
|
+
var listeners = _this.fJga[key];
|
|
1199
1199
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1200
1200
|
for (var index = 0; index < listeners.length; index++) {
|
|
1201
1201
|
var listener = listeners[index];
|
|
@@ -1211,17 +1211,17 @@
|
|
|
1211
1211
|
function CE() {
|
|
1212
1212
|
var _this = this;
|
|
1213
1213
|
_classCallCheck(this, CE);
|
|
1214
|
-
_defineProperty(this, "
|
|
1215
|
-
_defineProperty(this, "
|
|
1216
|
-
_defineProperty(this, "
|
|
1217
|
-
_defineProperty(this, "
|
|
1218
|
-
_defineProperty(this, "
|
|
1214
|
+
_defineProperty(this, "UcJD", false);
|
|
1215
|
+
_defineProperty(this, "hvcM", null);
|
|
1216
|
+
_defineProperty(this, "OfTR", getDateInDDMMYYYY());
|
|
1217
|
+
_defineProperty(this, "pcQK", new EventsListener());
|
|
1218
|
+
_defineProperty(this, "rtEJ", Apxor.getSiteId());
|
|
1219
1219
|
_defineProperty(this, "_qeState", {});
|
|
1220
1220
|
_defineProperty(this, "getQeState", function () {
|
|
1221
1221
|
try {
|
|
1222
1222
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1223
1223
|
if (data) {
|
|
1224
|
-
return JSON.parse(decode(_this.
|
|
1224
|
+
return JSON.parse(decode(_this.rtEJ, data));
|
|
1225
1225
|
} else {
|
|
1226
1226
|
_this._qeState = {};
|
|
1227
1227
|
return _this.setQeState();
|
|
@@ -1250,10 +1250,10 @@
|
|
|
1250
1250
|
return _this._qeState;
|
|
1251
1251
|
});
|
|
1252
1252
|
_defineProperty(this, "initialize", function () {
|
|
1253
|
-
if (!_this.
|
|
1254
|
-
_this.
|
|
1255
|
-
_this.
|
|
1256
|
-
_this.
|
|
1253
|
+
if (!_this.UcJD) {
|
|
1254
|
+
_this.UcJD = true;
|
|
1255
|
+
_this.hvcM = new ConfigLookup();
|
|
1256
|
+
_this.pcQK.initialize();
|
|
1257
1257
|
_this._qeState = _this.getQeState();
|
|
1258
1258
|
Logger$8.info("QE Initialized..");
|
|
1259
1259
|
}
|
|
@@ -1264,12 +1264,12 @@
|
|
|
1264
1264
|
* @param config
|
|
1265
1265
|
*/
|
|
1266
1266
|
_defineProperty(this, "parse", function (config) {
|
|
1267
|
-
if (!_this.
|
|
1267
|
+
if (!_this.ZzAy()) {
|
|
1268
1268
|
Logger$8.warn("Must call init first. Unable to proceed");
|
|
1269
1269
|
return;
|
|
1270
1270
|
}
|
|
1271
|
-
_this.
|
|
1272
|
-
_this.
|
|
1271
|
+
_this.hvcM.parse(config);
|
|
1272
|
+
_this.pcQK.xcoZ();
|
|
1273
1273
|
});
|
|
1274
1274
|
/**
|
|
1275
1275
|
* Validates all conditions for given config ID
|
|
@@ -1278,10 +1278,10 @@
|
|
|
1278
1278
|
* @param index
|
|
1279
1279
|
*/
|
|
1280
1280
|
_defineProperty(this, "validate", function (id, index) {
|
|
1281
|
-
if (!_this.
|
|
1281
|
+
if (!_this.ZzAy()) {
|
|
1282
1282
|
return;
|
|
1283
1283
|
}
|
|
1284
|
-
_this.
|
|
1284
|
+
_this.hvcM.validate(id, index);
|
|
1285
1285
|
});
|
|
1286
1286
|
_defineProperty(this, "updateCount", function (id) {
|
|
1287
1287
|
try {
|
|
@@ -1290,22 +1290,22 @@
|
|
|
1290
1290
|
}
|
|
1291
1291
|
_this.incrementFrequencies(id);
|
|
1292
1292
|
_this.setQeState(id);
|
|
1293
|
-
_this.
|
|
1293
|
+
_this.hvcM.IwRA(id);
|
|
1294
1294
|
} catch (e) {
|
|
1295
1295
|
console.log("Could not update the count config:".concat(e));
|
|
1296
1296
|
}
|
|
1297
1297
|
});
|
|
1298
1298
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1299
|
-
_this.
|
|
1299
|
+
_this.hvcM.resetFrequencyCounts();
|
|
1300
1300
|
});
|
|
1301
1301
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1302
|
-
return _this.
|
|
1302
|
+
return _this.hvcM.getFrequencyCount(id);
|
|
1303
1303
|
});
|
|
1304
1304
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1305
|
-
_this.
|
|
1305
|
+
_this.pcQK.Pdms(event, callback);
|
|
1306
1306
|
});
|
|
1307
1307
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1308
|
-
_this.
|
|
1308
|
+
_this.pcQK.unregisterFromEvent(event, callback);
|
|
1309
1309
|
});
|
|
1310
1310
|
/**
|
|
1311
1311
|
* Fetches the config from Server
|
|
@@ -1318,14 +1318,14 @@
|
|
|
1318
1318
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1319
1319
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1320
1320
|
});
|
|
1321
|
-
_defineProperty(this, "
|
|
1322
|
-
return _this.
|
|
1321
|
+
_defineProperty(this, "ZzAy", function () {
|
|
1322
|
+
return _this.UcJD;
|
|
1323
1323
|
});
|
|
1324
1324
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1325
|
-
return _this.
|
|
1325
|
+
return _this.hvcM.NrmJ(campaignId);
|
|
1326
1326
|
});
|
|
1327
|
-
_defineProperty(this, "
|
|
1328
|
-
return _this.
|
|
1327
|
+
_defineProperty(this, "PSuD", function () {
|
|
1328
|
+
return _this.OfTR;
|
|
1329
1329
|
});
|
|
1330
1330
|
if (!CE.instance) {
|
|
1331
1331
|
CE.instance = this;
|
|
@@ -1349,7 +1349,7 @@
|
|
|
1349
1349
|
OVERALL: 0,
|
|
1350
1350
|
DATES: {}
|
|
1351
1351
|
};
|
|
1352
|
-
if (this.
|
|
1352
|
+
if (this.OfTR) this._qeState[id].DATES[this.OfTR] = 0;
|
|
1353
1353
|
this.setQeState(id);
|
|
1354
1354
|
}
|
|
1355
1355
|
} catch (e) {
|
|
@@ -1368,12 +1368,12 @@
|
|
|
1368
1368
|
|
|
1369
1369
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1370
1370
|
var currentDate = getDateInDDMMYYYY();
|
|
1371
|
-
if (currentDate !== this.
|
|
1372
|
-
this.
|
|
1371
|
+
if (currentDate !== this.OfTR || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
1372
|
+
this.OfTR = currentDate;
|
|
1373
1373
|
configFrequency.DATES = {};
|
|
1374
|
-
configFrequency.DATES[this.
|
|
1374
|
+
configFrequency.DATES[this.OfTR] = 0;
|
|
1375
1375
|
}
|
|
1376
|
-
configFrequency.DATES[this.
|
|
1376
|
+
configFrequency.DATES[this.OfTR] = configFrequency.DATES[this.OfTR] + 1;
|
|
1377
1377
|
}
|
|
1378
1378
|
}], [{
|
|
1379
1379
|
key: "getInstance",
|
|
@@ -1392,7 +1392,7 @@
|
|
|
1392
1392
|
|
|
1393
1393
|
/* eslint-disable no-empty */
|
|
1394
1394
|
|
|
1395
|
-
window.ceVersion =
|
|
1395
|
+
window.ceVersion = 123;
|
|
1396
1396
|
try {
|
|
1397
1397
|
if (exports !== undefined || exports !== null) {
|
|
1398
1398
|
exports["default"] = CE;
|