apxor-qe 1.2.0 → 1.2.1
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, "ivYh", "ALL");
|
|
242
|
+
_defineProperty(this, "swAi", []);
|
|
243
|
+
_defineProperty(this, "Cgrz", []);
|
|
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.ivYh = config.audience.audience_type;
|
|
248
|
+
_this.swAi = config.audience.attributes.user;
|
|
249
|
+
_this.Cgrz = config.audience.attributes.session;
|
|
250
|
+
if (!Array.isArray(_this.swAi) || !Array.isArray(_this.Cgrz)) {
|
|
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.ivYh === "FTU") {
|
|
263
263
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
264
264
|
}
|
|
265
|
-
return status && _this.
|
|
265
|
+
return status && _this.aGEF(user, _this.swAi) && _this.aGEF(session, _this.Cgrz);
|
|
266
266
|
});
|
|
267
|
-
_defineProperty(this, "
|
|
267
|
+
_defineProperty(this, "aGEF", function (attributes, expected) {
|
|
268
268
|
var length = expected.length;
|
|
269
269
|
var status = true;
|
|
270
270
|
try {
|
|
@@ -315,34 +315,34 @@
|
|
|
315
315
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
316
316
|
var _this = this;
|
|
317
317
|
_classCallCheck(this, Frequency);
|
|
318
|
-
_defineProperty(this, "
|
|
319
|
-
_defineProperty(this, "
|
|
320
|
-
_defineProperty(this, "
|
|
321
|
-
_defineProperty(this, "
|
|
322
|
-
_defineProperty(this, "
|
|
323
|
-
_defineProperty(this, "
|
|
318
|
+
_defineProperty(this, "QbNu", 0);
|
|
319
|
+
_defineProperty(this, "Ahfz", 0);
|
|
320
|
+
_defineProperty(this, "LAYA", "SESSION");
|
|
321
|
+
_defineProperty(this, "BUyy", 0);
|
|
322
|
+
_defineProperty(this, "xPGq", 0);
|
|
323
|
+
_defineProperty(this, "jvRb", 0);
|
|
324
324
|
_defineProperty(this, "parse", function () {
|
|
325
325
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
326
326
|
try {
|
|
327
|
-
_this.
|
|
328
|
-
_this.
|
|
329
|
-
_this.
|
|
330
|
-
_this.
|
|
331
|
-
_this.
|
|
327
|
+
_this.QbNu = config.frequency.count;
|
|
328
|
+
_this.jvRb = _this.QbNu;
|
|
329
|
+
_this.Ahfz = config.frequency.time_interval;
|
|
330
|
+
_this.LAYA = config.frequency.validity;
|
|
331
|
+
_this.xPGq = config.frequency.ses_lmt;
|
|
332
332
|
_this._dayCount = config.frequency.day_lmt;
|
|
333
333
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
334
334
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
335
335
|
var qe_state = CE.getInstance().getQeState();
|
|
336
336
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
337
|
-
if (_this.
|
|
338
|
-
_this.
|
|
339
|
-
if (_this.
|
|
337
|
+
if (_this.LAYA === "SESSION") {
|
|
338
|
+
_this.QbNu = parseInt(_this.QbNu) - parseInt(qe_state[config._id]["SESSION"]);
|
|
339
|
+
if (_this.QbNu <= 0) {
|
|
340
340
|
console.warn("Max count limit reached for session:" + config._id);
|
|
341
341
|
return false;
|
|
342
342
|
}
|
|
343
|
-
} else if (_this.
|
|
344
|
-
_this.
|
|
345
|
-
if (_this.
|
|
343
|
+
} else if (_this.LAYA === "OVERALL") {
|
|
344
|
+
_this.QbNu = parseInt(_this.QbNu) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
345
|
+
if (_this.QbNu <= 0) {
|
|
346
346
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
347
347
|
return false;
|
|
348
348
|
}
|
|
@@ -356,28 +356,28 @@
|
|
|
356
356
|
}
|
|
357
357
|
return true;
|
|
358
358
|
});
|
|
359
|
-
_defineProperty(this, "
|
|
360
|
-
_this.
|
|
359
|
+
_defineProperty(this, "cnxa", function () {
|
|
360
|
+
_this.QbNu = _this.QbNu - 1;
|
|
361
361
|
});
|
|
362
362
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
363
|
-
return _this.
|
|
363
|
+
return _this.QbNu;
|
|
364
364
|
});
|
|
365
|
-
_defineProperty(this, "
|
|
366
|
-
if (_this.
|
|
367
|
-
_this.
|
|
365
|
+
_defineProperty(this, "zibq", function () {
|
|
366
|
+
if (_this.LAYA === "SESSION") {
|
|
367
|
+
_this.QbNu = _this.jvRb;
|
|
368
368
|
Logger$1.info("Campaign Limit reset");
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
/**
|
|
372
|
-
* @function
|
|
372
|
+
* @function Yfir
|
|
373
373
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
374
374
|
* @param {string} Config id
|
|
375
375
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
376
376
|
* false - Otherwise
|
|
377
377
|
*/
|
|
378
|
-
_defineProperty(this, "
|
|
378
|
+
_defineProperty(this, "Yfir", function (id) {
|
|
379
379
|
try {
|
|
380
|
-
if (_this.
|
|
380
|
+
if (_this.QbNu <= 0) {
|
|
381
381
|
return false;
|
|
382
382
|
}
|
|
383
383
|
|
|
@@ -388,8 +388,8 @@
|
|
|
388
388
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
389
389
|
|
|
390
390
|
//If the config has a session count limit set
|
|
391
|
-
if (_this.
|
|
392
|
-
var sessionCountInConfig = parseInt(_this.
|
|
391
|
+
if (_this.xPGq !== 0) {
|
|
392
|
+
var sessionCountInConfig = parseInt(_this.xPGq);
|
|
393
393
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
394
394
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
395
395
|
return false;
|
|
@@ -416,14 +416,14 @@
|
|
|
416
416
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
417
417
|
var _this = this;
|
|
418
418
|
_classCallCheck(this, Meta);
|
|
419
|
-
_defineProperty(this, "
|
|
420
|
-
_defineProperty(this, "
|
|
419
|
+
_defineProperty(this, "vaGr", "");
|
|
420
|
+
_defineProperty(this, "ivYh", "");
|
|
421
421
|
_defineProperty(this, "parse", function () {
|
|
422
422
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
423
423
|
try {
|
|
424
424
|
var _config$meta;
|
|
425
|
-
_this.
|
|
426
|
-
_this.
|
|
425
|
+
_this.vaGr = config.meta.name;
|
|
426
|
+
_this.ivYh = config.meta.type;
|
|
427
427
|
_this._only_context = config.meta.only_context;
|
|
428
428
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
429
429
|
} catch (error) {
|
|
@@ -438,11 +438,11 @@
|
|
|
438
438
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
439
439
|
var _this = this;
|
|
440
440
|
_classCallCheck(this, Validity);
|
|
441
|
-
_defineProperty(this, "
|
|
442
|
-
_defineProperty(this, "
|
|
443
|
-
_defineProperty(this, "
|
|
444
|
-
_defineProperty(this, "
|
|
445
|
-
_defineProperty(this, "
|
|
441
|
+
_defineProperty(this, "kvkt", -1);
|
|
442
|
+
_defineProperty(this, "lgIh", -1);
|
|
443
|
+
_defineProperty(this, "CYCz", -1);
|
|
444
|
+
_defineProperty(this, "Qhzg", -1);
|
|
445
|
+
_defineProperty(this, "qZSX", false);
|
|
446
446
|
_defineProperty(this, "parse", function () {
|
|
447
447
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
448
448
|
try {
|
|
@@ -450,17 +450,17 @@
|
|
|
450
450
|
Logger$2.error("Not valid dates");
|
|
451
451
|
return false;
|
|
452
452
|
}
|
|
453
|
-
_this.
|
|
454
|
-
_this.
|
|
453
|
+
_this.kvkt = Date.parse(config.validity.start_date);
|
|
454
|
+
_this.lgIh = Date.parse(config.validity.end_date);
|
|
455
455
|
if (isDefined(config.time_limits_in_day)) {
|
|
456
|
-
_this.
|
|
457
|
-
if (_this.
|
|
456
|
+
_this.qZSX = config.time_limits_in_day;
|
|
457
|
+
if (_this.qZSX && isDefined(config.time_limits)) {
|
|
458
458
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
459
|
-
_this.
|
|
460
|
-
_this.
|
|
459
|
+
_this.CYCz = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
|
|
460
|
+
_this.Qhzg = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
|
|
461
461
|
|
|
462
462
|
// If invalid format is passed, return false
|
|
463
|
-
if (isNaN(_this.
|
|
463
|
+
if (isNaN(_this.CYCz) || isNaN(_this.Qhzg)) {
|
|
464
464
|
Logger$2.error("Not valid times");
|
|
465
465
|
return false;
|
|
466
466
|
}
|
|
@@ -474,8 +474,8 @@
|
|
|
474
474
|
});
|
|
475
475
|
_defineProperty(this, "validate", function () {
|
|
476
476
|
var currentTime = Date.now();
|
|
477
|
-
if (currentTime > _this.
|
|
478
|
-
return !_this.
|
|
477
|
+
if (currentTime > _this.kvkt && currentTime < _this.lgIh) {
|
|
478
|
+
return !_this.qZSX || currentTime >= _this.CYCz && currentTime <= _this.Qhzg;
|
|
479
479
|
}
|
|
480
480
|
return false;
|
|
481
481
|
});
|
|
@@ -484,13 +484,13 @@
|
|
|
484
484
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
485
485
|
var _this = this;
|
|
486
486
|
_classCallCheck(this, Details);
|
|
487
|
-
_defineProperty(this, "
|
|
488
|
-
_defineProperty(this, "
|
|
487
|
+
_defineProperty(this, "vaGr", "");
|
|
488
|
+
_defineProperty(this, "xhRu", {});
|
|
489
489
|
_defineProperty(this, "parse", function () {
|
|
490
490
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
491
491
|
try {
|
|
492
|
-
_this.
|
|
493
|
-
_this.
|
|
492
|
+
_this.vaGr = details.name;
|
|
493
|
+
_this.xhRu = details.additional_info;
|
|
494
494
|
} catch (error) {
|
|
495
495
|
return false;
|
|
496
496
|
}
|
|
@@ -501,14 +501,14 @@
|
|
|
501
501
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
502
502
|
var _this = this;
|
|
503
503
|
_classCallCheck(this, Timebounds);
|
|
504
|
-
_defineProperty(this, "
|
|
505
|
-
_defineProperty(this, "
|
|
504
|
+
_defineProperty(this, "TNxD", 0);
|
|
505
|
+
_defineProperty(this, "kxyu", 0);
|
|
506
506
|
_defineProperty(this, "parse", function () {
|
|
507
507
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
508
508
|
try {
|
|
509
|
-
_this.
|
|
510
|
-
_this.
|
|
511
|
-
if (isNaN(_this.
|
|
509
|
+
_this.TNxD = Number(timeBounds.lower);
|
|
510
|
+
_this.kxyu = Number(timeBounds.upper);
|
|
511
|
+
if (isNaN(_this.TNxD) || isNaN(_this.kxyu)) {
|
|
512
512
|
return false;
|
|
513
513
|
}
|
|
514
514
|
} catch (error) {
|
|
@@ -521,17 +521,17 @@
|
|
|
521
521
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
522
522
|
var _this = this;
|
|
523
523
|
_classCallCheck(this, PreCondition);
|
|
524
|
-
_defineProperty(this, "
|
|
525
|
-
_defineProperty(this, "
|
|
526
|
-
_defineProperty(this, "
|
|
527
|
-
_defineProperty(this, "
|
|
528
|
-
_defineProperty(this, "
|
|
524
|
+
_defineProperty(this, "zXLB", 0);
|
|
525
|
+
_defineProperty(this, "VlYY", "");
|
|
526
|
+
_defineProperty(this, "SiPE", "");
|
|
527
|
+
_defineProperty(this, "ScWj", new Details());
|
|
528
|
+
_defineProperty(this, "eLLb", new Timebounds());
|
|
529
529
|
_defineProperty(this, "parse", function () {
|
|
530
530
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
531
531
|
try {
|
|
532
|
-
_this.
|
|
533
|
-
_this.
|
|
534
|
-
return _this.
|
|
532
|
+
_this.VlYY = precondition.event_type;
|
|
533
|
+
_this.SiPE = precondition.activity;
|
|
534
|
+
return _this.ScWj.parse(precondition.details) && _this.eLLb.parse(precondition.time_bounds);
|
|
535
535
|
} catch (error) {
|
|
536
536
|
return false;
|
|
537
537
|
}
|
|
@@ -542,29 +542,29 @@
|
|
|
542
542
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
543
543
|
var _this = this;
|
|
544
544
|
_classCallCheck(this, Condition);
|
|
545
|
-
_defineProperty(this, "
|
|
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, "
|
|
545
|
+
_defineProperty(this, "zXLB", 0);
|
|
546
|
+
_defineProperty(this, "GiHC", -1);
|
|
547
|
+
_defineProperty(this, "QbNu", 0);
|
|
548
|
+
_defineProperty(this, "Gpim", "");
|
|
549
|
+
_defineProperty(this, "SiPE", "");
|
|
550
|
+
_defineProperty(this, "VlYY", "");
|
|
551
|
+
_defineProperty(this, "eLLb", new Timebounds());
|
|
552
|
+
_defineProperty(this, "ScWj", new Details());
|
|
553
|
+
_defineProperty(this, "GiPO", new PreCondition());
|
|
554
|
+
_defineProperty(this, "SIXE", "AND");
|
|
555
|
+
_defineProperty(this, "fJlK", false);
|
|
556
|
+
_defineProperty(this, "ivYh", void 0);
|
|
557
557
|
_defineProperty(this, "parse", function () {
|
|
558
558
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
559
559
|
try {
|
|
560
|
-
_this.
|
|
561
|
-
_this.
|
|
562
|
-
_this.
|
|
563
|
-
_this.
|
|
564
|
-
_this.
|
|
565
|
-
_this.
|
|
566
|
-
_this.
|
|
567
|
-
return _this.
|
|
560
|
+
_this.GiHC = condition.sequence;
|
|
561
|
+
_this.QbNu = condition.count_config.count;
|
|
562
|
+
_this.Gpim = condition.count_config.operator;
|
|
563
|
+
_this.SiPE = condition.activity;
|
|
564
|
+
_this.VlYY = condition.event_type;
|
|
565
|
+
_this.SIXE = condition.combine_operator;
|
|
566
|
+
_this.ivYh = condition.type;
|
|
567
|
+
return _this.ScWj.parse(condition.details) && _this.GiPO.parse(condition.trigger) && _this.eLLb.parse(condition.time_bounds);
|
|
568
568
|
} catch (error) {
|
|
569
569
|
Logger$3.error(error);
|
|
570
570
|
return false;
|
|
@@ -578,19 +578,19 @@
|
|
|
578
578
|
function ConditionValidator() {
|
|
579
579
|
var _this = this;
|
|
580
580
|
_classCallCheck(this, ConditionValidator);
|
|
581
|
-
_defineProperty(this, "
|
|
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, "
|
|
581
|
+
_defineProperty(this, "WuXg", 0);
|
|
582
|
+
_defineProperty(this, "VZgC", "");
|
|
583
|
+
_defineProperty(this, "jrHz", new Condition());
|
|
584
|
+
_defineProperty(this, "HpgP", false);
|
|
585
|
+
_defineProperty(this, "jNsl", false);
|
|
586
|
+
_defineProperty(this, "pyWB", 0);
|
|
587
|
+
_defineProperty(this, "SIXE", "AND");
|
|
588
|
+
_defineProperty(this, "NQJv", -1);
|
|
589
|
+
_defineProperty(this, "lQVv", []);
|
|
590
|
+
_defineProperty(this, "lajT", {});
|
|
591
|
+
_defineProperty(this, "TgUk", false);
|
|
592
592
|
/**
|
|
593
|
-
* If respectSequence is true, don't auto-
|
|
593
|
+
* If respectSequence is true, don't auto-jirn to events except for the condition whose index is 0
|
|
594
594
|
*
|
|
595
595
|
* @param condition
|
|
596
596
|
* @param type
|
|
@@ -605,155 +605,155 @@
|
|
|
605
605
|
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
606
606
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
607
607
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
608
|
-
_this.
|
|
609
|
-
_this.
|
|
610
|
-
_this.
|
|
611
|
-
var result = _this.
|
|
608
|
+
_this.VZgC = id;
|
|
609
|
+
_this.pyWB = index;
|
|
610
|
+
_this.lQVv = noKpiArray;
|
|
611
|
+
var result = _this.jrHz.parse(condition);
|
|
612
612
|
if (result) {
|
|
613
|
-
_this.
|
|
613
|
+
_this.SIXE = _this.jrHz.SIXE;
|
|
614
614
|
|
|
615
615
|
// FIXME: Why this code is written? Don't see any usecase
|
|
616
|
-
if (_this.
|
|
617
|
-
var eventName = _this.
|
|
616
|
+
if (_this.jrHz.fJlK) {
|
|
617
|
+
var eventName = _this.jrHz.ScWj.vaGr;
|
|
618
618
|
if (eventName === "APX_PAGE_OPENED") {
|
|
619
|
-
eventName = _this.
|
|
620
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
619
|
+
eventName = _this.jrHz.ScWj.xhRu["navigation_id"];
|
|
620
|
+
eventName = isDefined(eventName) ? eventName : _this.jrHz.ScWj.vaGr;
|
|
621
621
|
}
|
|
622
|
-
_this.
|
|
623
|
-
var count = _this.
|
|
624
|
-
var operator = _this.
|
|
625
|
-
_this.
|
|
626
|
-
_this.
|
|
627
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
622
|
+
_this.NQJv = Apxor.getController().getEventCount(eventName);
|
|
623
|
+
var count = _this.jrHz.QbNu;
|
|
624
|
+
var operator = _this.jrHz.Gpim;
|
|
625
|
+
_this.jNsl = _this.HeFJ(_this.NQJv - 1, count, operator, false);
|
|
626
|
+
_this.HpgP = _this.jNsl;
|
|
627
|
+
// If the condition is already satisfied and if it is page view, no need to jirn
|
|
628
628
|
// This only applies for NAVIGATION_EVENTS
|
|
629
|
-
if (_this.
|
|
629
|
+
if (_this.jNsl && _this.jrHz.ScWj.vaGr === "APX_PAGE_OPENED") {
|
|
630
630
|
return true;
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
if (!respectSequence || index === 0) {
|
|
634
|
-
_this.
|
|
634
|
+
_this.jirn();
|
|
635
635
|
}
|
|
636
636
|
return true;
|
|
637
637
|
}
|
|
638
638
|
return false;
|
|
639
639
|
});
|
|
640
|
-
_defineProperty(this, "
|
|
641
|
-
var condition = _this.
|
|
642
|
-
var precondition = condition.
|
|
640
|
+
_defineProperty(this, "jirn", function () {
|
|
641
|
+
var condition = _this.jrHz;
|
|
642
|
+
var precondition = condition.GiPO;
|
|
643
643
|
var ceInstance = CE.getInstance();
|
|
644
|
-
if (precondition.
|
|
645
|
-
_this.
|
|
646
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
644
|
+
if (precondition.VlYY === "app_start") {
|
|
645
|
+
_this.HpgP = true;
|
|
646
|
+
ceInstance.registerForEvent(generateKey(condition.VlYY) + "___" + condition.ScWj.vaGr, _this.yfLP);
|
|
647
647
|
} else {
|
|
648
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
648
|
+
ceInstance.registerForEvent(generateKey(condition.VlYY) + "___" + precondition.ScWj.vaGr, _this.yfLP);
|
|
649
649
|
}
|
|
650
650
|
});
|
|
651
|
-
_defineProperty(this, "
|
|
652
|
-
var _this$
|
|
651
|
+
_defineProperty(this, "vMTP", function (type, name, time, additionalInfo) {
|
|
652
|
+
var _this$jrHz, _this$jrHz$_det, _this$jrHz$_det2;
|
|
653
653
|
var eventTime = Date.now();
|
|
654
|
-
var time_differnce = (eventTime - _this.
|
|
655
|
-
var time_fromConfig = ((_this$
|
|
654
|
+
var time_differnce = (eventTime - _this.lajT[name]) / 1000;
|
|
655
|
+
var time_fromConfig = ((_this$jrHz = _this.jrHz) === null || _this$jrHz === void 0 ? void 0 : (_this$jrHz$_det = _this$jrHz.ScWj) === null || _this$jrHz$_det === void 0 ? void 0 : (_this$jrHz$_det2 = _this$jrHz$_det.xhRu) === null || _this$jrHz$_det2 === void 0 ? void 0 : _this$jrHz$_det2.time) / 1000;
|
|
656
656
|
if (time_fromConfig > time_differnce) {
|
|
657
657
|
_this._displayCampaign(time);
|
|
658
658
|
}
|
|
659
659
|
});
|
|
660
|
-
_defineProperty(this, "
|
|
660
|
+
_defineProperty(this, "xJxT", function (type, name, time, additionalInfo) {
|
|
661
661
|
var _this$_condition2, _this$_condition2$_pr, _this$_condition3, _this$_condition3$_de, _this$_condition3$_de2;
|
|
662
|
-
_this.
|
|
662
|
+
_this.TgUk = true;
|
|
663
663
|
var currentTime = Date.now();
|
|
664
|
-
var eventName = (_this$_condition2 = _this.
|
|
665
|
-
var eventTime = _this.
|
|
664
|
+
var eventName = (_this$_condition2 = _this.jrHz) === null || _this$_condition2 === void 0 ? void 0 : (_this$_condition2$_pr = _this$_condition2.GiPO) === null || _this$_condition2$_pr === void 0 ? void 0 : _this$_condition2$_pr.ScWj.vaGr;
|
|
665
|
+
var eventTime = _this.lajT[eventName];
|
|
666
666
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
667
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
667
|
+
var time_fromConfig = (_this$_condition3 = _this.jrHz) === null || _this$_condition3 === void 0 ? void 0 : (_this$_condition3$_de = _this$_condition3.ScWj) === null || _this$_condition3$_de === void 0 ? void 0 : (_this$_condition3$_de2 = _this$_condition3$_de.xhRu) === null || _this$_condition3$_de2 === void 0 ? void 0 : _this$_condition3$_de2.time;
|
|
668
668
|
time_fromConfig = time_fromConfig / 1000;
|
|
669
669
|
if (time_fromConfig > time_differnce) {
|
|
670
670
|
_this._displayCampaign(time);
|
|
671
671
|
}
|
|
672
672
|
//unregister the event
|
|
673
673
|
});
|
|
674
|
-
_defineProperty(this, "
|
|
674
|
+
_defineProperty(this, "yfLP", function (type, name, time, additionalInfo) {
|
|
675
675
|
var ceInstance = CE.getInstance();
|
|
676
|
-
if (!_this.
|
|
676
|
+
if (!_this.HpgP) {
|
|
677
677
|
// Validate Precondition
|
|
678
|
-
_this.
|
|
679
|
-
if (_this.
|
|
680
|
-
var condition = _this.
|
|
681
|
-
var precondition = condition.
|
|
682
|
-
precondition.
|
|
678
|
+
_this.HpgP = _this.XLRj(type, name, time, additionalInfo);
|
|
679
|
+
if (_this.HpgP) {
|
|
680
|
+
var condition = _this.jrHz;
|
|
681
|
+
var precondition = condition.GiPO;
|
|
682
|
+
precondition.zXLB = time;
|
|
683
683
|
//events will be registred by its type activity event_type: "activity_time"
|
|
684
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
685
|
-
var
|
|
686
|
-
var event_time = condition === null || condition === void 0 ? void 0 : (
|
|
687
|
-
if ((condition === null || condition === void 0 ? void 0 : (
|
|
684
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.VlYY) === "activity_time") {
|
|
685
|
+
var jrHz$ScWj, jrHz$ScWj$_, jrHz$_details2, jrHz$_details2$, jrHz$_details3, jrHz$_details3$;
|
|
686
|
+
var event_time = condition === null || condition === void 0 ? void 0 : (jrHz$ScWj = condition.ScWj) === null || jrHz$ScWj === void 0 ? void 0 : (jrHz$ScWj$_ = jrHz$ScWj.xhRu) === null || jrHz$ScWj$_ === void 0 ? void 0 : jrHz$ScWj$_.time;
|
|
687
|
+
if ((condition === null || condition === void 0 ? void 0 : (jrHz$_details2 = condition.ScWj) === null || jrHz$_details2 === void 0 ? void 0 : (jrHz$_details2$ = jrHz$_details2.xhRu) === null || jrHz$_details2$ === void 0 ? void 0 : jrHz$_details2$.nkpi.length) > 0) {
|
|
688
688
|
setTimeout(function () {
|
|
689
|
-
if (!_this.
|
|
690
|
-
_this.
|
|
691
|
-
if (_this.
|
|
692
|
-
_this.
|
|
693
|
-
_this.
|
|
694
|
-
if (_this.
|
|
695
|
-
_this.
|
|
696
|
-
ceInstance.validate(_this.
|
|
689
|
+
if (!_this.TgUk) {
|
|
690
|
+
_this.jNsl = true;
|
|
691
|
+
if (_this.jNsl) {
|
|
692
|
+
_this.WuXg += 1;
|
|
693
|
+
_this.jNsl = _this.HeFJ(_this.WuXg, _this.jrHz.QbNu, _this.jrHz.Gpim);
|
|
694
|
+
if (_this.jNsl) {
|
|
695
|
+
_this.jrHz.zXLB = time;
|
|
696
|
+
ceInstance.validate(_this.VZgC, _this.pyWB);
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
condition.
|
|
701
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
700
|
+
condition.ScWj.xhRu.nkpi.map(function (nokpi) {
|
|
701
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.ScWj.xhRu.et) + "___" + nokpi, _this);
|
|
702
702
|
});
|
|
703
703
|
}, event_time);
|
|
704
|
-
condition.
|
|
705
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
704
|
+
condition.ScWj.xhRu.nkpi.map(function (nokpi) {
|
|
705
|
+
ceInstance.registerForEvent(toUpperCase(condition.ScWj.xhRu.et) + "___" + nokpi, _this.xJxT);
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
708
|
//it is for unregistering the events did case after completing the time imit
|
|
709
|
-
if ((condition === null || condition === void 0 ? void 0 : (
|
|
709
|
+
if ((condition === null || condition === void 0 ? void 0 : (jrHz$_details3 = condition.ScWj) === null || jrHz$_details3 === void 0 ? void 0 : (jrHz$_details3$ = jrHz$_details3.xhRu) === null || jrHz$_details3$ === void 0 ? void 0 : jrHz$_details3$.kpi.length) > 0) {
|
|
710
710
|
setTimeout(function () {
|
|
711
|
-
condition.
|
|
712
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
711
|
+
condition.ScWj.xhRu.kpi.map(function (kpi) {
|
|
712
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.ScWj.xhRu.et) + "___" + kpi, _this);
|
|
713
713
|
});
|
|
714
714
|
}, event_time);
|
|
715
|
-
condition.
|
|
716
|
-
if (kpi === condition.
|
|
715
|
+
condition.ScWj.xhRu.kpi.map(function (kpi) {
|
|
716
|
+
if (kpi === condition.GiPO.ScWj.vaGr) {
|
|
717
717
|
//unregister the previous event
|
|
718
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
719
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
718
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.VlYY) + "___" + precondition.ScWj.vaGr, _this);
|
|
719
|
+
ceInstance.registerForEvent(toUpperCase(condition.ScWj.xhRu.et) + "___" + kpi, _this.vMTP);
|
|
720
720
|
} else {
|
|
721
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
721
|
+
ceInstance.registerForEvent(toUpperCase(condition.ScWj.xhRu.et) + "___" + kpi, _this.xJxT);
|
|
722
722
|
}
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
725
|
} else {
|
|
726
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
727
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
726
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.VlYY) + "___" + precondition.ScWj.vaGr, _this);
|
|
727
|
+
ceInstance.registerForEvent(generateKey(condition.VlYY) + "___" + condition.ScWj.vaGr, _this);
|
|
728
728
|
}
|
|
729
|
-
_this.
|
|
729
|
+
_this.lajT[name] = Date.now();
|
|
730
730
|
}
|
|
731
731
|
return;
|
|
732
732
|
}
|
|
733
733
|
|
|
734
734
|
// Validate Condition
|
|
735
|
-
var validationStatus = generateKey(_this.
|
|
735
|
+
var validationStatus = generateKey(_this.jrHz.VlYY) === type && _this.VwBV(time - _this.jrHz.GiPO.zXLB, _this.jrHz.eLLb) && _this.jrHz.ScWj.vaGr === name && _this.ltAR(_this.jrHz.ScWj.xhRu, additionalInfo);
|
|
736
736
|
if (validationStatus) {
|
|
737
|
-
_this.
|
|
738
|
-
_this.
|
|
739
|
-
if (_this.
|
|
740
|
-
_this.
|
|
741
|
-
ceInstance.validate(_this.
|
|
737
|
+
_this.WuXg += 1;
|
|
738
|
+
_this.jNsl = _this.HeFJ(_this.WuXg, _this.jrHz.QbNu, _this.jrHz.Gpim);
|
|
739
|
+
if (_this.jNsl) {
|
|
740
|
+
_this.jrHz.zXLB = time;
|
|
741
|
+
ceInstance.validate(_this.VZgC, _this.pyWB);
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
});
|
|
745
|
-
_defineProperty(this, "
|
|
746
|
-
var precondition = _this.
|
|
747
|
-
return generateKey(precondition.
|
|
745
|
+
_defineProperty(this, "XLRj", function (type, name, time, additionalInfo) {
|
|
746
|
+
var precondition = _this.jrHz.GiPO;
|
|
747
|
+
return generateKey(precondition.VlYY) === type && precondition.ScWj.vaGr === name && _this.VwBV(time, precondition.eLLb) && _this.ltAR(precondition.ScWj.xhRu, additionalInfo);
|
|
748
748
|
});
|
|
749
|
-
_defineProperty(this, "
|
|
749
|
+
_defineProperty(this, "VwBV", function (time, timeBounds) {
|
|
750
750
|
var currentTime = Math.ceil(time);
|
|
751
|
-
return currentTime > timeBounds.
|
|
751
|
+
return currentTime > timeBounds.TNxD && currentTime < timeBounds.kxyu;
|
|
752
752
|
});
|
|
753
|
-
_defineProperty(this, "
|
|
753
|
+
_defineProperty(this, "HeFJ", function (current, required, operator) {
|
|
754
754
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
755
|
-
if (checkOld && _this.
|
|
756
|
-
current = current + _this.
|
|
755
|
+
if (checkOld && _this.jrHz.fJlK) {
|
|
756
|
+
current = current + _this.NQJv;
|
|
757
757
|
}
|
|
758
758
|
switch (operator) {
|
|
759
759
|
case "EQ":
|
|
@@ -770,7 +770,7 @@
|
|
|
770
770
|
return false;
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
|
-
_defineProperty(this, "
|
|
773
|
+
_defineProperty(this, "ltAR", function (expected, received) {
|
|
774
774
|
var status = true;
|
|
775
775
|
try {
|
|
776
776
|
var _loop = function _loop() {
|
|
@@ -817,13 +817,13 @@
|
|
|
817
817
|
key: "_displayCampaign",
|
|
818
818
|
value: function _displayCampaign(time) {
|
|
819
819
|
var ceInstance = CE.getInstance();
|
|
820
|
-
this.
|
|
821
|
-
if (this.
|
|
822
|
-
this.
|
|
823
|
-
this.
|
|
824
|
-
if (this.
|
|
825
|
-
this.
|
|
826
|
-
ceInstance.validate(this.
|
|
820
|
+
this.jNsl = true;
|
|
821
|
+
if (this.jNsl) {
|
|
822
|
+
this.WuXg += 1;
|
|
823
|
+
this.jNsl = this.HeFJ(this.WuXg, this.jrHz.QbNu, this.jrHz.Gpim);
|
|
824
|
+
if (this.jNsl) {
|
|
825
|
+
this.jrHz.zXLB = time;
|
|
826
|
+
ceInstance.validate(this.VZgC, this.pyWB);
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
829
|
}
|
|
@@ -840,20 +840,20 @@
|
|
|
840
840
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
841
841
|
var _this = this;
|
|
842
842
|
_classCallCheck(this, OverallConfig);
|
|
843
|
-
_defineProperty(this, "
|
|
843
|
+
_defineProperty(this, "sZzG", []);
|
|
844
844
|
_defineProperty(this, "_ret_day", {});
|
|
845
|
-
_defineProperty(this, "
|
|
846
|
-
_defineProperty(this, "
|
|
847
|
-
_defineProperty(this, "
|
|
845
|
+
_defineProperty(this, "Xzos", {});
|
|
846
|
+
_defineProperty(this, "oFUv", false);
|
|
847
|
+
_defineProperty(this, "UFdW", false);
|
|
848
848
|
_defineProperty(this, "parse", function () {
|
|
849
849
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
850
850
|
try {
|
|
851
|
-
_this.
|
|
851
|
+
_this.sZzG = config.overall_cfg.events;
|
|
852
852
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
853
|
-
_this.
|
|
854
|
-
_this.
|
|
855
|
-
_this.
|
|
856
|
-
_this.
|
|
853
|
+
_this.Xzos = config.overall_cfg.session;
|
|
854
|
+
_this.oFUv = config.overall_cfg.toggleRetDay;
|
|
855
|
+
_this.sZzG = config.overall_cfg.events;
|
|
856
|
+
_this.UFdW = config.overall_cfg.toggleSession;
|
|
857
857
|
} catch (error) {
|
|
858
858
|
Logger$5.error(error);
|
|
859
859
|
return false;
|
|
@@ -863,10 +863,10 @@
|
|
|
863
863
|
_defineProperty(this, "validate", function () {
|
|
864
864
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
865
865
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
866
|
-
if (_this.
|
|
866
|
+
if (_this.oFUv && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
867
867
|
return false;
|
|
868
868
|
}
|
|
869
|
-
if (_this.
|
|
869
|
+
if (_this.UFdW && !isNaN(retainedSession) && !(retainedSession >= _this.Xzos.from && retainedSession <= _this.Xzos.to)) {
|
|
870
870
|
return false;
|
|
871
871
|
}
|
|
872
872
|
try {
|
|
@@ -874,8 +874,8 @@
|
|
|
874
874
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
875
875
|
var siteid = Apxor.getSiteId();
|
|
876
876
|
var LtCountObjDecoded = JSON.parse(decode(siteid, data));
|
|
877
|
-
for (var i = 0; i < _this.
|
|
878
|
-
var evName = _this.
|
|
877
|
+
for (var i = 0; i < _this.sZzG.length; i++) {
|
|
878
|
+
var evName = _this.sZzG[i].name.replace("'", "").replace("’", "");
|
|
879
879
|
if (LtCountObjDecoded[evName]) {
|
|
880
880
|
return false;
|
|
881
881
|
}
|
|
@@ -891,15 +891,15 @@
|
|
|
891
891
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
892
892
|
var _this = this;
|
|
893
893
|
_classCallCheck(this, ConfigItem);
|
|
894
|
-
_defineProperty(this, "
|
|
895
|
-
_defineProperty(this, "
|
|
896
|
-
_defineProperty(this, "
|
|
897
|
-
_defineProperty(this, "
|
|
898
|
-
_defineProperty(this, "
|
|
899
|
-
_defineProperty(this, "
|
|
900
|
-
_defineProperty(this, "
|
|
901
|
-
_defineProperty(this, "
|
|
902
|
-
_defineProperty(this, "
|
|
894
|
+
_defineProperty(this, "oaNf", []);
|
|
895
|
+
_defineProperty(this, "VZgC", "");
|
|
896
|
+
_defineProperty(this, "HSbO", new Meta());
|
|
897
|
+
_defineProperty(this, "ougI", new Audience());
|
|
898
|
+
_defineProperty(this, "LAYA", new Validity());
|
|
899
|
+
_defineProperty(this, "NJhT", new Frequency());
|
|
900
|
+
_defineProperty(this, "FIof", new OverallConfig());
|
|
901
|
+
_defineProperty(this, "xPmO", false);
|
|
902
|
+
_defineProperty(this, "GmJY", []);
|
|
903
903
|
_defineProperty(this, "parse", function () {
|
|
904
904
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
905
905
|
try {
|
|
@@ -916,7 +916,7 @@
|
|
|
916
916
|
}
|
|
917
917
|
|
|
918
918
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
919
|
-
if (!(_this.
|
|
919
|
+
if (!(_this.HSbO.parse(config) && _this.LAYA.parse(config) && _this.NJhT.parse(config) && _this.ougI.parse(config) && _this.FIof.parse(config))) {
|
|
920
920
|
return false;
|
|
921
921
|
}
|
|
922
922
|
|
|
@@ -925,9 +925,9 @@
|
|
|
925
925
|
Logger$6.error("No valid conditions", config.conditions);
|
|
926
926
|
return false;
|
|
927
927
|
}
|
|
928
|
-
_this.
|
|
929
|
-
_this.
|
|
930
|
-
if (_this.
|
|
928
|
+
_this.VZgC = config._id;
|
|
929
|
+
_this.xPmO = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
930
|
+
if (_this.xPmO) {
|
|
931
931
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
932
932
|
// We need to sort, if server sends them in orderless manner
|
|
933
933
|
config.conditions.sort(function (prev, current) {
|
|
@@ -939,17 +939,17 @@
|
|
|
939
939
|
var conditions = config.conditions;
|
|
940
940
|
var length = conditions.length;
|
|
941
941
|
for (var index = 0; index < length; index++) {
|
|
942
|
-
_this.
|
|
942
|
+
_this.GmJY = [];
|
|
943
943
|
var condition = conditions[index];
|
|
944
944
|
if (condition.type === "didn't") {
|
|
945
|
-
var
|
|
945
|
+
var jrHz$details, jrHz$details$ad;
|
|
946
946
|
var obj = {
|
|
947
947
|
trigger_key: condition.trigger.details.name,
|
|
948
|
-
no_kpi_array: condition === null || condition === void 0 ? void 0 : (
|
|
948
|
+
no_kpi_array: condition === null || condition === void 0 ? void 0 : (jrHz$details = condition.details) === null || jrHz$details === void 0 ? void 0 : (jrHz$details$ad = jrHz$details.additional_info) === null || jrHz$details$ad === void 0 ? void 0 : jrHz$details$ad.nkpi,
|
|
949
949
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
950
950
|
time_bounds: condition.time_bounds.upper
|
|
951
951
|
};
|
|
952
|
-
_this.
|
|
952
|
+
_this.GmJY = [].concat(_toConsumableArray(_this.GmJY), [obj]);
|
|
953
953
|
//this will be the key
|
|
954
954
|
//when event occur check this array and then then check the time
|
|
955
955
|
//check the time diffrence
|
|
@@ -958,57 +958,57 @@
|
|
|
958
958
|
}
|
|
959
959
|
|
|
960
960
|
var conditionValidator = new ConditionValidator();
|
|
961
|
-
if (conditionValidator.initialize(condition, _this.
|
|
962
|
-
_this.
|
|
961
|
+
if (conditionValidator.initialize(condition, _this.VZgC, index, _this.xPmO, _this.GmJY)) {
|
|
962
|
+
_this.oaNf.push(conditionValidator);
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
return _this.
|
|
965
|
+
return _this.oaNf.length > 0;
|
|
966
966
|
} catch (error) {
|
|
967
967
|
Logger$6.error(error);
|
|
968
968
|
return false;
|
|
969
969
|
}
|
|
970
970
|
});
|
|
971
|
-
_defineProperty(this, "
|
|
971
|
+
_defineProperty(this, "GBBl", function (index) {
|
|
972
972
|
if (index < 0) {
|
|
973
973
|
return;
|
|
974
974
|
}
|
|
975
|
-
if (_this.
|
|
976
|
-
var conditionValidator = _this.
|
|
977
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
975
|
+
if (_this.xPmO) {
|
|
976
|
+
var conditionValidator = _this.oaNf[index];
|
|
977
|
+
if (isDefined(conditionValidator) && conditionValidator.jNsl) {
|
|
978
978
|
// Check if previous validator is satisfied
|
|
979
|
-
var prevValidator = _this.
|
|
980
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
979
|
+
var prevValidator = _this.oaNf[index - 1];
|
|
980
|
+
if (isDefined(prevValidator) && !prevValidator.jNsl) {
|
|
981
981
|
// TODO: If current index is satisfied before previous one, do something
|
|
982
982
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
983
983
|
return;
|
|
984
984
|
}
|
|
985
|
-
var nextValidator = _this.
|
|
985
|
+
var nextValidator = _this.oaNf[index + 1];
|
|
986
986
|
if (!isDefined(nextValidator)) {
|
|
987
987
|
// It means this is the last condition
|
|
988
988
|
// Validate all conditions
|
|
989
|
-
_this.
|
|
989
|
+
_this.Bmfx();
|
|
990
990
|
} else {
|
|
991
|
-
nextValidator.
|
|
991
|
+
nextValidator.jirn();
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
994
|
} else {
|
|
995
995
|
// Validate all conditions
|
|
996
|
-
_this.
|
|
996
|
+
_this.Bmfx();
|
|
997
997
|
}
|
|
998
998
|
});
|
|
999
|
-
_defineProperty(this, "
|
|
999
|
+
_defineProperty(this, "Bmfx", function () {
|
|
1000
1000
|
// Check If Audience, Validity is satisfied or not
|
|
1001
1001
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1002
1002
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1003
|
-
if (!_this.
|
|
1003
|
+
if (!_this.LAYA.validate() || !_this.ougI.validate(userAttributes, sessionAttributes) || !_this.FIof.validate()) {
|
|
1004
1004
|
return;
|
|
1005
1005
|
}
|
|
1006
|
-
var length = _this.
|
|
1006
|
+
var length = _this.oaNf.length;
|
|
1007
1007
|
var isSatisfied = length < 1;
|
|
1008
1008
|
var combineOperator = "";
|
|
1009
1009
|
for (var index = 0; index < length; index++) {
|
|
1010
|
-
var validator = _this.
|
|
1011
|
-
var currentResult = validator.
|
|
1010
|
+
var validator = _this.oaNf[index];
|
|
1011
|
+
var currentResult = validator.jNsl;
|
|
1012
1012
|
if (combineOperator.trim() === "") {
|
|
1013
1013
|
isSatisfied = currentResult;
|
|
1014
1014
|
} else {
|
|
@@ -1021,47 +1021,47 @@
|
|
|
1021
1021
|
break;
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
combineOperator = validator.
|
|
1024
|
+
combineOperator = validator.SIXE;
|
|
1025
1025
|
}
|
|
1026
1026
|
if (isSatisfied) {
|
|
1027
1027
|
console.debug("onCondition satisfied");
|
|
1028
1028
|
// Check if count reached it's maximum
|
|
1029
|
-
if (!_this.
|
|
1030
|
-
console.warn("Maximum limit reached", _this.
|
|
1029
|
+
if (!_this.NJhT.Yfir(_this.VZgC)) {
|
|
1030
|
+
console.warn("Maximum limit reached", _this.VZgC);
|
|
1031
1031
|
return;
|
|
1032
1032
|
}
|
|
1033
|
-
console.log("Dispatching event", _this.
|
|
1034
|
-
if (_this.
|
|
1035
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1036
|
-
message_name: _this.
|
|
1037
|
-
id: _this.
|
|
1033
|
+
console.log("Dispatching event", _this.HSbO.ivYh);
|
|
1034
|
+
if (_this.HSbO._only_context === true) {
|
|
1035
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.HSbO._attr), {}, {
|
|
1036
|
+
message_name: _this.HSbO.vaGr,
|
|
1037
|
+
id: _this.VZgC
|
|
1038
1038
|
}));
|
|
1039
1039
|
}
|
|
1040
1040
|
// Emit event
|
|
1041
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1042
|
-
name: _this.
|
|
1041
|
+
Apxor.getController().dispatchEvent(_this.HSbO.ivYh, {
|
|
1042
|
+
name: _this.HSbO.ivYh,
|
|
1043
1043
|
additional_info: {
|
|
1044
|
-
uuid: _this.
|
|
1045
|
-
name: _this.
|
|
1044
|
+
uuid: _this.VZgC,
|
|
1045
|
+
name: _this.HSbO.vaGr
|
|
1046
1046
|
}
|
|
1047
1047
|
});
|
|
1048
1048
|
}
|
|
1049
1049
|
});
|
|
1050
|
-
_defineProperty(this, "
|
|
1051
|
-
_this.
|
|
1050
|
+
_defineProperty(this, "cnxa", function () {
|
|
1051
|
+
_this.NJhT.cnxa();
|
|
1052
1052
|
});
|
|
1053
1053
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1054
|
-
return _this.
|
|
1054
|
+
return _this.NJhT.getFrequencyCount();
|
|
1055
1055
|
});
|
|
1056
|
-
_defineProperty(this, "
|
|
1057
|
-
return _this.
|
|
1056
|
+
_defineProperty(this, "NFqM", function () {
|
|
1057
|
+
return _this.NJhT.zibq();
|
|
1058
1058
|
});
|
|
1059
1059
|
});
|
|
1060
1060
|
|
|
1061
1061
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1062
1062
|
var _this = this;
|
|
1063
1063
|
_classCallCheck(this, ConfigLookup);
|
|
1064
|
-
_defineProperty(this, "
|
|
1064
|
+
_defineProperty(this, "lljB", {});
|
|
1065
1065
|
_defineProperty(this, "parse", function () {
|
|
1066
1066
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1067
1067
|
configs: []
|
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
var configId = _config._id;
|
|
1085
1085
|
var configItem = new ConfigItem();
|
|
1086
1086
|
if (configItem.parse(_config)) {
|
|
1087
|
-
_this.
|
|
1087
|
+
_this.lljB[configId] = configItem;
|
|
1088
1088
|
} else {
|
|
1089
1089
|
console.warn("Failed to parse cfg", configId);
|
|
1090
1090
|
}
|
|
@@ -1092,31 +1092,31 @@
|
|
|
1092
1092
|
}
|
|
1093
1093
|
});
|
|
1094
1094
|
_defineProperty(this, "validate", function (id, index) {
|
|
1095
|
-
if (_this.
|
|
1096
|
-
var configItem = _this.
|
|
1097
|
-
configItem.
|
|
1095
|
+
if (_this.lljB[id]) {
|
|
1096
|
+
var configItem = _this.lljB[id];
|
|
1097
|
+
configItem.GBBl(index);
|
|
1098
1098
|
}
|
|
1099
1099
|
});
|
|
1100
|
-
_defineProperty(this, "
|
|
1101
|
-
var campiagnConfig = _this.
|
|
1102
|
-
campiagnConfig.
|
|
1100
|
+
_defineProperty(this, "cnxa", function (id) {
|
|
1101
|
+
var campiagnConfig = _this.lljB[id];
|
|
1102
|
+
campiagnConfig.cnxa();
|
|
1103
1103
|
});
|
|
1104
1104
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1105
|
-
var campiagnConfig = _this.
|
|
1105
|
+
var campiagnConfig = _this.lljB[id];
|
|
1106
1106
|
return campiagnConfig.getFrequencyCount();
|
|
1107
1107
|
});
|
|
1108
1108
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1109
|
-
var configs = _this.
|
|
1109
|
+
var configs = _this.lljB;
|
|
1110
1110
|
for (var configId in configs) {
|
|
1111
|
-
configs[configId].
|
|
1111
|
+
configs[configId].NFqM();
|
|
1112
1112
|
}
|
|
1113
1113
|
});
|
|
1114
|
-
_defineProperty(this, "
|
|
1114
|
+
_defineProperty(this, "YDSO", function (campaignId) {
|
|
1115
1115
|
try {
|
|
1116
|
-
if (_this.
|
|
1117
|
-
var configItem = _this.
|
|
1118
|
-
if (configItem && configItem.
|
|
1119
|
-
return configItem.
|
|
1116
|
+
if (_this.lljB) {
|
|
1117
|
+
var configItem = _this.lljB[campaignId];
|
|
1118
|
+
if (configItem && configItem.HSbO) {
|
|
1119
|
+
return configItem.HSbO;
|
|
1120
1120
|
}
|
|
1121
1121
|
}
|
|
1122
1122
|
} catch (e) {
|
|
@@ -1132,42 +1132,42 @@
|
|
|
1132
1132
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1133
1133
|
var _this = this;
|
|
1134
1134
|
_classCallCheck(this, EventsListener);
|
|
1135
|
-
_defineProperty(this, "
|
|
1136
|
-
_defineProperty(this, "
|
|
1137
|
-
_defineProperty(this, "
|
|
1135
|
+
_defineProperty(this, "xUpW", {});
|
|
1136
|
+
_defineProperty(this, "dRvR", []);
|
|
1137
|
+
_defineProperty(this, "DDNd", false);
|
|
1138
1138
|
_defineProperty(this, "initialize", function () {
|
|
1139
1139
|
var controller = Apxor.getController();
|
|
1140
1140
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1141
|
-
return _this.
|
|
1141
|
+
return _this.IsCi(event, "AE");
|
|
1142
1142
|
});
|
|
1143
1143
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1144
|
-
return _this.
|
|
1144
|
+
return _this.IsCi(event, "CE");
|
|
1145
1145
|
});
|
|
1146
1146
|
});
|
|
1147
|
-
_defineProperty(this, "
|
|
1147
|
+
_defineProperty(this, "ndnI", function () {
|
|
1148
1148
|
// Clear Buffer
|
|
1149
|
-
for (var item in _this.
|
|
1150
|
-
_this.
|
|
1149
|
+
for (var item in _this.dRvR) {
|
|
1150
|
+
_this.Fzta(item.event, item.key, item.type);
|
|
1151
1151
|
}
|
|
1152
|
-
_this.
|
|
1152
|
+
_this.DDNd = true;
|
|
1153
1153
|
});
|
|
1154
|
-
_defineProperty(this, "
|
|
1154
|
+
_defineProperty(this, "QOqX", function (event, callback) {
|
|
1155
1155
|
if (!isFunction(callback)) {
|
|
1156
1156
|
return;
|
|
1157
1157
|
}
|
|
1158
1158
|
var listeners;
|
|
1159
|
-
if (_this.
|
|
1160
|
-
listeners = _this.
|
|
1159
|
+
if (_this.xUpW[event]) {
|
|
1160
|
+
listeners = _this.xUpW[event];
|
|
1161
1161
|
} else {
|
|
1162
1162
|
listeners = [];
|
|
1163
1163
|
}
|
|
1164
1164
|
listeners.push(callback);
|
|
1165
|
-
_this.
|
|
1166
|
-
Logger$7.debug("Listeners list: ", _this.
|
|
1165
|
+
_this.xUpW[event] = listeners;
|
|
1166
|
+
Logger$7.debug("Listeners list: ", _this.xUpW);
|
|
1167
1167
|
});
|
|
1168
1168
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1169
|
-
if (_this.
|
|
1170
|
-
var listeners = _this.
|
|
1169
|
+
if (_this.xUpW[event]) {
|
|
1170
|
+
var listeners = _this.xUpW[event];
|
|
1171
1171
|
var updatedListeners = [];
|
|
1172
1172
|
for (var index = 0; index < listeners.length; index++) {
|
|
1173
1173
|
var listener = listeners[index];
|
|
@@ -1175,25 +1175,25 @@
|
|
|
1175
1175
|
updatedListeners.push(listener);
|
|
1176
1176
|
}
|
|
1177
1177
|
}
|
|
1178
|
-
_this.
|
|
1178
|
+
_this.xUpW[event] = updatedListeners;
|
|
1179
1179
|
}
|
|
1180
1180
|
});
|
|
1181
|
-
_defineProperty(this, "
|
|
1181
|
+
_defineProperty(this, "IsCi", function (event) {
|
|
1182
1182
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1183
1183
|
var key = type + "___" + event.name;
|
|
1184
|
-
_this.
|
|
1184
|
+
_this.Fzta(event, key, type);
|
|
1185
1185
|
});
|
|
1186
|
-
_defineProperty(this, "
|
|
1187
|
-
if (!_this.
|
|
1188
|
-
_this.
|
|
1186
|
+
_defineProperty(this, "Fzta", function (event, key, type) {
|
|
1187
|
+
if (!_this.DDNd) {
|
|
1188
|
+
_this.dRvR.push({
|
|
1189
1189
|
event: event,
|
|
1190
1190
|
key: key,
|
|
1191
1191
|
type: type
|
|
1192
1192
|
});
|
|
1193
1193
|
} else {
|
|
1194
|
-
Logger$7.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1195
|
-
if (_this.
|
|
1196
|
-
var listeners = _this.
|
|
1194
|
+
Logger$7.debug("Notifying listeners for event: " + event + ", " + key, _this.xUpW);
|
|
1195
|
+
if (_this.xUpW[key]) {
|
|
1196
|
+
var listeners = _this.xUpW[key];
|
|
1197
1197
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1198
1198
|
for (var index = 0; index < listeners.length; index++) {
|
|
1199
1199
|
var listener = listeners[index];
|
|
@@ -1209,17 +1209,17 @@
|
|
|
1209
1209
|
function CE() {
|
|
1210
1210
|
var _this = this;
|
|
1211
1211
|
_classCallCheck(this, CE);
|
|
1212
|
-
_defineProperty(this, "
|
|
1213
|
-
_defineProperty(this, "
|
|
1214
|
-
_defineProperty(this, "
|
|
1215
|
-
_defineProperty(this, "
|
|
1216
|
-
_defineProperty(this, "
|
|
1212
|
+
_defineProperty(this, "XRon", false);
|
|
1213
|
+
_defineProperty(this, "KSfx", null);
|
|
1214
|
+
_defineProperty(this, "kkXn", getDateInDDMMYYYY());
|
|
1215
|
+
_defineProperty(this, "fOwS", new EventsListener());
|
|
1216
|
+
_defineProperty(this, "NhQg", Apxor.getSiteId());
|
|
1217
1217
|
_defineProperty(this, "_qeState", {});
|
|
1218
1218
|
_defineProperty(this, "getQeState", function () {
|
|
1219
1219
|
try {
|
|
1220
1220
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1221
1221
|
if (data) {
|
|
1222
|
-
return JSON.parse(decode(_this.
|
|
1222
|
+
return JSON.parse(decode(_this.NhQg, data));
|
|
1223
1223
|
} else {
|
|
1224
1224
|
_this._qeState = {};
|
|
1225
1225
|
return _this.setQeState();
|
|
@@ -1248,10 +1248,10 @@
|
|
|
1248
1248
|
return _this._qeState;
|
|
1249
1249
|
});
|
|
1250
1250
|
_defineProperty(this, "initialize", function () {
|
|
1251
|
-
if (!_this.
|
|
1252
|
-
_this.
|
|
1253
|
-
_this.
|
|
1254
|
-
_this.
|
|
1251
|
+
if (!_this.XRon) {
|
|
1252
|
+
_this.XRon = true;
|
|
1253
|
+
_this.KSfx = new ConfigLookup();
|
|
1254
|
+
_this.fOwS.initialize();
|
|
1255
1255
|
_this._qeState = _this.getQeState();
|
|
1256
1256
|
Logger$8.info("QE Initialized..");
|
|
1257
1257
|
}
|
|
@@ -1262,12 +1262,12 @@
|
|
|
1262
1262
|
* @param config
|
|
1263
1263
|
*/
|
|
1264
1264
|
_defineProperty(this, "parse", function (config) {
|
|
1265
|
-
if (!_this.
|
|
1265
|
+
if (!_this.HAyL()) {
|
|
1266
1266
|
Logger$8.warn("Must call init first. Unable to proceed");
|
|
1267
1267
|
return;
|
|
1268
1268
|
}
|
|
1269
|
-
_this.
|
|
1270
|
-
_this.
|
|
1269
|
+
_this.KSfx.parse(config);
|
|
1270
|
+
_this.fOwS.ndnI();
|
|
1271
1271
|
});
|
|
1272
1272
|
/**
|
|
1273
1273
|
* Validates all conditions for given config ID
|
|
@@ -1276,10 +1276,10 @@
|
|
|
1276
1276
|
* @param index
|
|
1277
1277
|
*/
|
|
1278
1278
|
_defineProperty(this, "validate", function (id, index) {
|
|
1279
|
-
if (!_this.
|
|
1279
|
+
if (!_this.HAyL()) {
|
|
1280
1280
|
return;
|
|
1281
1281
|
}
|
|
1282
|
-
_this.
|
|
1282
|
+
_this.KSfx.validate(id, index);
|
|
1283
1283
|
});
|
|
1284
1284
|
_defineProperty(this, "updateCount", function (id) {
|
|
1285
1285
|
try {
|
|
@@ -1288,22 +1288,22 @@
|
|
|
1288
1288
|
}
|
|
1289
1289
|
_this.incrementFrequencies(id);
|
|
1290
1290
|
_this.setQeState(id);
|
|
1291
|
-
_this.
|
|
1291
|
+
_this.KSfx.cnxa(id);
|
|
1292
1292
|
} catch (e) {
|
|
1293
1293
|
console.log("Could not update the count config:".concat(e));
|
|
1294
1294
|
}
|
|
1295
1295
|
});
|
|
1296
1296
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1297
|
-
_this.
|
|
1297
|
+
_this.KSfx.resetFrequencyCounts();
|
|
1298
1298
|
});
|
|
1299
1299
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1300
|
-
return _this.
|
|
1300
|
+
return _this.KSfx.getFrequencyCount(id);
|
|
1301
1301
|
});
|
|
1302
1302
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1303
|
-
_this.
|
|
1303
|
+
_this.fOwS.QOqX(event, callback);
|
|
1304
1304
|
});
|
|
1305
1305
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1306
|
-
_this.
|
|
1306
|
+
_this.fOwS.unregisterFromEvent(event, callback);
|
|
1307
1307
|
});
|
|
1308
1308
|
/**
|
|
1309
1309
|
* Fetches the config from Server
|
|
@@ -1316,14 +1316,14 @@
|
|
|
1316
1316
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1317
1317
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1318
1318
|
});
|
|
1319
|
-
_defineProperty(this, "
|
|
1320
|
-
return _this.
|
|
1319
|
+
_defineProperty(this, "HAyL", function () {
|
|
1320
|
+
return _this.XRon;
|
|
1321
1321
|
});
|
|
1322
1322
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1323
|
-
return _this.
|
|
1323
|
+
return _this.KSfx.YDSO(campaignId);
|
|
1324
1324
|
});
|
|
1325
|
-
_defineProperty(this, "
|
|
1326
|
-
return _this.
|
|
1325
|
+
_defineProperty(this, "mDOI", function () {
|
|
1326
|
+
return _this.kkXn;
|
|
1327
1327
|
});
|
|
1328
1328
|
if (!CE.instance) {
|
|
1329
1329
|
CE.instance = this;
|
|
@@ -1347,7 +1347,7 @@
|
|
|
1347
1347
|
OVERALL: 0,
|
|
1348
1348
|
DATES: {}
|
|
1349
1349
|
};
|
|
1350
|
-
if (this.
|
|
1350
|
+
if (this.kkXn) this._qeState[id].DATES[this.kkXn] = 0;
|
|
1351
1351
|
this.setQeState(id);
|
|
1352
1352
|
}
|
|
1353
1353
|
} catch (e) {
|
|
@@ -1366,12 +1366,12 @@
|
|
|
1366
1366
|
|
|
1367
1367
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1368
1368
|
var currentDate = getDateInDDMMYYYY();
|
|
1369
|
-
if (currentDate !== this.
|
|
1370
|
-
this.
|
|
1369
|
+
if (currentDate !== this.kkXn || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
1370
|
+
this.kkXn = currentDate;
|
|
1371
1371
|
configFrequency.DATES = {};
|
|
1372
|
-
configFrequency.DATES[this.
|
|
1372
|
+
configFrequency.DATES[this.kkXn] = 0;
|
|
1373
1373
|
}
|
|
1374
|
-
configFrequency.DATES[this.
|
|
1374
|
+
configFrequency.DATES[this.kkXn] = configFrequency.DATES[this.kkXn] + 1;
|
|
1375
1375
|
}
|
|
1376
1376
|
}], [{
|
|
1377
1377
|
key: "getInstance",
|
|
@@ -1390,7 +1390,7 @@
|
|
|
1390
1390
|
|
|
1391
1391
|
/* eslint-disable no-empty */
|
|
1392
1392
|
|
|
1393
|
-
window.ceVersion =
|
|
1393
|
+
window.ceVersion = 121;
|
|
1394
1394
|
try {
|
|
1395
1395
|
if (exports !== undefined || exports !== null) {
|
|
1396
1396
|
exports["default"] = CE;
|