@alipay/ams-checkout 1.11.0 → 1.12.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.
@@ -12,8 +12,8 @@ var _queryParse = queryParse(),
12
12
  groupId = _queryParse.groupId,
13
13
  host = _queryParse.requestHost;
14
14
  export var requestHost = {
15
- local: 'http://imgs-1529.gz00b.dev.alipay.net/mgw.htm',
16
- dev: host || 'http://imgs-1529.gz00b.dev.alipay.net/mgw.htm',
15
+ local: 'http://imgs-8452.sggz00b.dev.alipay.net/mgw.htm',
16
+ dev: host || 'http://imgs-8452.sggz00b.dev.alipay.net/mgw.htm',
17
17
  sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
18
18
  pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
19
19
  prod: 'https://imgs-sea-global.alipay.com/mgw.htm',
@@ -22,7 +22,7 @@ export var requestHost = {
22
22
  export var clientId = '5J5Y8X4E2Y25GR00690';
23
23
  export var tntInstId = 'ALIPW3SG';
24
24
  export var appId = 'ANTOM_PAYMENT_WEB';
25
- export var sofaId = groupId || 'GROUP_20231218150235';
25
+ export var sofaId = groupId || 'GROUP_20240304204929';
26
26
  export var hostSignMap = function hostSignMap(hostSign, env) {
27
27
  var map = {
28
28
  SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
@@ -1,4 +1,4 @@
1
- import type { Logger } from "../../util/logger";
1
+ import type { Logger } from '../../util/logger';
2
2
  /**
3
3
  * Bus 埋点内容定义
4
4
  */
@@ -4,7 +4,11 @@ export declare enum PaymentActionEnum {
4
4
  export declare enum ApplePayActionEnum {
5
5
  canMakePayments = "plugin_CARD_APPLE_PAY_available",
6
6
  createComponent = "plugin_CARD_APPLE_PAY_createComponent",
7
- destoryComponent = "plugin_CARD_APPLE_PAY_destoryComponent"
7
+ destroyComponent = "plugin_CARD_APPLE_PAY_destroyComponent"
8
+ }
9
+ export declare enum PaypalActionEnum {
10
+ mountComponent = "plugin_Paypal_mountComponent",
11
+ destroyComponent = "plugin_Paypal_destroyComponent"
8
12
  }
9
13
  export declare enum SDKCallbackActionEnum {
10
14
  onEventCallback = "onEventCallback"
@@ -5,9 +5,14 @@ export var PaymentActionEnum = /*#__PURE__*/function (PaymentActionEnum) {
5
5
  export var ApplePayActionEnum = /*#__PURE__*/function (ApplePayActionEnum) {
6
6
  ApplePayActionEnum["canMakePayments"] = "plugin_CARD_APPLE_PAY_available";
7
7
  ApplePayActionEnum["createComponent"] = "plugin_CARD_APPLE_PAY_createComponent";
8
- ApplePayActionEnum["destoryComponent"] = "plugin_CARD_APPLE_PAY_destoryComponent";
8
+ ApplePayActionEnum["destroyComponent"] = "plugin_CARD_APPLE_PAY_destroyComponent";
9
9
  return ApplePayActionEnum;
10
10
  }({});
11
+ export var PaypalActionEnum = /*#__PURE__*/function (PaypalActionEnum) {
12
+ PaypalActionEnum["mountComponent"] = "plugin_Paypal_mountComponent";
13
+ PaypalActionEnum["destroyComponent"] = "plugin_Paypal_destroyComponent";
14
+ return PaypalActionEnum;
15
+ }({});
11
16
  export var SDKCallbackActionEnum = /*#__PURE__*/function (SDKCallbackActionEnum) {
12
17
  SDKCallbackActionEnum["onEventCallback"] = "onEventCallback";
13
18
  return SDKCallbackActionEnum;
@@ -7,6 +7,7 @@ export declare class AMSComponent extends CoreInstance {
7
7
  _componentApp: ComponentApp;
8
8
  channelType: componentSignEnum[];
9
9
  productSceneVersion: string;
10
+ timer: any;
10
11
  constructor(options: IoptionsParams);
11
12
  private parameterInitAndCheck;
12
13
  private pluginAppendIframe;
@@ -29,18 +29,19 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
29
  */
30
30
  import { v4 as uuid } from 'uuid';
31
31
  import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
32
+ import { ApplePayBusSubscriber } from "../../plugin/applepay";
32
33
  import ComponentApp from "../../plugin/component";
34
+ import { ExtendPlugin } from "../../plugin/const";
35
+ import { PaypalBusSubscriber } from "../../plugin/paypal";
33
36
  import { componentSignEnum, environmentEnum, modeEnum, networkModeEnum, productSceneEnum, renderDisplayTypeEnum } from "../../types";
34
37
  import { getOrSetStorageId, isPC, parseBase64ToString } from "../../util";
35
38
  import { createIframeNode, createPreloadIframeNode } from "../../util/createIframeNode";
36
39
  import { getSecurityConfigStorageKey } from "../../util/security";
37
- import CoreInstance from "../instance/index";
38
40
  import { BusManager, BusMessage } from "../bus";
39
41
  import { SDKCallbackBusSubscriber } from "../bus/ability/callback";
40
- import { ApplePayBusSubscriber } from "../../plugin/applepay";
41
42
  import { SecurityBusSubscriber } from "../bus/ability/security";
42
43
  import { TrackerBusSubscriber } from "../bus/ability/tracker";
43
- import { ExtendPlugin } from "../../plugin/const";
44
+ import CoreInstance from "../instance/index";
44
45
  export var getComponentSign = function getComponentSign(params) {
45
46
  var _params$paymentSessio = params.paymentSessionConfig,
46
47
  _params$paymentSessio2 = _params$paymentSessio === void 0 ? {} : _params$paymentSessio,
@@ -74,7 +75,7 @@ var handleSessionData = function handleSessionData(originSessionData) {
74
75
  parseData = _parseSessionData2[0],
75
76
  sessionData = _parseSessionData2[1];
76
77
  resetEasyPaySceneVersion(parseData);
77
- return [parseData, sessionData];
78
+ return [parseData !== null && parseData !== void 0 ? parseData : {}, sessionData];
78
79
  };
79
80
  var handleParams = function handleParams(params) {
80
81
  var _params = Object.assign({
@@ -116,6 +117,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
116
117
  _defineProperty(_assertThisInitialized(_this), "_componentApp", void 0);
117
118
  _defineProperty(_assertThisInitialized(_this), "channelType", void 0);
118
119
  _defineProperty(_assertThisInitialized(_this), "productSceneVersion", void 0);
120
+ _defineProperty(_assertThisInitialized(_this), "timer", void 0);
119
121
  var ComponentPlugin = new ComponentApp();
120
122
  ComponentPlugin.setRender(createIframeNode);
121
123
  ComponentPlugin.setPreloadRender(createPreloadIframeNode);
@@ -229,6 +231,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
229
231
  BusManager.subscribe(new TrackerBusSubscriber(this.logger));
230
232
  // subscribe plugin
231
233
  BusManager.subscribe(new ApplePayBusSubscriber(this.logger));
234
+ BusManager.subscribe(new PaypalBusSubscriber(this.logger));
232
235
 
233
236
  // register bus plugin
234
237
  ExtendPlugin.forEach(function (item) {
@@ -264,7 +267,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
264
267
  * only the channel described in the document will be called, and it will be returned as available by default
265
268
  * @param paymentMethod - described in the document
266
269
  * @param subPaymentMethod - described in the document
267
- * @returns
270
+ * @returns
268
271
  */
269
272
  }, {
270
273
  key: "canMakePayments",
@@ -322,6 +325,8 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
322
325
  _this4._eventCenter.emit(EVENT.error.name, error);
323
326
  return Promise.reject(error);
324
327
  }).then(function (appendParams) {
328
+ var iframeNodesParams = appendParams.iframeNodesParams;
329
+ _this4.logger.setTrackId(iframeNodesParams === null || iframeNodesParams === void 0 ? void 0 : iframeNodesParams.sessionData);
325
330
  return _this4.createComponentProcess(appendParams);
326
331
  });
327
332
  }
@@ -361,7 +366,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
361
366
  channelType: channelType
362
367
  });
363
368
  }
364
- setTimeout(function () {
369
+ this.timer = setTimeout(function () {
365
370
  _this5.clearPreloadIframe(true);
366
371
  }, MAX_CLEAR_TIME);
367
372
  }
@@ -369,6 +374,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
369
374
  key: "clearPreloadIframe",
370
375
  value: function clearPreloadIframe() {
371
376
  var isTimeOut = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
377
+ !isTimeOut && clearTimeout(this.timer);
372
378
  if (Array.isArray(this.channelType)) {
373
379
  for (var i = 0; i < this.channelType.length; i++) {
374
380
  var iframe = document.getElementById("ams-checkout-component-".concat(this.channelType[i], "-").concat(this.productSceneVersion));
@@ -410,6 +416,8 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
410
416
  _this6._eventCenter.emit(EVENT.error.name, error);
411
417
  return Promise.reject(error);
412
418
  }).then(function (appendParams) {
419
+ var iframeNodesParams = appendParams.iframeNodesParams;
420
+ _this6.logger.setTrackId(iframeNodesParams === null || iframeNodesParams === void 0 ? void 0 : iframeNodesParams.sessionData);
413
421
  return _this6.mountComponentProcess(appendParams);
414
422
  });
415
423
  }
@@ -1,8 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+ * 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
6
+ * 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.
7
+ */
8
+ import { ComponentActionNamesType } from 'src/plugin/type';
1
9
  import type { AMSCheckoutOptions, IAppendParams, InitSecurityConfig, IoptionsParams } from '../../types/index';
2
10
  import { EventCenter } from '../../util/index';
3
11
  import { Logger } from '../../util/logger';
4
12
  import { Security } from '../../util/security';
5
- import { ComponentActionNamesType } from 'src/plugin/type';
6
13
  export default class AMSSDK {
7
14
  options: AMSCheckoutOptions;
8
15
  originOptions: IoptionsParams;
@@ -16,6 +16,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
16
16
  * 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.
17
17
  */
18
18
  /* eslint-disable @typescript-eslint/no-explicit-any */
19
+
19
20
  import { v4 as uuid } from 'uuid';
20
21
  import { sdkVersion } from "../../config/index";
21
22
  import { ERRORMESSAGE, EVENT } from "../../constant";
@@ -24,8 +25,8 @@ import { environmentEnum, modeEnum, networkModeEnum, osTypeEnum, productSceneEnu
24
25
  import { checkTimeElapsed, device, EventCenter, getOrSetStorageId, getType, queryParse, safeJson } from "../../util/index";
25
26
  import CallApp from "../../util/intl-callapp/es/main";
26
27
  import { LogConfig, Logger } from "../../util/logger";
27
- import { compareVersion } from "../../util/versionCompare";
28
28
  import { getSecurityConfigStorageKey, getSecurityHost, getSecurityScene, Security, SecurityRegionEnum } from "../../util/security";
29
+ import { compareVersion } from "../../util/versionCompare";
29
30
  import { BusManager, BusMessage } from "../bus";
30
31
  var AMSSDK = /*#__PURE__*/function () {
31
32
  function AMSSDK(options) {
@@ -56,23 +57,26 @@ var AMSSDK = /*#__PURE__*/function () {
56
57
  this._storageId = _storageId;
57
58
 
58
59
  // TODO Consumption data analysis control parameters
59
- this.logger = new Logger(LogConfig, (options === null || options === void 0 ? void 0 : options.environment) !== environmentEnum.prod);
60
+ this.logger = new Logger(LogConfig, ![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
60
61
  this.logger.setMedta({
61
62
  instanceId: this._instanceId
62
63
  });
63
64
  this.logger.initTracker();
65
+ this.logger.setComponentStartTime(Date.now());
66
+ this.logger.setTrackId(this._instanceId);
64
67
  this.logger.logInfo({
65
68
  title: 'NEW_AMSSDK_BY_MECHANT',
66
- msg: "".concat(options === null || options === void 0 ? void 0 : options.environment, "_").concat(options === null || options === void 0 ? void 0 : options.locale, "}")
69
+ msg: "".concat(options === null || options === void 0 ? void 0 : options.environment, "_").concat(options === null || options === void 0 ? void 0 : options.locale)
67
70
  }).send();
68
- this.preInitSecurity();
71
+ this.preInitSecurity(options);
69
72
  }
70
73
  _createClass(AMSSDK, [{
71
74
  key: "preInitSecurity",
72
- value: function preInitSecurity() {
75
+ value: function preInitSecurity(options) {
73
76
  var _this$options;
74
77
  var antomSDKConfigKey = 'antomSDKConfigKey';
75
78
  var config = safeJson(getOrSetStorageId(antomSDKConfigKey), {});
79
+ if (![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment)) return;
76
80
  if (checkTimeElapsed()) {
77
81
  antomConfig({
78
82
  env: this.options.env.environment
@@ -109,11 +113,13 @@ var AMSSDK = /*#__PURE__*/function () {
109
113
  this.logger.logInfo({
110
114
  title: 'sdk_event_apiOnDestroy'
111
115
  }).send();
112
- var actionName = (_this$getBusActionNam = this.getBusActionNames()) === null || _this$getBusActionNam === void 0 ? void 0 : _this$getBusActionNam.destoryComponent;
116
+ var actionName = (_this$getBusActionNam = this.getBusActionNames()) === null || _this$getBusActionNam === void 0 ? void 0 : _this$getBusActionNam.destroyComponent;
113
117
  if (actionName && BusManager.isSubscribed(actionName)) {
118
+ var _this$_appendParams;
114
119
  // 执行出错了,在通用拦截器返回
115
120
  BusManager.publish(new BusMessage(actionName, JSON.stringify({
116
- options: this.originOptions
121
+ options: this.originOptions,
122
+ selector: (_this$_appendParams = this._appendParams) === null || _this$_appendParams === void 0 || (_this$_appendParams = _this$_appendParams.iframeNodesParams) === null || _this$_appendParams === void 0 ? void 0 : _this$_appendParams.selector
117
123
  })));
118
124
  }
119
125
  var _iterator = _createForOfIteratorHelper(this.plugins.values()),
@@ -315,14 +321,14 @@ var AMSSDK = /*#__PURE__*/function () {
315
321
  key: "_registerPlugin",
316
322
  value: function _registerPlugin(pluginId, plugin) {
317
323
  this.plugins.set(pluginId, plugin);
318
- try {
319
- if (plugin.applyPlugin) {
324
+ if (plugin !== null && plugin !== void 0 && plugin.applyPlugin) {
325
+ try {
320
326
  plugin.applyPlugin(this);
327
+ } catch (error) {
328
+ this.plugins.delete(pluginId);
329
+ if (getType(error) === 'error') throw error;
330
+ throw new Error("Failed to register plug-in\uFF1A".concat(pluginId, " Exception in the apply function of the plug-in"));
321
331
  }
322
- } catch (error) {
323
- this.plugins.delete(pluginId);
324
- if (getType(error) === 'error') throw error;
325
- throw new Error("Failed to register plug-in\uFF1A".concat(pluginId, " Exception in the apply function of the plug-in"));
326
332
  }
327
333
  }
328
334
  /**
@@ -337,6 +343,7 @@ var AMSSDK = /*#__PURE__*/function () {
337
343
  }
338
344
  return this.plugins.get(pluginId);
339
345
  }
346
+
340
347
  /**
341
348
  * @description Execute to open app or jump link
342
349
  */
@@ -14,7 +14,7 @@ export declare enum ApplePayComponentEvent {
14
14
  sdk_event_appleOnvalidatemerchant = "sdk_event_appleOnvalidatemerchant",
15
15
  sdk_event_appleSubmitToken = "sdk_event_appleSubmitToken",
16
16
  sdk_event_applePaymentResult = "sdk_event_applePaymentResult",
17
- sdk_event_appleDestoryComponent = "sdk_event_appleDestoryComponent"
17
+ sdk_event_appleDestroyComponent = "sdk_event_appleDestroyComponent"
18
18
  }
19
19
  /**
20
20
  * Apple pay Component
@@ -27,7 +27,7 @@ export var ApplePayComponentEvent = /*#__PURE__*/function (ApplePayComponentEven
27
27
  ApplePayComponentEvent["sdk_event_appleOnvalidatemerchant"] = "sdk_event_appleOnvalidatemerchant";
28
28
  ApplePayComponentEvent["sdk_event_appleSubmitToken"] = "sdk_event_appleSubmitToken";
29
29
  ApplePayComponentEvent["sdk_event_applePaymentResult"] = "sdk_event_applePaymentResult";
30
- ApplePayComponentEvent["sdk_event_appleDestoryComponent"] = "sdk_event_appleDestoryComponent";
30
+ ApplePayComponentEvent["sdk_event_appleDestroyComponent"] = "sdk_event_appleDestroyComponent";
31
31
  return ApplePayComponentEvent;
32
32
  }({});
33
33
 
@@ -55,8 +55,8 @@ var ApplePayComponent = /*#__PURE__*/function () {
55
55
 
56
56
  /**
57
57
  * Is Apple Pay Enabled
58
- * @param subTypeEnum
59
- * @returns
58
+ * @param subTypeEnum
59
+ * @returns
60
60
  */
61
61
  _createClass(ApplePayComponent, [{
62
62
  key: "canMakePayments",
@@ -66,8 +66,8 @@ var ApplePayComponent = /*#__PURE__*/function () {
66
66
 
67
67
  /**
68
68
  * Is Apple Pay Enabled
69
- * @param subTypeEnum
70
- * @returns
69
+ * @param subTypeEnum
70
+ * @returns
71
71
  */
72
72
  }, {
73
73
  key: "isAppPayEnabled",
@@ -12,6 +12,6 @@ export declare class ApplePayBusSubscriber extends BusSubscriber {
12
12
  protected onOptionalInit(context: BusContext, message: BusMessage): void;
13
13
  protected onCanMakePayments(context: BusContext, message: BusMessage): void;
14
14
  protected onCreateComponent(context: BusContext, message: BusMessage): void;
15
- protected onDestoryComponent(context: BusContext, message: BusMessage): void;
15
+ protected onDestroyComponent(context: BusContext, message: BusMessage): void;
16
16
  onMessage(context: BusContext, message: BusMessage): void;
17
17
  }
@@ -80,13 +80,13 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
80
80
  this.applePay.submitPay(appendParams);
81
81
  }
82
82
  }, {
83
- key: "onDestoryComponent",
84
- value: function onDestoryComponent(context, message) {
83
+ key: "onDestroyComponent",
84
+ value: function onDestroyComponent(context, message) {
85
85
  this.applePay = null;
86
- console.log('onDestoryComponent', context, message);
86
+ console.log('onDestroyComponent', context, message);
87
87
  this.logger.logInfo({
88
88
  name: 'APPLE_PAY',
89
- title: ApplePayComponentEvent.sdk_event_appleDestoryComponent
89
+ title: ApplePayComponentEvent.sdk_event_appleDestroyComponent
90
90
  }, {
91
91
  biz: 'sdk',
92
92
  type: 'funnel'
@@ -105,8 +105,8 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
105
105
  case ApplePayActionEnum.createComponent:
106
106
  this.onCreateComponent(context, message);
107
107
  break;
108
- case ApplePayActionEnum.destoryComponent:
109
- this.onDestoryComponent(context, message);
108
+ case ApplePayActionEnum.destroyComponent:
109
+ this.onDestroyComponent(context, message);
110
110
  break;
111
111
  default:
112
112
  console.log("Unknown action: " + message.getAction());
@@ -8,7 +8,7 @@
8
8
  import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
9
9
  import { platformEnum } from "../../types";
10
10
  import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../../util";
11
- var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n \n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 80% {\n opacity: 1\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
11
+ var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n \n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
12
12
  export var componentAddCSS = function componentAddCSS() {
13
13
  var style = document.createElement('style');
14
14
  style.type = 'text/css';
@@ -25,7 +25,6 @@ export default class ComponentApp {
25
25
  private _renderDisplayType;
26
26
  private _multipleCallbackEvents;
27
27
  _merchantAppointParam: IMerchantAppointParam;
28
- private _webAppHeartBeatTimeoutId;
29
28
  private _webAppHeartBeatTimeoutFn;
30
29
  constructor();
31
30
  /**
@@ -98,7 +97,7 @@ export default class ComponentApp {
98
97
  */
99
98
  dispatchToApp(payload: {
100
99
  context: eventPayloadContext;
101
- }, targetElement?: any): any;
100
+ }, targetElement?: any, sendLog?: boolean): any;
102
101
  /**
103
102
  * @description Subscribe to messages from SDK
104
103
  */