apxor-qe 1.3.0 → 1.4.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.
@@ -203,7 +203,7 @@
203
203
  var toUpperCase = function toUpperCase(key) {
204
204
  return key.toUpperCase();
205
205
  };
206
- var compare = function compare(actual, expected, operator) {
206
+ var zuMV = function zuMV(actual, expected, operator) {
207
207
  switch (operator) {
208
208
  case "EQ":
209
209
  return actual === expected;
@@ -242,20 +242,38 @@
242
242
  return dateDDMMYYYY;
243
243
  };
244
244
 
245
+ /**
246
+ * @function getDateInMMDDYYYY
247
+ * @description Returns the current date in MM/DD/YYYY Format
248
+ * @returns {string}
249
+ */
250
+ var getDateInMMDDYYYY = function getDateInMMDDYYYY() {
251
+ var currentDate = new Date();
252
+ var dateDDMMYYYY = currentDate.getMonth() + "/" + currentDate.getDate() + "/" + currentDate.getFullYear();
253
+ return dateDDMMYYYY;
254
+ };
255
+ var _getTime = function _getTime() {
256
+ var currentTime = new Date();
257
+ return {
258
+ hours: currentTime.getHours(),
259
+ mins: currentTime.getMinutes()
260
+ };
261
+ };
262
+
245
263
  var Logger = window.ApxorLogger;
246
264
  var Audience = /*#__PURE__*/_createClass(function Audience() {
247
265
  var _this = this;
248
266
  _classCallCheck(this, Audience);
249
- _defineProperty(this, "FFVT", "ALL");
250
- _defineProperty(this, "Peqo", []);
251
- _defineProperty(this, "ukFQ", []);
267
+ _defineProperty(this, "upBe", "ALL");
268
+ _defineProperty(this, "qHve", []);
269
+ _defineProperty(this, "hfXD", []);
252
270
  _defineProperty(this, "parse", function () {
253
271
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
254
272
  try {
255
- _this.FFVT = config.audience.audience_type;
256
- _this.Peqo = config.audience.attributes.user;
257
- _this.ukFQ = config.audience.attributes.session;
258
- if (!Array.isArray(_this.Peqo) || !Array.isArray(_this.ukFQ)) {
273
+ _this.upBe = config.audience.audience_type;
274
+ _this.qHve = config.audience.attributes.user;
275
+ _this.hfXD = config.audience.attributes.session;
276
+ if (!Array.isArray(_this.qHve) || !Array.isArray(_this.hfXD)) {
259
277
  Logger.error("No attributes");
260
278
  return false;
261
279
  }
@@ -267,12 +285,12 @@
267
285
  });
268
286
  _defineProperty(this, "validate", function (user, session) {
269
287
  var status = true;
270
- if (_this.FFVT === "FTU") {
288
+ if (_this.upBe === "FTU") {
271
289
  status = Apxor.getController().getSessionInfo().is_first_session;
272
290
  }
273
- return status && _this.pYKU(user, _this.Peqo) && _this.pYKU(session, _this.ukFQ);
291
+ return status && _this.AYgA(user, _this.qHve) && _this.AYgA(session, _this.hfXD);
274
292
  });
275
- _defineProperty(this, "pYKU", function (attributes, expected) {
293
+ _defineProperty(this, "AYgA", function (attributes, expected) {
276
294
  var length = expected.length;
277
295
  var status = true;
278
296
  try {
@@ -302,7 +320,7 @@
302
320
  }
303
321
  var match = loggedValues.some(function (loggedValue) {
304
322
  return values.some(function (configValue) {
305
- return compare(loggedValue, configValue, operator);
323
+ return zuMV(loggedValue, configValue, operator);
306
324
  });
307
325
  });
308
326
  status = status && match;
@@ -324,34 +342,37 @@
324
342
  var Frequency = /*#__PURE__*/_createClass(function Frequency() {
325
343
  var _this = this;
326
344
  _classCallCheck(this, Frequency);
327
- _defineProperty(this, "FDLa", 0);
328
- _defineProperty(this, "CBbn", 0);
329
- _defineProperty(this, "bLov", "SESSION");
330
- _defineProperty(this, "WzqN", 0);
331
- _defineProperty(this, "FhVO", 0);
332
- _defineProperty(this, "HkIT", 0);
345
+ _defineProperty(this, "cyan", 0);
346
+ _defineProperty(this, "xUCG", 0);
347
+ _defineProperty(this, "TTrx", "SESSION");
348
+ _defineProperty(this, "dBjB", 0);
349
+ _defineProperty(this, "QeCL", 0);
350
+ _defineProperty(this, "voNY", 0);
333
351
  _defineProperty(this, "parse", function () {
334
352
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
335
353
  try {
336
- _this.FDLa = config.frequency.count;
337
- _this.HkIT = _this.FDLa;
338
- _this.CBbn = config.frequency.time_interval;
339
- _this.bLov = config.frequency.validity;
340
- _this.FhVO = config.frequency.ses_lmt;
354
+ _this.cyan = config.frequency.count;
355
+ if (_this.cyan === -1) {
356
+ _this.cyan = 1000;
357
+ }
358
+ _this.voNY = _this.cyan;
359
+ _this.xUCG = config.frequency.time_interval;
360
+ _this.TTrx = config.frequency.validity;
361
+ _this.QeCL = config.frequency.ses_lmt;
341
362
  _this._dayCount = config.frequency.day_lmt;
342
363
  // let data = Apxor.getController().getFromStorage(QE_STATE);
343
364
  // let qe_state = JSON.parse(decode(Apxor.getSiteId(), data));
344
365
  var qe_state = CE.getInstance().getQeState();
345
366
  if (!isDefined(qe_state) || !isDefined(qe_state[config._id])) return true;
346
- if (_this.bLov === "SESSION") {
347
- _this.FDLa = parseInt(_this.FDLa) - parseInt(qe_state[config._id]["SESSION"]);
348
- if (_this.FDLa <= 0) {
367
+ if (_this.TTrx === "SESSION") {
368
+ _this.cyan = parseInt(_this.cyan) - parseInt(qe_state[config._id]["SESSION"]);
369
+ if (_this.cyan <= 0) {
349
370
  console.warn("Max count limit reached for session:" + config._id);
350
371
  return false;
351
372
  }
352
- } else if (_this.bLov === "OVERALL") {
353
- _this.FDLa = parseInt(_this.FDLa) - parseInt(qe_state[config._id]["OVERALL"]);
354
- if (_this.FDLa <= 0) {
373
+ } else if (_this.TTrx === "OVERALL") {
374
+ _this.cyan = parseInt(_this.cyan) - parseInt(qe_state[config._id]["OVERALL"]);
375
+ if (_this.cyan <= 0) {
355
376
  console.warn("Max count limit reached for overall:" + config._id);
356
377
  return false;
357
378
  }
@@ -365,28 +386,28 @@
365
386
  }
366
387
  return true;
367
388
  });
368
- _defineProperty(this, "PUEA", function () {
369
- _this.FDLa = _this.FDLa - 1;
389
+ _defineProperty(this, "yGJs", function () {
390
+ _this.cyan = _this.cyan - 1;
370
391
  });
371
392
  _defineProperty(this, "getFrequencyCount", function () {
372
- return _this.FDLa;
393
+ return _this.cyan;
373
394
  });
374
- _defineProperty(this, "kPus", function () {
375
- if (_this.bLov === "SESSION") {
376
- _this.FDLa = _this.HkIT;
395
+ _defineProperty(this, "NSSU", function () {
396
+ if (_this.TTrx === "SESSION") {
397
+ _this.cyan = _this.voNY;
377
398
  Logger$1.info("Campaign Limit reset");
378
399
  }
379
400
  });
380
401
  /**
381
- * @function Frbd
402
+ * @function HBeu
382
403
  * @description Validates if the campaign count is with in the limits set in the config.
383
404
  * @param {string} Config id
384
405
  * @returns {boolean} true - If the Campaign limits are not reached
385
406
  * false - Otherwise
386
407
  */
387
- _defineProperty(this, "Frbd", function (id) {
408
+ _defineProperty(this, "HBeu", function (id) {
388
409
  try {
389
- if (_this.FDLa <= 0) {
410
+ if (_this.cyan <= 0) {
390
411
  return false;
391
412
  }
392
413
 
@@ -397,8 +418,8 @@
397
418
  if (!isDefined(qe_state) || !isDefined(qe_state[id])) return true;
398
419
 
399
420
  //If the config has a session count limit set
400
- if (_this.FhVO !== 0) {
401
- var sessionCountInConfig = parseInt(_this.FhVO);
421
+ if (_this.QeCL !== 0) {
422
+ var sessionCountInConfig = parseInt(_this.QeCL);
402
423
  var thisSessionCount = parseInt(qe_state[id]["SESSION"]);
403
424
  if (sessionCountInConfig - thisSessionCount <= 0) {
404
425
  return false;
@@ -425,14 +446,14 @@
425
446
  var Meta = /*#__PURE__*/_createClass(function Meta() {
426
447
  var _this = this;
427
448
  _classCallCheck(this, Meta);
428
- _defineProperty(this, "CtPY", "");
429
- _defineProperty(this, "FFVT", "");
449
+ _defineProperty(this, "dXou", "");
450
+ _defineProperty(this, "upBe", "");
430
451
  _defineProperty(this, "parse", function () {
431
452
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
432
453
  try {
433
454
  var _config$meta;
434
- _this.CtPY = config.meta.name;
435
- _this.FFVT = config.meta.type;
455
+ _this.dXou = config.meta.name;
456
+ _this.upBe = config.meta.type;
436
457
  _this._only_context = config.meta.only_context;
437
458
  _this._attr = ((_config$meta = config.meta) === null || _config$meta === void 0 ? void 0 : _config$meta.attr) || {};
438
459
  } catch (error) {
@@ -447,11 +468,11 @@
447
468
  var Validity = /*#__PURE__*/_createClass(function Validity() {
448
469
  var _this = this;
449
470
  _classCallCheck(this, Validity);
450
- _defineProperty(this, "JHaV", -1);
451
- _defineProperty(this, "CDOi", -1);
452
- _defineProperty(this, "qOFY", -1);
453
- _defineProperty(this, "vZJY", -1);
454
- _defineProperty(this, "RnJn", false);
471
+ _defineProperty(this, "ZXIv", -1);
472
+ _defineProperty(this, "PYEw", -1);
473
+ _defineProperty(this, "gDYY", -1);
474
+ _defineProperty(this, "JWWv", -1);
475
+ _defineProperty(this, "WVbP", false);
455
476
  _defineProperty(this, "parse", function () {
456
477
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
457
478
  try {
@@ -459,17 +480,17 @@
459
480
  Logger$2.error("Not valid dates");
460
481
  return false;
461
482
  }
462
- _this.JHaV = Date.parse(config.validity.start_date);
463
- _this.CDOi = Date.parse(config.validity.end_date);
483
+ _this.ZXIv = Date.parse(config.validity.start_date);
484
+ _this.PYEw = Date.parse(config.validity.end_date);
464
485
  if (isDefined(config.time_limits_in_day)) {
465
- _this.RnJn = config.time_limits_in_day;
466
- if (_this.RnJn && isDefined(config.time_limits)) {
486
+ _this.WVbP = config.time_limits_in_day;
487
+ if (_this.WVbP && isDefined(config.time_limits)) {
467
488
  var currentDate = new Date().toISOString().split("T")[0];
468
- _this.qOFY = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
469
- _this.vZJY = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
489
+ _this.gDYY = Date.parse(currentDate + "T" + config.time_limits.start_time + ".000Z");
490
+ _this.JWWv = Date.parse(currentDate + "T" + config.time_limits.end_time + ".000Z");
470
491
 
471
492
  // If invalid format is passed, return false
472
- if (isNaN(_this.qOFY) || isNaN(_this.vZJY)) {
493
+ if (isNaN(_this.gDYY) || isNaN(_this.JWWv)) {
473
494
  Logger$2.error("Not valid times");
474
495
  return false;
475
496
  }
@@ -483,8 +504,8 @@
483
504
  });
484
505
  _defineProperty(this, "validate", function () {
485
506
  var currentTime = Date.now();
486
- if (currentTime > _this.JHaV && currentTime < _this.CDOi) {
487
- return !_this.RnJn || currentTime >= _this.qOFY && currentTime <= _this.vZJY;
507
+ if (currentTime > _this.ZXIv && currentTime < _this.PYEw) {
508
+ return !_this.WVbP || currentTime >= _this.gDYY && currentTime <= _this.JWWv;
488
509
  }
489
510
  return false;
490
511
  });
@@ -493,13 +514,13 @@
493
514
  var Details = /*#__PURE__*/_createClass(function Details() {
494
515
  var _this = this;
495
516
  _classCallCheck(this, Details);
496
- _defineProperty(this, "CtPY", "");
497
- _defineProperty(this, "NVOO", {});
517
+ _defineProperty(this, "dXou", "");
518
+ _defineProperty(this, "PjLw", {});
498
519
  _defineProperty(this, "parse", function () {
499
520
  var details = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
500
521
  try {
501
- _this.CtPY = details.name;
502
- _this.NVOO = details.additional_info;
522
+ _this.dXou = details.name;
523
+ _this.PjLw = details.additional_info;
503
524
  } catch (error) {
504
525
  return false;
505
526
  }
@@ -510,14 +531,14 @@
510
531
  var Timebounds = /*#__PURE__*/_createClass(function Timebounds() {
511
532
  var _this = this;
512
533
  _classCallCheck(this, Timebounds);
513
- _defineProperty(this, "RZpl", 0);
514
- _defineProperty(this, "FsQW", 0);
534
+ _defineProperty(this, "ubix", 0);
535
+ _defineProperty(this, "xTww", 0);
515
536
  _defineProperty(this, "parse", function () {
516
537
  var timeBounds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
517
538
  try {
518
- _this.RZpl = Number(timeBounds.lower);
519
- _this.FsQW = Number(timeBounds.upper);
520
- if (isNaN(_this.RZpl) || isNaN(_this.FsQW)) {
539
+ _this.ubix = Number(timeBounds.lower);
540
+ _this.xTww = Number(timeBounds.upper);
541
+ if (isNaN(_this.ubix) || isNaN(_this.xTww)) {
521
542
  return false;
522
543
  }
523
544
  } catch (error) {
@@ -530,17 +551,17 @@
530
551
  var PreCondition = /*#__PURE__*/_createClass(function PreCondition() {
531
552
  var _this = this;
532
553
  _classCallCheck(this, PreCondition);
533
- _defineProperty(this, "gplO", 0);
534
- _defineProperty(this, "AlVX", "");
535
- _defineProperty(this, "fBwj", "");
536
- _defineProperty(this, "QYMC", new Details());
537
- _defineProperty(this, "pWFR", new Timebounds());
554
+ _defineProperty(this, "wLrd", 0);
555
+ _defineProperty(this, "GwDz", "");
556
+ _defineProperty(this, "HJIQ", "");
557
+ _defineProperty(this, "LHnZ", new Details());
558
+ _defineProperty(this, "pZbN", new Timebounds());
538
559
  _defineProperty(this, "parse", function () {
539
560
  var precondition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
540
561
  try {
541
- _this.AlVX = precondition.event_type;
542
- _this.fBwj = precondition.activity;
543
- return _this.QYMC.parse(precondition.details) && _this.pWFR.parse(precondition.time_bounds);
562
+ _this.GwDz = precondition.event_type;
563
+ _this.HJIQ = precondition.activity;
564
+ return _this.LHnZ.parse(precondition.details) && _this.pZbN.parse(precondition.time_bounds);
544
565
  } catch (error) {
545
566
  return false;
546
567
  }
@@ -551,29 +572,29 @@
551
572
  var Condition = /*#__PURE__*/_createClass(function Condition() {
552
573
  var _this = this;
553
574
  _classCallCheck(this, Condition);
554
- _defineProperty(this, "gplO", 0);
555
- _defineProperty(this, "fnMy", -1);
556
- _defineProperty(this, "FDLa", 0);
557
- _defineProperty(this, "LXVx", "");
558
- _defineProperty(this, "fBwj", "");
559
- _defineProperty(this, "AlVX", "");
560
- _defineProperty(this, "pWFR", new Timebounds());
561
- _defineProperty(this, "QYMC", new Details());
562
- _defineProperty(this, "jsSe", new PreCondition());
563
- _defineProperty(this, "kURO", "AND");
564
- _defineProperty(this, "eatT", false);
565
- _defineProperty(this, "FFVT", void 0);
575
+ _defineProperty(this, "wLrd", 0);
576
+ _defineProperty(this, "BvTW", -1);
577
+ _defineProperty(this, "cyan", 0);
578
+ _defineProperty(this, "FdOF", "");
579
+ _defineProperty(this, "HJIQ", "");
580
+ _defineProperty(this, "GwDz", "");
581
+ _defineProperty(this, "pZbN", new Timebounds());
582
+ _defineProperty(this, "LHnZ", new Details());
583
+ _defineProperty(this, "idDI", new PreCondition());
584
+ _defineProperty(this, "Sdoc", "AND");
585
+ _defineProperty(this, "LnGT", false);
586
+ _defineProperty(this, "upBe", void 0);
566
587
  _defineProperty(this, "parse", function () {
567
588
  var condition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
568
589
  try {
569
- _this.fnMy = condition.sequence;
570
- _this.FDLa = condition.count_config.count;
571
- _this.LXVx = condition.count_config.operator;
572
- _this.fBwj = condition.activity;
573
- _this.AlVX = condition.event_type;
574
- _this.kURO = condition.combine_operator;
575
- _this.FFVT = condition.type;
576
- return _this.QYMC.parse(condition.details) && _this.jsSe.parse(condition.trigger) && _this.pWFR.parse(condition.time_bounds);
590
+ _this.BvTW = condition.sequence;
591
+ _this.cyan = condition.count_config.count;
592
+ _this.FdOF = condition.count_config.operator;
593
+ _this.HJIQ = condition.activity;
594
+ _this.GwDz = condition.event_type;
595
+ _this.Sdoc = condition.combine_operator;
596
+ _this.upBe = condition.type;
597
+ return _this.LHnZ.parse(condition.details) && _this.idDI.parse(condition.trigger) && _this.pZbN.parse(condition.time_bounds);
577
598
  } catch (error) {
578
599
  Logger$3.error(error);
579
600
  return false;
@@ -581,25 +602,51 @@
581
602
  });
582
603
  });
583
604
 
584
- /* eslint-disable no-unused-vars */
585
605
  var Logger$4 = window.ApxorLogger;
606
+ var GoalEvent = /*#__PURE__*/_createClass(function GoalEvent() {
607
+ var _this = this;
608
+ _classCallCheck(this, GoalEvent);
609
+ _defineProperty(this, "cyan", 0);
610
+ _defineProperty(this, "FdOF", "");
611
+ _defineProperty(this, "GwDz", "");
612
+ _defineProperty(this, "pZbN", new Timebounds());
613
+ _defineProperty(this, "LHnZ", new Details());
614
+ _defineProperty(this, "Sdoc", "AND");
615
+ _defineProperty(this, "parse", function (data) {
616
+ try {
617
+ _this.cyan = data.count_config.count;
618
+ _this.FdOF = data.count_config.operator;
619
+ _this.GwDz = data.event_type;
620
+ _this.Sdoc = data.combine_operator;
621
+ return _this.LHnZ.parse(data.details) && _this.pZbN.parse(data.time_bounds);
622
+ } catch (error) {
623
+ Logger$4.error(error);
624
+ return false;
625
+ }
626
+ });
627
+ });
628
+
629
+ /* eslint-disable no-unused-vars */
630
+ var Logger$5 = window.ApxorLogger;
586
631
  var ConditionValidator = /*#__PURE__*/function () {
587
632
  function ConditionValidator() {
588
633
  var _this = this;
589
634
  _classCallCheck(this, ConditionValidator);
590
- _defineProperty(this, "vWIX", 0);
591
- _defineProperty(this, "Fdjl", "");
592
- _defineProperty(this, "dqkJ", new Condition());
593
- _defineProperty(this, "AhjD", false);
594
- _defineProperty(this, "xVdJ", false);
595
- _defineProperty(this, "BjBE", 0);
596
- _defineProperty(this, "kURO", "AND");
597
- _defineProperty(this, "sqsm", -1);
598
- _defineProperty(this, "wlEj", []);
599
- _defineProperty(this, "qewW", {});
600
- _defineProperty(this, "doep", false);
635
+ _defineProperty(this, "AFha", 0);
636
+ _defineProperty(this, "xWwF", "");
637
+ _defineProperty(this, "ZXgH", new Condition());
638
+ _defineProperty(this, "AwpM", new GoalEvent());
639
+ _defineProperty(this, "CTgi", false);
640
+ _defineProperty(this, "dzHG", false);
641
+ _defineProperty(this, "ewWl", 0);
642
+ _defineProperty(this, "Sdoc", "AND");
643
+ _defineProperty(this, "gzxI", "OR");
644
+ _defineProperty(this, "Swao", -1);
645
+ _defineProperty(this, "SKdF", []);
646
+ _defineProperty(this, "ATJy", {});
647
+ _defineProperty(this, "qFlV", false);
601
648
  /**
602
- * If respectSequence is true, don't auto-qqsE to events except for the condition whose index is 0
649
+ * If respectSequence is true, don't auto-DGaq to events except for the condition whose index is 0
603
650
  *
604
651
  * @param condition
605
652
  * @param type
@@ -614,155 +661,181 @@
614
661
  var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
615
662
  var respectSequence = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
616
663
  var noKpiArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
617
- _this.Fdjl = id;
618
- _this.BjBE = index;
619
- _this.wlEj = noKpiArray;
620
- var result = _this.dqkJ.parse(condition);
621
- if (result) {
622
- _this.kURO = _this.dqkJ.kURO;
664
+ var flag = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : "";
665
+ _this.xWwF = id;
666
+ _this.ewWl = index;
667
+ _this.SKdF = noKpiArray;
668
+ if (flag !== "termination" || flag === "") {
669
+ var result = _this.ZXgH.parse(condition);
670
+ if (result) {
671
+ _this.Sdoc = _this.ZXgH.Sdoc;
623
672
 
624
- // FIXME: Why this code is written? Don't see any usecase
625
- if (_this.dqkJ.eatT) {
626
- var eventName = _this.dqkJ.QYMC.CtPY;
627
- if (eventName === "APX_PAGE_OPENED") {
628
- eventName = _this.dqkJ.QYMC.NVOO["navigation_id"];
629
- eventName = isDefined(eventName) ? eventName : _this.dqkJ.QYMC.CtPY;
673
+ // FIXME: Why this code is written? Don't see any usecase
674
+ if (_this.ZXgH.LnGT) {
675
+ var eventName = _this.ZXgH.LHnZ.dXou;
676
+ if (eventName === "APX_PAGE_OPENED") {
677
+ eventName = _this.ZXgH.LHnZ.PjLw["navigation_id"];
678
+ eventName = isDefined(eventName) ? eventName : _this.ZXgH.LHnZ.dXou;
679
+ }
680
+ _this.Swao = Apxor.getController().getEventCount(eventName);
681
+ var count = _this.ZXgH.cyan;
682
+ var operator = _this.ZXgH.FdOF;
683
+ _this.dzHG = _this.TfGM(_this.Swao - 1, count, operator, false);
684
+ _this.CTgi = _this.dzHG;
685
+ // If the condition is already satisfied and if it is page view, no need to DGaq
686
+ // This only applies for NAVIGATION_EVENTS
687
+ if (_this.dzHG && _this.ZXgH.LHnZ.dXou === "APX_PAGE_OPENED") {
688
+ return true;
689
+ }
630
690
  }
631
- _this.sqsm = Apxor.getController().getEventCount(eventName);
632
- var count = _this.dqkJ.FDLa;
633
- var operator = _this.dqkJ.LXVx;
634
- _this.xVdJ = _this.LzlO(_this.sqsm - 1, count, operator, false);
635
- _this.AhjD = _this.xVdJ;
636
- // If the condition is already satisfied and if it is page view, no need to qqsE
637
- // This only applies for NAVIGATION_EVENTS
638
- if (_this.xVdJ && _this.dqkJ.QYMC.CtPY === "APX_PAGE_OPENED") {
639
- return true;
691
+ if (!respectSequence || index === 0) {
692
+ _this.DGaq();
640
693
  }
694
+ return true;
641
695
  }
642
- if (!respectSequence || index === 0) {
643
- _this.qqsE();
644
- }
696
+ } else {
697
+ var _result = _this.AwpM.parse(condition);
698
+ _this.gzxI = _this.AwpM.Sdoc;
699
+ _this.cvYj();
645
700
  return true;
646
701
  }
647
702
  return false;
648
703
  });
649
- _defineProperty(this, "qqsE", function () {
650
- var condition = _this.dqkJ;
651
- var precondition = condition.jsSe;
704
+ _defineProperty(this, "DGaq", function () {
705
+ var condition = _this.ZXgH;
706
+ var precondition = condition.idDI;
652
707
  var ceInstance = CE.getInstance();
653
- if (precondition.AlVX === "app_start") {
654
- _this.AhjD = true;
655
- ceInstance.registerForEvent(generateKey(condition.AlVX) + "___" + condition.QYMC.CtPY, _this.LydU);
708
+ if (precondition.GwDz === "app_start") {
709
+ _this.CTgi = true;
710
+ ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + condition.LHnZ.dXou, _this.ZNEJ);
656
711
  } else {
657
- ceInstance.registerForEvent(generateKey(condition.AlVX) + "___" + precondition.QYMC.CtPY, _this.LydU);
712
+ ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + precondition.LHnZ.dXou, _this.ZNEJ);
658
713
  }
659
714
  });
660
- _defineProperty(this, "uMbk", function (type, name, time, additionalInfo) {
661
- var _this$dqkJ;
715
+ _defineProperty(this, "cvYj", function () {
716
+ var condition = _this.AwpM;
717
+ var ceInstance = CE.getInstance();
718
+ _this.CTgi = true;
719
+ ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + condition.LHnZ.dXou, _this.YBSM);
720
+ });
721
+ _defineProperty(this, "Ijls", function (type, name, time, additionalInfo) {
722
+ var _this$ZXgH;
662
723
  var eventTime = Date.now();
663
- var time_differnce = (eventTime - _this.qewW[name]) / 1000;
664
- var time_fromConfig = ((_this$dqkJ = _this.dqkJ) === null || _this$dqkJ === void 0 || (_this$dqkJ = _this$dqkJ.QYMC) === null || _this$dqkJ === void 0 || (_this$dqkJ = _this$dqkJ.NVOO) === null || _this$dqkJ === void 0 ? void 0 : _this$dqkJ.time) / 1000;
724
+ var time_differnce = (eventTime - _this.ATJy[name]) / 1000;
725
+ var time_fromConfig = ((_this$ZXgH = _this.ZXgH) === null || _this$ZXgH === void 0 || (_this$ZXgH = _this$ZXgH.LHnZ) === null || _this$ZXgH === void 0 || (_this$ZXgH = _this$ZXgH.PjLw) === null || _this$ZXgH === void 0 ? void 0 : _this$ZXgH.time) / 1000;
665
726
  if (time_fromConfig > time_differnce) {
666
727
  _this._displayCampaign(time);
667
728
  }
668
729
  });
669
- _defineProperty(this, "kIfZ", function (type, name, time, additionalInfo) {
730
+ _defineProperty(this, "MKnM", function (type, name, time, additionalInfo) {
670
731
  var _this$_condition2, _this$_condition3;
671
- _this.doep = true;
732
+ _this.qFlV = true;
672
733
  var currentTime = Date.now();
673
- var eventName = (_this$_condition2 = _this.dqkJ) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.jsSe) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.QYMC.CtPY;
674
- var eventTime = _this.qewW[eventName];
734
+ var eventName = (_this$_condition2 = _this.ZXgH) === null || _this$_condition2 === void 0 || (_this$_condition2 = _this$_condition2.idDI) === null || _this$_condition2 === void 0 ? void 0 : _this$_condition2.LHnZ.dXou;
735
+ var eventTime = _this.ATJy[eventName];
675
736
  var time_differnce = (currentTime - eventTime) / 1000;
676
- var time_fromConfig = (_this$_condition3 = _this.dqkJ) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.QYMC) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.NVOO) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
737
+ var time_fromConfig = (_this$_condition3 = _this.ZXgH) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.LHnZ) === null || _this$_condition3 === void 0 || (_this$_condition3 = _this$_condition3.PjLw) === null || _this$_condition3 === void 0 ? void 0 : _this$_condition3.time;
677
738
  time_fromConfig = time_fromConfig / 1000;
678
739
  if (time_fromConfig > time_differnce) {
679
740
  _this._displayCampaign(time);
680
741
  }
681
742
  //unregister the event
682
743
  });
683
- _defineProperty(this, "LydU", function (type, name, time, additionalInfo) {
744
+ _defineProperty(this, "ZNEJ", function (type, name, time, additionalInfo) {
684
745
  var ceInstance = CE.getInstance();
685
- if (!_this.AhjD) {
746
+ if (!_this.CTgi) {
686
747
  // Validate Precondition
687
- _this.AhjD = _this.zOaF(type, name, time, additionalInfo);
688
- if (_this.AhjD) {
689
- var condition = _this.dqkJ;
690
- var precondition = condition.jsSe;
691
- precondition.gplO = time;
748
+ _this.CTgi = _this.cAeN(type, name, time, additionalInfo);
749
+ if (_this.CTgi) {
750
+ var condition = _this.ZXgH;
751
+ var precondition = condition.idDI;
752
+ precondition.wLrd = time;
692
753
  //events will be registred by its type activity event_type: "activity_time"
693
- if ((condition === null || condition === void 0 ? void 0 : condition.AlVX) === "activity_time") {
694
- var dqkJ$QYMC, dqkJ$_details2, dqkJ$_details3;
695
- var event_time = condition === null || condition === void 0 || (dqkJ$QYMC = condition.QYMC) === null || dqkJ$QYMC === void 0 || (dqkJ$QYMC = dqkJ$QYMC.NVOO) === null || dqkJ$QYMC === void 0 ? void 0 : dqkJ$QYMC.time;
696
- if ((condition === null || condition === void 0 || (dqkJ$_details2 = condition.QYMC) === null || dqkJ$_details2 === void 0 || (dqkJ$_details2 = dqkJ$_details2.NVOO) === null || dqkJ$_details2 === void 0 ? void 0 : dqkJ$_details2.nkpi.length) > 0) {
754
+ if ((condition === null || condition === void 0 ? void 0 : condition.GwDz) === "activity_time") {
755
+ var ZXgH$LHnZ, ZXgH$_details2, ZXgH$_details3;
756
+ var event_time = condition === null || condition === void 0 || (ZXgH$LHnZ = condition.LHnZ) === null || ZXgH$LHnZ === void 0 || (ZXgH$LHnZ = ZXgH$LHnZ.PjLw) === null || ZXgH$LHnZ === void 0 ? void 0 : ZXgH$LHnZ.time;
757
+ if ((condition === null || condition === void 0 || (ZXgH$_details2 = condition.LHnZ) === null || ZXgH$_details2 === void 0 || (ZXgH$_details2 = ZXgH$_details2.PjLw) === null || ZXgH$_details2 === void 0 ? void 0 : ZXgH$_details2.nkpi.length) > 0) {
697
758
  setTimeout(function () {
698
- if (!_this.doep) {
699
- _this.xVdJ = true;
700
- if (_this.xVdJ) {
701
- _this.vWIX += 1;
702
- _this.xVdJ = _this.LzlO(_this.vWIX, _this.dqkJ.FDLa, _this.dqkJ.LXVx);
703
- if (_this.xVdJ) {
704
- _this.dqkJ.gplO = time;
705
- ceInstance.validate(_this.Fdjl, _this.BjBE);
759
+ if (!_this.qFlV) {
760
+ _this.dzHG = true;
761
+ if (_this.dzHG) {
762
+ _this.AFha += 1;
763
+ _this.dzHG = _this.TfGM(_this.AFha, _this.ZXgH.cyan, _this.ZXgH.FdOF);
764
+ if (_this.dzHG) {
765
+ _this.ZXgH.wLrd = time;
766
+ ceInstance.validate(_this.xWwF, _this.ewWl);
706
767
  }
707
768
  }
708
769
  }
709
- condition.QYMC.NVOO.nkpi.map(function (nokpi) {
710
- ceInstance.unregisterFromEvent(toUpperCase(condition.QYMC.NVOO.et) + "___" + nokpi, _this);
770
+ condition.LHnZ.PjLw.nkpi.map(function (nokpi) {
771
+ ceInstance.unregisterFromEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + nokpi, _this);
711
772
  });
712
773
  }, event_time);
713
- condition.QYMC.NVOO.nkpi.map(function (nokpi) {
714
- ceInstance.registerForEvent(toUpperCase(condition.QYMC.NVOO.et) + "___" + nokpi, _this.kIfZ);
774
+ condition.LHnZ.PjLw.nkpi.map(function (nokpi) {
775
+ ceInstance.registerForEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + nokpi, _this.MKnM);
715
776
  });
716
777
  }
717
778
  //it is for unregistering the events did case after completing the time imit
718
- if ((condition === null || condition === void 0 || (dqkJ$_details3 = condition.QYMC) === null || dqkJ$_details3 === void 0 || (dqkJ$_details3 = dqkJ$_details3.NVOO) === null || dqkJ$_details3 === void 0 ? void 0 : dqkJ$_details3.kpi.length) > 0) {
779
+ if ((condition === null || condition === void 0 || (ZXgH$_details3 = condition.LHnZ) === null || ZXgH$_details3 === void 0 || (ZXgH$_details3 = ZXgH$_details3.PjLw) === null || ZXgH$_details3 === void 0 ? void 0 : ZXgH$_details3.kpi.length) > 0) {
719
780
  setTimeout(function () {
720
- condition.QYMC.NVOO.kpi.map(function (kpi) {
721
- ceInstance.unregisterFromEvent(toUpperCase(condition.QYMC.NVOO.et) + "___" + kpi, _this);
781
+ condition.LHnZ.PjLw.kpi.map(function (kpi) {
782
+ ceInstance.unregisterFromEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + kpi, _this);
722
783
  });
723
784
  }, event_time);
724
- condition.QYMC.NVOO.kpi.map(function (kpi) {
725
- if (kpi === condition.jsSe.QYMC.CtPY) {
785
+ condition.LHnZ.PjLw.kpi.map(function (kpi) {
786
+ if (kpi === condition.idDI.LHnZ.dXou) {
726
787
  //unregister the previous event
727
- ceInstance.unregisterFromEvent(generateKey(precondition.AlVX) + "___" + precondition.QYMC.CtPY, _this);
728
- ceInstance.registerForEvent(toUpperCase(condition.QYMC.NVOO.et) + "___" + kpi, _this.uMbk);
788
+ ceInstance.unregisterFromEvent(generateKey(precondition.GwDz) + "___" + precondition.LHnZ.dXou, _this);
789
+ ceInstance.registerForEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + kpi, _this.Ijls);
729
790
  } else {
730
- ceInstance.registerForEvent(toUpperCase(condition.QYMC.NVOO.et) + "___" + kpi, _this.kIfZ);
791
+ ceInstance.registerForEvent(toUpperCase(condition.LHnZ.PjLw.et) + "___" + kpi, _this.MKnM);
731
792
  }
732
793
  });
733
794
  }
734
795
  } else {
735
- ceInstance.unregisterFromEvent(generateKey(precondition.AlVX) + "___" + precondition.QYMC.CtPY, _this);
736
- ceInstance.registerForEvent(generateKey(condition.AlVX) + "___" + condition.QYMC.CtPY, _this);
796
+ ceInstance.unregisterFromEvent(generateKey(precondition.GwDz) + "___" + precondition.LHnZ.dXou, _this);
797
+ ceInstance.registerForEvent(generateKey(condition.GwDz) + "___" + condition.LHnZ.dXou, _this);
737
798
  }
738
- _this.qewW[name] = Date.now();
799
+ _this.ATJy[name] = Date.now();
739
800
  }
740
801
  return;
741
802
  }
742
803
 
743
804
  // Validate Condition
744
- var validationStatus = generateKey(_this.dqkJ.AlVX) === type && _this.Chvr(time - _this.dqkJ.jsSe.gplO, _this.dqkJ.pWFR) && _this.dqkJ.QYMC.CtPY === name && _this.BXyf(_this.dqkJ.QYMC.NVOO, additionalInfo);
805
+ var validationStatus = generateKey(_this.ZXgH.GwDz) === type && _this.gVIC(time - _this.ZXgH.idDI.wLrd, _this.ZXgH.pZbN) && _this.ZXgH.LHnZ.dXou === name && _this.XxaE(_this.ZXgH.LHnZ.PjLw, additionalInfo);
745
806
  if (validationStatus) {
746
- _this.vWIX += 1;
747
- _this.xVdJ = _this.LzlO(_this.vWIX, _this.dqkJ.FDLa, _this.dqkJ.LXVx);
748
- if (_this.xVdJ) {
749
- _this.dqkJ.gplO = time;
750
- ceInstance.validate(_this.Fdjl, _this.BjBE);
807
+ _this.AFha += 1;
808
+ _this.dzHG = _this.TfGM(_this.AFha, _this.ZXgH.cyan, _this.ZXgH.FdOF);
809
+ if (_this.dzHG) {
810
+ _this.ZXgH.wLrd = time;
811
+ ceInstance.validate(_this.xWwF, _this.ewWl);
751
812
  }
752
813
  }
753
814
  });
754
- _defineProperty(this, "zOaF", function (type, name, time, additionalInfo) {
755
- var precondition = _this.dqkJ.jsSe;
756
- return generateKey(precondition.AlVX) === type && precondition.QYMC.CtPY === name && _this.Chvr(time, precondition.pWFR) && _this.BXyf(precondition.QYMC.NVOO, additionalInfo);
815
+ _defineProperty(this, "YBSM", function (type, name, time, additionalInfo) {
816
+ var ceInstance = CE.getInstance();
817
+ var validationStatus = generateKey(_this.AwpM.GwDz) === type && _this.gVIC(time, _this.AwpM.pZbN) && _this.AwpM.LHnZ.dXou === name && _this.XxaE(_this.AwpM.LHnZ.PjLw, additionalInfo);
818
+ if (validationStatus) {
819
+ _this.AFha += 1;
820
+ _this.dzHG = _this.TfGM(_this.AFha, _this.AwpM.cyan, _this.AwpM.FdOF);
821
+ if (_this.dzHG) {
822
+ _this.AwpM.wLrd = time;
823
+ ceInstance.validateForTermination(_this.xWwF, _this.ewWl);
824
+ }
825
+ }
826
+ });
827
+ _defineProperty(this, "cAeN", function (type, name, time, additionalInfo) {
828
+ var precondition = _this.ZXgH.idDI;
829
+ return generateKey(precondition.GwDz) === type && precondition.LHnZ.dXou === name && _this.gVIC(time, precondition.pZbN) && _this.XxaE(precondition.LHnZ.PjLw, additionalInfo);
757
830
  });
758
- _defineProperty(this, "Chvr", function (time, timeBounds) {
831
+ _defineProperty(this, "gVIC", function (time, timeBounds) {
759
832
  var currentTime = Math.ceil(time);
760
- return currentTime > timeBounds.RZpl && currentTime < timeBounds.FsQW;
833
+ return currentTime > timeBounds.ubix && currentTime < timeBounds.xTww;
761
834
  });
762
- _defineProperty(this, "LzlO", function (current, required, operator) {
835
+ _defineProperty(this, "TfGM", function (current, required, operator) {
763
836
  var checkOld = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
764
- if (checkOld && _this.dqkJ.eatT) {
765
- current = current + _this.sqsm;
837
+ if (checkOld && _this.ZXgH.LnGT) {
838
+ current = current + _this.Swao;
766
839
  }
767
840
  switch (operator) {
768
841
  case "EQ":
@@ -779,7 +852,7 @@
779
852
  return false;
780
853
  }
781
854
  });
782
- _defineProperty(this, "BXyf", function (expected, received) {
855
+ _defineProperty(this, "XxaE", function (expected, received) {
783
856
  var status = true;
784
857
  try {
785
858
  var _loop = function _loop() {
@@ -804,11 +877,11 @@
804
877
  loggedValues = [received[item]];
805
878
  }
806
879
  var match = loggedValues.some(function (loggedValue) {
807
- return compare(loggedValue, expectedValue, operator);
880
+ return zuMV(loggedValue, expectedValue, operator);
808
881
  });
809
882
  status = status && match;
810
883
  } else {
811
- status = status && compare(received[item], expected[item], "EQ");
884
+ status = status && zuMV(received[item], expected[item], "EQ");
812
885
  }
813
886
  },
814
887
  _ret;
@@ -817,7 +890,7 @@
817
890
  if (_ret) return _ret.v;
818
891
  }
819
892
  } catch (error) {
820
- Logger$4.error(error);
893
+ Logger$5.error(error);
821
894
  status = false;
822
895
  }
823
896
  return status;
@@ -827,13 +900,13 @@
827
900
  key: "_displayCampaign",
828
901
  value: function _displayCampaign(time) {
829
902
  var ceInstance = CE.getInstance();
830
- this.xVdJ = true;
831
- if (this.xVdJ) {
832
- this.vWIX += 1;
833
- this.xVdJ = this.LzlO(this.vWIX, this.dqkJ.FDLa, this.dqkJ.LXVx);
834
- if (this.xVdJ) {
835
- this.dqkJ.gplO = time;
836
- ceInstance.validate(this.Fdjl, this.BjBE);
903
+ this.dzHG = true;
904
+ if (this.dzHG) {
905
+ this.AFha += 1;
906
+ this.dzHG = this.TfGM(this.AFha, this.ZXgH.cyan, this.ZXgH.FdOF);
907
+ if (this.dzHG) {
908
+ this.ZXgH.wLrd = time;
909
+ ceInstance.validate(this.xWwF, this.ewWl);
837
910
  }
838
911
  }
839
912
  }
@@ -846,26 +919,26 @@
846
919
  var APX_RETAINED_DAYS = "apx_retained_days";
847
920
  var APX_CONTEXT_EVALUATED = "apx_context_evaluated";
848
921
 
849
- var Logger$5 = window.ApxorLogger;
922
+ var Logger$6 = window.ApxorLogger;
850
923
  var OverallConfig = /*#__PURE__*/_createClass(function OverallConfig() {
851
924
  var _this = this;
852
925
  _classCallCheck(this, OverallConfig);
853
- _defineProperty(this, "PMCb", []);
926
+ _defineProperty(this, "PuiS", []);
854
927
  _defineProperty(this, "_ret_day", {});
855
- _defineProperty(this, "ejSN", {});
856
- _defineProperty(this, "eQvN", false);
857
- _defineProperty(this, "eEge", false);
928
+ _defineProperty(this, "KMnE", {});
929
+ _defineProperty(this, "TIdq", false);
930
+ _defineProperty(this, "BItf", false);
858
931
  _defineProperty(this, "parse", function () {
859
932
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
860
933
  try {
861
- _this.PMCb = config.overall_cfg.events;
934
+ _this.PuiS = config.overall_cfg.events;
862
935
  _this._ret_day = config.overall_cfg.ret_day;
863
- _this.ejSN = config.overall_cfg.session;
864
- _this.eQvN = config.overall_cfg.toggleRetDay;
865
- _this.PMCb = config.overall_cfg.events;
866
- _this.eEge = config.overall_cfg.toggleSession;
936
+ _this.KMnE = config.overall_cfg.session;
937
+ _this.TIdq = config.overall_cfg.toggleRetDay;
938
+ _this.PuiS = config.overall_cfg.events;
939
+ _this.BItf = config.overall_cfg.toggleSession;
867
940
  } catch (error) {
868
- Logger$5.error(error);
941
+ Logger$6.error(error);
869
942
  return false;
870
943
  }
871
944
  return true;
@@ -873,10 +946,10 @@
873
946
  _defineProperty(this, "validate", function () {
874
947
  var retainedDays = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_DAYS));
875
948
  var retainedSession = parseInt(Apxor.getController().getFromStorage(APX_RETAINED_SESSIONS));
876
- if (_this.eQvN && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
949
+ if (_this.TIdq && !isNaN(retainedDays) && !(retainedDays >= _this._ret_day.from && retainedDays <= _this._ret_day.to)) {
877
950
  return false;
878
951
  }
879
- if (_this.eEge && !isNaN(retainedSession) && !(retainedSession >= _this.ejSN.from && retainedSession <= _this.ejSN.to)) {
952
+ if (_this.BItf && !isNaN(retainedSession) && !(retainedSession >= _this.KMnE.from && retainedSession <= _this.KMnE.to)) {
880
953
  return false;
881
954
  }
882
955
  try {
@@ -884,60 +957,203 @@
884
957
  var data = Apxor.getController().getFromStorage("_apx_lt_count");
885
958
  var siteid = Apxor.getSiteId();
886
959
  var LtCountObjDecoded = JSON.parse(new TextDecoder().decode(stringToArrayBuffer(decode(siteid, data))));
887
- for (var i = 0; i < _this.PMCb.length; i++) {
888
- var evName = _this.PMCb[i].name.replace("'", "").replace("’", "");
960
+ for (var i = 0; i < _this.PuiS.length; i++) {
961
+ var evName = _this.PuiS[i].name.replace("'", "").replace("’", "");
889
962
  if (LtCountObjDecoded[evName]) {
890
963
  return false;
891
964
  }
892
965
  }
893
966
  } catch (e) {
894
- Logger$5.error("Failed to validate the lt count:" + e);
967
+ Logger$6.error("Failed to validate the lt count:" + e);
895
968
  }
896
969
  return true;
897
970
  });
898
971
  });
899
972
 
900
- var Logger$6 = window.ApxorLogger;
973
+ var Logger$7 = window.ApxorLogger;
974
+ var Attributes = /*#__PURE__*/_createClass(function Attributes() {
975
+ var _this = this;
976
+ _classCallCheck(this, Attributes);
977
+ _defineProperty(this, "qHve", []);
978
+ _defineProperty(this, "hfXD", []);
979
+ _defineProperty(this, "parse", function () {
980
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
981
+ try {
982
+ _this.qHve = config.attributes.user;
983
+ _this.hfXD = config.attributes.session;
984
+ if (!Array.isArray(_this.qHve) || !Array.isArray(_this.hfXD)) {
985
+ Logger$7.error("No attributes");
986
+ return false;
987
+ }
988
+ } catch (error) {
989
+ Logger$7.error(error);
990
+ return false;
991
+ }
992
+ return true;
993
+ });
994
+ _defineProperty(this, "validate", function (user, session) {
995
+ return _this.AYgA(user, _this.qHve) && _this.AYgA(session, _this.hfXD);
996
+ });
997
+ _defineProperty(this, "AYgA", function (attributes, expected) {
998
+ var length = expected.length;
999
+ var status = true;
1000
+ try {
1001
+ var _loop = function _loop() {
1002
+ var item = expected[index];
1003
+ if (!attributes[item.name] || status === false) {
1004
+ return {
1005
+ v: false
1006
+ };
1007
+ }
1008
+ var operator = item.operator;
1009
+ var type = item.type;
1010
+ var values = item.value.map(function (value) {
1011
+ if (type === "s") {
1012
+ return value;
1013
+ } else if (type === "l") {
1014
+ return parseInt(value);
1015
+ } else if (type === "f") {
1016
+ return parseFloat(value);
1017
+ }
1018
+ });
1019
+ var loggedValues = [];
1020
+ if (Array.isArray(attributes[item.name])) {
1021
+ loggedValues = attributes[item.name];
1022
+ } else {
1023
+ loggedValues = [attributes[item.name]];
1024
+ }
1025
+ var match = loggedValues.some(function (loggedValue) {
1026
+ return values.some(function (configValue) {
1027
+ return zuMV(loggedValue, configValue, operator);
1028
+ });
1029
+ });
1030
+ status = status && match;
1031
+ },
1032
+ _ret;
1033
+ for (var index = 0; index < length; index++) {
1034
+ _ret = _loop();
1035
+ if (_ret) return _ret.v;
1036
+ }
1037
+ } catch (error) {
1038
+ Logger$7.error(error);
1039
+ status = false;
1040
+ }
1041
+ return status;
1042
+ });
1043
+ });
1044
+
1045
+ //TERMINATION KEYS
1046
+ var APX_TERMINATION_ID = "apx_termination_ID";
1047
+
1048
+ var TimeBasedTermination = /*#__PURE__*/_createClass(function TimeBasedTermination() {
1049
+ var _this = this;
1050
+ _classCallCheck(this, TimeBasedTermination);
1051
+ _defineProperty(this, "mmqX", Apxor.getController());
1052
+ _defineProperty(this, "type", "");
1053
+ _defineProperty(this, "_duration_seconds", 0);
1054
+ _defineProperty(this, "ebrV", 1);
1055
+ _defineProperty(this, "parse", function (config) {
1056
+ try {
1057
+ var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
1058
+ _this.upBe = (_config$terminate_inf = config.terminate_info.time_based) === null || _config$terminate_inf === void 0 ? void 0 : _config$terminate_inf.type;
1059
+ _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.ebrV = (_config$terminate_inf3 = config.terminate_info.time_based) === null || _config$terminate_inf3 === void 0 ? void 0 : _config$terminate_inf3.days;
1061
+ if (_this.zuMV(config._id)) {
1062
+ _this.mmqX.persistTerminationInfoLocally(config._id);
1063
+ return false;
1064
+ }
1065
+ } catch (_unused) {
1066
+ return false;
1067
+ }
1068
+ return true;
1069
+ });
1070
+ _defineProperty(this, "zuMV", function (id) {
1071
+ var _Data$id;
1072
+ var Data = JSON.parse(_this.mmqX.getFromStorage(APX_TERMINATION_ID));
1073
+ if (!Data[id] || !((_Data$id = Data[id]) !== null && _Data$id !== void 0 && _Data$id.startDate)) return false;
1074
+ var startDate = new Date(Data[id].startDate);
1075
+ var presentDate = new Date(getDateInMMDDYYYY());
1076
+ var diff = parseInt((presentDate - startDate) / (1000 * 60 * 60 * 24), 10);
1077
+ var currentTime = _getTime();
1078
+ var gDYY = Data[id].gDYY;
1079
+ return diff === _this.ebrV && currentTime.hours >= gDYY.hours || diff > _this.ebrV || Data[id].goalAcheived;
1080
+ });
1081
+ });
1082
+
1083
+ var TerminationInfo = /*#__PURE__*/_createClass(function TerminationInfo() {
1084
+ var _this = this;
1085
+ _classCallCheck(this, TerminationInfo);
1086
+ _defineProperty(this, "enable_goal_events", false);
1087
+ _defineProperty(this, "attributes", {});
1088
+ _defineProperty(this, "KDkd", new Attributes());
1089
+ _defineProperty(this, "uNVj", new TimeBasedTermination());
1090
+ _defineProperty(this, "parse", function () {
1091
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1092
+ try {
1093
+ var _config$terminate_inf, _config$terminate_inf2, _config$terminate_inf3;
1094
+ _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.uNVj.parse(config)) {
1096
+ return false;
1097
+ }
1098
+ _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
+ _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.KDkd.parse(config.terminate_info)) {
1101
+ return false;
1102
+ }
1103
+ } catch (error) {
1104
+ window.ApxorLogger.error(error);
1105
+ return false;
1106
+ }
1107
+ return true;
1108
+ });
1109
+ _defineProperty(this, "validate", function (user, session) {
1110
+ return _this.KDkd.validate(user, session);
1111
+ });
1112
+ });
1113
+
1114
+ var Logger$8 = window.ApxorLogger;
901
1115
  var ConfigItem = /*#__PURE__*/_createClass(function ConfigItem() {
902
1116
  var _this = this;
903
1117
  _classCallCheck(this, ConfigItem);
904
- _defineProperty(this, "BHxj", []);
905
- _defineProperty(this, "Fdjl", "");
906
- _defineProperty(this, "FBLV", new Meta());
907
- _defineProperty(this, "HZsk", new Audience());
908
- _defineProperty(this, "bLov", new Validity());
909
- _defineProperty(this, "RUmb", new Frequency());
910
- _defineProperty(this, "mpfN", new OverallConfig());
911
- _defineProperty(this, "OBnx", false);
912
- _defineProperty(this, "lyLV", []);
1118
+ _defineProperty(this, "hmOw", []);
1119
+ _defineProperty(this, "mlaS", []);
1120
+ _defineProperty(this, "xWwF", "");
1121
+ _defineProperty(this, "axSA", new Meta());
1122
+ _defineProperty(this, "oypC", new Audience());
1123
+ _defineProperty(this, "TTrx", new Validity());
1124
+ _defineProperty(this, "ihSD", new Frequency());
1125
+ _defineProperty(this, "KUHf", new OverallConfig());
1126
+ _defineProperty(this, "qNqv", new TerminationInfo());
1127
+ _defineProperty(this, "AKqc", false);
1128
+ _defineProperty(this, "NIKc", []);
913
1129
  _defineProperty(this, "parse", function () {
914
1130
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
915
1131
  try {
916
1132
  // If ID is not present, throw it out
917
1133
  if (!isDefined(config._id)) {
918
- Logger$6.error("No Id");
1134
+ Logger$8.error("No Id");
919
1135
  return false;
920
1136
  }
921
1137
 
922
1138
  // If config is disabled, throw it out
923
1139
  if (!isDefined(config.enabled) || !config.enabled) {
924
- Logger$6.error("Not enabled");
1140
+ Logger$8.error("Not enabled");
925
1141
  return false;
926
1142
  }
927
1143
 
928
1144
  // If META, VALIDITY, FREQUENCY and AUDIENCE is not parsed properly, throw it out
929
- if (!(_this.FBLV.parse(config) && _this.bLov.parse(config) && _this.RUmb.parse(config) && _this.HZsk.parse(config) && _this.mpfN.parse(config))) {
1145
+ if (!(_this.axSA.parse(config) && _this.TTrx.parse(config) && _this.ihSD.parse(config) && _this.oypC.parse(config) && _this.KUHf.parse(config) && _this.qNqv.parse(config))) {
930
1146
  return false;
931
1147
  }
932
1148
 
933
1149
  // If there are no conditions, throw it out
934
1150
  if (!isDefined(config.conditions) || !Array.isArray(config.conditions)) {
935
- Logger$6.error("No valid conditions", config.conditions);
1151
+ Logger$8.error("No valid conditions", config.conditions);
936
1152
  return false;
937
1153
  }
938
- _this.Fdjl = config._id;
939
- _this.OBnx = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
940
- if (_this.OBnx) {
1154
+ _this.xWwF = config._id;
1155
+ _this.AKqc = isDefined(config.sequence_enabled) ? config.sequence_enabled : false;
1156
+ if (_this.AKqc) {
941
1157
  // iff respectSequence is true, Sort the Conditions by their sequence order
942
1158
  // We need to sort, if server sends them in orderless manner
943
1159
  config.conditions.sort(function (prev, current) {
@@ -949,17 +1165,17 @@
949
1165
  var conditions = config.conditions;
950
1166
  var length = conditions.length;
951
1167
  for (var index = 0; index < length; index++) {
952
- _this.lyLV = [];
1168
+ _this.NIKc = [];
953
1169
  var condition = conditions[index];
954
1170
  if (condition.type === "didn't") {
955
- var dqkJ$details;
1171
+ var ZXgH$details;
956
1172
  var obj = {
957
1173
  trigger_key: condition.trigger.details.name,
958
- no_kpi_array: condition === null || condition === void 0 || (dqkJ$details = condition.details) === null || dqkJ$details === void 0 || (dqkJ$details = dqkJ$details.additional_info) === null || dqkJ$details === void 0 ? void 0 : dqkJ$details.nkpi,
1174
+ no_kpi_array: condition === null || condition === void 0 || (ZXgH$details = condition.details) === null || ZXgH$details === void 0 || (ZXgH$details = ZXgH$details.additional_info) === null || ZXgH$details === void 0 ? void 0 : ZXgH$details.nkpi,
959
1175
  condition_id: condition === null || condition === void 0 ? void 0 : condition._id,
960
1176
  time_bounds: condition.time_bounds.upper
961
1177
  };
962
- _this.lyLV = [].concat(_toConsumableArray(_this.lyLV), [obj]);
1178
+ _this.NIKc = [].concat(_toConsumableArray(_this.NIKc), [obj]);
963
1179
  //this will be the key
964
1180
  //when event occur check this array and then then check the time
965
1181
  //check the time diffrence
@@ -968,57 +1184,73 @@
968
1184
  }
969
1185
 
970
1186
  var conditionValidator = new ConditionValidator();
971
- if (conditionValidator.initialize(condition, _this.Fdjl, index, _this.OBnx, _this.lyLV)) {
972
- _this.BHxj.push(conditionValidator);
1187
+ if (conditionValidator.initialize(condition, _this.xWwF, index, _this.AKqc, _this.NIKc)) {
1188
+ _this.hmOw.push(conditionValidator);
973
1189
  }
974
1190
  }
975
- return _this.BHxj.length > 0;
1191
+ if (_this.qNqv.enable_goal_events) {
1192
+ var goal_events = config.terminate_info.goal_events.events;
1193
+ var goaleventslength = goal_events.length;
1194
+ for (var i = 0; i < goaleventslength; i++) {
1195
+ var _conditionValidator = new ConditionValidator();
1196
+ if (_conditionValidator.initialize(goal_events[i], _this.xWwF, i, true, [], "termination")) {
1197
+ _this.mlaS.push(_conditionValidator);
1198
+ }
1199
+ }
1200
+ }
1201
+ return _this.hmOw.length > 0;
976
1202
  } catch (error) {
977
- Logger$6.error(error);
1203
+ Logger$8.error(error);
978
1204
  return false;
979
1205
  }
980
1206
  });
981
- _defineProperty(this, "BLtn", function (index) {
1207
+ _defineProperty(this, "SslG", function (index) {
982
1208
  if (index < 0) {
983
1209
  return;
984
1210
  }
985
- if (_this.OBnx) {
986
- var conditionValidator = _this.BHxj[index];
987
- if (isDefined(conditionValidator) && conditionValidator.xVdJ) {
1211
+ if (_this.AKqc) {
1212
+ var conditionValidator = _this.hmOw[index];
1213
+ if (isDefined(conditionValidator) && conditionValidator.dzHG) {
988
1214
  // Check if previous validator is satisfied
989
- var prevValidator = _this.BHxj[index - 1];
990
- if (isDefined(prevValidator) && !prevValidator.xVdJ) {
1215
+ var prevValidator = _this.hmOw[index - 1];
1216
+ if (isDefined(prevValidator) && !prevValidator.dzHG) {
991
1217
  // TODO: If current index is satisfied before previous one, do something
992
1218
  // either unregister all conditions or remove this item from ConfigLookup
993
1219
  return;
994
1220
  }
995
- var nextValidator = _this.BHxj[index + 1];
1221
+ var nextValidator = _this.hmOw[index + 1];
996
1222
  if (!isDefined(nextValidator)) {
997
1223
  // It means this is the last condition
998
1224
  // Validate all conditions
999
- _this.CtCE();
1225
+ _this.wUEZ();
1000
1226
  } else {
1001
- nextValidator.qqsE();
1227
+ nextValidator.DGaq();
1002
1228
  }
1003
1229
  }
1004
1230
  } else {
1005
1231
  // Validate all conditions
1006
- _this.CtCE();
1232
+ _this.wUEZ();
1007
1233
  }
1008
1234
  });
1009
- _defineProperty(this, "CtCE", function () {
1235
+ _defineProperty(this, "uDmd", function (index) {
1236
+ if (index < 0) {
1237
+ return;
1238
+ }
1239
+ _this.Fkcf();
1240
+ });
1241
+ _defineProperty(this, "wUEZ", function () {
1010
1242
  // Check If Audience, Validity is satisfied or not
1011
1243
  var userAttributes = Apxor.getController().getUserAttributes();
1012
1244
  var sessionAttributes = Apxor.getController().getSessionAttributes();
1013
- if (!_this.bLov.validate() || !_this.HZsk.validate(userAttributes, sessionAttributes) || !_this.mpfN.validate()) {
1245
+ if (!_this.TTrx.validate() || !_this.oypC.validate(userAttributes, sessionAttributes) || !_this.KUHf.validate()) {
1014
1246
  return;
1015
1247
  }
1016
- var length = _this.BHxj.length;
1248
+ var length = _this.hmOw.length;
1017
1249
  var isSatisfied = length < 1;
1018
1250
  var combineOperator = "";
1019
1251
  for (var index = 0; index < length; index++) {
1020
- var validator = _this.BHxj[index];
1021
- var currentResult = validator.xVdJ;
1252
+ var validator = _this.hmOw[index];
1253
+ var currentResult = validator.dzHG;
1022
1254
  if (combineOperator.trim() === "") {
1023
1255
  isSatisfied = currentResult;
1024
1256
  } else {
@@ -1031,47 +1263,92 @@
1031
1263
  break;
1032
1264
  }
1033
1265
  }
1034
- combineOperator = validator.kURO;
1266
+ combineOperator = validator.Sdoc;
1035
1267
  }
1036
1268
  if (isSatisfied) {
1037
1269
  console.debug("onCondition satisfied");
1038
1270
  // Check if count reached it's maximum
1039
- if (!_this.RUmb.Frbd(_this.Fdjl)) {
1040
- console.warn("Maximum limit reached", _this.Fdjl);
1271
+ if (!_this.ihSD.HBeu(_this.xWwF)) {
1272
+ console.warn("Maximum limit reached", _this.xWwF);
1041
1273
  return;
1042
1274
  }
1043
- console.log("Dispatching event", _this.FBLV.FFVT);
1044
- if (_this.FBLV._only_context === true) {
1045
- Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.FBLV._attr), {}, {
1046
- message_name: _this.FBLV.CtPY,
1047
- id: _this.Fdjl
1275
+ console.log("Dispatching event", _this.axSA.upBe);
1276
+ if (_this.axSA._only_context === true) {
1277
+ Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.axSA._attr), {}, {
1278
+ message_name: _this.axSA.dXou,
1279
+ id: _this.xWwF
1048
1280
  }));
1049
1281
  }
1050
1282
  // Emit event
1051
- Apxor.getController().dispatchEvent(_this.FBLV.FFVT, {
1052
- name: _this.FBLV.FFVT,
1283
+ Apxor.getController().dispatchEvent(_this.axSA.upBe, {
1284
+ name: _this.axSA.upBe,
1053
1285
  additional_info: {
1054
- uuid: _this.Fdjl,
1055
- name: _this.FBLV.CtPY
1286
+ uuid: _this.xWwF,
1287
+ name: _this.axSA.dXou
1056
1288
  }
1057
1289
  });
1058
1290
  }
1059
1291
  });
1060
- _defineProperty(this, "PUEA", function () {
1061
- _this.RUmb.PUEA();
1292
+ _defineProperty(this, "Fkcf", function () {
1293
+ var length = _this.mlaS.length;
1294
+ var isSatisfied = length < 1;
1295
+ var combineOperator = "";
1296
+ for (var index = 0; index < length; index++) {
1297
+ var validator = _this.mlaS[index];
1298
+ var currentResult = validator.dzHG;
1299
+ if (combineOperator.trim() === "") {
1300
+ isSatisfied = currentResult;
1301
+ } else {
1302
+ switch (combineOperator) {
1303
+ case "AND":
1304
+ isSatisfied = isSatisfied && currentResult;
1305
+ break;
1306
+ case "OR":
1307
+ isSatisfied = isSatisfied || currentResult;
1308
+ break;
1309
+ }
1310
+ }
1311
+ combineOperator = validator.gzxI;
1312
+ }
1313
+ if (isSatisfied) {
1314
+ console.log("Dispatching event", _this.axSA.upBe);
1315
+ Apxor.getController().persistTerminationInfoLocally(_this.xWwF);
1316
+ if (_this.axSA._only_context === true) {
1317
+ Apxor.logEvent(APX_CONTEXT_EVALUATED, _objectSpread2(_objectSpread2({}, _this.axSA._attr), {}, {
1318
+ message_name: _this.axSA.dXou,
1319
+ id: _this.xWwF
1320
+ }));
1321
+ }
1322
+ // Emit event
1323
+ Apxor.getController().dispatchEvent(_this.axSA.upBe, {
1324
+ name: _this.axSA.upBe,
1325
+ additional_info: {
1326
+ uuid: _this.xWwF,
1327
+ name: _this.axSA.dXou
1328
+ }
1329
+ });
1330
+ }
1331
+ });
1332
+ _defineProperty(this, "validateForTerminationAttributes", function () {
1333
+ var userAttributes = Apxor.getController().getUserAttributes();
1334
+ var sessionAttributes = Apxor.getController().getSessionAttributes();
1335
+ return _this.qNqv.validate(userAttributes, sessionAttributes);
1336
+ });
1337
+ _defineProperty(this, "yGJs", function () {
1338
+ _this.ihSD.yGJs();
1062
1339
  });
1063
1340
  _defineProperty(this, "getFrequencyCount", function () {
1064
- return _this.RUmb.getFrequencyCount();
1341
+ return _this.ihSD.getFrequencyCount();
1065
1342
  });
1066
- _defineProperty(this, "YMgG", function () {
1067
- return _this.RUmb.kPus();
1343
+ _defineProperty(this, "vtVj", function () {
1344
+ return _this.ihSD.NSSU();
1068
1345
  });
1069
1346
  });
1070
1347
 
1071
1348
  var ConfigLookup = /*#__PURE__*/_createClass(function ConfigLookup() {
1072
1349
  var _this = this;
1073
1350
  _classCallCheck(this, ConfigLookup);
1074
- _defineProperty(this, "benn", {});
1351
+ _defineProperty(this, "aSMs", {});
1075
1352
  _defineProperty(this, "parse", function () {
1076
1353
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1077
1354
  configs: []
@@ -1094,7 +1371,7 @@
1094
1371
  var configId = _config._id;
1095
1372
  var configItem = new ConfigItem();
1096
1373
  if (configItem.parse(_config)) {
1097
- _this.benn[configId] = configItem;
1374
+ _this.aSMs[configId] = configItem;
1098
1375
  } else {
1099
1376
  console.warn("Failed to parse cfg", configId);
1100
1377
  }
@@ -1102,31 +1379,44 @@
1102
1379
  }
1103
1380
  });
1104
1381
  _defineProperty(this, "validate", function (id, index) {
1105
- if (_this.benn[id]) {
1106
- var configItem = _this.benn[id];
1107
- configItem.BLtn(index);
1382
+ if (_this.aSMs[id]) {
1383
+ var configItem = _this.aSMs[id];
1384
+ configItem.SslG(index);
1108
1385
  }
1109
1386
  });
1110
- _defineProperty(this, "PUEA", function (id) {
1111
- var campiagnConfig = _this.benn[id];
1112
- campiagnConfig.PUEA();
1387
+ _defineProperty(this, "validateForTermination", function (id, index) {
1388
+ if (_this.aSMs[id]) {
1389
+ var configItem = _this.aSMs[id];
1390
+ configItem.uDmd(index);
1391
+ }
1392
+ });
1393
+ _defineProperty(this, "validateForTerminationAttributes", function (id) {
1394
+ if (_this.aSMs[id]) {
1395
+ var configItem = _this.aSMs[id];
1396
+ return configItem.validateForTerminationAttributes();
1397
+ }
1398
+ return false;
1399
+ });
1400
+ _defineProperty(this, "yGJs", function (id) {
1401
+ var campiagnConfig = _this.aSMs[id];
1402
+ campiagnConfig.yGJs();
1113
1403
  });
1114
1404
  _defineProperty(this, "getFrequencyCount", function (id) {
1115
- var campiagnConfig = _this.benn[id];
1405
+ var campiagnConfig = _this.aSMs[id];
1116
1406
  return campiagnConfig.getFrequencyCount();
1117
1407
  });
1118
1408
  _defineProperty(this, "resetFrequencyCounts", function () {
1119
- var configs = _this.benn;
1409
+ var configs = _this.aSMs;
1120
1410
  for (var configId in configs) {
1121
- configs[configId].YMgG();
1411
+ configs[configId].vtVj();
1122
1412
  }
1123
1413
  });
1124
- _defineProperty(this, "SynP", function (campaignId) {
1414
+ _defineProperty(this, "iSci", function (campaignId) {
1125
1415
  try {
1126
- if (_this.benn) {
1127
- var configItem = _this.benn[campaignId];
1128
- if (configItem && configItem.FBLV) {
1129
- return configItem.FBLV;
1416
+ if (_this.aSMs) {
1417
+ var configItem = _this.aSMs[campaignId];
1418
+ if (configItem && configItem.axSA) {
1419
+ return configItem.axSA;
1130
1420
  }
1131
1421
  }
1132
1422
  } catch (e) {
@@ -1138,46 +1428,46 @@
1138
1428
 
1139
1429
  var APP_EVENT = "APP_EVENT";
1140
1430
  var CLIENT_EVENT = "CLIENT_EVENT";
1141
- var Logger$7 = window.ApxorLogger;
1431
+ var Logger$9 = window.ApxorLogger;
1142
1432
  var EventsListener = /*#__PURE__*/_createClass(function EventsListener() {
1143
1433
  var _this = this;
1144
1434
  _classCallCheck(this, EventsListener);
1145
- _defineProperty(this, "VywR", {});
1146
- _defineProperty(this, "Tdmf", []);
1147
- _defineProperty(this, "wJFP", false);
1435
+ _defineProperty(this, "MqKW", {});
1436
+ _defineProperty(this, "PZUh", []);
1437
+ _defineProperty(this, "CrNj", false);
1148
1438
  _defineProperty(this, "initialize", function () {
1149
1439
  var controller = Apxor.getController();
1150
1440
  controller.registerForEvent(APP_EVENT, function (event) {
1151
- return _this.tkDV(event, "AE");
1441
+ return _this.Snah(event, "AE");
1152
1442
  });
1153
1443
  controller.registerForEvent(CLIENT_EVENT, function (event) {
1154
- return _this.tkDV(event, "CE");
1444
+ return _this.Snah(event, "CE");
1155
1445
  });
1156
1446
  });
1157
- _defineProperty(this, "QkcY", function () {
1447
+ _defineProperty(this, "hUlQ", function () {
1158
1448
  // Clear Buffer
1159
- for (var item in _this.Tdmf) {
1160
- _this.MCKA(item.event, item.key, item.type);
1449
+ for (var item in _this.PZUh) {
1450
+ _this.lMiM(item.event, item.key, item.type);
1161
1451
  }
1162
- _this.wJFP = true;
1452
+ _this.CrNj = true;
1163
1453
  });
1164
- _defineProperty(this, "HhWj", function (event, callback) {
1454
+ _defineProperty(this, "colh", function (event, callback) {
1165
1455
  if (!isFunction(callback)) {
1166
1456
  return;
1167
1457
  }
1168
1458
  var listeners;
1169
- if (_this.VywR[event]) {
1170
- listeners = _this.VywR[event];
1459
+ if (_this.MqKW[event]) {
1460
+ listeners = _this.MqKW[event];
1171
1461
  } else {
1172
1462
  listeners = [];
1173
1463
  }
1174
1464
  listeners.push(callback);
1175
- _this.VywR[event] = listeners;
1176
- Logger$7.debug("Listeners list: ", _this.VywR);
1465
+ _this.MqKW[event] = listeners;
1466
+ Logger$9.debug("Listeners list: ", _this.MqKW);
1177
1467
  });
1178
1468
  _defineProperty(this, "unregisterFromEvent", function (event, callback) {
1179
- if (_this.VywR[event]) {
1180
- var listeners = _this.VywR[event];
1469
+ if (_this.MqKW[event]) {
1470
+ var listeners = _this.MqKW[event];
1181
1471
  var updatedListeners = [];
1182
1472
  for (var index = 0; index < listeners.length; index++) {
1183
1473
  var listener = listeners[index];
@@ -1185,25 +1475,25 @@
1185
1475
  updatedListeners.push(listener);
1186
1476
  }
1187
1477
  }
1188
- _this.VywR[event] = updatedListeners;
1478
+ _this.MqKW[event] = updatedListeners;
1189
1479
  }
1190
1480
  });
1191
- _defineProperty(this, "tkDV", function (event) {
1481
+ _defineProperty(this, "Snah", function (event) {
1192
1482
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "AE";
1193
1483
  var key = type + "___" + event.name;
1194
- _this.MCKA(event, key, type);
1484
+ _this.lMiM(event, key, type);
1195
1485
  });
1196
- _defineProperty(this, "MCKA", function (event, key, type) {
1197
- if (!_this.wJFP) {
1198
- _this.Tdmf.push({
1486
+ _defineProperty(this, "lMiM", function (event, key, type) {
1487
+ if (!_this.CrNj) {
1488
+ _this.PZUh.push({
1199
1489
  event: event,
1200
1490
  key: key,
1201
1491
  type: type
1202
1492
  });
1203
1493
  } else {
1204
- Logger$7.debug("Notifying listeners for event: " + event + ", " + key, _this.VywR);
1205
- if (_this.VywR[key]) {
1206
- var listeners = _this.VywR[key];
1494
+ Logger$9.debug("Notifying listeners for event: " + event + ", " + key, _this.MqKW);
1495
+ if (_this.MqKW[key]) {
1496
+ var listeners = _this.MqKW[key];
1207
1497
  var time = Apxor.getController().getSDKRunningTimeInSec();
1208
1498
  for (var index = 0; index < listeners.length; index++) {
1209
1499
  var listener = listeners[index];
@@ -1214,22 +1504,22 @@
1214
1504
  });
1215
1505
  });
1216
1506
 
1217
- var Logger$8 = window.ApxorLogger;
1507
+ var Logger$a = window.ApxorLogger;
1218
1508
  var CE = /*#__PURE__*/function () {
1219
1509
  function CE() {
1220
1510
  var _this = this;
1221
1511
  _classCallCheck(this, CE);
1222
- _defineProperty(this, "nckW", false);
1223
- _defineProperty(this, "yTlh", null);
1224
- _defineProperty(this, "JXUH", getDateInDDMMYYYY());
1225
- _defineProperty(this, "cINd", new EventsListener());
1226
- _defineProperty(this, "TKYH", Apxor.getSiteId());
1512
+ _defineProperty(this, "FyrB", false);
1513
+ _defineProperty(this, "EGlR", null);
1514
+ _defineProperty(this, "Emjp", getDateInDDMMYYYY());
1515
+ _defineProperty(this, "WpgE", new EventsListener());
1516
+ _defineProperty(this, "kKtz", Apxor.getSiteId());
1227
1517
  _defineProperty(this, "_qeState", {});
1228
1518
  _defineProperty(this, "getQeState", function () {
1229
1519
  try {
1230
1520
  var data = Apxor.getController().getFromStorage(QE_STATE);
1231
1521
  if (data) {
1232
- return JSON.parse(decode(_this.TKYH, data));
1522
+ return JSON.parse(decode(_this.kKtz, data));
1233
1523
  } else {
1234
1524
  _this._qeState = {};
1235
1525
  return _this.setQeState();
@@ -1258,12 +1548,12 @@
1258
1548
  return _this._qeState;
1259
1549
  });
1260
1550
  _defineProperty(this, "initialize", function () {
1261
- if (!_this.nckW) {
1262
- _this.nckW = true;
1263
- _this.yTlh = new ConfigLookup();
1264
- _this.cINd.initialize();
1551
+ if (!_this.FyrB) {
1552
+ _this.FyrB = true;
1553
+ _this.EGlR = new ConfigLookup();
1554
+ _this.WpgE.initialize();
1265
1555
  _this._qeState = _this.getQeState();
1266
- Logger$8.info("QE Initialized..");
1556
+ Logger$a.info("QE Initialized..");
1267
1557
  }
1268
1558
  });
1269
1559
  /**
@@ -1272,12 +1562,12 @@
1272
1562
  * @param config
1273
1563
  */
1274
1564
  _defineProperty(this, "parse", function (config) {
1275
- if (!_this.kEWF()) {
1276
- Logger$8.warn("Must call init first. Unable to proceed");
1565
+ if (!_this.lHre()) {
1566
+ Logger$a.warn("Must call init first. Unable to proceed");
1277
1567
  return;
1278
1568
  }
1279
- _this.yTlh.parse(config);
1280
- _this.cINd.QkcY();
1569
+ _this.EGlR.parse(config);
1570
+ _this.WpgE.hUlQ();
1281
1571
  });
1282
1572
  /**
1283
1573
  * Validates all conditions for given config ID
@@ -1286,10 +1576,19 @@
1286
1576
  * @param index
1287
1577
  */
1288
1578
  _defineProperty(this, "validate", function (id, index) {
1289
- if (!_this.kEWF()) {
1579
+ if (!_this.lHre()) {
1290
1580
  return;
1291
1581
  }
1292
- _this.yTlh.validate(id, index);
1582
+ _this.EGlR.validate(id, index);
1583
+ });
1584
+ _defineProperty(this, "validateForTermination", function (id, index) {
1585
+ if (!_this.lHre()) {
1586
+ return;
1587
+ }
1588
+ _this.EGlR.validateForTermination(id, index);
1589
+ });
1590
+ _defineProperty(this, "validateForTerminationAttributes", function (user, session) {
1591
+ return _this.EGlR.validateForTerminationAttributes(user, session);
1293
1592
  });
1294
1593
  _defineProperty(this, "updateCount", function (id) {
1295
1594
  try {
@@ -1298,22 +1597,22 @@
1298
1597
  }
1299
1598
  _this.incrementFrequencies(id);
1300
1599
  _this.setQeState(id);
1301
- _this.yTlh.PUEA(id);
1600
+ _this.EGlR.yGJs(id);
1302
1601
  } catch (e) {
1303
1602
  console.log("Could not update the count config:".concat(e));
1304
1603
  }
1305
1604
  });
1306
1605
  _defineProperty(this, "resetFrequencyCounts", function () {
1307
- _this.yTlh.resetFrequencyCounts();
1606
+ _this.EGlR.resetFrequencyCounts();
1308
1607
  });
1309
1608
  _defineProperty(this, "getFrequencyCount", function (id) {
1310
- return _this.yTlh.getFrequencyCount(id);
1609
+ return _this.EGlR.getFrequencyCount(id);
1311
1610
  });
1312
1611
  _defineProperty(this, "registerForEvent", function (event, callback) {
1313
- _this.cINd.HhWj(event, callback);
1612
+ _this.WpgE.colh(event, callback);
1314
1613
  });
1315
1614
  _defineProperty(this, "unregisterFromEvent", function (event, callback) {
1316
- _this.cINd.unregisterFromEvent(event, callback);
1615
+ _this.WpgE.unregisterFromEvent(event, callback);
1317
1616
  });
1318
1617
  /**
1319
1618
  * Fetches the config from Server
@@ -1326,14 +1625,14 @@
1326
1625
  _defineProperty(this, "fetch", function (type, validateUrl, apiUrl, callback) {
1327
1626
  Apxor.getController().fetchConfiguration(type, validateUrl, apiUrl, callback);
1328
1627
  });
1329
- _defineProperty(this, "kEWF", function () {
1330
- return _this.nckW;
1628
+ _defineProperty(this, "lHre", function () {
1629
+ return _this.FyrB;
1331
1630
  });
1332
1631
  _defineProperty(this, "getCampaignMetaFromQueryEngine", function (campaignId) {
1333
- return _this.yTlh.SynP(campaignId);
1632
+ return _this.EGlR.iSci(campaignId);
1334
1633
  });
1335
- _defineProperty(this, "VBfn", function () {
1336
- return _this.JXUH;
1634
+ _defineProperty(this, "rvWz", function () {
1635
+ return _this.Emjp;
1337
1636
  });
1338
1637
  if (!CE.instance) {
1339
1638
  CE.instance = this;
@@ -1357,11 +1656,11 @@
1357
1656
  OVERALL: 0,
1358
1657
  DATES: {}
1359
1658
  };
1360
- if (this.JXUH) this._qeState[id].DATES[this.JXUH] = 0;
1659
+ if (this.Emjp) this._qeState[id].DATES[this.Emjp] = 0;
1361
1660
  this.setQeState(id);
1362
1661
  }
1363
1662
  } catch (e) {
1364
- Logger$8.error("Can not create the frequency count object:" + e);
1663
+ Logger$a.error("Can not create the frequency count object:" + e);
1365
1664
  }
1366
1665
  }
1367
1666
  }, {
@@ -1376,12 +1675,12 @@
1376
1675
 
1377
1676
  // Increment the DATES count for this particular date by 1. If the date changes reset.
1378
1677
  var currentDate = getDateInDDMMYYYY();
1379
- if (currentDate !== this.JXUH || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
1380
- this.JXUH = currentDate;
1678
+ if (currentDate !== this.Emjp || !(configFrequency.DATES && configFrequency.DATES[currentDate])) {
1679
+ this.Emjp = currentDate;
1381
1680
  configFrequency.DATES = {};
1382
- configFrequency.DATES[this.JXUH] = 0;
1681
+ configFrequency.DATES[this.Emjp] = 0;
1383
1682
  }
1384
- configFrequency.DATES[this.JXUH] = configFrequency.DATES[this.JXUH] + 1;
1683
+ configFrequency.DATES[this.Emjp] = configFrequency.DATES[this.Emjp] + 1;
1385
1684
  }
1386
1685
  }], [{
1387
1686
  key: "getInstance",
@@ -1400,7 +1699,7 @@
1400
1699
 
1401
1700
  /* eslint-disable no-empty */
1402
1701
 
1403
- window.ceVersion = 130;
1702
+ window.ceVersion = 141;
1404
1703
  try {
1405
1704
  if (exports !== undefined || exports !== null) {
1406
1705
  exports["default"] = CE;