dialogshift-webchat-sdk 2.3.16 → 2.9.3-develop.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/README.md +20 -18
- package/bundles/dialogshift-webchat-sdk.min.css +1 -3
- package/bundles/dialogshift-webchat-sdk.min.css.map +1 -29
- package/bundles/dialogshift-webchat-sdk.umd.js +1092 -570
- package/bundles/dialogshift-webchat-sdk.umd.js.map +1 -1
- package/dist/config/config.d.ts +5 -0
- package/dist/config/config.js +7 -2
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.dev.js +2 -2
- package/dist/config/env.dev.js.map +1 -1
- package/dist/config/env.js +4 -4
- package/dist/config/env.js.map +1 -1
- package/dist/config/env.prod.js +2 -2
- package/dist/config/env.stage.js +2 -2
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +5 -0
- package/dist/consts.js.map +1 -0
- package/dist/core/app.d.ts +10 -1
- package/dist/core/app.js +104 -45
- package/dist/core/app.js.map +1 -1
- package/dist/core/base-widget.d.ts +1 -1
- package/dist/core/base-widget.js +19 -15
- package/dist/core/base-widget.js.map +1 -1
- package/dist/core/event-emitter.d.ts +1 -1
- package/dist/core/event-emitter.js +1 -1
- package/dist/core/event-emitter.js.map +1 -1
- package/dist/core/facade.d.ts +1 -0
- package/dist/core/facade.js +11 -3
- package/dist/core/facade.js.map +1 -1
- package/dist/core/observable.js +4 -2
- package/dist/core/observable.js.map +1 -1
- package/dist/core/utils.d.ts +2 -1
- package/dist/core/utils.js +37 -27
- package/dist/core/utils.js.map +1 -1
- package/dist/core/widget-manager.d.ts +12 -3
- package/dist/core/widget-manager.js +129 -55
- package/dist/core/widget-manager.js.map +1 -1
- package/dist/enums.d.ts +4 -0
- package/dist/enums.js +9 -0
- package/dist/enums.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/models/action-button.js +4 -4
- package/dist/models/action-button.js.map +1 -1
- package/dist/models/index.js +7 -3
- package/dist/models/index.js.map +1 -1
- package/dist/services/api.service.d.ts +1 -1
- package/dist/services/api.service.js +23 -17
- package/dist/services/api.service.js.map +1 -1
- package/dist/services/audio.service.js +3 -3
- package/dist/services/audio.service.js.map +1 -1
- package/dist/services/cookie.service.js +6 -6
- package/dist/services/cookie.service.js.map +1 -1
- package/dist/services/ga.service.d.ts +3 -0
- package/dist/services/ga.service.js +20 -0
- package/dist/services/ga.service.js.map +1 -0
- package/dist/services/http.service.js +4 -4
- package/dist/services/http.service.js.map +1 -1
- package/dist/services/index.js +7 -3
- package/dist/services/index.js.map +1 -1
- package/dist/services/token.service.js +7 -8
- package/dist/services/token.service.js.map +1 -1
- package/dist/services/user.service.d.ts +8 -0
- package/dist/services/user.service.js +107 -15
- package/dist/services/user.service.js.map +1 -1
- package/dist/services/webchat.service.js +3 -3
- package/dist/services/webchat.service.js.map +1 -1
- package/dist/types.js +1 -1
- package/dist/widgets/action-button-group.widget.d.ts +2 -0
- package/dist/widgets/action-button-group.widget.js +8 -3
- package/dist/widgets/action-button-group.widget.js.map +1 -1
- package/dist/widgets/action-button.widget.d.ts +1 -0
- package/dist/widgets/action-button.widget.js +14 -8
- package/dist/widgets/action-button.widget.js.map +1 -1
- package/dist/widgets/chat-button.widget.d.ts +1 -1
- package/dist/widgets/chat-button.widget.js +17 -6
- package/dist/widgets/chat-button.widget.js.map +1 -1
- package/dist/widgets/chatbox.widget.d.ts +1 -1
- package/dist/widgets/chatbox.widget.js +7 -3
- package/dist/widgets/chatbox.widget.js.map +1 -1
- package/dist/widgets/content-wrapper.widget.js +4 -2
- package/dist/widgets/content-wrapper.widget.js.map +1 -1
- package/dist/widgets/footer.widget.d.ts +5 -0
- package/dist/widgets/footer.widget.js +34 -0
- package/dist/widgets/footer.widget.js.map +1 -0
- package/dist/widgets/header/header-close-button.widget.d.ts +12 -0
- package/dist/widgets/header/header-close-button.widget.js +48 -0
- package/dist/widgets/header/header-close-button.widget.js.map +1 -0
- package/dist/widgets/header/header.widget.d.ts +16 -0
- package/dist/widgets/header/header.widget.js +51 -0
- package/dist/widgets/header/header.widget.js.map +1 -0
- package/dist/widgets/iframe-box.widget.js +9 -10
- package/dist/widgets/iframe-box.widget.js.map +1 -1
- package/dist/widgets/iframe.widget.d.ts +3 -2
- package/dist/widgets/iframe.widget.js +12 -8
- package/dist/widgets/iframe.widget.js.map +1 -1
- package/dist/widgets/index.d.ts +2 -0
- package/dist/widgets/index.js +9 -3
- package/dist/widgets/index.js.map +1 -1
- package/dist/widgets/teaser.widget.d.ts +4 -1
- package/dist/widgets/teaser.widget.js +46 -9
- package/dist/widgets/teaser.widget.js.map +1 -1
- package/dist/widgets/unread.widget.js +4 -2
- package/dist/widgets/unread.widget.js.map +1 -1
- package/dist/widgets/whatsapp-button.widget.d.ts +8 -1
- package/dist/widgets/whatsapp-button.widget.js +18 -4
- package/dist/widgets/whatsapp-button.widget.js.map +1 -1
- package/dist/widgets/whatsapp-window.widget.d.ts +1 -3
- package/dist/widgets/whatsapp-window.widget.js +22 -28
- package/dist/widgets/whatsapp-window.widget.js.map +1 -1
- package/dist/widgets/wrapper.widget.js +5 -3
- package/dist/widgets/wrapper.widget.js.map +1 -1
- package/package.json +26 -22
|
@@ -1,103 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/******/ (
|
|
4
|
-
/******/ // The module cache
|
|
5
|
-
/******/ var installedModules = {};
|
|
6
|
-
/******/
|
|
7
|
-
/******/ // The require function
|
|
8
|
-
/******/ function __webpack_require__(moduleId) {
|
|
9
|
-
/******/
|
|
10
|
-
/******/ // Check if module is in cache
|
|
11
|
-
/******/ if(installedModules[moduleId]) {
|
|
12
|
-
/******/ return installedModules[moduleId].exports;
|
|
13
|
-
/******/ }
|
|
14
|
-
/******/ // Create a new module (and put it into the cache)
|
|
15
|
-
/******/ var module = installedModules[moduleId] = {
|
|
16
|
-
/******/ i: moduleId,
|
|
17
|
-
/******/ l: false,
|
|
18
|
-
/******/ exports: {}
|
|
19
|
-
/******/ };
|
|
20
|
-
/******/
|
|
21
|
-
/******/ // Execute the module function
|
|
22
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
23
|
-
/******/
|
|
24
|
-
/******/ // Flag the module as loaded
|
|
25
|
-
/******/ module.l = true;
|
|
26
|
-
/******/
|
|
27
|
-
/******/ // Return the exports of the module
|
|
28
|
-
/******/ return module.exports;
|
|
29
|
-
/******/ }
|
|
30
|
-
/******/
|
|
31
|
-
/******/
|
|
32
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
33
|
-
/******/ __webpack_require__.m = modules;
|
|
34
|
-
/******/
|
|
35
|
-
/******/ // expose the module cache
|
|
36
|
-
/******/ __webpack_require__.c = installedModules;
|
|
37
|
-
/******/
|
|
38
|
-
/******/ // define getter function for harmony exports
|
|
39
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
40
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
41
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
42
|
-
/******/ }
|
|
43
|
-
/******/ };
|
|
44
|
-
/******/
|
|
45
|
-
/******/ // define __esModule on exports
|
|
46
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
47
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
48
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
49
|
-
/******/ }
|
|
50
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
51
|
-
/******/ };
|
|
52
|
-
/******/
|
|
53
|
-
/******/ // create a fake namespace object
|
|
54
|
-
/******/ // mode & 1: value is a module id, require it
|
|
55
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
56
|
-
/******/ // mode & 4: return value when already ns object
|
|
57
|
-
/******/ // mode & 8|1: behave like require
|
|
58
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
59
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
60
|
-
/******/ if(mode & 8) return value;
|
|
61
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
62
|
-
/******/ var ns = Object.create(null);
|
|
63
|
-
/******/ __webpack_require__.r(ns);
|
|
64
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
65
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
66
|
-
/******/ return ns;
|
|
67
|
-
/******/ };
|
|
68
|
-
/******/
|
|
69
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
70
|
-
/******/ __webpack_require__.n = function(module) {
|
|
71
|
-
/******/ var getter = module && module.__esModule ?
|
|
72
|
-
/******/ function getDefault() { return module['default']; } :
|
|
73
|
-
/******/ function getModuleExports() { return module; };
|
|
74
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
75
|
-
/******/ return getter;
|
|
76
|
-
/******/ };
|
|
77
|
-
/******/
|
|
78
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
79
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
80
|
-
/******/
|
|
81
|
-
/******/ // __webpack_public_path__
|
|
82
|
-
/******/ __webpack_require__.p = "";
|
|
83
|
-
/******/
|
|
84
|
-
/******/
|
|
85
|
-
/******/ // Load entry module and return exports
|
|
86
|
-
/******/ return __webpack_require__(__webpack_require__.s = "./src/scripts/index.ts");
|
|
87
|
-
/******/ })
|
|
88
|
-
/************************************************************************/
|
|
89
|
-
/******/ ({
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
90
4
|
|
|
91
5
|
/***/ "./src/scripts/config/config.ts":
|
|
92
6
|
/*!**************************************!*\
|
|
93
7
|
!*** ./src/scripts/config/config.ts ***!
|
|
94
8
|
\**************************************/
|
|
95
|
-
|
|
96
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
97
10
|
|
|
98
|
-
"use strict";
|
|
99
11
|
__webpack_require__.r(__webpack_exports__);
|
|
100
|
-
/* harmony export
|
|
12
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13
|
+
/* harmony export */ config: () => (/* binding */ config)
|
|
14
|
+
/* harmony export */ });
|
|
101
15
|
/* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env */ "./src/scripts/config/env.ts");
|
|
102
16
|
|
|
103
17
|
var config = {
|
|
@@ -113,8 +27,10 @@ var config = {
|
|
|
113
27
|
contentWrapperCls: 'ds-content-wrapper',
|
|
114
28
|
buttonCls: 'ds-button',
|
|
115
29
|
buttonLogoCls: 'ds-button--logo',
|
|
30
|
+
buttonIconContainerCls: 'ds-button--icon-container',
|
|
116
31
|
buttonWithTextCls: 'ds-button--with-text',
|
|
117
32
|
buttonActiveCls: 'ds-button--active',
|
|
33
|
+
buttonHiddenCls: 'ds-button--hidden',
|
|
118
34
|
chatCls: 'ds-chat',
|
|
119
35
|
chatLoaderCls: 'ds-chat-loader',
|
|
120
36
|
chatLoaderImageCls: 'ds-chat-loader-image',
|
|
@@ -130,7 +46,10 @@ var config = {
|
|
|
130
46
|
themeTile: 'ds-theme-tile',
|
|
131
47
|
actionButtonGroupCls: 'ds-action-button-group',
|
|
132
48
|
actionButtonCls: 'ds-action-button',
|
|
133
|
-
|
|
49
|
+
headerCls: 'ds-header',
|
|
50
|
+
headerCloseButtonCls: 'ds-header-close-button',
|
|
51
|
+
headerCloseButtonLeftCls: 'ds-header-close-button--left',
|
|
52
|
+
env: _env__WEBPACK_IMPORTED_MODULE_0__.environment,
|
|
134
53
|
};
|
|
135
54
|
|
|
136
55
|
|
|
@@ -140,40 +59,56 @@ var config = {
|
|
|
140
59
|
/*!***********************************!*\
|
|
141
60
|
!*** ./src/scripts/config/env.ts ***!
|
|
142
61
|
\***********************************/
|
|
143
|
-
|
|
144
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
62
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
145
63
|
|
|
146
|
-
"use strict";
|
|
147
64
|
__webpack_require__.r(__webpack_exports__);
|
|
148
|
-
/* harmony export
|
|
65
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
66
|
+
/* harmony export */ environment: () => (/* binding */ environment)
|
|
67
|
+
/* harmony export */ });
|
|
149
68
|
var environment = {
|
|
150
|
-
coreApiEndpoint: 'https://core.
|
|
151
|
-
ibeApiEndpoint: 'https://ibe.
|
|
152
|
-
iframeHost: 'https://webchat.dialogshift.com',
|
|
69
|
+
coreApiEndpoint: 'https://core.dev.co25.net',
|
|
70
|
+
ibeApiEndpoint: 'https://ibe.dev.co25.net',
|
|
71
|
+
iframeHost: 'https://webchat.dev.dialogshift.com',
|
|
153
72
|
};
|
|
154
73
|
|
|
155
74
|
|
|
75
|
+
/***/ }),
|
|
76
|
+
|
|
77
|
+
/***/ "./src/scripts/consts.ts":
|
|
78
|
+
/*!*******************************!*\
|
|
79
|
+
!*** ./src/scripts/consts.ts ***!
|
|
80
|
+
\*******************************/
|
|
81
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
82
|
+
|
|
83
|
+
__webpack_require__.r(__webpack_exports__);
|
|
84
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
85
|
+
/* harmony export */ iconSvg: () => (/* binding */ iconSvg)
|
|
86
|
+
/* harmony export */ });
|
|
87
|
+
var iconSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" stroke="currentColor" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.549805 10.8695C0.549805 5.16744 5.84902 0.549988 12.3568 0.549988C18.8646 0.549988 24.1329 5.16744 24.1329 10.9005C24.1329 16.6336 18.8646 21.251 12.3568 21.251C10.0016 21.251 7.80137 20.6312 5.94199 19.5776C4.26855 20.5693 2.47116 20.5383 1.4485 20.3833C1.13861 20.3523 1.07663 19.9495 1.32454 19.7945C2.3472 19.1437 2.87402 18.2141 3.18392 17.3773C1.54147 15.6109 0.549805 13.3487 0.549805 10.8695ZM29.4631 28.5646C29.711 28.5336 29.773 28.2237 29.5561 28.0687C28.6883 27.5109 28.2235 26.7362 27.9756 26.0544C29.3391 24.5669 30.1449 22.7075 30.1449 20.6622C30.1449 17.7182 28.4404 15.0841 25.8373 13.5346C24.5048 19.0818 18.9576 23.2654 12.3568 23.2654C11.892 23.2654 11.4271 23.2344 10.9933 23.2034C12.2329 26.7052 15.9516 29.2773 20.3831 29.2773C22.3355 29.2773 24.1639 28.7815 25.7133 27.8828C27.1079 28.7195 28.5954 28.6885 29.4631 28.5646Z"/><mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="31" height="30"><path fill-rule="evenodd" clip-rule="evenodd" d="M0.549805 10.8695C0.549805 5.16744 5.84902 0.549988 12.3568 0.549988C18.8646 0.549988 24.1329 5.16744 24.1329 10.9005C24.1329 16.6336 18.8646 21.251 12.3568 21.251C10.0016 21.251 7.80137 20.6312 5.94199 19.5776C4.26855 20.5693 2.47116 20.5383 1.4485 20.3833C1.13861 20.3523 1.07663 19.9495 1.32454 19.7945C2.3472 19.1437 2.87402 18.2141 3.18392 17.3773C1.54147 15.6109 0.549805 13.3487 0.549805 10.8695ZM29.4631 28.5646C29.711 28.5336 29.773 28.2237 29.5561 28.0687C28.6883 27.5109 28.2235 26.7362 27.9756 26.0544C29.3391 24.5669 30.1449 22.7075 30.1449 20.6622C30.1449 17.7182 28.4404 15.0841 25.8373 13.5346C24.5048 19.0818 18.9576 23.2654 12.3568 23.2654C11.892 23.2654 11.4271 23.2344 10.9933 23.2034C12.2329 26.7052 15.9516 29.2773 20.3831 29.2773C22.3355 29.2773 24.1639 28.7815 25.7133 27.8828C27.1079 28.7195 28.5954 28.6885 29.4631 28.5646Z"/></mask><g mask="url(#mask0)"/></svg>';
|
|
88
|
+
|
|
89
|
+
|
|
156
90
|
/***/ }),
|
|
157
91
|
|
|
158
92
|
/***/ "./src/scripts/core/app.ts":
|
|
159
93
|
/*!*********************************!*\
|
|
160
94
|
!*** ./src/scripts/core/app.ts ***!
|
|
161
95
|
\*********************************/
|
|
162
|
-
|
|
163
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
96
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
164
97
|
|
|
165
|
-
"use strict";
|
|
166
98
|
__webpack_require__.r(__webpack_exports__);
|
|
167
|
-
/* harmony export
|
|
168
|
-
/* harmony export
|
|
169
|
-
/* harmony export
|
|
170
|
-
/* harmony export
|
|
171
|
-
/* harmony export
|
|
99
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
100
|
+
/* harmony export */ ActionEventName: () => (/* binding */ ActionEventName),
|
|
101
|
+
/* harmony export */ ActionEventType: () => (/* binding */ ActionEventType),
|
|
102
|
+
/* harmony export */ App: () => (/* binding */ App),
|
|
103
|
+
/* harmony export */ AppTheme: () => (/* binding */ AppTheme),
|
|
104
|
+
/* harmony export */ ChatPosition: () => (/* binding */ ChatPosition)
|
|
105
|
+
/* harmony export */ });
|
|
172
106
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
173
107
|
/* harmony import */ var _event_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event-emitter */ "./src/scripts/core/event-emitter.ts");
|
|
174
108
|
/* harmony import */ var _widget_manager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widget-manager */ "./src/scripts/core/widget-manager.ts");
|
|
175
109
|
/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services */ "./src/scripts/services/index.ts");
|
|
176
110
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./src/scripts/core/utils.ts");
|
|
111
|
+
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums */ "./src/scripts/enums.ts");
|
|
177
112
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
178
113
|
__assign = Object.assign || function(t) {
|
|
179
114
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -190,6 +125,7 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
190
125
|
|
|
191
126
|
|
|
192
127
|
|
|
128
|
+
|
|
193
129
|
var ChatPosition;
|
|
194
130
|
(function (ChatPosition) {
|
|
195
131
|
ChatPosition["left"] = "left";
|
|
@@ -217,6 +153,10 @@ var appOptionsDefault = {
|
|
|
217
153
|
unreadCounter: 0,
|
|
218
154
|
context: {},
|
|
219
155
|
direction: 'ltr',
|
|
156
|
+
showInIframe: false,
|
|
157
|
+
custidStoreMode: _enums__WEBPACK_IMPORTED_MODULE_5__.CustidStoreMode.cookie,
|
|
158
|
+
loadGaContext: false,
|
|
159
|
+
leftCloseButton: false,
|
|
220
160
|
};
|
|
221
161
|
var ActionEventType;
|
|
222
162
|
(function (ActionEventType) {
|
|
@@ -231,6 +171,7 @@ var ActionEventName;
|
|
|
231
171
|
ActionEventName["setTeaserText"] = "set.teaser.text";
|
|
232
172
|
ActionEventName["showChatbox"] = "show.chatbox";
|
|
233
173
|
ActionEventName["hideChatbox"] = "hide.chatbox";
|
|
174
|
+
ActionEventName["showWhatsApp"] = "show.whatsApp";
|
|
234
175
|
})(ActionEventName || (ActionEventName = {}));
|
|
235
176
|
var App = /** @class */ (function () {
|
|
236
177
|
function App(options) {
|
|
@@ -243,21 +184,22 @@ var App = /** @class */ (function () {
|
|
|
243
184
|
if (!options.id) {
|
|
244
185
|
throw Error('Dialogshift app id is undefined.');
|
|
245
186
|
}
|
|
246
|
-
this.options =
|
|
247
|
-
this.broadcast = new _event_emitter__WEBPACK_IMPORTED_MODULE_1__
|
|
248
|
-
this.widgetManager = new _widget_manager__WEBPACK_IMPORTED_MODULE_2__
|
|
187
|
+
this.options = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.mergeDeep)(appOptionsDefault, options);
|
|
188
|
+
this.broadcast = new _event_emitter__WEBPACK_IMPORTED_MODULE_1__.EventEmitter();
|
|
189
|
+
this.widgetManager = new _widget_manager__WEBPACK_IMPORTED_MODULE_2__.WidgetManager(this);
|
|
249
190
|
this.init();
|
|
250
191
|
}
|
|
251
192
|
App.prototype.init = function () {
|
|
252
193
|
var _this = this;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
256
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
194
|
+
this.options.context['hostUrl'] = encodeURI(window.location.href);
|
|
195
|
+
if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.parseUrlParam)(window.location.href, 'ctrl') === 'forcenew') {
|
|
196
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.UserService.deleteUser();
|
|
197
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.TokenService.deleteToken();
|
|
198
|
+
// CookieService.delete('ds-keep-chat-open')
|
|
199
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_4__.removeURLParameters)(['ctrl']);
|
|
200
|
+
}
|
|
201
|
+
var openUrlParam = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.parseUrlParam)(window.location.href, 'dschat');
|
|
202
|
+
if (openUrlParam === 'open' && window.innerWidth > 576) {
|
|
261
203
|
this.options.isChatboxVisible = true;
|
|
262
204
|
}
|
|
263
205
|
this.loadConfig().then(function () {
|
|
@@ -269,7 +211,7 @@ var App = /** @class */ (function () {
|
|
|
269
211
|
if (_this.chatConfig.csrfAfter) {
|
|
270
212
|
csrfAfter = _this.chatConfig.csrfAfter;
|
|
271
213
|
}
|
|
272
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
214
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.TokenService.touchToken(_this.options.id, csrfAfter).then(function (token) {
|
|
273
215
|
_this.csrfToken = token;
|
|
274
216
|
});
|
|
275
217
|
_this.afterInit();
|
|
@@ -289,14 +231,22 @@ var App = /** @class */ (function () {
|
|
|
289
231
|
}, 20);
|
|
290
232
|
};
|
|
291
233
|
App.prototype.initWebchatService = function () {
|
|
292
|
-
this.webchatService = new _services__WEBPACK_IMPORTED_MODULE_3__
|
|
234
|
+
this.webchatService = new _services__WEBPACK_IMPORTED_MODULE_3__.WebchatService({
|
|
293
235
|
targetWindow: this.widgetManager.getIframeWidget().getBoxElem(),
|
|
294
236
|
});
|
|
295
237
|
};
|
|
296
238
|
App.prototype.render = function () {
|
|
297
239
|
var _this = this;
|
|
298
|
-
this.
|
|
240
|
+
var isWidgetManagerVisible = this.options.showInIframe
|
|
241
|
+
? true
|
|
242
|
+
: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.inIframe)()
|
|
243
|
+
? false
|
|
244
|
+
: true;
|
|
245
|
+
this.widgetManager.renderWrapper(Object.assign({}, this.options, {
|
|
246
|
+
visible: isWidgetManagerVisible,
|
|
247
|
+
}));
|
|
299
248
|
this.widgetManager.renderContentWrapper();
|
|
249
|
+
this.widgetManager.renderFooter();
|
|
300
250
|
if (this.options.renderButton) {
|
|
301
251
|
this.widgetManager.renderChatButton(this.options, this.chatConfig);
|
|
302
252
|
}
|
|
@@ -305,6 +255,7 @@ var App = /** @class */ (function () {
|
|
|
305
255
|
this.widgetManager.renderChatboxWidget(this.options, function () {
|
|
306
256
|
_this.loadChat();
|
|
307
257
|
});
|
|
258
|
+
this.widgetManager.renderHeader(this.options);
|
|
308
259
|
this.widgetManager.renderUnreadWidget(this.options, this.chatConfig);
|
|
309
260
|
if (this.options.renderWaButton) {
|
|
310
261
|
this.widgetManager.renderWhatsappButtonWidget(this.chatConfig);
|
|
@@ -331,22 +282,23 @@ var App = /** @class */ (function () {
|
|
|
331
282
|
_this.widgetManager.getTeaserWidget().hide();
|
|
332
283
|
}, hideTeaserAfter * 1000);
|
|
333
284
|
}
|
|
334
|
-
if (
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
})
|
|
344
|
-
|
|
285
|
+
/* if (CookieService.get('keep-chat-open') === 'true') {
|
|
286
|
+
this.setInitialElement({
|
|
287
|
+
suppress: true,
|
|
288
|
+
})
|
|
289
|
+
this.loadChat()
|
|
290
|
+
|
|
291
|
+
this.getBroadcast().once('ready', () => {
|
|
292
|
+
setTimeout(() => {
|
|
293
|
+
this.webchatService.setMinimized(true)
|
|
294
|
+
}, 250)
|
|
295
|
+
})
|
|
296
|
+
} */
|
|
345
297
|
};
|
|
346
298
|
App.prototype.bindEvents = function () {
|
|
347
299
|
var _this = this;
|
|
348
300
|
window.addEventListener('message', function (event) {
|
|
349
|
-
if (event.origin === _config_config__WEBPACK_IMPORTED_MODULE_0__
|
|
301
|
+
if (event.origin === _config_config__WEBPACK_IMPORTED_MODULE_0__.config.env.iframeHost) {
|
|
350
302
|
var message_1 = event.data;
|
|
351
303
|
if (message_1.type === ActionEventType.message) {
|
|
352
304
|
_this.broadcast.fire(message_1.name, message_1.payload);
|
|
@@ -381,23 +333,31 @@ var App = /** @class */ (function () {
|
|
|
381
333
|
});
|
|
382
334
|
this.broadcast.on('command.receive', function (event) {
|
|
383
335
|
var commandModel = event.data;
|
|
384
|
-
if (commandModel.commandType === '
|
|
385
|
-
|
|
386
|
-
_this.chatConfig.keepChatOpenDuringLivechat) {
|
|
387
|
-
_services__WEBPACK_IMPORTED_MODULE_3__["CookieService"].set('keep-chat-open', 'true');
|
|
388
|
-
}
|
|
389
|
-
if (commandModel.action === 'end') {
|
|
390
|
-
_services__WEBPACK_IMPORTED_MODULE_3__["CookieService"].set('keep-chat-open', 'false');
|
|
391
|
-
}
|
|
336
|
+
if (commandModel.commandType === 'receivedCookieConsent') {
|
|
337
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.UserService.switchToCookieModeAfterConsent();
|
|
392
338
|
}
|
|
339
|
+
else if (commandModel.commandType === 'dismissCookieConsent') {
|
|
340
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.UserService.switchToSessionModeAfterConsentDismiss();
|
|
341
|
+
} /* else if (commandModel.commandType === 'livechat') {
|
|
342
|
+
if (
|
|
343
|
+
commandModel.action === 'start' &&
|
|
344
|
+
this.chatConfig.keepChatOpenDuringLivechat
|
|
345
|
+
) {
|
|
346
|
+
CookieService.set('keep-chat-open', 'true')
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (commandModel.action === 'end') {
|
|
350
|
+
CookieService.set('keep-chat-open', 'false')
|
|
351
|
+
}
|
|
352
|
+
} */
|
|
393
353
|
});
|
|
394
354
|
};
|
|
395
355
|
App.prototype.proceedActionEvent = function (message) {
|
|
396
356
|
if (message.name === ActionEventName.tabOpen) {
|
|
397
357
|
var url = message.payload.targetUrl;
|
|
398
358
|
if (message.payload.urlType === 'openSameTab') {
|
|
399
|
-
if (!
|
|
400
|
-
url += (url.split('?')[1] ? '&' : '?'
|
|
359
|
+
if (!(0,_utils__WEBPACK_IMPORTED_MODULE_4__.isExternalUrl)(url)) {
|
|
360
|
+
url += "".concat(url.split('?')[1] ? '&' : '?', "dschat=open");
|
|
401
361
|
}
|
|
402
362
|
window.open(url, '_self');
|
|
403
363
|
}
|
|
@@ -417,27 +377,33 @@ var App = /** @class */ (function () {
|
|
|
417
377
|
if (message.name === ActionEventName.hideChatbox) {
|
|
418
378
|
this.widgetManager.getChatboxWidget().hide();
|
|
419
379
|
}
|
|
380
|
+
if (message.name === ActionEventName.showWhatsApp) {
|
|
381
|
+
this.widgetManager.getWhatsappWindowWidget().show();
|
|
382
|
+
}
|
|
420
383
|
};
|
|
421
384
|
App.prototype.loadConfig = function () {
|
|
422
385
|
var _this = this;
|
|
423
386
|
var channel = this.options.context.channel
|
|
424
387
|
? this.options.context.channel
|
|
425
388
|
: 'pwa-embed';
|
|
426
|
-
return _services__WEBPACK_IMPORTED_MODULE_3__
|
|
389
|
+
return _services__WEBPACK_IMPORTED_MODULE_3__.ApiService.getConfig(this.options.id, _services__WEBPACK_IMPORTED_MODULE_3__.UserService.getCustomerId(), window.location.host, window.location.pathname, channel).then(function (data) {
|
|
427
390
|
_this.chatConfig = data;
|
|
428
391
|
if (data.websiteElementCss) {
|
|
429
|
-
|
|
392
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_4__.injectCss)(data.websiteElementCss);
|
|
430
393
|
}
|
|
431
394
|
if (_this.chatConfig.defaultLg) {
|
|
432
395
|
_this.chatConfig.defaultLocale = _this.chatConfig.defaultLg;
|
|
433
396
|
delete _this.chatConfig.defaultLg;
|
|
434
397
|
}
|
|
398
|
+
if (_this.chatConfig.channelOverride) {
|
|
399
|
+
_this.options.context.channel = _this.chatConfig.channelOverride;
|
|
400
|
+
}
|
|
435
401
|
_this.applyConfig();
|
|
436
402
|
return _this.chatConfig;
|
|
437
403
|
});
|
|
438
404
|
};
|
|
439
405
|
App.prototype.applyConfig = function () {
|
|
440
|
-
var _a = this.chatConfig, setUnreadCounter = _a.setUnreadCounter, showTeaserAfter = _a.showTeaserAfter, hideTeaserAfter = _a.hideTeaserAfter, theme = _a.theme, noCookieModeSdk = _a.noCookieModeSdk, forgetCustomerAfterHours = _a.forgetCustomerAfterHours, isChatboxVisible = _a.isChatboxVisible, renderWaButton = _a.renderWaButton, extendedWidth = _a.extendedWidth;
|
|
406
|
+
var _a = this.chatConfig, setUnreadCounter = _a.setUnreadCounter, showTeaserAfter = _a.showTeaserAfter, hideTeaserAfter = _a.hideTeaserAfter, theme = _a.theme, noCookieModeSdk = _a.noCookieModeSdk, forgetCustomerAfterHours = _a.forgetCustomerAfterHours, isChatboxVisible = _a.isChatboxVisible, renderWaButton = _a.renderWaButton, extendedWidth = _a.extendedWidth, bwWaButton = _a.bwWaButton, custidStoreMode = _a.custidStoreMode, loadGaContext = _a.loadGaContext, leftCloseButton = _a.leftCloseButton;
|
|
441
407
|
if (setUnreadCounter) {
|
|
442
408
|
this.options.unreadCounter = setUnreadCounter;
|
|
443
409
|
}
|
|
@@ -454,10 +420,10 @@ var App = /** @class */ (function () {
|
|
|
454
420
|
this.options.theme = theme;
|
|
455
421
|
}
|
|
456
422
|
if (noCookieModeSdk === true) {
|
|
457
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
423
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.CookieService.noCookieMode = true;
|
|
458
424
|
}
|
|
459
425
|
if (forgetCustomerAfterHours) {
|
|
460
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
426
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.UserService.updateCookieLifetime(forgetCustomerAfterHours);
|
|
461
427
|
}
|
|
462
428
|
if (renderWaButton) {
|
|
463
429
|
this.options.renderWaButton = renderWaButton;
|
|
@@ -465,6 +431,20 @@ var App = /** @class */ (function () {
|
|
|
465
431
|
if (extendedWidth) {
|
|
466
432
|
this.options.extendedWidth = extendedWidth;
|
|
467
433
|
}
|
|
434
|
+
if (bwWaButton) {
|
|
435
|
+
this.options.bwWaButton = bwWaButton;
|
|
436
|
+
}
|
|
437
|
+
if (custidStoreMode) {
|
|
438
|
+
this.options.custidStoreMode = custidStoreMode;
|
|
439
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.UserService.custidStoreMode = custidStoreMode;
|
|
440
|
+
}
|
|
441
|
+
if (loadGaContext) {
|
|
442
|
+
this.options.loadGaContext = loadGaContext;
|
|
443
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.UserService.loadGaContext = loadGaContext;
|
|
444
|
+
}
|
|
445
|
+
if (leftCloseButton) {
|
|
446
|
+
this.options.leftCloseButton = leftCloseButton;
|
|
447
|
+
}
|
|
468
448
|
};
|
|
469
449
|
App.prototype.getWebchatService = function () {
|
|
470
450
|
return this.webchatService;
|
|
@@ -477,8 +457,8 @@ var App = /** @class */ (function () {
|
|
|
477
457
|
};
|
|
478
458
|
App.prototype.getContext = function (key) {
|
|
479
459
|
return new Promise(function (resolve, reject) {
|
|
480
|
-
if (_services__WEBPACK_IMPORTED_MODULE_3__
|
|
481
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
460
|
+
if (_services__WEBPACK_IMPORTED_MODULE_3__.UserService.getCustomerId()) {
|
|
461
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.ApiService.getContext(_services__WEBPACK_IMPORTED_MODULE_3__.UserService.getCustomerId(), key).then(resolve, reject);
|
|
482
462
|
}
|
|
483
463
|
else {
|
|
484
464
|
reject('Can not load context. Customer is not created.');
|
|
@@ -488,8 +468,8 @@ var App = /** @class */ (function () {
|
|
|
488
468
|
App.prototype.setContext = function (key, value) {
|
|
489
469
|
var _this = this;
|
|
490
470
|
return new Promise(function (resolve, reject) {
|
|
491
|
-
if (_services__WEBPACK_IMPORTED_MODULE_3__
|
|
492
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
471
|
+
if (_services__WEBPACK_IMPORTED_MODULE_3__.UserService.getCustomerId()) {
|
|
472
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.ApiService.setContext(_services__WEBPACK_IMPORTED_MODULE_3__.UserService.getCustomerId(), key, value).then(resolve, reject);
|
|
493
473
|
}
|
|
494
474
|
else {
|
|
495
475
|
_this.options.context[key] = value;
|
|
@@ -500,7 +480,7 @@ var App = /** @class */ (function () {
|
|
|
500
480
|
return this.chatConfig;
|
|
501
481
|
};
|
|
502
482
|
App.prototype.setInitialElement = function (initialElement) {
|
|
503
|
-
var mergedInitialElement =
|
|
483
|
+
var mergedInitialElement = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.mergeDeep)(this.options.initialElement, initialElement);
|
|
504
484
|
this.options.initialElement = mergedInitialElement;
|
|
505
485
|
if (this.widgetManager.getIframeWidget()) {
|
|
506
486
|
this.widgetManager
|
|
@@ -567,7 +547,7 @@ var App = /** @class */ (function () {
|
|
|
567
547
|
var iframeWidget = _this.widgetManager.getIframeWidget();
|
|
568
548
|
if (!iframeWidget.isLoaded()) {
|
|
569
549
|
iframeWidget.setLoaded(true);
|
|
570
|
-
_services__WEBPACK_IMPORTED_MODULE_3__
|
|
550
|
+
_services__WEBPACK_IMPORTED_MODULE_3__.UserService.touchUser(_this.options.id, _this.options.locale, _this.csrfToken, _this.options.context).then(function (customerId) {
|
|
571
551
|
// Debug interval
|
|
572
552
|
setTimeout(function () {
|
|
573
553
|
iframeWidget.load(customerId);
|
|
@@ -577,7 +557,17 @@ var App = /** @class */ (function () {
|
|
|
577
557
|
};
|
|
578
558
|
var iframeWidget = this.widgetManager.getIframeWidget();
|
|
579
559
|
if (!iframeWidget || !iframeWidget.isRendered()) {
|
|
580
|
-
this.
|
|
560
|
+
var channel = this.options.context.channel
|
|
561
|
+
? this.options.context.channel
|
|
562
|
+
: 'pwa-embed';
|
|
563
|
+
var _a = this.options, id = _a.id, initialElement = _a.initialElement, locale = _a.locale;
|
|
564
|
+
this.widgetManager.renderIframeWidget({
|
|
565
|
+
id: id,
|
|
566
|
+
initialElement: initialElement,
|
|
567
|
+
locale: locale,
|
|
568
|
+
channel: channel,
|
|
569
|
+
host: _config_config__WEBPACK_IMPORTED_MODULE_0__.config.env.iframeHost,
|
|
570
|
+
}, function () {
|
|
581
571
|
// For a separate thread. @todo refactor render flow.
|
|
582
572
|
setTimeout(function () {
|
|
583
573
|
_this.initWebchatService();
|
|
@@ -593,6 +583,10 @@ var App = /** @class */ (function () {
|
|
|
593
583
|
_this.widgetManager.getActionButtonGroupWidget().addButton(__assign(__assign({}, item), { locale: _this.options.locale, app: _this }));
|
|
594
584
|
});
|
|
595
585
|
};
|
|
586
|
+
App.prototype.setLocale = function (locale) {
|
|
587
|
+
this.options.locale = locale;
|
|
588
|
+
this.widgetManager.setLocale(locale, this.chatConfig);
|
|
589
|
+
};
|
|
596
590
|
return App;
|
|
597
591
|
}());
|
|
598
592
|
|
|
@@ -604,34 +598,38 @@ var App = /** @class */ (function () {
|
|
|
604
598
|
/*!*****************************************!*\
|
|
605
599
|
!*** ./src/scripts/core/base-widget.ts ***!
|
|
606
600
|
\*****************************************/
|
|
607
|
-
|
|
608
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
601
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
609
602
|
|
|
610
|
-
"use strict";
|
|
611
603
|
__webpack_require__.r(__webpack_exports__);
|
|
612
|
-
/* harmony export
|
|
613
|
-
/* harmony export
|
|
604
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
605
|
+
/* harmony export */ BaseWidget: () => (/* binding */ BaseWidget),
|
|
606
|
+
/* harmony export */ config: () => (/* binding */ config)
|
|
607
|
+
/* harmony export */ });
|
|
614
608
|
/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable */ "./src/scripts/core/observable.ts");
|
|
615
609
|
/* harmony import */ var _services_audio_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/audio.service */ "./src/scripts/services/audio.service.ts");
|
|
616
610
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
617
611
|
var extendStatics = function (d, b) {
|
|
618
612
|
extendStatics = Object.setPrototypeOf ||
|
|
619
613
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
620
|
-
function (d, b) { for (var p in b) if (
|
|
614
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
621
615
|
return extendStatics(d, b);
|
|
622
616
|
};
|
|
623
617
|
return function (d, b) {
|
|
618
|
+
if (typeof b !== "function" && b !== null)
|
|
619
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
624
620
|
extendStatics(d, b);
|
|
625
621
|
function __() { this.constructor = d; }
|
|
626
622
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
627
623
|
};
|
|
628
624
|
})();
|
|
629
|
-
var
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
625
|
+
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
626
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
627
|
+
if (ar || !(i in from)) {
|
|
628
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
629
|
+
ar[i] = from[i];
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
635
633
|
};
|
|
636
634
|
|
|
637
635
|
|
|
@@ -683,7 +681,7 @@ var BaseWidget = /** @class */ (function (_super) {
|
|
|
683
681
|
setTimeout(function () {
|
|
684
682
|
boxElem.classList.add(config.visibleCls);
|
|
685
683
|
if (_this.effects.sound) {
|
|
686
|
-
_services_audio_service__WEBPACK_IMPORTED_MODULE_1__
|
|
684
|
+
_services_audio_service__WEBPACK_IMPORTED_MODULE_1__.AudioService.playSound(_this.effects.sound);
|
|
687
685
|
}
|
|
688
686
|
}, 10);
|
|
689
687
|
}
|
|
@@ -717,7 +715,7 @@ var BaseWidget = /** @class */ (function (_super) {
|
|
|
717
715
|
boxElem.addEventListener('animationend', handler);
|
|
718
716
|
boxElem.classList.add(config.fxCls[_this.effects.appear]);
|
|
719
717
|
if (_this.effects.sound) {
|
|
720
|
-
_services_audio_service__WEBPACK_IMPORTED_MODULE_1__
|
|
718
|
+
_services_audio_service__WEBPACK_IMPORTED_MODULE_1__.AudioService.playSound(_this.effects.sound);
|
|
721
719
|
}
|
|
722
720
|
}, this.effects.delay);
|
|
723
721
|
};
|
|
@@ -764,12 +762,12 @@ var BaseWidget = /** @class */ (function (_super) {
|
|
|
764
762
|
var baseCls = this.getBaseCls();
|
|
765
763
|
var classes = [config.rootCls];
|
|
766
764
|
if (typeof baseCls === 'string') {
|
|
767
|
-
classes =
|
|
765
|
+
classes = __spreadArray(__spreadArray([], classes, true), (baseCls.indexOf(' ') < 0
|
|
768
766
|
? [baseCls]
|
|
769
|
-
: baseCls.replace(/^\s+|\s+$/g, '').split(/\s+/)));
|
|
767
|
+
: baseCls.replace(/^\s+|\s+$/g, '').split(/\s+/)), true);
|
|
770
768
|
}
|
|
771
769
|
else {
|
|
772
|
-
classes =
|
|
770
|
+
classes = __spreadArray(__spreadArray([], classes, true), baseCls, true);
|
|
773
771
|
}
|
|
774
772
|
classes.forEach(function (item) { return _this.boxElem.classList.add(item); });
|
|
775
773
|
}
|
|
@@ -779,7 +777,7 @@ var BaseWidget = /** @class */ (function (_super) {
|
|
|
779
777
|
if (!this.contentElem) {
|
|
780
778
|
this.contentElem = this.createNode();
|
|
781
779
|
if (this.getBaseCls()) {
|
|
782
|
-
this.contentElem.classList.add(this.getBaseCls()
|
|
780
|
+
this.contentElem.classList.add("".concat(this.getBaseCls(), "__content"));
|
|
783
781
|
}
|
|
784
782
|
this.getBoxElem().appendChild(this.contentElem);
|
|
785
783
|
}
|
|
@@ -866,7 +864,7 @@ var BaseWidget = /** @class */ (function (_super) {
|
|
|
866
864
|
this.fire('destroy');
|
|
867
865
|
};
|
|
868
866
|
return BaseWidget;
|
|
869
|
-
}(_observable__WEBPACK_IMPORTED_MODULE_0__
|
|
867
|
+
}(_observable__WEBPACK_IMPORTED_MODULE_0__.Observable));
|
|
870
868
|
|
|
871
869
|
|
|
872
870
|
|
|
@@ -876,12 +874,12 @@ var BaseWidget = /** @class */ (function (_super) {
|
|
|
876
874
|
/*!*******************************************!*\
|
|
877
875
|
!*** ./src/scripts/core/event-emitter.ts ***!
|
|
878
876
|
\*******************************************/
|
|
879
|
-
|
|
880
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
877
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
881
878
|
|
|
882
|
-
"use strict";
|
|
883
879
|
__webpack_require__.r(__webpack_exports__);
|
|
884
|
-
/* harmony export
|
|
880
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
881
|
+
/* harmony export */ EventEmitter: () => (/* binding */ EventEmitter)
|
|
882
|
+
/* harmony export */ });
|
|
885
883
|
/**
|
|
886
884
|
* A simple and lightweight EventEmitter by TypeScript for Node.js or Browsers.
|
|
887
885
|
*
|
|
@@ -1146,12 +1144,12 @@ var EventEmitter = /** @class */ (function () {
|
|
|
1146
1144
|
/*!************************************!*\
|
|
1147
1145
|
!*** ./src/scripts/core/facade.ts ***!
|
|
1148
1146
|
\************************************/
|
|
1149
|
-
|
|
1150
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1147
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1151
1148
|
|
|
1152
|
-
"use strict";
|
|
1153
1149
|
__webpack_require__.r(__webpack_exports__);
|
|
1154
|
-
/* harmony export
|
|
1150
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1151
|
+
/* harmony export */ createFacade: () => (/* binding */ createFacade)
|
|
1152
|
+
/* harmony export */ });
|
|
1155
1153
|
var c2o = [
|
|
1156
1154
|
'pro110d',
|
|
1157
1155
|
'pro1130',
|
|
@@ -1188,9 +1186,13 @@ var createFacade = function (instance) {
|
|
|
1188
1186
|
},
|
|
1189
1187
|
showButton: function () {
|
|
1190
1188
|
instance.getWidgetManager().getChatButtonWidget().show();
|
|
1189
|
+
instance.getWidgetManager().getWhatsappButtonWidget().show();
|
|
1190
|
+
instance.getWidgetManager().getUnreadWidget().show();
|
|
1191
1191
|
},
|
|
1192
1192
|
hideButton: function () {
|
|
1193
1193
|
instance.getWidgetManager().getChatButtonWidget().hide();
|
|
1194
|
+
instance.getWidgetManager().getWhatsappButtonWidget().hide();
|
|
1195
|
+
instance.getWidgetManager().getUnreadWidget().hide();
|
|
1194
1196
|
},
|
|
1195
1197
|
setButtonText: function (text) {
|
|
1196
1198
|
instance.getWidgetManager().getChatButtonWidget().setContent(text);
|
|
@@ -1256,6 +1258,9 @@ var createFacade = function (instance) {
|
|
|
1256
1258
|
isReady: function () {
|
|
1257
1259
|
return instance.isReady();
|
|
1258
1260
|
},
|
|
1261
|
+
setLocale: function (locale) {
|
|
1262
|
+
instance.setLocale(locale);
|
|
1263
|
+
},
|
|
1259
1264
|
};
|
|
1260
1265
|
};
|
|
1261
1266
|
|
|
@@ -1266,21 +1271,23 @@ var createFacade = function (instance) {
|
|
|
1266
1271
|
/*!****************************************!*\
|
|
1267
1272
|
!*** ./src/scripts/core/observable.ts ***!
|
|
1268
1273
|
\****************************************/
|
|
1269
|
-
|
|
1270
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1274
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1271
1275
|
|
|
1272
|
-
"use strict";
|
|
1273
1276
|
__webpack_require__.r(__webpack_exports__);
|
|
1274
|
-
/* harmony export
|
|
1277
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1278
|
+
/* harmony export */ Observable: () => (/* binding */ Observable)
|
|
1279
|
+
/* harmony export */ });
|
|
1275
1280
|
/* harmony import */ var _event_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event-emitter */ "./src/scripts/core/event-emitter.ts");
|
|
1276
1281
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
1277
1282
|
var extendStatics = function (d, b) {
|
|
1278
1283
|
extendStatics = Object.setPrototypeOf ||
|
|
1279
1284
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1280
|
-
function (d, b) { for (var p in b) if (
|
|
1285
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1281
1286
|
return extendStatics(d, b);
|
|
1282
1287
|
};
|
|
1283
1288
|
return function (d, b) {
|
|
1289
|
+
if (typeof b !== "function" && b !== null)
|
|
1290
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1284
1291
|
extendStatics(d, b);
|
|
1285
1292
|
function __() { this.constructor = d; }
|
|
1286
1293
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -1306,7 +1313,7 @@ var Observable = /** @class */ (function (_super) {
|
|
|
1306
1313
|
this.offAll();
|
|
1307
1314
|
};
|
|
1308
1315
|
return Observable;
|
|
1309
|
-
}(_event_emitter__WEBPACK_IMPORTED_MODULE_0__
|
|
1316
|
+
}(_event_emitter__WEBPACK_IMPORTED_MODULE_0__.EventEmitter));
|
|
1310
1317
|
|
|
1311
1318
|
|
|
1312
1319
|
|
|
@@ -1316,20 +1323,21 @@ var Observable = /** @class */ (function (_super) {
|
|
|
1316
1323
|
/*!***********************************!*\
|
|
1317
1324
|
!*** ./src/scripts/core/utils.ts ***!
|
|
1318
1325
|
\***********************************/
|
|
1319
|
-
|
|
1320
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1326
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1321
1327
|
|
|
1322
|
-
"use strict";
|
|
1323
1328
|
__webpack_require__.r(__webpack_exports__);
|
|
1324
|
-
/* harmony export
|
|
1325
|
-
/* harmony export
|
|
1326
|
-
/* harmony export
|
|
1327
|
-
/* harmony export
|
|
1328
|
-
/* harmony export
|
|
1329
|
-
/* harmony export
|
|
1330
|
-
/* harmony export
|
|
1331
|
-
/* harmony export
|
|
1332
|
-
/* harmony export
|
|
1329
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1330
|
+
/* harmony export */ inIframe: () => (/* binding */ inIframe),
|
|
1331
|
+
/* harmony export */ injectCss: () => (/* binding */ injectCss),
|
|
1332
|
+
/* harmony export */ isCrawler: () => (/* binding */ isCrawler),
|
|
1333
|
+
/* harmony export */ isExternalUrl: () => (/* binding */ isExternalUrl),
|
|
1334
|
+
/* harmony export */ isFontLoaded: () => (/* binding */ isFontLoaded),
|
|
1335
|
+
/* harmony export */ isObject: () => (/* binding */ isObject),
|
|
1336
|
+
/* harmony export */ loadOpenSans: () => (/* binding */ loadOpenSans),
|
|
1337
|
+
/* harmony export */ mergeDeep: () => (/* binding */ mergeDeep),
|
|
1338
|
+
/* harmony export */ parseUrlParam: () => (/* binding */ parseUrlParam),
|
|
1339
|
+
/* harmony export */ removeURLParameters: () => (/* binding */ removeURLParameters)
|
|
1340
|
+
/* harmony export */ });
|
|
1333
1341
|
var parseUrlParam = function (source, name, defaultReturn) {
|
|
1334
1342
|
if (defaultReturn === void 0) { defaultReturn = null; }
|
|
1335
1343
|
var url = new URL(source);
|
|
@@ -1350,7 +1358,7 @@ var isExternalUrl = function (url) {
|
|
|
1350
1358
|
if (match != null &&
|
|
1351
1359
|
typeof match[2] === 'string' &&
|
|
1352
1360
|
match[2].length > 0 &&
|
|
1353
|
-
match[2].replace(new RegExp(":( + { 'http:': 80, 'https:': 443 }["
|
|
1361
|
+
match[2].replace(new RegExp(":( + { 'http:': 80, 'https:': 443 }[".concat(location.protocol, "] + )?$")), '') !== location.host) {
|
|
1354
1362
|
return true;
|
|
1355
1363
|
}
|
|
1356
1364
|
return false;
|
|
@@ -1370,7 +1378,7 @@ var isFontLoaded = function (fontName) {
|
|
|
1370
1378
|
var text = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
1371
1379
|
context.font = '72px monospace';
|
|
1372
1380
|
var baselineSize = context.measureText(text).width;
|
|
1373
|
-
context.font = "72px "
|
|
1381
|
+
context.font = "72px ".concat(fontName, ", monospace");
|
|
1374
1382
|
var newSize = context.measureText(text).width;
|
|
1375
1383
|
canvas = null;
|
|
1376
1384
|
if (newSize === baselineSize) {
|
|
@@ -1378,15 +1386,7 @@ var isFontLoaded = function (fontName) {
|
|
|
1378
1386
|
}
|
|
1379
1387
|
return true;
|
|
1380
1388
|
};
|
|
1381
|
-
var loadOpenSans = function () {
|
|
1382
|
-
var style = document.createElement('link');
|
|
1383
|
-
var head = document.querySelector('head');
|
|
1384
|
-
style.rel = 'stylesheet';
|
|
1385
|
-
style.href = 'https://fonts.googleapis.com/css?family=Open+Sans:400';
|
|
1386
|
-
if (head !== null) {
|
|
1387
|
-
head.appendChild(style);
|
|
1388
|
-
}
|
|
1389
|
-
};
|
|
1389
|
+
var loadOpenSans = function () { };
|
|
1390
1390
|
var isObject = function (item) {
|
|
1391
1391
|
return item && typeof item === 'object' && !Array.isArray(item);
|
|
1392
1392
|
};
|
|
@@ -1409,7 +1409,7 @@ var mergeDeep = function (target, source) {
|
|
|
1409
1409
|
return output;
|
|
1410
1410
|
};
|
|
1411
1411
|
var removeURLParameters = function (removeParams) {
|
|
1412
|
-
var deleteRegex = new RegExp(removeParams.join('=|')
|
|
1412
|
+
var deleteRegex = new RegExp("".concat(removeParams.join('=|'), "="));
|
|
1413
1413
|
var params = location.search.slice(1).split('&');
|
|
1414
1414
|
var search = [];
|
|
1415
1415
|
for (var i = 0; i < params.length; i++) {
|
|
@@ -1417,13 +1417,21 @@ var removeURLParameters = function (removeParams) {
|
|
|
1417
1417
|
search.push(params[i]);
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
var searchString = search.length ? "?"
|
|
1421
|
-
var redirectUrl = ""
|
|
1420
|
+
var searchString = search.length ? "?".concat(search.join('&')) : '';
|
|
1421
|
+
var redirectUrl = "".concat(location.pathname).concat(searchString).concat(location.hash);
|
|
1422
1422
|
window.history.replaceState({}, document.title, redirectUrl);
|
|
1423
1423
|
};
|
|
1424
1424
|
var isCrawler = function () {
|
|
1425
1425
|
return /bot|google|baidu|bing|msn|teoma|slurp|yandex/i.test(navigator.userAgent);
|
|
1426
1426
|
};
|
|
1427
|
+
var inIframe = function () {
|
|
1428
|
+
try {
|
|
1429
|
+
return window.self !== window.top;
|
|
1430
|
+
}
|
|
1431
|
+
catch (e) {
|
|
1432
|
+
return true;
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1427
1435
|
|
|
1428
1436
|
|
|
1429
1437
|
/***/ }),
|
|
@@ -1432,12 +1440,12 @@ var isCrawler = function () {
|
|
|
1432
1440
|
/*!********************************************!*\
|
|
1433
1441
|
!*** ./src/scripts/core/widget-manager.ts ***!
|
|
1434
1442
|
\********************************************/
|
|
1435
|
-
|
|
1436
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1443
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1437
1444
|
|
|
1438
|
-
"use strict";
|
|
1439
1445
|
__webpack_require__.r(__webpack_exports__);
|
|
1440
|
-
/* harmony export
|
|
1446
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1447
|
+
/* harmony export */ WidgetManager: () => (/* binding */ WidgetManager)
|
|
1448
|
+
/* harmony export */ });
|
|
1441
1449
|
/* harmony import */ var _widgets_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../widgets/index */ "./src/scripts/widgets/index.ts");
|
|
1442
1450
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
1443
1451
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
@@ -1453,6 +1461,19 @@ var __assign = (undefined && undefined.__assign) || function () {
|
|
|
1453
1461
|
};
|
|
1454
1462
|
|
|
1455
1463
|
|
|
1464
|
+
var getTeaserText = function (_a) {
|
|
1465
|
+
var teaserText = _a.teaserText, locale = _a.locale, defaultLocale = _a.defaultLocale;
|
|
1466
|
+
var content = 'Can I help you?';
|
|
1467
|
+
if (teaserText) {
|
|
1468
|
+
if (teaserText[locale]) {
|
|
1469
|
+
content = teaserText[locale];
|
|
1470
|
+
}
|
|
1471
|
+
else if (defaultLocale && teaserText[defaultLocale]) {
|
|
1472
|
+
content = teaserText[defaultLocale];
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
return content;
|
|
1476
|
+
};
|
|
1456
1477
|
var WidgetManager = /** @class */ (function () {
|
|
1457
1478
|
function WidgetManager(app) {
|
|
1458
1479
|
this.app = app;
|
|
@@ -1466,26 +1487,47 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1466
1487
|
WidgetManager.prototype.isAppReady = function () {
|
|
1467
1488
|
return this.app.isReady();
|
|
1468
1489
|
};
|
|
1490
|
+
WidgetManager.prototype.renderHeader = function (options) {
|
|
1491
|
+
var _this = this;
|
|
1492
|
+
this.headerWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.HeaderWidget({
|
|
1493
|
+
renderTo: this.chatboxWidget.getBoxElem(),
|
|
1494
|
+
leftCloseButton: options.leftCloseButton,
|
|
1495
|
+
});
|
|
1496
|
+
this.headerWidget.getCloseButton().on('click', function () {
|
|
1497
|
+
if (_this.whatsappWindowWidget && _this.whatsappWindowWidget.isVisible()) {
|
|
1498
|
+
_this.whatsappWindowWidget.hide();
|
|
1499
|
+
}
|
|
1500
|
+
else {
|
|
1501
|
+
_this.chatboxWidget.hide();
|
|
1502
|
+
}
|
|
1503
|
+
});
|
|
1504
|
+
};
|
|
1469
1505
|
WidgetManager.prototype.renderIframeBox = function () {
|
|
1470
|
-
this.iframeBoxWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1506
|
+
this.iframeBoxWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.IframeBoxWidget({
|
|
1471
1507
|
visible: false,
|
|
1472
1508
|
renderTo: this.wrapperWidget.getBoxElem(),
|
|
1473
1509
|
});
|
|
1474
1510
|
};
|
|
1511
|
+
WidgetManager.prototype.renderFooter = function () {
|
|
1512
|
+
this.footerWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.FooterWidget({
|
|
1513
|
+
renderTo: this.wrapperWidget.getBoxElem(),
|
|
1514
|
+
});
|
|
1515
|
+
};
|
|
1475
1516
|
WidgetManager.prototype.renderWrapper = function (options) {
|
|
1476
|
-
this.wrapperWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1517
|
+
this.wrapperWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.WrapperWidget({
|
|
1477
1518
|
renderTo: document.body,
|
|
1478
1519
|
position: options.position,
|
|
1479
1520
|
theme: options.theme,
|
|
1480
1521
|
direction: options.direction,
|
|
1481
1522
|
baseCustomCls: options.baseCls,
|
|
1523
|
+
visible: options.visible,
|
|
1482
1524
|
});
|
|
1483
1525
|
if (!options.renderButton) {
|
|
1484
|
-
this.wrapperWidget.addCls(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
1526
|
+
this.wrapperWidget.addCls(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.wrapperNoButtonCls);
|
|
1485
1527
|
}
|
|
1486
1528
|
};
|
|
1487
1529
|
WidgetManager.prototype.renderContentWrapper = function () {
|
|
1488
|
-
this.contentWrapperWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1530
|
+
this.contentWrapperWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.ContentWrapperWidget({
|
|
1489
1531
|
renderTo: this.wrapperWidget.getBoxElem(),
|
|
1490
1532
|
});
|
|
1491
1533
|
};
|
|
@@ -1502,9 +1544,9 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1502
1544
|
content = buttonText[defaultLocale];
|
|
1503
1545
|
}
|
|
1504
1546
|
}
|
|
1505
|
-
this.chatButtonWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1547
|
+
this.chatButtonWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.ChatButtonWidget({
|
|
1506
1548
|
content: content,
|
|
1507
|
-
renderTo: this.
|
|
1549
|
+
renderTo: this.footerWidget.getBoxElem(),
|
|
1508
1550
|
visible: options.isButtonVisible,
|
|
1509
1551
|
effects: effects === null || effects === void 0 ? void 0 : effects.chatButton,
|
|
1510
1552
|
events: [
|
|
@@ -1542,12 +1584,13 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1542
1584
|
});
|
|
1543
1585
|
};
|
|
1544
1586
|
WidgetManager.prototype.renderIframeWidget = function (options, afterRender) {
|
|
1545
|
-
this.iframeWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1546
|
-
host:
|
|
1587
|
+
this.iframeWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.IframeWidget({
|
|
1588
|
+
host: options.host,
|
|
1547
1589
|
id: options.id,
|
|
1548
1590
|
initialElement: options.initialElement,
|
|
1549
1591
|
locale: options.locale,
|
|
1550
1592
|
renderTo: this.getChatboxWidget().getBoxElem(),
|
|
1593
|
+
channel: options.channel,
|
|
1551
1594
|
events: [
|
|
1552
1595
|
{
|
|
1553
1596
|
type: 'render',
|
|
@@ -1562,22 +1605,15 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1562
1605
|
var _this = this;
|
|
1563
1606
|
var locale = options.locale;
|
|
1564
1607
|
var teaserText = chatConfig.teaserText, defaultLocale = chatConfig.defaultLocale, effects = chatConfig.effects;
|
|
1565
|
-
var content =
|
|
1566
|
-
|
|
1567
|
-
if (teaserText[locale]) {
|
|
1568
|
-
content = teaserText[locale];
|
|
1569
|
-
}
|
|
1570
|
-
else if (defaultLocale && teaserText[defaultLocale]) {
|
|
1571
|
-
content = teaserText[defaultLocale];
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
this.teaserWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__["TeaserWidget"]({
|
|
1608
|
+
var content = getTeaserText({ teaserText: teaserText, locale: locale, defaultLocale: defaultLocale });
|
|
1609
|
+
this.teaserWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.TeaserWidget({
|
|
1575
1610
|
content: content,
|
|
1576
1611
|
showTeaserOnce: chatConfig.showTeaserOnce,
|
|
1577
1612
|
hideTeaserAfterTimes: chatConfig.hideTeaserAfterTimes,
|
|
1578
1613
|
renderTo: this.contentWrapperWidget.getBoxElem(),
|
|
1579
1614
|
visible: isTeaserVisible,
|
|
1580
1615
|
effects: effects === null || effects === void 0 ? void 0 : effects.teaser,
|
|
1616
|
+
custidStoreMode: options.custidStoreMode,
|
|
1581
1617
|
events: [
|
|
1582
1618
|
{
|
|
1583
1619
|
type: 'before:show',
|
|
@@ -1586,7 +1622,7 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1586
1622
|
if (_this.actionButtonGroupWidget) {
|
|
1587
1623
|
_this.actionButtonGroupWidget.show();
|
|
1588
1624
|
}
|
|
1589
|
-
_this.wrapperWidget.addCls(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
1625
|
+
_this.wrapperWidget.addCls(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.wrapperTeaserIsOpenCls);
|
|
1590
1626
|
},
|
|
1591
1627
|
},
|
|
1592
1628
|
{
|
|
@@ -1596,7 +1632,7 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1596
1632
|
{
|
|
1597
1633
|
type: 'before:hide',
|
|
1598
1634
|
callback: function () {
|
|
1599
|
-
_this.wrapperWidget.removeCls(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
1635
|
+
_this.wrapperWidget.removeCls(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.wrapperTeaserIsOpenCls);
|
|
1600
1636
|
if (_this.actionButtonGroupWidget) {
|
|
1601
1637
|
_this.actionButtonGroupWidget.hide();
|
|
1602
1638
|
}
|
|
@@ -1616,7 +1652,7 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1616
1652
|
};
|
|
1617
1653
|
WidgetManager.prototype.renderUnreadWidget = function (options, chatConfig) {
|
|
1618
1654
|
var effects = chatConfig.effects;
|
|
1619
|
-
this.unreadWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1655
|
+
this.unreadWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.UnreadWidget({
|
|
1620
1656
|
visible: options.unreadCounter > 0 ? true : false,
|
|
1621
1657
|
renderTo: this.wrapperWidget.getBoxElem(),
|
|
1622
1658
|
unreadCounter: options.unreadCounter,
|
|
@@ -1625,7 +1661,7 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1625
1661
|
};
|
|
1626
1662
|
WidgetManager.prototype.renderChatboxWidget = function (options, beforeShowCallback) {
|
|
1627
1663
|
var _this = this;
|
|
1628
|
-
this.chatboxWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1664
|
+
this.chatboxWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.ChatboxWidget({
|
|
1629
1665
|
visible: options.isChatboxVisible,
|
|
1630
1666
|
hasExtendedWidth: options.extendedWidth,
|
|
1631
1667
|
events: [
|
|
@@ -1682,7 +1718,7 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1682
1718
|
WidgetManager.prototype.renderActionButtonGroupWidget = function (app, options, chatConfig) {
|
|
1683
1719
|
var _this = this;
|
|
1684
1720
|
var actionButtons = chatConfig.actionButtons, effects = chatConfig.effects;
|
|
1685
|
-
this.actionButtonGroupWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1721
|
+
this.actionButtonGroupWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.ActionButtonGroupWidget({
|
|
1686
1722
|
renderTo: this.contentWrapperWidget.getBoxElem(),
|
|
1687
1723
|
effects: effects === null || effects === void 0 ? void 0 : effects.actionButtons,
|
|
1688
1724
|
visible: actionButtons &&
|
|
@@ -1697,10 +1733,12 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1697
1733
|
};
|
|
1698
1734
|
WidgetManager.prototype.renderWhatsappButtonWidget = function (chatConfig) {
|
|
1699
1735
|
var _this = this;
|
|
1700
|
-
var effects = chatConfig.effects;
|
|
1701
|
-
this.whatsappButtonWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1702
|
-
|
|
1736
|
+
var effects = chatConfig.effects, bwWaButton = chatConfig.bwWaButton, slideWaButton = chatConfig.slideWaButton;
|
|
1737
|
+
this.whatsappButtonWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.WhatsappButtonWidget({
|
|
1738
|
+
slideWaButton: slideWaButton,
|
|
1739
|
+
renderTo: this.footerWidget.getBoxElem(),
|
|
1703
1740
|
effects: effects === null || effects === void 0 ? void 0 : effects.whatsappButton,
|
|
1741
|
+
blackWhiteStyle: bwWaButton,
|
|
1704
1742
|
events: [
|
|
1705
1743
|
{
|
|
1706
1744
|
type: 'toggle',
|
|
@@ -1708,17 +1746,23 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1708
1746
|
if (event.data.isPressed) {
|
|
1709
1747
|
if (!_this.isAppReady()) {
|
|
1710
1748
|
_this.getBroadcast().once('ready', function () {
|
|
1711
|
-
_this.whatsappWindowWidget
|
|
1749
|
+
if (_this.whatsappWindowWidget) {
|
|
1750
|
+
_this.whatsappWindowWidget.show();
|
|
1751
|
+
}
|
|
1712
1752
|
});
|
|
1713
1753
|
}
|
|
1714
1754
|
else {
|
|
1715
|
-
_this.whatsappWindowWidget
|
|
1755
|
+
if (_this.whatsappWindowWidget) {
|
|
1756
|
+
_this.whatsappWindowWidget.show();
|
|
1757
|
+
}
|
|
1716
1758
|
}
|
|
1717
1759
|
_this.chatButtonWidget.toggle(true);
|
|
1718
1760
|
_this.wrapperWidget.addCls('ds-whatsapp--opened');
|
|
1719
1761
|
}
|
|
1720
1762
|
else {
|
|
1721
|
-
_this.whatsappWindowWidget
|
|
1763
|
+
if (_this.whatsappWindowWidget) {
|
|
1764
|
+
_this.whatsappWindowWidget.hide();
|
|
1765
|
+
}
|
|
1722
1766
|
_this.wrapperWidget.removeCls('ds-whatsapp--opened');
|
|
1723
1767
|
}
|
|
1724
1768
|
},
|
|
@@ -1731,7 +1775,7 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1731
1775
|
};
|
|
1732
1776
|
WidgetManager.prototype.renderWhatsappWindowWidget = function (options) {
|
|
1733
1777
|
var _this = this;
|
|
1734
|
-
this.whatsappWindowWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__
|
|
1778
|
+
this.whatsappWindowWidget = new _widgets_index__WEBPACK_IMPORTED_MODULE_0__.WhatsappWindowWidget({
|
|
1735
1779
|
renderTo: this.chatboxWidget.getBoxElem(),
|
|
1736
1780
|
visible: false,
|
|
1737
1781
|
clientId: options.id,
|
|
@@ -1753,7 +1797,9 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1753
1797
|
],
|
|
1754
1798
|
});
|
|
1755
1799
|
this.chatboxWidget.on('before:hide', function () {
|
|
1756
|
-
_this.whatsappWindowWidget
|
|
1800
|
+
if (_this.whatsappWindowWidget) {
|
|
1801
|
+
_this.whatsappWindowWidget.hide();
|
|
1802
|
+
}
|
|
1757
1803
|
});
|
|
1758
1804
|
};
|
|
1759
1805
|
WidgetManager.prototype.getChatButtonWidget = function () {
|
|
@@ -1786,15 +1832,51 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1786
1832
|
WidgetManager.prototype.getIframeBoxWidget = function () {
|
|
1787
1833
|
return this.iframeBoxWidget;
|
|
1788
1834
|
};
|
|
1835
|
+
WidgetManager.prototype.setLocale = function (locale, chatConfig) {
|
|
1836
|
+
var teaserText = chatConfig.teaserText, defaultLocale = chatConfig.defaultLocale;
|
|
1837
|
+
if (this.teaserWidget) {
|
|
1838
|
+
var teaserContent = getTeaserText({ teaserText: teaserText, locale: locale, defaultLocale: defaultLocale });
|
|
1839
|
+
this.teaserWidget.setContent(teaserContent);
|
|
1840
|
+
}
|
|
1841
|
+
if (this.actionButtonGroupWidget) {
|
|
1842
|
+
var buttons = this.actionButtonGroupWidget.getButtons();
|
|
1843
|
+
buttons.forEach(function (button) { return button.setLocale(locale); });
|
|
1844
|
+
}
|
|
1845
|
+
if (this.whatsappWindowWidget) {
|
|
1846
|
+
this.whatsappWindowWidget.setLocale(locale);
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1789
1849
|
WidgetManager.prototype.destroy = function () {
|
|
1790
|
-
this.unreadWidget
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
this.
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
this.
|
|
1797
|
-
|
|
1850
|
+
if (this.unreadWidget) {
|
|
1851
|
+
this.unreadWidget.destroy();
|
|
1852
|
+
}
|
|
1853
|
+
if (this.teaserWidget) {
|
|
1854
|
+
this.teaserWidget.destroy();
|
|
1855
|
+
}
|
|
1856
|
+
if (this.chatButtonWidget) {
|
|
1857
|
+
this.chatButtonWidget.destroy();
|
|
1858
|
+
}
|
|
1859
|
+
if (this.iframeWidget) {
|
|
1860
|
+
this.iframeWidget.destroy();
|
|
1861
|
+
}
|
|
1862
|
+
if (this.chatboxWidget) {
|
|
1863
|
+
this.chatboxWidget.destroy();
|
|
1864
|
+
}
|
|
1865
|
+
if (this.wrapperWidget) {
|
|
1866
|
+
this.wrapperWidget.destroy();
|
|
1867
|
+
}
|
|
1868
|
+
if (this.actionButtonGroupWidget) {
|
|
1869
|
+
this.actionButtonGroupWidget.destroy();
|
|
1870
|
+
}
|
|
1871
|
+
if (this.iframeBoxWidget) {
|
|
1872
|
+
this.iframeBoxWidget.destroy();
|
|
1873
|
+
}
|
|
1874
|
+
if (this.headerWidget) {
|
|
1875
|
+
this.headerWidget.destroy();
|
|
1876
|
+
}
|
|
1877
|
+
if (this.footerWidget) {
|
|
1878
|
+
this.footerWidget.destroy();
|
|
1879
|
+
}
|
|
1798
1880
|
if (this.whatsappButtonWidget) {
|
|
1799
1881
|
this.whatsappButtonWidget.destroy();
|
|
1800
1882
|
}
|
|
@@ -1809,29 +1891,21 @@ var WidgetManager = /** @class */ (function () {
|
|
|
1809
1891
|
|
|
1810
1892
|
/***/ }),
|
|
1811
1893
|
|
|
1812
|
-
/***/ "./src/scripts/
|
|
1894
|
+
/***/ "./src/scripts/enums.ts":
|
|
1813
1895
|
/*!******************************!*\
|
|
1814
|
-
!*** ./src/scripts/
|
|
1896
|
+
!*** ./src/scripts/enums.ts ***!
|
|
1815
1897
|
\******************************/
|
|
1816
|
-
|
|
1817
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1898
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1818
1899
|
|
|
1819
|
-
"use strict";
|
|
1820
1900
|
__webpack_require__.r(__webpack_exports__);
|
|
1821
|
-
/* harmony export
|
|
1822
|
-
/* harmony
|
|
1823
|
-
/* harmony
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
return facade;
|
|
1830
|
-
}
|
|
1831
|
-
facade = Object(_core_facade__WEBPACK_IMPORTED_MODULE_0__["createFacade"])(new _core_app__WEBPACK_IMPORTED_MODULE_1__["App"](options));
|
|
1832
|
-
return facade;
|
|
1833
|
-
};
|
|
1834
|
-
|
|
1901
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1902
|
+
/* harmony export */ CustidStoreMode: () => (/* binding */ CustidStoreMode)
|
|
1903
|
+
/* harmony export */ });
|
|
1904
|
+
var CustidStoreMode;
|
|
1905
|
+
(function (CustidStoreMode) {
|
|
1906
|
+
CustidStoreMode["cookie"] = "cookie";
|
|
1907
|
+
CustidStoreMode["session"] = "session";
|
|
1908
|
+
})(CustidStoreMode || (CustidStoreMode = {}));
|
|
1835
1909
|
|
|
1836
1910
|
|
|
1837
1911
|
/***/ }),
|
|
@@ -1840,14 +1914,14 @@ var instance = function (options) {
|
|
|
1840
1914
|
/*!*********************************************!*\
|
|
1841
1915
|
!*** ./src/scripts/models/action-button.ts ***!
|
|
1842
1916
|
\*********************************************/
|
|
1843
|
-
|
|
1844
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1917
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1845
1918
|
|
|
1846
|
-
"use strict";
|
|
1847
1919
|
__webpack_require__.r(__webpack_exports__);
|
|
1848
|
-
/* harmony export
|
|
1849
|
-
/* harmony export
|
|
1850
|
-
/* harmony export
|
|
1920
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1921
|
+
/* harmony export */ ActionButton: () => (/* binding */ ActionButton),
|
|
1922
|
+
/* harmony export */ ActionButtonNormalizer: () => (/* binding */ ActionButtonNormalizer),
|
|
1923
|
+
/* harmony export */ ActionButtonType: () => (/* binding */ ActionButtonType)
|
|
1924
|
+
/* harmony export */ });
|
|
1851
1925
|
var ActionButtonType;
|
|
1852
1926
|
(function (ActionButtonType) {
|
|
1853
1927
|
ActionButtonType["quickreply"] = "quickreply";
|
|
@@ -1894,7 +1968,7 @@ var ActionButtonNormalizer = /** @class */ (function () {
|
|
|
1894
1968
|
function ActionButtonNormalizer() {
|
|
1895
1969
|
}
|
|
1896
1970
|
ActionButtonNormalizer.normalize = function (data) {
|
|
1897
|
-
var locales = ['en', 'de', 'fr', 'it', 'ru', 'ar'];
|
|
1971
|
+
var locales = ['en', 'de', 'fr', 'it', 'ru', 'ar', 'nl', 'cz', 'hu', 'ro', 'es', 'da'];
|
|
1898
1972
|
var result = {
|
|
1899
1973
|
type: data.type,
|
|
1900
1974
|
successor: data.successor,
|
|
@@ -1924,18 +1998,15 @@ var ActionButtonNormalizer = /** @class */ (function () {
|
|
|
1924
1998
|
/*!*************************************!*\
|
|
1925
1999
|
!*** ./src/scripts/models/index.ts ***!
|
|
1926
2000
|
\*************************************/
|
|
1927
|
-
|
|
1928
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2001
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1929
2002
|
|
|
1930
|
-
"use strict";
|
|
1931
2003
|
__webpack_require__.r(__webpack_exports__);
|
|
2004
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2005
|
+
/* harmony export */ ActionButton: () => (/* reexport safe */ _action_button__WEBPACK_IMPORTED_MODULE_0__.ActionButton),
|
|
2006
|
+
/* harmony export */ ActionButtonNormalizer: () => (/* reexport safe */ _action_button__WEBPACK_IMPORTED_MODULE_0__.ActionButtonNormalizer),
|
|
2007
|
+
/* harmony export */ ActionButtonType: () => (/* reexport safe */ _action_button__WEBPACK_IMPORTED_MODULE_0__.ActionButtonType)
|
|
2008
|
+
/* harmony export */ });
|
|
1932
2009
|
/* harmony import */ var _action_button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./action-button */ "./src/scripts/models/action-button.ts");
|
|
1933
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionButtonType", function() { return _action_button__WEBPACK_IMPORTED_MODULE_0__["ActionButtonType"]; });
|
|
1934
|
-
|
|
1935
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionButton", function() { return _action_button__WEBPACK_IMPORTED_MODULE_0__["ActionButton"]; });
|
|
1936
|
-
|
|
1937
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionButtonNormalizer", function() { return _action_button__WEBPACK_IMPORTED_MODULE_0__["ActionButtonNormalizer"]; });
|
|
1938
|
-
|
|
1939
2010
|
|
|
1940
2011
|
|
|
1941
2012
|
|
|
@@ -1945,12 +2016,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1945
2016
|
/*!*********************************************!*\
|
|
1946
2017
|
!*** ./src/scripts/services/api.service.ts ***!
|
|
1947
2018
|
\*********************************************/
|
|
1948
|
-
|
|
1949
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2019
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1950
2020
|
|
|
1951
|
-
"use strict";
|
|
1952
2021
|
__webpack_require__.r(__webpack_exports__);
|
|
1953
|
-
/* harmony export
|
|
2022
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2023
|
+
/* harmony export */ ApiService: () => (/* binding */ ApiService)
|
|
2024
|
+
/* harmony export */ });
|
|
1954
2025
|
/* harmony import */ var _http_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.service */ "./src/scripts/services/http.service.ts");
|
|
1955
2026
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
1956
2027
|
|
|
@@ -1959,13 +2030,13 @@ var ApiService = /** @class */ (function () {
|
|
|
1959
2030
|
function ApiService() {
|
|
1960
2031
|
}
|
|
1961
2032
|
ApiService.getTransport = function () {
|
|
1962
|
-
return _http_service__WEBPACK_IMPORTED_MODULE_0__
|
|
2033
|
+
return _http_service__WEBPACK_IMPORTED_MODULE_0__.HttpService;
|
|
1963
2034
|
};
|
|
1964
2035
|
ApiService.getCoreEndpoint = function () {
|
|
1965
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2036
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.env.coreApiEndpoint;
|
|
1966
2037
|
};
|
|
1967
2038
|
ApiService.getIbeEndpoint = function () {
|
|
1968
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2039
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.env.ibeApiEndpoint;
|
|
1969
2040
|
};
|
|
1970
2041
|
ApiService.setContext = function (customerId, key, value) {
|
|
1971
2042
|
var context = {};
|
|
@@ -1974,36 +2045,42 @@ var ApiService = /** @class */ (function () {
|
|
|
1974
2045
|
custid: customerId,
|
|
1975
2046
|
context: JSON.stringify(context),
|
|
1976
2047
|
};
|
|
1977
|
-
return ApiService.getTransport().postRequest(ApiService.getCoreEndpoint()
|
|
2048
|
+
return ApiService.getTransport().postRequest("".concat(ApiService.getCoreEndpoint(), "/config/context"), data);
|
|
1978
2049
|
};
|
|
1979
2050
|
ApiService.getContext = function (customerId, variable) {
|
|
1980
2051
|
return ApiService.getTransport()
|
|
1981
|
-
.getRequest(ApiService.getCoreEndpoint()
|
|
2052
|
+
.getRequest("".concat(ApiService.getCoreEndpoint(), "/config/context/").concat(customerId, "/").concat(variable))
|
|
1982
2053
|
.then(function (response) {
|
|
1983
2054
|
return response[variable] ? response[variable] : null;
|
|
1984
2055
|
});
|
|
1985
2056
|
};
|
|
1986
|
-
ApiService.getConfig = function (clientId, customerId, channel) {
|
|
2057
|
+
ApiService.getConfig = function (clientId, customerId, host, path, channel) {
|
|
1987
2058
|
if (customerId === void 0) { customerId = 'none'; }
|
|
1988
|
-
var url = ApiService.getCoreEndpoint()
|
|
2059
|
+
var url = "".concat(ApiService.getCoreEndpoint(), "/config/webapp/").concat(clientId, "/").concat(customerId);
|
|
2060
|
+
var queryData = {
|
|
2061
|
+
host: host,
|
|
2062
|
+
path: path,
|
|
2063
|
+
};
|
|
1989
2064
|
if (channel) {
|
|
1990
|
-
|
|
2065
|
+
queryData['channel'] = channel;
|
|
1991
2066
|
}
|
|
2067
|
+
var queryString = new URLSearchParams(queryData);
|
|
2068
|
+
url += "?".concat(queryString.toString());
|
|
1992
2069
|
return ApiService.getTransport().getRequest(url);
|
|
1993
2070
|
};
|
|
1994
2071
|
ApiService.createUser = function (options) {
|
|
1995
|
-
var url = ApiService.getCoreEndpoint()
|
|
2072
|
+
var url = "".concat(ApiService.getCoreEndpoint(), "/customer/v2/createnew/").concat(options.source, "/").concat(options.clientId, "/").concat(options.locale);
|
|
1996
2073
|
if (options.csrfToken) {
|
|
1997
|
-
url += "?csrftoken="
|
|
2074
|
+
url += "?csrftoken=".concat(options.csrfToken);
|
|
1998
2075
|
}
|
|
1999
2076
|
if (options.context) {
|
|
2000
2077
|
options.csrfToken ? (url += '&') : (url += '?');
|
|
2001
|
-
url += "context="
|
|
2078
|
+
url += "context=".concat(encodeURIComponent(JSON.stringify(options.context)));
|
|
2002
2079
|
}
|
|
2003
2080
|
url.indexOf('?') === -1 ? (url += '?origin=sdk') : (url += '&origin=sdk');
|
|
2004
2081
|
url += '&v=2.3.16';
|
|
2005
2082
|
if (options.debug) {
|
|
2006
|
-
url += "&debug="
|
|
2083
|
+
url += "&debug=".concat(options.debug);
|
|
2007
2084
|
}
|
|
2008
2085
|
return ApiService.getTransport().getRequest(url);
|
|
2009
2086
|
};
|
|
@@ -2016,7 +2093,7 @@ var ApiService = /** @class */ (function () {
|
|
|
2016
2093
|
if (options.context) {
|
|
2017
2094
|
data.context = JSON.stringify(options.context);
|
|
2018
2095
|
}
|
|
2019
|
-
return ApiService.getTransport().postRequest(ApiService.getCoreEndpoint()
|
|
2096
|
+
return ApiService.getTransport().postRequest("".concat(ApiService.getCoreEndpoint(), "/customer/validate"), data);
|
|
2020
2097
|
};
|
|
2021
2098
|
ApiService.createToken = function (options) {
|
|
2022
2099
|
var data = {
|
|
@@ -2027,10 +2104,10 @@ var ApiService = /** @class */ (function () {
|
|
|
2027
2104
|
if (options.csrftoken) {
|
|
2028
2105
|
data.csrftoken = options.csrftoken;
|
|
2029
2106
|
}
|
|
2030
|
-
return ApiService.getTransport().getRequest(ApiService.getCoreEndpoint()
|
|
2107
|
+
return ApiService.getTransport().getRequest("".concat(ApiService.getCoreEndpoint(), "/customer/csrf"), data);
|
|
2031
2108
|
};
|
|
2032
2109
|
ApiService.getWhatsappLink = function (clientid, custid) {
|
|
2033
|
-
return ApiService.getTransport().getRequest(ApiService.getIbeEndpoint()
|
|
2110
|
+
return ApiService.getTransport().getRequest("".concat(ApiService.getIbeEndpoint(), "/whatsapp/onboard"), {
|
|
2034
2111
|
clientid: clientid,
|
|
2035
2112
|
custid: custid,
|
|
2036
2113
|
});
|
|
@@ -2046,13 +2123,13 @@ var ApiService = /** @class */ (function () {
|
|
|
2046
2123
|
/*!***********************************************!*\
|
|
2047
2124
|
!*** ./src/scripts/services/audio.service.ts ***!
|
|
2048
2125
|
\***********************************************/
|
|
2049
|
-
|
|
2050
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2126
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2051
2127
|
|
|
2052
|
-
"use strict";
|
|
2053
2128
|
__webpack_require__.r(__webpack_exports__);
|
|
2054
|
-
/* harmony export
|
|
2055
|
-
/* harmony export
|
|
2129
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2130
|
+
/* harmony export */ AudioService: () => (/* binding */ AudioService),
|
|
2131
|
+
/* harmony export */ AudioSound: () => (/* binding */ AudioSound)
|
|
2132
|
+
/* harmony export */ });
|
|
2056
2133
|
var AudioSound;
|
|
2057
2134
|
(function (AudioSound) {
|
|
2058
2135
|
AudioSound["appear"] = "appear";
|
|
@@ -2082,12 +2159,12 @@ var AudioService = /** @class */ (function () {
|
|
|
2082
2159
|
/*!************************************************!*\
|
|
2083
2160
|
!*** ./src/scripts/services/cookie.service.ts ***!
|
|
2084
2161
|
\************************************************/
|
|
2085
|
-
|
|
2086
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2162
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2087
2163
|
|
|
2088
|
-
"use strict";
|
|
2089
2164
|
__webpack_require__.r(__webpack_exports__);
|
|
2090
|
-
/* harmony export
|
|
2165
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2166
|
+
/* harmony export */ CookieService: () => (/* binding */ CookieService)
|
|
2167
|
+
/* harmony export */ });
|
|
2091
2168
|
var __assign = (undefined && undefined.__assign) || function () {
|
|
2092
2169
|
__assign = Object.assign || function(t) {
|
|
2093
2170
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -2130,17 +2207,17 @@ var CookieService = /** @class */ (function () {
|
|
|
2130
2207
|
params.expires = expires.toUTCString();
|
|
2131
2208
|
}
|
|
2132
2209
|
var encodedValue = encodeURIComponent(value);
|
|
2133
|
-
var updatedCookie = name
|
|
2210
|
+
var updatedCookie = "".concat(name, "=").concat(encodedValue);
|
|
2134
2211
|
for (var propName in params) {
|
|
2135
|
-
updatedCookie = updatedCookie
|
|
2212
|
+
updatedCookie = "".concat(updatedCookie, "; ").concat(propName);
|
|
2136
2213
|
var propValue = params[propName];
|
|
2137
2214
|
if (propValue !== true) {
|
|
2138
|
-
updatedCookie = updatedCookie
|
|
2215
|
+
updatedCookie = "".concat(updatedCookie, "=").concat(propValue);
|
|
2139
2216
|
}
|
|
2140
2217
|
}
|
|
2141
2218
|
document.cookie = updatedCookie;
|
|
2142
2219
|
};
|
|
2143
|
-
CookieService
|
|
2220
|
+
CookieService.delete = function (name) {
|
|
2144
2221
|
CookieService.set(name, '', {
|
|
2145
2222
|
'max-age': -1,
|
|
2146
2223
|
});
|
|
@@ -2151,18 +2228,48 @@ var CookieService = /** @class */ (function () {
|
|
|
2151
2228
|
|
|
2152
2229
|
|
|
2153
2230
|
|
|
2231
|
+
/***/ }),
|
|
2232
|
+
|
|
2233
|
+
/***/ "./src/scripts/services/ga.service.ts":
|
|
2234
|
+
/*!********************************************!*\
|
|
2235
|
+
!*** ./src/scripts/services/ga.service.ts ***!
|
|
2236
|
+
\********************************************/
|
|
2237
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2238
|
+
|
|
2239
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2240
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2241
|
+
/* harmony export */ GaService: () => (/* binding */ GaService)
|
|
2242
|
+
/* harmony export */ });
|
|
2243
|
+
var GaService = /** @class */ (function () {
|
|
2244
|
+
function GaService() {
|
|
2245
|
+
}
|
|
2246
|
+
GaService.getGaValue = function () {
|
|
2247
|
+
for (var _i = 0, _a = document.cookie.split(';'); _i < _a.length; _i++) {
|
|
2248
|
+
var c = _a[_i];
|
|
2249
|
+
var d = c.trim();
|
|
2250
|
+
if (d.startsWith('_ga=')) {
|
|
2251
|
+
return d.split('=', 2)[1];
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
return null;
|
|
2255
|
+
};
|
|
2256
|
+
return GaService;
|
|
2257
|
+
}());
|
|
2258
|
+
|
|
2259
|
+
|
|
2260
|
+
|
|
2154
2261
|
/***/ }),
|
|
2155
2262
|
|
|
2156
2263
|
/***/ "./src/scripts/services/http.service.ts":
|
|
2157
2264
|
/*!**********************************************!*\
|
|
2158
2265
|
!*** ./src/scripts/services/http.service.ts ***!
|
|
2159
2266
|
\**********************************************/
|
|
2160
|
-
|
|
2161
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2267
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2162
2268
|
|
|
2163
|
-
"use strict";
|
|
2164
2269
|
__webpack_require__.r(__webpack_exports__);
|
|
2165
|
-
/* harmony export
|
|
2270
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2271
|
+
/* harmony export */ HttpService: () => (/* binding */ HttpService)
|
|
2272
|
+
/* harmony export */ });
|
|
2166
2273
|
var HttpService = /** @class */ (function () {
|
|
2167
2274
|
function HttpService() {
|
|
2168
2275
|
}
|
|
@@ -2177,7 +2284,7 @@ var HttpService = /** @class */ (function () {
|
|
|
2177
2284
|
};
|
|
2178
2285
|
HttpService.getRequest = function (url, options) {
|
|
2179
2286
|
var queryString = options
|
|
2180
|
-
? url
|
|
2287
|
+
? "".concat(url, "?").concat(new URLSearchParams(options).toString())
|
|
2181
2288
|
: url;
|
|
2182
2289
|
return fetch(queryString).then(this.processError).then(this.processJson);
|
|
2183
2290
|
};
|
|
@@ -2203,29 +2310,23 @@ var HttpService = /** @class */ (function () {
|
|
|
2203
2310
|
/*!***************************************!*\
|
|
2204
2311
|
!*** ./src/scripts/services/index.ts ***!
|
|
2205
2312
|
\***************************************/
|
|
2206
|
-
|
|
2207
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2313
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2208
2314
|
|
|
2209
|
-
"use strict";
|
|
2210
2315
|
__webpack_require__.r(__webpack_exports__);
|
|
2316
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2317
|
+
/* harmony export */ ApiService: () => (/* reexport safe */ _api_service__WEBPACK_IMPORTED_MODULE_0__.ApiService),
|
|
2318
|
+
/* harmony export */ CookieService: () => (/* reexport safe */ _cookie_service__WEBPACK_IMPORTED_MODULE_3__.CookieService),
|
|
2319
|
+
/* harmony export */ HttpService: () => (/* reexport safe */ _http_service__WEBPACK_IMPORTED_MODULE_1__.HttpService),
|
|
2320
|
+
/* harmony export */ TokenService: () => (/* reexport safe */ _token_service__WEBPACK_IMPORTED_MODULE_5__.TokenService),
|
|
2321
|
+
/* harmony export */ UserService: () => (/* reexport safe */ _user_service__WEBPACK_IMPORTED_MODULE_4__.UserService),
|
|
2322
|
+
/* harmony export */ WebchatService: () => (/* reexport safe */ _webchat_service__WEBPACK_IMPORTED_MODULE_2__.WebchatService)
|
|
2323
|
+
/* harmony export */ });
|
|
2211
2324
|
/* harmony import */ var _api_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./api.service */ "./src/scripts/services/api.service.ts");
|
|
2212
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ApiService", function() { return _api_service__WEBPACK_IMPORTED_MODULE_0__["ApiService"]; });
|
|
2213
|
-
|
|
2214
2325
|
/* harmony import */ var _http_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.service */ "./src/scripts/services/http.service.ts");
|
|
2215
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpService", function() { return _http_service__WEBPACK_IMPORTED_MODULE_1__["HttpService"]; });
|
|
2216
|
-
|
|
2217
2326
|
/* harmony import */ var _webchat_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./webchat.service */ "./src/scripts/services/webchat.service.ts");
|
|
2218
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WebchatService", function() { return _webchat_service__WEBPACK_IMPORTED_MODULE_2__["WebchatService"]; });
|
|
2219
|
-
|
|
2220
2327
|
/* harmony import */ var _cookie_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cookie.service */ "./src/scripts/services/cookie.service.ts");
|
|
2221
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CookieService", function() { return _cookie_service__WEBPACK_IMPORTED_MODULE_3__["CookieService"]; });
|
|
2222
|
-
|
|
2223
2328
|
/* harmony import */ var _user_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./user.service */ "./src/scripts/services/user.service.ts");
|
|
2224
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserService", function() { return _user_service__WEBPACK_IMPORTED_MODULE_4__["UserService"]; });
|
|
2225
|
-
|
|
2226
2329
|
/* harmony import */ var _token_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./token.service */ "./src/scripts/services/token.service.ts");
|
|
2227
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenService", function() { return _token_service__WEBPACK_IMPORTED_MODULE_5__["TokenService"]; });
|
|
2228
|
-
|
|
2229
2330
|
|
|
2230
2331
|
|
|
2231
2332
|
|
|
@@ -2240,27 +2341,26 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2240
2341
|
/*!***********************************************!*\
|
|
2241
2342
|
!*** ./src/scripts/services/token.service.ts ***!
|
|
2242
2343
|
\***********************************************/
|
|
2243
|
-
|
|
2244
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2344
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2245
2345
|
|
|
2246
|
-
"use strict";
|
|
2247
2346
|
__webpack_require__.r(__webpack_exports__);
|
|
2248
|
-
/* harmony export
|
|
2347
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2348
|
+
/* harmony export */ TokenService: () => (/* binding */ TokenService)
|
|
2349
|
+
/* harmony export */ });
|
|
2249
2350
|
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ "./src/scripts/services/index.ts");
|
|
2250
2351
|
/* harmony import */ var _core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/utils */ "./src/scripts/core/utils.ts");
|
|
2251
2352
|
|
|
2252
2353
|
|
|
2253
2354
|
var csrfCookieName = 'ds-csrf';
|
|
2254
|
-
var customerIdCookieName = 'ds-custid';
|
|
2255
2355
|
var TokenService = /** @class */ (function () {
|
|
2256
2356
|
function TokenService() {
|
|
2257
2357
|
}
|
|
2258
2358
|
TokenService.touchToken = function (clientId, csrfAfter) {
|
|
2259
2359
|
return new Promise(function (resolve) {
|
|
2260
|
-
var customerId = ___WEBPACK_IMPORTED_MODULE_0__
|
|
2261
|
-
var csrftoken = ___WEBPACK_IMPORTED_MODULE_0__
|
|
2360
|
+
var customerId = ___WEBPACK_IMPORTED_MODULE_0__.UserService.getCustomerId();
|
|
2361
|
+
var csrftoken = ___WEBPACK_IMPORTED_MODULE_0__.CookieService.get(csrfCookieName);
|
|
2262
2362
|
var sec = btoa(window.screen.width.toString());
|
|
2263
|
-
var realUserScore =
|
|
2363
|
+
var realUserScore = (0,_core_utils__WEBPACK_IMPORTED_MODULE_1__.isCrawler)() ? 0 : 100;
|
|
2264
2364
|
if (customerId) {
|
|
2265
2365
|
resolve(customerId);
|
|
2266
2366
|
}
|
|
@@ -2269,18 +2369,18 @@ var TokenService = /** @class */ (function () {
|
|
|
2269
2369
|
}
|
|
2270
2370
|
else {
|
|
2271
2371
|
setTimeout(function () {
|
|
2272
|
-
if (___WEBPACK_IMPORTED_MODULE_0__
|
|
2372
|
+
if (___WEBPACK_IMPORTED_MODULE_0__.UserService.getCustomerId()) {
|
|
2273
2373
|
return;
|
|
2274
2374
|
}
|
|
2275
|
-
___WEBPACK_IMPORTED_MODULE_0__
|
|
2375
|
+
___WEBPACK_IMPORTED_MODULE_0__.ApiService.createToken({
|
|
2276
2376
|
clientId: clientId,
|
|
2277
2377
|
csrftoken: csrftoken,
|
|
2278
2378
|
sec: sec,
|
|
2279
2379
|
realUserScore: realUserScore,
|
|
2280
2380
|
}).then(function (response) {
|
|
2281
2381
|
if (!csrftoken) {
|
|
2282
|
-
___WEBPACK_IMPORTED_MODULE_0__
|
|
2283
|
-
expires: 86400 * 7,
|
|
2382
|
+
___WEBPACK_IMPORTED_MODULE_0__.CookieService.set(csrfCookieName, response.csrftoken, {
|
|
2383
|
+
expires: 86400 * 7, // 7 days
|
|
2284
2384
|
});
|
|
2285
2385
|
resolve(response.csrftoken);
|
|
2286
2386
|
}
|
|
@@ -2290,7 +2390,7 @@ var TokenService = /** @class */ (function () {
|
|
|
2290
2390
|
});
|
|
2291
2391
|
};
|
|
2292
2392
|
TokenService.deleteToken = function () {
|
|
2293
|
-
___WEBPACK_IMPORTED_MODULE_0__
|
|
2393
|
+
___WEBPACK_IMPORTED_MODULE_0__.CookieService.delete(csrfCookieName);
|
|
2294
2394
|
};
|
|
2295
2395
|
return TokenService;
|
|
2296
2396
|
}());
|
|
@@ -2303,14 +2403,18 @@ var TokenService = /** @class */ (function () {
|
|
|
2303
2403
|
/*!**********************************************!*\
|
|
2304
2404
|
!*** ./src/scripts/services/user.service.ts ***!
|
|
2305
2405
|
\**********************************************/
|
|
2306
|
-
|
|
2307
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2406
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2308
2407
|
|
|
2309
|
-
"use strict";
|
|
2310
2408
|
__webpack_require__.r(__webpack_exports__);
|
|
2311
|
-
/* harmony export
|
|
2409
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2410
|
+
/* harmony export */ UserService: () => (/* binding */ UserService)
|
|
2411
|
+
/* harmony export */ });
|
|
2312
2412
|
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ */ "./src/scripts/services/index.ts");
|
|
2313
2413
|
/* harmony import */ var _core_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/utils */ "./src/scripts/core/utils.ts");
|
|
2414
|
+
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ "./src/scripts/enums.ts");
|
|
2415
|
+
/* harmony import */ var _ga_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ga.service */ "./src/scripts/services/ga.service.ts");
|
|
2416
|
+
|
|
2417
|
+
|
|
2314
2418
|
|
|
2315
2419
|
|
|
2316
2420
|
var customerIdCookieName = 'ds-custid';
|
|
@@ -2318,32 +2422,114 @@ var UserService = /** @class */ (function () {
|
|
|
2318
2422
|
function UserService() {
|
|
2319
2423
|
}
|
|
2320
2424
|
UserService.getCustomerId = function () {
|
|
2321
|
-
|
|
2425
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie) {
|
|
2426
|
+
return ___WEBPACK_IMPORTED_MODULE_0__.CookieService.get(customerIdCookieName);
|
|
2427
|
+
}
|
|
2428
|
+
else {
|
|
2429
|
+
var customerId = this.customerId;
|
|
2430
|
+
/* let customerId: string | null = null
|
|
2431
|
+
try {
|
|
2432
|
+
customerId = sessionStorage.getItem(customerIdCookieName)
|
|
2433
|
+
} catch (e) {
|
|
2434
|
+
console.log('Session storage blocked.')
|
|
2435
|
+
}*/
|
|
2436
|
+
if (customerId === null) {
|
|
2437
|
+
customerId = ___WEBPACK_IMPORTED_MODULE_0__.CookieService.get(customerIdCookieName);
|
|
2438
|
+
}
|
|
2439
|
+
return customerId;
|
|
2440
|
+
}
|
|
2322
2441
|
};
|
|
2323
2442
|
UserService.setCustomerId = function (id, expires) {
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2443
|
+
this.saveCustomerId(id, expires);
|
|
2444
|
+
___WEBPACK_IMPORTED_MODULE_0__.TokenService.deleteToken();
|
|
2445
|
+
};
|
|
2446
|
+
UserService.saveCustomerId = function (id, expires) {
|
|
2447
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie) {
|
|
2448
|
+
___WEBPACK_IMPORTED_MODULE_0__.CookieService.set(customerIdCookieName, id, {
|
|
2449
|
+
expires: expires ? expires : 86400 * 90, // 90 days
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2452
|
+
else {
|
|
2453
|
+
this.customerId = id;
|
|
2454
|
+
/* try {
|
|
2455
|
+
sessionStorage.setItem(customerIdCookieName, id)
|
|
2456
|
+
} catch (e) {
|
|
2457
|
+
console.log('Session storage blocked.')
|
|
2458
|
+
}*/
|
|
2459
|
+
}
|
|
2460
|
+
};
|
|
2461
|
+
UserService.deleteCustomerId = function () {
|
|
2462
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie) {
|
|
2463
|
+
___WEBPACK_IMPORTED_MODULE_0__.CookieService.delete(customerIdCookieName);
|
|
2464
|
+
}
|
|
2465
|
+
else {
|
|
2466
|
+
this.customerId = null;
|
|
2467
|
+
/* try {
|
|
2468
|
+
sessionStorage.removeItem(customerIdCookieName)
|
|
2469
|
+
} catch (e) {
|
|
2470
|
+
console.log('Session storage blocked.')
|
|
2471
|
+
}
|
|
2472
|
+
if (CookieService.get(customerIdCookieName) !== null) {
|
|
2473
|
+
CookieService.delete(customerIdCookieName)
|
|
2474
|
+
}*/
|
|
2475
|
+
}
|
|
2328
2476
|
};
|
|
2329
2477
|
UserService.updateCookieLifetime = function (forgetCustomerAfterHours) {
|
|
2330
|
-
if (UserService.getCustomerId()) {
|
|
2478
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie && UserService.getCustomerId()) {
|
|
2331
2479
|
UserService.setCustomerId(UserService.getCustomerId(), 3600 * forgetCustomerAfterHours);
|
|
2332
2480
|
}
|
|
2333
2481
|
};
|
|
2482
|
+
UserService.switchToCookieModeAfterConsent = function () {
|
|
2483
|
+
this.custidStoreMode = _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie;
|
|
2484
|
+
var customerId = this.customerId;
|
|
2485
|
+
/* let customerId = null
|
|
2486
|
+
try {
|
|
2487
|
+
customerId = sessionStorage.getItem(customerIdCookieName)
|
|
2488
|
+
} catch (e) {
|
|
2489
|
+
console.log('Session storage blocked.')
|
|
2490
|
+
}*/
|
|
2491
|
+
if (customerId !== null) {
|
|
2492
|
+
UserService.saveCustomerId(customerId);
|
|
2493
|
+
/* try {
|
|
2494
|
+
sessionStorage.removeItem(customerIdCookieName)
|
|
2495
|
+
} catch (e) {
|
|
2496
|
+
console.log('Session storage blocked.')
|
|
2497
|
+
}*/
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
UserService.switchToSessionModeAfterConsentDismiss = function () {
|
|
2501
|
+
var customerId = ___WEBPACK_IMPORTED_MODULE_0__.CookieService.get(customerIdCookieName);
|
|
2502
|
+
UserService.deleteCustomerId();
|
|
2503
|
+
this.custidStoreMode = _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.session;
|
|
2504
|
+
if (customerId !== null) {
|
|
2505
|
+
this.customerId = customerId;
|
|
2506
|
+
/* try {
|
|
2507
|
+
sessionStorage.setItem(customerIdCookieName, customerId)
|
|
2508
|
+
} catch (e) {
|
|
2509
|
+
console.log('Session storage blocked.');
|
|
2510
|
+
}*/
|
|
2511
|
+
}
|
|
2512
|
+
};
|
|
2334
2513
|
UserService.touchUser = function (clientId, locale, csrfToken, context) {
|
|
2514
|
+
var _this = this;
|
|
2335
2515
|
return new Promise(function (resolve) {
|
|
2336
2516
|
var source = 'pwa-embed';
|
|
2337
|
-
var customerId =
|
|
2517
|
+
var customerId = _this.getCustomerId();
|
|
2338
2518
|
if (!clientId) {
|
|
2339
2519
|
throw new Error('Client ID is undefined');
|
|
2340
2520
|
}
|
|
2341
2521
|
if (location.pathname.indexOf('/g/') !== -1) {
|
|
2342
2522
|
source = 'pwa-c2o';
|
|
2343
2523
|
}
|
|
2524
|
+
if (_this.loadGaContext) {
|
|
2525
|
+
var ga = _ga_service__WEBPACK_IMPORTED_MODULE_3__.GaService.getGaValue();
|
|
2526
|
+
if (ga !== null) {
|
|
2527
|
+
context['_ga'] = ga;
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2344
2530
|
// remove one month later 03.03.2021
|
|
2345
2531
|
if (!customerId && customerId !== 'null') {
|
|
2346
|
-
___WEBPACK_IMPORTED_MODULE_0__
|
|
2532
|
+
___WEBPACK_IMPORTED_MODULE_0__.ApiService.createUser({
|
|
2347
2533
|
clientId: clientId,
|
|
2348
2534
|
source: source,
|
|
2349
2535
|
locale: locale,
|
|
@@ -2356,8 +2542,8 @@ var UserService = /** @class */ (function () {
|
|
|
2356
2542
|
});
|
|
2357
2543
|
}
|
|
2358
2544
|
else {
|
|
2359
|
-
var currentURL =
|
|
2360
|
-
___WEBPACK_IMPORTED_MODULE_0__
|
|
2545
|
+
var currentURL = (0,_core_utils__WEBPACK_IMPORTED_MODULE_1__.parseUrlParam)(window.location.href, 'curl');
|
|
2546
|
+
___WEBPACK_IMPORTED_MODULE_0__.ApiService.validateUser({
|
|
2361
2547
|
clientId: clientId,
|
|
2362
2548
|
customerId: customerId,
|
|
2363
2549
|
currentURL: currentURL,
|
|
@@ -2365,8 +2551,9 @@ var UserService = /** @class */ (function () {
|
|
|
2365
2551
|
})
|
|
2366
2552
|
.then(function () {
|
|
2367
2553
|
resolve(customerId);
|
|
2368
|
-
})
|
|
2369
|
-
|
|
2554
|
+
})
|
|
2555
|
+
.catch(function () {
|
|
2556
|
+
___WEBPACK_IMPORTED_MODULE_0__.ApiService.createUser({
|
|
2370
2557
|
clientId: clientId,
|
|
2371
2558
|
source: source,
|
|
2372
2559
|
locale: locale,
|
|
@@ -2381,10 +2568,17 @@ var UserService = /** @class */ (function () {
|
|
|
2381
2568
|
});
|
|
2382
2569
|
};
|
|
2383
2570
|
UserService.deleteUser = function () {
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2571
|
+
this.deleteCustomerId();
|
|
2572
|
+
/* try {
|
|
2573
|
+
sessionStorage.removeItem('ds-times-counter')
|
|
2574
|
+
sessionStorage.removeItem('ds-teaser-display')
|
|
2575
|
+
} catch (e) {
|
|
2576
|
+
console.log('Session storage blocked.')
|
|
2577
|
+
}*/
|
|
2578
|
+
};
|
|
2579
|
+
UserService.custidStoreMode = _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie;
|
|
2580
|
+
UserService.loadGaContext = false;
|
|
2581
|
+
UserService.customerId = null;
|
|
2388
2582
|
return UserService;
|
|
2389
2583
|
}());
|
|
2390
2584
|
|
|
@@ -2396,12 +2590,12 @@ var UserService = /** @class */ (function () {
|
|
|
2396
2590
|
/*!*************************************************!*\
|
|
2397
2591
|
!*** ./src/scripts/services/webchat.service.ts ***!
|
|
2398
2592
|
\*************************************************/
|
|
2399
|
-
|
|
2400
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2593
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2401
2594
|
|
|
2402
|
-
"use strict";
|
|
2403
2595
|
__webpack_require__.r(__webpack_exports__);
|
|
2404
|
-
/* harmony export
|
|
2596
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2597
|
+
/* harmony export */ WebchatService: () => (/* binding */ WebchatService)
|
|
2598
|
+
/* harmony export */ });
|
|
2405
2599
|
var WebchatService = /** @class */ (function () {
|
|
2406
2600
|
function WebchatService(options) {
|
|
2407
2601
|
this.targetWindow = options.targetWindow;
|
|
@@ -2434,12 +2628,12 @@ var WebchatService = /** @class */ (function () {
|
|
|
2434
2628
|
/*!***********************************************************!*\
|
|
2435
2629
|
!*** ./src/scripts/widgets/action-button-group.widget.ts ***!
|
|
2436
2630
|
\***********************************************************/
|
|
2437
|
-
|
|
2438
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2631
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2439
2632
|
|
|
2440
|
-
"use strict";
|
|
2441
2633
|
__webpack_require__.r(__webpack_exports__);
|
|
2442
|
-
/* harmony export
|
|
2634
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2635
|
+
/* harmony export */ ActionButtonGroupWidget: () => (/* binding */ ActionButtonGroupWidget)
|
|
2636
|
+
/* harmony export */ });
|
|
2443
2637
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
2444
2638
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
2445
2639
|
/* harmony import */ var _action_button_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./action-button.widget */ "./src/scripts/widgets/action-button.widget.ts");
|
|
@@ -2448,10 +2642,12 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
2448
2642
|
var extendStatics = function (d, b) {
|
|
2449
2643
|
extendStatics = Object.setPrototypeOf ||
|
|
2450
2644
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2451
|
-
function (d, b) { for (var p in b) if (
|
|
2645
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2452
2646
|
return extendStatics(d, b);
|
|
2453
2647
|
};
|
|
2454
2648
|
return function (d, b) {
|
|
2649
|
+
if (typeof b !== "function" && b !== null)
|
|
2650
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2455
2651
|
extendStatics(d, b);
|
|
2456
2652
|
function __() { this.constructor = d; }
|
|
2457
2653
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -2469,20 +2665,23 @@ var ActionButtonGroupWidget = /** @class */ (function (_super) {
|
|
|
2469
2665
|
return _this;
|
|
2470
2666
|
}
|
|
2471
2667
|
ActionButtonGroupWidget.prototype.getBaseCls = function () {
|
|
2472
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2668
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.actionButtonGroupCls;
|
|
2473
2669
|
};
|
|
2474
2670
|
ActionButtonGroupWidget.prototype.getDisplayMode = function () {
|
|
2475
2671
|
return 'flex';
|
|
2476
2672
|
};
|
|
2477
2673
|
ActionButtonGroupWidget.prototype.addButton = function (options) {
|
|
2478
|
-
var button = new _action_button_widget__WEBPACK_IMPORTED_MODULE_2__
|
|
2674
|
+
var button = new _action_button_widget__WEBPACK_IMPORTED_MODULE_2__.ActionButtonWidget({
|
|
2479
2675
|
locale: options.locale,
|
|
2480
|
-
actionButton: _models__WEBPACK_IMPORTED_MODULE_3__
|
|
2676
|
+
actionButton: _models__WEBPACK_IMPORTED_MODULE_3__.ActionButton.fromJson(options),
|
|
2481
2677
|
renderTo: this.getBoxElem(),
|
|
2482
2678
|
app: options.app,
|
|
2483
2679
|
});
|
|
2484
2680
|
this.buttons.push(button);
|
|
2485
2681
|
};
|
|
2682
|
+
ActionButtonGroupWidget.prototype.getButtons = function () {
|
|
2683
|
+
return this.buttons;
|
|
2684
|
+
};
|
|
2486
2685
|
ActionButtonGroupWidget.prototype.clearButtons = function () {
|
|
2487
2686
|
this.buttons.forEach(function (item) { return item.destroy(); });
|
|
2488
2687
|
};
|
|
@@ -2504,7 +2703,7 @@ var ActionButtonGroupWidget = /** @class */ (function (_super) {
|
|
|
2504
2703
|
_super.prototype.hideNode.call(this);
|
|
2505
2704
|
};
|
|
2506
2705
|
return ActionButtonGroupWidget;
|
|
2507
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
2706
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
2508
2707
|
|
|
2509
2708
|
|
|
2510
2709
|
|
|
@@ -2514,12 +2713,12 @@ var ActionButtonGroupWidget = /** @class */ (function (_super) {
|
|
|
2514
2713
|
/*!*****************************************************!*\
|
|
2515
2714
|
!*** ./src/scripts/widgets/action-button.widget.ts ***!
|
|
2516
2715
|
\*****************************************************/
|
|
2517
|
-
|
|
2518
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2716
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2519
2717
|
|
|
2520
|
-
"use strict";
|
|
2521
2718
|
__webpack_require__.r(__webpack_exports__);
|
|
2522
|
-
/* harmony export
|
|
2719
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2720
|
+
/* harmony export */ ActionButtonWidget: () => (/* binding */ ActionButtonWidget)
|
|
2721
|
+
/* harmony export */ });
|
|
2523
2722
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
2524
2723
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
2525
2724
|
/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../models */ "./src/scripts/models/index.ts");
|
|
@@ -2527,10 +2726,12 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
2527
2726
|
var extendStatics = function (d, b) {
|
|
2528
2727
|
extendStatics = Object.setPrototypeOf ||
|
|
2529
2728
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2530
|
-
function (d, b) { for (var p in b) if (
|
|
2729
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2531
2730
|
return extendStatics(d, b);
|
|
2532
2731
|
};
|
|
2533
2732
|
return function (d, b) {
|
|
2733
|
+
if (typeof b !== "function" && b !== null)
|
|
2734
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2534
2735
|
extendStatics(d, b);
|
|
2535
2736
|
function __() { this.constructor = d; }
|
|
2536
2737
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -2543,16 +2744,12 @@ var ActionButtonWidget = /** @class */ (function (_super) {
|
|
|
2543
2744
|
__extends(ActionButtonWidget, _super);
|
|
2544
2745
|
function ActionButtonWidget(options) {
|
|
2545
2746
|
var _this = _super.call(this, options) || this;
|
|
2546
|
-
|
|
2547
|
-
if (!title) {
|
|
2548
|
-
title = 'Button';
|
|
2549
|
-
}
|
|
2550
|
-
_this.setContent(title);
|
|
2747
|
+
_this.setLocale(_this.locale);
|
|
2551
2748
|
return _this;
|
|
2552
2749
|
}
|
|
2553
2750
|
ActionButtonWidget.prototype.bindEvents = function () {
|
|
2554
2751
|
var _this = this;
|
|
2555
|
-
if (this.actionButton.getType() === _models__WEBPACK_IMPORTED_MODULE_2__
|
|
2752
|
+
if (this.actionButton.getType() === _models__WEBPACK_IMPORTED_MODULE_2__.ActionButtonType.quickreply) {
|
|
2556
2753
|
this.getBoxElem().addEventListener('click', function () {
|
|
2557
2754
|
_this.app.triggerElement({
|
|
2558
2755
|
successor: _this.actionButton.getSuccessor(),
|
|
@@ -2560,7 +2757,7 @@ var ActionButtonWidget = /** @class */ (function (_super) {
|
|
|
2560
2757
|
});
|
|
2561
2758
|
});
|
|
2562
2759
|
}
|
|
2563
|
-
if (this.actionButton.getType() === _models__WEBPACK_IMPORTED_MODULE_2__
|
|
2760
|
+
if (this.actionButton.getType() === _models__WEBPACK_IMPORTED_MODULE_2__.ActionButtonType.callback) {
|
|
2564
2761
|
this.getBoxElem().addEventListener('click', function () {
|
|
2565
2762
|
var callback = _this.actionButton.getCallback();
|
|
2566
2763
|
callback();
|
|
@@ -2572,10 +2769,18 @@ var ActionButtonWidget = /** @class */ (function (_super) {
|
|
|
2572
2769
|
this.bindEvents();
|
|
2573
2770
|
};
|
|
2574
2771
|
ActionButtonWidget.prototype.getBaseCls = function () {
|
|
2575
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2772
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.actionButtonCls;
|
|
2773
|
+
};
|
|
2774
|
+
ActionButtonWidget.prototype.setLocale = function (locale) {
|
|
2775
|
+
this.locale = locale;
|
|
2776
|
+
var title = this.actionButton.getTitle(this.locale);
|
|
2777
|
+
if (!title) {
|
|
2778
|
+
title = 'Press me';
|
|
2779
|
+
}
|
|
2780
|
+
this.setContent(title);
|
|
2576
2781
|
};
|
|
2577
2782
|
return ActionButtonWidget;
|
|
2578
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
2783
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
2579
2784
|
|
|
2580
2785
|
|
|
2581
2786
|
|
|
@@ -2585,22 +2790,25 @@ var ActionButtonWidget = /** @class */ (function (_super) {
|
|
|
2585
2790
|
/*!***************************************************!*\
|
|
2586
2791
|
!*** ./src/scripts/widgets/chat-button.widget.ts ***!
|
|
2587
2792
|
\***************************************************/
|
|
2588
|
-
|
|
2589
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2793
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2590
2794
|
|
|
2591
|
-
"use strict";
|
|
2592
2795
|
__webpack_require__.r(__webpack_exports__);
|
|
2593
|
-
/* harmony export
|
|
2796
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2797
|
+
/* harmony export */ ChatButtonWidget: () => (/* binding */ ChatButtonWidget)
|
|
2798
|
+
/* harmony export */ });
|
|
2594
2799
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
2595
2800
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
2801
|
+
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../consts */ "./src/scripts/consts.ts");
|
|
2596
2802
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
2597
2803
|
var extendStatics = function (d, b) {
|
|
2598
2804
|
extendStatics = Object.setPrototypeOf ||
|
|
2599
2805
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2600
|
-
function (d, b) { for (var p in b) if (
|
|
2806
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2601
2807
|
return extendStatics(d, b);
|
|
2602
2808
|
};
|
|
2603
2809
|
return function (d, b) {
|
|
2810
|
+
if (typeof b !== "function" && b !== null)
|
|
2811
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2604
2812
|
extendStatics(d, b);
|
|
2605
2813
|
function __() { this.constructor = d; }
|
|
2606
2814
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -2608,6 +2816,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
2608
2816
|
})();
|
|
2609
2817
|
|
|
2610
2818
|
|
|
2819
|
+
|
|
2611
2820
|
var ChatButtonWidget = /** @class */ (function (_super) {
|
|
2612
2821
|
__extends(ChatButtonWidget, _super);
|
|
2613
2822
|
function ChatButtonWidget(options) {
|
|
@@ -2622,26 +2831,34 @@ var ChatButtonWidget = /** @class */ (function (_super) {
|
|
|
2622
2831
|
});
|
|
2623
2832
|
};
|
|
2624
2833
|
ChatButtonWidget.prototype.getBaseCls = function () {
|
|
2625
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2834
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonCls;
|
|
2626
2835
|
};
|
|
2627
2836
|
ChatButtonWidget.prototype.render = function () {
|
|
2628
2837
|
var boxElem = this.getBoxElem();
|
|
2629
|
-
|
|
2838
|
+
var iconContainer = document.createElement('div');
|
|
2839
|
+
iconContainer.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonIconContainerCls);
|
|
2840
|
+
iconContainer.innerHTML = _consts__WEBPACK_IMPORTED_MODULE_2__.iconSvg;
|
|
2841
|
+
boxElem.appendChild(iconContainer);
|
|
2842
|
+
boxElem.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonLogoCls);
|
|
2630
2843
|
this.bindEvents();
|
|
2631
2844
|
_super.prototype.render.call(this);
|
|
2632
2845
|
};
|
|
2633
|
-
ChatButtonWidget.prototype.toggle = function (state, suppressEvent) {
|
|
2846
|
+
ChatButtonWidget.prototype.toggle = function (state, suppressEvent, timeout) {
|
|
2847
|
+
var _this = this;
|
|
2634
2848
|
if (suppressEvent === void 0) { suppressEvent = false; }
|
|
2849
|
+
if (timeout === void 0) { timeout = 100; }
|
|
2635
2850
|
var isPressed = state === undefined ? !this.isPressed : !!state;
|
|
2636
2851
|
if (isPressed === this.isPressed) {
|
|
2637
2852
|
return;
|
|
2638
2853
|
}
|
|
2639
2854
|
this.isPressed = isPressed;
|
|
2640
2855
|
if (isPressed) {
|
|
2641
|
-
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2856
|
+
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonHiddenCls);
|
|
2642
2857
|
}
|
|
2643
2858
|
else {
|
|
2644
|
-
|
|
2859
|
+
setTimeout(function () {
|
|
2860
|
+
_this.getBoxElem().classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonHiddenCls);
|
|
2861
|
+
}, timeout);
|
|
2645
2862
|
}
|
|
2646
2863
|
if (!suppressEvent) {
|
|
2647
2864
|
this.fire('toggle', {
|
|
@@ -2652,14 +2869,14 @@ var ChatButtonWidget = /** @class */ (function (_super) {
|
|
|
2652
2869
|
ChatButtonWidget.prototype.setContent = function (text) {
|
|
2653
2870
|
_super.prototype.setContent.call(this, text);
|
|
2654
2871
|
if (text) {
|
|
2655
|
-
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2872
|
+
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonWithTextCls);
|
|
2656
2873
|
}
|
|
2657
2874
|
else {
|
|
2658
|
-
this.getBoxElem().classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2875
|
+
this.getBoxElem().classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.buttonWithTextCls);
|
|
2659
2876
|
}
|
|
2660
2877
|
};
|
|
2661
2878
|
return ChatButtonWidget;
|
|
2662
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
2879
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
2663
2880
|
|
|
2664
2881
|
|
|
2665
2882
|
|
|
@@ -2669,22 +2886,24 @@ var ChatButtonWidget = /** @class */ (function (_super) {
|
|
|
2669
2886
|
/*!***********************************************!*\
|
|
2670
2887
|
!*** ./src/scripts/widgets/chatbox.widget.ts ***!
|
|
2671
2888
|
\***********************************************/
|
|
2672
|
-
|
|
2673
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2889
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2674
2890
|
|
|
2675
|
-
"use strict";
|
|
2676
2891
|
__webpack_require__.r(__webpack_exports__);
|
|
2677
|
-
/* harmony export
|
|
2892
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2893
|
+
/* harmony export */ ChatboxWidget: () => (/* binding */ ChatboxWidget)
|
|
2894
|
+
/* harmony export */ });
|
|
2678
2895
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
2679
2896
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
2680
2897
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
2681
2898
|
var extendStatics = function (d, b) {
|
|
2682
2899
|
extendStatics = Object.setPrototypeOf ||
|
|
2683
2900
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2684
|
-
function (d, b) { for (var p in b) if (
|
|
2901
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2685
2902
|
return extendStatics(d, b);
|
|
2686
2903
|
};
|
|
2687
2904
|
return function (d, b) {
|
|
2905
|
+
if (typeof b !== "function" && b !== null)
|
|
2906
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2688
2907
|
extendStatics(d, b);
|
|
2689
2908
|
function __() { this.constructor = d; }
|
|
2690
2909
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -2700,11 +2919,11 @@ var ChatboxWidget = /** @class */ (function (_super) {
|
|
|
2700
2919
|
_this.setState('loading');
|
|
2701
2920
|
if (options.hasExtendedWidth) {
|
|
2702
2921
|
_this.hasExtendedWidth = true;
|
|
2703
|
-
_this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2922
|
+
_this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatHasExtendedWidth);
|
|
2704
2923
|
}
|
|
2705
|
-
_this.on('before:show', function () { return document.body.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2924
|
+
_this.on('before:show', function () { return document.body.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatIsOpen); });
|
|
2706
2925
|
_this.on('before:hide', function () {
|
|
2707
|
-
return document.body.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2926
|
+
return document.body.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatIsOpen);
|
|
2708
2927
|
});
|
|
2709
2928
|
return _this;
|
|
2710
2929
|
}
|
|
@@ -2714,45 +2933,47 @@ var ChatboxWidget = /** @class */ (function (_super) {
|
|
|
2714
2933
|
boxElem.style.visibility = 'visible';
|
|
2715
2934
|
setTimeout(function () {
|
|
2716
2935
|
boxElem.style.opacity = '1';
|
|
2936
|
+
boxElem.style.transform = 'translateY(0)';
|
|
2717
2937
|
});
|
|
2718
2938
|
};
|
|
2719
2939
|
ChatboxWidget.prototype.hideNode = function () {
|
|
2720
2940
|
var boxElem = this.getBoxElem();
|
|
2721
2941
|
boxElem.style.opacity = '0';
|
|
2942
|
+
boxElem.style.transform = 'translateY(10px)';
|
|
2722
2943
|
setTimeout(function () {
|
|
2723
2944
|
boxElem.style.zIndex = '-1';
|
|
2724
2945
|
boxElem.style.visibility = 'hidden';
|
|
2725
|
-
});
|
|
2946
|
+
}, 100);
|
|
2726
2947
|
};
|
|
2727
2948
|
ChatboxWidget.prototype.getBaseCls = function () {
|
|
2728
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2949
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatCls;
|
|
2729
2950
|
};
|
|
2730
2951
|
ChatboxWidget.prototype.setState = function (state) {
|
|
2731
2952
|
if (state === 'loading') {
|
|
2732
|
-
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2953
|
+
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatLoadingCls);
|
|
2733
2954
|
}
|
|
2734
2955
|
if (state === 'ready') {
|
|
2735
|
-
this.getBoxElem().classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2956
|
+
this.getBoxElem().classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatLoadingCls);
|
|
2736
2957
|
}
|
|
2737
2958
|
};
|
|
2738
2959
|
ChatboxWidget.prototype.renderLoader = function () {
|
|
2739
2960
|
var loaderAnimation = '<svg xmlns="http://www.w3.org/2000/svg" width="64px" height="64px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><g transform="rotate(0 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(30 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(60 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.75s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(90 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(120 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(150 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(180 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(210 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(240 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.25s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(270 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(300 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"></animate></rect></g><g transform="rotate(330 50 50)"><rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#6a6a6a"><animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate></rect></g></svg>';
|
|
2740
2961
|
var loader = document.createElement('div');
|
|
2741
|
-
loader.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2962
|
+
loader.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatLoaderCls);
|
|
2742
2963
|
var loaderImage = document.createElement('div');
|
|
2743
|
-
loaderImage.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2964
|
+
loaderImage.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatLoaderImageCls);
|
|
2744
2965
|
loaderImage.innerHTML = loaderAnimation;
|
|
2745
2966
|
loader.appendChild(loaderImage);
|
|
2746
2967
|
return loader;
|
|
2747
2968
|
};
|
|
2748
2969
|
ChatboxWidget.prototype.render = function (renderTo) {
|
|
2749
2970
|
var boxElem = this.getBoxElem();
|
|
2750
|
-
boxElem.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
2971
|
+
boxElem.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.chatCls);
|
|
2751
2972
|
boxElem.appendChild(this.renderLoader());
|
|
2752
2973
|
_super.prototype.render.call(this, renderTo);
|
|
2753
2974
|
};
|
|
2754
2975
|
return ChatboxWidget;
|
|
2755
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
2976
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
2756
2977
|
|
|
2757
2978
|
|
|
2758
2979
|
|
|
@@ -2762,22 +2983,24 @@ var ChatboxWidget = /** @class */ (function (_super) {
|
|
|
2762
2983
|
/*!*******************************************************!*\
|
|
2763
2984
|
!*** ./src/scripts/widgets/content-wrapper.widget.ts ***!
|
|
2764
2985
|
\*******************************************************/
|
|
2765
|
-
|
|
2766
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2986
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2767
2987
|
|
|
2768
|
-
"use strict";
|
|
2769
2988
|
__webpack_require__.r(__webpack_exports__);
|
|
2770
|
-
/* harmony export
|
|
2989
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2990
|
+
/* harmony export */ ContentWrapperWidget: () => (/* binding */ ContentWrapperWidget)
|
|
2991
|
+
/* harmony export */ });
|
|
2771
2992
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
2772
2993
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
2773
2994
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
2774
2995
|
var extendStatics = function (d, b) {
|
|
2775
2996
|
extendStatics = Object.setPrototypeOf ||
|
|
2776
2997
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2777
|
-
function (d, b) { for (var p in b) if (
|
|
2998
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2778
2999
|
return extendStatics(d, b);
|
|
2779
3000
|
};
|
|
2780
3001
|
return function (d, b) {
|
|
3002
|
+
if (typeof b !== "function" && b !== null)
|
|
3003
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2781
3004
|
extendStatics(d, b);
|
|
2782
3005
|
function __() { this.constructor = d; }
|
|
2783
3006
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -2793,10 +3016,179 @@ var ContentWrapperWidget = /** @class */ (function (_super) {
|
|
|
2793
3016
|
return _this;
|
|
2794
3017
|
}
|
|
2795
3018
|
ContentWrapperWidget.prototype.getBaseCls = function () {
|
|
2796
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
3019
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.contentWrapperCls;
|
|
2797
3020
|
};
|
|
2798
3021
|
return ContentWrapperWidget;
|
|
2799
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
3022
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
3023
|
+
|
|
3024
|
+
|
|
3025
|
+
|
|
3026
|
+
/***/ }),
|
|
3027
|
+
|
|
3028
|
+
/***/ "./src/scripts/widgets/footer.widget.ts":
|
|
3029
|
+
/*!**********************************************!*\
|
|
3030
|
+
!*** ./src/scripts/widgets/footer.widget.ts ***!
|
|
3031
|
+
\**********************************************/
|
|
3032
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3033
|
+
|
|
3034
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3035
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3036
|
+
/* harmony export */ FooterWidget: () => (/* binding */ FooterWidget)
|
|
3037
|
+
/* harmony export */ });
|
|
3038
|
+
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3039
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3040
|
+
var extendStatics = function (d, b) {
|
|
3041
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3042
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3043
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3044
|
+
return extendStatics(d, b);
|
|
3045
|
+
};
|
|
3046
|
+
return function (d, b) {
|
|
3047
|
+
if (typeof b !== "function" && b !== null)
|
|
3048
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3049
|
+
extendStatics(d, b);
|
|
3050
|
+
function __() { this.constructor = d; }
|
|
3051
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3052
|
+
};
|
|
3053
|
+
})();
|
|
3054
|
+
|
|
3055
|
+
var config = {
|
|
3056
|
+
baseCls: 'ds-footer',
|
|
3057
|
+
};
|
|
3058
|
+
var FooterWidget = /** @class */ (function (_super) {
|
|
3059
|
+
__extends(FooterWidget, _super);
|
|
3060
|
+
function FooterWidget(options) {
|
|
3061
|
+
return _super.call(this, options) || this;
|
|
3062
|
+
}
|
|
3063
|
+
FooterWidget.prototype.getBaseCls = function () {
|
|
3064
|
+
return config.baseCls;
|
|
3065
|
+
};
|
|
3066
|
+
return FooterWidget;
|
|
3067
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
3068
|
+
|
|
3069
|
+
|
|
3070
|
+
|
|
3071
|
+
/***/ }),
|
|
3072
|
+
|
|
3073
|
+
/***/ "./src/scripts/widgets/header/header-close-button.widget.ts":
|
|
3074
|
+
/*!******************************************************************!*\
|
|
3075
|
+
!*** ./src/scripts/widgets/header/header-close-button.widget.ts ***!
|
|
3076
|
+
\******************************************************************/
|
|
3077
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3078
|
+
|
|
3079
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3080
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3081
|
+
/* harmony export */ HeaderCloseButtonWidget: () => (/* binding */ HeaderCloseButtonWidget)
|
|
3082
|
+
/* harmony export */ });
|
|
3083
|
+
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3084
|
+
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config/config */ "./src/scripts/config/config.ts");
|
|
3085
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3086
|
+
var extendStatics = function (d, b) {
|
|
3087
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3088
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3089
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3090
|
+
return extendStatics(d, b);
|
|
3091
|
+
};
|
|
3092
|
+
return function (d, b) {
|
|
3093
|
+
if (typeof b !== "function" && b !== null)
|
|
3094
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3095
|
+
extendStatics(d, b);
|
|
3096
|
+
function __() { this.constructor = d; }
|
|
3097
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3098
|
+
};
|
|
3099
|
+
})();
|
|
3100
|
+
|
|
3101
|
+
|
|
3102
|
+
var HeaderCloseButtonWidget = /** @class */ (function (_super) {
|
|
3103
|
+
__extends(HeaderCloseButtonWidget, _super);
|
|
3104
|
+
function HeaderCloseButtonWidget(options) {
|
|
3105
|
+
var _this = _super.call(this, options) || this;
|
|
3106
|
+
_this.leftCloseButton = options.leftCloseButton;
|
|
3107
|
+
return _this;
|
|
3108
|
+
}
|
|
3109
|
+
HeaderCloseButtonWidget.prototype.bindEvents = function () {
|
|
3110
|
+
var _this = this;
|
|
3111
|
+
this.getBoxElem().addEventListener('click', function () {
|
|
3112
|
+
_this.fire('click');
|
|
3113
|
+
});
|
|
3114
|
+
};
|
|
3115
|
+
HeaderCloseButtonWidget.prototype.render = function () {
|
|
3116
|
+
_super.prototype.render.call(this);
|
|
3117
|
+
this.bindEvents();
|
|
3118
|
+
};
|
|
3119
|
+
HeaderCloseButtonWidget.prototype.getBaseCls = function () {
|
|
3120
|
+
var cls = _config_config__WEBPACK_IMPORTED_MODULE_1__.config.headerCloseButtonCls;
|
|
3121
|
+
if (this.leftCloseButton) {
|
|
3122
|
+
cls += " ".concat(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.headerCloseButtonLeftCls);
|
|
3123
|
+
}
|
|
3124
|
+
return cls;
|
|
3125
|
+
};
|
|
3126
|
+
return HeaderCloseButtonWidget;
|
|
3127
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
3128
|
+
|
|
3129
|
+
|
|
3130
|
+
|
|
3131
|
+
/***/ }),
|
|
3132
|
+
|
|
3133
|
+
/***/ "./src/scripts/widgets/header/header.widget.ts":
|
|
3134
|
+
/*!*****************************************************!*\
|
|
3135
|
+
!*** ./src/scripts/widgets/header/header.widget.ts ***!
|
|
3136
|
+
\*****************************************************/
|
|
3137
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3138
|
+
|
|
3139
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3140
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3141
|
+
/* harmony export */ HeaderWidget: () => (/* binding */ HeaderWidget)
|
|
3142
|
+
/* harmony export */ });
|
|
3143
|
+
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3144
|
+
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config/config */ "./src/scripts/config/config.ts");
|
|
3145
|
+
/* harmony import */ var _header_close_button_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./header-close-button.widget */ "./src/scripts/widgets/header/header-close-button.widget.ts");
|
|
3146
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3147
|
+
var extendStatics = function (d, b) {
|
|
3148
|
+
extendStatics = Object.setPrototypeOf ||
|
|
3149
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3150
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3151
|
+
return extendStatics(d, b);
|
|
3152
|
+
};
|
|
3153
|
+
return function (d, b) {
|
|
3154
|
+
if (typeof b !== "function" && b !== null)
|
|
3155
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3156
|
+
extendStatics(d, b);
|
|
3157
|
+
function __() { this.constructor = d; }
|
|
3158
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3159
|
+
};
|
|
3160
|
+
})();
|
|
3161
|
+
|
|
3162
|
+
|
|
3163
|
+
|
|
3164
|
+
var HeaderWidget = /** @class */ (function (_super) {
|
|
3165
|
+
__extends(HeaderWidget, _super);
|
|
3166
|
+
function HeaderWidget(options) {
|
|
3167
|
+
var _this = _super.call(this, options) || this;
|
|
3168
|
+
_this.leftCloseButton = options.leftCloseButton;
|
|
3169
|
+
return _this;
|
|
3170
|
+
}
|
|
3171
|
+
HeaderWidget.prototype.getBaseCls = function () {
|
|
3172
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.headerCls;
|
|
3173
|
+
};
|
|
3174
|
+
HeaderWidget.prototype.getDisplayMode = function () {
|
|
3175
|
+
return 'flex';
|
|
3176
|
+
};
|
|
3177
|
+
HeaderWidget.prototype.renderCloseButton = function () {
|
|
3178
|
+
this.closeButton = new _header_close_button_widget__WEBPACK_IMPORTED_MODULE_2__.HeaderCloseButtonWidget({
|
|
3179
|
+
renderTo: this.getBoxElem(),
|
|
3180
|
+
leftCloseButton: this.leftCloseButton,
|
|
3181
|
+
});
|
|
3182
|
+
};
|
|
3183
|
+
HeaderWidget.prototype.getCloseButton = function () {
|
|
3184
|
+
return this.closeButton;
|
|
3185
|
+
};
|
|
3186
|
+
HeaderWidget.prototype.render = function (renderTo) {
|
|
3187
|
+
_super.prototype.render.call(this, renderTo);
|
|
3188
|
+
this.renderCloseButton();
|
|
3189
|
+
};
|
|
3190
|
+
return HeaderWidget;
|
|
3191
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
2800
3192
|
|
|
2801
3193
|
|
|
2802
3194
|
|
|
@@ -2806,21 +3198,23 @@ var ContentWrapperWidget = /** @class */ (function (_super) {
|
|
|
2806
3198
|
/*!**************************************************!*\
|
|
2807
3199
|
!*** ./src/scripts/widgets/iframe-box.widget.ts ***!
|
|
2808
3200
|
\**************************************************/
|
|
2809
|
-
|
|
2810
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3201
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2811
3202
|
|
|
2812
|
-
"use strict";
|
|
2813
3203
|
__webpack_require__.r(__webpack_exports__);
|
|
2814
|
-
/* harmony export
|
|
3204
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3205
|
+
/* harmony export */ IframeBoxWidget: () => (/* binding */ IframeBoxWidget)
|
|
3206
|
+
/* harmony export */ });
|
|
2815
3207
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
2816
3208
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
2817
3209
|
var extendStatics = function (d, b) {
|
|
2818
3210
|
extendStatics = Object.setPrototypeOf ||
|
|
2819
3211
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2820
|
-
function (d, b) { for (var p in b) if (
|
|
3212
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2821
3213
|
return extendStatics(d, b);
|
|
2822
3214
|
};
|
|
2823
3215
|
return function (d, b) {
|
|
3216
|
+
if (typeof b !== "function" && b !== null)
|
|
3217
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2824
3218
|
extendStatics(d, b);
|
|
2825
3219
|
function __() { this.constructor = d; }
|
|
2826
3220
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -2844,21 +3238,18 @@ var IframeBoxWidget = /** @class */ (function (_super) {
|
|
|
2844
3238
|
IframeBoxWidget.prototype.getBaseCls = function () {
|
|
2845
3239
|
return config.baseCls;
|
|
2846
3240
|
};
|
|
2847
|
-
// getBoxElem(): HTMLIFrameElement {
|
|
2848
|
-
// return super.getBoxElem() as HTMLIFrameElement
|
|
2849
|
-
// }
|
|
2850
3241
|
IframeBoxWidget.prototype.isLoaded = function () {
|
|
2851
3242
|
return this.loaded;
|
|
2852
3243
|
};
|
|
2853
|
-
// createNode(): HTMLIFrameElement {
|
|
2854
|
-
// return document.createElement('iframe')
|
|
2855
|
-
// }
|
|
2856
3244
|
IframeBoxWidget.prototype.load = function (url) {
|
|
2857
3245
|
if (!this.iframe) {
|
|
2858
3246
|
this.iframe = document.createElement('iframe');
|
|
2859
3247
|
this.iframe.src = url;
|
|
2860
3248
|
this.iframe.scrolling = 'yes';
|
|
2861
3249
|
this.iframe.frameBorder = '0';
|
|
3250
|
+
this.iframe.sandbox.add('allow-same-origin');
|
|
3251
|
+
this.iframe.sandbox.add('allow-scripts');
|
|
3252
|
+
this.iframe.sandbox.add('allow-forms');
|
|
2862
3253
|
this.getBoxElem().appendChild(this.iframe);
|
|
2863
3254
|
}
|
|
2864
3255
|
else {
|
|
@@ -2889,10 +3280,10 @@ var IframeBoxWidget = /** @class */ (function (_super) {
|
|
|
2889
3280
|
});
|
|
2890
3281
|
};
|
|
2891
3282
|
IframeBoxWidget.prototype.setWidth = function (width) {
|
|
2892
|
-
this.getBoxElem().style.width = width
|
|
3283
|
+
this.getBoxElem().style.width = "".concat(width, "px");
|
|
2893
3284
|
};
|
|
2894
3285
|
return IframeBoxWidget;
|
|
2895
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
3286
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
2896
3287
|
|
|
2897
3288
|
|
|
2898
3289
|
|
|
@@ -2902,22 +3293,24 @@ var IframeBoxWidget = /** @class */ (function (_super) {
|
|
|
2902
3293
|
/*!**********************************************!*\
|
|
2903
3294
|
!*** ./src/scripts/widgets/iframe.widget.ts ***!
|
|
2904
3295
|
\**********************************************/
|
|
2905
|
-
|
|
2906
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3296
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2907
3297
|
|
|
2908
|
-
"use strict";
|
|
2909
3298
|
__webpack_require__.r(__webpack_exports__);
|
|
2910
|
-
/* harmony export
|
|
3299
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3300
|
+
/* harmony export */ IframeWidget: () => (/* binding */ IframeWidget)
|
|
3301
|
+
/* harmony export */ });
|
|
2911
3302
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
2912
3303
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
2913
3304
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
2914
3305
|
var extendStatics = function (d, b) {
|
|
2915
3306
|
extendStatics = Object.setPrototypeOf ||
|
|
2916
3307
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2917
|
-
function (d, b) { for (var p in b) if (
|
|
3308
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2918
3309
|
return extendStatics(d, b);
|
|
2919
3310
|
};
|
|
2920
3311
|
return function (d, b) {
|
|
3312
|
+
if (typeof b !== "function" && b !== null)
|
|
3313
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2921
3314
|
extendStatics(d, b);
|
|
2922
3315
|
function __() { this.constructor = d; }
|
|
2923
3316
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -2935,10 +3328,11 @@ var IframeWidget = /** @class */ (function (_super) {
|
|
|
2935
3328
|
suppress: false,
|
|
2936
3329
|
};
|
|
2937
3330
|
_this.initialElement = options.initialElement;
|
|
3331
|
+
_this.channel = options.channel || 'pwa-embed';
|
|
2938
3332
|
return _this;
|
|
2939
3333
|
}
|
|
2940
3334
|
IframeWidget.prototype.getBaseCls = function () {
|
|
2941
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
3335
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.iframeCls;
|
|
2942
3336
|
};
|
|
2943
3337
|
IframeWidget.prototype.getBoxElem = function () {
|
|
2944
3338
|
return _super.prototype.getBoxElem.call(this);
|
|
@@ -2956,18 +3350,19 @@ var IframeWidget = /** @class */ (function (_super) {
|
|
|
2956
3350
|
return Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
2957
3351
|
};
|
|
2958
3352
|
IframeWidget.prototype.buildUrl = function () {
|
|
2959
|
-
var iframeUrl = this.host
|
|
3353
|
+
var iframeUrl = "".concat(this.host, "?clid=").concat(this.id, "&cid=").concat(this.customerId);
|
|
2960
3354
|
if (this.initialElement.suppress) {
|
|
2961
3355
|
iframeUrl += '&init=suppress';
|
|
2962
3356
|
}
|
|
2963
3357
|
else if (this.initialElement.successor) {
|
|
2964
|
-
iframeUrl += "&init="
|
|
3358
|
+
iframeUrl += "&init=".concat(this.initialElement.successor);
|
|
2965
3359
|
}
|
|
2966
3360
|
if (this.locale) {
|
|
2967
|
-
iframeUrl += "&lg="
|
|
3361
|
+
iframeUrl += "&lg=".concat(this.locale);
|
|
2968
3362
|
}
|
|
2969
|
-
iframeUrl += "&
|
|
2970
|
-
iframeUrl += "&
|
|
3363
|
+
iframeUrl += "&source=".concat(this.channel);
|
|
3364
|
+
iframeUrl += "&viewport=".concat(this.getViewportWidth());
|
|
3365
|
+
iframeUrl += "&curl=".concat(location.origin + location.pathname);
|
|
2971
3366
|
return iframeUrl;
|
|
2972
3367
|
};
|
|
2973
3368
|
IframeWidget.prototype.load = function (customerId) {
|
|
@@ -2989,7 +3384,7 @@ var IframeWidget = /** @class */ (function (_super) {
|
|
|
2989
3384
|
this.initialElement = initialElement;
|
|
2990
3385
|
};
|
|
2991
3386
|
return IframeWidget;
|
|
2992
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
3387
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
2993
3388
|
|
|
2994
3389
|
|
|
2995
3390
|
|
|
@@ -2999,46 +3394,40 @@ var IframeWidget = /** @class */ (function (_super) {
|
|
|
2999
3394
|
/*!**************************************!*\
|
|
3000
3395
|
!*** ./src/scripts/widgets/index.ts ***!
|
|
3001
3396
|
\**************************************/
|
|
3002
|
-
|
|
3003
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3397
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3004
3398
|
|
|
3005
|
-
"use strict";
|
|
3006
3399
|
__webpack_require__.r(__webpack_exports__);
|
|
3400
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3401
|
+
/* harmony export */ ActionButtonGroupWidget: () => (/* reexport safe */ _action_button_group_widget__WEBPACK_IMPORTED_MODULE_8__.ActionButtonGroupWidget),
|
|
3402
|
+
/* harmony export */ ActionButtonWidget: () => (/* reexport safe */ _action_button_widget__WEBPACK_IMPORTED_MODULE_7__.ActionButtonWidget),
|
|
3403
|
+
/* harmony export */ ChatButtonWidget: () => (/* reexport safe */ _chat_button_widget__WEBPACK_IMPORTED_MODULE_2__.ChatButtonWidget),
|
|
3404
|
+
/* harmony export */ ChatboxWidget: () => (/* reexport safe */ _chatbox_widget__WEBPACK_IMPORTED_MODULE_1__.ChatboxWidget),
|
|
3405
|
+
/* harmony export */ ContentWrapperWidget: () => (/* reexport safe */ _content_wrapper_widget__WEBPACK_IMPORTED_MODULE_6__.ContentWrapperWidget),
|
|
3406
|
+
/* harmony export */ FooterWidget: () => (/* reexport safe */ _footer_widget__WEBPACK_IMPORTED_MODULE_13__.FooterWidget),
|
|
3407
|
+
/* harmony export */ HeaderWidget: () => (/* reexport safe */ _header_header_widget__WEBPACK_IMPORTED_MODULE_12__.HeaderWidget),
|
|
3408
|
+
/* harmony export */ IframeBoxWidget: () => (/* reexport safe */ _iframe_box_widget__WEBPACK_IMPORTED_MODULE_11__.IframeBoxWidget),
|
|
3409
|
+
/* harmony export */ IframeWidget: () => (/* reexport safe */ _iframe_widget__WEBPACK_IMPORTED_MODULE_3__.IframeWidget),
|
|
3410
|
+
/* harmony export */ TeaserWidget: () => (/* reexport safe */ _teaser_widget__WEBPACK_IMPORTED_MODULE_4__.TeaserWidget),
|
|
3411
|
+
/* harmony export */ UnreadWidget: () => (/* reexport safe */ _unread_widget__WEBPACK_IMPORTED_MODULE_5__.UnreadWidget),
|
|
3412
|
+
/* harmony export */ WhatsappButtonWidget: () => (/* reexport safe */ _whatsapp_button_widget__WEBPACK_IMPORTED_MODULE_9__.WhatsappButtonWidget),
|
|
3413
|
+
/* harmony export */ WhatsappWindowWidget: () => (/* reexport safe */ _whatsapp_window_widget__WEBPACK_IMPORTED_MODULE_10__.WhatsappWindowWidget),
|
|
3414
|
+
/* harmony export */ WrapperWidget: () => (/* reexport safe */ _wrapper_widget__WEBPACK_IMPORTED_MODULE_0__.WrapperWidget)
|
|
3415
|
+
/* harmony export */ });
|
|
3007
3416
|
/* harmony import */ var _wrapper_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapper.widget */ "./src/scripts/widgets/wrapper.widget.ts");
|
|
3008
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WrapperWidget", function() { return _wrapper_widget__WEBPACK_IMPORTED_MODULE_0__["WrapperWidget"]; });
|
|
3009
|
-
|
|
3010
3417
|
/* harmony import */ var _chatbox_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chatbox.widget */ "./src/scripts/widgets/chatbox.widget.ts");
|
|
3011
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChatboxWidget", function() { return _chatbox_widget__WEBPACK_IMPORTED_MODULE_1__["ChatboxWidget"]; });
|
|
3012
|
-
|
|
3013
3418
|
/* harmony import */ var _chat_button_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chat-button.widget */ "./src/scripts/widgets/chat-button.widget.ts");
|
|
3014
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChatButtonWidget", function() { return _chat_button_widget__WEBPACK_IMPORTED_MODULE_2__["ChatButtonWidget"]; });
|
|
3015
|
-
|
|
3016
3419
|
/* harmony import */ var _iframe_widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./iframe.widget */ "./src/scripts/widgets/iframe.widget.ts");
|
|
3017
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IframeWidget", function() { return _iframe_widget__WEBPACK_IMPORTED_MODULE_3__["IframeWidget"]; });
|
|
3018
|
-
|
|
3019
3420
|
/* harmony import */ var _teaser_widget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./teaser.widget */ "./src/scripts/widgets/teaser.widget.ts");
|
|
3020
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TeaserWidget", function() { return _teaser_widget__WEBPACK_IMPORTED_MODULE_4__["TeaserWidget"]; });
|
|
3021
|
-
|
|
3022
3421
|
/* harmony import */ var _unread_widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./unread.widget */ "./src/scripts/widgets/unread.widget.ts");
|
|
3023
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnreadWidget", function() { return _unread_widget__WEBPACK_IMPORTED_MODULE_5__["UnreadWidget"]; });
|
|
3024
|
-
|
|
3025
3422
|
/* harmony import */ var _content_wrapper_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./content-wrapper.widget */ "./src/scripts/widgets/content-wrapper.widget.ts");
|
|
3026
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ContentWrapperWidget", function() { return _content_wrapper_widget__WEBPACK_IMPORTED_MODULE_6__["ContentWrapperWidget"]; });
|
|
3027
|
-
|
|
3028
3423
|
/* harmony import */ var _action_button_widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./action-button.widget */ "./src/scripts/widgets/action-button.widget.ts");
|
|
3029
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionButtonWidget", function() { return _action_button_widget__WEBPACK_IMPORTED_MODULE_7__["ActionButtonWidget"]; });
|
|
3030
|
-
|
|
3031
3424
|
/* harmony import */ var _action_button_group_widget__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./action-button-group.widget */ "./src/scripts/widgets/action-button-group.widget.ts");
|
|
3032
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionButtonGroupWidget", function() { return _action_button_group_widget__WEBPACK_IMPORTED_MODULE_8__["ActionButtonGroupWidget"]; });
|
|
3033
|
-
|
|
3034
3425
|
/* harmony import */ var _whatsapp_button_widget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./whatsapp-button.widget */ "./src/scripts/widgets/whatsapp-button.widget.ts");
|
|
3035
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WhatsappButtonWidget", function() { return _whatsapp_button_widget__WEBPACK_IMPORTED_MODULE_9__["WhatsappButtonWidget"]; });
|
|
3036
|
-
|
|
3037
3426
|
/* harmony import */ var _whatsapp_window_widget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./whatsapp-window.widget */ "./src/scripts/widgets/whatsapp-window.widget.ts");
|
|
3038
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WhatsappWindowWidget", function() { return _whatsapp_window_widget__WEBPACK_IMPORTED_MODULE_10__["WhatsappWindowWidget"]; });
|
|
3039
|
-
|
|
3040
3427
|
/* harmony import */ var _iframe_box_widget__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./iframe-box.widget */ "./src/scripts/widgets/iframe-box.widget.ts");
|
|
3041
|
-
/* harmony
|
|
3428
|
+
/* harmony import */ var _header_header_widget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./header/header.widget */ "./src/scripts/widgets/header/header.widget.ts");
|
|
3429
|
+
/* harmony import */ var _footer_widget__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./footer.widget */ "./src/scripts/widgets/footer.widget.ts");
|
|
3430
|
+
|
|
3042
3431
|
|
|
3043
3432
|
|
|
3044
3433
|
|
|
@@ -3060,23 +3449,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3060
3449
|
/*!**********************************************!*\
|
|
3061
3450
|
!*** ./src/scripts/widgets/teaser.widget.ts ***!
|
|
3062
3451
|
\**********************************************/
|
|
3063
|
-
|
|
3064
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3452
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3065
3453
|
|
|
3066
|
-
"use strict";
|
|
3067
3454
|
__webpack_require__.r(__webpack_exports__);
|
|
3068
|
-
/* harmony export
|
|
3455
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3456
|
+
/* harmony export */ TeaserWidget: () => (/* binding */ TeaserWidget)
|
|
3457
|
+
/* harmony export */ });
|
|
3069
3458
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3070
3459
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
3071
|
-
/* harmony import */ var
|
|
3460
|
+
/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ "./src/scripts/enums.ts");
|
|
3072
3461
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3073
3462
|
var extendStatics = function (d, b) {
|
|
3074
3463
|
extendStatics = Object.setPrototypeOf ||
|
|
3075
3464
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3076
|
-
function (d, b) { for (var p in b) if (
|
|
3465
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3077
3466
|
return extendStatics(d, b);
|
|
3078
3467
|
};
|
|
3079
3468
|
return function (d, b) {
|
|
3469
|
+
if (typeof b !== "function" && b !== null)
|
|
3470
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3080
3471
|
extendStatics(d, b);
|
|
3081
3472
|
function __() { this.constructor = d; }
|
|
3082
3473
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3088,14 +3479,16 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
3088
3479
|
var TeaserWidget = /** @class */ (function (_super) {
|
|
3089
3480
|
__extends(TeaserWidget, _super);
|
|
3090
3481
|
function TeaserWidget(options) {
|
|
3091
|
-
|
|
3482
|
+
var _this = _super.call(this, options) || this;
|
|
3483
|
+
_this.custidStoreMode = options.custidStoreMode;
|
|
3484
|
+
return _this;
|
|
3092
3485
|
}
|
|
3093
3486
|
TeaserWidget.prototype.getBaseCls = function () {
|
|
3094
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
3487
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.teaserCls;
|
|
3095
3488
|
};
|
|
3096
3489
|
TeaserWidget.prototype.render = function () {
|
|
3097
3490
|
this.crossElem = this.createNode();
|
|
3098
|
-
this.crossElem.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
3491
|
+
this.crossElem.classList.add(_config_config__WEBPACK_IMPORTED_MODULE_1__.config.teaserCrossCls);
|
|
3099
3492
|
this.bindEvents();
|
|
3100
3493
|
this.getBoxElem().appendChild(this.crossElem);
|
|
3101
3494
|
_super.prototype.render.call(this);
|
|
@@ -3105,14 +3498,30 @@ var TeaserWidget = /** @class */ (function (_super) {
|
|
|
3105
3498
|
return true;
|
|
3106
3499
|
}
|
|
3107
3500
|
var timesCounter = 0;
|
|
3108
|
-
if (
|
|
3109
|
-
|
|
3501
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie) {
|
|
3502
|
+
var storedTimesCounter = null;
|
|
3503
|
+
try {
|
|
3504
|
+
storedTimesCounter = sessionStorage.getItem('ds-times-counter');
|
|
3505
|
+
}
|
|
3506
|
+
catch (e) {
|
|
3507
|
+
console.log('Session storage blocked.');
|
|
3508
|
+
}
|
|
3509
|
+
if (storedTimesCounter !== null) {
|
|
3510
|
+
timesCounter = parseInt(storedTimesCounter, 10);
|
|
3511
|
+
}
|
|
3110
3512
|
}
|
|
3111
3513
|
timesCounter += 1;
|
|
3112
3514
|
if (timesCounter > this.hideTeaserAfterTimes) {
|
|
3113
3515
|
return false;
|
|
3114
3516
|
}
|
|
3115
|
-
|
|
3517
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie) {
|
|
3518
|
+
try {
|
|
3519
|
+
sessionStorage.setItem('ds-times-counter', timesCounter.toString());
|
|
3520
|
+
}
|
|
3521
|
+
catch (e) {
|
|
3522
|
+
console.log('Session storage blocked.');
|
|
3523
|
+
}
|
|
3524
|
+
}
|
|
3116
3525
|
return true;
|
|
3117
3526
|
};
|
|
3118
3527
|
TeaserWidget.prototype.show = function (options) {
|
|
@@ -3122,13 +3531,30 @@ var TeaserWidget = /** @class */ (function (_super) {
|
|
|
3122
3531
|
return;
|
|
3123
3532
|
}
|
|
3124
3533
|
if (!this.checkTimes()) {
|
|
3534
|
+
this.hideNode();
|
|
3125
3535
|
return;
|
|
3126
3536
|
}
|
|
3127
|
-
|
|
3537
|
+
var teaserDisplay = null;
|
|
3538
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie) {
|
|
3539
|
+
try {
|
|
3540
|
+
teaserDisplay = sessionStorage.getItem('ds-teaser-display');
|
|
3541
|
+
}
|
|
3542
|
+
catch (e) {
|
|
3543
|
+
console.log('Session storage blocked.');
|
|
3544
|
+
}
|
|
3545
|
+
}
|
|
3546
|
+
if (this.showTeaserOnce && teaserDisplay !== null) {
|
|
3128
3547
|
return;
|
|
3129
3548
|
}
|
|
3130
3549
|
_super.prototype.show.call(this);
|
|
3131
|
-
|
|
3550
|
+
if (this.custidStoreMode === _enums__WEBPACK_IMPORTED_MODULE_2__.CustidStoreMode.cookie) {
|
|
3551
|
+
try {
|
|
3552
|
+
sessionStorage.setItem('ds-teaser-display', 'true');
|
|
3553
|
+
}
|
|
3554
|
+
catch (e) {
|
|
3555
|
+
console.log('Session storage blocked.');
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3132
3558
|
};
|
|
3133
3559
|
TeaserWidget.prototype.bindEvents = function () {
|
|
3134
3560
|
var _this = this;
|
|
@@ -3139,7 +3565,7 @@ var TeaserWidget = /** @class */ (function (_super) {
|
|
|
3139
3565
|
this.getBoxElem().addEventListener('click', function () { return _this.fire('click'); });
|
|
3140
3566
|
};
|
|
3141
3567
|
return TeaserWidget;
|
|
3142
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
3568
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
3143
3569
|
|
|
3144
3570
|
|
|
3145
3571
|
|
|
@@ -3149,22 +3575,24 @@ var TeaserWidget = /** @class */ (function (_super) {
|
|
|
3149
3575
|
/*!**********************************************!*\
|
|
3150
3576
|
!*** ./src/scripts/widgets/unread.widget.ts ***!
|
|
3151
3577
|
\**********************************************/
|
|
3152
|
-
|
|
3153
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3578
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3154
3579
|
|
|
3155
|
-
"use strict";
|
|
3156
3580
|
__webpack_require__.r(__webpack_exports__);
|
|
3157
|
-
/* harmony export
|
|
3581
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3582
|
+
/* harmony export */ UnreadWidget: () => (/* binding */ UnreadWidget)
|
|
3583
|
+
/* harmony export */ });
|
|
3158
3584
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3159
3585
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
3160
3586
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3161
3587
|
var extendStatics = function (d, b) {
|
|
3162
3588
|
extendStatics = Object.setPrototypeOf ||
|
|
3163
3589
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3164
|
-
function (d, b) { for (var p in b) if (
|
|
3590
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3165
3591
|
return extendStatics(d, b);
|
|
3166
3592
|
};
|
|
3167
3593
|
return function (d, b) {
|
|
3594
|
+
if (typeof b !== "function" && b !== null)
|
|
3595
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3168
3596
|
extendStatics(d, b);
|
|
3169
3597
|
function __() { this.constructor = d; }
|
|
3170
3598
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3183,7 +3611,7 @@ var UnreadWidget = /** @class */ (function (_super) {
|
|
|
3183
3611
|
return _this;
|
|
3184
3612
|
}
|
|
3185
3613
|
UnreadWidget.prototype.getBaseCls = function () {
|
|
3186
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_1__
|
|
3614
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_1__.config.unreadCls;
|
|
3187
3615
|
};
|
|
3188
3616
|
UnreadWidget.prototype.setCounter = function (amount) {
|
|
3189
3617
|
if (amount < 1) {
|
|
@@ -3217,7 +3645,7 @@ var UnreadWidget = /** @class */ (function (_super) {
|
|
|
3217
3645
|
}
|
|
3218
3646
|
};
|
|
3219
3647
|
return UnreadWidget;
|
|
3220
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
3648
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
3221
3649
|
|
|
3222
3650
|
|
|
3223
3651
|
|
|
@@ -3227,21 +3655,23 @@ var UnreadWidget = /** @class */ (function (_super) {
|
|
|
3227
3655
|
/*!*******************************************************!*\
|
|
3228
3656
|
!*** ./src/scripts/widgets/whatsapp-button.widget.ts ***!
|
|
3229
3657
|
\*******************************************************/
|
|
3230
|
-
|
|
3231
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3658
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3232
3659
|
|
|
3233
|
-
"use strict";
|
|
3234
3660
|
__webpack_require__.r(__webpack_exports__);
|
|
3235
|
-
/* harmony export
|
|
3661
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3662
|
+
/* harmony export */ WhatsappButtonWidget: () => (/* binding */ WhatsappButtonWidget)
|
|
3663
|
+
/* harmony export */ });
|
|
3236
3664
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3237
3665
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3238
3666
|
var extendStatics = function (d, b) {
|
|
3239
3667
|
extendStatics = Object.setPrototypeOf ||
|
|
3240
3668
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3241
|
-
function (d, b) { for (var p in b) if (
|
|
3669
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3242
3670
|
return extendStatics(d, b);
|
|
3243
3671
|
};
|
|
3244
3672
|
return function (d, b) {
|
|
3673
|
+
if (typeof b !== "function" && b !== null)
|
|
3674
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3245
3675
|
extendStatics(d, b);
|
|
3246
3676
|
function __() { this.constructor = d; }
|
|
3247
3677
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3251,12 +3681,16 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
3251
3681
|
var config = {
|
|
3252
3682
|
baseCls: 'ds-whatsapp-button',
|
|
3253
3683
|
activeCls: 'ds-whatsapp-button--active',
|
|
3684
|
+
bwCls: 'ds-whatsapp-button--bw',
|
|
3685
|
+
slideCls: 'ds-whatsapp-button--slide',
|
|
3254
3686
|
};
|
|
3255
3687
|
var WhatsappButtonWidget = /** @class */ (function (_super) {
|
|
3256
3688
|
__extends(WhatsappButtonWidget, _super);
|
|
3257
3689
|
function WhatsappButtonWidget(options) {
|
|
3258
3690
|
var _this = _super.call(this, options) || this;
|
|
3259
3691
|
_this.isPressed = false;
|
|
3692
|
+
_this.blackWhiteStyle = false;
|
|
3693
|
+
_this.slideWaButton = false;
|
|
3260
3694
|
return _this;
|
|
3261
3695
|
}
|
|
3262
3696
|
WhatsappButtonWidget.prototype.bindEvents = function () {
|
|
@@ -3266,6 +3700,14 @@ var WhatsappButtonWidget = /** @class */ (function (_super) {
|
|
|
3266
3700
|
});
|
|
3267
3701
|
};
|
|
3268
3702
|
WhatsappButtonWidget.prototype.render = function () {
|
|
3703
|
+
if (this.blackWhiteStyle) {
|
|
3704
|
+
var boxElem = this.getBoxElem();
|
|
3705
|
+
boxElem.classList.add(config.bwCls);
|
|
3706
|
+
}
|
|
3707
|
+
if (this.slideWaButton) {
|
|
3708
|
+
var boxElem = this.getBoxElem();
|
|
3709
|
+
boxElem.classList.add(config.slideCls);
|
|
3710
|
+
}
|
|
3269
3711
|
_super.prototype.render.call(this);
|
|
3270
3712
|
this.bindEvents();
|
|
3271
3713
|
};
|
|
@@ -3292,7 +3734,7 @@ var WhatsappButtonWidget = /** @class */ (function (_super) {
|
|
|
3292
3734
|
return config.baseCls;
|
|
3293
3735
|
};
|
|
3294
3736
|
return WhatsappButtonWidget;
|
|
3295
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
3737
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
3296
3738
|
|
|
3297
3739
|
|
|
3298
3740
|
|
|
@@ -3302,22 +3744,24 @@ var WhatsappButtonWidget = /** @class */ (function (_super) {
|
|
|
3302
3744
|
/*!*******************************************************!*\
|
|
3303
3745
|
!*** ./src/scripts/widgets/whatsapp-window.widget.ts ***!
|
|
3304
3746
|
\*******************************************************/
|
|
3305
|
-
|
|
3306
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3747
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3307
3748
|
|
|
3308
|
-
"use strict";
|
|
3309
3749
|
__webpack_require__.r(__webpack_exports__);
|
|
3310
|
-
/* harmony export
|
|
3750
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3751
|
+
/* harmony export */ WhatsappWindowWidget: () => (/* binding */ WhatsappWindowWidget)
|
|
3752
|
+
/* harmony export */ });
|
|
3311
3753
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3312
3754
|
/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services */ "./src/scripts/services/index.ts");
|
|
3313
3755
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
3314
3756
|
var extendStatics = function (d, b) {
|
|
3315
3757
|
extendStatics = Object.setPrototypeOf ||
|
|
3316
3758
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3317
|
-
function (d, b) { for (var p in b) if (
|
|
3759
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3318
3760
|
return extendStatics(d, b);
|
|
3319
3761
|
};
|
|
3320
3762
|
return function (d, b) {
|
|
3763
|
+
if (typeof b !== "function" && b !== null)
|
|
3764
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3321
3765
|
extendStatics(d, b);
|
|
3322
3766
|
function __() { this.constructor = d; }
|
|
3323
3767
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3335,7 +3779,7 @@ var config = {
|
|
|
3335
3779
|
textLinkMobileCls: 'ds-whatsapp-window__text-link-mobile',
|
|
3336
3780
|
qr: 'ds-whatsapp-window__qr',
|
|
3337
3781
|
linkCls: 'ds-whatsapp-window__link',
|
|
3338
|
-
|
|
3782
|
+
linkTestCls: 'ds-whatsapp-window__link-text',
|
|
3339
3783
|
};
|
|
3340
3784
|
var texts = {
|
|
3341
3785
|
en: {
|
|
@@ -3346,9 +3790,9 @@ var texts = {
|
|
|
3346
3790
|
link: 'Open WhatsApp',
|
|
3347
3791
|
},
|
|
3348
3792
|
de: {
|
|
3349
|
-
title: '
|
|
3350
|
-
description: '
|
|
3351
|
-
linkText: '
|
|
3793
|
+
title: 'WhatsApp',
|
|
3794
|
+
description: 'QR-Code mit dem Smartphone scannen',
|
|
3795
|
+
linkText: 'auf dem Computer auch mit diesem Link',
|
|
3352
3796
|
linkMobileText: 'Klicke den Button um WhatsApp zu öffnen',
|
|
3353
3797
|
link: 'WhatsApp öffnen',
|
|
3354
3798
|
},
|
|
@@ -3379,7 +3823,7 @@ var WhatsappWindowWidget = /** @class */ (function (_super) {
|
|
|
3379
3823
|
var _this = this;
|
|
3380
3824
|
if (!this.isLoaded) {
|
|
3381
3825
|
this.isLoaded = true;
|
|
3382
|
-
_services__WEBPACK_IMPORTED_MODULE_1__
|
|
3826
|
+
_services__WEBPACK_IMPORTED_MODULE_1__.ApiService.getWhatsappLink(this.clientId, _services__WEBPACK_IMPORTED_MODULE_1__.UserService.getCustomerId()).then(function (response) {
|
|
3383
3827
|
_this.waLink = response.waLink;
|
|
3384
3828
|
_this.waSvg = response.waSvg;
|
|
3385
3829
|
_this.renderContent();
|
|
@@ -3392,33 +3836,25 @@ var WhatsappWindowWidget = /** @class */ (function (_super) {
|
|
|
3392
3836
|
}
|
|
3393
3837
|
};
|
|
3394
3838
|
WhatsappWindowWidget.prototype.renderContent = function () {
|
|
3395
|
-
var title = "<div class=\""
|
|
3396
|
-
var description = "<div class=\""
|
|
3397
|
-
var qr = "<div class=\""
|
|
3398
|
-
var linkText = "<div class=\""
|
|
3399
|
-
var linkMobileText = "<div class=\""
|
|
3400
|
-
var link = "<a class=\""
|
|
3839
|
+
var title = "<div class=\"".concat(config.titleCls, "\">").concat(getText(this.locale, 'title'), "</div>");
|
|
3840
|
+
var description = "<div class=\"".concat(config.textCls, "\">").concat(getText(this.locale, 'description'), "</div>");
|
|
3841
|
+
var qr = "<div class=\"".concat(config.qr, "\">").concat(this.waSvg, "</div>");
|
|
3842
|
+
var linkText = "<div class=\"".concat(config.textLinkCls, "\">").concat(getText(this.locale, 'linkText'), "</div>");
|
|
3843
|
+
var linkMobileText = "<div class=\"".concat(config.textLinkMobileCls, "\">").concat(getText(this.locale, 'linkMobileText'), "</div>");
|
|
3844
|
+
var link = "<a class=\"".concat(config.linkCls, "\" href=\"").concat(this.waLink, "\" target=\"_blank\">\n <span class=\"").concat(config.linkTestCls, "\">").concat(getText(this.locale, 'link'), "</span>\n </a>");
|
|
3401
3845
|
this.setContent(title + description + qr + linkText + linkMobileText + link);
|
|
3402
3846
|
};
|
|
3403
3847
|
WhatsappWindowWidget.prototype.getBaseCls = function () {
|
|
3404
3848
|
return config.baseCls;
|
|
3405
3849
|
};
|
|
3406
|
-
WhatsappWindowWidget.prototype.
|
|
3407
|
-
this.
|
|
3408
|
-
this.
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
_super.prototype.render.call(this);
|
|
3412
|
-
};
|
|
3413
|
-
WhatsappWindowWidget.prototype.bindEvents = function () {
|
|
3414
|
-
var _this = this;
|
|
3415
|
-
this.crossElem.addEventListener('click', function (event) {
|
|
3416
|
-
event.stopPropagation();
|
|
3417
|
-
_this.hide();
|
|
3418
|
-
});
|
|
3850
|
+
WhatsappWindowWidget.prototype.setLocale = function (locale) {
|
|
3851
|
+
this.locale = locale;
|
|
3852
|
+
if (this.isLoaded) {
|
|
3853
|
+
this.renderContent();
|
|
3854
|
+
}
|
|
3419
3855
|
};
|
|
3420
3856
|
return WhatsappWindowWidget;
|
|
3421
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__
|
|
3857
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_0__.BaseWidget));
|
|
3422
3858
|
|
|
3423
3859
|
|
|
3424
3860
|
|
|
@@ -3428,12 +3864,12 @@ var WhatsappWindowWidget = /** @class */ (function (_super) {
|
|
|
3428
3864
|
/*!***********************************************!*\
|
|
3429
3865
|
!*** ./src/scripts/widgets/wrapper.widget.ts ***!
|
|
3430
3866
|
\***********************************************/
|
|
3431
|
-
|
|
3432
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3867
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3433
3868
|
|
|
3434
|
-
"use strict";
|
|
3435
3869
|
__webpack_require__.r(__webpack_exports__);
|
|
3436
|
-
/* harmony export
|
|
3870
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3871
|
+
/* harmony export */ WrapperWidget: () => (/* binding */ WrapperWidget)
|
|
3872
|
+
/* harmony export */ });
|
|
3437
3873
|
/* harmony import */ var _core_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/app */ "./src/scripts/core/app.ts");
|
|
3438
3874
|
/* harmony import */ var _core_base_widget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/base-widget */ "./src/scripts/core/base-widget.ts");
|
|
3439
3875
|
/* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config/config */ "./src/scripts/config/config.ts");
|
|
@@ -3441,10 +3877,12 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
3441
3877
|
var extendStatics = function (d, b) {
|
|
3442
3878
|
extendStatics = Object.setPrototypeOf ||
|
|
3443
3879
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
3444
|
-
function (d, b) { for (var p in b) if (
|
|
3880
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
3445
3881
|
return extendStatics(d, b);
|
|
3446
3882
|
};
|
|
3447
3883
|
return function (d, b) {
|
|
3884
|
+
if (typeof b !== "function" && b !== null)
|
|
3885
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
3448
3886
|
extendStatics(d, b);
|
|
3449
3887
|
function __() { this.constructor = d; }
|
|
3450
3888
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -3461,33 +3899,33 @@ var WrapperWidget = /** @class */ (function (_super) {
|
|
|
3461
3899
|
return _this;
|
|
3462
3900
|
}
|
|
3463
3901
|
WrapperWidget.prototype.getBaseCls = function () {
|
|
3464
|
-
return _config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3902
|
+
return _config_config__WEBPACK_IMPORTED_MODULE_2__.config.wrapperCls;
|
|
3465
3903
|
};
|
|
3466
3904
|
WrapperWidget.prototype.setPosition = function (position) {
|
|
3467
3905
|
this.position = position;
|
|
3468
3906
|
var boxElem = this.getBoxElem();
|
|
3469
|
-
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3470
|
-
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3471
|
-
boxElem.classList.add(position === _core_app__WEBPACK_IMPORTED_MODULE_0__
|
|
3472
|
-
? _config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3473
|
-
: _config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3907
|
+
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__.config.wrapperPositionLeftCls);
|
|
3908
|
+
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__.config.wrapperPositionRightCls);
|
|
3909
|
+
boxElem.classList.add(position === _core_app__WEBPACK_IMPORTED_MODULE_0__.ChatPosition.left
|
|
3910
|
+
? _config_config__WEBPACK_IMPORTED_MODULE_2__.config.wrapperPositionLeftCls
|
|
3911
|
+
: _config_config__WEBPACK_IMPORTED_MODULE_2__.config.wrapperPositionRightCls);
|
|
3474
3912
|
};
|
|
3475
3913
|
WrapperWidget.prototype.setTheme = function (theme) {
|
|
3476
|
-
if (!(theme in _core_app__WEBPACK_IMPORTED_MODULE_0__
|
|
3914
|
+
if (!(theme in _core_app__WEBPACK_IMPORTED_MODULE_0__.AppTheme)) {
|
|
3477
3915
|
return;
|
|
3478
3916
|
}
|
|
3479
3917
|
this.theme = theme;
|
|
3480
3918
|
var boxElem = this.getBoxElem();
|
|
3481
|
-
var themeCls = _config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3482
|
-
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3483
|
-
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3919
|
+
var themeCls = _config_config__WEBPACK_IMPORTED_MODULE_2__.config["theme".concat(theme.charAt(0).toUpperCase() + theme.slice(1))];
|
|
3920
|
+
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__.config.themeRound);
|
|
3921
|
+
boxElem.classList.remove(_config_config__WEBPACK_IMPORTED_MODULE_2__.config.themeTile);
|
|
3484
3922
|
boxElem.classList.add(themeCls);
|
|
3485
3923
|
};
|
|
3486
3924
|
WrapperWidget.prototype.render = function () {
|
|
3487
3925
|
this.setPosition(this.position);
|
|
3488
3926
|
this.setTheme(this.theme);
|
|
3489
3927
|
if (this.direction === 'rtl') {
|
|
3490
|
-
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_2__
|
|
3928
|
+
this.getBoxElem().classList.add(_config_config__WEBPACK_IMPORTED_MODULE_2__.config.wrapperDirectionRtlCls);
|
|
3491
3929
|
}
|
|
3492
3930
|
if (this.baseCustomCls) {
|
|
3493
3931
|
this.getBoxElem().classList.add(this.baseCustomCls);
|
|
@@ -3495,11 +3933,95 @@ var WrapperWidget = /** @class */ (function (_super) {
|
|
|
3495
3933
|
_super.prototype.render.call(this);
|
|
3496
3934
|
};
|
|
3497
3935
|
return WrapperWidget;
|
|
3498
|
-
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_1__
|
|
3936
|
+
}(_core_base_widget__WEBPACK_IMPORTED_MODULE_1__.BaseWidget));
|
|
3499
3937
|
|
|
3500
3938
|
|
|
3501
3939
|
|
|
3502
3940
|
/***/ })
|
|
3503
3941
|
|
|
3504
|
-
/******/
|
|
3505
|
-
|
|
3942
|
+
/******/ });
|
|
3943
|
+
/************************************************************************/
|
|
3944
|
+
/******/ // The module cache
|
|
3945
|
+
/******/ var __webpack_module_cache__ = {};
|
|
3946
|
+
/******/
|
|
3947
|
+
/******/ // The require function
|
|
3948
|
+
/******/ function __webpack_require__(moduleId) {
|
|
3949
|
+
/******/ // Check if module is in cache
|
|
3950
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
3951
|
+
/******/ if (cachedModule !== undefined) {
|
|
3952
|
+
/******/ return cachedModule.exports;
|
|
3953
|
+
/******/ }
|
|
3954
|
+
/******/ // Create a new module (and put it into the cache)
|
|
3955
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
3956
|
+
/******/ // no module.id needed
|
|
3957
|
+
/******/ // no module.loaded needed
|
|
3958
|
+
/******/ exports: {}
|
|
3959
|
+
/******/ };
|
|
3960
|
+
/******/
|
|
3961
|
+
/******/ // Execute the module function
|
|
3962
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
3963
|
+
/******/
|
|
3964
|
+
/******/ // Return the exports of the module
|
|
3965
|
+
/******/ return module.exports;
|
|
3966
|
+
/******/ }
|
|
3967
|
+
/******/
|
|
3968
|
+
/************************************************************************/
|
|
3969
|
+
/******/ /* webpack/runtime/define property getters */
|
|
3970
|
+
/******/ (() => {
|
|
3971
|
+
/******/ // define getter functions for harmony exports
|
|
3972
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
3973
|
+
/******/ for(var key in definition) {
|
|
3974
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
3975
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
3976
|
+
/******/ }
|
|
3977
|
+
/******/ }
|
|
3978
|
+
/******/ };
|
|
3979
|
+
/******/ })();
|
|
3980
|
+
/******/
|
|
3981
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
3982
|
+
/******/ (() => {
|
|
3983
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
3984
|
+
/******/ })();
|
|
3985
|
+
/******/
|
|
3986
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
3987
|
+
/******/ (() => {
|
|
3988
|
+
/******/ // define __esModule on exports
|
|
3989
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
3990
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
3991
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3992
|
+
/******/ }
|
|
3993
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
3994
|
+
/******/ };
|
|
3995
|
+
/******/ })();
|
|
3996
|
+
/******/
|
|
3997
|
+
/************************************************************************/
|
|
3998
|
+
var __webpack_exports__ = {};
|
|
3999
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
4000
|
+
(() => {
|
|
4001
|
+
/*!******************************!*\
|
|
4002
|
+
!*** ./src/scripts/index.ts ***!
|
|
4003
|
+
\******************************/
|
|
4004
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4005
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4006
|
+
/* harmony export */ instance: () => (/* binding */ instance)
|
|
4007
|
+
/* harmony export */ });
|
|
4008
|
+
/* harmony import */ var _core_facade__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/facade */ "./src/scripts/core/facade.ts");
|
|
4009
|
+
/* harmony import */ var _core_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core/app */ "./src/scripts/core/app.ts");
|
|
4010
|
+
|
|
4011
|
+
|
|
4012
|
+
var facade = null;
|
|
4013
|
+
var instance = function (options) {
|
|
4014
|
+
if (facade && !facade.isDestroyed()) {
|
|
4015
|
+
return facade;
|
|
4016
|
+
}
|
|
4017
|
+
facade = (0,_core_facade__WEBPACK_IMPORTED_MODULE_0__.createFacade)(new _core_app__WEBPACK_IMPORTED_MODULE_1__.App(options));
|
|
4018
|
+
return facade;
|
|
4019
|
+
};
|
|
4020
|
+
|
|
4021
|
+
|
|
4022
|
+
})();
|
|
4023
|
+
|
|
4024
|
+
window.Dialogshift = __webpack_exports__;
|
|
4025
|
+
/******/ })()
|
|
4026
|
+
;
|
|
4027
|
+
//# sourceMappingURL=dialogshift-webchat-sdk.umd.js.map
|