apxor-qe 1.4.1 → 1.4.2
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 +432 -418
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
var toUpperCase = function toUpperCase(key) {
|
|
204
204
|
return key.toUpperCase();
|
|
205
205
|
};
|
|
206
|
-
var
|
|
206
|
+
var OjHn = function OjHn(actual, expected, operator) {
|
|
207
207
|
switch (operator) {
|
|
208
208
|
case "EQ":
|
|
209
209
|
return actual === expected;
|
|
@@ -264,16 +264,16 @@
|
|
|
264
264
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
265
265
|
var _this = this;
|
|
266
266
|
_classCallCheck(this, Audience);
|
|
267
|
-
_defineProperty(this, "
|
|
268
|
-
_defineProperty(this, "
|
|
269
|
-
_defineProperty(this, "
|
|
267
|
+
_defineProperty(this, "KSOj", "ALL");
|
|
268
|
+
_defineProperty(this, "MSCc", []);
|
|
269
|
+
_defineProperty(this, "HuDN", []);
|
|
270
270
|
_defineProperty(this, "parse", function () {
|
|
271
271
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
272
272
|
try {
|
|
273
|
-
_this.
|
|
274
|
-
_this.
|
|
275
|
-
_this.
|
|
276
|
-
if (!Array.isArray(_this.
|
|
273
|
+
_this.KSOj = config.audience.audience_type;
|
|
274
|
+
_this.MSCc = config.audience.attributes.user;
|
|
275
|
+
_this.HuDN = config.audience.attributes.session;
|
|
276
|
+
if (!Array.isArray(_this.MSCc) || !Array.isArray(_this.HuDN)) {
|
|
277
277
|
Logger.error("No attributes");
|
|
278
278
|
return false;
|
|
279
279
|
}
|
|
@@ -285,12 +285,12 @@
|
|
|
285
285
|
});
|
|
286
286
|
_defineProperty(this, "validate", function (user, session) {
|
|
287
287
|
var status = true;
|
|
288
|
-
if (_this.
|
|
288
|
+
if (_this.KSOj === "FTU") {
|
|
289
289
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
290
290
|
}
|
|
291
|
-
return status && _this.
|
|
291
|
+
return status && _this.zQwl(user, _this.MSCc) && _this.zQwl(session, _this.HuDN);
|
|
292
292
|
});
|
|
293
|
-
_defineProperty(this, "
|
|
293
|
+
_defineProperty(this, "zQwl", function (attributes, expected) {
|
|
294
294
|
var length = expected.length;
|
|
295
295
|
var status = true;
|
|
296
296
|
try {
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
}
|
|
321
321
|
var match = loggedValues.some(function (loggedValue) {
|
|
322
322
|
return values.some(function (configValue) {
|
|
323
|
-
return
|
|
323
|
+
return OjHn(loggedValue, configValue, operator);
|
|
324
324
|
});
|
|
325
325
|
});
|
|
326
326
|
status = status && match;
|
|
@@ -342,37 +342,37 @@
|
|
|
342
342
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
343
343
|
var _this = this;
|
|
344
344
|
_classCallCheck(this, Frequency);
|
|
345
|
-
_defineProperty(this, "
|
|
346
|
-
_defineProperty(this, "
|
|
347
|
-
_defineProperty(this, "
|
|
348
|
-
_defineProperty(this, "
|
|
349
|
-
_defineProperty(this, "
|
|
350
|
-
_defineProperty(this, "
|
|
345
|
+
_defineProperty(this, "oKkN", 0);
|
|
346
|
+
_defineProperty(this, "uzZi", 0);
|
|
347
|
+
_defineProperty(this, "Avzx", "SESSION");
|
|
348
|
+
_defineProperty(this, "CqAl", 0);
|
|
349
|
+
_defineProperty(this, "ivKN", 0);
|
|
350
|
+
_defineProperty(this, "cOKY", 0);
|
|
351
351
|
_defineProperty(this, "parse", function () {
|
|
352
352
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
353
353
|
try {
|
|
354
|
-
_this.
|
|
355
|
-
if (_this.
|
|
356
|
-
_this.
|
|
354
|
+
_this.oKkN = config.frequency.count;
|
|
355
|
+
if (_this.oKkN === -1) {
|
|
356
|
+
_this.oKkN = 1000;
|
|
357
357
|
}
|
|
358
|
-
_this.
|
|
359
|
-
_this.
|
|
360
|
-
_this.
|
|
361
|
-
_this.
|
|
358
|
+
_this.cOKY = _this.oKkN;
|
|
359
|
+
_this.uzZi = config.frequency.time_interval;
|
|
360
|
+
_this.Avzx = config.frequency.validity;
|
|
361
|
+
_this.ivKN = config.frequency.ses_lmt;
|
|
362
362
|
_this._dayCount = config.frequency.day_lmt;
|
|
363
363
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
364
364
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
365
365
|
var qe_state = CE.getInstance().getQeState();
|
|
366
366
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
367
|
-
if (_this.
|
|
368
|
-
_this.
|
|
369
|
-
if (_this.
|
|
367
|
+
if (_this.Avzx === "SESSION") {
|
|
368
|
+
_this.oKkN = parseInt(_this.oKkN) - parseInt(qe_state[config._id]["SESSION"]);
|
|
369
|
+
if (_this.oKkN <= 0) {
|
|
370
370
|
console.warn("Max count limit reached for session:" + config._id);
|
|
371
371
|
return false;
|
|
372
372
|
}
|
|
373
|
-
} else if (_this.
|
|
374
|
-
_this.
|
|
375
|
-
if (_this.
|
|
373
|
+
} else if (_this.Avzx === "OVERALL") {
|
|
374
|
+
_this.oKkN = parseInt(_this.oKkN) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
375
|
+
if (_this.oKkN <= 0) {
|
|
376
376
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
377
377
|
return false;
|
|
378
378
|
}
|
|
@@ -386,28 +386,28 @@
|
|
|
386
386
|
}
|
|
387
387
|
return true;
|
|
388
388
|
});
|
|
389
|
-
_defineProperty(this, "
|
|
390
|
-
_this.
|
|
389
|
+
_defineProperty(this, "ErGD", function () {
|
|
390
|
+
_this.oKkN = _this.oKkN - 1;
|
|
391
391
|
});
|
|
392
392
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
393
|
-
return _this.
|
|
393
|
+
return _this.oKkN;
|
|
394
394
|
});
|
|
395
|
-
_defineProperty(this, "
|
|
396
|
-
if (_this.
|
|
397
|
-
_this.
|
|
395
|
+
_defineProperty(this, "Kbwh", function () {
|
|
396
|
+
if (_this.Avzx === "SESSION") {
|
|
397
|
+
_this.oKkN = _this.cOKY;
|
|
398
398
|
Logger$1.info("Campaign Limit reset");
|
|
399
399
|
}
|
|
400
400
|
});
|
|
401
401
|
/**
|
|
402
|
-
* @function
|
|
402
|
+
* @function TzLe
|
|
403
403
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
404
404
|
* @param {string} Config id
|
|
405
405
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
406
406
|
* false - Otherwise
|
|
407
407
|
*/
|
|
408
|
-
_defineProperty(this, "
|
|
408
|
+
_defineProperty(this, "TzLe", function (id) {
|
|
409
409
|
try {
|
|
410
|
-
if (_this.
|
|
410
|
+
if (_this.oKkN <= 0) {
|
|
411
411
|
return false;
|
|
412
412
|
}
|
|
413
413
|
|
|
@@ -418,8 +418,8 @@
|
|
|
418
418
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
419
419
|
|
|
420
420
|
//If the config has a session count limit set
|
|
421
|
-
if (_this.
|
|
422
|
-
var sessionCountInConfig = parseInt(_this.
|
|
421
|
+
if (_this.ivKN !== 0) {
|
|
422
|
+
var sessionCountInConfig = parseInt(_this.ivKN);
|
|
423
423
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
424
424
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
425
425
|
return false;
|
|
@@ -446,14 +446,14 @@
|
|
|
446
446
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
447
447
|
var _this = this;
|
|
448
448
|
_classCallCheck(this, Meta);
|
|
449
|
-
_defineProperty(this, "
|
|
450
|
-
_defineProperty(this, "
|
|
449
|
+
_defineProperty(this, "lKfZ", "");
|
|
450
|
+
_defineProperty(this, "KSOj", "");
|
|
451
451
|
_defineProperty(this, "parse", function () {
|
|
452
452
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
453
453
|
try {
|
|
454
454
|
var _config$meta;
|
|
455
|
-
_this.
|
|
456
|
-
_this.
|
|
455
|
+
_this.lKfZ = config.meta.name;
|
|
456
|
+
_this.KSOj = config.meta.type;
|
|
457
457
|
_this._only_context = config.meta.only_context;
|
|
458
458
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
459
459
|
} catch (error) {
|
|
@@ -468,11 +468,11 @@
|
|
|
468
468
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
469
469
|
var _this = this;
|
|
470
470
|
_classCallCheck(this, Validity);
|
|
471
|
-
_defineProperty(this, "
|
|
472
|
-
_defineProperty(this, "
|
|
473
|
-
_defineProperty(this, "
|
|
474
|
-
_defineProperty(this, "
|
|
475
|
-
_defineProperty(this, "
|
|
471
|
+
_defineProperty(this, "TVeC", -1);
|
|
472
|
+
_defineProperty(this, "AsSy", -1);
|
|
473
|
+
_defineProperty(this, "Hztt", -1);
|
|
474
|
+
_defineProperty(this, "ZTNT", -1);
|
|
475
|
+
_defineProperty(this, "eGYo", false);
|
|
476
476
|
_defineProperty(this, "parse", function () {
|
|
477
477
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
478
478
|
try {
|
|
@@ -480,17 +480,17 @@
|
|
|
480
480
|
Logger$2.error("Not valid dates");
|
|
481
481
|
return false;
|
|
482
482
|
}
|
|
483
|
-
_this.
|
|
484
|
-
_this.
|
|
483
|
+
_this.TVeC = Date.parse(config.validity.start_date);
|
|
484
|
+
_this.AsSy = Date.parse(config.validity.end_date);
|
|
485
485
|
if (isDefined(config.time_limits_in_day)) {
|
|
486
|
-
_this.
|
|
487
|
-
if (_this.
|
|
486
|
+
_this.eGYo = config.time_limits_in_day;
|
|
487
|
+
if (_this.eGYo && isDefined(config.time_limits)) {
|
|
488
488
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
489
|
-
_this.
|
|
490
|
-
_this.
|
|
489
|
+
_this.Hztt = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
|
|
490
|
+
_this.ZTNT = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
|
|
491
491
|
|
|
492
492
|
// If invalid format is passed, return false
|
|
493
|
-
if (isNaN(_this.
|
|
493
|
+
if (isNaN(_this.Hztt) || isNaN(_this.ZTNT)) {
|
|
494
494
|
Logger$2.error("Not valid times");
|
|
495
495
|
return false;
|
|
496
496
|
}
|
|
@@ -504,8 +504,8 @@
|
|
|
504
504
|
});
|
|
505
505
|
_defineProperty(this, "validate", function () {
|
|
506
506
|
var currentTime = Date.now();
|
|
507
|
-
if (currentTime > _this.
|
|
508
|
-
return !_this.
|
|
507
|
+
if (currentTime > _this.TVeC && currentTime < _this.AsSy) {
|
|
508
|
+
return !_this.eGYo || currentTime >= _this.Hztt && currentTime <= _this.ZTNT;
|
|
509
509
|
}
|
|
510
510
|
return false;
|
|
511
511
|
});
|
|
@@ -514,13 +514,13 @@
|
|
|
514
514
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
515
515
|
var _this = this;
|
|
516
516
|
_classCallCheck(this, Details);
|
|
517
|
-
_defineProperty(this, "
|
|
518
|
-
_defineProperty(this, "
|
|
517
|
+
_defineProperty(this, "lKfZ", "");
|
|
518
|
+
_defineProperty(this, "xDaw", {});
|
|
519
519
|
_defineProperty(this, "parse", function () {
|
|
520
520
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
521
521
|
try {
|
|
522
|
-
_this.
|
|
523
|
-
_this.
|
|
522
|
+
_this.lKfZ = details.name;
|
|
523
|
+
_this.xDaw = details.additional_info;
|
|
524
524
|
} catch (error) {
|
|
525
525
|
return false;
|
|
526
526
|
}
|
|
@@ -531,14 +531,14 @@
|
|
|
531
531
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
532
532
|
var _this = this;
|
|
533
533
|
_classCallCheck(this, Timebounds);
|
|
534
|
-
_defineProperty(this, "
|
|
535
|
-
_defineProperty(this, "
|
|
534
|
+
_defineProperty(this, "MZxZ", 0);
|
|
535
|
+
_defineProperty(this, "gheX", 0);
|
|
536
536
|
_defineProperty(this, "parse", function () {
|
|
537
537
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
538
538
|
try {
|
|
539
|
-
_this.
|
|
540
|
-
_this.
|
|
541
|
-
if (isNaN(_this.
|
|
539
|
+
_this.MZxZ = Number(timeBounds.lower);
|
|
540
|
+
_this.gheX = Number(timeBounds.upper);
|
|
541
|
+
if (isNaN(_this.MZxZ) || isNaN(_this.gheX)) {
|
|
542
542
|
return false;
|
|
543
543
|
}
|
|
544
544
|
} catch (error) {
|
|
@@ -551,17 +551,17 @@
|
|
|
551
551
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
552
552
|
var _this = this;
|
|
553
553
|
_classCallCheck(this, PreCondition);
|
|
554
|
-
_defineProperty(this, "
|
|
555
|
-
_defineProperty(this, "
|
|
556
|
-
_defineProperty(this, "
|
|
557
|
-
_defineProperty(this, "
|
|
558
|
-
_defineProperty(this, "
|
|
554
|
+
_defineProperty(this, "SHrN", 0);
|
|
555
|
+
_defineProperty(this, "rXTM", "");
|
|
556
|
+
_defineProperty(this, "bgoZ", "");
|
|
557
|
+
_defineProperty(this, "kuZn", new Details());
|
|
558
|
+
_defineProperty(this, "tzep", new Timebounds());
|
|
559
559
|
_defineProperty(this, "parse", function () {
|
|
560
560
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
561
561
|
try {
|
|
562
|
-
_this.
|
|
563
|
-
_this.
|
|
564
|
-
return _this.
|
|
562
|
+
_this.rXTM = precondition.event_type;
|
|
563
|
+
_this.bgoZ = precondition.activity;
|
|
564
|
+
return _this.kuZn.parse(precondition.details) && _this.tzep.parse(precondition.time_bounds);
|
|
565
565
|
} catch (error) {
|
|
566
566
|
return false;
|
|
567
567
|
}
|
|
@@ -572,29 +572,29 @@
|
|
|
572
572
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
573
573
|
var _this = this;
|
|
574
574
|
_classCallCheck(this, Condition);
|
|
575
|
-
_defineProperty(this, "
|
|
576
|
-
_defineProperty(this, "
|
|
577
|
-
_defineProperty(this, "
|
|
578
|
-
_defineProperty(this, "
|
|
579
|
-
_defineProperty(this, "
|
|
580
|
-
_defineProperty(this, "
|
|
581
|
-
_defineProperty(this, "
|
|
582
|
-
_defineProperty(this, "
|
|
583
|
-
_defineProperty(this, "
|
|
584
|
-
_defineProperty(this, "
|
|
585
|
-
_defineProperty(this, "
|
|
586
|
-
_defineProperty(this, "
|
|
575
|
+
_defineProperty(this, "SHrN", 0);
|
|
576
|
+
_defineProperty(this, "eGRJ", -1);
|
|
577
|
+
_defineProperty(this, "oKkN", 0);
|
|
578
|
+
_defineProperty(this, "CKgT", "");
|
|
579
|
+
_defineProperty(this, "bgoZ", "");
|
|
580
|
+
_defineProperty(this, "rXTM", "");
|
|
581
|
+
_defineProperty(this, "tzep", new Timebounds());
|
|
582
|
+
_defineProperty(this, "kuZn", new Details());
|
|
583
|
+
_defineProperty(this, "xiSw", new PreCondition());
|
|
584
|
+
_defineProperty(this, "LNgq", "AND");
|
|
585
|
+
_defineProperty(this, "dWSg", false);
|
|
586
|
+
_defineProperty(this, "KSOj", void 0);
|
|
587
587
|
_defineProperty(this, "parse", function () {
|
|
588
588
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
589
589
|
try {
|
|
590
|
-
_this.
|
|
591
|
-
_this.
|
|
592
|
-
_this.
|
|
593
|
-
_this.
|
|
594
|
-
_this.
|
|
595
|
-
_this.
|
|
596
|
-
_this.
|
|
597
|
-
return _this.
|
|
590
|
+
_this.eGRJ = condition.sequence;
|
|
591
|
+
_this.oKkN = condition.count_config.count;
|
|
592
|
+
_this.CKgT = condition.count_config.operator;
|
|
593
|
+
_this.bgoZ = condition.activity;
|
|
594
|
+
_this.rXTM = condition.event_type;
|
|
595
|
+
_this.LNgq = condition.combine_operator;
|
|
596
|
+
_this.KSOj = condition.type;
|
|
597
|
+
return _this.kuZn.parse(condition.details) && _this.xiSw.parse(condition.trigger) && _this.tzep.parse(condition.time_bounds);
|
|
598
598
|
} catch (error) {
|
|
599
599
|
Logger$3.error(error);
|
|
600
600
|
return false;
|
|
@@ -606,19 +606,19 @@
|
|
|
606
606
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
607
607
|
var _this = this;
|
|
608
608
|
_classCallCheck(this, GoalEvent);
|
|
609
|
-
_defineProperty(this, "
|
|
610
|
-
_defineProperty(this, "
|
|
611
|
-
_defineProperty(this, "
|
|
612
|
-
_defineProperty(this, "
|
|
613
|
-
_defineProperty(this, "
|
|
614
|
-
_defineProperty(this, "
|
|
609
|
+
_defineProperty(this, "oKkN", 0);
|
|
610
|
+
_defineProperty(this, "CKgT", "");
|
|
611
|
+
_defineProperty(this, "rXTM", "");
|
|
612
|
+
_defineProperty(this, "tzep", new Timebounds());
|
|
613
|
+
_defineProperty(this, "kuZn", new Details());
|
|
614
|
+
_defineProperty(this, "LNgq", "AND");
|
|
615
615
|
_defineProperty(this, "parse", function (data) {
|
|
616
616
|
try {
|
|
617
|
-
_this.
|
|
618
|
-
_this.
|
|
619
|
-
_this.
|
|
620
|
-
_this.
|
|
621
|
-
return _this.
|
|
617
|
+
_this.oKkN = data.count_config.count;
|
|
618
|
+
_this.CKgT = data.count_config.operator;
|
|
619
|
+
_this.rXTM = data.event_type;
|
|
620
|
+
_this.LNgq = data.combine_operator;
|
|
621
|
+
return _this.kuZn.parse(data.details) && _this.tzep.parse(data.time_bounds);
|
|
622
622
|
} catch (error) {
|
|
623
623
|
Logger$4.error(error);
|
|
624
624
|
return false;
|
|
@@ -632,21 +632,21 @@
|
|
|
632
632
|
function ConditionValidator() {
|
|
633
633
|
var _this = this;
|
|
634
634
|
_classCallCheck(this, ConditionValidator);
|
|
635
|
-
_defineProperty(this, "
|
|
636
|
-
_defineProperty(this, "
|
|
637
|
-
_defineProperty(this, "
|
|
638
|
-
_defineProperty(this, "
|
|
639
|
-
_defineProperty(this, "
|
|
640
|
-
_defineProperty(this, "
|
|
641
|
-
_defineProperty(this, "
|
|
642
|
-
_defineProperty(this, "
|
|
643
|
-
_defineProperty(this, "
|
|
644
|
-
_defineProperty(this, "
|
|
645
|
-
_defineProperty(this, "
|
|
646
|
-
_defineProperty(this, "
|
|
647
|
-
_defineProperty(this, "
|
|
635
|
+
_defineProperty(this, "akXD", 0);
|
|
636
|
+
_defineProperty(this, "FqJf", "");
|
|
637
|
+
_defineProperty(this, "ehaO", new Condition());
|
|
638
|
+
_defineProperty(this, "rkRi", new GoalEvent());
|
|
639
|
+
_defineProperty(this, "RlJN", false);
|
|
640
|
+
_defineProperty(this, "GJsb", false);
|
|
641
|
+
_defineProperty(this, "WLVW", 0);
|
|
642
|
+
_defineProperty(this, "LNgq", "AND");
|
|
643
|
+
_defineProperty(this, "WFrp", "OR");
|
|
644
|
+
_defineProperty(this, "sVTX", -1);
|
|
645
|
+
_defineProperty(this, "GzsF", []);
|
|
646
|
+
_defineProperty(this, "HATm", {});
|
|
647
|
+
_defineProperty(this, "bqgA", false);
|
|
648
648
|
/**
|
|
649
|
-
* If respectSequence is true, don't auto-
|
|
649
|
+
* If respectSequence is true, don't auto-hian to events except for the condition whose index is 0
|
|
650
650
|
*
|
|
651
651
|
* @param condition
|
|
652
652
|
* @param type
|
|
@@ -662,180 +662,191 @@
|
|
|
662
662
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
663
663
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
664
664
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
665
|
-
_this.
|
|
666
|
-
_this.
|
|
667
|
-
_this.
|
|
665
|
+
_this.FqJf = id;
|
|
666
|
+
_this.WLVW = index;
|
|
667
|
+
_this.GzsF = noKpiArray;
|
|
668
668
|
if (flag !== "termination" || flag === "") {
|
|
669
|
-
var result = _this.
|
|
669
|
+
var result = _this.ehaO.parse(condition);
|
|
670
670
|
if (result) {
|
|
671
|
-
_this.
|
|
671
|
+
_this.LNgq = _this.ehaO.LNgq;
|
|
672
672
|
|
|
673
673
|
// FIXME: Why this code is written? Don't see any usecase
|
|
674
|
-
if (_this.
|
|
675
|
-
var eventName = _this.
|
|
674
|
+
if (_this.ehaO.dWSg) {
|
|
675
|
+
var eventName = _this.ehaO.kuZn.lKfZ;
|
|
676
676
|
if (eventName === "APX_PAGE_OPENED") {
|
|
677
|
-
eventName = _this.
|
|
678
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
677
|
+
eventName = _this.ehaO.kuZn.xDaw["navigation_id"];
|
|
678
|
+
eventName = isDefined(eventName) ? eventName : _this.ehaO.kuZn.lKfZ;
|
|
679
679
|
}
|
|
680
|
-
_this.
|
|
681
|
-
var count = _this.
|
|
682
|
-
var operator = _this.
|
|
683
|
-
_this.
|
|
684
|
-
_this.
|
|
685
|
-
// If the condition is already satisfied and if it is page view, no need to
|
|
680
|
+
_this.sVTX = Apxor.getController().getEventCount(eventName);
|
|
681
|
+
var count = _this.ehaO.oKkN;
|
|
682
|
+
var operator = _this.ehaO.CKgT;
|
|
683
|
+
_this.GJsb = _this.BcDf(_this.sVTX - 1, count, operator, false);
|
|
684
|
+
_this.RlJN = _this.GJsb;
|
|
685
|
+
// If the condition is already satisfied and if it is page view, no need to hian
|
|
686
686
|
// This only applies for NAVIGATION_EVENTS
|
|
687
|
-
if (_this.
|
|
687
|
+
if (_this.GJsb && _this.ehaO.kuZn.lKfZ === "APX_PAGE_OPENED") {
|
|
688
688
|
return true;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
if (!respectSequence || index === 0) {
|
|
692
|
-
_this.
|
|
692
|
+
_this.hian();
|
|
693
693
|
}
|
|
694
694
|
return true;
|
|
695
695
|
}
|
|
696
696
|
} else {
|
|
697
|
-
var _result = _this.
|
|
698
|
-
_this.
|
|
699
|
-
_this.
|
|
697
|
+
var _result = _this.rkRi.parse(condition);
|
|
698
|
+
_this.WFrp = _this.rkRi.LNgq;
|
|
699
|
+
_this.FoZP();
|
|
700
700
|
return true;
|
|
701
701
|
}
|
|
702
702
|
return false;
|
|
703
703
|
});
|
|
704
|
-
_defineProperty(this, "
|
|
705
|
-
var
|
|
706
|
-
var
|
|
704
|
+
_defineProperty(this, "hian", function () {
|
|
705
|
+
var _window$ApxorRTM;
|
|
706
|
+
var condition = _this.ehaO;
|
|
707
|
+
var precondition = condition.xiSw;
|
|
707
708
|
var ceInstance = CE.getInstance();
|
|
708
|
-
if (precondition.
|
|
709
|
-
_this.
|
|
710
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
709
|
+
if (precondition.rXTM === "app_start") {
|
|
710
|
+
_this.RlJN = true;
|
|
711
|
+
ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + condition.kuZn.lKfZ, _this.LkAU);
|
|
711
712
|
} else {
|
|
712
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
713
|
+
ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + precondition.kuZn.lKfZ, _this.LkAU);
|
|
714
|
+
}
|
|
715
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.FqJf)) {
|
|
716
|
+
ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + "apxor-badge-container-".concat("-".concat(_this.FqJf).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.LkAU);
|
|
713
717
|
}
|
|
714
718
|
});
|
|
715
|
-
_defineProperty(this, "
|
|
716
|
-
var condition = _this.
|
|
719
|
+
_defineProperty(this, "FoZP", function () {
|
|
720
|
+
var condition = _this.rkRi;
|
|
717
721
|
var ceInstance = CE.getInstance();
|
|
718
|
-
_this.
|
|
719
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
722
|
+
_this.RlJN = true;
|
|
723
|
+
ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + condition.kuZn.lKfZ, _this.xsmN);
|
|
720
724
|
});
|
|
721
|
-
_defineProperty(this, "
|
|
722
|
-
var _this$
|
|
725
|
+
_defineProperty(this, "JTwT", function (type, name, time, additionalInfo) {
|
|
726
|
+
var _this$ehaO;
|
|
723
727
|
var eventTime = Date.now();
|
|
724
|
-
var time_differnce = (eventTime - _this.
|
|
725
|
-
var time_fromConfig = ((_this$
|
|
728
|
+
var time_differnce = (eventTime - _this.HATm[name]) / 1000;
|
|
729
|
+
var time_fromConfig = ((_this$ehaO = _this.ehaO) === null || _this$ehaO === void 0 || (_this$ehaO = _this$ehaO.kuZn) === null || _this$ehaO === void 0 || (_this$ehaO = _this$ehaO.xDaw) === null || _this$ehaO === void 0 ? void 0 : _this$ehaO.time) / 1000;
|
|
726
730
|
if (time_fromConfig > time_differnce) {
|
|
727
731
|
_this._displayCampaign(time);
|
|
728
732
|
}
|
|
729
733
|
});
|
|
730
|
-
_defineProperty(this, "
|
|
734
|
+
_defineProperty(this, "sSky", function (type, name, time, additionalInfo) {
|
|
731
735
|
var _this$_condition2, _this$_condition3;
|
|
732
|
-
_this.
|
|
736
|
+
_this.bqgA = true;
|
|
733
737
|
var currentTime = Date.now();
|
|
734
|
-
var eventName = (_this$_condition2 = _this.
|
|
735
|
-
var eventTime = _this.
|
|
738
|
+
var eventName = (_this$_condition2 = _this.ehaO) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.xiSw) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.kuZn.lKfZ;
|
|
739
|
+
var eventTime = _this.HATm[eventName];
|
|
736
740
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
737
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
741
|
+
var time_fromConfig = (_this$_condition3 = _this.ehaO) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.kuZn) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.xDaw) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
738
742
|
time_fromConfig = time_fromConfig / 1000;
|
|
739
743
|
if (time_fromConfig > time_differnce) {
|
|
740
744
|
_this._displayCampaign(time);
|
|
741
745
|
}
|
|
742
746
|
//unregister the event
|
|
743
747
|
});
|
|
744
|
-
_defineProperty(this, "
|
|
748
|
+
_defineProperty(this, "LkAU", function (type, name, time, additionalInfo) {
|
|
749
|
+
var _window$ApxorRTM2;
|
|
745
750
|
var ceInstance = CE.getInstance();
|
|
746
|
-
if (!_this.
|
|
751
|
+
if (!_this.RlJN) {
|
|
747
752
|
// Validate Precondition
|
|
748
|
-
_this.
|
|
749
|
-
if (_this.
|
|
750
|
-
var condition = _this.
|
|
751
|
-
var precondition = condition.
|
|
752
|
-
precondition.
|
|
753
|
+
_this.RlJN = _this.PCkN(type, name, time, additionalInfo);
|
|
754
|
+
if (_this.RlJN) {
|
|
755
|
+
var condition = _this.ehaO;
|
|
756
|
+
var precondition = condition.xiSw;
|
|
757
|
+
precondition.SHrN = time;
|
|
753
758
|
//events will be registred by its type activity event_type: "activity_time"
|
|
754
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
755
|
-
var
|
|
756
|
-
var event_time = condition === null || condition === void 0 || (
|
|
757
|
-
if ((condition === null || condition === void 0 || (
|
|
759
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.rXTM) === "activity_time") {
|
|
760
|
+
var ehaO$kuZn, ehaO$_details2, ehaO$_details3;
|
|
761
|
+
var event_time = condition === null || condition === void 0 || (ehaO$kuZn = condition.kuZn) === null || ehaO$kuZn === void 0 || (ehaO$kuZn = ehaO$kuZn.xDaw) === null || ehaO$kuZn === void 0 ? void 0 : ehaO$kuZn.time;
|
|
762
|
+
if ((condition === null || condition === void 0 || (ehaO$_details2 = condition.kuZn) === null || ehaO$_details2 === void 0 || (ehaO$_details2 = ehaO$_details2.xDaw) === null || ehaO$_details2 === void 0 ? void 0 : ehaO$_details2.nkpi.length) > 0) {
|
|
758
763
|
setTimeout(function () {
|
|
759
|
-
if (!_this.
|
|
760
|
-
_this.
|
|
761
|
-
if (_this.
|
|
762
|
-
_this.
|
|
763
|
-
_this.
|
|
764
|
-
if (_this.
|
|
765
|
-
_this.
|
|
766
|
-
ceInstance.validate(_this.
|
|
764
|
+
if (!_this.bqgA) {
|
|
765
|
+
_this.GJsb = true;
|
|
766
|
+
if (_this.GJsb) {
|
|
767
|
+
_this.akXD += 1;
|
|
768
|
+
_this.GJsb = _this.BcDf(_this.akXD, _this.ehaO.oKkN, _this.ehaO.CKgT);
|
|
769
|
+
if (_this.GJsb) {
|
|
770
|
+
_this.ehaO.SHrN = time;
|
|
771
|
+
ceInstance.validate(_this.FqJf, _this.WLVW);
|
|
767
772
|
}
|
|
768
773
|
}
|
|
769
774
|
}
|
|
770
|
-
condition.
|
|
771
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
775
|
+
condition.kuZn.xDaw.nkpi.map(function (nokpi) {
|
|
776
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + nokpi, _this);
|
|
772
777
|
});
|
|
773
778
|
}, event_time);
|
|
774
|
-
condition.
|
|
775
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
779
|
+
condition.kuZn.xDaw.nkpi.map(function (nokpi) {
|
|
780
|
+
ceInstance.registerForEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + nokpi, _this.sSky);
|
|
776
781
|
});
|
|
777
782
|
}
|
|
778
783
|
//it is for unregistering the events did case after completing the time imit
|
|
779
|
-
if ((condition === null || condition === void 0 || (
|
|
784
|
+
if ((condition === null || condition === void 0 || (ehaO$_details3 = condition.kuZn) === null || ehaO$_details3 === void 0 || (ehaO$_details3 = ehaO$_details3.xDaw) === null || ehaO$_details3 === void 0 ? void 0 : ehaO$_details3.kpi.length) > 0) {
|
|
780
785
|
setTimeout(function () {
|
|
781
|
-
condition.
|
|
782
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
786
|
+
condition.kuZn.xDaw.kpi.map(function (kpi) {
|
|
787
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + kpi, _this);
|
|
783
788
|
});
|
|
784
789
|
}, event_time);
|
|
785
|
-
condition.
|
|
786
|
-
if (kpi === condition.
|
|
790
|
+
condition.kuZn.xDaw.kpi.map(function (kpi) {
|
|
791
|
+
if (kpi === condition.xiSw.kuZn.lKfZ) {
|
|
787
792
|
//unregister the previous event
|
|
788
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
789
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
793
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.rXTM) + "___" + precondition.kuZn.lKfZ, _this);
|
|
794
|
+
ceInstance.registerForEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + kpi, _this.JTwT);
|
|
790
795
|
} else {
|
|
791
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
796
|
+
ceInstance.registerForEvent(toUpperCase(condition.kuZn.xDaw.et) + "___" + kpi, _this.sSky);
|
|
792
797
|
}
|
|
793
798
|
});
|
|
794
799
|
}
|
|
795
800
|
} else {
|
|
796
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
797
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
801
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.rXTM) + "___" + precondition.kuZn.lKfZ, _this);
|
|
802
|
+
ceInstance.registerForEvent(generateKey(condition.rXTM) + "___" + condition.kuZn.lKfZ, _this);
|
|
798
803
|
}
|
|
799
|
-
_this.
|
|
804
|
+
_this.HATm[name] = Date.now();
|
|
800
805
|
}
|
|
801
806
|
return;
|
|
802
807
|
}
|
|
808
|
+
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && Apxor.getController().isBadgeTriggerSatisfied(_this.FqJf)) {
|
|
809
|
+
_this.GJsb = true;
|
|
810
|
+
_this.ehaO.SHrN = time;
|
|
811
|
+
ceInstance.validate(_this.FqJf, _this.WLVW);
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
803
814
|
|
|
804
815
|
// Validate Condition
|
|
805
|
-
var validationStatus = generateKey(_this.
|
|
816
|
+
var validationStatus = generateKey(_this.ehaO.rXTM) === type && _this.IHQA(time - _this.ehaO.xiSw.SHrN, _this.ehaO.tzep) && _this.ehaO.kuZn.lKfZ === name && _this.YnRU(_this.ehaO.kuZn.xDaw, additionalInfo);
|
|
806
817
|
if (validationStatus) {
|
|
807
|
-
_this.
|
|
808
|
-
_this.
|
|
809
|
-
if (_this.
|
|
810
|
-
_this.
|
|
811
|
-
ceInstance.validate(_this.
|
|
818
|
+
_this.akXD += 1;
|
|
819
|
+
_this.GJsb = _this.BcDf(_this.akXD, _this.ehaO.oKkN, _this.ehaO.CKgT);
|
|
820
|
+
if (_this.GJsb) {
|
|
821
|
+
_this.ehaO.SHrN = time;
|
|
822
|
+
ceInstance.validate(_this.FqJf, _this.WLVW);
|
|
812
823
|
}
|
|
813
824
|
}
|
|
814
825
|
});
|
|
815
|
-
_defineProperty(this, "
|
|
826
|
+
_defineProperty(this, "xsmN", function (type, name, time, additionalInfo) {
|
|
816
827
|
var ceInstance = CE.getInstance();
|
|
817
|
-
var validationStatus = generateKey(_this.
|
|
828
|
+
var validationStatus = generateKey(_this.rkRi.rXTM) === type && _this.IHQA(time, _this.rkRi.tzep) && _this.rkRi.kuZn.lKfZ === name && _this.YnRU(_this.rkRi.kuZn.xDaw, additionalInfo);
|
|
818
829
|
if (validationStatus) {
|
|
819
|
-
_this.
|
|
820
|
-
_this.
|
|
821
|
-
if (_this.
|
|
822
|
-
_this.
|
|
823
|
-
ceInstance.validateForTermination(_this.
|
|
830
|
+
_this.akXD += 1;
|
|
831
|
+
_this.GJsb = _this.BcDf(_this.akXD, _this.rkRi.oKkN, _this.rkRi.CKgT);
|
|
832
|
+
if (_this.GJsb) {
|
|
833
|
+
_this.rkRi.SHrN = time;
|
|
834
|
+
ceInstance.validateForTermination(_this.FqJf, _this.WLVW);
|
|
824
835
|
}
|
|
825
836
|
}
|
|
826
837
|
});
|
|
827
|
-
_defineProperty(this, "
|
|
828
|
-
var precondition = _this.
|
|
829
|
-
return generateKey(precondition.
|
|
838
|
+
_defineProperty(this, "PCkN", function (type, name, time, additionalInfo) {
|
|
839
|
+
var precondition = _this.ehaO.xiSw;
|
|
840
|
+
return generateKey(precondition.rXTM) === type && precondition.kuZn.lKfZ === name && _this.IHQA(time, precondition.tzep) && _this.YnRU(precondition.kuZn.xDaw, additionalInfo);
|
|
830
841
|
});
|
|
831
|
-
_defineProperty(this, "
|
|
842
|
+
_defineProperty(this, "IHQA", function (time, timeBounds) {
|
|
832
843
|
var currentTime = Math.ceil(time);
|
|
833
|
-
return currentTime > timeBounds.
|
|
844
|
+
return currentTime > timeBounds.MZxZ && currentTime < timeBounds.gheX;
|
|
834
845
|
});
|
|
835
|
-
_defineProperty(this, "
|
|
846
|
+
_defineProperty(this, "BcDf", function (current, required, operator) {
|
|
836
847
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
837
|
-
if (checkOld && _this.
|
|
838
|
-
current = current + _this.
|
|
848
|
+
if (checkOld && _this.ehaO.dWSg) {
|
|
849
|
+
current = current + _this.sVTX;
|
|
839
850
|
}
|
|
840
851
|
switch (operator) {
|
|
841
852
|
case "EQ":
|
|
@@ -852,7 +863,7 @@
|
|
|
852
863
|
return false;
|
|
853
864
|
}
|
|
854
865
|
});
|
|
855
|
-
_defineProperty(this, "
|
|
866
|
+
_defineProperty(this, "YnRU", function (expected, received) {
|
|
856
867
|
var status = true;
|
|
857
868
|
try {
|
|
858
869
|
var _loop = function _loop() {
|
|
@@ -877,11 +888,11 @@
|
|
|
877
888
|
loggedValues = [received[item]];
|
|
878
889
|
}
|
|
879
890
|
var match = loggedValues.some(function (loggedValue) {
|
|
880
|
-
return
|
|
891
|
+
return OjHn(loggedValue, expectedValue, operator);
|
|
881
892
|
});
|
|
882
893
|
status = status && match;
|
|
883
894
|
} else {
|
|
884
|
-
status = status &&
|
|
895
|
+
status = status && OjHn(received[item], expected[item], "EQ");
|
|
885
896
|
}
|
|
886
897
|
},
|
|
887
898
|
_ret;
|
|
@@ -900,13 +911,13 @@
|
|
|
900
911
|
key: "_displayCampaign",
|
|
901
912
|
value: function _displayCampaign(time) {
|
|
902
913
|
var ceInstance = CE.getInstance();
|
|
903
|
-
this.
|
|
904
|
-
if (this.
|
|
905
|
-
this.
|
|
906
|
-
this.
|
|
907
|
-
if (this.
|
|
908
|
-
this.
|
|
909
|
-
ceInstance.validate(this.
|
|
914
|
+
this.GJsb = true;
|
|
915
|
+
if (this.GJsb) {
|
|
916
|
+
this.akXD += 1;
|
|
917
|
+
this.GJsb = this.BcDf(this.akXD, this.ehaO.oKkN, this.ehaO.CKgT);
|
|
918
|
+
if (this.GJsb) {
|
|
919
|
+
this.ehaO.SHrN = time;
|
|
920
|
+
ceInstance.validate(this.FqJf, this.WLVW);
|
|
910
921
|
}
|
|
911
922
|
}
|
|
912
923
|
}
|
|
@@ -923,20 +934,20 @@
|
|
|
923
934
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
924
935
|
var _this = this;
|
|
925
936
|
_classCallCheck(this, OverallConfig);
|
|
926
|
-
_defineProperty(this, "
|
|
937
|
+
_defineProperty(this, "NpXz", []);
|
|
927
938
|
_defineProperty(this, "_ret_day", {});
|
|
928
|
-
_defineProperty(this, "
|
|
929
|
-
_defineProperty(this, "
|
|
930
|
-
_defineProperty(this, "
|
|
939
|
+
_defineProperty(this, "MiYE", {});
|
|
940
|
+
_defineProperty(this, "FLiS", false);
|
|
941
|
+
_defineProperty(this, "DdTA", false);
|
|
931
942
|
_defineProperty(this, "parse", function () {
|
|
932
943
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
933
944
|
try {
|
|
934
|
-
_this.
|
|
945
|
+
_this.NpXz = config.overall_cfg.events;
|
|
935
946
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
936
|
-
_this.
|
|
937
|
-
_this.
|
|
938
|
-
_this.
|
|
939
|
-
_this.
|
|
947
|
+
_this.MiYE = config.overall_cfg.session;
|
|
948
|
+
_this.FLiS = config.overall_cfg.toggleRetDay;
|
|
949
|
+
_this.NpXz = config.overall_cfg.events;
|
|
950
|
+
_this.DdTA = config.overall_cfg.toggleSession;
|
|
940
951
|
} catch (error) {
|
|
941
952
|
Logger$6.error(error);
|
|
942
953
|
return false;
|
|
@@ -946,10 +957,10 @@
|
|
|
946
957
|
_defineProperty(this, "validate", function () {
|
|
947
958
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
948
959
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
949
|
-
if (_this.
|
|
960
|
+
if (_this.FLiS && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
950
961
|
return false;
|
|
951
962
|
}
|
|
952
|
-
if (_this.
|
|
963
|
+
if (_this.DdTA && !isNaN(retainedSession) && !(retainedSession >= _this.MiYE.from && retainedSession <= _this.MiYE.to)) {
|
|
953
964
|
return false;
|
|
954
965
|
}
|
|
955
966
|
try {
|
|
@@ -957,8 +968,8 @@
|
|
|
957
968
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
958
969
|
var siteid = Apxor.getSiteId();
|
|
959
970
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
960
|
-
for (var i = 0; i < _this.
|
|
961
|
-
var evName = _this.
|
|
971
|
+
for (var i = 0; i < _this.NpXz.length; i++) {
|
|
972
|
+
var evName = _this.NpXz[i].name.replace("'", "").replace("’", "");
|
|
962
973
|
if (LtCountObjDecoded[evName]) {
|
|
963
974
|
return false;
|
|
964
975
|
}
|
|
@@ -974,14 +985,14 @@
|
|
|
974
985
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
975
986
|
var _this = this;
|
|
976
987
|
_classCallCheck(this, Attributes);
|
|
977
|
-
_defineProperty(this, "
|
|
978
|
-
_defineProperty(this, "
|
|
988
|
+
_defineProperty(this, "MSCc", []);
|
|
989
|
+
_defineProperty(this, "HuDN", []);
|
|
979
990
|
_defineProperty(this, "parse", function () {
|
|
980
991
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
981
992
|
try {
|
|
982
|
-
_this.
|
|
983
|
-
_this.
|
|
984
|
-
if (!Array.isArray(_this.
|
|
993
|
+
_this.MSCc = config.attributes.user;
|
|
994
|
+
_this.HuDN = config.attributes.session;
|
|
995
|
+
if (!Array.isArray(_this.MSCc) || !Array.isArray(_this.HuDN)) {
|
|
985
996
|
Logger$7.error("No attributes");
|
|
986
997
|
return false;
|
|
987
998
|
}
|
|
@@ -992,9 +1003,9 @@
|
|
|
992
1003
|
return true;
|
|
993
1004
|
});
|
|
994
1005
|
_defineProperty(this, "validate", function (user, session) {
|
|
995
|
-
return _this.
|
|
1006
|
+
return _this.zQwl(user, _this.MSCc) && _this.zQwl(session, _this.HuDN);
|
|
996
1007
|
});
|
|
997
|
-
_defineProperty(this, "
|
|
1008
|
+
_defineProperty(this, "zQwl", function (attributes, expected) {
|
|
998
1009
|
var length = expected.length;
|
|
999
1010
|
var status = true;
|
|
1000
1011
|
try {
|
|
@@ -1024,7 +1035,7 @@
|
|
|
1024
1035
|
}
|
|
1025
1036
|
var match = loggedValues.some(function (loggedValue) {
|
|
1026
1037
|
return values.some(function (configValue) {
|
|
1027
|
-
return
|
|
1038
|
+
return OjHn(loggedValue, configValue, operator);
|
|
1028
1039
|
});
|
|
1029
1040
|
});
|
|
1030
1041
|
status = status && match;
|
|
@@ -1048,18 +1059,18 @@
|
|
|
1048
1059
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1049
1060
|
var _this = this;
|
|
1050
1061
|
_classCallCheck(this, TimeBasedTermination);
|
|
1051
|
-
_defineProperty(this, "
|
|
1062
|
+
_defineProperty(this, "OCNT", Apxor.getController());
|
|
1052
1063
|
_defineProperty(this, "type", "");
|
|
1053
1064
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1054
|
-
_defineProperty(this, "
|
|
1065
|
+
_defineProperty(this, "dXMg", 1);
|
|
1055
1066
|
_defineProperty(this, "parse", function (config) {
|
|
1056
1067
|
try {
|
|
1057
1068
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1058
|
-
_this.
|
|
1069
|
+
_this.KSOj = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1059
1070
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1060
|
-
_this.
|
|
1061
|
-
if (_this.
|
|
1062
|
-
_this.
|
|
1071
|
+
_this.dXMg = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1072
|
+
if (_this.OjHn(config._id)) {
|
|
1073
|
+
_this.OCNT.persistTerminationInfoLocally(config._id);
|
|
1063
1074
|
return false;
|
|
1064
1075
|
}
|
|
1065
1076
|
} catch (_unused) {
|
|
@@ -1067,16 +1078,16 @@
|
|
|
1067
1078
|
}
|
|
1068
1079
|
return true;
|
|
1069
1080
|
});
|
|
1070
|
-
_defineProperty(this, "
|
|
1081
|
+
_defineProperty(this, "OjHn", function (id) {
|
|
1071
1082
|
var _Data$id;
|
|
1072
|
-
var Data = JSON.parse(_this.
|
|
1083
|
+
var Data = JSON.parse(_this.OCNT.getFromStorage(APX_TERMINATION_ID));
|
|
1073
1084
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1074
1085
|
var startDate = new Date(Data[id].startDate);
|
|
1075
1086
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1076
1087
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1077
1088
|
var currentTime = _getTime();
|
|
1078
|
-
var
|
|
1079
|
-
return diff === _this.
|
|
1089
|
+
var Hztt = Data[id].Hztt;
|
|
1090
|
+
return diff === _this.dXMg && currentTime.hours >= Hztt.hours || diff > _this.dXMg || Data[id].goalAcheived;
|
|
1080
1091
|
});
|
|
1081
1092
|
});
|
|
1082
1093
|
|
|
@@ -1085,19 +1096,19 @@
|
|
|
1085
1096
|
_classCallCheck(this, TerminationInfo);
|
|
1086
1097
|
_defineProperty(this, "enable_goal_events", false);
|
|
1087
1098
|
_defineProperty(this, "attributes", {});
|
|
1088
|
-
_defineProperty(this, "
|
|
1089
|
-
_defineProperty(this, "
|
|
1099
|
+
_defineProperty(this, "hQNV", new Attributes());
|
|
1100
|
+
_defineProperty(this, "NQJh", new TimeBasedTermination());
|
|
1090
1101
|
_defineProperty(this, "parse", function () {
|
|
1091
1102
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1092
1103
|
try {
|
|
1093
1104
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1094
1105
|
_this.enable_time_based = config === null || config === void 0 || (_config$terminate_inf = config.terminate_info) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.enable_time_based;
|
|
1095
|
-
if (_this.enable_time_based && !_this.
|
|
1106
|
+
if (_this.enable_time_based && !_this.NQJh.parse(config)) {
|
|
1096
1107
|
return false;
|
|
1097
1108
|
}
|
|
1098
1109
|
_this.enable_goal_events = config === null || config === void 0 || (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.enable_goal_events;
|
|
1099
1110
|
_this.enable_attributes = config === null || config === void 0 || (_config$terminate_inf3 = config.terminate_info) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.enable_attributes;
|
|
1100
|
-
if (_this.enable_attributes && !_this.
|
|
1111
|
+
if (_this.enable_attributes && !_this.hQNV.parse(config.terminate_info)) {
|
|
1101
1112
|
return false;
|
|
1102
1113
|
}
|
|
1103
1114
|
} catch (error) {
|
|
@@ -1107,7 +1118,7 @@
|
|
|
1107
1118
|
return true;
|
|
1108
1119
|
});
|
|
1109
1120
|
_defineProperty(this, "validate", function (user, session) {
|
|
1110
|
-
return _this.
|
|
1121
|
+
return _this.hQNV.validate(user, session);
|
|
1111
1122
|
});
|
|
1112
1123
|
});
|
|
1113
1124
|
|
|
@@ -1115,17 +1126,17 @@
|
|
|
1115
1126
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1116
1127
|
var _this = this;
|
|
1117
1128
|
_classCallCheck(this, ConfigItem);
|
|
1118
|
-
_defineProperty(this, "
|
|
1119
|
-
_defineProperty(this, "
|
|
1120
|
-
_defineProperty(this, "
|
|
1121
|
-
_defineProperty(this, "
|
|
1122
|
-
_defineProperty(this, "
|
|
1123
|
-
_defineProperty(this, "
|
|
1124
|
-
_defineProperty(this, "
|
|
1125
|
-
_defineProperty(this, "
|
|
1126
|
-
_defineProperty(this, "
|
|
1127
|
-
_defineProperty(this, "
|
|
1128
|
-
_defineProperty(this, "
|
|
1129
|
+
_defineProperty(this, "xJBM", []);
|
|
1130
|
+
_defineProperty(this, "vlff", []);
|
|
1131
|
+
_defineProperty(this, "FqJf", "");
|
|
1132
|
+
_defineProperty(this, "nWdU", new Meta());
|
|
1133
|
+
_defineProperty(this, "NGHV", new Audience());
|
|
1134
|
+
_defineProperty(this, "Avzx", new Validity());
|
|
1135
|
+
_defineProperty(this, "znWc", new Frequency());
|
|
1136
|
+
_defineProperty(this, "TaRN", new OverallConfig());
|
|
1137
|
+
_defineProperty(this, "QowM", new TerminationInfo());
|
|
1138
|
+
_defineProperty(this, "sajn", false);
|
|
1139
|
+
_defineProperty(this, "pzra", []);
|
|
1129
1140
|
_defineProperty(this, "parse", function () {
|
|
1130
1141
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1131
1142
|
try {
|
|
@@ -1142,7 +1153,7 @@
|
|
|
1142
1153
|
}
|
|
1143
1154
|
|
|
1144
1155
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1145
|
-
if (!(_this.
|
|
1156
|
+
if (!(_this.nWdU.parse(config) && _this.Avzx.parse(config) && _this.znWc.parse(config) && _this.NGHV.parse(config) && _this.TaRN.parse(config) && _this.QowM.parse(config))) {
|
|
1146
1157
|
return false;
|
|
1147
1158
|
}
|
|
1148
1159
|
|
|
@@ -1151,9 +1162,9 @@
|
|
|
1151
1162
|
Logger$8.error("No valid conditions", config.conditions);
|
|
1152
1163
|
return false;
|
|
1153
1164
|
}
|
|
1154
|
-
_this.
|
|
1155
|
-
_this.
|
|
1156
|
-
if (_this.
|
|
1165
|
+
_this.FqJf = config._id;
|
|
1166
|
+
_this.sajn = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1167
|
+
if (_this.sajn) {
|
|
1157
1168
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1158
1169
|
// We need to sort, if server sends them in orderless manner
|
|
1159
1170
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1165,17 +1176,17 @@
|
|
|
1165
1176
|
var conditions = config.conditions;
|
|
1166
1177
|
var length = conditions.length;
|
|
1167
1178
|
for (var index = 0; index < length; index++) {
|
|
1168
|
-
_this.
|
|
1179
|
+
_this.pzra = [];
|
|
1169
1180
|
var condition = conditions[index];
|
|
1170
1181
|
if (condition.type === "didn't") {
|
|
1171
|
-
var
|
|
1182
|
+
var ehaO$details;
|
|
1172
1183
|
var obj = {
|
|
1173
1184
|
trigger_key: condition.trigger.details.name,
|
|
1174
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1185
|
+
no_kpi_array: condition === null || condition === void 0 || (ehaO$details = condition.details) === null || ehaO$details === void 0 || (ehaO$details = ehaO$details.additional_info) === null || ehaO$details === void 0 ? void 0 : ehaO$details.nkpi,
|
|
1175
1186
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1176
1187
|
time_bounds: condition.time_bounds.upper
|
|
1177
1188
|
};
|
|
1178
|
-
_this.
|
|
1189
|
+
_this.pzra = [].concat(_toConsumableArray(_this.pzra), [obj]);
|
|
1179
1190
|
//this will be the key
|
|
1180
1191
|
//when event occur check this array and then then check the time
|
|
1181
1192
|
//check the time diffrence
|
|
@@ -1184,73 +1195,73 @@
|
|
|
1184
1195
|
}
|
|
1185
1196
|
|
|
1186
1197
|
var conditionValidator = new ConditionValidator();
|
|
1187
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1188
|
-
_this.
|
|
1198
|
+
if (conditionValidator.initialize(condition, _this.FqJf, index, _this.sajn, _this.pzra)) {
|
|
1199
|
+
_this.xJBM.push(conditionValidator);
|
|
1189
1200
|
}
|
|
1190
1201
|
}
|
|
1191
|
-
if (_this.
|
|
1202
|
+
if (_this.QowM.enable_goal_events) {
|
|
1192
1203
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1193
1204
|
var goaleventslength = goal_events.length;
|
|
1194
1205
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1195
1206
|
var _conditionValidator = new ConditionValidator();
|
|
1196
|
-
if (_conditionValidator.initialize(goal_events[i], _this.
|
|
1197
|
-
_this.
|
|
1207
|
+
if (_conditionValidator.initialize(goal_events[i], _this.FqJf, i, true, [], "termination")) {
|
|
1208
|
+
_this.vlff.push(_conditionValidator);
|
|
1198
1209
|
}
|
|
1199
1210
|
}
|
|
1200
1211
|
}
|
|
1201
|
-
return _this.
|
|
1212
|
+
return _this.xJBM.length > 0;
|
|
1202
1213
|
} catch (error) {
|
|
1203
1214
|
Logger$8.error(error);
|
|
1204
1215
|
return false;
|
|
1205
1216
|
}
|
|
1206
1217
|
});
|
|
1207
|
-
_defineProperty(this, "
|
|
1218
|
+
_defineProperty(this, "GjfG", function (index) {
|
|
1208
1219
|
if (index < 0) {
|
|
1209
1220
|
return;
|
|
1210
1221
|
}
|
|
1211
|
-
if (_this.
|
|
1212
|
-
var conditionValidator = _this.
|
|
1213
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1222
|
+
if (_this.sajn) {
|
|
1223
|
+
var conditionValidator = _this.xJBM[index];
|
|
1224
|
+
if (isDefined(conditionValidator) && conditionValidator.GJsb) {
|
|
1214
1225
|
// Check if previous validator is satisfied
|
|
1215
|
-
var prevValidator = _this.
|
|
1216
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1226
|
+
var prevValidator = _this.xJBM[index - 1];
|
|
1227
|
+
if (isDefined(prevValidator) && !prevValidator.GJsb) {
|
|
1217
1228
|
// TODO: If current index is satisfied before previous one, do something
|
|
1218
1229
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1219
1230
|
return;
|
|
1220
1231
|
}
|
|
1221
|
-
var nextValidator = _this.
|
|
1232
|
+
var nextValidator = _this.xJBM[index + 1];
|
|
1222
1233
|
if (!isDefined(nextValidator)) {
|
|
1223
1234
|
// It means this is the last condition
|
|
1224
1235
|
// Validate all conditions
|
|
1225
|
-
_this.
|
|
1236
|
+
_this.FnDf();
|
|
1226
1237
|
} else {
|
|
1227
|
-
nextValidator.
|
|
1238
|
+
nextValidator.hian();
|
|
1228
1239
|
}
|
|
1229
1240
|
}
|
|
1230
1241
|
} else {
|
|
1231
1242
|
// Validate all conditions
|
|
1232
|
-
_this.
|
|
1243
|
+
_this.FnDf();
|
|
1233
1244
|
}
|
|
1234
1245
|
});
|
|
1235
|
-
_defineProperty(this, "
|
|
1246
|
+
_defineProperty(this, "pYOs", function (index) {
|
|
1236
1247
|
if (index < 0) {
|
|
1237
1248
|
return;
|
|
1238
1249
|
}
|
|
1239
|
-
_this.
|
|
1250
|
+
_this.YpOv();
|
|
1240
1251
|
});
|
|
1241
|
-
_defineProperty(this, "
|
|
1252
|
+
_defineProperty(this, "FnDf", function () {
|
|
1242
1253
|
// Check If Audience, Validity is satisfied or not
|
|
1243
1254
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1244
1255
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1245
|
-
if (!_this.
|
|
1256
|
+
if (!_this.Avzx.validate() || !_this.NGHV.validate(userAttributes, sessionAttributes) || !_this.TaRN.validate()) {
|
|
1246
1257
|
return;
|
|
1247
1258
|
}
|
|
1248
|
-
var length = _this.
|
|
1259
|
+
var length = _this.xJBM.length;
|
|
1249
1260
|
var isSatisfied = length < 1;
|
|
1250
1261
|
var combineOperator = "";
|
|
1251
1262
|
for (var index = 0; index < length; index++) {
|
|
1252
|
-
var validator = _this.
|
|
1253
|
-
var currentResult = validator.
|
|
1263
|
+
var validator = _this.xJBM[index];
|
|
1264
|
+
var currentResult = validator.GJsb;
|
|
1254
1265
|
if (combineOperator.trim() === "") {
|
|
1255
1266
|
isSatisfied = currentResult;
|
|
1256
1267
|
} else {
|
|
@@ -1263,39 +1274,39 @@
|
|
|
1263
1274
|
break;
|
|
1264
1275
|
}
|
|
1265
1276
|
}
|
|
1266
|
-
combineOperator = validator.
|
|
1277
|
+
combineOperator = validator.LNgq;
|
|
1267
1278
|
}
|
|
1268
1279
|
if (isSatisfied) {
|
|
1269
1280
|
console.debug("onCondition satisfied");
|
|
1270
1281
|
// Check if count reached it's maximum
|
|
1271
|
-
if (!_this.
|
|
1272
|
-
console.warn("Maximum limit reached", _this.
|
|
1282
|
+
if (!_this.znWc.TzLe(_this.FqJf)) {
|
|
1283
|
+
console.warn("Maximum limit reached", _this.FqJf);
|
|
1273
1284
|
return;
|
|
1274
1285
|
}
|
|
1275
|
-
console.log("Dispatching event", _this.
|
|
1276
|
-
if (_this.
|
|
1277
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1278
|
-
message_name: _this.
|
|
1279
|
-
id: _this.
|
|
1286
|
+
console.log("Dispatching event", _this.nWdU.KSOj);
|
|
1287
|
+
if (_this.nWdU._only_context === true) {
|
|
1288
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.nWdU._attr), {}, {
|
|
1289
|
+
message_name: _this.nWdU.lKfZ,
|
|
1290
|
+
id: _this.FqJf
|
|
1280
1291
|
}));
|
|
1281
1292
|
}
|
|
1282
1293
|
// Emit event
|
|
1283
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1284
|
-
name: _this.
|
|
1294
|
+
Apxor.getController().dispatchEvent(_this.nWdU.KSOj, {
|
|
1295
|
+
name: _this.nWdU.KSOj,
|
|
1285
1296
|
additional_info: {
|
|
1286
|
-
uuid: _this.
|
|
1287
|
-
name: _this.
|
|
1297
|
+
uuid: _this.FqJf,
|
|
1298
|
+
name: _this.nWdU.lKfZ
|
|
1288
1299
|
}
|
|
1289
1300
|
});
|
|
1290
1301
|
}
|
|
1291
1302
|
});
|
|
1292
|
-
_defineProperty(this, "
|
|
1293
|
-
var length = _this.
|
|
1303
|
+
_defineProperty(this, "YpOv", function () {
|
|
1304
|
+
var length = _this.vlff.length;
|
|
1294
1305
|
var isSatisfied = length < 1;
|
|
1295
1306
|
var combineOperator = "";
|
|
1296
1307
|
for (var index = 0; index < length; index++) {
|
|
1297
|
-
var validator = _this.
|
|
1298
|
-
var currentResult = validator.
|
|
1308
|
+
var validator = _this.vlff[index];
|
|
1309
|
+
var currentResult = validator.GJsb;
|
|
1299
1310
|
if (combineOperator.trim() === "") {
|
|
1300
1311
|
isSatisfied = currentResult;
|
|
1301
1312
|
} else {
|
|
@@ -1308,23 +1319,23 @@
|
|
|
1308
1319
|
break;
|
|
1309
1320
|
}
|
|
1310
1321
|
}
|
|
1311
|
-
combineOperator = validator.
|
|
1322
|
+
combineOperator = validator.WFrp;
|
|
1312
1323
|
}
|
|
1313
1324
|
if (isSatisfied) {
|
|
1314
|
-
console.log("Dispatching event", _this.
|
|
1315
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1316
|
-
if (_this.
|
|
1317
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1318
|
-
message_name: _this.
|
|
1319
|
-
id: _this.
|
|
1325
|
+
console.log("Dispatching event", _this.nWdU.KSOj);
|
|
1326
|
+
Apxor.getController().persistTerminationInfoLocally(_this.FqJf);
|
|
1327
|
+
if (_this.nWdU._only_context === true) {
|
|
1328
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.nWdU._attr), {}, {
|
|
1329
|
+
message_name: _this.nWdU.lKfZ,
|
|
1330
|
+
id: _this.FqJf
|
|
1320
1331
|
}));
|
|
1321
1332
|
}
|
|
1322
1333
|
// Emit event
|
|
1323
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1324
|
-
name: _this.
|
|
1334
|
+
Apxor.getController().dispatchEvent(_this.nWdU.KSOj, {
|
|
1335
|
+
name: _this.nWdU.KSOj,
|
|
1325
1336
|
additional_info: {
|
|
1326
|
-
uuid: _this.
|
|
1327
|
-
name: _this.
|
|
1337
|
+
uuid: _this.FqJf,
|
|
1338
|
+
name: _this.nWdU.lKfZ
|
|
1328
1339
|
}
|
|
1329
1340
|
});
|
|
1330
1341
|
}
|
|
@@ -1332,23 +1343,23 @@
|
|
|
1332
1343
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1333
1344
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1334
1345
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1335
|
-
return _this.
|
|
1346
|
+
return _this.QowM.validate(userAttributes, sessionAttributes);
|
|
1336
1347
|
});
|
|
1337
|
-
_defineProperty(this, "
|
|
1338
|
-
_this.
|
|
1348
|
+
_defineProperty(this, "ErGD", function () {
|
|
1349
|
+
_this.znWc.ErGD();
|
|
1339
1350
|
});
|
|
1340
1351
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1341
|
-
return _this.
|
|
1352
|
+
return _this.znWc.getFrequencyCount();
|
|
1342
1353
|
});
|
|
1343
|
-
_defineProperty(this, "
|
|
1344
|
-
return _this.
|
|
1354
|
+
_defineProperty(this, "KnFr", function () {
|
|
1355
|
+
return _this.znWc.Kbwh();
|
|
1345
1356
|
});
|
|
1346
1357
|
});
|
|
1347
1358
|
|
|
1348
1359
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1349
1360
|
var _this = this;
|
|
1350
1361
|
_classCallCheck(this, ConfigLookup);
|
|
1351
|
-
_defineProperty(this, "
|
|
1362
|
+
_defineProperty(this, "XvSv", {});
|
|
1352
1363
|
_defineProperty(this, "parse", function () {
|
|
1353
1364
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1354
1365
|
configs: []
|
|
@@ -1371,7 +1382,7 @@
|
|
|
1371
1382
|
var configId = _config._id;
|
|
1372
1383
|
var configItem = new ConfigItem();
|
|
1373
1384
|
if (configItem.parse(_config)) {
|
|
1374
|
-
_this.
|
|
1385
|
+
_this.XvSv[configId] = configItem;
|
|
1375
1386
|
} else {
|
|
1376
1387
|
console.warn("Failed to parse cfg", configId);
|
|
1377
1388
|
}
|
|
@@ -1379,44 +1390,44 @@
|
|
|
1379
1390
|
}
|
|
1380
1391
|
});
|
|
1381
1392
|
_defineProperty(this, "validate", function (id, index) {
|
|
1382
|
-
if (_this.
|
|
1383
|
-
var configItem = _this.
|
|
1384
|
-
configItem.
|
|
1393
|
+
if (_this.XvSv[id]) {
|
|
1394
|
+
var configItem = _this.XvSv[id];
|
|
1395
|
+
configItem.GjfG(index);
|
|
1385
1396
|
}
|
|
1386
1397
|
});
|
|
1387
1398
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1388
|
-
if (_this.
|
|
1389
|
-
var configItem = _this.
|
|
1390
|
-
configItem.
|
|
1399
|
+
if (_this.XvSv[id]) {
|
|
1400
|
+
var configItem = _this.XvSv[id];
|
|
1401
|
+
configItem.pYOs(index);
|
|
1391
1402
|
}
|
|
1392
1403
|
});
|
|
1393
1404
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1394
|
-
if (_this.
|
|
1395
|
-
var configItem = _this.
|
|
1405
|
+
if (_this.XvSv[id]) {
|
|
1406
|
+
var configItem = _this.XvSv[id];
|
|
1396
1407
|
return configItem.validateForTerminationAttributes();
|
|
1397
1408
|
}
|
|
1398
1409
|
return false;
|
|
1399
1410
|
});
|
|
1400
|
-
_defineProperty(this, "
|
|
1401
|
-
var campiagnConfig = _this.
|
|
1402
|
-
campiagnConfig.
|
|
1411
|
+
_defineProperty(this, "ErGD", function (id) {
|
|
1412
|
+
var campiagnConfig = _this.XvSv[id];
|
|
1413
|
+
campiagnConfig.ErGD();
|
|
1403
1414
|
});
|
|
1404
1415
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1405
|
-
var campiagnConfig = _this.
|
|
1416
|
+
var campiagnConfig = _this.XvSv[id];
|
|
1406
1417
|
return campiagnConfig.getFrequencyCount();
|
|
1407
1418
|
});
|
|
1408
1419
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1409
|
-
var configs = _this.
|
|
1420
|
+
var configs = _this.XvSv;
|
|
1410
1421
|
for (var configId in configs) {
|
|
1411
|
-
configs[configId].
|
|
1422
|
+
configs[configId].KnFr();
|
|
1412
1423
|
}
|
|
1413
1424
|
});
|
|
1414
|
-
_defineProperty(this, "
|
|
1425
|
+
_defineProperty(this, "Asov", function (campaignId) {
|
|
1415
1426
|
try {
|
|
1416
|
-
if (_this.
|
|
1417
|
-
var configItem = _this.
|
|
1418
|
-
if (configItem && configItem.
|
|
1419
|
-
return configItem.
|
|
1427
|
+
if (_this.XvSv) {
|
|
1428
|
+
var configItem = _this.XvSv[campaignId];
|
|
1429
|
+
if (configItem && configItem.nWdU) {
|
|
1430
|
+
return configItem.nWdU;
|
|
1420
1431
|
}
|
|
1421
1432
|
}
|
|
1422
1433
|
} catch (e) {
|
|
@@ -1432,42 +1443,42 @@
|
|
|
1432
1443
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1433
1444
|
var _this = this;
|
|
1434
1445
|
_classCallCheck(this, EventsListener);
|
|
1435
|
-
_defineProperty(this, "
|
|
1436
|
-
_defineProperty(this, "
|
|
1437
|
-
_defineProperty(this, "
|
|
1446
|
+
_defineProperty(this, "AZee", {});
|
|
1447
|
+
_defineProperty(this, "GHrG", []);
|
|
1448
|
+
_defineProperty(this, "HJfd", false);
|
|
1438
1449
|
_defineProperty(this, "initialize", function () {
|
|
1439
1450
|
var controller = Apxor.getController();
|
|
1440
1451
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1441
|
-
return _this.
|
|
1452
|
+
return _this.gFEv(event, "AE");
|
|
1442
1453
|
});
|
|
1443
1454
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1444
|
-
return _this.
|
|
1455
|
+
return _this.gFEv(event, "CE");
|
|
1445
1456
|
});
|
|
1446
1457
|
});
|
|
1447
|
-
_defineProperty(this, "
|
|
1458
|
+
_defineProperty(this, "KqaR", function () {
|
|
1448
1459
|
// Clear Buffer
|
|
1449
|
-
for (var item in _this.
|
|
1450
|
-
_this.
|
|
1460
|
+
for (var item in _this.GHrG) {
|
|
1461
|
+
_this.wTap(item.event, item.key, item.type);
|
|
1451
1462
|
}
|
|
1452
|
-
_this.
|
|
1463
|
+
_this.HJfd = true;
|
|
1453
1464
|
});
|
|
1454
|
-
_defineProperty(this, "
|
|
1465
|
+
_defineProperty(this, "HaQv", function (event, callback) {
|
|
1455
1466
|
if (!isFunction(callback)) {
|
|
1456
1467
|
return;
|
|
1457
1468
|
}
|
|
1458
1469
|
var listeners;
|
|
1459
|
-
if (_this.
|
|
1460
|
-
listeners = _this.
|
|
1470
|
+
if (_this.AZee[event]) {
|
|
1471
|
+
listeners = _this.AZee[event];
|
|
1461
1472
|
} else {
|
|
1462
1473
|
listeners = [];
|
|
1463
1474
|
}
|
|
1464
1475
|
listeners.push(callback);
|
|
1465
|
-
_this.
|
|
1466
|
-
Logger$9.debug("Listeners list: ", _this.
|
|
1476
|
+
_this.AZee[event] = listeners;
|
|
1477
|
+
Logger$9.debug("Listeners list: ", _this.AZee);
|
|
1467
1478
|
});
|
|
1468
1479
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1469
|
-
if (_this.
|
|
1470
|
-
var listeners = _this.
|
|
1480
|
+
if (_this.AZee[event]) {
|
|
1481
|
+
var listeners = _this.AZee[event];
|
|
1471
1482
|
var updatedListeners = [];
|
|
1472
1483
|
for (var index = 0; index < listeners.length; index++) {
|
|
1473
1484
|
var listener = listeners[index];
|
|
@@ -1475,25 +1486,25 @@
|
|
|
1475
1486
|
updatedListeners.push(listener);
|
|
1476
1487
|
}
|
|
1477
1488
|
}
|
|
1478
|
-
_this.
|
|
1489
|
+
_this.AZee[event] = updatedListeners;
|
|
1479
1490
|
}
|
|
1480
1491
|
});
|
|
1481
|
-
_defineProperty(this, "
|
|
1492
|
+
_defineProperty(this, "gFEv", function (event) {
|
|
1482
1493
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1483
1494
|
var key = type + "___" + event.name;
|
|
1484
|
-
_this.
|
|
1495
|
+
_this.wTap(event, key, type);
|
|
1485
1496
|
});
|
|
1486
|
-
_defineProperty(this, "
|
|
1487
|
-
if (!_this.
|
|
1488
|
-
_this.
|
|
1497
|
+
_defineProperty(this, "wTap", function (event, key, type) {
|
|
1498
|
+
if (!_this.HJfd) {
|
|
1499
|
+
_this.GHrG.push({
|
|
1489
1500
|
event: event,
|
|
1490
1501
|
key: key,
|
|
1491
1502
|
type: type
|
|
1492
1503
|
});
|
|
1493
1504
|
} else {
|
|
1494
|
-
Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1495
|
-
if (_this.
|
|
1496
|
-
var listeners = _this.
|
|
1505
|
+
Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.AZee);
|
|
1506
|
+
if (_this.AZee[key]) {
|
|
1507
|
+
var listeners = _this.AZee[key];
|
|
1497
1508
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1498
1509
|
for (var index = 0; index < listeners.length; index++) {
|
|
1499
1510
|
var listener = listeners[index];
|
|
@@ -1509,17 +1520,17 @@
|
|
|
1509
1520
|
function CE() {
|
|
1510
1521
|
var _this = this;
|
|
1511
1522
|
_classCallCheck(this, CE);
|
|
1512
|
-
_defineProperty(this, "
|
|
1513
|
-
_defineProperty(this, "
|
|
1514
|
-
_defineProperty(this, "
|
|
1515
|
-
_defineProperty(this, "
|
|
1516
|
-
_defineProperty(this, "
|
|
1523
|
+
_defineProperty(this, "RNCW", false);
|
|
1524
|
+
_defineProperty(this, "vozs", null);
|
|
1525
|
+
_defineProperty(this, "OpCt", getDateInDDMMYYYY());
|
|
1526
|
+
_defineProperty(this, "HLag", new EventsListener());
|
|
1527
|
+
_defineProperty(this, "mhlV", Apxor.getSiteId());
|
|
1517
1528
|
_defineProperty(this, "_qeState", {});
|
|
1518
1529
|
_defineProperty(this, "getQeState", function () {
|
|
1519
1530
|
try {
|
|
1520
1531
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1521
1532
|
if (data) {
|
|
1522
|
-
return JSON.parse(decode(_this.
|
|
1533
|
+
return JSON.parse(decode(_this.mhlV, data));
|
|
1523
1534
|
} else {
|
|
1524
1535
|
_this._qeState = {};
|
|
1525
1536
|
return _this.setQeState();
|
|
@@ -1548,10 +1559,10 @@
|
|
|
1548
1559
|
return _this._qeState;
|
|
1549
1560
|
});
|
|
1550
1561
|
_defineProperty(this, "initialize", function () {
|
|
1551
|
-
if (!_this.
|
|
1552
|
-
_this.
|
|
1553
|
-
_this.
|
|
1554
|
-
_this.
|
|
1562
|
+
if (!_this.RNCW) {
|
|
1563
|
+
_this.RNCW = true;
|
|
1564
|
+
_this.vozs = new ConfigLookup();
|
|
1565
|
+
_this.HLag.initialize();
|
|
1555
1566
|
_this._qeState = _this.getQeState();
|
|
1556
1567
|
Logger$a.info("QE Initialized..");
|
|
1557
1568
|
}
|
|
@@ -1562,12 +1573,12 @@
|
|
|
1562
1573
|
* @param config
|
|
1563
1574
|
*/
|
|
1564
1575
|
_defineProperty(this, "parse", function (config) {
|
|
1565
|
-
if (!_this.
|
|
1576
|
+
if (!_this.wVJP()) {
|
|
1566
1577
|
Logger$a.warn("Must call init first. Unable to proceed");
|
|
1567
1578
|
return;
|
|
1568
1579
|
}
|
|
1569
|
-
_this.
|
|
1570
|
-
_this.
|
|
1580
|
+
_this.vozs.parse(config);
|
|
1581
|
+
_this.HLag.KqaR();
|
|
1571
1582
|
});
|
|
1572
1583
|
/**
|
|
1573
1584
|
* Validates all conditions for given config ID
|
|
@@ -1576,19 +1587,19 @@
|
|
|
1576
1587
|
* @param index
|
|
1577
1588
|
*/
|
|
1578
1589
|
_defineProperty(this, "validate", function (id, index) {
|
|
1579
|
-
if (!_this.
|
|
1590
|
+
if (!_this.wVJP()) {
|
|
1580
1591
|
return;
|
|
1581
1592
|
}
|
|
1582
|
-
_this.
|
|
1593
|
+
_this.vozs.validate(id, index);
|
|
1583
1594
|
});
|
|
1584
1595
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1585
|
-
if (!_this.
|
|
1596
|
+
if (!_this.wVJP()) {
|
|
1586
1597
|
return;
|
|
1587
1598
|
}
|
|
1588
|
-
_this.
|
|
1599
|
+
_this.vozs.validateForTermination(id, index);
|
|
1589
1600
|
});
|
|
1590
1601
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
1591
|
-
return _this.
|
|
1602
|
+
return _this.vozs.validateForTerminationAttributes(user, session);
|
|
1592
1603
|
});
|
|
1593
1604
|
_defineProperty(this, "updateCount", function (id) {
|
|
1594
1605
|
try {
|
|
@@ -1597,22 +1608,25 @@
|
|
|
1597
1608
|
}
|
|
1598
1609
|
_this.incrementFrequencies(id);
|
|
1599
1610
|
_this.setQeState(id);
|
|
1600
|
-
_this.
|
|
1611
|
+
_this.vozs.ErGD(id);
|
|
1601
1612
|
} catch (e) {
|
|
1602
1613
|
console.log("Could not update the count config:".concat(e));
|
|
1603
1614
|
}
|
|
1604
1615
|
});
|
|
1605
1616
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1606
|
-
_this.
|
|
1617
|
+
_this.vozs.resetFrequencyCounts();
|
|
1607
1618
|
});
|
|
1608
1619
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1609
|
-
return _this.
|
|
1620
|
+
return _this.vozs.getFrequencyCount(id);
|
|
1610
1621
|
});
|
|
1611
1622
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1612
|
-
_this.
|
|
1623
|
+
_this.HLag.HaQv(event, callback);
|
|
1613
1624
|
});
|
|
1614
1625
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1615
|
-
_this.
|
|
1626
|
+
_this.HLag.unregisterFromEvent(event, callback);
|
|
1627
|
+
});
|
|
1628
|
+
_defineProperty(this, "notifyEventListener", function (event) {
|
|
1629
|
+
_this.HLag.gFEv(event);
|
|
1616
1630
|
});
|
|
1617
1631
|
/**
|
|
1618
1632
|
* Fetches the config from Server
|
|
@@ -1625,14 +1639,14 @@
|
|
|
1625
1639
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1626
1640
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1627
1641
|
});
|
|
1628
|
-
_defineProperty(this, "
|
|
1629
|
-
return _this.
|
|
1642
|
+
_defineProperty(this, "wVJP", function () {
|
|
1643
|
+
return _this.RNCW;
|
|
1630
1644
|
});
|
|
1631
1645
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1632
|
-
return _this.
|
|
1646
|
+
return _this.vozs.Asov(campaignId);
|
|
1633
1647
|
});
|
|
1634
|
-
_defineProperty(this, "
|
|
1635
|
-
return _this.
|
|
1648
|
+
_defineProperty(this, "CmBi", function () {
|
|
1649
|
+
return _this.OpCt;
|
|
1636
1650
|
});
|
|
1637
1651
|
if (!CE.instance) {
|
|
1638
1652
|
CE.instance = this;
|
|
@@ -1656,7 +1670,7 @@
|
|
|
1656
1670
|
OVERALL: 0,
|
|
1657
1671
|
DATES: {}
|
|
1658
1672
|
};
|
|
1659
|
-
if (this.
|
|
1673
|
+
if (this.OpCt) this._qeState[id].DATES[this.OpCt] = 0;
|
|
1660
1674
|
this.setQeState(id);
|
|
1661
1675
|
}
|
|
1662
1676
|
} catch (e) {
|
|
@@ -1675,12 +1689,12 @@
|
|
|
1675
1689
|
|
|
1676
1690
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1677
1691
|
var currentDate = getDateInDDMMYYYY();
|
|
1678
|
-
if (currentDate !== this.
|
|
1679
|
-
this.
|
|
1692
|
+
if (currentDate !== this.OpCt || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
1693
|
+
this.OpCt = currentDate;
|
|
1680
1694
|
configFrequency.DATES = {};
|
|
1681
|
-
configFrequency.DATES[this.
|
|
1695
|
+
configFrequency.DATES[this.OpCt] = 0;
|
|
1682
1696
|
}
|
|
1683
|
-
configFrequency.DATES[this.
|
|
1697
|
+
configFrequency.DATES[this.OpCt] = configFrequency.DATES[this.OpCt] + 1;
|
|
1684
1698
|
}
|
|
1685
1699
|
}], [{
|
|
1686
1700
|
key: "getInstance",
|
|
@@ -1699,7 +1713,7 @@
|
|
|
1699
1713
|
|
|
1700
1714
|
/* eslint-disable no-empty */
|
|
1701
1715
|
|
|
1702
|
-
window.ceVersion =
|
|
1716
|
+
window.ceVersion = 142;
|
|
1703
1717
|
try {
|
|
1704
1718
|
if (exports !== undefined || exports !== null) {
|
|
1705
1719
|
exports["default"] = CE;
|