apxor-rtm-ui 0.0.10 → 0.1.0-qa.0
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.rtm.js.bak +188 -90
- package/dist/apxor.rtm.min.js +1 -42
- package/package.json +12 -19
package/dist/apxor.rtm.js.bak
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
4
4
|
(global = global || self, global['apxor-rtm'] = factory());
|
|
5
|
-
}(this,
|
|
5
|
+
}(this, function () { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _typeof(obj) {
|
|
8
8
|
"@babel/helpers - typeof";
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
25
25
|
descriptor.configurable = true;
|
|
26
26
|
if ("value" in descriptor) descriptor.writable = true;
|
|
27
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
27
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
return Constructor;
|
|
37
37
|
}
|
|
38
38
|
function _defineProperty(obj, key, value) {
|
|
39
|
+
key = _toPropertyKey(key);
|
|
39
40
|
if (key in obj) {
|
|
40
41
|
Object.defineProperty(obj, key, {
|
|
41
42
|
value: value,
|
|
@@ -141,9 +142,29 @@
|
|
|
141
142
|
function _nonIterableSpread() {
|
|
142
143
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
143
144
|
}
|
|
145
|
+
function _toPrimitive(input, hint) {
|
|
146
|
+
if (typeof input !== "object" || input === null) return input;
|
|
147
|
+
var prim = input[Symbol.toPrimitive];
|
|
148
|
+
if (prim !== undefined) {
|
|
149
|
+
var res = prim.call(input, hint || "default");
|
|
150
|
+
if (typeof res !== "object") return res;
|
|
151
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
152
|
+
}
|
|
153
|
+
return (hint === "string" ? String : Number)(input);
|
|
154
|
+
}
|
|
155
|
+
function _toPropertyKey(arg) {
|
|
156
|
+
var key = _toPrimitive(arg, "string");
|
|
157
|
+
return typeof key === "symbol" ? key : String(key);
|
|
158
|
+
}
|
|
144
159
|
|
|
145
160
|
/*! shepherd.js 4.0.0-beta.1 */
|
|
146
161
|
|
|
162
|
+
/* eslint-disable no-unused-vars */
|
|
163
|
+
/* eslint-disable no-useless-escape */
|
|
164
|
+
/* eslint-disable no-empty */
|
|
165
|
+
/* eslint-disable no-unsafe-finally */
|
|
166
|
+
/* eslint-disable no-func-assign */
|
|
167
|
+
|
|
147
168
|
function _typeof$1(obj) {
|
|
148
169
|
if (typeof Symbol === "function" && _typeof(Symbol.iterator) === "symbol") {
|
|
149
170
|
_typeof$1 = function _typeof$1(obj) {
|
|
@@ -5073,6 +5094,8 @@
|
|
|
5073
5094
|
case RIGHT_ARROW:
|
|
5074
5095
|
_this3.tour.next();
|
|
5075
5096
|
break;
|
|
5097
|
+
default:
|
|
5098
|
+
break;
|
|
5076
5099
|
}
|
|
5077
5100
|
});
|
|
5078
5101
|
}
|
|
@@ -6303,7 +6326,8 @@
|
|
|
6303
6326
|
};
|
|
6304
6327
|
var EVENT_PREFIX = {
|
|
6305
6328
|
INAPP: "InApp_",
|
|
6306
|
-
INLINE: "InLine_"
|
|
6329
|
+
INLINE: "InLine_",
|
|
6330
|
+
SURVEY: "Survey_"
|
|
6307
6331
|
};
|
|
6308
6332
|
var COLORS = {
|
|
6309
6333
|
BLACK: "#000000",
|
|
@@ -6312,7 +6336,8 @@
|
|
|
6312
6336
|
var BUTTON_CONTAINER_POSITION = {
|
|
6313
6337
|
TOP: "top",
|
|
6314
6338
|
CENTER: "center",
|
|
6315
|
-
BOTTOM: "bottom"
|
|
6339
|
+
BOTTOM: "bottom",
|
|
6340
|
+
SURVEY_BOTTOM: "survey_button"
|
|
6316
6341
|
};
|
|
6317
6342
|
var VIDEOS_MODES = {
|
|
6318
6343
|
PLAYER: "mini",
|
|
@@ -6323,6 +6348,8 @@
|
|
|
6323
6348
|
CAROUSEL: "carousel"
|
|
6324
6349
|
};
|
|
6325
6350
|
|
|
6351
|
+
/* eslint-disable no-unused-vars */
|
|
6352
|
+
|
|
6326
6353
|
var isUndefined$1 = function isUndefined(term) {
|
|
6327
6354
|
return typeof term === "undefined";
|
|
6328
6355
|
};
|
|
@@ -6640,6 +6667,8 @@
|
|
|
6640
6667
|
totalSlots = 3;
|
|
6641
6668
|
} else if (position === BUTTON_CONTAINER_POSITION.BOTTOM) {
|
|
6642
6669
|
totalSlots = 5;
|
|
6670
|
+
} else if (position === BUTTON_CONTAINER_POSITION.SURVEY_BOTTOM) {
|
|
6671
|
+
totalSlots = 3;
|
|
6643
6672
|
} else {
|
|
6644
6673
|
totalSlots = 1;
|
|
6645
6674
|
}
|
|
@@ -6752,7 +6781,7 @@
|
|
|
6752
6781
|
}
|
|
6753
6782
|
buttons += type !== "stepper" ? "\n div .button-div.".concat(position, "-button-").concat(slot, "{\n width:auto;\n height:auto;\n cursor: pointer;\n background-color: ").concat(bg_color === "#" ? "transparent" : bg_color, ";\n ").concat(borderStyles, "\n ").concat(marginStyles, "\n ").concat(paddingStyles, "\n ").concat(marginLeft ? "margin-left:auto;" : "", "\n ").concat(marginRight ? "margin-right:auto;" : "margin-right:12px;", "\n ").concat(gradientStyles, "\n }\n .").concat(position, "-button-").concat(slot, "{\n cursor: pointer;\n color: ").concat(text_color, ";\n background-color: transparent;\n font-size: ").concat(size, "px;\n border:none;\n font-family: ").concat(font_family, ";\n font-weight: ").concat(weight, ";\n font-style: ").concat(style, ";\n margin: ").concat(text_margin_top, "px ").concat(text_margin_right, "px ").concat(text_margin_bottom, "px ").concat(text_margin_left, "px;\n padding: ").concat(text_padding_top, "px ").concat(text_padding_right, "px ").concat(text_padding_bottom, "px ").concat(text_padding_left, "px;\n }\n ") : "\n div .button-div.".concat(position, "-button-").concat(slot, "{\n width:auto;\n height:auto;\n cursor: pointer;\n background-color: transparent;\n ").concat(marginLeft ? "margin-left:auto;" : "", "\n ").concat(marginRight ? "margin-right:auto;" : "margin-right:12px;", "\n ").concat(gradientStyles, "\n }\n ").concat(sub_type === CAROUSEL_TYPE.NUMBER ? "div .stepper-".concat(sub_type, "{\n font-family:").concat(numberedfont.family, ";\n font-size: ").concat(numberedfont.size, "px;\n font-style:").concat(numberedfont.style, ";\n font-width:").concat(numberedfont.width, ";\n color:").concat(numbered.color, ";\n }") : "", "\n\n ").concat(sub_type === CAROUSEL_TYPE.CAROUSAL ? "div .stepper-".concat(sub_type, "{\n font-size:\"20px\";\n }") : "", "\n ");
|
|
6754
6783
|
});
|
|
6755
|
-
return "\n div .".concat(position, "-buttons-container {\n display: flex;\n flex-direction:").concat(button_direction === DIRECTION.VERTICAL && position === BUTTON_CONTAINER_POSITION.BOTTOM ? "column" : "row", ";\n justify-content:").concat(justifyContent, ";\n align-items:center;\n flex-wrap:wrap;\n }\n ").concat(buttons, "\n ");
|
|
6784
|
+
return "\n div .".concat(position, "-buttons-container {\n width:100%;\n display: flex;\n flex-direction:").concat(button_direction === DIRECTION.VERTICAL && position === BUTTON_CONTAINER_POSITION.BOTTOM ? "column" : "row", ";\n justify-content:").concat(justifyContent, ";\n align-items:center;\n flex-wrap:wrap;\n }\n ").concat(buttons, "\n ");
|
|
6756
6785
|
};
|
|
6757
6786
|
var generateButtonsFromConfig = function generateButtonsFromConfig() {
|
|
6758
6787
|
var buttons_config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -6861,6 +6890,18 @@
|
|
|
6861
6890
|
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6862
6891
|
};
|
|
6863
6892
|
break;
|
|
6893
|
+
case "submit":
|
|
6894
|
+
action = function action() {
|
|
6895
|
+
ActionHandler.complete(false, "submit");
|
|
6896
|
+
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6897
|
+
};
|
|
6898
|
+
break;
|
|
6899
|
+
case "skip":
|
|
6900
|
+
action = function action() {
|
|
6901
|
+
ActionHandler.complete(false, "skip");
|
|
6902
|
+
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
6903
|
+
};
|
|
6904
|
+
break;
|
|
6864
6905
|
default:
|
|
6865
6906
|
action = function action() {
|
|
6866
6907
|
window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
|
|
@@ -7107,6 +7148,9 @@
|
|
|
7107
7148
|
var pipSVG = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(width, "\" height=\"").concat(height, "\" fill=").concat(color, " class=\"bi bi-pip\" viewBox=\"0 0 16 16\">\n <path d=\"M0 3.5A1.5 1.5 0 0 1 1.5 2h13A1.5 1.5 0 0 1 16 3.5v9a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 12.5v-9zM1.5 3a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5h-13z\"/>\n <path d=\"M8 8.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-5a.5.5 0 0 1-.5-.5v-3z\"/>\n </svg>");
|
|
7108
7149
|
return pipSVG;
|
|
7109
7150
|
};
|
|
7151
|
+
var getSlotNumberByPosition = function getSlotNumberByPosition(position) {
|
|
7152
|
+
if (position === "left") return 1;else if (position === "center") return 3;else return 5;
|
|
7153
|
+
};
|
|
7110
7154
|
|
|
7111
7155
|
/* eslint-disable no-unused-vars */
|
|
7112
7156
|
var ApxorWalkthroughTour;
|
|
@@ -7457,7 +7501,7 @@
|
|
|
7457
7501
|
var recheckStartedAt = new Date();
|
|
7458
7502
|
//For every find_interval
|
|
7459
7503
|
var elementRecheckIntervalId = setInterval(function () {
|
|
7460
|
-
var element = getViewElement();
|
|
7504
|
+
var element = getViewElement(view_id);
|
|
7461
7505
|
//If the element is found, stop checking and create a step
|
|
7462
7506
|
if (element) {
|
|
7463
7507
|
clearInterval(elementRecheckIntervalId);
|
|
@@ -7473,7 +7517,7 @@
|
|
|
7473
7517
|
}, find_interval);
|
|
7474
7518
|
};
|
|
7475
7519
|
setTimeout(function () {
|
|
7476
|
-
var element = getViewElement();
|
|
7520
|
+
var element = getViewElement(view_id);
|
|
7477
7521
|
if (!element) {
|
|
7478
7522
|
console.warn("Element with id:".concat(view_id, " not found."));
|
|
7479
7523
|
if (find_interval) {
|
|
@@ -7919,6 +7963,10 @@
|
|
|
7919
7963
|
}
|
|
7920
7964
|
outerCircleCenterY = innerCircleTop + (textElementOffsetTop + textElemOffsetHeight - innerCircleTop) / 2;
|
|
7921
7965
|
break;
|
|
7966
|
+
case "LEFT":
|
|
7967
|
+
break;
|
|
7968
|
+
case "RIGHT":
|
|
7969
|
+
break;
|
|
7922
7970
|
}
|
|
7923
7971
|
if (textElementOffsetLeft === -1 || textElementOffsetTop === -1 || outerCircleCenterY === -1) {
|
|
7924
7972
|
console.warn("Failed to identify the right place for text");
|
|
@@ -8364,7 +8412,8 @@
|
|
|
8364
8412
|
* embed: {
|
|
8365
8413
|
* html : "<iframe><video></video></iframe>",
|
|
8366
8414
|
* }
|
|
8367
|
-
*/
|
|
8415
|
+
*/
|
|
8416
|
+
var EmbeddedVideo = /*#__PURE__*/_createClass(function EmbeddedVideo() {
|
|
8368
8417
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8369
8418
|
_classCallCheck(this, EmbeddedVideo);
|
|
8370
8419
|
this.html = data.html;
|
|
@@ -8585,6 +8634,7 @@
|
|
|
8585
8634
|
function Text() {
|
|
8586
8635
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8587
8636
|
_classCallCheck(this, Text);
|
|
8637
|
+
this.background_color = data === null || data === void 0 ? void 0 : data.background_color;
|
|
8588
8638
|
this.alignment = getStringOrDefault(data.alignment, "center").toLowerCase();
|
|
8589
8639
|
this.color = getColorOrDefault(data.color, "#FFF").toLowerCase();
|
|
8590
8640
|
this.font = new Font(data.font);
|
|
@@ -8829,7 +8879,8 @@
|
|
|
8829
8879
|
* outside_touch : true,
|
|
8830
8880
|
* target_touch : false,
|
|
8831
8881
|
* }
|
|
8832
|
-
*/
|
|
8882
|
+
*/
|
|
8883
|
+
var DismissActions = /*#__PURE__*/_createClass(function DismissActions() {
|
|
8833
8884
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8834
8885
|
_classCallCheck(this, DismissActions);
|
|
8835
8886
|
this.outside_touch = Boolean(data.outside_touch);
|
|
@@ -9097,7 +9148,14 @@
|
|
|
9097
9148
|
var Button = /*#__PURE__*/_createClass(function Button() {
|
|
9098
9149
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9099
9150
|
_classCallCheck(this, Button);
|
|
9100
|
-
|
|
9151
|
+
if (data !== null && data !== void 0 && data.position) {
|
|
9152
|
+
this.position = new Position(data.position);
|
|
9153
|
+
}
|
|
9154
|
+
if ((data === null || data === void 0 ? void 0 : data.slot) === undefined) {
|
|
9155
|
+
this.slot = getSlotNumberByPosition(this.position.position);
|
|
9156
|
+
} else {
|
|
9157
|
+
this.slot = getNumberOrDefault(data.slot, 0);
|
|
9158
|
+
}
|
|
9101
9159
|
this.type = getStringOrDefault(data.type, "button");
|
|
9102
9160
|
this.sub_type = getStringOrDefault(data.sub_type, "");
|
|
9103
9161
|
this.color = getColorOrDefault(data.color, "#FFF");
|
|
@@ -9193,6 +9251,7 @@
|
|
|
9193
9251
|
var _this = this;
|
|
9194
9252
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9195
9253
|
_classCallCheck(this, Buttons);
|
|
9254
|
+
this.background_color = data.background_color;
|
|
9196
9255
|
this.enable_top = data.enable_top;
|
|
9197
9256
|
this.enable_center = data.enable_center;
|
|
9198
9257
|
this.enable_bottom = data.enable_bottom;
|
|
@@ -9211,6 +9270,14 @@
|
|
|
9211
9270
|
topButtons.forEach(function (topButton) {
|
|
9212
9271
|
_this.top.push(new TopButton(topButton));
|
|
9213
9272
|
});
|
|
9273
|
+
this.enable_margin = data.enable_margin;
|
|
9274
|
+
if (this.enable_margin) this.margin = new Margin(data.margin);
|
|
9275
|
+
this.enable_padding = data.enable_padding;
|
|
9276
|
+
if (this.enable_padding) this.padding = new Padding(data.padding);
|
|
9277
|
+
this.enable_border = data.enable_border;
|
|
9278
|
+
if (this.enable_border) this.border = new Border(data.border);
|
|
9279
|
+
this.enable_gradient = data.enable_gradient;
|
|
9280
|
+
if (this.enable_gradient) this.gradient = new Gradient(data.gradient);
|
|
9214
9281
|
});
|
|
9215
9282
|
|
|
9216
9283
|
/**
|
|
@@ -9396,6 +9463,12 @@
|
|
|
9396
9463
|
if (this.enable_carousel) this.carousel = new Carousel(data.carousel);
|
|
9397
9464
|
this.enable_progressbar = data.enable_progressbar;
|
|
9398
9465
|
if (this.enable_progressbar) this.progressbar = new ProgressBar(data.progressbar);
|
|
9466
|
+
|
|
9467
|
+
//surveys
|
|
9468
|
+
this.enable_padding = data === null || data === void 0 ? void 0 : data.enable_padding;
|
|
9469
|
+
if (this.enable_padding) this.padding = new Padding(data.padding);
|
|
9470
|
+
this.enable_margin = data === null || data === void 0 ? void 0 : data.enable_margin;
|
|
9471
|
+
if (this.enable_margin) this.margin = new Margin(data.margin);
|
|
9399
9472
|
}
|
|
9400
9473
|
_createClass(Stepper, null, [{
|
|
9401
9474
|
key: "isEnabled",
|
|
@@ -9425,7 +9498,13 @@
|
|
|
9425
9498
|
var uis = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
|
|
9426
9499
|
var index = arguments.length > 9 ? arguments[9] : undefined;
|
|
9427
9500
|
_classCallCheck(this, ModalInApp);
|
|
9428
|
-
|
|
9501
|
+
/**
|
|
9502
|
+
* @function _getMarketingStyles
|
|
9503
|
+
* @private
|
|
9504
|
+
* @description Creates the styles for Marketing message.
|
|
9505
|
+
* @returns {string} css styles
|
|
9506
|
+
*/
|
|
9507
|
+
_defineProperty(this, "ProW", function () {
|
|
9429
9508
|
if (!_this.enable_marketing) {
|
|
9430
9509
|
return "";
|
|
9431
9510
|
}
|
|
@@ -9439,7 +9518,12 @@
|
|
|
9439
9518
|
var marketingStyles = "\n .apx-inapp-marketing".concat(_this.cssPostFix, " {\n align-self:").concat(alignment, ";\n text-align:").concat(message.alignment, ";\n }\n ");
|
|
9440
9519
|
return marketingStyles;
|
|
9441
9520
|
});
|
|
9442
|
-
|
|
9521
|
+
/**
|
|
9522
|
+
* @funciton generateResponse
|
|
9523
|
+
* @private
|
|
9524
|
+
* @description Get the response for Form content in the InApp modal.
|
|
9525
|
+
*/
|
|
9526
|
+
_defineProperty(this, "dMvX", function (form_elements) {
|
|
9443
9527
|
var obj = {};
|
|
9444
9528
|
var callback = "";
|
|
9445
9529
|
form_elements.forEach(function (element) {
|
|
@@ -9467,6 +9551,8 @@
|
|
|
9467
9551
|
case "button":
|
|
9468
9552
|
callback = (_element$callback = element === null || element === void 0 ? void 0 : element.callback) !== null && _element$callback !== void 0 ? _element$callback : "";
|
|
9469
9553
|
break;
|
|
9554
|
+
default:
|
|
9555
|
+
break;
|
|
9470
9556
|
}
|
|
9471
9557
|
});
|
|
9472
9558
|
return {
|
|
@@ -9474,7 +9560,12 @@
|
|
|
9474
9560
|
callback: callback
|
|
9475
9561
|
};
|
|
9476
9562
|
});
|
|
9477
|
-
|
|
9563
|
+
/**
|
|
9564
|
+
* @function _setMarketingMessage
|
|
9565
|
+
* @private
|
|
9566
|
+
* @description Sets the marketing content at the end of the InApp
|
|
9567
|
+
*/
|
|
9568
|
+
_defineProperty(this, "TRzX", function () {
|
|
9478
9569
|
if (_this.enable_marketing) {
|
|
9479
9570
|
var marketingContainer = document.createElement("div");
|
|
9480
9571
|
marketingContainer.classList.add("apx-inapp-marketing".concat(_this.cssPostFix));
|
|
@@ -9692,7 +9783,7 @@
|
|
|
9692
9783
|
}, {
|
|
9693
9784
|
key: "_setStyles",
|
|
9694
9785
|
value: function _setStyles() {
|
|
9695
|
-
var styles = " \n ".concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInAppContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInAppMediaContainerStyles(), "\n ").concat(this._getInAppNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getFormStyles(), "\n ").concat(this._getInAppButtonContainerStyles(), "\n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.
|
|
9786
|
+
var styles = " \n ".concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInAppContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInAppMediaContainerStyles(), "\n ").concat(this._getInAppNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getFormStyles(), "\n ").concat(this._getInAppButtonContainerStyles(), "\n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.ProW(), " \n ").concat(this._getProgressBarStyles(), "\n ").concat(this._getBootstrapiconsStyles(), " \n ").replaceAll("\n", "").replace(/[\s]{2,999}/g, "");
|
|
9696
9787
|
var styleNode = document.createElement("style");
|
|
9697
9788
|
styleNode.innerHTML = styles;
|
|
9698
9789
|
this.overlayElement.appendChild(styleNode);
|
|
@@ -10048,13 +10139,6 @@
|
|
|
10048
10139
|
}
|
|
10049
10140
|
return videoStyles;
|
|
10050
10141
|
}
|
|
10051
|
-
|
|
10052
|
-
/**
|
|
10053
|
-
* @function _getMarketingStyles
|
|
10054
|
-
* @private
|
|
10055
|
-
* @description Creates the styles for Marketing message.
|
|
10056
|
-
* @returns {string} css styles
|
|
10057
|
-
*/
|
|
10058
10142
|
}, {
|
|
10059
10143
|
key: "_getProgressBarStyles",
|
|
10060
10144
|
value:
|
|
@@ -10067,7 +10151,7 @@
|
|
|
10067
10151
|
function _getProgressBarStyles() {
|
|
10068
10152
|
var progressBarStyles = "";
|
|
10069
10153
|
if (this.has_progress_bar) {
|
|
10070
|
-
progressBarStyles = "\n .apx-inapp-progress-bar".concat(this.cssPostFix, "{\n position: absolute;\n width:100%;\n height:").concat(this.progressbar.width, ";\n ").concat(this.progressbar.position === "top" ? "top:0px;" : "bottom:0px;", "\n left:0px;\n z-index:999999;\n overflow:hidden;\n cursor: pointer;\n background:").concat(this.progressbar.reamining_color, ";\n }\n .apx-inapp-bar").concat(this.cssPostFix, "{\n width:100%;\n height:100%;\n background:").concat(this.progressbar.progress_color, ";\n }");
|
|
10154
|
+
progressBarStyles = "\n .apx-inapp-progress-bar".concat(this.cssPostFix, "{\n position: absolute;\n width:100%;\n height:").concat(this.progressbar.width, "px;\n ").concat(this.progressbar.position === "top" ? "top:0px;" : "bottom:0px;", "\n left:0px;\n z-index:999999;\n overflow:hidden;\n cursor: pointer;\n background:").concat(this.progressbar.reamining_color, ";\n }\n .apx-inapp-bar").concat(this.cssPostFix, "{\n width:100%;\n height:100%;\n background:").concat(this.progressbar.progress_color, ";\n }");
|
|
10071
10155
|
}
|
|
10072
10156
|
return progressBarStyles;
|
|
10073
10157
|
}
|
|
@@ -10141,7 +10225,7 @@
|
|
|
10141
10225
|
this._setCloseButton();
|
|
10142
10226
|
|
|
10143
10227
|
//Set the Marketing content
|
|
10144
|
-
this.
|
|
10228
|
+
this.TRzX();
|
|
10145
10229
|
}
|
|
10146
10230
|
|
|
10147
10231
|
/**
|
|
@@ -10311,12 +10395,6 @@
|
|
|
10311
10395
|
this.textContainer.appendChild(textElement);
|
|
10312
10396
|
}
|
|
10313
10397
|
}
|
|
10314
|
-
|
|
10315
|
-
/**
|
|
10316
|
-
* @funciton generateResponse
|
|
10317
|
-
* @private
|
|
10318
|
-
* @description Get the response for Form content in the InApp modal.
|
|
10319
|
-
*/
|
|
10320
10398
|
}, {
|
|
10321
10399
|
key: "_setFormContent",
|
|
10322
10400
|
value:
|
|
@@ -10340,7 +10418,7 @@
|
|
|
10340
10418
|
var form = document.querySelector(".apx-inapp-form-container".concat(this.cssPostFix));
|
|
10341
10419
|
form.addEventListener("submit", function (e) {
|
|
10342
10420
|
e.preventDefault();
|
|
10343
|
-
var _this3$generateRespon = _this3.
|
|
10421
|
+
var _this3$generateRespon = _this3.dMvX(_this3.form.elements),
|
|
10344
10422
|
obj = _this3$generateRespon.obj,
|
|
10345
10423
|
callback = _this3$generateRespon.callback;
|
|
10346
10424
|
var evalString = "(obj)=>" + callback + "(obj)";
|
|
@@ -10520,12 +10598,6 @@
|
|
|
10520
10598
|
this.direction.non_media === DIRECTION.VERTICAL || this.direction.nudge === DIRECTION.VERTICAL ? this.inAppContainer.appendChild(closeButton) : this.buttonContainer.appendChild(closeButton);
|
|
10521
10599
|
}
|
|
10522
10600
|
}
|
|
10523
|
-
|
|
10524
|
-
/**
|
|
10525
|
-
* @function _setMarketingMessage
|
|
10526
|
-
* @private
|
|
10527
|
-
* @description Sets the marketing content at the end of the InApp
|
|
10528
|
-
*/
|
|
10529
10601
|
}, {
|
|
10530
10602
|
key: "_setAutoTerminate",
|
|
10531
10603
|
value:
|
|
@@ -10644,7 +10716,11 @@
|
|
|
10644
10716
|
function VideoInApp(config, configId, name, showCallback, _hideCallback) {
|
|
10645
10717
|
var _this = this;
|
|
10646
10718
|
_classCallCheck(this, VideoInApp);
|
|
10647
|
-
|
|
10719
|
+
/**
|
|
10720
|
+
* @function showVideoInApp
|
|
10721
|
+
* @description Shows the video InApp with the configured mode.
|
|
10722
|
+
*/
|
|
10723
|
+
_defineProperty(this, "MOZi", function () {
|
|
10648
10724
|
_this.createPlayer();
|
|
10649
10725
|
try {
|
|
10650
10726
|
// In PIP mode, only after the video metadata is loaded, show the PIP.
|
|
@@ -10660,7 +10736,7 @@
|
|
|
10660
10736
|
};
|
|
10661
10737
|
} else {
|
|
10662
10738
|
// As the video player is hidden by default, unhide if the mode is not PIP.
|
|
10663
|
-
_this.
|
|
10739
|
+
_this.HMFI();
|
|
10664
10740
|
}
|
|
10665
10741
|
_this.showCallback();
|
|
10666
10742
|
} catch (e) {
|
|
@@ -10668,20 +10744,37 @@
|
|
|
10668
10744
|
_this.hideCallback();
|
|
10669
10745
|
}
|
|
10670
10746
|
});
|
|
10671
|
-
|
|
10747
|
+
/**
|
|
10748
|
+
* @function _getHeightWidthFromResolution
|
|
10749
|
+
* @private
|
|
10750
|
+
* @description Sets the height and width of the video element.
|
|
10751
|
+
* For portrait - width is set to 50% of the screen and height is auto adjusted based on resolution.
|
|
10752
|
+
* For landscape - height is set to 50% of the screen and width is auto adjusted based on resolution.
|
|
10753
|
+
*/
|
|
10754
|
+
_defineProperty(this, "jcAJ", function () {
|
|
10672
10755
|
var _getHeightWidthFromRe = getHeightWidthFromResolution(_this.video),
|
|
10673
10756
|
width = _getHeightWidthFromRe.width,
|
|
10674
10757
|
height = _getHeightWidthFromRe.height;
|
|
10675
10758
|
_this.height = height;
|
|
10676
10759
|
_this.width = width;
|
|
10677
10760
|
});
|
|
10678
|
-
|
|
10761
|
+
/**
|
|
10762
|
+
* @function _removeVideoPlayerStyles
|
|
10763
|
+
* @private
|
|
10764
|
+
* @description Removes the video player style element.
|
|
10765
|
+
*/
|
|
10766
|
+
_defineProperty(this, "Wfze", function () {
|
|
10679
10767
|
var playerStyles = document.getElementById("apx-mpl-styles");
|
|
10680
10768
|
if (playerStyles) {
|
|
10681
10769
|
playerStyles.remove();
|
|
10682
10770
|
}
|
|
10683
10771
|
});
|
|
10684
|
-
|
|
10772
|
+
/**
|
|
10773
|
+
* @function _setVideoControlListeners
|
|
10774
|
+
* @private
|
|
10775
|
+
* @description Attach listeners on the video controls
|
|
10776
|
+
*/
|
|
10777
|
+
_defineProperty(this, "tvXC", function () {
|
|
10685
10778
|
// Listener for the video end. Display the CTA's when the video ends.
|
|
10686
10779
|
_this.videoElement.addEventListener("ended", function () {
|
|
10687
10780
|
var ctaButtons = document.getElementById("apx-cta-btn");
|
|
@@ -10699,7 +10792,12 @@
|
|
|
10699
10792
|
}
|
|
10700
10793
|
});
|
|
10701
10794
|
});
|
|
10702
|
-
|
|
10795
|
+
/**
|
|
10796
|
+
* @function _setPIPtoggleListeners
|
|
10797
|
+
* @private
|
|
10798
|
+
* @description Attach listeners for the PIP toggle. i.e. for the PIP enter and PIP exit
|
|
10799
|
+
*/
|
|
10800
|
+
_defineProperty(this, "JVqR", function () {
|
|
10703
10801
|
// Enable the PIP toggle listeners only if the config says so.
|
|
10704
10802
|
if (_this.enable_pip_button && _this.pip.enable_toggles) {
|
|
10705
10803
|
// On Exit of the PIP,
|
|
@@ -10724,7 +10822,12 @@
|
|
|
10724
10822
|
_this.videoElement.addEventListener("enterpictureinpicture", onEnterPip, false);
|
|
10725
10823
|
}
|
|
10726
10824
|
});
|
|
10727
|
-
|
|
10825
|
+
/**
|
|
10826
|
+
* @function _setCustomControls
|
|
10827
|
+
* @private Sets the custom controls on the video player.
|
|
10828
|
+
* PIP and close are the custom controls that are created and positions on the video.
|
|
10829
|
+
*/
|
|
10830
|
+
_defineProperty(this, "CFBY", function () {
|
|
10728
10831
|
_this.enable_close_button;
|
|
10729
10832
|
if (_this.enable_close_button) {
|
|
10730
10833
|
var closeButton = document.createElement("span");
|
|
@@ -10745,7 +10848,7 @@
|
|
|
10745
10848
|
try {
|
|
10746
10849
|
_this.videoPlayer.remove();
|
|
10747
10850
|
_this.hideCallback("cancel");
|
|
10748
|
-
_this.
|
|
10851
|
+
_this.Wfze();
|
|
10749
10852
|
} catch (e) {
|
|
10750
10853
|
console.log("Error \n ".concat(e, " \n occured while closing the video"));
|
|
10751
10854
|
}
|
|
@@ -10770,13 +10873,25 @@
|
|
|
10770
10873
|
_this.videoPlayer.appendChild(pipButton);
|
|
10771
10874
|
}
|
|
10772
10875
|
});
|
|
10773
|
-
|
|
10876
|
+
/**
|
|
10877
|
+
* @function hideVideoPlayer
|
|
10878
|
+
* @description Sets the visibility of the video player to hidden.
|
|
10879
|
+
*/
|
|
10880
|
+
_defineProperty(this, "uxdx", function () {
|
|
10774
10881
|
_this.videoPlayer.classList.add("apx-video-hide-elmt".concat(_this.cssPostFix));
|
|
10775
10882
|
});
|
|
10776
|
-
|
|
10883
|
+
/**
|
|
10884
|
+
* @function unhideVideoPlayer
|
|
10885
|
+
* @description Unhides video player.
|
|
10886
|
+
*/
|
|
10887
|
+
_defineProperty(this, "HMFI", function () {
|
|
10777
10888
|
_this.videoPlayer.classList.remove("apx-video-hide-elmt".concat(_this.cssPostFix));
|
|
10778
10889
|
});
|
|
10779
|
-
|
|
10890
|
+
/**
|
|
10891
|
+
* @function getVideoElement
|
|
10892
|
+
* @returns {HTMLElement} Video ekement
|
|
10893
|
+
*/
|
|
10894
|
+
_defineProperty(this, "XfLX", function () {
|
|
10780
10895
|
return _this.videoElement;
|
|
10781
10896
|
});
|
|
10782
10897
|
this.videoPlayer = null;
|
|
@@ -10825,7 +10940,7 @@
|
|
|
10825
10940
|
this.videoPlayer.style = "background-color:".concat(this.bg_color, ";");
|
|
10826
10941
|
|
|
10827
10942
|
// Video has a resolution, not deviating from the resolution set the height and width.
|
|
10828
|
-
this.
|
|
10943
|
+
this.jcAJ();
|
|
10829
10944
|
//Generate the styles and add them to the document head.
|
|
10830
10945
|
this._setVideoPlayerStyles();
|
|
10831
10946
|
//Set the position of the video player with in the 5 possible positions.
|
|
@@ -10833,26 +10948,18 @@
|
|
|
10833
10948
|
//Create a video element,set the source and add to the container.
|
|
10834
10949
|
this._setPlayerContent();
|
|
10835
10950
|
//Set the listeners on the video control buttons.
|
|
10836
|
-
this.
|
|
10951
|
+
this.tvXC();
|
|
10837
10952
|
//Attach listeners for the PIP toggle. i.e. for the PIP enter and PIP exit
|
|
10838
|
-
this.
|
|
10953
|
+
this.JVqR();
|
|
10839
10954
|
//Set the custom close and PIP controls. Not using the defaults from the html video element.
|
|
10840
10955
|
//Reason - We want to position them at the top right and left positions.
|
|
10841
|
-
this.
|
|
10956
|
+
this.CFBY();
|
|
10842
10957
|
//Generate and postion the CTA buttons on the video. By default hidden, visible only when video is completed
|
|
10843
10958
|
this._setButtons(BUTTON_CONTAINER_POSITION.CENTER);
|
|
10844
10959
|
//Hide the video player. Display it based on the video mode. Videoplayer for "video" mode and a direct PIP for "PIP" mode.
|
|
10845
|
-
this.
|
|
10960
|
+
this.uxdx();
|
|
10846
10961
|
document.body.appendChild(this.videoPlayer);
|
|
10847
10962
|
}
|
|
10848
|
-
|
|
10849
|
-
/**
|
|
10850
|
-
* @function _getHeightWidthFromResolution
|
|
10851
|
-
* @private
|
|
10852
|
-
* @description Sets the height and width of the video element.
|
|
10853
|
-
* For portrait - width is set to 50% of the screen and height is auto adjusted based on resolution.
|
|
10854
|
-
* For landscape - height is set to 50% of the screen and width is auto adjusted based on resolution.
|
|
10855
|
-
*/
|
|
10856
10963
|
}, {
|
|
10857
10964
|
key: "_setVideoPlayerStyles",
|
|
10858
10965
|
value:
|
|
@@ -10872,12 +10979,6 @@
|
|
|
10872
10979
|
document.head.appendChild(styleElement);
|
|
10873
10980
|
}
|
|
10874
10981
|
}
|
|
10875
|
-
|
|
10876
|
-
/**
|
|
10877
|
-
* @function _removeVideoPlayerStyles
|
|
10878
|
-
* @private
|
|
10879
|
-
* @description Removes the video player style element.
|
|
10880
|
-
*/
|
|
10881
10982
|
}, {
|
|
10882
10983
|
key: "_setVideoPlayerPosition",
|
|
10883
10984
|
value:
|
|
@@ -10937,12 +11038,6 @@
|
|
|
10937
11038
|
this.videoElement.appendChild(sourceElement);
|
|
10938
11039
|
this.videoPlayer.appendChild(this.videoElement);
|
|
10939
11040
|
}
|
|
10940
|
-
|
|
10941
|
-
/**
|
|
10942
|
-
* @function _setVideoControlListeners
|
|
10943
|
-
* @private
|
|
10944
|
-
* @description Attach listeners on the video controls
|
|
10945
|
-
*/
|
|
10946
11041
|
}, {
|
|
10947
11042
|
key: "_setButtons",
|
|
10948
11043
|
value:
|
|
@@ -10962,7 +11057,7 @@
|
|
|
10962
11057
|
try {
|
|
10963
11058
|
_this2.videoPlayer.remove();
|
|
10964
11059
|
_this2.hideCallback();
|
|
10965
|
-
_this2.
|
|
11060
|
+
_this2.Wfze();
|
|
10966
11061
|
} catch (e) {
|
|
10967
11062
|
console.log("Can't close the video player\n".concat(e));
|
|
10968
11063
|
}
|
|
@@ -10990,11 +11085,6 @@
|
|
|
10990
11085
|
this.videoPlayer.appendChild(buttons);
|
|
10991
11086
|
}
|
|
10992
11087
|
}
|
|
10993
|
-
|
|
10994
|
-
/**
|
|
10995
|
-
* @function hideVideoPlayer
|
|
10996
|
-
* @description Sets the visibility of the video player to hidden.
|
|
10997
|
-
*/
|
|
10998
11088
|
}], [{
|
|
10999
11089
|
key: "isAVideoBeingPlayed",
|
|
11000
11090
|
value: function isAVideoBeingPlayed() {
|
|
@@ -11026,11 +11116,6 @@
|
|
|
11026
11116
|
}
|
|
11027
11117
|
return showVideo;
|
|
11028
11118
|
}
|
|
11029
|
-
|
|
11030
|
-
/**
|
|
11031
|
-
* @function showVideoInApp
|
|
11032
|
-
* @description Shows the video InApp with the configured mode.
|
|
11033
|
-
*/
|
|
11034
11119
|
}]);
|
|
11035
11120
|
return VideoInApp;
|
|
11036
11121
|
}();
|
|
@@ -11038,13 +11123,13 @@
|
|
|
11038
11123
|
var RTM = /*#__PURE__*/_createClass(function RTM() {
|
|
11039
11124
|
var _this = this;
|
|
11040
11125
|
_classCallCheck(this, RTM);
|
|
11041
|
-
_defineProperty(this, "
|
|
11126
|
+
_defineProperty(this, "SvZF", {});
|
|
11042
11127
|
_defineProperty(this, "isShowingAction", false);
|
|
11043
11128
|
_defineProperty(this, "currentAction", null);
|
|
11044
|
-
_defineProperty(this, "version",
|
|
11129
|
+
_defineProperty(this, "version", 31);
|
|
11045
11130
|
_defineProperty(this, "isInitialised", false);
|
|
11046
11131
|
_defineProperty(this, "_eventsInDynamicText", {});
|
|
11047
|
-
_defineProperty(this, "
|
|
11132
|
+
_defineProperty(this, "PQYS", function () {
|
|
11048
11133
|
_this.isInitialised = true;
|
|
11049
11134
|
var oldPushState = history.pushState;
|
|
11050
11135
|
history.pushState = function pushState() {
|
|
@@ -11069,7 +11154,7 @@
|
|
|
11069
11154
|
});
|
|
11070
11155
|
_defineProperty(this, "show", function (uiJson, duration, uuid, name) {
|
|
11071
11156
|
if (!_this.isInitialised) {
|
|
11072
|
-
_this.
|
|
11157
|
+
_this.PQYS();
|
|
11073
11158
|
}
|
|
11074
11159
|
try {
|
|
11075
11160
|
// console.log("Showing action for uuid:", uuid, uiJson, this.currentAction);
|
|
@@ -11147,8 +11232,17 @@
|
|
|
11147
11232
|
_this.currentAction = null;
|
|
11148
11233
|
window.Apxor && window.Apxor.updateFlag && window.Apxor.updateFlag(false);
|
|
11149
11234
|
});
|
|
11150
|
-
VideoInAppInstance.
|
|
11235
|
+
VideoInAppInstance.MOZi();
|
|
11151
11236
|
});
|
|
11237
|
+
/**
|
|
11238
|
+
* Creates a modal for the given config and displays it.
|
|
11239
|
+
* Supported Modals are "small-text","medium-text","large-text","icon-text","image-text","image-only","custom-size-text","video-text"
|
|
11240
|
+
* @param {JSON} inappconfig
|
|
11241
|
+
* @param {string} configId
|
|
11242
|
+
* @param {string} name
|
|
11243
|
+
* @param {function} showCallback
|
|
11244
|
+
* @param {function} closeCallback
|
|
11245
|
+
*/
|
|
11152
11246
|
_defineProperty(this, "createInAppModal", function (inappconfig, configId, name) {
|
|
11153
11247
|
var config = JSON.parse(inappconfig);
|
|
11154
11248
|
var inappModal = new ModalInApp(config, configId, name, function () {
|
|
@@ -11173,7 +11267,11 @@
|
|
|
11173
11267
|
}, function () {}, false, [], 0);
|
|
11174
11268
|
inappModal.createInAppModal();
|
|
11175
11269
|
});
|
|
11176
|
-
})
|
|
11270
|
+
} // createSurvey = (config, configId, name) => {
|
|
11271
|
+
// const survey_obj = new NewSurveys(configId, name, config, []);
|
|
11272
|
+
// survey_obj.createSurvey();
|
|
11273
|
+
// };
|
|
11274
|
+
);
|
|
11177
11275
|
|
|
11178
11276
|
/* eslint-disable no-empty */
|
|
11179
11277
|
var rtm = new RTM();
|
|
@@ -11187,4 +11285,4 @@
|
|
|
11187
11285
|
|
|
11188
11286
|
return rtm;
|
|
11189
11287
|
|
|
11190
|
-
}))
|
|
11288
|
+
}));
|