apxor-qe 1.4.2 → 1.5.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 +576 -430
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.js.bak
CHANGED
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
return typeof key === "symbol" ? key : String(key);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
var isUndefined = function isUndefined(term) {
|
|
116
|
+
return typeof term === "undefined";
|
|
117
|
+
};
|
|
118
|
+
|
|
115
119
|
/**
|
|
116
120
|
*
|
|
117
121
|
* @param term
|
|
@@ -203,7 +207,7 @@
|
|
|
203
207
|
var toUpperCase = function toUpperCase(key) {
|
|
204
208
|
return key.toUpperCase();
|
|
205
209
|
};
|
|
206
|
-
var
|
|
210
|
+
var Pflq = function Pflq(actual, expected, operator) {
|
|
207
211
|
switch (operator) {
|
|
208
212
|
case "EQ":
|
|
209
213
|
return actual === expected;
|
|
@@ -264,16 +268,18 @@
|
|
|
264
268
|
var Audience = /*#__PURE__*/_createClass(function Audience() {
|
|
265
269
|
var _this = this;
|
|
266
270
|
_classCallCheck(this, Audience);
|
|
267
|
-
_defineProperty(this, "
|
|
268
|
-
_defineProperty(this, "
|
|
269
|
-
_defineProperty(this, "
|
|
271
|
+
_defineProperty(this, "Lecg", "ALL");
|
|
272
|
+
_defineProperty(this, "KWLx", []);
|
|
273
|
+
_defineProperty(this, "YkGb", []);
|
|
274
|
+
_defineProperty(this, "userAttributesValidated", true);
|
|
275
|
+
_defineProperty(this, "sessionAttributeValidated", true);
|
|
270
276
|
_defineProperty(this, "parse", function () {
|
|
271
277
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
272
278
|
try {
|
|
273
|
-
_this.
|
|
274
|
-
_this.
|
|
275
|
-
_this.
|
|
276
|
-
if (!Array.isArray(_this.
|
|
279
|
+
_this.Lecg = config.audience.audience_type;
|
|
280
|
+
_this.KWLx = config.audience.attributes.user;
|
|
281
|
+
_this.YkGb = config.audience.attributes.session;
|
|
282
|
+
if (!Array.isArray(_this.KWLx) || !Array.isArray(_this.YkGb)) {
|
|
277
283
|
Logger.error("No attributes");
|
|
278
284
|
return false;
|
|
279
285
|
}
|
|
@@ -285,18 +291,26 @@
|
|
|
285
291
|
});
|
|
286
292
|
_defineProperty(this, "validate", function (user, session) {
|
|
287
293
|
var status = true;
|
|
288
|
-
if (_this.
|
|
294
|
+
if (_this.Lecg === "FTU") {
|
|
289
295
|
status = Apxor.getController().getSessionInfo().is_first_session;
|
|
290
296
|
}
|
|
291
|
-
|
|
297
|
+
var userAttributesCompare = _this.hTqd(user, _this.KWLx);
|
|
298
|
+
var sessionAttributesCompare = _this.hTqd(session, _this.YkGb);
|
|
299
|
+
if (!userAttributesCompare) {
|
|
300
|
+
_this.userAttributesValidated = false;
|
|
301
|
+
}
|
|
302
|
+
if (!sessionAttributesCompare) {
|
|
303
|
+
_this.sessionAttributeValidated = false;
|
|
304
|
+
}
|
|
305
|
+
return status && userAttributesCompare && sessionAttributesCompare;
|
|
292
306
|
});
|
|
293
|
-
_defineProperty(this, "
|
|
307
|
+
_defineProperty(this, "hTqd", function (attributes, expected) {
|
|
294
308
|
var length = expected.length;
|
|
295
309
|
var status = true;
|
|
296
310
|
try {
|
|
297
311
|
var _loop = function _loop() {
|
|
298
312
|
var item = expected[index];
|
|
299
|
-
if (
|
|
313
|
+
if (isUndefined(attributes[item.name]) || status === false) {
|
|
300
314
|
return {
|
|
301
315
|
v: false
|
|
302
316
|
};
|
|
@@ -310,6 +324,13 @@
|
|
|
310
324
|
return parseInt(value);
|
|
311
325
|
} else if (type === "f") {
|
|
312
326
|
return parseFloat(value);
|
|
327
|
+
} else if (type === "b") {
|
|
328
|
+
switch (value) {
|
|
329
|
+
case "true":
|
|
330
|
+
return true;
|
|
331
|
+
case "false":
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
313
334
|
}
|
|
314
335
|
});
|
|
315
336
|
var loggedValues = [];
|
|
@@ -320,7 +341,16 @@
|
|
|
320
341
|
}
|
|
321
342
|
var match = loggedValues.some(function (loggedValue) {
|
|
322
343
|
return values.some(function (configValue) {
|
|
323
|
-
|
|
344
|
+
if (type === "s") {
|
|
345
|
+
loggedValue = "".concat(loggedValue);
|
|
346
|
+
} else if (type === "l") {
|
|
347
|
+
loggedValue = parseInt(loggedValue);
|
|
348
|
+
} else if (type === "f") {
|
|
349
|
+
loggedValue = parseFloat(loggedValue);
|
|
350
|
+
} else if (type === "b") {
|
|
351
|
+
loggedValue = !!loggedValue;
|
|
352
|
+
}
|
|
353
|
+
return Pflq(loggedValue, configValue, operator);
|
|
324
354
|
});
|
|
325
355
|
});
|
|
326
356
|
status = status && match;
|
|
@@ -342,37 +372,37 @@
|
|
|
342
372
|
var Frequency = /*#__PURE__*/_createClass(function Frequency() {
|
|
343
373
|
var _this = this;
|
|
344
374
|
_classCallCheck(this, Frequency);
|
|
345
|
-
_defineProperty(this, "
|
|
346
|
-
_defineProperty(this, "
|
|
347
|
-
_defineProperty(this, "
|
|
348
|
-
_defineProperty(this, "
|
|
349
|
-
_defineProperty(this, "
|
|
350
|
-
_defineProperty(this, "
|
|
375
|
+
_defineProperty(this, "eeAf", 0);
|
|
376
|
+
_defineProperty(this, "lEEo", 0);
|
|
377
|
+
_defineProperty(this, "xdhp", "SESSION");
|
|
378
|
+
_defineProperty(this, "TIcR", 0);
|
|
379
|
+
_defineProperty(this, "kcoq", 0);
|
|
380
|
+
_defineProperty(this, "dtUE", 0);
|
|
351
381
|
_defineProperty(this, "parse", function () {
|
|
352
382
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
353
383
|
try {
|
|
354
|
-
_this.
|
|
355
|
-
if (_this.
|
|
356
|
-
_this.
|
|
357
|
-
}
|
|
358
|
-
_this.
|
|
359
|
-
_this.
|
|
360
|
-
_this.
|
|
361
|
-
_this.
|
|
384
|
+
_this.eeAf = config.frequency.count;
|
|
385
|
+
if (_this.eeAf === -1) {
|
|
386
|
+
_this.eeAf = 1000;
|
|
387
|
+
}
|
|
388
|
+
_this.dtUE = _this.eeAf;
|
|
389
|
+
_this.lEEo = config.frequency.time_interval;
|
|
390
|
+
_this.xdhp = config.frequency.validity;
|
|
391
|
+
_this.kcoq = config.frequency.ses_lmt;
|
|
362
392
|
_this._dayCount = config.frequency.day_lmt;
|
|
363
393
|
// let data = Apxor.getController().getFromStorage(QE_STATE);
|
|
364
394
|
// let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
|
|
365
395
|
var qe_state = CE.getInstance().getQeState();
|
|
366
396
|
if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
|
|
367
|
-
if (_this.
|
|
368
|
-
_this.
|
|
369
|
-
if (_this.
|
|
397
|
+
if (_this.xdhp === "SESSION") {
|
|
398
|
+
_this.eeAf = parseInt(_this.eeAf) - parseInt(qe_state[config._id]["SESSION"]);
|
|
399
|
+
if (_this.eeAf <= 0) {
|
|
370
400
|
console.warn("Max count limit reached for session:" + config._id);
|
|
371
401
|
return false;
|
|
372
402
|
}
|
|
373
|
-
} else if (_this.
|
|
374
|
-
_this.
|
|
375
|
-
if (_this.
|
|
403
|
+
} else if (_this.xdhp === "OVERALL") {
|
|
404
|
+
_this.eeAf = parseInt(_this.eeAf) - parseInt(qe_state[config._id]["OVERALL"]);
|
|
405
|
+
if (_this.eeAf <= 0) {
|
|
376
406
|
console.warn("Max count limit reached for overall:" + config._id);
|
|
377
407
|
return false;
|
|
378
408
|
}
|
|
@@ -386,28 +416,28 @@
|
|
|
386
416
|
}
|
|
387
417
|
return true;
|
|
388
418
|
});
|
|
389
|
-
_defineProperty(this, "
|
|
390
|
-
_this.
|
|
419
|
+
_defineProperty(this, "ikdS", function () {
|
|
420
|
+
_this.eeAf = _this.eeAf - 1;
|
|
391
421
|
});
|
|
392
422
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
393
|
-
return _this.
|
|
423
|
+
return _this.eeAf;
|
|
394
424
|
});
|
|
395
|
-
_defineProperty(this, "
|
|
396
|
-
if (_this.
|
|
397
|
-
_this.
|
|
425
|
+
_defineProperty(this, "MdUm", function () {
|
|
426
|
+
if (_this.xdhp === "SESSION") {
|
|
427
|
+
_this.eeAf = _this.dtUE;
|
|
398
428
|
Logger$1.info("Campaign Limit reset");
|
|
399
429
|
}
|
|
400
430
|
});
|
|
401
431
|
/**
|
|
402
|
-
* @function
|
|
432
|
+
* @function iOMM
|
|
403
433
|
* @description Validates if the campaign count is with in the limits set in the config.
|
|
404
434
|
* @param {string} Config id
|
|
405
435
|
* @returns {boolean} true - If the Campaign limits are not reached
|
|
406
436
|
* false - Otherwise
|
|
407
437
|
*/
|
|
408
|
-
_defineProperty(this, "
|
|
438
|
+
_defineProperty(this, "iOMM", function (id) {
|
|
409
439
|
try {
|
|
410
|
-
if (_this.
|
|
440
|
+
if (_this.eeAf <= 0) {
|
|
411
441
|
return false;
|
|
412
442
|
}
|
|
413
443
|
|
|
@@ -418,8 +448,8 @@
|
|
|
418
448
|
if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
|
|
419
449
|
|
|
420
450
|
//If the config has a session count limit set
|
|
421
|
-
if (_this.
|
|
422
|
-
var sessionCountInConfig = parseInt(_this.
|
|
451
|
+
if (_this.kcoq !== 0) {
|
|
452
|
+
var sessionCountInConfig = parseInt(_this.kcoq);
|
|
423
453
|
var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
|
|
424
454
|
if (sessionCountInConfig - thisSessionCount <= 0) {
|
|
425
455
|
return false;
|
|
@@ -446,16 +476,17 @@
|
|
|
446
476
|
var Meta = /*#__PURE__*/_createClass(function Meta() {
|
|
447
477
|
var _this = this;
|
|
448
478
|
_classCallCheck(this, Meta);
|
|
449
|
-
_defineProperty(this, "
|
|
450
|
-
_defineProperty(this, "
|
|
479
|
+
_defineProperty(this, "figp", "");
|
|
480
|
+
_defineProperty(this, "Lecg", "");
|
|
451
481
|
_defineProperty(this, "parse", function () {
|
|
452
482
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
453
483
|
try {
|
|
454
|
-
var _config$meta;
|
|
455
|
-
_this.
|
|
456
|
-
_this.
|
|
484
|
+
var _config$meta, _config$meta2;
|
|
485
|
+
_this.figp = config.meta.name;
|
|
486
|
+
_this.Lecg = config.meta.type;
|
|
457
487
|
_this._only_context = config.meta.only_context;
|
|
458
488
|
_this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
|
|
489
|
+
_this._isExperiment = (_config$meta2 = config.meta) === null || _config$meta2 === void 0 ? void 0 : _config$meta2.isExperiment;
|
|
459
490
|
} catch (error) {
|
|
460
491
|
window.ApxorLogger.error(error);
|
|
461
492
|
return false;
|
|
@@ -468,11 +499,13 @@
|
|
|
468
499
|
var Validity = /*#__PURE__*/_createClass(function Validity() {
|
|
469
500
|
var _this = this;
|
|
470
501
|
_classCallCheck(this, Validity);
|
|
471
|
-
_defineProperty(this, "
|
|
472
|
-
_defineProperty(this, "
|
|
473
|
-
_defineProperty(this, "
|
|
474
|
-
_defineProperty(this, "
|
|
475
|
-
_defineProperty(this, "
|
|
502
|
+
_defineProperty(this, "qbZE", -1);
|
|
503
|
+
_defineProperty(this, "RbKz", -1);
|
|
504
|
+
_defineProperty(this, "tgyZ", -1);
|
|
505
|
+
_defineProperty(this, "cWdN", -1);
|
|
506
|
+
_defineProperty(this, "cidg", false);
|
|
507
|
+
_defineProperty(this, "_nudge_expired", false);
|
|
508
|
+
_defineProperty(this, "_not_yet_active", false);
|
|
476
509
|
_defineProperty(this, "parse", function () {
|
|
477
510
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
478
511
|
try {
|
|
@@ -480,17 +513,17 @@
|
|
|
480
513
|
Logger$2.error("Not valid dates");
|
|
481
514
|
return false;
|
|
482
515
|
}
|
|
483
|
-
_this.
|
|
484
|
-
_this.
|
|
516
|
+
_this.qbZE = Date.parse(config.validity.start_date);
|
|
517
|
+
_this.RbKz = Date.parse(config.validity.end_date);
|
|
485
518
|
if (isDefined(config.time_limits_in_day)) {
|
|
486
|
-
_this.
|
|
487
|
-
if (_this.
|
|
519
|
+
_this.cidg = config.time_limits_in_day;
|
|
520
|
+
if (_this.cidg && isDefined(config.time_limits)) {
|
|
488
521
|
var currentDate = new Date().toISOString().split("T")[0];
|
|
489
|
-
_this.
|
|
490
|
-
_this.
|
|
522
|
+
_this.tgyZ = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
|
|
523
|
+
_this.cWdN = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
|
|
491
524
|
|
|
492
525
|
// If invalid format is passed, return false
|
|
493
|
-
if (isNaN(_this.
|
|
526
|
+
if (isNaN(_this.tgyZ) || isNaN(_this.cWdN)) {
|
|
494
527
|
Logger$2.error("Not valid times");
|
|
495
528
|
return false;
|
|
496
529
|
}
|
|
@@ -504,8 +537,12 @@
|
|
|
504
537
|
});
|
|
505
538
|
_defineProperty(this, "validate", function () {
|
|
506
539
|
var currentTime = Date.now();
|
|
507
|
-
if (currentTime > _this.
|
|
508
|
-
return !_this.
|
|
540
|
+
if (currentTime > _this.qbZE && currentTime < _this.RbKz) {
|
|
541
|
+
return !_this.cidg || currentTime >= _this.tgyZ && currentTime <= _this.cWdN;
|
|
542
|
+
} else if (currentTime < _this.qbZE) {
|
|
543
|
+
_this._not_yet_active = true;
|
|
544
|
+
} else if (currentTime > _this.RbKz) {
|
|
545
|
+
_this._nudge_expired = true;
|
|
509
546
|
}
|
|
510
547
|
return false;
|
|
511
548
|
});
|
|
@@ -514,13 +551,13 @@
|
|
|
514
551
|
var Details = /*#__PURE__*/_createClass(function Details() {
|
|
515
552
|
var _this = this;
|
|
516
553
|
_classCallCheck(this, Details);
|
|
517
|
-
_defineProperty(this, "
|
|
518
|
-
_defineProperty(this, "
|
|
554
|
+
_defineProperty(this, "figp", "");
|
|
555
|
+
_defineProperty(this, "rXDy", {});
|
|
519
556
|
_defineProperty(this, "parse", function () {
|
|
520
557
|
var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
521
558
|
try {
|
|
522
|
-
_this.
|
|
523
|
-
_this.
|
|
559
|
+
_this.figp = details.name;
|
|
560
|
+
_this.rXDy = details.additional_info;
|
|
524
561
|
} catch (error) {
|
|
525
562
|
return false;
|
|
526
563
|
}
|
|
@@ -531,14 +568,14 @@
|
|
|
531
568
|
var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
|
|
532
569
|
var _this = this;
|
|
533
570
|
_classCallCheck(this, Timebounds);
|
|
534
|
-
_defineProperty(this, "
|
|
535
|
-
_defineProperty(this, "
|
|
571
|
+
_defineProperty(this, "serE", 0);
|
|
572
|
+
_defineProperty(this, "DOnR", 0);
|
|
536
573
|
_defineProperty(this, "parse", function () {
|
|
537
574
|
var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
538
575
|
try {
|
|
539
|
-
_this.
|
|
540
|
-
_this.
|
|
541
|
-
if (isNaN(_this.
|
|
576
|
+
_this.serE = Number(timeBounds.lower);
|
|
577
|
+
_this.DOnR = Number(timeBounds.upper);
|
|
578
|
+
if (isNaN(_this.serE) || isNaN(_this.DOnR)) {
|
|
542
579
|
return false;
|
|
543
580
|
}
|
|
544
581
|
} catch (error) {
|
|
@@ -551,17 +588,17 @@
|
|
|
551
588
|
var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
|
|
552
589
|
var _this = this;
|
|
553
590
|
_classCallCheck(this, PreCondition);
|
|
554
|
-
_defineProperty(this, "
|
|
555
|
-
_defineProperty(this, "
|
|
556
|
-
_defineProperty(this, "
|
|
557
|
-
_defineProperty(this, "
|
|
558
|
-
_defineProperty(this, "
|
|
591
|
+
_defineProperty(this, "wxRT", 0);
|
|
592
|
+
_defineProperty(this, "tlgv", "");
|
|
593
|
+
_defineProperty(this, "kimo", "");
|
|
594
|
+
_defineProperty(this, "xCDb", new Details());
|
|
595
|
+
_defineProperty(this, "uvCn", new Timebounds());
|
|
559
596
|
_defineProperty(this, "parse", function () {
|
|
560
597
|
var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
561
598
|
try {
|
|
562
|
-
_this.
|
|
563
|
-
_this.
|
|
564
|
-
return _this.
|
|
599
|
+
_this.tlgv = precondition.event_type;
|
|
600
|
+
_this.kimo = precondition.activity;
|
|
601
|
+
return _this.xCDb.parse(precondition.details) && _this.uvCn.parse(precondition.time_bounds);
|
|
565
602
|
} catch (error) {
|
|
566
603
|
return false;
|
|
567
604
|
}
|
|
@@ -572,29 +609,29 @@
|
|
|
572
609
|
var Condition = /*#__PURE__*/_createClass(function Condition() {
|
|
573
610
|
var _this = this;
|
|
574
611
|
_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, "
|
|
612
|
+
_defineProperty(this, "wxRT", 0);
|
|
613
|
+
_defineProperty(this, "eAoS", -1);
|
|
614
|
+
_defineProperty(this, "eeAf", 0);
|
|
615
|
+
_defineProperty(this, "FOfl", "");
|
|
616
|
+
_defineProperty(this, "kimo", "");
|
|
617
|
+
_defineProperty(this, "tlgv", "");
|
|
618
|
+
_defineProperty(this, "uvCn", new Timebounds());
|
|
619
|
+
_defineProperty(this, "xCDb", new Details());
|
|
620
|
+
_defineProperty(this, "woYX", new PreCondition());
|
|
621
|
+
_defineProperty(this, "zzXl", "AND");
|
|
622
|
+
_defineProperty(this, "Ziyx", false);
|
|
623
|
+
_defineProperty(this, "Lecg", void 0);
|
|
587
624
|
_defineProperty(this, "parse", function () {
|
|
588
625
|
var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
589
626
|
try {
|
|
590
|
-
_this.
|
|
591
|
-
_this.
|
|
592
|
-
_this.
|
|
593
|
-
_this.
|
|
594
|
-
_this.
|
|
595
|
-
_this.
|
|
596
|
-
_this.
|
|
597
|
-
return _this.
|
|
627
|
+
_this.eAoS = condition.sequence;
|
|
628
|
+
_this.eeAf = condition.count_config.count;
|
|
629
|
+
_this.FOfl = condition.count_config.operator;
|
|
630
|
+
_this.kimo = condition.activity;
|
|
631
|
+
_this.tlgv = condition.event_type;
|
|
632
|
+
_this.zzXl = condition.combine_operator;
|
|
633
|
+
_this.Lecg = condition.type;
|
|
634
|
+
return _this.xCDb.parse(condition.details) && _this.woYX.parse(condition.trigger) && _this.uvCn.parse(condition.time_bounds);
|
|
598
635
|
} catch (error) {
|
|
599
636
|
Logger$3.error(error);
|
|
600
637
|
return false;
|
|
@@ -606,19 +643,19 @@
|
|
|
606
643
|
var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
|
|
607
644
|
var _this = this;
|
|
608
645
|
_classCallCheck(this, GoalEvent);
|
|
609
|
-
_defineProperty(this, "
|
|
610
|
-
_defineProperty(this, "
|
|
611
|
-
_defineProperty(this, "
|
|
612
|
-
_defineProperty(this, "
|
|
613
|
-
_defineProperty(this, "
|
|
614
|
-
_defineProperty(this, "
|
|
646
|
+
_defineProperty(this, "eeAf", 0);
|
|
647
|
+
_defineProperty(this, "FOfl", "");
|
|
648
|
+
_defineProperty(this, "tlgv", "");
|
|
649
|
+
_defineProperty(this, "uvCn", new Timebounds());
|
|
650
|
+
_defineProperty(this, "xCDb", new Details());
|
|
651
|
+
_defineProperty(this, "zzXl", "AND");
|
|
615
652
|
_defineProperty(this, "parse", function (data) {
|
|
616
653
|
try {
|
|
617
|
-
_this.
|
|
618
|
-
_this.
|
|
619
|
-
_this.
|
|
620
|
-
_this.
|
|
621
|
-
return _this.
|
|
654
|
+
_this.eeAf = data.count_config.count;
|
|
655
|
+
_this.FOfl = data.count_config.operator;
|
|
656
|
+
_this.tlgv = data.event_type;
|
|
657
|
+
_this.zzXl = data.combine_operator;
|
|
658
|
+
return _this.xCDb.parse(data.details) && _this.uvCn.parse(data.time_bounds);
|
|
622
659
|
} catch (error) {
|
|
623
660
|
Logger$4.error(error);
|
|
624
661
|
return false;
|
|
@@ -632,21 +669,21 @@
|
|
|
632
669
|
function ConditionValidator() {
|
|
633
670
|
var _this = this;
|
|
634
671
|
_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, "
|
|
672
|
+
_defineProperty(this, "Purf", 0);
|
|
673
|
+
_defineProperty(this, "jUXZ", "");
|
|
674
|
+
_defineProperty(this, "UHEM", new Condition());
|
|
675
|
+
_defineProperty(this, "VHgA", new GoalEvent());
|
|
676
|
+
_defineProperty(this, "dwoA", false);
|
|
677
|
+
_defineProperty(this, "KWyt", false);
|
|
678
|
+
_defineProperty(this, "OOsw", 0);
|
|
679
|
+
_defineProperty(this, "zzXl", "AND");
|
|
680
|
+
_defineProperty(this, "bXqj", "OR");
|
|
681
|
+
_defineProperty(this, "aJVI", -1);
|
|
682
|
+
_defineProperty(this, "moyq", []);
|
|
683
|
+
_defineProperty(this, "FJhx", {});
|
|
684
|
+
_defineProperty(this, "bNNf", false);
|
|
648
685
|
/**
|
|
649
|
-
* If respectSequence is true, don't auto-
|
|
686
|
+
* If respectSequence is true, don't auto-PaJS to events except for the condition whose index is 0
|
|
650
687
|
*
|
|
651
688
|
* @param condition
|
|
652
689
|
* @param type
|
|
@@ -662,191 +699,191 @@
|
|
|
662
699
|
var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
663
700
|
var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
664
701
|
var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
|
|
665
|
-
_this.
|
|
666
|
-
_this.
|
|
667
|
-
_this.
|
|
702
|
+
_this.jUXZ = id;
|
|
703
|
+
_this.OOsw = index;
|
|
704
|
+
_this.moyq = noKpiArray;
|
|
668
705
|
if (flag !== "termination" || flag === "") {
|
|
669
|
-
var result = _this.
|
|
706
|
+
var result = _this.UHEM.parse(condition);
|
|
670
707
|
if (result) {
|
|
671
|
-
_this.
|
|
708
|
+
_this.zzXl = _this.UHEM.zzXl;
|
|
672
709
|
|
|
673
710
|
// FIXME: Why this code is written? Don't see any usecase
|
|
674
|
-
if (_this.
|
|
675
|
-
var eventName = _this.
|
|
711
|
+
if (_this.UHEM.Ziyx) {
|
|
712
|
+
var eventName = _this.UHEM.xCDb.figp;
|
|
676
713
|
if (eventName === "APX_PAGE_OPENED") {
|
|
677
|
-
eventName = _this.
|
|
678
|
-
eventName = isDefined(eventName) ? eventName : _this.
|
|
714
|
+
eventName = _this.UHEM.xCDb.rXDy["navigation_id"];
|
|
715
|
+
eventName = isDefined(eventName) ? eventName : _this.UHEM.xCDb.figp;
|
|
679
716
|
}
|
|
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
|
|
717
|
+
_this.aJVI = Apxor.getController().getEventCount(eventName);
|
|
718
|
+
var count = _this.UHEM.eeAf;
|
|
719
|
+
var operator = _this.UHEM.FOfl;
|
|
720
|
+
_this.KWyt = _this.ZQVH(_this.aJVI - 1, count, operator, false);
|
|
721
|
+
_this.dwoA = _this.KWyt;
|
|
722
|
+
// If the condition is already satisfied and if it is page view, no need to PaJS
|
|
686
723
|
// This only applies for NAVIGATION_EVENTS
|
|
687
|
-
if (_this.
|
|
724
|
+
if (_this.KWyt && _this.UHEM.xCDb.figp === "APX_PAGE_OPENED") {
|
|
688
725
|
return true;
|
|
689
726
|
}
|
|
690
727
|
}
|
|
691
728
|
if (!respectSequence || index === 0) {
|
|
692
|
-
_this.
|
|
729
|
+
_this.PaJS();
|
|
693
730
|
}
|
|
694
731
|
return true;
|
|
695
732
|
}
|
|
696
733
|
} else {
|
|
697
|
-
var _result = _this.
|
|
698
|
-
_this.
|
|
699
|
-
_this.
|
|
734
|
+
var _result = _this.VHgA.parse(condition);
|
|
735
|
+
_this.bXqj = _this.VHgA.zzXl;
|
|
736
|
+
_this.gUva();
|
|
700
737
|
return true;
|
|
701
738
|
}
|
|
702
739
|
return false;
|
|
703
740
|
});
|
|
704
|
-
_defineProperty(this, "
|
|
741
|
+
_defineProperty(this, "PaJS", function () {
|
|
705
742
|
var _window$ApxorRTM;
|
|
706
|
-
var condition = _this.
|
|
707
|
-
var precondition = condition.
|
|
743
|
+
var condition = _this.UHEM;
|
|
744
|
+
var precondition = condition.woYX;
|
|
708
745
|
var ceInstance = CE.getInstance();
|
|
709
|
-
if (precondition.
|
|
710
|
-
_this.
|
|
711
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
746
|
+
if (precondition.tlgv === "app_start") {
|
|
747
|
+
_this.dwoA = true;
|
|
748
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + condition.xCDb.figp, _this.YgWO);
|
|
712
749
|
} else {
|
|
713
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
750
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + precondition.xCDb.figp, _this.YgWO);
|
|
714
751
|
}
|
|
715
|
-
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.
|
|
716
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
752
|
+
if ((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.badgesLists.includes(_this.jUXZ)) {
|
|
753
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + "apxor-badge-container-".concat("-".concat(_this.jUXZ).replaceAll(" ", "").replace(/[^\w\s]/gi, "")), _this.YgWO);
|
|
717
754
|
}
|
|
718
755
|
});
|
|
719
|
-
_defineProperty(this, "
|
|
720
|
-
var condition = _this.
|
|
756
|
+
_defineProperty(this, "gUva", function () {
|
|
757
|
+
var condition = _this.VHgA;
|
|
721
758
|
var ceInstance = CE.getInstance();
|
|
722
|
-
_this.
|
|
723
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
759
|
+
_this.dwoA = true;
|
|
760
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + condition.xCDb.figp, _this.cQYJ);
|
|
724
761
|
});
|
|
725
|
-
_defineProperty(this, "
|
|
726
|
-
var _this$
|
|
762
|
+
_defineProperty(this, "LcXc", function (type, name, time, additionalInfo) {
|
|
763
|
+
var _this$UHEM;
|
|
727
764
|
var eventTime = Date.now();
|
|
728
|
-
var time_differnce = (eventTime - _this.
|
|
729
|
-
var time_fromConfig = ((_this$
|
|
765
|
+
var time_differnce = (eventTime - _this.FJhx[name]) / 1000;
|
|
766
|
+
var time_fromConfig = ((_this$UHEM = _this.UHEM) === null || _this$UHEM === void 0 || (_this$UHEM = _this$UHEM.xCDb) === null || _this$UHEM === void 0 || (_this$UHEM = _this$UHEM.rXDy) === null || _this$UHEM === void 0 ? void 0 : _this$UHEM.time) / 1000;
|
|
730
767
|
if (time_fromConfig > time_differnce) {
|
|
731
768
|
_this._displayCampaign(time);
|
|
732
769
|
}
|
|
733
770
|
});
|
|
734
|
-
_defineProperty(this, "
|
|
771
|
+
_defineProperty(this, "gLck", function (type, name, time, additionalInfo) {
|
|
735
772
|
var _this$_condition2, _this$_condition3;
|
|
736
|
-
_this.
|
|
773
|
+
_this.bNNf = true;
|
|
737
774
|
var currentTime = Date.now();
|
|
738
|
-
var eventName = (_this$_condition2 = _this.
|
|
739
|
-
var eventTime = _this.
|
|
775
|
+
var eventName = (_this$_condition2 = _this.UHEM) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.woYX) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.xCDb.figp;
|
|
776
|
+
var eventTime = _this.FJhx[eventName];
|
|
740
777
|
var time_differnce = (currentTime - eventTime) / 1000;
|
|
741
|
-
var time_fromConfig = (_this$_condition3 = _this.
|
|
778
|
+
var time_fromConfig = (_this$_condition3 = _this.UHEM) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.xCDb) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.rXDy) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
|
|
742
779
|
time_fromConfig = time_fromConfig / 1000;
|
|
743
780
|
if (time_fromConfig > time_differnce) {
|
|
744
781
|
_this._displayCampaign(time);
|
|
745
782
|
}
|
|
746
783
|
//unregister the event
|
|
747
784
|
});
|
|
748
|
-
_defineProperty(this, "
|
|
749
|
-
var _window$ApxorRTM2;
|
|
785
|
+
_defineProperty(this, "YgWO", function (type, name, time, additionalInfo) {
|
|
786
|
+
var _window$ApxorRTM2, _window$ApxorRTM3;
|
|
750
787
|
var ceInstance = CE.getInstance();
|
|
751
|
-
if (!_this.
|
|
788
|
+
if (!_this.dwoA) {
|
|
752
789
|
// Validate Precondition
|
|
753
|
-
_this.
|
|
754
|
-
if (_this.
|
|
755
|
-
var condition = _this.
|
|
756
|
-
var precondition = condition.
|
|
757
|
-
precondition.
|
|
790
|
+
_this.dwoA = _this.uXGd(type, name, time, additionalInfo);
|
|
791
|
+
if (_this.dwoA) {
|
|
792
|
+
var condition = _this.UHEM;
|
|
793
|
+
var precondition = condition.woYX;
|
|
794
|
+
precondition.wxRT = time;
|
|
758
795
|
//events will be registred by its type activity event_type: "activity_time"
|
|
759
|
-
if ((condition === null || condition === void 0 ? void 0 : condition.
|
|
760
|
-
var
|
|
761
|
-
var event_time = condition === null || condition === void 0 || (
|
|
762
|
-
if ((condition === null || condition === void 0 || (
|
|
796
|
+
if ((condition === null || condition === void 0 ? void 0 : condition.tlgv) === "activity_time") {
|
|
797
|
+
var UHEM$xCDb, UHEM$_details2, UHEM$_details3;
|
|
798
|
+
var event_time = condition === null || condition === void 0 || (UHEM$xCDb = condition.xCDb) === null || UHEM$xCDb === void 0 || (UHEM$xCDb = UHEM$xCDb.rXDy) === null || UHEM$xCDb === void 0 ? void 0 : UHEM$xCDb.time;
|
|
799
|
+
if ((condition === null || condition === void 0 || (UHEM$_details2 = condition.xCDb) === null || UHEM$_details2 === void 0 || (UHEM$_details2 = UHEM$_details2.rXDy) === null || UHEM$_details2 === void 0 ? void 0 : UHEM$_details2.nkpi.length) > 0) {
|
|
763
800
|
setTimeout(function () {
|
|
764
|
-
if (!_this.
|
|
765
|
-
_this.
|
|
766
|
-
if (_this.
|
|
767
|
-
_this.
|
|
768
|
-
_this.
|
|
769
|
-
if (_this.
|
|
770
|
-
_this.
|
|
771
|
-
ceInstance.validate(_this.
|
|
801
|
+
if (!_this.bNNf) {
|
|
802
|
+
_this.KWyt = true;
|
|
803
|
+
if (_this.KWyt) {
|
|
804
|
+
_this.Purf += 1;
|
|
805
|
+
_this.KWyt = _this.ZQVH(_this.Purf, _this.UHEM.eeAf, _this.UHEM.FOfl);
|
|
806
|
+
if (_this.KWyt) {
|
|
807
|
+
_this.UHEM.wxRT = time;
|
|
808
|
+
ceInstance.validate(_this.jUXZ, _this.OOsw);
|
|
772
809
|
}
|
|
773
810
|
}
|
|
774
811
|
}
|
|
775
|
-
condition.
|
|
776
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
812
|
+
condition.xCDb.rXDy.nkpi.map(function (nokpi) {
|
|
813
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + nokpi, _this);
|
|
777
814
|
});
|
|
778
815
|
}, event_time);
|
|
779
|
-
condition.
|
|
780
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
816
|
+
condition.xCDb.rXDy.nkpi.map(function (nokpi) {
|
|
817
|
+
ceInstance.registerForEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + nokpi, _this.gLck);
|
|
781
818
|
});
|
|
782
819
|
}
|
|
783
820
|
//it is for unregistering the events did case after completing the time imit
|
|
784
|
-
if ((condition === null || condition === void 0 || (
|
|
821
|
+
if ((condition === null || condition === void 0 || (UHEM$_details3 = condition.xCDb) === null || UHEM$_details3 === void 0 || (UHEM$_details3 = UHEM$_details3.rXDy) === null || UHEM$_details3 === void 0 ? void 0 : UHEM$_details3.kpi.length) > 0) {
|
|
785
822
|
setTimeout(function () {
|
|
786
|
-
condition.
|
|
787
|
-
ceInstance.unregisterFromEvent(toUpperCase(condition.
|
|
823
|
+
condition.xCDb.rXDy.kpi.map(function (kpi) {
|
|
824
|
+
ceInstance.unregisterFromEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + kpi, _this);
|
|
788
825
|
});
|
|
789
826
|
}, event_time);
|
|
790
|
-
condition.
|
|
791
|
-
if (kpi === condition.
|
|
827
|
+
condition.xCDb.rXDy.kpi.map(function (kpi) {
|
|
828
|
+
if (kpi === condition.woYX.xCDb.figp) {
|
|
792
829
|
//unregister the previous event
|
|
793
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
794
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
830
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.tlgv) + "___" + precondition.xCDb.figp, _this);
|
|
831
|
+
ceInstance.registerForEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + kpi, _this.LcXc);
|
|
795
832
|
} else {
|
|
796
|
-
ceInstance.registerForEvent(toUpperCase(condition.
|
|
833
|
+
ceInstance.registerForEvent(toUpperCase(condition.xCDb.rXDy.et) + "___" + kpi, _this.gLck);
|
|
797
834
|
}
|
|
798
835
|
});
|
|
799
836
|
}
|
|
800
837
|
} else {
|
|
801
|
-
ceInstance.unregisterFromEvent(generateKey(precondition.
|
|
802
|
-
ceInstance.registerForEvent(generateKey(condition.
|
|
838
|
+
ceInstance.unregisterFromEvent(generateKey(precondition.tlgv) + "___" + precondition.xCDb.figp, _this);
|
|
839
|
+
ceInstance.registerForEvent(generateKey(condition.tlgv) + "___" + condition.xCDb.figp, _this);
|
|
803
840
|
}
|
|
804
|
-
_this.
|
|
841
|
+
_this.FJhx[name] = Date.now();
|
|
805
842
|
}
|
|
806
843
|
return;
|
|
807
844
|
}
|
|
808
|
-
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && Apxor.getController().isBadgeTriggerSatisfied(_this.
|
|
809
|
-
_this.
|
|
810
|
-
_this.
|
|
811
|
-
ceInstance.validate(_this.
|
|
845
|
+
if ((_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.isBadgePresent && (_window$ApxorRTM3 = window.ApxorRTM) !== null && _window$ApxorRTM3 !== void 0 && _window$ApxorRTM3.badgesLists.includes(_this.jUXZ) && Apxor.getController().isBadgeTriggerSatisfied(_this.jUXZ)) {
|
|
846
|
+
_this.KWyt = true;
|
|
847
|
+
_this.UHEM.wxRT = time;
|
|
848
|
+
ceInstance.validate(_this.jUXZ, _this.OOsw);
|
|
812
849
|
return;
|
|
813
850
|
}
|
|
814
851
|
|
|
815
852
|
// Validate Condition
|
|
816
|
-
var validationStatus = generateKey(_this.
|
|
853
|
+
var validationStatus = generateKey(_this.UHEM.tlgv) === type && _this.tBEr(time - _this.UHEM.woYX.wxRT, _this.UHEM.uvCn) && _this.UHEM.xCDb.figp === name && _this.BSUO(_this.UHEM.xCDb.rXDy, additionalInfo);
|
|
817
854
|
if (validationStatus) {
|
|
818
|
-
_this.
|
|
819
|
-
_this.
|
|
820
|
-
if (_this.
|
|
821
|
-
_this.
|
|
822
|
-
ceInstance.validate(_this.
|
|
855
|
+
_this.Purf += 1;
|
|
856
|
+
_this.KWyt = _this.ZQVH(_this.Purf, _this.UHEM.eeAf, _this.UHEM.FOfl);
|
|
857
|
+
if (_this.KWyt) {
|
|
858
|
+
_this.UHEM.wxRT = time;
|
|
859
|
+
ceInstance.validate(_this.jUXZ, _this.OOsw);
|
|
823
860
|
}
|
|
824
861
|
}
|
|
825
862
|
});
|
|
826
|
-
_defineProperty(this, "
|
|
863
|
+
_defineProperty(this, "cQYJ", function (type, name, time, additionalInfo) {
|
|
827
864
|
var ceInstance = CE.getInstance();
|
|
828
|
-
var validationStatus = generateKey(_this.
|
|
865
|
+
var validationStatus = generateKey(_this.VHgA.tlgv) === type && _this.tBEr(time, _this.VHgA.uvCn) && _this.VHgA.xCDb.figp === name && _this.BSUO(_this.VHgA.xCDb.rXDy, additionalInfo);
|
|
829
866
|
if (validationStatus) {
|
|
830
|
-
_this.
|
|
831
|
-
_this.
|
|
832
|
-
if (_this.
|
|
833
|
-
_this.
|
|
834
|
-
ceInstance.validateForTermination(_this.
|
|
867
|
+
_this.Purf += 1;
|
|
868
|
+
_this.KWyt = _this.ZQVH(_this.Purf, _this.VHgA.eeAf, _this.VHgA.FOfl);
|
|
869
|
+
if (_this.KWyt) {
|
|
870
|
+
_this.VHgA.wxRT = time;
|
|
871
|
+
ceInstance.validateForTermination(_this.jUXZ, _this.OOsw);
|
|
835
872
|
}
|
|
836
873
|
}
|
|
837
874
|
});
|
|
838
|
-
_defineProperty(this, "
|
|
839
|
-
var precondition = _this.
|
|
840
|
-
return generateKey(precondition.
|
|
875
|
+
_defineProperty(this, "uXGd", function (type, name, time, additionalInfo) {
|
|
876
|
+
var precondition = _this.UHEM.woYX;
|
|
877
|
+
return generateKey(precondition.tlgv) === type && precondition.xCDb.figp === name && _this.tBEr(time, precondition.uvCn) && _this.BSUO(precondition.xCDb.rXDy, additionalInfo);
|
|
841
878
|
});
|
|
842
|
-
_defineProperty(this, "
|
|
879
|
+
_defineProperty(this, "tBEr", function (time, timeBounds) {
|
|
843
880
|
var currentTime = Math.ceil(time);
|
|
844
|
-
return currentTime > timeBounds.
|
|
881
|
+
return currentTime > timeBounds.serE && currentTime < timeBounds.DOnR;
|
|
845
882
|
});
|
|
846
|
-
_defineProperty(this, "
|
|
883
|
+
_defineProperty(this, "ZQVH", function (current, required, operator) {
|
|
847
884
|
var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
848
|
-
if (checkOld && _this.
|
|
849
|
-
current = current + _this.
|
|
885
|
+
if (checkOld && _this.UHEM.Ziyx) {
|
|
886
|
+
current = current + _this.aJVI;
|
|
850
887
|
}
|
|
851
888
|
switch (operator) {
|
|
852
889
|
case "EQ":
|
|
@@ -863,7 +900,7 @@
|
|
|
863
900
|
return false;
|
|
864
901
|
}
|
|
865
902
|
});
|
|
866
|
-
_defineProperty(this, "
|
|
903
|
+
_defineProperty(this, "BSUO", function (expected, received) {
|
|
867
904
|
var status = true;
|
|
868
905
|
try {
|
|
869
906
|
var _loop = function _loop() {
|
|
@@ -888,11 +925,11 @@
|
|
|
888
925
|
loggedValues = [received[item]];
|
|
889
926
|
}
|
|
890
927
|
var match = loggedValues.some(function (loggedValue) {
|
|
891
|
-
return
|
|
928
|
+
return Pflq(loggedValue, expectedValue, operator);
|
|
892
929
|
});
|
|
893
930
|
status = status && match;
|
|
894
931
|
} else {
|
|
895
|
-
status = status &&
|
|
932
|
+
status = status && Pflq(received[item], expected[item], "EQ");
|
|
896
933
|
}
|
|
897
934
|
},
|
|
898
935
|
_ret;
|
|
@@ -911,13 +948,13 @@
|
|
|
911
948
|
key: "_displayCampaign",
|
|
912
949
|
value: function _displayCampaign(time) {
|
|
913
950
|
var ceInstance = CE.getInstance();
|
|
914
|
-
this.
|
|
915
|
-
if (this.
|
|
916
|
-
this.
|
|
917
|
-
this.
|
|
918
|
-
if (this.
|
|
919
|
-
this.
|
|
920
|
-
ceInstance.validate(this.
|
|
951
|
+
this.KWyt = true;
|
|
952
|
+
if (this.KWyt) {
|
|
953
|
+
this.Purf += 1;
|
|
954
|
+
this.KWyt = this.ZQVH(this.Purf, this.UHEM.eeAf, this.UHEM.FOfl);
|
|
955
|
+
if (this.KWyt) {
|
|
956
|
+
this.UHEM.wxRT = time;
|
|
957
|
+
ceInstance.validate(this.jUXZ, this.OOsw);
|
|
921
958
|
}
|
|
922
959
|
}
|
|
923
960
|
}
|
|
@@ -929,25 +966,29 @@
|
|
|
929
966
|
var APX_RETAINED_SESSIONS = "apx_retained_session";
|
|
930
967
|
var APX_RETAINED_DAYS = "apx_retained_days";
|
|
931
968
|
var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
|
|
969
|
+
var APX_VARIANT_CODE = "apx_variant_code";
|
|
932
970
|
|
|
933
971
|
var Logger$6 = window.ApxorLogger;
|
|
934
972
|
var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
|
|
935
973
|
var _this = this;
|
|
936
974
|
_classCallCheck(this, OverallConfig);
|
|
937
|
-
_defineProperty(this, "
|
|
975
|
+
_defineProperty(this, "zlRP", []);
|
|
938
976
|
_defineProperty(this, "_ret_day", {});
|
|
939
|
-
_defineProperty(this, "
|
|
940
|
-
_defineProperty(this, "
|
|
941
|
-
_defineProperty(this, "
|
|
977
|
+
_defineProperty(this, "UUEf", {});
|
|
978
|
+
_defineProperty(this, "jxTr", false);
|
|
979
|
+
_defineProperty(this, "kPcF", false);
|
|
980
|
+
_defineProperty(this, "retainedDaysValidated", true);
|
|
981
|
+
_defineProperty(this, "retainedSessionValidated", true);
|
|
982
|
+
_defineProperty(this, "eventDoneInLT", false);
|
|
983
|
+
// event done in life time, if event(like "purchase_event") already done in life time then campaign will not be shown
|
|
942
984
|
_defineProperty(this, "parse", function () {
|
|
943
985
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
944
986
|
try {
|
|
945
|
-
_this.
|
|
987
|
+
_this.zlRP = config.overall_cfg.events;
|
|
946
988
|
_this._ret_day = config.overall_cfg.ret_day;
|
|
947
|
-
_this.
|
|
948
|
-
_this.
|
|
949
|
-
_this.
|
|
950
|
-
_this.DdTA = config.overall_cfg.toggleSession;
|
|
989
|
+
_this.UUEf = config.overall_cfg.session;
|
|
990
|
+
_this.jxTr = config.overall_cfg.toggleRetDay;
|
|
991
|
+
_this.kPcF = config.overall_cfg.toggleSession;
|
|
951
992
|
} catch (error) {
|
|
952
993
|
Logger$6.error(error);
|
|
953
994
|
return false;
|
|
@@ -957,10 +998,12 @@
|
|
|
957
998
|
_defineProperty(this, "validate", function () {
|
|
958
999
|
var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
|
|
959
1000
|
var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
|
|
960
|
-
if (_this.
|
|
1001
|
+
if (_this.jxTr && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
|
|
1002
|
+
_this.retainedDaysValidated = false;
|
|
961
1003
|
return false;
|
|
962
1004
|
}
|
|
963
|
-
if (_this.
|
|
1005
|
+
if (_this.kPcF && !isNaN(retainedSession) && !(retainedSession >= _this.UUEf.from && retainedSession <= _this.UUEf.to)) {
|
|
1006
|
+
_this.retainedSessionValidated = false;
|
|
964
1007
|
return false;
|
|
965
1008
|
}
|
|
966
1009
|
try {
|
|
@@ -968,9 +1011,10 @@
|
|
|
968
1011
|
var data = Apxor.getController().getFromStorage("_apx_lt_count");
|
|
969
1012
|
var siteid = Apxor.getSiteId();
|
|
970
1013
|
var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
|
|
971
|
-
for (var i = 0; i < _this.
|
|
972
|
-
var evName = _this.
|
|
1014
|
+
for (var i = 0; i < _this.zlRP.length; i++) {
|
|
1015
|
+
var evName = _this.zlRP[i].name.replace("'", "").replace("’", "");
|
|
973
1016
|
if (LtCountObjDecoded[evName]) {
|
|
1017
|
+
_this.eventDoneInLT = true;
|
|
974
1018
|
return false;
|
|
975
1019
|
}
|
|
976
1020
|
}
|
|
@@ -985,14 +1029,14 @@
|
|
|
985
1029
|
var Attributes = /*#__PURE__*/_createClass(function Attributes() {
|
|
986
1030
|
var _this = this;
|
|
987
1031
|
_classCallCheck(this, Attributes);
|
|
988
|
-
_defineProperty(this, "
|
|
989
|
-
_defineProperty(this, "
|
|
1032
|
+
_defineProperty(this, "KWLx", []);
|
|
1033
|
+
_defineProperty(this, "YkGb", []);
|
|
990
1034
|
_defineProperty(this, "parse", function () {
|
|
991
1035
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
992
1036
|
try {
|
|
993
|
-
_this.
|
|
994
|
-
_this.
|
|
995
|
-
if (!Array.isArray(_this.
|
|
1037
|
+
_this.KWLx = config.attributes.user;
|
|
1038
|
+
_this.YkGb = config.attributes.session;
|
|
1039
|
+
if (!Array.isArray(_this.KWLx) || !Array.isArray(_this.YkGb)) {
|
|
996
1040
|
Logger$7.error("No attributes");
|
|
997
1041
|
return false;
|
|
998
1042
|
}
|
|
@@ -1003,9 +1047,9 @@
|
|
|
1003
1047
|
return true;
|
|
1004
1048
|
});
|
|
1005
1049
|
_defineProperty(this, "validate", function (user, session) {
|
|
1006
|
-
return _this.
|
|
1050
|
+
return _this.hTqd(user, _this.KWLx) && _this.hTqd(session, _this.YkGb);
|
|
1007
1051
|
});
|
|
1008
|
-
_defineProperty(this, "
|
|
1052
|
+
_defineProperty(this, "hTqd", function (attributes, expected) {
|
|
1009
1053
|
var length = expected.length;
|
|
1010
1054
|
var status = true;
|
|
1011
1055
|
try {
|
|
@@ -1035,7 +1079,7 @@
|
|
|
1035
1079
|
}
|
|
1036
1080
|
var match = loggedValues.some(function (loggedValue) {
|
|
1037
1081
|
return values.some(function (configValue) {
|
|
1038
|
-
return
|
|
1082
|
+
return Pflq(loggedValue, configValue, operator);
|
|
1039
1083
|
});
|
|
1040
1084
|
});
|
|
1041
1085
|
status = status && match;
|
|
@@ -1059,18 +1103,18 @@
|
|
|
1059
1103
|
var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
|
|
1060
1104
|
var _this = this;
|
|
1061
1105
|
_classCallCheck(this, TimeBasedTermination);
|
|
1062
|
-
_defineProperty(this, "
|
|
1106
|
+
_defineProperty(this, "sKMB", Apxor.getController());
|
|
1063
1107
|
_defineProperty(this, "type", "");
|
|
1064
1108
|
_defineProperty(this, "_duration_seconds", 0);
|
|
1065
|
-
_defineProperty(this, "
|
|
1109
|
+
_defineProperty(this, "EUqu", 1);
|
|
1066
1110
|
_defineProperty(this, "parse", function (config) {
|
|
1067
1111
|
try {
|
|
1068
1112
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1069
|
-
_this.
|
|
1113
|
+
_this.Lecg = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
|
|
1070
1114
|
_this._duration_seconds = (_config$terminate_inf2 = config.terminate_info) === null || _config$terminate_inf2 === void 0 ? void 0 : _config$terminate_inf2.time_based.duration_seconds;
|
|
1071
|
-
_this.
|
|
1072
|
-
if (_this.
|
|
1073
|
-
_this.
|
|
1115
|
+
_this.EUqu = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
|
|
1116
|
+
if (_this.Pflq(config._id)) {
|
|
1117
|
+
_this.sKMB.persistTerminationInfoLocally(config._id);
|
|
1074
1118
|
return false;
|
|
1075
1119
|
}
|
|
1076
1120
|
} catch (_unused) {
|
|
@@ -1078,16 +1122,16 @@
|
|
|
1078
1122
|
}
|
|
1079
1123
|
return true;
|
|
1080
1124
|
});
|
|
1081
|
-
_defineProperty(this, "
|
|
1125
|
+
_defineProperty(this, "Pflq", function (id) {
|
|
1082
1126
|
var _Data$id;
|
|
1083
|
-
var Data = JSON.parse(_this.
|
|
1127
|
+
var Data = JSON.parse(_this.sKMB.getFromStorage(APX_TERMINATION_ID));
|
|
1084
1128
|
if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
|
|
1085
1129
|
var startDate = new Date(Data[id].startDate);
|
|
1086
1130
|
var presentDate = new Date(getDateInMMDDYYYY());
|
|
1087
1131
|
var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
|
|
1088
1132
|
var currentTime = _getTime();
|
|
1089
|
-
var
|
|
1090
|
-
return diff === _this.
|
|
1133
|
+
var tgyZ = Data[id].tgyZ;
|
|
1134
|
+
return diff === _this.EUqu && currentTime.hours >= tgyZ.hours || diff > _this.EUqu || Data[id].goalAcheived;
|
|
1091
1135
|
});
|
|
1092
1136
|
});
|
|
1093
1137
|
|
|
@@ -1096,19 +1140,19 @@
|
|
|
1096
1140
|
_classCallCheck(this, TerminationInfo);
|
|
1097
1141
|
_defineProperty(this, "enable_goal_events", false);
|
|
1098
1142
|
_defineProperty(this, "attributes", {});
|
|
1099
|
-
_defineProperty(this, "
|
|
1100
|
-
_defineProperty(this, "
|
|
1143
|
+
_defineProperty(this, "GeVn", new Attributes());
|
|
1144
|
+
_defineProperty(this, "YOHg", new TimeBasedTermination());
|
|
1101
1145
|
_defineProperty(this, "parse", function () {
|
|
1102
1146
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1103
1147
|
try {
|
|
1104
1148
|
var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
|
|
1105
1149
|
_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;
|
|
1106
|
-
if (_this.enable_time_based && !_this.
|
|
1150
|
+
if (_this.enable_time_based && !_this.YOHg.parse(config)) {
|
|
1107
1151
|
return false;
|
|
1108
1152
|
}
|
|
1109
1153
|
_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;
|
|
1110
1154
|
_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;
|
|
1111
|
-
if (_this.enable_attributes && !_this.
|
|
1155
|
+
if (_this.enable_attributes && !_this.GeVn.parse(config.terminate_info)) {
|
|
1112
1156
|
return false;
|
|
1113
1157
|
}
|
|
1114
1158
|
} catch (error) {
|
|
@@ -1118,7 +1162,7 @@
|
|
|
1118
1162
|
return true;
|
|
1119
1163
|
});
|
|
1120
1164
|
_defineProperty(this, "validate", function (user, session) {
|
|
1121
|
-
return _this.
|
|
1165
|
+
return _this.GeVn.validate(user, session);
|
|
1122
1166
|
});
|
|
1123
1167
|
});
|
|
1124
1168
|
|
|
@@ -1126,20 +1170,22 @@
|
|
|
1126
1170
|
var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
|
|
1127
1171
|
var _this = this;
|
|
1128
1172
|
_classCallCheck(this, ConfigItem);
|
|
1129
|
-
_defineProperty(this, "
|
|
1130
|
-
_defineProperty(this, "
|
|
1131
|
-
_defineProperty(this, "
|
|
1132
|
-
_defineProperty(this, "
|
|
1133
|
-
_defineProperty(this, "
|
|
1134
|
-
_defineProperty(this, "
|
|
1135
|
-
_defineProperty(this, "
|
|
1136
|
-
_defineProperty(this, "
|
|
1137
|
-
_defineProperty(this, "
|
|
1138
|
-
_defineProperty(this, "
|
|
1139
|
-
_defineProperty(this, "
|
|
1173
|
+
_defineProperty(this, "CVRh", []);
|
|
1174
|
+
_defineProperty(this, "AHwj", []);
|
|
1175
|
+
_defineProperty(this, "jUXZ", "");
|
|
1176
|
+
_defineProperty(this, "ByBE", new Meta());
|
|
1177
|
+
_defineProperty(this, "bgGW", new Audience());
|
|
1178
|
+
_defineProperty(this, "xdhp", new Validity());
|
|
1179
|
+
_defineProperty(this, "AIgt", new Frequency());
|
|
1180
|
+
_defineProperty(this, "IQFR", new OverallConfig());
|
|
1181
|
+
_defineProperty(this, "fgQe", new TerminationInfo());
|
|
1182
|
+
_defineProperty(this, "DAMl", false);
|
|
1183
|
+
_defineProperty(this, "iODJ", []);
|
|
1184
|
+
_defineProperty(this, "_variant_code", "");
|
|
1140
1185
|
_defineProperty(this, "parse", function () {
|
|
1141
1186
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1142
1187
|
try {
|
|
1188
|
+
var _this$ByBE$_attr;
|
|
1143
1189
|
// If ID is not present, throw it out
|
|
1144
1190
|
if (!isDefined(config._id)) {
|
|
1145
1191
|
Logger$8.error("No Id");
|
|
@@ -1153,18 +1199,18 @@
|
|
|
1153
1199
|
}
|
|
1154
1200
|
|
|
1155
1201
|
// If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
|
|
1156
|
-
if (!(_this.
|
|
1202
|
+
if (!(_this.ByBE.parse(config) && _this.xdhp.parse(config) && _this.AIgt.parse(config) && _this.bgGW.parse(config) && _this.IQFR.parse(config) && _this.fgQe.parse(config))) {
|
|
1157
1203
|
return false;
|
|
1158
1204
|
}
|
|
1159
|
-
|
|
1205
|
+
_this._variant_code = _this.ByBE._isExperiment || _this.ByBE._only_context ? (_this$ByBE$_attr = _this.ByBE._attr) === null || _this$ByBE$_attr === void 0 ? void 0 : _this$ByBE$_attr[APX_VARIANT_CODE] : "TG";
|
|
1160
1206
|
// If there are no conditions, throw it out
|
|
1161
1207
|
if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
|
|
1162
1208
|
Logger$8.error("No valid conditions", config.conditions);
|
|
1163
1209
|
return false;
|
|
1164
1210
|
}
|
|
1165
|
-
_this.
|
|
1166
|
-
_this.
|
|
1167
|
-
if (_this.
|
|
1211
|
+
_this.jUXZ = config._id;
|
|
1212
|
+
_this.DAMl = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
|
|
1213
|
+
if (_this.DAMl) {
|
|
1168
1214
|
// iff respectSequence is true, Sort the Conditions by their sequence order
|
|
1169
1215
|
// We need to sort, if server sends them in orderless manner
|
|
1170
1216
|
config.conditions.sort(function (prev, current) {
|
|
@@ -1176,17 +1222,17 @@
|
|
|
1176
1222
|
var conditions = config.conditions;
|
|
1177
1223
|
var length = conditions.length;
|
|
1178
1224
|
for (var index = 0; index < length; index++) {
|
|
1179
|
-
_this.
|
|
1225
|
+
_this.iODJ = [];
|
|
1180
1226
|
var condition = conditions[index];
|
|
1181
1227
|
if (condition.type === "didn't") {
|
|
1182
|
-
var
|
|
1228
|
+
var UHEM$details;
|
|
1183
1229
|
var obj = {
|
|
1184
1230
|
trigger_key: condition.trigger.details.name,
|
|
1185
|
-
no_kpi_array: condition === null || condition === void 0 || (
|
|
1231
|
+
no_kpi_array: condition === null || condition === void 0 || (UHEM$details = condition.details) === null || UHEM$details === void 0 || (UHEM$details = UHEM$details.additional_info) === null || UHEM$details === void 0 ? void 0 : UHEM$details.nkpi,
|
|
1186
1232
|
condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
|
|
1187
1233
|
time_bounds: condition.time_bounds.upper
|
|
1188
1234
|
};
|
|
1189
|
-
_this.
|
|
1235
|
+
_this.iODJ = [].concat(_toConsumableArray(_this.iODJ), [obj]);
|
|
1190
1236
|
//this will be the key
|
|
1191
1237
|
//when event occur check this array and then then check the time
|
|
1192
1238
|
//check the time diffrence
|
|
@@ -1195,73 +1241,143 @@
|
|
|
1195
1241
|
}
|
|
1196
1242
|
|
|
1197
1243
|
var conditionValidator = new ConditionValidator();
|
|
1198
|
-
if (conditionValidator.initialize(condition, _this.
|
|
1199
|
-
_this.
|
|
1244
|
+
if (conditionValidator.initialize(condition, _this.jUXZ, index, _this.DAMl, _this.iODJ)) {
|
|
1245
|
+
_this.CVRh.push(conditionValidator);
|
|
1200
1246
|
}
|
|
1201
1247
|
}
|
|
1202
|
-
if (_this.
|
|
1248
|
+
if (_this.fgQe.enable_goal_events) {
|
|
1203
1249
|
var goal_events = config.terminate_info.goal_events.events;
|
|
1204
1250
|
var goaleventslength = goal_events.length;
|
|
1205
1251
|
for (var i = 0; i < goaleventslength; i++) {
|
|
1206
1252
|
var _conditionValidator = new ConditionValidator();
|
|
1207
|
-
if (_conditionValidator.initialize(goal_events[i], _this.
|
|
1208
|
-
_this.
|
|
1253
|
+
if (_conditionValidator.initialize(goal_events[i], _this.jUXZ, i, true, [], "termination")) {
|
|
1254
|
+
_this.AHwj.push(_conditionValidator);
|
|
1209
1255
|
}
|
|
1210
1256
|
}
|
|
1211
1257
|
}
|
|
1212
|
-
return _this.
|
|
1258
|
+
return _this.CVRh.length > 0;
|
|
1213
1259
|
} catch (error) {
|
|
1214
1260
|
Logger$8.error(error);
|
|
1215
1261
|
return false;
|
|
1216
1262
|
}
|
|
1217
1263
|
});
|
|
1218
|
-
_defineProperty(this, "
|
|
1264
|
+
_defineProperty(this, "uhJX", function (index) {
|
|
1219
1265
|
if (index < 0) {
|
|
1220
1266
|
return;
|
|
1221
1267
|
}
|
|
1222
|
-
if (_this.
|
|
1223
|
-
var conditionValidator = _this.
|
|
1224
|
-
if (isDefined(conditionValidator) && conditionValidator.
|
|
1268
|
+
if (_this.DAMl) {
|
|
1269
|
+
var conditionValidator = _this.CVRh[index];
|
|
1270
|
+
if (isDefined(conditionValidator) && conditionValidator.KWyt) {
|
|
1225
1271
|
// Check if previous validator is satisfied
|
|
1226
|
-
var prevValidator = _this.
|
|
1227
|
-
if (isDefined(prevValidator) && !prevValidator.
|
|
1272
|
+
var prevValidator = _this.CVRh[index - 1];
|
|
1273
|
+
if (isDefined(prevValidator) && !prevValidator.KWyt) {
|
|
1228
1274
|
// TODO: If current index is satisfied before previous one, do something
|
|
1229
1275
|
// either unregister all conditions or remove this item from ConfigLookup
|
|
1230
1276
|
return;
|
|
1231
1277
|
}
|
|
1232
|
-
var nextValidator = _this.
|
|
1278
|
+
var nextValidator = _this.CVRh[index + 1];
|
|
1233
1279
|
if (!isDefined(nextValidator)) {
|
|
1234
1280
|
// It means this is the last condition
|
|
1235
1281
|
// Validate all conditions
|
|
1236
|
-
_this.
|
|
1282
|
+
_this.CdpR();
|
|
1237
1283
|
} else {
|
|
1238
|
-
nextValidator.
|
|
1284
|
+
nextValidator.PaJS();
|
|
1239
1285
|
}
|
|
1240
1286
|
}
|
|
1241
1287
|
} else {
|
|
1242
1288
|
// Validate all conditions
|
|
1243
|
-
_this.
|
|
1289
|
+
_this.CdpR();
|
|
1244
1290
|
}
|
|
1245
1291
|
});
|
|
1246
|
-
_defineProperty(this, "
|
|
1292
|
+
_defineProperty(this, "gtHb", function (index) {
|
|
1247
1293
|
if (index < 0) {
|
|
1248
1294
|
return;
|
|
1249
1295
|
}
|
|
1250
|
-
_this.
|
|
1296
|
+
_this.MQhs();
|
|
1251
1297
|
});
|
|
1252
|
-
_defineProperty(this, "
|
|
1298
|
+
_defineProperty(this, "CdpR", function () {
|
|
1253
1299
|
// Check If Audience, Validity is satisfied or not
|
|
1254
1300
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1255
1301
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1256
|
-
if (!_this.
|
|
1302
|
+
if (!_this.xdhp.validate() || !_this.bgGW.validate(userAttributes, sessionAttributes) || !_this.IQFR.validate()) {
|
|
1303
|
+
if (!_this.IQFR.retainedDaysValidated) {
|
|
1304
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1305
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1306
|
+
apx_nudge_id: _this.jUXZ,
|
|
1307
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1308
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1309
|
+
apx_failure_type: "warn",
|
|
1310
|
+
apx_reason: "Retained day criteria not met"
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
if (!_this.IQFR.retainedSessionValidated) {
|
|
1314
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1315
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1316
|
+
apx_nudge_id: _this.jUXZ,
|
|
1317
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1318
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1319
|
+
apx_failure_type: "warn",
|
|
1320
|
+
apx_reason: "User session criteria not met"
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
if (_this.IQFR.eventDoneInLT) {
|
|
1324
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1325
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1326
|
+
apx_nudge_id: _this.jUXZ,
|
|
1327
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1328
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1329
|
+
apx_failure_type: "warn",
|
|
1330
|
+
apx_reason: "Event done in life time"
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
if (!_this.bgGW.userAttributesValidated) {
|
|
1334
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1335
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1336
|
+
apx_nudge_id: _this.jUXZ,
|
|
1337
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1338
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1339
|
+
apx_failure_type: "warn",
|
|
1340
|
+
apx_reason: "User property filter not met"
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
if (!_this.bgGW.sessionAttributeValidated) {
|
|
1344
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1345
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1346
|
+
apx_nudge_id: _this.jUXZ,
|
|
1347
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1348
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1349
|
+
apx_failure_type: "warn",
|
|
1350
|
+
apx_reason: "Session property filter not met"
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
if (_this.xdhp._not_yet_active) {
|
|
1354
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1355
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1356
|
+
apx_nudge_id: _this.jUXZ,
|
|
1357
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1358
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1359
|
+
apx_failure_type: "warn",
|
|
1360
|
+
apx_reason: "nudge not yet active"
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
if (_this.xdhp._nudge_expired) {
|
|
1364
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1365
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1366
|
+
apx_nudge_id: _this.jUXZ,
|
|
1367
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1368
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1369
|
+
apx_failure_type: "warn",
|
|
1370
|
+
apx_reason: "nudge expired"
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1257
1373
|
return;
|
|
1258
1374
|
}
|
|
1259
|
-
var length = _this.
|
|
1375
|
+
var length = _this.CVRh.length;
|
|
1260
1376
|
var isSatisfied = length < 1;
|
|
1261
1377
|
var combineOperator = "";
|
|
1262
1378
|
for (var index = 0; index < length; index++) {
|
|
1263
|
-
var validator = _this.
|
|
1264
|
-
var currentResult = validator.
|
|
1379
|
+
var validator = _this.CVRh[index];
|
|
1380
|
+
var currentResult = validator.KWyt;
|
|
1265
1381
|
if (combineOperator.trim() === "") {
|
|
1266
1382
|
isSatisfied = currentResult;
|
|
1267
1383
|
} else {
|
|
@@ -1274,39 +1390,59 @@
|
|
|
1274
1390
|
break;
|
|
1275
1391
|
}
|
|
1276
1392
|
}
|
|
1277
|
-
combineOperator = validator.
|
|
1393
|
+
combineOperator = validator.zzXl;
|
|
1278
1394
|
}
|
|
1279
1395
|
if (isSatisfied) {
|
|
1396
|
+
var _window$ApxorRTM, _window$ApxorRTM2;
|
|
1280
1397
|
console.debug("onCondition satisfied");
|
|
1281
1398
|
// Check if count reached it's maximum
|
|
1282
|
-
if (!_this.
|
|
1283
|
-
console.warn("Maximum limit reached", _this.
|
|
1399
|
+
if (!_this.AIgt.iOMM(_this.jUXZ)) {
|
|
1400
|
+
console.warn("Maximum limit reached", _this.jUXZ);
|
|
1401
|
+
//logging event for view not found for test device
|
|
1402
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_non_eligible_user", {
|
|
1403
|
+
apx_nudge_type: "campaign",
|
|
1404
|
+
apx_nudge_id: _this.jUXZ,
|
|
1405
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1406
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG",
|
|
1407
|
+
apx_failure_type: "warn",
|
|
1408
|
+
apx_reason: "Campaign limit reached"
|
|
1409
|
+
});
|
|
1284
1410
|
return;
|
|
1285
1411
|
}
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1412
|
+
|
|
1413
|
+
//logging event for view not found for test device
|
|
1414
|
+
if (!((_window$ApxorRTM = window.ApxorRTM) !== null && _window$ApxorRTM !== void 0 && _window$ApxorRTM.isBadgePresent && (_window$ApxorRTM2 = window.ApxorRTM) !== null && _window$ApxorRTM2 !== void 0 && _window$ApxorRTM2.badgesLists.includes(_this.jUXZ) && Apxor.getController().isBadgeTriggerSatisfied(_this.jUXZ))) {
|
|
1415
|
+
Apxor === null || Apxor === void 0 || Apxor.logEvent("apx_trigger_satisfied", {
|
|
1416
|
+
apx_nudge_type: _this.ByBE.Lecg === "SURVEY" ? "survey" : "campaign",
|
|
1417
|
+
apx_nudge_id: _this.jUXZ,
|
|
1418
|
+
apx_nudge_name: _this.ByBE.figp,
|
|
1419
|
+
apx_variant_code: _this.ByBE._isExperiment || _this.ByBE._only_context ? _this.ByBE._attr[APX_VARIANT_CODE] : "TG"
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
console.log("Dispatching event", _this.ByBE.Lecg);
|
|
1423
|
+
if (_this.ByBE._only_context === true) {
|
|
1424
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.ByBE._attr), {}, {
|
|
1425
|
+
message_name: _this.ByBE.figp,
|
|
1426
|
+
id: _this.jUXZ
|
|
1291
1427
|
}));
|
|
1292
1428
|
}
|
|
1293
1429
|
// Emit event
|
|
1294
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1295
|
-
name: _this.
|
|
1430
|
+
Apxor.getController().dispatchEvent(_this.ByBE.Lecg, {
|
|
1431
|
+
name: _this.ByBE.Lecg,
|
|
1296
1432
|
additional_info: {
|
|
1297
|
-
uuid: _this.
|
|
1298
|
-
name: _this.
|
|
1433
|
+
uuid: _this.jUXZ,
|
|
1434
|
+
name: _this.ByBE.figp
|
|
1299
1435
|
}
|
|
1300
1436
|
});
|
|
1301
1437
|
}
|
|
1302
1438
|
});
|
|
1303
|
-
_defineProperty(this, "
|
|
1304
|
-
var length = _this.
|
|
1439
|
+
_defineProperty(this, "MQhs", function () {
|
|
1440
|
+
var length = _this.AHwj.length;
|
|
1305
1441
|
var isSatisfied = length < 1;
|
|
1306
1442
|
var combineOperator = "";
|
|
1307
1443
|
for (var index = 0; index < length; index++) {
|
|
1308
|
-
var validator = _this.
|
|
1309
|
-
var currentResult = validator.
|
|
1444
|
+
var validator = _this.AHwj[index];
|
|
1445
|
+
var currentResult = validator.KWyt;
|
|
1310
1446
|
if (combineOperator.trim() === "") {
|
|
1311
1447
|
isSatisfied = currentResult;
|
|
1312
1448
|
} else {
|
|
@@ -1319,23 +1455,23 @@
|
|
|
1319
1455
|
break;
|
|
1320
1456
|
}
|
|
1321
1457
|
}
|
|
1322
|
-
combineOperator = validator.
|
|
1458
|
+
combineOperator = validator.bXqj;
|
|
1323
1459
|
}
|
|
1324
1460
|
if (isSatisfied) {
|
|
1325
|
-
console.log("Dispatching event", _this.
|
|
1326
|
-
Apxor.getController().persistTerminationInfoLocally(_this.
|
|
1327
|
-
if (_this.
|
|
1328
|
-
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.
|
|
1329
|
-
message_name: _this.
|
|
1330
|
-
id: _this.
|
|
1461
|
+
console.log("Dispatching event", _this.ByBE.Lecg);
|
|
1462
|
+
Apxor.getController().persistTerminationInfoLocally(_this.jUXZ);
|
|
1463
|
+
if (_this.ByBE._only_context === true) {
|
|
1464
|
+
Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.ByBE._attr), {}, {
|
|
1465
|
+
message_name: _this.ByBE.figp,
|
|
1466
|
+
id: _this.jUXZ
|
|
1331
1467
|
}));
|
|
1332
1468
|
}
|
|
1333
1469
|
// Emit event
|
|
1334
|
-
Apxor.getController().dispatchEvent(_this.
|
|
1335
|
-
name: _this.
|
|
1470
|
+
Apxor.getController().dispatchEvent(_this.ByBE.Lecg, {
|
|
1471
|
+
name: _this.ByBE.Lecg,
|
|
1336
1472
|
additional_info: {
|
|
1337
|
-
uuid: _this.
|
|
1338
|
-
name: _this.
|
|
1473
|
+
uuid: _this.jUXZ,
|
|
1474
|
+
name: _this.ByBE.figp
|
|
1339
1475
|
}
|
|
1340
1476
|
});
|
|
1341
1477
|
}
|
|
@@ -1343,23 +1479,23 @@
|
|
|
1343
1479
|
_defineProperty(this, "validateForTerminationAttributes", function () {
|
|
1344
1480
|
var userAttributes = Apxor.getController().getUserAttributes();
|
|
1345
1481
|
var sessionAttributes = Apxor.getController().getSessionAttributes();
|
|
1346
|
-
return _this.
|
|
1482
|
+
return _this.fgQe.validate(userAttributes, sessionAttributes);
|
|
1347
1483
|
});
|
|
1348
|
-
_defineProperty(this, "
|
|
1349
|
-
_this.
|
|
1484
|
+
_defineProperty(this, "ikdS", function () {
|
|
1485
|
+
_this.AIgt.ikdS();
|
|
1350
1486
|
});
|
|
1351
1487
|
_defineProperty(this, "getFrequencyCount", function () {
|
|
1352
|
-
return _this.
|
|
1488
|
+
return _this.AIgt.getFrequencyCount();
|
|
1353
1489
|
});
|
|
1354
|
-
_defineProperty(this, "
|
|
1355
|
-
return _this.
|
|
1490
|
+
_defineProperty(this, "trLO", function () {
|
|
1491
|
+
return _this.AIgt.MdUm();
|
|
1356
1492
|
});
|
|
1357
1493
|
});
|
|
1358
1494
|
|
|
1359
1495
|
var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
|
|
1360
1496
|
var _this = this;
|
|
1361
1497
|
_classCallCheck(this, ConfigLookup);
|
|
1362
|
-
_defineProperty(this, "
|
|
1498
|
+
_defineProperty(this, "XDsl", {});
|
|
1363
1499
|
_defineProperty(this, "parse", function () {
|
|
1364
1500
|
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
1365
1501
|
configs: []
|
|
@@ -1382,7 +1518,7 @@
|
|
|
1382
1518
|
var configId = _config._id;
|
|
1383
1519
|
var configItem = new ConfigItem();
|
|
1384
1520
|
if (configItem.parse(_config)) {
|
|
1385
|
-
_this.
|
|
1521
|
+
_this.XDsl[configId] = configItem;
|
|
1386
1522
|
} else {
|
|
1387
1523
|
console.warn("Failed to parse cfg", configId);
|
|
1388
1524
|
}
|
|
@@ -1390,44 +1526,51 @@
|
|
|
1390
1526
|
}
|
|
1391
1527
|
});
|
|
1392
1528
|
_defineProperty(this, "validate", function (id, index) {
|
|
1393
|
-
if (_this.
|
|
1394
|
-
var configItem = _this.
|
|
1395
|
-
configItem.
|
|
1529
|
+
if (_this.XDsl[id]) {
|
|
1530
|
+
var configItem = _this.XDsl[id];
|
|
1531
|
+
configItem.uhJX(index);
|
|
1396
1532
|
}
|
|
1397
1533
|
});
|
|
1534
|
+
_defineProperty(this, "getVariantCode", function (id) {
|
|
1535
|
+
if (_this.XDsl[id]) {
|
|
1536
|
+
var configItem = _this.XDsl[id];
|
|
1537
|
+
return configItem._variant_code;
|
|
1538
|
+
}
|
|
1539
|
+
return "";
|
|
1540
|
+
});
|
|
1398
1541
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1399
|
-
if (_this.
|
|
1400
|
-
var configItem = _this.
|
|
1401
|
-
configItem.
|
|
1542
|
+
if (_this.XDsl[id]) {
|
|
1543
|
+
var configItem = _this.XDsl[id];
|
|
1544
|
+
configItem.gtHb(index);
|
|
1402
1545
|
}
|
|
1403
1546
|
});
|
|
1404
1547
|
_defineProperty(this, "validateForTerminationAttributes", function (id) {
|
|
1405
|
-
if (_this.
|
|
1406
|
-
var configItem = _this.
|
|
1548
|
+
if (_this.XDsl[id]) {
|
|
1549
|
+
var configItem = _this.XDsl[id];
|
|
1407
1550
|
return configItem.validateForTerminationAttributes();
|
|
1408
1551
|
}
|
|
1409
1552
|
return false;
|
|
1410
1553
|
});
|
|
1411
|
-
_defineProperty(this, "
|
|
1412
|
-
var campiagnConfig = _this.
|
|
1413
|
-
campiagnConfig.
|
|
1554
|
+
_defineProperty(this, "ikdS", function (id) {
|
|
1555
|
+
var campiagnConfig = _this.XDsl[id];
|
|
1556
|
+
campiagnConfig.ikdS();
|
|
1414
1557
|
});
|
|
1415
1558
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1416
|
-
var campiagnConfig = _this.
|
|
1559
|
+
var campiagnConfig = _this.XDsl[id];
|
|
1417
1560
|
return campiagnConfig.getFrequencyCount();
|
|
1418
1561
|
});
|
|
1419
1562
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1420
|
-
var configs = _this.
|
|
1563
|
+
var configs = _this.XDsl;
|
|
1421
1564
|
for (var configId in configs) {
|
|
1422
|
-
configs[configId].
|
|
1565
|
+
configs[configId].trLO();
|
|
1423
1566
|
}
|
|
1424
1567
|
});
|
|
1425
|
-
_defineProperty(this, "
|
|
1568
|
+
_defineProperty(this, "jMAH", function (campaignId) {
|
|
1426
1569
|
try {
|
|
1427
|
-
if (_this.
|
|
1428
|
-
var configItem = _this.
|
|
1429
|
-
if (configItem && configItem.
|
|
1430
|
-
return configItem.
|
|
1570
|
+
if (_this.XDsl) {
|
|
1571
|
+
var configItem = _this.XDsl[campaignId];
|
|
1572
|
+
if (configItem && configItem.ByBE) {
|
|
1573
|
+
return configItem.ByBE;
|
|
1431
1574
|
}
|
|
1432
1575
|
}
|
|
1433
1576
|
} catch (e) {
|
|
@@ -1443,42 +1586,42 @@
|
|
|
1443
1586
|
var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
|
|
1444
1587
|
var _this = this;
|
|
1445
1588
|
_classCallCheck(this, EventsListener);
|
|
1446
|
-
_defineProperty(this, "
|
|
1447
|
-
_defineProperty(this, "
|
|
1448
|
-
_defineProperty(this, "
|
|
1589
|
+
_defineProperty(this, "rnqO", {});
|
|
1590
|
+
_defineProperty(this, "jgKf", []);
|
|
1591
|
+
_defineProperty(this, "isEr", false);
|
|
1449
1592
|
_defineProperty(this, "initialize", function () {
|
|
1450
1593
|
var controller = Apxor.getController();
|
|
1451
1594
|
controller.registerForEvent(APP_EVENT, function (event) {
|
|
1452
|
-
return _this.
|
|
1595
|
+
return _this.OmRD(event, "AE");
|
|
1453
1596
|
});
|
|
1454
1597
|
controller.registerForEvent(CLIENT_EVENT, function (event) {
|
|
1455
|
-
return _this.
|
|
1598
|
+
return _this.OmRD(event, "CE");
|
|
1456
1599
|
});
|
|
1457
1600
|
});
|
|
1458
|
-
_defineProperty(this, "
|
|
1601
|
+
_defineProperty(this, "uHZe", function () {
|
|
1459
1602
|
// Clear Buffer
|
|
1460
|
-
for (var item in _this.
|
|
1461
|
-
_this.
|
|
1603
|
+
for (var item in _this.jgKf) {
|
|
1604
|
+
_this.gOcO(item.event, item.key, item.type);
|
|
1462
1605
|
}
|
|
1463
|
-
_this.
|
|
1606
|
+
_this.isEr = true;
|
|
1464
1607
|
});
|
|
1465
|
-
_defineProperty(this, "
|
|
1608
|
+
_defineProperty(this, "dgAX", function (event, callback) {
|
|
1466
1609
|
if (!isFunction(callback)) {
|
|
1467
1610
|
return;
|
|
1468
1611
|
}
|
|
1469
1612
|
var listeners;
|
|
1470
|
-
if (_this.
|
|
1471
|
-
listeners = _this.
|
|
1613
|
+
if (_this.rnqO[event]) {
|
|
1614
|
+
listeners = _this.rnqO[event];
|
|
1472
1615
|
} else {
|
|
1473
1616
|
listeners = [];
|
|
1474
1617
|
}
|
|
1475
1618
|
listeners.push(callback);
|
|
1476
|
-
_this.
|
|
1477
|
-
Logger$9.debug("Listeners list: ", _this.
|
|
1619
|
+
_this.rnqO[event] = listeners;
|
|
1620
|
+
Logger$9.debug("Listeners list: ", _this.rnqO);
|
|
1478
1621
|
});
|
|
1479
1622
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1480
|
-
if (_this.
|
|
1481
|
-
var listeners = _this.
|
|
1623
|
+
if (_this.rnqO[event]) {
|
|
1624
|
+
var listeners = _this.rnqO[event];
|
|
1482
1625
|
var updatedListeners = [];
|
|
1483
1626
|
for (var index = 0; index < listeners.length; index++) {
|
|
1484
1627
|
var listener = listeners[index];
|
|
@@ -1486,25 +1629,25 @@
|
|
|
1486
1629
|
updatedListeners.push(listener);
|
|
1487
1630
|
}
|
|
1488
1631
|
}
|
|
1489
|
-
_this.
|
|
1632
|
+
_this.rnqO[event] = updatedListeners;
|
|
1490
1633
|
}
|
|
1491
1634
|
});
|
|
1492
|
-
_defineProperty(this, "
|
|
1635
|
+
_defineProperty(this, "OmRD", function (event) {
|
|
1493
1636
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
|
|
1494
1637
|
var key = type + "___" + event.name;
|
|
1495
|
-
_this.
|
|
1638
|
+
_this.gOcO(event, key, type);
|
|
1496
1639
|
});
|
|
1497
|
-
_defineProperty(this, "
|
|
1498
|
-
if (!_this.
|
|
1499
|
-
_this.
|
|
1640
|
+
_defineProperty(this, "gOcO", function (event, key, type) {
|
|
1641
|
+
if (!_this.isEr) {
|
|
1642
|
+
_this.jgKf.push({
|
|
1500
1643
|
event: event,
|
|
1501
1644
|
key: key,
|
|
1502
1645
|
type: type
|
|
1503
1646
|
});
|
|
1504
1647
|
} else {
|
|
1505
|
-
Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.
|
|
1506
|
-
if (_this.
|
|
1507
|
-
var listeners = _this.
|
|
1648
|
+
Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.rnqO);
|
|
1649
|
+
if (_this.rnqO[key]) {
|
|
1650
|
+
var listeners = _this.rnqO[key];
|
|
1508
1651
|
var time = Apxor.getController().getSDKRunningTimeInSec();
|
|
1509
1652
|
for (var index = 0; index < listeners.length; index++) {
|
|
1510
1653
|
var listener = listeners[index];
|
|
@@ -1520,17 +1663,17 @@
|
|
|
1520
1663
|
function CE() {
|
|
1521
1664
|
var _this = this;
|
|
1522
1665
|
_classCallCheck(this, CE);
|
|
1523
|
-
_defineProperty(this, "
|
|
1524
|
-
_defineProperty(this, "
|
|
1525
|
-
_defineProperty(this, "
|
|
1526
|
-
_defineProperty(this, "
|
|
1527
|
-
_defineProperty(this, "
|
|
1666
|
+
_defineProperty(this, "qwnH", false);
|
|
1667
|
+
_defineProperty(this, "MWAY", null);
|
|
1668
|
+
_defineProperty(this, "dOSQ", getDateInDDMMYYYY());
|
|
1669
|
+
_defineProperty(this, "aXRJ", new EventsListener());
|
|
1670
|
+
_defineProperty(this, "yjQV", Apxor.getSiteId());
|
|
1528
1671
|
_defineProperty(this, "_qeState", {});
|
|
1529
1672
|
_defineProperty(this, "getQeState", function () {
|
|
1530
1673
|
try {
|
|
1531
1674
|
var data = Apxor.getController().getFromStorage(QE_STATE);
|
|
1532
1675
|
if (data) {
|
|
1533
|
-
return JSON.parse(decode(_this.
|
|
1676
|
+
return JSON.parse(decode(_this.yjQV, data));
|
|
1534
1677
|
} else {
|
|
1535
1678
|
_this._qeState = {};
|
|
1536
1679
|
return _this.setQeState();
|
|
@@ -1559,10 +1702,10 @@
|
|
|
1559
1702
|
return _this._qeState;
|
|
1560
1703
|
});
|
|
1561
1704
|
_defineProperty(this, "initialize", function () {
|
|
1562
|
-
if (!_this.
|
|
1563
|
-
_this.
|
|
1564
|
-
_this.
|
|
1565
|
-
_this.
|
|
1705
|
+
if (!_this.qwnH) {
|
|
1706
|
+
_this.qwnH = true;
|
|
1707
|
+
_this.MWAY = new ConfigLookup();
|
|
1708
|
+
_this.aXRJ.initialize();
|
|
1566
1709
|
_this._qeState = _this.getQeState();
|
|
1567
1710
|
Logger$a.info("QE Initialized..");
|
|
1568
1711
|
}
|
|
@@ -1573,12 +1716,12 @@
|
|
|
1573
1716
|
* @param config
|
|
1574
1717
|
*/
|
|
1575
1718
|
_defineProperty(this, "parse", function (config) {
|
|
1576
|
-
if (!_this.
|
|
1719
|
+
if (!_this.lGLs()) {
|
|
1577
1720
|
Logger$a.warn("Must call init first. Unable to proceed");
|
|
1578
1721
|
return;
|
|
1579
1722
|
}
|
|
1580
|
-
_this.
|
|
1581
|
-
_this.
|
|
1723
|
+
_this.MWAY.parse(config);
|
|
1724
|
+
_this.aXRJ.uHZe();
|
|
1582
1725
|
});
|
|
1583
1726
|
/**
|
|
1584
1727
|
* Validates all conditions for given config ID
|
|
@@ -1587,19 +1730,22 @@
|
|
|
1587
1730
|
* @param index
|
|
1588
1731
|
*/
|
|
1589
1732
|
_defineProperty(this, "validate", function (id, index) {
|
|
1590
|
-
if (!_this.
|
|
1733
|
+
if (!_this.lGLs()) {
|
|
1591
1734
|
return;
|
|
1592
1735
|
}
|
|
1593
|
-
_this.
|
|
1736
|
+
_this.MWAY.validate(id, index);
|
|
1737
|
+
});
|
|
1738
|
+
_defineProperty(this, "getVariantCode", function (id) {
|
|
1739
|
+
return _this.MWAY.getVariantCode(id);
|
|
1594
1740
|
});
|
|
1595
1741
|
_defineProperty(this, "validateForTermination", function (id, index) {
|
|
1596
|
-
if (!_this.
|
|
1742
|
+
if (!_this.lGLs()) {
|
|
1597
1743
|
return;
|
|
1598
1744
|
}
|
|
1599
|
-
_this.
|
|
1745
|
+
_this.MWAY.validateForTermination(id, index);
|
|
1600
1746
|
});
|
|
1601
1747
|
_defineProperty(this, "validateForTerminationAttributes", function (user, session) {
|
|
1602
|
-
return _this.
|
|
1748
|
+
return _this.MWAY.validateForTerminationAttributes(user, session);
|
|
1603
1749
|
});
|
|
1604
1750
|
_defineProperty(this, "updateCount", function (id) {
|
|
1605
1751
|
try {
|
|
@@ -1608,25 +1754,25 @@
|
|
|
1608
1754
|
}
|
|
1609
1755
|
_this.incrementFrequencies(id);
|
|
1610
1756
|
_this.setQeState(id);
|
|
1611
|
-
_this.
|
|
1757
|
+
_this.MWAY.ikdS(id);
|
|
1612
1758
|
} catch (e) {
|
|
1613
1759
|
console.log("Could not update the count config:".concat(e));
|
|
1614
1760
|
}
|
|
1615
1761
|
});
|
|
1616
1762
|
_defineProperty(this, "resetFrequencyCounts", function () {
|
|
1617
|
-
_this.
|
|
1763
|
+
_this.MWAY.resetFrequencyCounts();
|
|
1618
1764
|
});
|
|
1619
1765
|
_defineProperty(this, "getFrequencyCount", function (id) {
|
|
1620
|
-
return _this.
|
|
1766
|
+
return _this.MWAY.getFrequencyCount(id);
|
|
1621
1767
|
});
|
|
1622
1768
|
_defineProperty(this, "registerForEvent", function (event, callback) {
|
|
1623
|
-
_this.
|
|
1769
|
+
_this.aXRJ.dgAX(event, callback);
|
|
1624
1770
|
});
|
|
1625
1771
|
_defineProperty(this, "unregisterFromEvent", function (event, callback) {
|
|
1626
|
-
_this.
|
|
1772
|
+
_this.aXRJ.unregisterFromEvent(event, callback);
|
|
1627
1773
|
});
|
|
1628
1774
|
_defineProperty(this, "notifyEventListener", function (event) {
|
|
1629
|
-
_this.
|
|
1775
|
+
_this.aXRJ.OmRD(event);
|
|
1630
1776
|
});
|
|
1631
1777
|
/**
|
|
1632
1778
|
* Fetches the config from Server
|
|
@@ -1639,14 +1785,14 @@
|
|
|
1639
1785
|
_defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
|
|
1640
1786
|
Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
|
|
1641
1787
|
});
|
|
1642
|
-
_defineProperty(this, "
|
|
1643
|
-
return _this.
|
|
1788
|
+
_defineProperty(this, "lGLs", function () {
|
|
1789
|
+
return _this.qwnH;
|
|
1644
1790
|
});
|
|
1645
1791
|
_defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
|
|
1646
|
-
return _this.
|
|
1792
|
+
return _this.MWAY.jMAH(campaignId);
|
|
1647
1793
|
});
|
|
1648
|
-
_defineProperty(this, "
|
|
1649
|
-
return _this.
|
|
1794
|
+
_defineProperty(this, "hUQY", function () {
|
|
1795
|
+
return _this.dOSQ;
|
|
1650
1796
|
});
|
|
1651
1797
|
if (!CE.instance) {
|
|
1652
1798
|
CE.instance = this;
|
|
@@ -1670,7 +1816,7 @@
|
|
|
1670
1816
|
OVERALL: 0,
|
|
1671
1817
|
DATES: {}
|
|
1672
1818
|
};
|
|
1673
|
-
if (this.
|
|
1819
|
+
if (this.dOSQ) this._qeState[id].DATES[this.dOSQ] = 0;
|
|
1674
1820
|
this.setQeState(id);
|
|
1675
1821
|
}
|
|
1676
1822
|
} catch (e) {
|
|
@@ -1689,12 +1835,12 @@
|
|
|
1689
1835
|
|
|
1690
1836
|
// Increment the DATES count for this particular date by 1. If the date changes reset.
|
|
1691
1837
|
var currentDate = getDateInDDMMYYYY();
|
|
1692
|
-
if (currentDate !== this.
|
|
1693
|
-
this.
|
|
1838
|
+
if (currentDate !== this.dOSQ || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
|
|
1839
|
+
this.dOSQ = currentDate;
|
|
1694
1840
|
configFrequency.DATES = {};
|
|
1695
|
-
configFrequency.DATES[this.
|
|
1841
|
+
configFrequency.DATES[this.dOSQ] = 0;
|
|
1696
1842
|
}
|
|
1697
|
-
configFrequency.DATES[this.
|
|
1843
|
+
configFrequency.DATES[this.dOSQ] = configFrequency.DATES[this.dOSQ] + 1;
|
|
1698
1844
|
}
|
|
1699
1845
|
}], [{
|
|
1700
1846
|
key: "getInstance",
|
|
@@ -1713,7 +1859,7 @@
|
|
|
1713
1859
|
|
|
1714
1860
|
/* eslint-disable no-empty */
|
|
1715
1861
|
|
|
1716
|
-
window.ceVersion =
|
|
1862
|
+
window.ceVersion = 151;
|
|
1717
1863
|
try {
|
|
1718
1864
|
if (exports !== undefined || exports !== null) {
|
|
1719
1865
|
exports["default"] = CE;
|