@alipay/ams-checkout 1.5.8 → 1.5.10

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.
@@ -14,23 +14,18 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
14
14
  * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
15
15
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
16
16
  */
17
- /* eslint-disable no-console */
18
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
+ import { marmotMap } from "../../config/index";
19
19
  import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID } from "../../constant";
20
20
  import { queryPaymentInfo } from "../../service";
21
- import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, renderDisplayTypeEnum, targetEnum } from "../../types";
22
- import { getType, isJsonString, isPC, queryParse } from "../../util";
21
+ import { componentSignEnum, eventCodeEnum, messageName, platformEnum, productSceneEnum, RedirectType, renderDisplayTypeEnum, SecuritySceneEnum, targetEnum } from "../../types";
22
+ import { getType, isJsonString, isPC } from "../../util";
23
23
  import { isLocalMock } from "../../util/mock";
24
+ import { getApdidToken, getAppname, getSecurityHost, initSecuritySDK } from "../../util/security";
24
25
  import { createIframe, getAppDomain, getIframeUrl } from "./cashierApp";
25
26
  import { addInlineLoading, createInlineBaseElement } from "./component.inline.style";
26
27
  import { addPopupLoading, createBaseElement, createMockup, createRetentionPopup, handleDeclareInfo as _handleDeclareInfo, hideRetentionPopup, removeRetentionPopup as _removeRetentionPopup } from "./component.popup.style";
27
- import APDID from '@alipay/jshield-apdid';
28
- import { getSecurityHost, getAppname } from "../../util/security";
29
- var _ref = queryParse() || {},
30
- preinit = _ref.preinit,
31
- rebuild = _ref.rebuild,
32
- scene = _ref.scene,
33
- region = _ref.region;
28
+ import { createModal, destroyModal, insertStyleSheet } from "./popupWindow.style";
34
29
  window.changingPageHeight = window.innerHeight;
35
30
  var ComponentApp = /*#__PURE__*/function () {
36
31
  function ComponentApp() {
@@ -41,6 +36,8 @@ var ComponentApp = /*#__PURE__*/function () {
41
36
  _defineProperty(this, "_performanceData", []);
42
37
  _defineProperty(this, "_loadAppPromiseResolve", null);
43
38
  _defineProperty(this, "_isInitComponent", void 0);
39
+ _defineProperty(this, "_threedData", void 0);
40
+ _defineProperty(this, "popupWindow", void 0);
44
41
  _defineProperty(this, "appDomain", void 0);
45
42
  _defineProperty(this, "createIframeNode", void 0);
46
43
  _defineProperty(this, "_selector", void 0);
@@ -49,17 +46,17 @@ var ComponentApp = /*#__PURE__*/function () {
49
46
  _defineProperty(this, "_actionQueryPromise", null);
50
47
  _defineProperty(this, "_renderParams", null);
51
48
  _defineProperty(this, "_componentSign", componentSignEnum.NONE);
52
- _defineProperty(this, "_clickEventName", void 0);
49
+ _defineProperty(this, "_appLocationSearch", void 0);
53
50
  _defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
54
- this._appVersion = '1.5.8';
51
+ this._appVersion = '1.5.9';
55
52
  this._isInitComponent = false;
56
53
  this._selector = "#".concat(COMPONENT_SECTION_ID);
57
54
  this.createIframeNode = function () {
58
55
  return Promise.resolve();
59
56
  };
60
57
  this.platform = isPC() ? platformEnum.desktop : platformEnum.mobile;
61
- this._clickEventName = this.platform === platformEnum.mobile ? 'touchend' : 'click';
62
58
  this._isRetention = true;
59
+ this._appLocationSearch = '';
63
60
  this._performanceData.push({
64
61
  key: 'sdk_init',
65
62
  value: Date.now()
@@ -84,6 +81,29 @@ var ComponentApp = /*#__PURE__*/function () {
84
81
  this.AMSSDK = AMSSDK;
85
82
  this.subscribeFromSDK();
86
83
  }
84
+ }, {
85
+ key: "initLoggerMeta",
86
+ value: function initLoggerMeta() {
87
+ var _this$_renderParams, _paymentSessionMetaDa;
88
+ console.log('this._renderParams', JSON.stringify(this._renderParams), null, 3);
89
+ var paymentSessionMetaData = (_this$_renderParams = this._renderParams) === null || _this$_renderParams === void 0 ? void 0 : _this$_renderParams.paymentSessionMetaData;
90
+ var paymentSessionConfig = paymentSessionMetaData.paymentSessionConfig;
91
+ this.AMSSDK.logger.setMedta({
92
+ platform: this.platform === platformEnum.desktop ? 'PC' : 'WAP',
93
+ // PC/WAP,
94
+ sdkVersion: this._appVersion,
95
+ instanceId: this.AMSSDK._instanceId,
96
+ storageId: this.AMSSDK._storageId,
97
+ // the better way to use md5 paymentSesionID
98
+ renderDisplayType: paymentSessionMetaData === null || paymentSessionMetaData === void 0 ? void 0 : paymentSessionMetaData.renderDisplayType,
99
+ merchantId: paymentSessionMetaData === null || paymentSessionMetaData === void 0 ? void 0 : paymentSessionMetaData.clientId,
100
+ productScene: paymentSessionConfig === null || paymentSessionConfig === void 0 ? void 0 : paymentSessionConfig.productScene,
101
+ productSceneVersion: paymentSessionConfig === null || paymentSessionConfig === void 0 ? void 0 : paymentSessionConfig.productSceneVersion,
102
+ paymentMethodType: paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa === void 0 ? void 0 : _paymentSessionMetaDa.paymentMethodType,
103
+ paymentMethodCategoryType: paymentSessionConfig === null || paymentSessionConfig === void 0 ? void 0 : paymentSessionConfig.paymentMethodCategoryType
104
+ });
105
+ this.AMSSDK.logger.setComponentStartTime(Date.now());
106
+ }
87
107
 
88
108
  /**
89
109
  * @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
@@ -96,24 +116,84 @@ var ComponentApp = /*#__PURE__*/function () {
96
116
  }, {
97
117
  key: "initAPSecurity",
98
118
  value: function initAPSecurity() {
99
- var _this$_renderParams;
119
+ var _this$_renderParams2,
120
+ _this = this;
100
121
  if (componentSignEnum.CASHIER_PAYMENT_CARD !== this._componentSign) {
101
122
  return;
102
123
  }
103
- var securityConfig = (_this$_renderParams = this._renderParams) === null || _this$_renderParams === void 0 || (_this$_renderParams = _this$_renderParams.paymentSessionMetaData) === null || _this$_renderParams === void 0 ? void 0 : _this$_renderParams.securityConfig;
124
+ var securityConfig = (_this$_renderParams2 = this._renderParams) === null || _this$_renderParams2 === void 0 || (_this$_renderParams2 = _this$_renderParams2.paymentSessionMetaData) === null || _this$_renderParams2 === void 0 ? void 0 : _this$_renderParams2.securityConfig;
104
125
  if (!securityConfig) {
105
126
  return;
106
127
  }
107
128
  var appName = securityConfig === null || securityConfig === void 0 ? void 0 : securityConfig.appName;
108
129
  var h5gateway = securityConfig === null || securityConfig === void 0 ? void 0 : securityConfig.h5gateway;
109
- if (preinit === 'true' || rebuild === 'true') {
110
- appName = getAppname(scene);
111
- h5gateway = getSecurityHost(region);
112
- }
113
- APDID.initToken(appName, {
114
- host: h5gateway
115
- }, function (success, tokenResult, msg) {
116
- console.log("initToken result tokenResult", JSON.stringify(tokenResult));
130
+
131
+ // if merchant have init securitySDK and same as service paymentSessionMetaData, no need init again
132
+ if (this.AMSSDK.securityConfig) {
133
+ if (appName === getAppname(this.AMSSDK.securityConfig.scene) && h5gateway === getSecurityHost(this.AMSSDK.securityConfig.region)) {
134
+ return;
135
+ }
136
+ }
137
+ this.AMSSDK.logger.logInfo({
138
+ title: 'sdk_event_securitySdkInit'
139
+ });
140
+ initSecuritySDK(appName, h5gateway, function () {
141
+ _this.AMSSDK.logger.logInfo({
142
+ title: 'sdk_event_securitySdkInitSuccess'
143
+ });
144
+ }, function () {
145
+ // TODO Distinguishing Call Scenarios of Security SDK Failures
146
+ _this.AMSSDK.logger.logError({
147
+ title: 'sdk_error_securitySdkInitFailed'
148
+ });
149
+ });
150
+ }
151
+ }, {
152
+ key: "logDeviceId",
153
+ value: function logDeviceId(deviceId, getDeviceIdStartTime) {
154
+ var time = "".concat(Date.now() - getDeviceIdStartTime);
155
+ if (deviceId) {
156
+ this.AMSSDK.logger.logInfo({
157
+ title: 'sdk_event_securitySdkGetTokenSuccess'
158
+ }, {
159
+ deviceId: deviceId,
160
+ time: time
161
+ }).send();
162
+ } else {
163
+ this.AMSSDK.logger.logInfo({
164
+ title: 'sdk_error_securitySdkGetTokenFailed'
165
+ }, {
166
+ deviceId: deviceId,
167
+ time: time
168
+ }).send();
169
+ }
170
+ }
171
+ }, {
172
+ key: "getDeviceIdAndLog",
173
+ value: function getDeviceIdAndLog() {
174
+ var _this2 = this;
175
+ return new Promise(function (resolve) {
176
+ // To avoid rendering being blocked, move the logic to the next event loop for processing
177
+ setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
178
+ var _this2$_renderParams;
179
+ var securityConfig, getDeviceIdStartTime, deviceId;
180
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
181
+ while (1) switch (_context.prev = _context.next) {
182
+ case 0:
183
+ securityConfig = (_this2$_renderParams = _this2._renderParams) === null || _this2$_renderParams === void 0 || (_this2$_renderParams = _this2$_renderParams.paymentSessionMetaData) === null || _this2$_renderParams === void 0 ? void 0 : _this2$_renderParams.securityConfig;
184
+ getDeviceIdStartTime = Date.now();
185
+ _context.next = 4;
186
+ return getApdidToken(getAppname(SecuritySceneEnum.CARD), securityConfig);
187
+ case 4:
188
+ deviceId = _context.sent;
189
+ _this2.logDeviceId(deviceId, getDeviceIdStartTime);
190
+ resolve(deviceId);
191
+ case 7:
192
+ case "end":
193
+ return _context.stop();
194
+ }
195
+ }, _callee);
196
+ })), 0);
117
197
  });
118
198
  }
119
199
 
@@ -123,7 +203,7 @@ var ComponentApp = /*#__PURE__*/function () {
123
203
  }, {
124
204
  key: "appendIframeNodes",
125
205
  value: function appendIframeNodes(componentSign, renderParams) {
126
- var _this = this;
206
+ var _this3 = this;
127
207
  if (this._isInitComponent) {
128
208
  this.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
129
209
  return Promise.reject(ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
@@ -135,6 +215,7 @@ var ComponentApp = /*#__PURE__*/function () {
135
215
  this._renderDisplayType = renderParams.renderDisplayType;
136
216
  var insertedNode = this._renderDisplayType === renderDisplayTypeEnum.inline ? "#".concat(COMPONENT_CONTAINER_ID) : this._selector;
137
217
  this.initAPSecurity();
218
+ this.initLoggerMeta();
138
219
  this._performanceData.push({
139
220
  key: 'sdk_create_component',
140
221
  value: Date.now()
@@ -145,6 +226,7 @@ var ComponentApp = /*#__PURE__*/function () {
145
226
  if (this._renderDisplayType === renderDisplayTypeEnum.inline) {
146
227
  var container = createInlineBaseElement(this._selector);
147
228
  if (container) this.renderInlineLoading(renderParams, container);
229
+ insertStyleSheet();
148
230
  }
149
231
  if (this._renderDisplayType === renderDisplayTypeEnum.popup) {
150
232
  createBaseElement(this.platform, this.closeBtnFunc.bind(this));
@@ -154,10 +236,13 @@ var ComponentApp = /*#__PURE__*/function () {
154
236
  }
155
237
  this.createApp(renderParams);
156
238
  return Promise.all([this.createActionQueryPromise(), this.createIframeNode(this, insertedNode, this._renderDisplayType), this._createLoadAppPromise()]).then(function () {
239
+ _this3.AMSSDK.logger.logInfo({
240
+ title: 'sdk_event_successfully_created_app_process'
241
+ }).send();
157
242
  return Promise.resolve();
158
243
  }).catch(function (error) {
159
- _this._isInitComponent = false;
160
- _this.cleanContainer();
244
+ _this3._isInitComponent = false;
245
+ _this3.cleanContainer();
161
246
  return Promise.reject(error);
162
247
  });
163
248
  }
@@ -183,17 +268,20 @@ var ComponentApp = /*#__PURE__*/function () {
183
268
  }, {
184
269
  key: "_createLoadAppPromise",
185
270
  value: function _createLoadAppPromise() {
186
- var _this2 = this;
271
+ var _this4 = this;
187
272
  return new Promise(function (resolve, reject) {
188
- _this2._loadAppPromiseResolve = resolve;
273
+ _this4._loadAppPromiseResolve = resolve;
189
274
  setTimeout(function () {
190
275
  reject(ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
191
276
  }, LOADTIME_LIMIT);
192
277
  }).catch(function (error) {
193
- _this2.dispatchToSDK(EVENT.error.name, {
278
+ _this4.dispatchToSDK(EVENT.error.name, {
194
279
  code: ERRORMESSAGE.CREATECOMPONENT_ERROR.code,
195
280
  message: ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT.message
196
281
  });
282
+ _this4.AMSSDK.logger.logError({
283
+ title: 'sdk_error_web_app_timeout'
284
+ }).send();
197
285
  return Promise.reject(error);
198
286
  });
199
287
  }
@@ -204,109 +292,131 @@ var ComponentApp = /*#__PURE__*/function () {
204
292
  }, {
205
293
  key: "createActionQueryPromise",
206
294
  value: function createActionQueryPromise() {
207
- var _this3 = this;
295
+ var _this5 = this;
208
296
  this._performanceData.push({
209
297
  key: 'sdk_action_query_start',
210
298
  value: Date.now()
211
299
  });
212
- this._actionQueryPromise = new Promise(function (resolve, reject) {
213
- var _this3$_renderParams, _this3$_renderParams2, _this3$_renderParams3;
214
- var params = {
215
- paymentSessionData: _this3._renderParams && ((_this3$_renderParams = _this3._renderParams) === null || _this3$_renderParams === void 0 ? void 0 : _this3$_renderParams.sessionData) || '',
216
- paymentSessionConfig: (_this3$_renderParams2 = _this3._renderParams) === null || _this3$_renderParams2 === void 0 || (_this3$_renderParams2 = _this3$_renderParams2.paymentSessionMetaData) === null || _this3$_renderParams2 === void 0 ? void 0 : _this3$_renderParams2.paymentSessionConfig
217
- };
218
- /**
219
- * @description card
220
- */
221
- if (componentSignEnum.CASHIER_PAYMENT_CARD === _this3._componentSign || componentSignEnum.VAULTING_CARD === _this3._componentSign) {
222
- params.paymentMethodType = 'CARD';
223
- }
224
- var needDeviceId = false;
225
- var waitTime = '3000';
226
- var securityConfig = (_this3$_renderParams3 = _this3._renderParams) === null || _this3$_renderParams3 === void 0 || (_this3$_renderParams3 = _this3$_renderParams3.paymentSessionMetaData) === null || _this3$_renderParams3 === void 0 ? void 0 : _this3$_renderParams3.securityConfig;
227
- if (componentSignEnum.CASHIER_PAYMENT_CARD === _this3._componentSign && securityConfig) {
228
- var _this3$_renderParams4;
229
- var extendInfo = ((_this3$_renderParams4 = _this3._renderParams) === null || _this3$_renderParams4 === void 0 || (_this3$_renderParams4 = _this3$_renderParams4.paymentSessionMetaData) === null || _this3$_renderParams4 === void 0 ? void 0 : _this3$_renderParams4.extendInfo) || '';
230
- var info = JSON.parse(extendInfo);
231
- if ((info === null || info === void 0 ? void 0 : info.cardTokenPay) !== 'false') {
232
- needDeviceId = true;
233
- waitTime = securityConfig === null || securityConfig === void 0 ? void 0 : securityConfig.tokenCollectTime;
234
- }
235
- }
236
-
237
- /**
238
- * @description easyPay
239
- */
240
- if (componentSignEnum.EASY_PAY_WALLET === _this3._componentSign) {
241
- var _this3$_renderParams5;
242
- var _ref2 = params.paymentSessionConfig || {},
243
- _ref2$productSceneVer = _ref2.productSceneVersion,
244
- productSceneVersion = _ref2$productSceneVer === void 0 ? '' : _ref2$productSceneVer,
245
- _ref2$productScene = _ref2.productScene,
246
- productScene = _ref2$productScene === void 0 ? '' : _ref2$productScene;
247
- var _ref3 = ((_this3$_renderParams5 = _this3._renderParams) === null || _this3$_renderParams5 === void 0 ? void 0 : _this3$_renderParams5.paymentSessionMetaData) || {},
248
- _ref3$action = _ref3.action,
249
- _ref3$action2 = _ref3$action === void 0 ? {} : _ref3$action,
250
- _ref3$action2$autoDeb = _ref3$action2.autoDebitWithToken,
251
- autoDebitWithToken = _ref3$action2$autoDeb === void 0 ? false : _ref3$action2$autoDeb;
252
- if (productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken) {
253
- // if EASY_PAY 2.0 , no need to query payment request
254
- return resolve({
255
- message: 'sdk no need to make query request',
256
- success: true
257
- });
258
- }
259
- }
260
- /**
261
- * @author tianqiang
262
- * @description autoDebit
263
- */
264
- if (componentSignEnum.AUTO_DEBIT_WALLET === _this3._componentSign) {
265
- var _this3$_renderParams6, _action$web, _action$wap;
266
- var action = ((_this3$_renderParams6 = _this3._renderParams) === null || _this3$_renderParams6 === void 0 || (_this3$_renderParams6 = _this3$_renderParams6.paymentSessionMetaData) === null || _this3$_renderParams6 === void 0 ? void 0 : _this3$_renderParams6.action) || {};
267
- var signType = isPC() ? action === null || action === void 0 || (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 || (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType;
268
- if (signType === 'SMS') {
269
- return resolve({
270
- message: 'sdk no need to make query request',
271
- success: true
272
- });
273
- }
274
- if (!signType || signType !== 'REDIRECT') {
275
- return resolve({
276
- success: false
277
- });
278
- }
279
- }
280
300
 
281
- // mock
282
- if (isLocalMock()) {
283
- return resolve({
284
- message: 'sdk no need to make query request',
285
- success: true
286
- });
287
- }
288
- queryPaymentInfo(params, {
289
- env: _this3.AMSSDK.options.env.environment,
290
- locale: _this3.AMSSDK.options.locale,
291
- needDeviceId: needDeviceId,
292
- waitTime: waitTime
293
- }).then(function (res) {
294
- _this3._performanceData.push({
295
- key: 'sdk_action_query_end',
296
- value: Date.now()
297
- });
298
- if (res !== null && res !== void 0 && res.success) {
299
- resolve(res);
300
- } else {
301
- resolve(res);
302
- }
303
- }).catch(function (err) {
304
- _this3.dispatchToSDK(EVENT.error.name, {
305
- code: ERRORMESSAGE.CREATECOMPONENT_ERROR.code
306
- });
307
- reject(err);
308
- });
309
- });
301
+ // eslint-disable-next-line no-async-promise-executor
302
+ this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
303
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
304
+ var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4;
305
+ var envInfo, params, securityConfig, _this5$_renderParams5, extendInfo, info, _this5$_renderParams6, _ref3, _ref3$productSceneVer, productSceneVersion, _ref3$productScene, productScene, _ref4, _ref4$action, _ref4$action2, _ref4$action2$autoDeb, autoDebitWithToken, _this5$_renderParams7, _action$web, _action$wap, action, signType;
306
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
307
+ while (1) switch (_context2.prev = _context2.next) {
308
+ case 0:
309
+ envInfo = {
310
+ locale: _this5.AMSSDK.options.locale
311
+ };
312
+ params = {
313
+ paymentSessionData: _this5._renderParams && ((_this5$_renderParams = _this5._renderParams) === null || _this5$_renderParams === void 0 ? void 0 : _this5$_renderParams.sessionData) || '',
314
+ paymentSessionConfig: (_this5$_renderParams2 = _this5._renderParams) === null || _this5$_renderParams2 === void 0 || (_this5$_renderParams2 = _this5$_renderParams2.paymentSessionMetaData) === null || _this5$_renderParams2 === void 0 ? void 0 : _this5$_renderParams2.paymentSessionConfig,
315
+ notRedirectAfterComplete: ((_this5$_renderParams3 = _this5._renderParams) === null || _this5$_renderParams3 === void 0 ? void 0 : _this5$_renderParams3.notRedirectAfterComplete) === true
316
+ };
317
+ /**
318
+ * @description card
319
+ */
320
+ if (componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign) {
321
+ params.paymentMethodType = 'CARD';
322
+ }
323
+ securityConfig = (_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 || (_this5$_renderParams4 = _this5$_renderParams4.paymentSessionMetaData) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.securityConfig;
324
+ if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign && securityConfig)) {
325
+ _context2.next = 11;
326
+ break;
327
+ }
328
+ extendInfo = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 || (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.extendInfo) || '{}';
329
+ info = JSON.parse(extendInfo);
330
+ if (!((info === null || info === void 0 ? void 0 : info.cardTokenPay) !== 'false')) {
331
+ _context2.next = 11;
332
+ break;
333
+ }
334
+ _context2.next = 10;
335
+ return _this5.getDeviceIdAndLog();
336
+ case 10:
337
+ envInfo.deviceId = _context2.sent;
338
+ case 11:
339
+ if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
340
+ _context2.next = 16;
341
+ break;
342
+ }
343
+ _ref3 = params.paymentSessionConfig || {}, _ref3$productSceneVer = _ref3.productSceneVersion, productSceneVersion = _ref3$productSceneVer === void 0 ? '' : _ref3$productSceneVer, _ref3$productScene = _ref3.productScene, productScene = _ref3$productScene === void 0 ? '' : _ref3$productScene;
344
+ _ref4 = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData) || {}, _ref4$action = _ref4.action, _ref4$action2 = _ref4$action === void 0 ? {} : _ref4$action, _ref4$action2$autoDeb = _ref4$action2.autoDebitWithToken, autoDebitWithToken = _ref4$action2$autoDeb === void 0 ? false : _ref4$action2$autoDeb;
345
+ if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken)) {
346
+ _context2.next = 16;
347
+ break;
348
+ }
349
+ return _context2.abrupt("return", resolve({
350
+ message: 'sdk no need to make query request',
351
+ success: true
352
+ }));
353
+ case 16:
354
+ if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
355
+ _context2.next = 23;
356
+ break;
357
+ }
358
+ action = ((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 || (_this5$_renderParams7 = _this5$_renderParams7.paymentSessionMetaData) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.action) || {};
359
+ signType = isPC() ? action === null || action === void 0 || (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 || (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType;
360
+ if (!(signType === 'SMS')) {
361
+ _context2.next = 21;
362
+ break;
363
+ }
364
+ return _context2.abrupt("return", resolve({
365
+ message: 'sdk no need to make query request',
366
+ success: true
367
+ }));
368
+ case 21:
369
+ if (!(!signType || signType !== 'REDIRECT')) {
370
+ _context2.next = 23;
371
+ break;
372
+ }
373
+ return _context2.abrupt("return", resolve({
374
+ success: false
375
+ }));
376
+ case 23:
377
+ if (!isLocalMock()) {
378
+ _context2.next = 25;
379
+ break;
380
+ }
381
+ return _context2.abrupt("return", resolve({
382
+ message: 'sdk no need to make query request',
383
+ success: true
384
+ }));
385
+ case 25:
386
+ queryPaymentInfo(params, {
387
+ env: _this5.AMSSDK.options.env.environment,
388
+ envInfo: envInfo
389
+ }, _this5.AMSSDK.logger).then(function (res) {
390
+ _this5._performanceData.push({
391
+ key: 'sdk_action_query_end',
392
+ value: Date.now()
393
+ });
394
+ if (res !== null && res !== void 0 && res.success) {
395
+ resolve(res);
396
+ } else {
397
+ resolve(res);
398
+ }
399
+ }).catch(function (err) {
400
+ if (componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign) {
401
+ return resolve({
402
+ success: false
403
+ });
404
+ }
405
+ _this5.dispatchToSDK(EVENT.error.name, {
406
+ code: ERRORMESSAGE.CREATECOMPONENT_ERROR.code
407
+ });
408
+ reject(err);
409
+ });
410
+ case 26:
411
+ case "end":
412
+ return _context2.stop();
413
+ }
414
+ }, _callee2);
415
+ }));
416
+ return function (_x, _x2) {
417
+ return _ref2.apply(this, arguments);
418
+ };
419
+ }());
310
420
  return this._actionQueryPromise;
311
421
  }
312
422
  }, {
@@ -368,17 +478,21 @@ var ComponentApp = /*#__PURE__*/function () {
368
478
  extendInfo: extendInfo
369
479
  });
370
480
  this.app = createIframe(this.AMSSDK.options.mode, this.platform);
371
- this.app.src = getIframeUrl({
372
- renderDisplayType: renderParams.renderDisplayType,
373
- componentSign: this._componentSign,
374
- analytics: this.AMSSDK.options.analytics,
375
- productSceneVersion: productSceneVersion,
376
- environment: environment,
377
- appVersion: this._appVersion,
378
- extendInfo: extendInfo,
379
- locale: this.AMSSDK.options.locale,
380
- instanceId: this.AMSSDK._instanceId
381
- });
481
+ var _getIframeUrl = getIframeUrl({
482
+ renderDisplayType: renderParams.renderDisplayType,
483
+ componentSign: this._componentSign,
484
+ analytics: this.AMSSDK.options.analytics,
485
+ productSceneVersion: productSceneVersion,
486
+ environment: environment,
487
+ appVersion: this._appVersion,
488
+ extendInfo: extendInfo,
489
+ locale: this.AMSSDK.options.locale,
490
+ instanceId: this.AMSSDK._instanceId
491
+ }),
492
+ path = _getIframeUrl.path,
493
+ locationSearch = _getIframeUrl.locationSearch;
494
+ this._appLocationSearch = locationSearch;
495
+ this.app.src = "".concat(path, "?").concat(locationSearch);
382
496
 
383
497
  // Subscribe to messages from iframe
384
498
  this.addEventListener();
@@ -391,17 +505,11 @@ var ComponentApp = /*#__PURE__*/function () {
391
505
  }, {
392
506
  key: "listener",
393
507
  value: function listener(e) {
394
- if (e.origin !== this.appDomain) {
395
- return;
396
- }
508
+ if (e.origin !== this.appDomain) return;
397
509
  var isJson = isJsonString(e.data);
398
510
  if (isJson) {
399
511
  var data = JSON.parse(e.data);
400
- if (data.name !== messageName.APP_TO_SDK && data.name !== messageName.APP_TO_APP || data.instanceId !== this.AMSSDK._instanceId) {
401
- return;
402
- }
403
- // TODO
404
- // 如果带有callback标识,则从map结构中取出callbackfunc,执行,执行后在map结构中删除
512
+ if (data.name !== messageName.APP_TO_SDK && data.name !== messageName.APP_TO_APP || data.instanceId !== this.AMSSDK._instanceId) return;
405
513
  this._handleAppMessage(data);
406
514
  } else {
407
515
  console.warn(ERRORMESSAGE.NOT_JSON_FORMAT);
@@ -424,7 +532,54 @@ var ComponentApp = /*#__PURE__*/function () {
424
532
  }
425
533
  });
426
534
  }
427
-
535
+ }, {
536
+ key: "createPopupWindow",
537
+ value: function createPopupWindow(data) {
538
+ var _this$_renderParams3;
539
+ this._threedData = data;
540
+ var sessionData = encodeURIComponent((_this$_renderParams3 = this._renderParams) === null || _this$_renderParams3 === void 0 ? void 0 : _this$_renderParams3.sessionData);
541
+ var threedPageUrl = "".concat(marmotMap[this.AMSSDK.options.env.environment], "/threedPage/index.html?scene=threedWrapperPage&sessionData=").concat(sessionData, "&").concat(this._appLocationSearch);
542
+ this.popupWindow = createModal({
543
+ device: this.platform,
544
+ url: threedPageUrl
545
+ });
546
+ }
547
+ }, {
548
+ key: "getDeviceIdAndCallback",
549
+ value: function () {
550
+ var _getDeviceIdAndCallback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventContext) {
551
+ var deviceId;
552
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
553
+ while (1) switch (_context3.prev = _context3.next) {
554
+ case 0:
555
+ if (!(eventContext !== null && eventContext !== void 0 && eventContext.eventCallbackId)) {
556
+ _context3.next = 5;
557
+ break;
558
+ }
559
+ _context3.next = 3;
560
+ return this.getDeviceIdAndLog();
561
+ case 3:
562
+ deviceId = _context3.sent;
563
+ this.dispatchToApp({
564
+ context: {
565
+ event: 'appEventCallback',
566
+ eventCallbackId: eventContext === null || eventContext === void 0 ? void 0 : eventContext.eventCallbackId,
567
+ data: {
568
+ deviceId: deviceId
569
+ }
570
+ }
571
+ });
572
+ case 5:
573
+ case "end":
574
+ return _context3.stop();
575
+ }
576
+ }, _callee3, this);
577
+ }));
578
+ function getDeviceIdAndCallback(_x3) {
579
+ return _getDeviceIdAndCallback.apply(this, arguments);
580
+ }
581
+ return getDeviceIdAndCallback;
582
+ }()
428
583
  /**
429
584
  * @description Initialize subscription iframe message
430
585
  */
@@ -450,10 +605,32 @@ var ComponentApp = /*#__PURE__*/function () {
450
605
  }, {
451
606
  key: "_handleAppMessage",
452
607
  value: function _handleAppMessage(data) {
453
- var eventKeyMap = [EVENT.launch.name, EVENT.redirect.name, EVENT.sizeChanged.name, EVENT.log.name, EVENT.close.name, EVENT.error.name, EVENT.eventCallback.name, EVENT.submitForm.name, EVENT.showCloseButton.name, EVENT.hideCloseButton.name, EVENT.setAllowRetention.name, EVENT.declareCheckoutInfo.name, EVENT.showPopup.name, EVENT.dismissLoading.name];
608
+ var eventKeyMap = [EVENT.launch.name, EVENT.redirect.name, EVENT.sizeChanged.name, EVENT.log.name, EVENT.close.name, EVENT.error.name, EVENT.eventCallback.name, EVENT.submitForm.name, EVENT.showCloseButton.name, EVENT.hideCloseButton.name, EVENT.setAllowRetention.name, EVENT.declareCheckoutInfo.name, EVENT.showPopup.name, EVENT.dismissLoading.name, EVENT.popupWindow.name, EVENT.threedReady.name, EVENT.closePopup.name, EVENT.getDeviceId.name];
454
609
  if (!eventKeyMap.includes(data.context.event)) {
455
610
  return;
456
611
  }
612
+ if (data.context.event === EVENT.getDeviceId.name) {
613
+ this.getDeviceIdAndCallback(data.context);
614
+ return;
615
+ }
616
+ if (data.context.event === EVENT.closePopup.name) {
617
+ destroyModal();
618
+ return;
619
+ }
620
+ if (data.context.event === EVENT.threedReady.name) {
621
+ this.dispatchToApp({
622
+ context: {
623
+ event: 'renderThreedPage',
624
+ data: this._threedData
625
+ }
626
+ }, this.popupWindow);
627
+ return;
628
+ }
629
+ if (data.context.event === EVENT.popupWindow.name) {
630
+ var _data$context;
631
+ this.createPopupWindow((_data$context = data.context) === null || _data$context === void 0 ? void 0 : _data$context.data);
632
+ return;
633
+ }
457
634
  if (data.context.event === EVENT.dismissLoading.name) {
458
635
  var _data$context$data;
459
636
  this.dispatchToSDK(EVENT.eventCallback.name, {
@@ -501,6 +678,11 @@ var ComponentApp = /*#__PURE__*/function () {
501
678
  this.handleDeclareInfo(data.context.data);
502
679
  return;
503
680
  }
681
+ if (data.context.event === EVENT.eventCallback.name) {
682
+ this.AMSSDK.logger.logInfo({
683
+ title: 'sdk_event_event_callback'
684
+ }).send();
685
+ }
504
686
 
505
687
  // The plug-in communicates with the sdk after processing
506
688
  this.dispatchToSDK(data.context.event, data.context.data, data.context.eventCallbackId);
@@ -558,7 +740,7 @@ var ComponentApp = /*#__PURE__*/function () {
558
740
  }, {
559
741
  key: "handleRedirect",
560
742
  value: function handleRedirect(data) {
561
- var _this4 = this;
743
+ var _this6 = this;
562
744
  var _data = typeof data === 'string' ? {
563
745
  normalUrl: data
564
746
  } : {
@@ -567,23 +749,42 @@ var ComponentApp = /*#__PURE__*/function () {
567
749
  normalUrl: (data === null || data === void 0 ? void 0 : data.normalUrl) || '',
568
750
  target: data === null || data === void 0 ? void 0 : data.target
569
751
  };
752
+ this.AMSSDK.logger.logInfo({
753
+ title: 'sdk_event_call_url_start'
754
+ }, {
755
+ redirectInfo: JSON.stringify(_data)
756
+ }).send();
570
757
  var successCallback = function successCallback(type, url) {
571
- _this4.dispatchToSDK(EVENT.eventCallback.name, {
758
+ _this6.dispatchToSDK(EVENT.eventCallback.name, {
572
759
  code: eventCodeEnum.SDK_CALL_URL_SUCCESS,
573
760
  message: "Successfully opened the app,".concat(type, ": ").concat(url)
574
761
  });
762
+ _this6.AMSSDK.logger.logInfo({
763
+ title: 'sdk_event_call_url_success'
764
+ }, {
765
+ redirectInfo: JSON.stringify(_data),
766
+ openType: type,
767
+ url: url
768
+ }).send();
575
769
  };
576
- var failCallback = function failCallback() {
577
- _this4.dispatchToSDK(EVENT.eventCallback.name, {
770
+ var failCallback = function failCallback(type, url) {
771
+ _this6.dispatchToSDK(EVENT.eventCallback.name, {
578
772
  code: eventCodeEnum.SDK_CALL_URL_SUCCESS,
579
773
  message: "Failed to open app,applinkUrl: ".concat(_data === null || _data === void 0 ? void 0 : _data.applinkUrl, " schemeUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.schemeUrl, " normalUrl: ").concat(_data === null || _data === void 0 ? void 0 : _data.normalUrl)
580
774
  });
775
+ _this6.AMSSDK.logger.logInfo({
776
+ title: 'sdk_error_call_url_failed'
777
+ }, {
778
+ redirectInfo: JSON.stringify(_data),
779
+ openType: type,
780
+ url: url
781
+ }).send();
581
782
  };
582
783
 
583
784
  // 支持 target: _blank,新开tab页打开
584
785
  if (_data.target === targetEnum.BLANK) {
585
- if (!_data.normalUrl) return failCallback();
586
- successCallback('normalUrl', _data.normalUrl);
786
+ if (!_data.normalUrl) return failCallback(RedirectType.NormalUrl, '');
787
+ successCallback(RedirectType.NormalUrl, _data.normalUrl);
587
788
  window.open(_data.normalUrl);
588
789
  return;
589
790
  }
@@ -591,28 +792,30 @@ var ComponentApp = /*#__PURE__*/function () {
591
792
  this.AMSSDK._redirect({
592
793
  applinkUrl: _data === null || _data === void 0 ? void 0 : _data.applinkUrl
593
794
  }).then(function () {
594
- successCallback('applinkUrl', _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
795
+ successCallback(RedirectType.ApplinkUrl, _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
595
796
  }).catch(function () {
596
- return _this4.AMSSDK._redirect({
797
+ failCallback(RedirectType.ApplinkUrl, _data === null || _data === void 0 ? void 0 : _data.applinkUrl);
798
+ return _this6.AMSSDK._redirect({
597
799
  schemeUrl: _data === null || _data === void 0 ? void 0 : _data.schemeUrl
598
800
  });
599
801
  }).then(function () {
600
- successCallback('schemeUrl', _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
802
+ successCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
601
803
  }).catch(function () {
602
- return _this4.AMSSDK._redirect({
804
+ failCallback(RedirectType.SchemeUrl, _data === null || _data === void 0 ? void 0 : _data.schemeUrl);
805
+ return _this6.AMSSDK._redirect({
603
806
  normalUrl: _data === null || _data === void 0 ? void 0 : _data.normalUrl
604
807
  });
605
808
  }).then(function () {
606
- successCallback('normalUrl', _data === null || _data === void 0 ? void 0 : _data.normalUrl);
809
+ successCallback(RedirectType.NormalUrl, _data === null || _data === void 0 ? void 0 : _data.normalUrl);
607
810
  }).catch(function () {
608
- failCallback();
811
+ failCallback(RedirectType.NormalUrl, _data === null || _data === void 0 ? void 0 : _data.normalUrl);
609
812
  });
610
813
  }
611
814
  }, {
612
815
  key: "handleDeclareInfo",
613
- value: function handleDeclareInfo(_ref4) {
614
- var _ref4$closeDialogData = _ref4.closeDialogData,
615
- closeDialogData = _ref4$closeDialogData === void 0 ? {} : _ref4$closeDialogData;
816
+ value: function handleDeclareInfo(_ref5) {
817
+ var _ref5$closeDialogData = _ref5.closeDialogData,
818
+ closeDialogData = _ref5$closeDialogData === void 0 ? {} : _ref5$closeDialogData;
616
819
  _handleDeclareInfo({
617
820
  closeDialogData: closeDialogData
618
821
  });
@@ -644,13 +847,21 @@ var ComponentApp = /*#__PURE__*/function () {
644
847
  }, {
645
848
  key: "dispatchToApp",
646
849
  value: function dispatchToApp(payload) {
850
+ var targetElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
647
851
  var data = Object.assign({}, payload, {
648
852
  name: messageName.SDK_TO_APP,
649
853
  mode: this.AMSSDK.options.mode,
650
854
  appId: COMPONENTPLUGINID,
651
855
  instanceId: this.AMSSDK._instanceId
652
856
  });
653
- // TODO 如果存在回调函数,则增加callBack标识,并存入map。map可以设置
857
+ this.AMSSDK.logger.logInfo({
858
+ title: 'sdk_event_send_message_to_web'
859
+ }, {
860
+ event: data === null || data === void 0 ? void 0 : data.context.event
861
+ }).send();
862
+ if (targetElement && targetElement.contentWindow) {
863
+ return targetElement.contentWindow.postMessage(JSON.stringify(data), '*');
864
+ }
654
865
  if (this.app && this.app.contentWindow) {
655
866
  return this.app.contentWindow.postMessage(JSON.stringify(data), this.appDomain);
656
867
  }
@@ -678,22 +889,22 @@ var ComponentApp = /*#__PURE__*/function () {
678
889
  }, {
679
890
  key: "sendRenderEvent",
680
891
  value: function () {
681
- var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
682
- var _this$_renderParams2, _this$_renderParams3, _this$_renderParams4, _this$_renderParams5, res;
683
- return _regeneratorRuntime().wrap(function _callee$(_context) {
684
- while (1) switch (_context.prev = _context.next) {
892
+ var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
893
+ var _this$_renderParams4, _this$_renderParams5, _this$_renderParams6, _this$_renderParams7, _this$_renderParams8, res;
894
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
895
+ while (1) switch (_context4.prev = _context4.next) {
685
896
  case 0:
686
- _context.prev = 0;
897
+ _context4.prev = 0;
687
898
  if (this._actionQueryPromise) {
688
- _context.next = 3;
899
+ _context4.next = 3;
689
900
  break;
690
901
  }
691
- return _context.abrupt("return");
902
+ return _context4.abrupt("return");
692
903
  case 3:
693
- _context.next = 5;
904
+ _context4.next = 5;
694
905
  return this._actionQueryPromise;
695
906
  case 5:
696
- res = _context.sent;
907
+ res = _context4.sent;
697
908
  this._performanceData.push({
698
909
  key: 'sdk_render_component',
699
910
  value: Date.now()
@@ -703,11 +914,12 @@ var ComponentApp = /*#__PURE__*/function () {
703
914
  event: 'renderComponent',
704
915
  data: {
705
916
  queryResult: res,
706
- sessionResult: (_this$_renderParams2 = this._renderParams) === null || _this$_renderParams2 === void 0 ? void 0 : _this$_renderParams2.paymentSessionMetaData,
707
- paymentSessionData: (_this$_renderParams3 = this._renderParams) === null || _this$_renderParams3 === void 0 ? void 0 : _this$_renderParams3.sessionData,
917
+ sessionResult: (_this$_renderParams4 = this._renderParams) === null || _this$_renderParams4 === void 0 ? void 0 : _this$_renderParams4.paymentSessionMetaData,
918
+ paymentSessionData: (_this$_renderParams5 = this._renderParams) === null || _this$_renderParams5 === void 0 ? void 0 : _this$_renderParams5.sessionData,
708
919
  heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
709
- renderDisplayType: (_this$_renderParams4 = this._renderParams) === null || _this$_renderParams4 === void 0 ? void 0 : _this$_renderParams4.renderDisplayType,
710
- appearance: (_this$_renderParams5 = this._renderParams) === null || _this$_renderParams5 === void 0 ? void 0 : _this$_renderParams5.appearance,
920
+ renderDisplayType: (_this$_renderParams6 = this._renderParams) === null || _this$_renderParams6 === void 0 ? void 0 : _this$_renderParams6.renderDisplayType,
921
+ appearance: (_this$_renderParams7 = this._renderParams) === null || _this$_renderParams7 === void 0 ? void 0 : _this$_renderParams7.appearance,
922
+ notRedirectAfterComplete: ((_this$_renderParams8 = this._renderParams) === null || _this$_renderParams8 === void 0 ? void 0 : _this$_renderParams8.notRedirectAfterComplete) === true,
711
923
  envInfo: {
712
924
  screenHeight: screen.height,
713
925
  screenWidth: screen.width
@@ -724,16 +936,16 @@ var ComponentApp = /*#__PURE__*/function () {
724
936
  }
725
937
  });
726
938
  // eslint-disable-next-line no-empty
727
- _context.next = 13;
939
+ _context4.next = 13;
728
940
  break;
729
941
  case 11:
730
- _context.prev = 11;
731
- _context.t0 = _context["catch"](0);
942
+ _context4.prev = 11;
943
+ _context4.t0 = _context4["catch"](0);
732
944
  case 13:
733
945
  case "end":
734
- return _context.stop();
946
+ return _context4.stop();
735
947
  }
736
- }, _callee, this, [[0, 11]]);
948
+ }, _callee4, this, [[0, 11]]);
737
949
  }));
738
950
  function sendRenderEvent() {
739
951
  return _sendRenderEvent.apply(this, arguments);
@@ -747,7 +959,7 @@ var ComponentApp = /*#__PURE__*/function () {
747
959
  key: "cleanContainer",
748
960
  value: function cleanContainer() {
749
961
  var _document$getElementB4,
750
- _this5 = this;
962
+ _this7 = this;
751
963
  var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
752
964
  this._loadAppPromiseResolve && this._loadAppPromiseResolve(true);
753
965
  this._performanceData = [];
@@ -759,7 +971,7 @@ var ComponentApp = /*#__PURE__*/function () {
759
971
  mockup === null || mockup === void 0 || mockup.classList.add("".concat(MOCKUP_ID, "-hidden"));
760
972
  if (immediately) this.cleanElement();else {
761
973
  setTimeout(function () {
762
- _this5.cleanElement();
974
+ _this7.cleanElement();
763
975
  }, 300);
764
976
  }
765
977
  }