zmp-sdk 2.16.3 → 2.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -17889,7 +17889,7 @@ var argv = [];
17889
17889
  var version$2 = ''; // empty string to avoid regexp issues
17890
17890
  var versions = {};
17891
17891
  var release$1 = {};
17892
- var config$1 = {};
17892
+ var config = {};
17893
17893
 
17894
17894
  function noop$1() {}
17895
17895
 
@@ -17966,7 +17966,7 @@ var browser$1$1 = {
17966
17966
  hrtime: hrtime,
17967
17967
  platform: platform$2,
17968
17968
  release: release$1,
17969
- config: config$1,
17969
+ config: config,
17970
17970
  uptime: uptime$1
17971
17971
  };
17972
17972
 
@@ -34927,12 +34927,39 @@ const readCookieFallback = (name) => {
34927
34927
  return ck;
34928
34928
  };
34929
34929
 
34930
+ const Byte = 1;
34931
+ const KB = 1024 * Byte;
34932
+ const MB = 1024 * KB;
34930
34933
  const ZAPP_ID = window.zAppID;
34931
34934
  const APP_ID = window.APP_ID;
34932
34935
  const APP_CONFIG = window.APP_CONFIG || {};
34936
+ const MINI_APP_LINK = 'https://zalo.me/app/link/zapps';
34937
+ const MINI_APP_INTERNAL_LINK = 'https://h5.zdn.vn/zapps';
34938
+ const COOKIE_NAME = {
34939
+ ZOAUTH: `h5.zdn.vn_zoauth`,
34940
+ ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
34941
+ JS_TOKEN: `h5.zdn.vn_zlink3rd`,
34942
+ ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`
34943
+ };
34944
+ const APIS = {
34945
+ GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
34946
+ GET_ACCESS_TOKEN: 'https://h5.zalo.me/openapi/access_token',
34947
+ GET_ACCESS_TOKEN_V3: 'https://oauth.zaloapp.com/v3/access_token'
34948
+ };
34949
+ const STORAGE_LIMIT = 5 * MB;
34950
+ const NETWORK_TYPE = (isAndroid) => ({
34951
+ NONE: isAndroid ? -2 : 0,
34952
+ WIFI: isAndroid ? 0 : 1,
34953
+ '2G': isAndroid ? 2 : 2,
34954
+ '3G': isAndroid ? 15 : 2,
34955
+ '4G': isAndroid ? 13 : 2
34956
+ });
34957
+ const MEDIA_PICKER_LIMIT = 1 * MB;
34958
+ const MEDIA_PICKER_UPLOAD_SERVER = 'https://zapi-server.tungnt.xyz/upload/photos';
34933
34959
  const ACTION = {
34934
34960
  GET_DOWNLOADED_STICKER: {
34935
- name: 'action.get.downloaded.sticker'
34961
+ name: 'action.get.downloaded.sticker',
34962
+ have_callback: true
34936
34963
  },
34937
34964
  OPEN_SHARE_STICKER: {
34938
34965
  name: 'action.open.share.sticker'
@@ -35022,19 +35049,23 @@ const ACTION = {
35022
35049
  name: 'action.open.sendsticker'
35023
35050
  },
35024
35051
  REPORT_ABUSE: {
35025
- name: 'action.report.abuse'
35052
+ name: 'action.report.abuse',
35053
+ have_callback: true
35026
35054
  },
35027
35055
  FOLLOW_OA: {
35028
- name: 'action.follow.oa'
35056
+ name: 'action.follow.oa',
35057
+ have_callback: true
35029
35058
  },
35030
35059
  UNFOLLOW_OA: {
35031
- name: 'action.unfollow.oa'
35060
+ name: 'action.unfollow.oa',
35061
+ have_callback: true
35032
35062
  },
35033
35063
  OPEN_GAMEDETAIL: {
35034
35064
  name: 'action.open.gamedetail'
35035
35065
  },
35036
35066
  OPEN_SHARESHEET: {
35037
- name: 'action.open.sharesheet'
35067
+ name: 'action.open.sharesheet',
35068
+ have_callback: true
35038
35069
  },
35039
35070
  REQUEST_PERMISSION_CAMERA: {
35040
35071
  name: 'action.request.permission.camera'
@@ -35061,18 +35092,21 @@ const ACTION = {
35061
35092
  },
35062
35093
  CREATE_OPTIONS_MENU: {
35063
35094
  name: 'action.create.options.menu',
35064
- skip_jump: true
35095
+ skip_jump: true,
35096
+ have_callback: true
35065
35097
  },
35066
35098
  CREATE_SHORTCUT: {
35067
35099
  name: 'action.create.shortcut'
35068
35100
  },
35069
35101
  CHANGE_ACTIONBAR_LEFTBUTTON_TYPE: {
35070
35102
  name: 'action.change.actionbar.leftbutton.type',
35071
- skip_jump: true
35103
+ skip_jump: true,
35104
+ have_callback: true
35072
35105
  },
35073
35106
  WINDOW_CLOSE: {
35074
35107
  name: 'action.window.close',
35075
- skip_jump: true
35108
+ skip_jump: true,
35109
+ have_callback: true
35076
35110
  },
35077
35111
  WEBVIEW_CHECKRESERROR: {
35078
35112
  name: 'action.webview.checkResError'
@@ -35085,7 +35119,8 @@ const ACTION = {
35085
35119
  },
35086
35120
  ZBROWSER_JSBRIDGE: {
35087
35121
  name: 'action.zbrowser.jsbridge',
35088
- skip_jump: true
35122
+ skip_jump: true,
35123
+ have_callback: true
35089
35124
  },
35090
35125
  PROMPT_AUTHENTICATION: {
35091
35126
  name: 'action.prompt.authentication'
@@ -35101,13 +35136,16 @@ const ACTION = {
35101
35136
  name: 'action.open.appstore'
35102
35137
  },
35103
35138
  GET_LOCATION: {
35104
- name: 'action.get.location'
35139
+ name: 'action.get.location',
35140
+ have_callback: true
35105
35141
  },
35106
35142
  QUERY_LOCATION_HIDE: {
35107
- name: 'action.query.location.hide'
35143
+ name: 'action.query.location.hide',
35144
+ have_callback: true
35108
35145
  },
35109
35146
  SHOW_TOAST: {
35110
- name: 'action.show.toast'
35147
+ name: 'action.show.toast',
35148
+ have_callback: true
35111
35149
  },
35112
35150
  OPEN_APP: {
35113
35151
  name: 'action.open.app'
@@ -35125,10 +35163,12 @@ const ACTION = {
35125
35163
  name: 'action.open.sms'
35126
35164
  },
35127
35165
  VIEW_MYQR: {
35128
- name: 'action.view.myqr'
35166
+ name: 'action.view.myqr',
35167
+ have_callback: true
35129
35168
  },
35130
35169
  KEEP_SCREEN: {
35131
- name: 'action.keep.screen'
35170
+ name: 'action.keep.screen',
35171
+ have_callback: true
35132
35172
  },
35133
35173
  CHANGE_AUTOROTATE: {
35134
35174
  name: 'action.change.autorotate',
@@ -35147,25 +35187,31 @@ const ACTION = {
35147
35187
  name: 'action.open.inapprw'
35148
35188
  },
35149
35189
  ZALORUN_GETTRACKINGSTATUS: {
35150
- name: 'action.zalorun.getTrackingStatus'
35190
+ name: 'action.zalorun.getTrackingStatus',
35191
+ have_callback: true
35151
35192
  },
35152
35193
  ZALORUN_SETTRACKINGSTATUS: {
35153
- name: 'action.zalorun.setTrackingStatus'
35194
+ name: 'action.zalorun.setTrackingStatus',
35195
+ have_callback: true
35154
35196
  },
35155
35197
  ZALORUN_GETDAYSTEP: {
35156
- name: 'action.zalorun.getDayStep'
35198
+ name: 'action.zalorun.getDayStep',
35199
+ have_callback: true
35157
35200
  },
35158
35201
  ZALORUN_FORCESUBMITDATA: {
35159
- name: 'action.zalorun.forceSubmitData'
35202
+ name: 'action.zalorun.forceSubmitData',
35203
+ have_callback: true
35160
35204
  },
35161
35205
  ZALORUN_SETWEIGHT: {
35162
- name: 'action.zalorun.setWeight'
35206
+ name: 'action.zalorun.setWeight',
35207
+ have_callback: true
35163
35208
  },
35164
35209
  OPEN_PROFILE_EXT: {
35165
35210
  name: 'action.open.profile.ext'
35166
35211
  },
35167
35212
  DOWNLOAD_CATE: {
35168
- name: 'action.download.cate'
35213
+ name: 'action.download.cate',
35214
+ have_callback: true
35169
35215
  },
35170
35216
  JUMP_LOGIN: {
35171
35217
  name: 'action.jump.login',
@@ -35231,28 +35277,6 @@ const ACTION = {
35231
35277
  version_live: { iOS: 999 }
35232
35278
  }
35233
35279
  };
35234
- const ACTION_HAVE_CALLBACK = [
35235
- ACTION.GET_DOWNLOADED_STICKER.name,
35236
- ACTION.REPORT_ABUSE.name,
35237
- ACTION.FOLLOW_OA.name,
35238
- ACTION.UNFOLLOW_OA.name,
35239
- ACTION.OPEN_SHARESHEET.name,
35240
- ACTION.CREATE_OPTIONS_MENU.name,
35241
- ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,
35242
- ACTION.WINDOW_CLOSE.name,
35243
- ACTION.ZBROWSER_JSBRIDGE.name,
35244
- ACTION.GET_LOCATION.name,
35245
- ACTION.QUERY_LOCATION_HIDE.name,
35246
- ACTION.SHOW_TOAST.name,
35247
- ACTION.VIEW_MYQR.name,
35248
- ACTION.KEEP_SCREEN.name,
35249
- ACTION.ZALORUN_GETTRACKINGSTATUS.name,
35250
- ACTION.ZALORUN_SETTRACKINGSTATUS.name,
35251
- ACTION.ZALORUN_GETDAYSTEP.name,
35252
- ACTION.ZALORUN_FORCESUBMITDATA.name,
35253
- ACTION.ZALORUN_SETWEIGHT.name,
35254
- ACTION.DOWNLOAD_CATE.name
35255
- ];
35256
35280
  const RESPONSE_CODE = {
35257
35281
  BAD_REQUEST: -1400,
35258
35282
  INTERNAL_SERVER_ERROR: -1500,
@@ -35508,6 +35532,96 @@ const apiResponse = {
35508
35532
  }
35509
35533
  };
35510
35534
 
35535
+ function encode(bag) {
35536
+ var pairs = [];
35537
+ for (var key in bag) {
35538
+ if (bag.hasOwnProperty(key)) {
35539
+ var value = bag[key];
35540
+ if (typeof value === "undefined") {
35541
+ return;
35542
+ }
35543
+ if (value === null) {
35544
+ pairs.push(key);
35545
+ return;
35546
+ }
35547
+ pairs.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
35548
+ }
35549
+ }
35550
+ return pairs.join("&");
35551
+ }
35552
+ function decode(str, strict) {
35553
+ var data = {};
35554
+ if (str === "") {
35555
+ return data;
35556
+ }
35557
+ var pairs = str.split("&");
35558
+ for (var i = 0; i < pairs.length; i++) {
35559
+ var pair = pairs[i].split("=", 2);
35560
+ var key = decodeURIComponent(pair[0]);
35561
+ if (strict && Object.prototype.hasOwnProperty.call(data, key)) {
35562
+ throw new URIError("Duplicate key: " + key);
35563
+ }
35564
+ data[key] = pair.length === 2 ? decodeURIComponent(pair[1]) : null;
35565
+ }
35566
+ return data;
35567
+ }
35568
+ function appendToUrl(url, params) {
35569
+ return (url +
35570
+ (url.indexOf("?") !== -1 ? "&" : "?") +
35571
+ (typeof params === "string" ? params : QueryString.encode(params)));
35572
+ }
35573
+ function getParameterByName(name, url) {
35574
+ if (!url) {
35575
+ url = window.location.href;
35576
+ }
35577
+ name = name.replace(/[\[\]]/g, "\\$&");
35578
+ var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
35579
+ if (!results)
35580
+ return null;
35581
+ if (!results[2])
35582
+ return "";
35583
+ return decodeURIComponent(results[2].replace(/\+/g, " "));
35584
+ }
35585
+ function getParamsAsObject(query) {
35586
+ var params = {};
35587
+ if (!query)
35588
+ return params;
35589
+ var values = query.split("&");
35590
+ values.map(function (item) {
35591
+ var data = item.split("=");
35592
+ if (!data || data.length != 2)
35593
+ return;
35594
+ params[data[0]] = decodeURIComponent(data[1].replace(/\+/g, " "));
35595
+ });
35596
+ return params;
35597
+ }
35598
+ function toQueryString(data) {
35599
+ if (!data)
35600
+ return "";
35601
+ if ((typeof data === "undefined" ? "undefined" : typeof (data)) != "object")
35602
+ return data;
35603
+ var key = Object.keys(data);
35604
+ var params = [];
35605
+ key.map(function (k) {
35606
+ var v = data[k];
35607
+ if ((typeof v === "undefined" ? "undefined" : typeof (v)) == "object")
35608
+ v = JSON.stringify(v);
35609
+ else
35610
+ v = encodeURIComponent(v);
35611
+ var item = [k, v].join("=");
35612
+ params.push(item);
35613
+ });
35614
+ return params.join("&");
35615
+ }
35616
+ const QueryString = {
35617
+ encode: encode,
35618
+ decode: decode,
35619
+ appendToUrl: appendToUrl,
35620
+ getParameterByName: getParameterByName,
35621
+ getParamsAsObject: getParamsAsObject,
35622
+ toQueryString: toQueryString,
35623
+ };
35624
+
35511
35625
  const REGEXP_SPECIAL_UNICODE = new RegExp('[\\u0300-\\u036f]', 'g');
35512
35626
  const REGEXP_ACCENT_D = new RegExp('[đ|Đ]', 'g');
35513
35627
  const REGEXP_SPACES = new RegExp('\\s', 'g');
@@ -35728,13 +35842,12 @@ const stringToData = (data) => {
35728
35842
  }
35729
35843
  };
35730
35844
  const checkIOSSupportAction = (action) => {
35731
- var _a, _b;
35732
- const key = action.slice(7, action.length).replace(/\./gi, '_').toUpperCase();
35845
+ var _a;
35733
35846
  const zaloIOSVersion = getZaloVersion();
35734
- const actionVersionLive = ((_b = (_a = ACTION[key]) === null || _a === void 0 ? void 0 : _a.version_live) === null || _b === void 0 ? void 0 : _b.iOS) || 0;
35847
+ const actionVersionLive = ((_a = action === null || action === void 0 ? void 0 : action.version_live) === null || _a === void 0 ? void 0 : _a.iOS) || 0;
35735
35848
  if (Array.isArray(window.ignoreCheckSupport) &&
35736
35849
  window.ignoreCheckSupport.length > 0 &&
35737
- window.ignoreCheckSupport.includes(action)) {
35850
+ window.ignoreCheckSupport.includes(action.name)) {
35738
35851
  return true;
35739
35852
  }
35740
35853
  return zaloIOSVersion >= actionVersionLive;
@@ -35816,7 +35929,36 @@ const checkData = (types, option) => (data) => {
35816
35929
  return {
35817
35930
  error: false
35818
35931
  };
35819
- };
35932
+ };
35933
+ const getAppInfo = (appId, versionStatus, currentVersion) => __awaiter(void 0, void 0, void 0, function* () {
35934
+ const inputData = {
35935
+ appId,
35936
+ versionStatus
35937
+ };
35938
+ if (!lodash.isUndefined(currentVersion)) {
35939
+ inputData.currentVersion = currentVersion;
35940
+ }
35941
+ const api = QueryString.appendToUrl(`${API_DOMAIN}${H5_API.GET_APP_INFO}`, inputData);
35942
+ const msgApi = yield fetch(api, {
35943
+ credentials: 'include'
35944
+ });
35945
+ if (msgApi.ok) {
35946
+ const appInfo = yield msgApi.json();
35947
+ if (appInfo.err < 0 || !appInfo.data) {
35948
+ throw new Error(appInfo);
35949
+ }
35950
+ const info = {
35951
+ name: appInfo.data.name,
35952
+ version: appInfo.data.version,
35953
+ description: appInfo.data.description,
35954
+ appUrl: appInfo.data.appUrl,
35955
+ qrCodeUrl: appInfo.data.qrCodeUrl,
35956
+ logoUrl: appInfo.data.logoUrl
35957
+ };
35958
+ return info;
35959
+ }
35960
+ throw new Error("Can't get app info");
35961
+ });
35820
35962
 
35821
35963
  var eventemitter3 = createCommonjsModule(function (module) {
35822
35964
 
@@ -36188,129 +36330,6 @@ class ZMPEEmitter extends eventemitter3 {
36188
36330
  }
36189
36331
  }
36190
36332
 
36191
- var config = (() => {
36192
- const Byte = 1;
36193
- const KB = 1024 * Byte;
36194
- const MB = 1024 * KB;
36195
- const device = checkPlatform();
36196
- return {
36197
- MINI_APP_LINK: 'https://zalo.me/app/link/zapps',
36198
- MINI_APP_INTERNAL_LINK: 'https://h5.zdn.vn/zapps',
36199
- COOKIE_NAME: {
36200
- ZOAUTH: `h5.zdn.vn_zoauth`,
36201
- ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
36202
- JS_TOKEN: `h5.zdn.vn_zlink3rd`,
36203
- ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`
36204
- },
36205
- APIS: {
36206
- GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
36207
- GET_ACCESS_TOKEN: 'https://h5.zalo.me/openapi/access_token',
36208
- GET_ACCESS_TOKEN_V3: 'https://oauth.zaloapp.com/v3/access_token'
36209
- },
36210
- STORAGE_DATA_LIMIT: 100 * KB,
36211
- STORAGE_LIMIT: 5 * MB,
36212
- NETWORK_TYPE: {
36213
- NONE: device.isAndroid ? -2 : 0,
36214
- WIFI: device.isAndroid ? 0 : 1,
36215
- '2G': device.isAndroid ? 2 : 2,
36216
- '3G': device.isAndroid ? 15 : 2,
36217
- '4G': device.isAndroid ? 13 : 2
36218
- },
36219
- MEDIA_PICKER_LIMIT: 1 * MB,
36220
- MEDIA_PICKER_UPLOAD_SERVER: 'https://zapi-server.tungnt.xyz/upload/photos'
36221
- };
36222
- })();
36223
-
36224
- function encode(bag) {
36225
- var pairs = [];
36226
- for (var key in bag) {
36227
- if (bag.hasOwnProperty(key)) {
36228
- var value = bag[key];
36229
- if (typeof value === "undefined") {
36230
- return;
36231
- }
36232
- if (value === null) {
36233
- pairs.push(key);
36234
- return;
36235
- }
36236
- pairs.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
36237
- }
36238
- }
36239
- return pairs.join("&");
36240
- }
36241
- function decode(str, strict) {
36242
- var data = {};
36243
- if (str === "") {
36244
- return data;
36245
- }
36246
- var pairs = str.split("&");
36247
- for (var i = 0; i < pairs.length; i++) {
36248
- var pair = pairs[i].split("=", 2);
36249
- var key = decodeURIComponent(pair[0]);
36250
- if (strict && Object.prototype.hasOwnProperty.call(data, key)) {
36251
- throw new URIError("Duplicate key: " + key);
36252
- }
36253
- data[key] = pair.length === 2 ? decodeURIComponent(pair[1]) : null;
36254
- }
36255
- return data;
36256
- }
36257
- function appendToUrl(url, params) {
36258
- return (url +
36259
- (url.indexOf("?") !== -1 ? "&" : "?") +
36260
- (typeof params === "string" ? params : QueryString.encode(params)));
36261
- }
36262
- function getParameterByName(name, url) {
36263
- if (!url) {
36264
- url = window.location.href;
36265
- }
36266
- name = name.replace(/[\[\]]/g, "\\$&");
36267
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
36268
- if (!results)
36269
- return null;
36270
- if (!results[2])
36271
- return "";
36272
- return decodeURIComponent(results[2].replace(/\+/g, " "));
36273
- }
36274
- function getParamsAsObject(query) {
36275
- var params = {};
36276
- if (!query)
36277
- return params;
36278
- var values = query.split("&");
36279
- values.map(function (item) {
36280
- var data = item.split("=");
36281
- if (!data || data.length != 2)
36282
- return;
36283
- params[data[0]] = decodeURIComponent(data[1].replace(/\+/g, " "));
36284
- });
36285
- return params;
36286
- }
36287
- function toQueryString(data) {
36288
- if (!data)
36289
- return "";
36290
- if ((typeof data === "undefined" ? "undefined" : typeof (data)) != "object")
36291
- return data;
36292
- var key = Object.keys(data);
36293
- var params = [];
36294
- key.map(function (k) {
36295
- var v = data[k];
36296
- if ((typeof v === "undefined" ? "undefined" : typeof (v)) == "object")
36297
- v = JSON.stringify(v);
36298
- else
36299
- v = encodeURIComponent(v);
36300
- var item = [k, v].join("=");
36301
- params.push(item);
36302
- });
36303
- return params.join("&");
36304
- }
36305
- const QueryString = {
36306
- encode: encode,
36307
- decode: decode,
36308
- appendToUrl: appendToUrl,
36309
- getParameterByName: getParameterByName,
36310
- getParamsAsObject: getParamsAsObject,
36311
- toQueryString: toQueryString,
36312
- };
36313
-
36314
36333
  var wrappers = {};
36315
36334
  var WrapperFn = function wrapFunction(fn, type, source) {
36316
36335
  var t = type || 'default';
@@ -36572,8 +36591,9 @@ class ZaloJSBridge extends eventemitter3 {
36572
36591
  }
36573
36592
  jsCall(action, options, callback, isMultiCallback = false, nRetry = 3, haveTimeout = true) {
36574
36593
  try {
36575
- const key = generateUniqueString(action);
36576
- if (!this._device.isMobile || lodash.isEmpty(action)) {
36594
+ const actionName = action.name;
36595
+ const key = generateUniqueString(actionName);
36596
+ if (!this._device.isMobile || lodash.isEmpty(actionName)) {
36577
36597
  this.onJSCall(key, {
36578
36598
  error_code: -13,
36579
36599
  error_message: 'params invalid!',
@@ -36582,7 +36602,7 @@ class ZaloJSBridge extends eventemitter3 {
36582
36602
  jsToken: this._jsAccessTk,
36583
36603
  access_token: this._accessTk
36584
36604
  },
36585
- action: action
36605
+ action: actionName
36586
36606
  });
36587
36607
  return false;
36588
36608
  }
@@ -36596,11 +36616,11 @@ class ZaloJSBridge extends eventemitter3 {
36596
36616
  error_code: -14,
36597
36617
  error_message: 'Request Timeout!',
36598
36618
  data: {},
36599
- action: action
36619
+ action: actionName
36600
36620
  };
36601
36621
  this._jsCallFuncCallbacks[key] = {
36602
36622
  timeout: haveTimeout &&
36603
- ACTION_HAVE_CALLBACK.includes(action) &&
36623
+ action.have_callback &&
36604
36624
  setTimeout(() => {
36605
36625
  this.onJSCall(key, timeoutCallback);
36606
36626
  }, 8000),
@@ -36610,14 +36630,14 @@ class ZaloJSBridge extends eventemitter3 {
36610
36630
  options = serialize(options);
36611
36631
  if (isMultiCallback) {
36612
36632
  if (this._device.isIOS) {
36613
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, window.onMultiJSCall(key));
36633
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, window.onMultiJSCall(key));
36614
36634
  }
36615
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, `window.onMultiJSCall('${key}')`);
36635
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, `window.onMultiJSCall('${key}')`);
36616
36636
  }
36617
36637
  if (this._device.isIOS) {
36618
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, window.onJSCall(key));
36638
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, window.onJSCall(key));
36619
36639
  }
36620
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, `window.onJSCall('${key}')`);
36640
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, `window.onJSCall('${key}')`);
36621
36641
  }
36622
36642
  catch (error) {
36623
36643
  if (nRetry-- > 0) {
@@ -36635,7 +36655,7 @@ class ZaloJSBridge extends eventemitter3 {
36635
36655
  jsToken: this._jsAccessTk,
36636
36656
  access_token: this._accessTk
36637
36657
  },
36638
- action: action,
36658
+ action: actionName,
36639
36659
  js_error: error
36640
36660
  };
36641
36661
  this.onJSCall(key, errorCallback);
@@ -36666,7 +36686,7 @@ class ZJSBridgeProvider {
36666
36686
  __classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsAccessTk = value;
36667
36687
  }
36668
36688
  callNative(action, data, option) {
36669
- this.debug(action, data);
36689
+ this.debug(action.name, data);
36670
36690
  return new Promise((resolve, reject) => {
36671
36691
  const fn = (cb) => __awaiter(this, void 0, void 0, function* () {
36672
36692
  try {
@@ -36682,7 +36702,7 @@ class ZJSBridgeProvider {
36682
36702
  else if (cb && cb.error_code < 0) {
36683
36703
  try {
36684
36704
  window.zmpSentry &&
36685
- window.zmpSentry.captureMessage(`${action}: call native fail`, {
36705
+ window.zmpSentry.captureMessage(`${action.name}: call native fail`, {
36686
36706
  extra: {
36687
36707
  data: data,
36688
36708
  rs: cb
@@ -36717,7 +36737,7 @@ class ZJSBridgeProvider {
36717
36737
  }
36718
36738
  _ZJSBridgeProvider_bridge = new WeakMap();
36719
36739
 
36720
- var version = "2.16.3";
36740
+ var version = "2.16.6";
36721
36741
 
36722
36742
  class Basics {
36723
36743
  /**
@@ -36759,31 +36779,9 @@ class Basics {
36759
36779
  */
36760
36780
  static getAppInfo() {
36761
36781
  return __awaiter(this, void 0, void 0, function* () {
36762
- let info = {};
36763
36782
  const appId = this.getAppId();
36764
36783
  const systemInfo = this.getSystemInfo();
36765
- const api = QueryString.appendToUrl(`${API_DOMAIN}${H5_API.GET_APP_INFO}`, {
36766
- appId,
36767
- versionStatus: 0,
36768
- currentVersion: systemInfo.version
36769
- });
36770
- const msgApi = yield fetch(api, {
36771
- credentials: 'include'
36772
- });
36773
- if (msgApi.ok) {
36774
- const appInfo = yield msgApi.json();
36775
- if (appInfo.err < 0 || !appInfo.data) {
36776
- throw new Error(appInfo);
36777
- }
36778
- info = {
36779
- name: appInfo.data.name,
36780
- version: appInfo.data.version,
36781
- description: appInfo.data.description,
36782
- appUrl: appInfo.data.appUrl,
36783
- qrCodeUrl: appInfo.data.qrCodeUrl
36784
- };
36785
- }
36786
- return info;
36784
+ return yield getAppInfo(appId, 0, systemInfo.version);
36787
36785
  });
36788
36786
  }
36789
36787
  }
@@ -36822,7 +36820,7 @@ class NavigationBar {
36822
36820
  */
36823
36821
  static setNavigationBarTitle(object) {
36824
36822
  return __awaiter(this, void 0, void 0, function* () {
36825
- yield this.callNative(ACTION.CHANGE_TITLE_HEADER.name, {
36823
+ yield this.callNative(ACTION.CHANGE_TITLE_HEADER, {
36826
36824
  title: object.title
36827
36825
  }, {
36828
36826
  haveTimeout: false
@@ -36870,7 +36868,7 @@ class NavigationBar {
36870
36868
  actionBarType = HIDE_ACTION_BAR;
36871
36869
  }
36872
36870
  this.setActionBarConfig((state) => (Object.assign(Object.assign({}, state), { actionbarType: actionBarType, dataConfig: Object.assign(Object.assign({}, state.dataConfig), dataConfig) })));
36873
- yield this.callNative(ACTION.CHANGE_ACTIONBAR.name, Object.assign({}, this.getActionBarConfig()), {
36871
+ yield this.callNative(ACTION.CHANGE_ACTIONBAR, Object.assign({}, this.getActionBarConfig()), {
36874
36872
  haveTimeout: false
36875
36873
  });
36876
36874
  });
@@ -36914,7 +36912,7 @@ class NavigationBar {
36914
36912
  ? ACTION_LEFT_BUTTON_TYPE.SHOW_HOME
36915
36913
  : ACTION_LEFT_BUTTON_TYPE.HIDE_HOME;
36916
36914
  this.setActionBarConfig((state) => (Object.assign(Object.assign({}, state), { buttonType: leftButtonType, dataConfig: Object.assign(Object.assign({}, state.dataConfig), { viewInLeftType: leftButtonType }), homeConfig: Object.assign(Object.assign({}, state.homeConfig), { enable: showHomeButton }) })));
36917
- yield this.callNative(ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name, Object.assign({}, this.getActionBarConfig()), {
36915
+ yield this.callNative(ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE, Object.assign({}, this.getActionBarConfig()), {
36918
36916
  haveTimeout: false
36919
36917
  });
36920
36918
  });
@@ -36956,7 +36954,7 @@ class NavigationBar {
36956
36954
  */
36957
36955
  static setNavigationBarRightButton(object) {
36958
36956
  return __awaiter(this, void 0, void 0, function* () {
36959
- yield this.callNative(ACTION.CREATE_OPTIONS_MENU.name, {
36957
+ yield this.callNative(ACTION.CREATE_OPTIONS_MENU, {
36960
36958
  supportToolBar: object.supportToolBar,
36961
36959
  reset: object.reset,
36962
36960
  menuListItems: object.menuListItems,
@@ -36992,7 +36990,7 @@ class Background {
36992
36990
  return __awaiter(this, void 0, void 0, function* () {
36993
36991
  if (lodash.isString(object.backgroundColor) &&
36994
36992
  object.backgroundColor.length > 0) {
36995
- yield this.callNative(ACTION.CHANGE_ACTIONBAR.name, {
36993
+ yield this.callNative(ACTION.CHANGE_ACTIONBAR, {
36996
36994
  actionbarType: this.isShowNavBar ? 5 : 6,
36997
36995
  dataConfig: {
36998
36996
  backgroundColor: object.backgroundColor,
@@ -37104,7 +37102,7 @@ class Device {
37104
37102
  */
37105
37103
  static setDeviceOrientation(object) {
37106
37104
  return __awaiter(this, void 0, void 0, function* () {
37107
- yield this.callNative(ACTION.CHANGE_AUTOROTATE.name, {
37105
+ yield this.callNative(ACTION.CHANGE_AUTOROTATE, {
37108
37106
  autoRotate: OrientationType[object.rotate]
37109
37107
  });
37110
37108
  });
@@ -37128,26 +37126,27 @@ class Device {
37128
37126
  */
37129
37127
  static getNetworkType(object) {
37130
37128
  return __awaiter(this, void 0, void 0, function* () {
37131
- const resData = yield this.callNative(ACTION.WEBVIEW_NETWORKTYPE.name, {
37129
+ const resData = yield this.callNative(ACTION.WEBVIEW_NETWORKTYPE, {
37132
37130
  url: window.location.href,
37133
37131
  featureId: ''
37134
37132
  }).then((data) => {
37135
37133
  const network = data.network;
37136
37134
  let networkType;
37135
+ const isAndroid = checkPlatform().isAndroid;
37137
37136
  switch (network) {
37138
- case config.NETWORK_TYPE.NONE:
37137
+ case NETWORK_TYPE(isAndroid).NONE:
37139
37138
  networkType = NetworkType.none;
37140
37139
  break;
37141
- case config.NETWORK_TYPE.WIFI:
37140
+ case NETWORK_TYPE(isAndroid).WIFI:
37142
37141
  networkType = NetworkType.wifi;
37143
37142
  break;
37144
- case config.NETWORK_TYPE['2G']:
37143
+ case NETWORK_TYPE(isAndroid)['2G']:
37145
37144
  networkType = NetworkType.cellular;
37146
37145
  break;
37147
- case config.NETWORK_TYPE['3G']:
37146
+ case NETWORK_TYPE(isAndroid)['3G']:
37148
37147
  networkType = NetworkType.cellular;
37149
37148
  break;
37150
- case config.NETWORK_TYPE['4G']:
37149
+ case NETWORK_TYPE(isAndroid)['4G']:
37151
37150
  networkType = NetworkType.cellular;
37152
37151
  break;
37153
37152
  default:
@@ -37241,7 +37240,7 @@ class Device {
37241
37240
  items: Array.isArray(object === null || object === void 0 ? void 0 : object.items) ? object === null || object === void 0 ? void 0 : object.items : []
37242
37241
  }
37243
37242
  };
37244
- yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data));
37243
+ yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data));
37245
37244
  return true;
37246
37245
  });
37247
37246
  }
@@ -37260,7 +37259,7 @@ class Device {
37260
37259
  const data = {
37261
37260
  subaction: 2
37262
37261
  };
37263
- yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data));
37262
+ yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data));
37264
37263
  return true;
37265
37264
  });
37266
37265
  }
@@ -37281,7 +37280,7 @@ class Device {
37281
37280
  const data = {
37282
37281
  subaction: 1
37283
37282
  };
37284
- const resData = yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data), {
37283
+ const resData = yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data), {
37285
37284
  isMultiCallback: true
37286
37285
  }).then((resData) => {
37287
37286
  const res = {
@@ -37323,7 +37322,9 @@ class Device {
37323
37322
  */
37324
37323
  static stopBluetoothDevicesDiscovery() {
37325
37324
  return __awaiter(this, void 0, void 0, function* () {
37326
- return this.callNative('', {});
37325
+ return this.callNative({
37326
+ name: ''
37327
+ }, {});
37327
37328
  });
37328
37329
  }
37329
37330
  /**
@@ -37348,7 +37349,9 @@ class Device {
37348
37349
  */
37349
37350
  static startBluetoothDevicesDiscovery(object) {
37350
37351
  return __awaiter(this, void 0, void 0, function* () {
37351
- return this.callNative('', Object.assign({}, object));
37352
+ return this.callNative({
37353
+ name: ''
37354
+ }, Object.assign({}, object));
37352
37355
  });
37353
37356
  }
37354
37357
  /**
@@ -37370,7 +37373,9 @@ class Device {
37370
37373
  */
37371
37374
  static openBluetoothAdapter() {
37372
37375
  return __awaiter(this, void 0, void 0, function* () {
37373
- return this.callNative('', {});
37376
+ return this.callNative({
37377
+ name: ''
37378
+ }, {});
37374
37379
  });
37375
37380
  }
37376
37381
  /**
@@ -37388,7 +37393,9 @@ class Device {
37388
37393
  */
37389
37394
  static onBluetoothDeviceFound() {
37390
37395
  return __awaiter(this, void 0, void 0, function* () {
37391
- return this.callNative('', {});
37396
+ return this.callNative({
37397
+ name: ''
37398
+ }, {});
37392
37399
  });
37393
37400
  }
37394
37401
  /**
@@ -37434,7 +37441,9 @@ class Device {
37434
37441
  const data = {
37435
37442
  services: object.services || []
37436
37443
  };
37437
- return this.callNative('', data);
37444
+ return this.callNative({
37445
+ name: ''
37446
+ }, data);
37438
37447
  });
37439
37448
  }
37440
37449
  /**
@@ -37453,7 +37462,9 @@ class Device {
37453
37462
  */
37454
37463
  static getBluetoothDevices() {
37455
37464
  return __awaiter(this, void 0, void 0, function* () {
37456
- return this.callNative('', {});
37465
+ return this.callNative({
37466
+ name: ''
37467
+ }, {});
37457
37468
  });
37458
37469
  }
37459
37470
  /**
@@ -37472,7 +37483,9 @@ class Device {
37472
37483
  */
37473
37484
  static getBluetoothAdapterState() {
37474
37485
  return __awaiter(this, void 0, void 0, function* () {
37475
- return this.callNative('', {});
37486
+ return this.callNative({
37487
+ name: ''
37488
+ }, {});
37476
37489
  });
37477
37490
  }
37478
37491
  /**
@@ -37491,7 +37504,9 @@ class Device {
37491
37504
  */
37492
37505
  static closeBluetoothAdapter() {
37493
37506
  return __awaiter(this, void 0, void 0, function* () {
37494
- return this.callNative('', {});
37507
+ return this.callNative({
37508
+ name: ''
37509
+ }, {});
37495
37510
  });
37496
37511
  }
37497
37512
  /**
@@ -37503,7 +37518,7 @@ class Device {
37503
37518
  */
37504
37519
  static scanQRCode(object) {
37505
37520
  return __awaiter(this, void 0, void 0, function* () {
37506
- return yield this.callNative(ACTION.OPEN_QR.name, {
37521
+ return yield this.callNative(ACTION.OPEN_QR, {
37507
37522
  skipOpenLink: true
37508
37523
  });
37509
37524
  });
@@ -37517,7 +37532,7 @@ class Device {
37517
37532
  */
37518
37533
  static showToast(object) {
37519
37534
  return __awaiter(this, void 0, void 0, function* () {
37520
- yield this.callNative(ACTION.SHOW_TOAST.name, {
37535
+ yield this.callNative(ACTION.SHOW_TOAST, {
37521
37536
  toast: object.message
37522
37537
  });
37523
37538
  });
@@ -37531,7 +37546,7 @@ class Device {
37531
37546
  */
37532
37547
  static hideKeyboard(object) {
37533
37548
  return __awaiter(this, void 0, void 0, function* () {
37534
- yield this.callNative(ACTION.HIDE_KEYBOARD.name, {});
37549
+ yield this.callNative(ACTION.HIDE_KEYBOARD, {});
37535
37550
  });
37536
37551
  }
37537
37552
  /**
@@ -37543,7 +37558,7 @@ class Device {
37543
37558
  */
37544
37559
  static openPhone(object) {
37545
37560
  return __awaiter(this, void 0, void 0, function* () {
37546
- yield this.callNative(ACTION.OPEN_PHONE.name, {
37561
+ yield this.callNative(ACTION.OPEN_PHONE, {
37547
37562
  phoneNum: object.phoneNumber,
37548
37563
  phoneCode: object.phoneNumber
37549
37564
  });
@@ -37558,7 +37573,7 @@ class Device {
37558
37573
  */
37559
37574
  static openSMS(object) {
37560
37575
  return __awaiter(this, void 0, void 0, function* () {
37561
- yield this.callNative(ACTION.OPEN_SMS.name, {
37576
+ yield this.callNative(ACTION.OPEN_SMS, {
37562
37577
  content: object.content,
37563
37578
  phoneCode: object.phoneNumber
37564
37579
  });
@@ -37573,7 +37588,7 @@ class Device {
37573
37588
  */
37574
37589
  static keepScreen(object) {
37575
37590
  return __awaiter(this, void 0, void 0, function* () {
37576
- return yield this.callNative(ACTION.KEEP_SCREEN.name, {
37591
+ return yield this.callNative(ACTION.KEEP_SCREEN, {
37577
37592
  data: {
37578
37593
  keep_screen_on: object.keepScreenOn ? 1 : 0
37579
37594
  }
@@ -37589,7 +37604,7 @@ class Device {
37589
37604
  */
37590
37605
  static openBioAuthentication(object) {
37591
37606
  return __awaiter(this, void 0, void 0, function* () {
37592
- return yield this.callNative(ACTION.PROMPT_AUTHENTICATION.name, {
37607
+ return yield this.callNative(ACTION.PROMPT_AUTHENTICATION, {
37593
37608
  secret_data: object.secretData,
37594
37609
  app_id: this.getZAppId(),
37595
37610
  ui: {
@@ -37628,7 +37643,7 @@ class Device {
37628
37643
  */
37629
37644
  static checkStateBioAuthentication(object) {
37630
37645
  return __awaiter(this, void 0, void 0, function* () {
37631
- return yield this.callNative(ACTION.PROMPT_AUTHENTICATION_CHECK_STATE.name, {}).then((data) => {
37646
+ return yield this.callNative(ACTION.PROMPT_AUTHENTICATION_CHECK_STATE, {}).then((data) => {
37632
37647
  return {
37633
37648
  bioState: data === null || data === void 0 ? void 0 : data.bio_state
37634
37649
  };
@@ -37644,7 +37659,7 @@ class Device {
37644
37659
  */
37645
37660
  static vibrate(object) {
37646
37661
  return __awaiter(this, void 0, void 0, function* () {
37647
- return yield this.callNative(ACTION.INTERACTIVE_VIBRATION.name, {
37662
+ return yield this.callNative(ACTION.INTERACTIVE_VIBRATION, {
37648
37663
  type: VibrateType[object.type],
37649
37664
  vibrate_time: object.milliseconds
37650
37665
  });
@@ -37663,7 +37678,7 @@ class Device {
37663
37678
  if (lodash.isString(object.password) && object.password.length > 0) {
37664
37679
  securityType = 'wpa_wpa2';
37665
37680
  }
37666
- return yield this.callNative(ACTION.MP_JOIN_WIFI.name, {
37681
+ return yield this.callNative(ACTION.MP_JOIN_WIFI, {
37667
37682
  ssid: object.SSID,
37668
37683
  securityType: securityType,
37669
37684
  password: object.password,
@@ -37691,7 +37706,7 @@ class LocalResourceStorage {
37691
37706
  __classPrivateFieldSet(this, _LocalResourceStorage_resourceInfo, {
37692
37707
  keys: new Set(),
37693
37708
  currentSize: 0,
37694
- limitSize: config.STORAGE_LIMIT
37709
+ limitSize: STORAGE_LIMIT
37695
37710
  });
37696
37711
  __classPrivateFieldSet(this, _LocalResourceStorage_prefix, prefix);
37697
37712
  this.findAllCurrentDataByApp(prefix);
@@ -37754,7 +37769,7 @@ class LocalResourceStorage {
37754
37769
  currentSize: lodash.isNumber(currentSize)
37755
37770
  ? Number((currentSize / 1024).toFixed(2))
37756
37771
  : 0,
37757
- limitSize: Number((config.STORAGE_LIMIT / 1024).toFixed(2))
37772
+ limitSize: Number((STORAGE_LIMIT / 1024).toFixed(2))
37758
37773
  };
37759
37774
  }
37760
37775
  remove(keys) {
@@ -37800,13 +37815,13 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37800
37815
  __classPrivateFieldSet(this, _NativeResourceStorage_resourceInfo, {
37801
37816
  keys: new Set(),
37802
37817
  currentSize: 0,
37803
- limitSize: config.STORAGE_LIMIT
37818
+ limitSize: STORAGE_LIMIT
37804
37819
  });
37805
37820
  __classPrivateFieldSet(this, _NativeResourceStorage_appId, appId);
37806
37821
  }
37807
37822
  get(keys) {
37808
37823
  return __awaiter(this, void 0, void 0, function* () {
37809
- return yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37824
+ return yield this.callNative(ACTION.ZBROWSER_MPDS, {
37810
37825
  mpds_action: 'mpds.get',
37811
37826
  mpds_data: {
37812
37827
  keys
@@ -37825,7 +37840,7 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37825
37840
  }
37826
37841
  set(data) {
37827
37842
  return __awaiter(this, void 0, void 0, function* () {
37828
- const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37843
+ const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS, {
37829
37844
  mpds_action: 'mpds.set',
37830
37845
  mpds_data: {
37831
37846
  map: data
@@ -37845,7 +37860,7 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37845
37860
  }
37846
37861
  getInfo() {
37847
37862
  return __awaiter(this, void 0, void 0, function* () {
37848
- const currentSize = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37863
+ const currentSize = yield this.callNative(ACTION.ZBROWSER_MPDS, {
37849
37864
  mpds_action: 'mpds.get.size',
37850
37865
  mpds_data: {},
37851
37866
  appId: __classPrivateFieldGet(this, _NativeResourceStorage_appId)
@@ -37860,13 +37875,13 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37860
37875
  });
37861
37876
  return {
37862
37877
  currentSize: lodash.isNumber(currentSize) ? Number(currentSize / 1024) : 0,
37863
- limitSize: Number(config.STORAGE_LIMIT / 1024)
37878
+ limitSize: Number(STORAGE_LIMIT / 1024)
37864
37879
  };
37865
37880
  });
37866
37881
  }
37867
37882
  remove(keys) {
37868
37883
  return __awaiter(this, void 0, void 0, function* () {
37869
- const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37884
+ const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS, {
37870
37885
  mpds_action: 'mpds.remove.key',
37871
37886
  mpds_data: {
37872
37887
  keys: keys
@@ -37886,7 +37901,7 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37886
37901
  }
37887
37902
  clear() {
37888
37903
  return __awaiter(this, void 0, void 0, function* () {
37889
- yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37904
+ yield this.callNative(ACTION.ZBROWSER_MPDS, {
37890
37905
  mpds_action: 'mpds.clear.appData',
37891
37906
  mpds_data: {},
37892
37907
  appId: __classPrivateFieldGet(this, _NativeResourceStorage_appId)
@@ -38116,7 +38131,7 @@ class OpenApi {
38116
38131
  fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
38117
38132
  }
38118
38133
  const userInfo = yield axios
38119
- .get(config.APIS.GET_USER_INFO, {
38134
+ .get(APIS.GET_USER_INFO, {
38120
38135
  params: {
38121
38136
  fields: fields,
38122
38137
  access_token: accessToken
@@ -38149,7 +38164,7 @@ class OpenApi {
38149
38164
  */
38150
38165
  static getPhoneNumber(object) {
38151
38166
  return __awaiter(this, void 0, void 0, function* () {
38152
- return yield this.callNative(ACTION.MP_GET_NUMBER.name, {}, {
38167
+ return yield this.callNative(ACTION.MP_GET_NUMBER, {}, {
38153
38168
  isMultiCallback: true,
38154
38169
  callback: (nativeData, error) => {
38155
38170
  if (nativeData.error_code === 0) {
@@ -38162,7 +38177,7 @@ class OpenApi {
38162
38177
  return Promise.reject(error);
38163
38178
  }
38164
38179
  },
38165
- delay: this.isIOS ? 200 : 0
38180
+ delay: this.isIOS ? 400 : 0
38166
38181
  });
38167
38182
  });
38168
38183
  }
@@ -38179,7 +38194,7 @@ class Window {
38179
38194
  */
38180
38195
  static closeApp(object) {
38181
38196
  return __awaiter(this, void 0, void 0, function* () {
38182
- yield this.callNative(ACTION.WINDOW_CLOSE.name, {});
38197
+ yield this.callNative(ACTION.WINDOW_CLOSE, {});
38183
38198
  });
38184
38199
  }
38185
38200
  /**
@@ -38199,10 +38214,12 @@ class Window {
38199
38214
  return [key, value].join('=');
38200
38215
  })
38201
38216
  .join('&');
38202
- yield this.callNative(ACTION.OPEN_MP.name, {
38203
- mpUrl: `${config.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38217
+ const appInfo = yield getAppInfo(appId, 0);
38218
+ yield this.callNative(ACTION.OPEN_MP, {
38219
+ mpUrl: `${MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38204
38220
  mpInfo: {
38205
- appId: appId
38221
+ appId: appId,
38222
+ appAvtUrl: appInfo.logoUrl || ''
38206
38223
  }
38207
38224
  });
38208
38225
  });
@@ -38217,7 +38234,7 @@ class Window {
38217
38234
  */
38218
38235
  static openWebview(object) {
38219
38236
  return __awaiter(this, void 0, void 0, function* () {
38220
- yield this.callNative(ACTION.OPEN_INAPP.name, {
38237
+ yield this.callNative(ACTION.OPEN_INAPP, {
38221
38238
  url: object.url
38222
38239
  });
38223
38240
  });
@@ -38242,7 +38259,7 @@ class Location {
38242
38259
  */
38243
38260
  static getLocation(object) {
38244
38261
  return __awaiter(this, void 0, void 0, function* () {
38245
- return yield this.callNative(ACTION.GET_LOCATION.name, {
38262
+ return yield this.callNative(ACTION.GET_LOCATION, {
38246
38263
  silent_request: false,
38247
38264
  permission_description: 'Cho phép Zalo truy cập vào vị trí của thiết bị này?'
38248
38265
  }, {
@@ -38267,7 +38284,7 @@ class Location {
38267
38284
  return Promise.reject(error);
38268
38285
  }
38269
38286
  },
38270
- delay: this.isIOS ? 200 : 0
38287
+ delay: this.isIOS ? 400 : 0
38271
38288
  });
38272
38289
  });
38273
38290
  }
@@ -38281,7 +38298,7 @@ class Location {
38281
38298
  */
38282
38299
  static sendLocation(object) {
38283
38300
  return __awaiter(this, void 0, void 0, function* () {
38284
- yield this.callNative(ACTION.QUERY_LOCATION_HIDE.name, {
38301
+ yield this.callNative(ACTION.QUERY_LOCATION_HIDE, {
38285
38302
  title: object.title,
38286
38303
  touserid: object.toUserId,
38287
38304
  zapp: this.getZAppId()
@@ -38301,7 +38318,7 @@ class Media {
38301
38318
  */
38302
38319
  static requestCameraPermission(object) {
38303
38320
  return __awaiter(this, void 0, void 0, function* () {
38304
- return yield this.callNative(ACTION.REQUEST_PERMISSION_CAMERA.name, {}, {
38321
+ return yield this.callNative(ACTION.REQUEST_PERMISSION_CAMERA, {}, {
38305
38322
  callback: (nativeData, error) => {
38306
38323
  if (nativeData.error_code === -2 || nativeData.error_code >= 0) {
38307
38324
  return Promise.resolve({
@@ -38337,7 +38354,7 @@ class Media {
38337
38354
  imageUrl: object.imageUrl
38338
38355
  };
38339
38356
  }
38340
- return yield this.callNative(ACTION.SAVE_IMAGE_GALLERY.name, Object.assign({}, data));
38357
+ return yield this.callNative(ACTION.SAVE_IMAGE_GALLERY, Object.assign({}, data));
38341
38358
  });
38342
38359
  }
38343
38360
  }
@@ -38352,7 +38369,7 @@ class Zalo {
38352
38369
  */
38353
38370
  static viewOAQr(object) {
38354
38371
  return __awaiter(this, void 0, void 0, function* () {
38355
- yield this.callNative(ACTION.VIEW_MYQR.name, {
38372
+ yield this.callNative(ACTION.VIEW_MYQR, {
38356
38373
  dpn: object.displayName,
38357
38374
  uid: object.id,
38358
38375
  zapp: this.getZAppId()
@@ -38371,7 +38388,7 @@ class Zalo {
38371
38388
  */
38372
38389
  static openProfile(object) {
38373
38390
  return __awaiter(this, void 0, void 0, function* () {
38374
- return yield this.callNative(ACTION.OPEN_PROFILE.name, {
38391
+ return yield this.callNative(ACTION.OPEN_PROFILE, {
38375
38392
  uId: object.id,
38376
38393
  type: ProfileType[object.type],
38377
38394
  zapp: this.getZAppId(),
@@ -38389,7 +38406,7 @@ class Zalo {
38389
38406
  */
38390
38407
  static openChat(object) {
38391
38408
  return __awaiter(this, void 0, void 0, function* () {
38392
- return yield this.callNative(ACTION.OPEN_CHAT.name, {
38409
+ return yield this.callNative(ACTION.OPEN_CHAT, {
38393
38410
  uId: object.id,
38394
38411
  type: ChatType[object.type],
38395
38412
  zapp: this.getZAppId(),
@@ -38430,7 +38447,7 @@ class Zalo {
38430
38447
  };
38431
38448
  break;
38432
38449
  }
38433
- return yield this.callNative(ACTION.OPEN_POSTFEED.name, Object.assign(Object.assign({ type: PostFeedType[object.type] }, reqData), { zapp: this.getZAppId() })).then((res) => {
38450
+ return yield this.callNative(ACTION.OPEN_POSTFEED, Object.assign(Object.assign({ type: PostFeedType[object.type] }, reqData), { zapp: this.getZAppId() })).then((res) => {
38434
38451
  return {
38435
38452
  status: res.status,
38436
38453
  shareType: res.share_type,
@@ -38449,7 +38466,7 @@ class Zalo {
38449
38466
  */
38450
38467
  static followOA(object) {
38451
38468
  return __awaiter(this, void 0, void 0, function* () {
38452
- yield this.callNative(ACTION.FOLLOW_OA.name, {
38469
+ yield this.callNative(ACTION.FOLLOW_OA, {
38453
38470
  uid: object.id,
38454
38471
  showDialogConfirm: true,
38455
38472
  zapp: this.getZAppId()
@@ -38468,7 +38485,7 @@ class Zalo {
38468
38485
  */
38469
38486
  static unfollowOA(object) {
38470
38487
  return __awaiter(this, void 0, void 0, function* () {
38471
- yield this.callNative(ACTION.UNFOLLOW_OA.name, {
38488
+ yield this.callNative(ACTION.UNFOLLOW_OA, {
38472
38489
  uid: object.id,
38473
38490
  zapp: this.getZAppId()
38474
38491
  }, {
@@ -38548,7 +38565,7 @@ class Zalo {
38548
38565
  object.type = 'link';
38549
38566
  }
38550
38567
  }
38551
- return yield this.callNative(ACTION.OPEN_SHARESHEET.name, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
38568
+ return yield this.callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
38552
38569
  haveTimeout: false
38553
38570
  }).then((res) => {
38554
38571
  return {
@@ -38569,7 +38586,7 @@ class Zalo {
38569
38586
  */
38570
38587
  static createShortcut(url, title, icon) {
38571
38588
  return __awaiter(this, void 0, void 0, function* () {
38572
- return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38589
+ return yield this.callNative(ACTION.CREATE_SHORTCUT, {
38573
38590
  url: url,
38574
38591
  title: title,
38575
38592
  iconUrl: icon
@@ -38586,7 +38603,7 @@ class Zalo {
38586
38603
  */
38587
38604
  static openProfilePicker(object) {
38588
38605
  return __awaiter(this, void 0, void 0, function* () {
38589
- return yield this.callNative(ACTION.MP_OPEN_PROFILE_PICKER.name, {
38606
+ return yield this.callNative(ACTION.MP_OPEN_PROFILE_PICKER, {
38590
38607
  maxProfile: object === null || object === void 0 ? void 0 : object.maxProfile
38591
38608
  }, {
38592
38609
  isMultiCallback: true,
@@ -38612,7 +38629,7 @@ class Zalo {
38612
38629
  */
38613
38630
  static getActionsSupported(object) {
38614
38631
  return __awaiter(this, void 0, void 0, function* () {
38615
- return yield this.callNative(ACTION.GET_SUPPORTED_ACTIONS.name, {}, {
38632
+ return yield this.callNative(ACTION.GET_SUPPORTED_ACTIONS, {}, {
38616
38633
  isMultiCallback: false,
38617
38634
  callback: (nativeData, error) => {
38618
38635
  const platform = getPlatform();
@@ -38647,14 +38664,14 @@ class Zalo {
38647
38664
  return __awaiter(this, void 0, void 0, function* () {
38648
38665
  const uploadSetting = {
38649
38666
  type: 0,
38650
- url: config.MEDIA_PICKER_UPLOAD_SERVER,
38651
- maxSize: config.MEDIA_PICKER_LIMIT
38667
+ url: MEDIA_PICKER_UPLOAD_SERVER,
38668
+ maxSize: MEDIA_PICKER_LIMIT
38652
38669
  };
38653
38670
  const defaultEditView = {
38654
38671
  enable: 1,
38655
38672
  aspect_ratio: '1:1'
38656
38673
  };
38657
- return yield this.callNative(ACTION.PICK_MEDIA.name, {
38674
+ return yield this.callNative(ACTION.PICK_MEDIA, {
38658
38675
  media_type: MediaPickerType[type],
38659
38676
  edit_view: Object.assign(Object.assign({}, defaultEditView), editView),
38660
38677
  silent_request: silentRequest,
@@ -38686,7 +38703,7 @@ class Zalo {
38686
38703
  */
38687
38704
  static openOutApp(url) {
38688
38705
  return __awaiter(this, void 0, void 0, function* () {
38689
- return yield this.callNative(ACTION.OPEN_OUTAPP.name, {
38706
+ return yield this.callNative(ACTION.OPEN_OUTAPP, {
38690
38707
  url: url
38691
38708
  });
38692
38709
  });
@@ -38725,7 +38742,7 @@ class Routing {
38725
38742
  */
38726
38743
  static sendDataToPreviousMiniApp(object) {
38727
38744
  return __awaiter(this, void 0, void 0, function* () {
38728
- return yield this.callNative(ACTION.WEBVIEW_SET_RESULT.name, {
38745
+ return yield this.callNative(ACTION.WEBVIEW_SET_RESULT, {
38729
38746
  result: stringifyData(object.data)
38730
38747
  });
38731
38748
  });
@@ -38750,51 +38767,51 @@ class Routing {
38750
38767
  }
38751
38768
  }
38752
38769
 
38753
- var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_zOAuthVrf, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_refreshToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_prevGetTokenTimestamp, _ZaloMiniProgramSDK_tokenExpiresIn, _ZaloMiniProgramSDK_cookies, _ZaloMiniProgramSDK_actionBarConfig, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton, _ZaloMiniProgramSDK_getActionsSupported;
38754
- class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38770
+ var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_cookies, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_callJump, _ZaloMiniProgramSDKService_setNavigationBarRightButton, _ZaloMiniProgramSDKService_getActionsSupported;
38771
+ class ZaloMiniProgramSDKService extends ZJSBridgeProvider {
38755
38772
  constructor() {
38756
- var _a, _b, _c, _d, _e, _f, _g, _h;
38773
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
38757
38774
  super();
38758
- _ZaloMiniProgramSDK_zAppId.set(this, ZAPP_ID);
38759
- _ZaloMiniProgramSDK_appId.set(this, APP_ID);
38760
- _ZaloMiniProgramSDK_appConfig.set(this, APP_CONFIG);
38761
- _ZaloMiniProgramSDK_zOAuth.set(this, void 0);
38762
- _ZaloMiniProgramSDK_zOAuthVrf.set(this, void 0);
38763
- _ZaloMiniProgramSDK_accessToken.set(this, void 0);
38764
- _ZaloMiniProgramSDK_refreshToken.set(this, null);
38765
- _ZaloMiniProgramSDK_cache.set(this, {
38775
+ _ZaloMiniProgramSDKService_zAppId.set(this, ZAPP_ID);
38776
+ _ZaloMiniProgramSDKService_appId.set(this, APP_ID);
38777
+ _ZaloMiniProgramSDKService_appConfig.set(this, APP_CONFIG);
38778
+ _ZaloMiniProgramSDKService_zOAuth.set(this, void 0);
38779
+ _ZaloMiniProgramSDKService_zOAuthVrf.set(this, void 0);
38780
+ _ZaloMiniProgramSDKService_accessToken.set(this, void 0);
38781
+ _ZaloMiniProgramSDKService_refreshToken.set(this, null);
38782
+ _ZaloMiniProgramSDKService_cache.set(this, {
38766
38783
  timer: {
38767
38784
  getToken: 0
38768
38785
  }
38769
38786
  });
38770
- _ZaloMiniProgramSDK_prevGetTokenTimestamp.set(this, void 0);
38771
- _ZaloMiniProgramSDK_tokenExpiresIn.set(this, void 0);
38772
- _ZaloMiniProgramSDK_cookies.set(this, null);
38787
+ _ZaloMiniProgramSDKService_prevGetTokenTimestamp.set(this, void 0);
38788
+ _ZaloMiniProgramSDKService_tokenExpiresIn.set(this, void 0);
38789
+ _ZaloMiniProgramSDKService_cookies.set(this, null);
38773
38790
  this.events = ZMPEEmitter.getInstance();
38774
38791
  this.isIOS = checkPlatform().isIOS;
38775
- _ZaloMiniProgramSDK_actionBarConfig.set(this, void 0);
38792
+ _ZaloMiniProgramSDKService_actionBarConfig.set(this, void 0);
38776
38793
  this.getActionBarConfig = () => {
38777
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_actionBarConfig);
38794
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_actionBarConfig);
38778
38795
  };
38779
38796
  this.setActionBarConfig = (setState) => {
38780
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_actionBarConfig, setState(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_actionBarConfig)));
38797
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_actionBarConfig, setState(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_actionBarConfig)));
38781
38798
  };
38782
- _ZaloMiniProgramSDK_callJump.set(this, () => {
38799
+ _ZaloMiniProgramSDKService_callJump.set(this, () => {
38783
38800
  return new Promise((resolve, reject) => {
38784
- if (!lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies)) && !lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies))) {
38785
- resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies));
38801
+ if (!lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_cookies)) && !lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_cookies))) {
38802
+ resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_cookies));
38786
38803
  }
38787
38804
  else {
38788
- this.callNative('action.jump.login', {})
38805
+ this.callNative(ACTION.JUMP_LOGIN, {})
38789
38806
  .then((data) => {
38790
38807
  const cookies = (data && data.cookiesOAuthLogins) || [];
38791
- const jsToken = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.JS_TOKEN);
38808
+ const jsToken = cookies.find((cookie) => cookie.name === COOKIE_NAME.JS_TOKEN);
38792
38809
  if (jsToken) {
38793
38810
  this.setJSToken(jsToken.value);
38794
38811
  window.ZJSBridge.setJSToken &&
38795
38812
  window.ZJSBridge.setJSToken(jsToken.value);
38796
38813
  }
38797
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_cookies, cookies);
38814
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_cookies, cookies);
38798
38815
  resolve(cookies);
38799
38816
  })
38800
38817
  .catch((error) => {
@@ -38803,7 +38820,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38803
38820
  }
38804
38821
  });
38805
38822
  });
38806
- _ZaloMiniProgramSDK_setNavigationBarRightButton.set(this, NavigationBar.setNavigationBarRightButton);
38823
+ _ZaloMiniProgramSDKService_setNavigationBarRightButton.set(this, NavigationBar.setNavigationBarRightButton);
38807
38824
  this.getVersion = Basics.getVersion;
38808
38825
  this.getSystemInfo = Basics.getSystemInfo;
38809
38826
  this.setNavigationBarTitle = NavigationBar.setNavigationBarTitle;
@@ -38861,81 +38878,81 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38861
38878
  this.onCallbackData = Routing.onCallbackData;
38862
38879
  this.getPhoneNumber = OpenApi.getPhoneNumber;
38863
38880
  this.openProfilePicker = Zalo.openProfilePicker;
38864
- _ZaloMiniProgramSDK_getActionsSupported.set(this, Zalo.getActionsSupported);
38881
+ _ZaloMiniProgramSDKService_getActionsSupported.set(this, Zalo.getActionsSupported);
38865
38882
  this.connectWifi = Device.connectWifi;
38866
38883
  this.openMediaPicker = Zalo.openMediaPicker;
38867
38884
  this.openOutApp = Zalo.openOutApp;
38868
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
38869
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
38870
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
38885
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuth, null);
38886
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuthVrf, null);
38887
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, null);
38871
38888
  this.isShowNavBar = true;
38872
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, 0);
38873
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, 0);
38874
- const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
38875
- ((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
38889
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, 0);
38890
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, 0);
38891
+ const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
38892
+ ((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
38876
38893
  ? ACTION_LEFT_BUTTON_TYPE.SHOW_HOME
38877
38894
  : ACTION_LEFT_BUTTON_TYPE.HIDE_HOME;
38878
38895
  const currentUrl = new URL(location.href);
38879
- const actionBarType = lodash.isString(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.headerColor) &&
38880
- __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.headerColor.length > 0
38896
+ const actionBarType = lodash.isString((_f = (_e = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _e === void 0 ? void 0 : _e.app) === null || _f === void 0 ? void 0 : _f.headerColor) &&
38897
+ ((_j = (_h = (_g = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _g === void 0 ? void 0 : _g.app) === null || _h === void 0 ? void 0 : _h.headerColor) === null || _j === void 0 ? void 0 : _j.length) > 0
38881
38898
  ? SHOW_ACTION_BAR
38882
38899
  : HIDE_ACTION_BAR;
38883
- const leftButtonType = ((_f = (_e = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _e === void 0 ? void 0 : _e.app) === null || _f === void 0 ? void 0 : _f.leftButton) === 'none' ||
38884
- ((_h = (_g = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _g === void 0 ? void 0 : _g.app) === null || _h === void 0 ? void 0 : _h.leftButton) === 'home'
38900
+ const leftButtonType = ((_l = (_k = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _k === void 0 ? void 0 : _k.app) === null || _l === void 0 ? void 0 : _l.leftButton) === 'none' ||
38901
+ ((_o = (_m = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _m === void 0 ? void 0 : _m.app) === null || _o === void 0 ? void 0 : _o.leftButton) === 'home'
38885
38902
  ? ACTION_LEFT_BUTTON_TYPE.HIDE_BACK
38886
38903
  : ACTION_LEFT_BUTTON_TYPE.SHOW_BACK;
38887
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_actionBarConfig, {
38904
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_actionBarConfig, {
38888
38905
  actionbarType: actionBarType,
38889
38906
  buttonType: leftButtonType,
38890
38907
  dataConfig: {
38891
- backgroundColor: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.headerColor || '',
38892
- textColor: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.textColor || '',
38908
+ backgroundColor: ((_q = (_p = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _p === void 0 ? void 0 : _p.app) === null || _q === void 0 ? void 0 : _q.headerColor) || '',
38909
+ textColor: ((_s = (_r = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _r === void 0 ? void 0 : _r.app) === null || _s === void 0 ? void 0 : _s.textColor) || '',
38893
38910
  viewInLeftType: leftButtonType,
38894
38911
  confirmToExit: 1
38895
38912
  },
38896
38913
  homeConfig: {
38897
38914
  enable: showHomeButton,
38898
- url: `${config.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38915
+ url: `${MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38899
38916
  }
38900
38917
  });
38901
38918
  }
38902
38919
  static getInstance() {
38903
- if (!ZaloMiniProgramSDK.instance) {
38904
- ZaloMiniProgramSDK.instance = new ZaloMiniProgramSDK();
38920
+ if (!ZaloMiniProgramSDKService.instance) {
38921
+ ZaloMiniProgramSDKService.instance = new ZaloMiniProgramSDKService();
38905
38922
  }
38906
- return ZaloMiniProgramSDK.instance;
38923
+ return ZaloMiniProgramSDKService.instance;
38907
38924
  }
38908
38925
  getLoginStatus() {
38909
- return lodash.isString(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) && __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken).length > 0;
38926
+ return lodash.isString(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken)) && __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken).length > 0;
38910
38927
  }
38911
38928
  getAppId() {
38912
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId);
38929
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appId);
38913
38930
  }
38914
38931
  getZAppId() {
38915
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId);
38932
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zAppId);
38916
38933
  }
38917
38934
  login(object) {
38918
38935
  return __awaiter(this, void 0, void 0, function* () {
38919
- const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
38920
- const zOAuthCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH);
38921
- const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH_VRF);
38936
+ const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_callJump).call(this);
38937
+ const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
38938
+ const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
38922
38939
  if (!lodash.isUndefined(zOAuthCookie) &&
38923
38940
  !lodash.isNull(zOAuthCookie) &&
38924
38941
  lodash.isString(zOAuthCookie.value)) {
38925
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, zOAuthCookie.value);
38942
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuth, zOAuthCookie.value);
38926
38943
  if (!lodash.isUndefined(zOAuthVrfCookie) &&
38927
38944
  !lodash.isNull(zOAuthVrfCookie) &&
38928
38945
  lodash.isString(zOAuthVrfCookie.value)) {
38929
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, zOAuthVrfCookie.value);
38946
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuthVrf, zOAuthVrfCookie.value);
38930
38947
  yield this.loginZaloV4();
38931
38948
  }
38932
38949
  else {
38933
38950
  yield this.loginZaloV3();
38934
38951
  }
38935
- if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) {
38952
+ if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken)) {
38936
38953
  throw apiResponse.error.loginFailed();
38937
38954
  }
38938
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
38955
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
38939
38956
  }
38940
38957
  throw apiResponse.error.loginFailed();
38941
38958
  });
@@ -38943,25 +38960,25 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38943
38960
  loginZaloV3() {
38944
38961
  return __awaiter(this, void 0, void 0, function* () {
38945
38962
  return yield axios
38946
- .get(config.APIS.GET_ACCESS_TOKEN_V3, {
38963
+ .get(APIS.GET_ACCESS_TOKEN_V3, {
38947
38964
  params: {
38948
- app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
38949
- redirect_uri: `${config.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38950
- code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
38965
+ app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zAppId),
38966
+ redirect_uri: `${MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appId)}/`,
38967
+ code: __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zOAuth),
38951
38968
  isSDK: true
38952
38969
  }
38953
38970
  })
38954
38971
  .then((response) => {
38955
38972
  let resData = response.data;
38956
38973
  if (resData.access_token) {
38957
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, resData.access_token);
38974
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, resData.access_token);
38958
38975
  const expiresIn = parseInt(resData.expires_in) * 1000;
38959
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
38960
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
38961
- this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
38976
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, expiresIn);
38977
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, new Date().getTime());
38978
+ this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
38962
38979
  window.ZJSBridge.setZAccSession &&
38963
- window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
38964
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
38980
+ window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
38981
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
38965
38982
  }
38966
38983
  return null;
38967
38984
  });
@@ -38970,37 +38987,37 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38970
38987
  loginZaloV4() {
38971
38988
  return __awaiter(this, void 0, void 0, function* () {
38972
38989
  const inputData = new URLSearchParams();
38973
- inputData.append('app_id', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId));
38974
- inputData.append('code', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth) || '');
38975
- inputData.append('code_verifier', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf) || '');
38976
- if (lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken))) {
38990
+ inputData.append('app_id', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appId));
38991
+ inputData.append('code', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zOAuth) || '');
38992
+ inputData.append('code_verifier', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zOAuthVrf) || '');
38993
+ if (lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_refreshToken))) {
38977
38994
  inputData.append('grant_type', 'authorization_code');
38978
38995
  }
38979
38996
  else {
38980
38997
  inputData.append('grant_type', 'refresh_token');
38981
- inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
38998
+ inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_refreshToken) || '');
38982
38999
  }
38983
- const config$1 = {
39000
+ const config = {
38984
39001
  headers: {
38985
39002
  'Content-Type': 'application/x-www-form-urlencoded'
38986
39003
  }
38987
39004
  };
38988
39005
  return yield axios
38989
- .post(config.APIS.GET_ACCESS_TOKEN, inputData, config$1)
39006
+ .post(APIS.GET_ACCESS_TOKEN, inputData, config)
38990
39007
  .then((response) => {
38991
39008
  const resData = response.data;
38992
39009
  if (resData.refresh_token) {
38993
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_refreshToken, resData.refresh_token);
39010
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_refreshToken, resData.refresh_token);
38994
39011
  }
38995
39012
  if (resData.access_token) {
38996
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, resData.access_token);
39013
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, resData.access_token);
38997
39014
  const expiresIn = parseInt(resData.expires_in) * 1000;
38998
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
38999
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
39000
- this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39015
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, expiresIn);
39016
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, new Date().getTime());
39017
+ this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
39001
39018
  window.ZJSBridge.setZAccSession &&
39002
- window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39003
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
39019
+ window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
39020
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
39004
39021
  }
39005
39022
  return null;
39006
39023
  });
@@ -39008,43 +39025,43 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
39008
39025
  }
39009
39026
  getAccessToken(object) {
39010
39027
  return __awaiter(this, void 0, void 0, function* () {
39011
- const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp);
39012
- if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) {
39028
+ const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp);
39029
+ if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken)) {
39013
39030
  throw apiResponse.error.loginRequired();
39014
39031
  }
39015
- if (deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDK_tokenExpiresIn))
39016
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
39032
+ if (deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_tokenExpiresIn))
39033
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
39017
39034
  return yield this.login();
39018
39035
  });
39019
39036
  }
39020
39037
  }
39021
- _ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_refreshToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDK_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDK_cookies = new WeakMap(), _ZaloMiniProgramSDK_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap(), _ZaloMiniProgramSDK_getActionsSupported = new WeakMap();
39038
+ _ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_cookies = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_callJump = new WeakMap(), _ZaloMiniProgramSDKService_setNavigationBarRightButton = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
39022
39039
 
39023
- var _MockSDK_appId, _MockSDK_appConfig, _MockSDK_zOAuth, _MockSDK_accessToken, _MockSDK_cache, _MockSDK_loggedId;
39024
- class MockSDK {
39040
+ var _MockSDKService_appId, _MockSDKService_appConfig, _MockSDKService_zOAuth, _MockSDKService_accessToken, _MockSDKService_cache, _MockSDKService_loggedId;
39041
+ class MockSDKService {
39025
39042
  constructor() {
39026
- _MockSDK_appId.set(this, ZAPP_ID);
39027
- _MockSDK_appConfig.set(this, APP_CONFIG);
39028
- _MockSDK_zOAuth.set(this, 'DEFAULT ZOAUTH');
39029
- _MockSDK_accessToken.set(this, 'DEFAULT ACCESS TOKEN');
39030
- _MockSDK_cache.set(this, {
39043
+ _MockSDKService_appId.set(this, ZAPP_ID);
39044
+ _MockSDKService_appConfig.set(this, APP_CONFIG);
39045
+ _MockSDKService_zOAuth.set(this, 'DEFAULT ZOAUTH');
39046
+ _MockSDKService_accessToken.set(this, 'DEFAULT ACCESS TOKEN');
39047
+ _MockSDKService_cache.set(this, {
39031
39048
  timer: {
39032
39049
  getToken: 0
39033
39050
  }
39034
39051
  });
39035
- _MockSDK_loggedId.set(this, false);
39052
+ _MockSDKService_loggedId.set(this, false);
39036
39053
  this.getLoginStatus = () => {
39037
- return __classPrivateFieldGet(this, _MockSDK_loggedId);
39054
+ return __classPrivateFieldGet(this, _MockSDKService_loggedId);
39038
39055
  };
39039
39056
  this.getAppId = () => {
39040
- return __classPrivateFieldGet(this, _MockSDK_appId);
39057
+ return __classPrivateFieldGet(this, _MockSDKService_appId);
39041
39058
  };
39042
39059
  this.login = () => {
39043
- __classPrivateFieldSet(this, _MockSDK_loggedId, true);
39044
- return Promise.resolve(__classPrivateFieldGet(this, _MockSDK_zOAuth));
39060
+ __classPrivateFieldSet(this, _MockSDKService_loggedId, true);
39061
+ return Promise.resolve(__classPrivateFieldGet(this, _MockSDKService_zOAuth));
39045
39062
  };
39046
39063
  this.getAccessToken = () => {
39047
- return Promise.resolve(__classPrivateFieldGet(this, _MockSDK_accessToken));
39064
+ return Promise.resolve(__classPrivateFieldGet(this, _MockSDKService_accessToken));
39048
39065
  };
39049
39066
  this.getVersion = Basics.getVersion;
39050
39067
  this.getSystemInfo = Basics.getSystemInfo;
@@ -39355,7 +39372,7 @@ class MockSDK {
39355
39372
  });
39356
39373
  }
39357
39374
  }
39358
- _MockSDK_appId = new WeakMap(), _MockSDK_appConfig = new WeakMap(), _MockSDK_zOAuth = new WeakMap(), _MockSDK_accessToken = new WeakMap(), _MockSDK_cache = new WeakMap(), _MockSDK_loggedId = new WeakMap();
39375
+ _MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
39359
39376
 
39360
39377
  /*! *****************************************************************************
39361
39378
  Copyright (C) Microsoft. All rights reserved.
@@ -40591,12 +40608,12 @@ const validate = (target, propertyName, descriptor) => {
40591
40608
  return descriptor;
40592
40609
  };
40593
40610
 
40594
- var _SDKCreator_sdkManager;
40611
+ var _SDKCreator_sdkService;
40595
40612
  class SDKCreator {
40596
40613
  constructor() {
40597
40614
  this.events = ZMPEEmitter.getInstance();
40598
- _SDKCreator_sdkManager.set(this, void 0);
40599
- __classPrivateFieldSet(this, _SDKCreator_sdkManager, this.getInstance());
40615
+ _SDKCreator_sdkService.set(this, void 0);
40616
+ __classPrivateFieldSet(this, _SDKCreator_sdkService, this.getServiceInstance());
40600
40617
  this.events.addListener = (event, fn, context) => {
40601
40618
  const stringifyEventName = event;
40602
40619
  return this.events.addListener(Events[stringifyEventName], fn, context);
@@ -40619,11 +40636,11 @@ class SDKCreator {
40619
40636
  */
40620
40637
  login(object) {
40621
40638
  return __awaiter(this, void 0, void 0, function* () {
40622
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).login(object);
40639
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).login(object);
40623
40640
  });
40624
40641
  }
40625
40642
  getLoginStatus() {
40626
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getLoginStatus();
40643
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getLoginStatus();
40627
40644
  }
40628
40645
  /**
40629
40646
  * Get Access Token.
@@ -40642,264 +40659,266 @@ class SDKCreator {
40642
40659
  */
40643
40660
  getAccessToken(object) {
40644
40661
  return __awaiter(this, void 0, void 0, function* () {
40645
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getAccessToken(object);
40662
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getAccessToken(object);
40646
40663
  });
40647
40664
  }
40648
40665
  getVersion() {
40649
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getVersion();
40666
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getVersion();
40650
40667
  }
40651
40668
  getSystemInfo() {
40652
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getSystemInfo();
40669
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getSystemInfo();
40653
40670
  }
40654
40671
  setNavigationBarTitle(object) {
40655
40672
  return __awaiter(this, void 0, void 0, function* () {
40656
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).setNavigationBarTitle(object);
40673
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).setNavigationBarTitle(object);
40657
40674
  });
40658
40675
  }
40659
40676
  setNavigationBarColor(object) {
40660
40677
  return __awaiter(this, void 0, void 0, function* () {
40661
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setNavigationBarColor(object);
40678
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setNavigationBarColor(object);
40662
40679
  });
40663
40680
  }
40664
40681
  setBackgroundColor(object) {
40665
40682
  return __awaiter(this, void 0, void 0, function* () {
40666
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setBackgroundColor(object);
40683
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setBackgroundColor(object);
40667
40684
  });
40668
40685
  }
40669
40686
  setNavigationBarLeftButton(object) {
40670
40687
  return __awaiter(this, void 0, void 0, function* () {
40671
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setNavigationBarLeftButton(object);
40688
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setNavigationBarLeftButton(object);
40672
40689
  });
40673
40690
  }
40674
40691
  setDeviceOrientation(object) {
40675
40692
  return __awaiter(this, void 0, void 0, function* () {
40676
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setDeviceOrientation(object);
40693
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setDeviceOrientation(object);
40677
40694
  });
40678
40695
  }
40679
40696
  setStorage(object) {
40680
40697
  return __awaiter(this, void 0, void 0, function* () {
40681
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setStorage(object);
40698
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setStorage(object);
40682
40699
  });
40683
40700
  }
40684
40701
  getStorage(object) {
40685
40702
  return __awaiter(this, void 0, void 0, function* () {
40686
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getStorage(object);
40703
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getStorage(object);
40687
40704
  });
40688
40705
  }
40689
40706
  getStorageInfo(object) {
40690
40707
  return __awaiter(this, void 0, void 0, function* () {
40691
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getStorageInfo(object);
40708
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getStorageInfo(object);
40692
40709
  });
40693
40710
  }
40694
40711
  removeStorage(object) {
40695
40712
  return __awaiter(this, void 0, void 0, function* () {
40696
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).removeStorage(object);
40713
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).removeStorage(object);
40697
40714
  });
40698
40715
  }
40699
40716
  clearStorage(object) {
40700
40717
  return __awaiter(this, void 0, void 0, function* () {
40701
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).clearStorage(object);
40718
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).clearStorage(object);
40702
40719
  });
40703
40720
  }
40704
40721
  getUserInfo(object) {
40705
40722
  return __awaiter(this, void 0, void 0, function* () {
40706
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getUserInfo(object);
40723
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getUserInfo(object);
40707
40724
  });
40708
40725
  }
40709
40726
  getNetworkType(object) {
40710
40727
  return __awaiter(this, void 0, void 0, function* () {
40711
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getNetworkType(object);
40728
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getNetworkType(object);
40712
40729
  });
40713
40730
  }
40714
40731
  onNetworkStatusChange(callback) {
40715
40732
  return __awaiter(this, void 0, void 0, function* () {
40716
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onNetworkStatusChange(callback);
40733
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onNetworkStatusChange(callback);
40717
40734
  });
40718
40735
  }
40719
40736
  startBeaconDiscovery(object) {
40720
40737
  return __awaiter(this, void 0, void 0, function* () {
40721
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).startBeaconDiscovery(object);
40738
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).startBeaconDiscovery(object);
40722
40739
  });
40723
40740
  }
40724
40741
  stopBeaconDiscovery(object) {
40725
40742
  return __awaiter(this, void 0, void 0, function* () {
40726
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).stopBeaconDiscovery(object);
40743
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).stopBeaconDiscovery(object);
40727
40744
  });
40728
40745
  }
40729
40746
  getBeacons(object) {
40730
40747
  return __awaiter(this, void 0, void 0, function* () {
40731
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getBeacons(object);
40748
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getBeacons(object);
40732
40749
  });
40733
40750
  }
40734
40751
  closeApp(object) {
40735
40752
  return __awaiter(this, void 0, void 0, function* () {
40736
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).closeApp(object);
40753
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).closeApp(object);
40737
40754
  });
40738
40755
  }
40739
40756
  getLocation(object) {
40740
40757
  return __awaiter(this, void 0, void 0, function* () {
40741
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getLocation(object);
40758
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getLocation(object);
40742
40759
  });
40743
40760
  }
40744
40761
  stopBluetoothDevicesDiscovery() {
40745
40762
  return __awaiter(this, void 0, void 0, function* () {
40746
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).stopBluetoothDevicesDiscovery();
40763
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).stopBluetoothDevicesDiscovery();
40747
40764
  });
40748
40765
  }
40749
40766
  startBluetoothDevicesDiscovery(object) {
40750
40767
  return __awaiter(this, void 0, void 0, function* () {
40751
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).startBluetoothDevicesDiscovery(object);
40768
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).startBluetoothDevicesDiscovery(object);
40752
40769
  });
40753
40770
  }
40754
40771
  openBluetoothAdapter() {
40755
40772
  return __awaiter(this, void 0, void 0, function* () {
40756
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openBluetoothAdapter();
40773
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openBluetoothAdapter();
40757
40774
  });
40758
40775
  }
40759
40776
  onBluetoothDeviceFound() {
40760
40777
  return __awaiter(this, void 0, void 0, function* () {
40761
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onBluetoothDeviceFound();
40778
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onBluetoothDeviceFound();
40762
40779
  });
40763
40780
  }
40764
40781
  onBluetoothAdapterStateChange() {
40765
40782
  return __awaiter(this, void 0, void 0, function* () {
40766
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onBluetoothAdapterStateChange();
40783
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onBluetoothAdapterStateChange();
40767
40784
  });
40768
40785
  }
40769
40786
  getConnectedBluetoothDevices(object) {
40770
40787
  return __awaiter(this, void 0, void 0, function* () {
40771
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getConnectedBluetoothDevices(object);
40788
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getConnectedBluetoothDevices(object);
40772
40789
  });
40773
40790
  }
40774
40791
  getBluetoothDevices() {
40775
40792
  return __awaiter(this, void 0, void 0, function* () {
40776
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getBluetoothDevices();
40793
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getBluetoothDevices();
40777
40794
  });
40778
40795
  }
40779
40796
  getBluetoothAdapterState() {
40780
40797
  return __awaiter(this, void 0, void 0, function* () {
40781
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getBluetoothAdapterState();
40798
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getBluetoothAdapterState();
40782
40799
  });
40783
40800
  }
40784
40801
  closeBluetoothAdapter() {
40785
40802
  return __awaiter(this, void 0, void 0, function* () {
40786
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).closeBluetoothAdapter();
40803
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).closeBluetoothAdapter();
40787
40804
  });
40788
40805
  }
40789
40806
  scanQRCode(object) {
40790
40807
  return __awaiter(this, void 0, void 0, function* () {
40791
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).scanQRCode(object);
40808
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).scanQRCode(object);
40792
40809
  });
40793
40810
  }
40794
40811
  openProfile(object) {
40795
40812
  return __awaiter(this, void 0, void 0, function* () {
40796
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openProfile(object);
40813
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openProfile(object);
40797
40814
  });
40798
40815
  }
40799
40816
  openChat(object) {
40800
40817
  return __awaiter(this, void 0, void 0, function* () {
40801
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openChat(object);
40818
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openChat(object);
40802
40819
  });
40803
40820
  }
40804
40821
  openPostFeed(object) {
40805
40822
  return __awaiter(this, void 0, void 0, function* () {
40806
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openPostFeed(object);
40823
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openPostFeed(object);
40807
40824
  });
40808
40825
  }
40809
40826
  followOA(object) {
40810
40827
  return __awaiter(this, void 0, void 0, function* () {
40811
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).followOA(object);
40828
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).followOA(object);
40812
40829
  });
40813
40830
  }
40814
40831
  unfollowOA(object) {
40815
40832
  return __awaiter(this, void 0, void 0, function* () {
40816
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).unFollowOA(object);
40833
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).unFollowOA(object);
40817
40834
  });
40818
40835
  }
40819
40836
  openShareSheet(object) {
40820
40837
  return __awaiter(this, void 0, void 0, function* () {
40821
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openShareSheet(object);
40838
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openShareSheet(object);
40822
40839
  });
40823
40840
  }
40824
40841
  requestCameraPermission(object) {
40825
40842
  return __awaiter(this, void 0, void 0, function* () {
40826
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).requestCameraPermission(object);
40843
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).requestCameraPermission(object);
40827
40844
  });
40828
40845
  }
40829
40846
  createShortcut(object) {
40830
40847
  return __awaiter(this, void 0, void 0, function* () {
40831
40848
  const isIOS = checkPlatform().isIOS;
40832
- let iconURL = getMetaValue('og:image:url');
40833
- console.log('iconURL', iconURL);
40849
+ let iconURL = getMetaValue('og:image:url') || '';
40850
+ iconURL = iconURL.replace(/^zbrowser?:/, '');
40834
40851
  if (!(iconURL === null || iconURL === void 0 ? void 0 : iconURL.includes('https'))) {
40835
40852
  iconURL = `https:${iconURL}`;
40836
40853
  }
40837
40854
  const title = document.title;
40838
- const searchParams = object.params ? new URLSearchParams(object.params) : new URLSearchParams();
40855
+ const searchParams = object.params
40856
+ ? new URLSearchParams(object.params)
40857
+ : new URLSearchParams();
40839
40858
  if (isIOS) {
40840
40859
  searchParams.append('appId', APP_ID);
40841
40860
  searchParams.append('appName', title);
40842
40861
  searchParams.append('appIcon', iconURL);
40843
40862
  const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40844
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openOutApp(encodeURI(iosShortcutURL));
40863
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40845
40864
  }
40846
40865
  else
40847
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(`${config.MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40866
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).createShortcut(`${MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40848
40867
  });
40849
40868
  }
40850
40869
  openBioAuthentication(object) {
40851
40870
  return __awaiter(this, void 0, void 0, function* () {
40852
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openBioAuthentication(object);
40871
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openBioAuthentication(object);
40853
40872
  });
40854
40873
  }
40855
40874
  checkStateBioAuthentication(object) {
40856
40875
  return __awaiter(this, void 0, void 0, function* () {
40857
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).checkStateBioAuthentication(object);
40876
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).checkStateBioAuthentication(object);
40858
40877
  });
40859
40878
  }
40860
40879
  sendLocation(object) {
40861
40880
  return __awaiter(this, void 0, void 0, function* () {
40862
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).sendLocation(object);
40881
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).sendLocation(object);
40863
40882
  });
40864
40883
  }
40865
40884
  showToast(object) {
40866
40885
  return __awaiter(this, void 0, void 0, function* () {
40867
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).showToast(object);
40886
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).showToast(object);
40868
40887
  });
40869
40888
  }
40870
40889
  hideKeyboard(object) {
40871
40890
  return __awaiter(this, void 0, void 0, function* () {
40872
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).hideKeyboard(object);
40891
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).hideKeyboard(object);
40873
40892
  });
40874
40893
  }
40875
40894
  openPhone(object) {
40876
40895
  return __awaiter(this, void 0, void 0, function* () {
40877
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openPhone(object);
40896
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openPhone(object);
40878
40897
  });
40879
40898
  }
40880
40899
  openSMS(object) {
40881
40900
  return __awaiter(this, void 0, void 0, function* () {
40882
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openSMS(object);
40901
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openSMS(object);
40883
40902
  });
40884
40903
  }
40885
40904
  viewOAQr(object) {
40886
40905
  return __awaiter(this, void 0, void 0, function* () {
40887
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).viewOAQr(object);
40906
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).viewOAQr(object);
40888
40907
  });
40889
40908
  }
40890
40909
  keepScreen(object) {
40891
40910
  return __awaiter(this, void 0, void 0, function* () {
40892
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).keepScreen(object);
40911
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).keepScreen(object);
40893
40912
  });
40894
40913
  }
40895
40914
  saveImageToGallery(object) {
40896
40915
  return __awaiter(this, void 0, void 0, function* () {
40897
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).saveImageToPhotosAlbum(object);
40916
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).saveImageToPhotosAlbum(object);
40898
40917
  });
40899
40918
  }
40900
40919
  saveImageToPhotosAlbum(object) {
40901
40920
  return __awaiter(this, void 0, void 0, function* () {
40902
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).saveImageToPhotosAlbum(object);
40921
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).saveImageToPhotosAlbum(object);
40903
40922
  });
40904
40923
  }
40905
40924
  openMiniApp(object) {
@@ -40914,46 +40933,46 @@ class SDKCreator {
40914
40933
  });
40915
40934
  object.params = params;
40916
40935
  }
40917
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openMiniApp(object);
40936
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openMiniApp(object);
40918
40937
  });
40919
40938
  }
40920
40939
  vibrate(object) {
40921
40940
  return __awaiter(this, void 0, void 0, function* () {
40922
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).vibrate(object);
40941
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).vibrate(object);
40923
40942
  });
40924
40943
  }
40925
40944
  openWebview(object) {
40926
40945
  return __awaiter(this, void 0, void 0, function* () {
40927
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openWebview(object);
40946
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openWebview(object);
40928
40947
  });
40929
40948
  }
40930
40949
  getRouteParams() {
40931
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getRouteParams();
40950
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getRouteParams();
40932
40951
  }
40933
40952
  getAppInfo(object) {
40934
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getAppInfo();
40953
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getAppInfo();
40935
40954
  }
40936
40955
  sendDataToPreviousMiniApp(object) {
40937
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).sendDataToPreviousMiniApp(object);
40956
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).sendDataToPreviousMiniApp(object);
40938
40957
  }
40939
40958
  onCallbackData(callback) {
40940
40959
  return __awaiter(this, void 0, void 0, function* () {
40941
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onCallbackData(callback);
40960
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onCallbackData(callback);
40942
40961
  });
40943
40962
  }
40944
40963
  getPhoneNumber(object) {
40945
40964
  return __awaiter(this, void 0, void 0, function* () {
40946
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getPhoneNumber();
40965
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getPhoneNumber();
40947
40966
  });
40948
40967
  }
40949
40968
  openProfilePicker(object) {
40950
40969
  return __awaiter(this, void 0, void 0, function* () {
40951
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openProfilePicker(object);
40970
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openProfilePicker(object);
40952
40971
  });
40953
40972
  }
40954
40973
  connectWifi(object) {
40955
40974
  return __awaiter(this, void 0, void 0, function* () {
40956
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).connectWifi(object);
40975
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).connectWifi(object);
40957
40976
  });
40958
40977
  }
40959
40978
  openMediaPicker(object) {
@@ -40969,7 +40988,7 @@ class SDKCreator {
40969
40988
  editView.aspect_ratio = (_c = object.editView) === null || _c === void 0 ? void 0 : _c.aspectRatio;
40970
40989
  const silentRequest = object.silentRequest === true ? 1 : 0;
40971
40990
  const maxSelectItem = object.maxSelectItem;
40972
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openMediaPicker(object.type, editView, silentRequest, maxSelectItem);
40991
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openMediaPicker(object.type, editView, silentRequest, maxSelectItem);
40973
40992
  });
40974
40993
  }
40975
40994
  getShareableLink(object) {
@@ -40980,7 +40999,7 @@ class SDKCreator {
40980
40999
  });
40981
41000
  }
40982
41001
  }
40983
- _SDKCreator_sdkManager = new WeakMap();
41002
+ _SDKCreator_sdkService = new WeakMap();
40984
41003
  __decorate([
40985
41004
  handleError
40986
41005
  ], SDKCreator.prototype, "login", null);
@@ -41386,13 +41405,13 @@ __decorate([
41386
41405
  }))
41387
41406
  ], SDKCreator.prototype, "getShareableLink", null);
41388
41407
  class ZaloMiniAppSDKCreator extends SDKCreator {
41389
- getInstance() {
41390
- return ZaloMiniProgramSDK.getInstance();
41408
+ getServiceInstance() {
41409
+ return ZaloMiniProgramSDKService.getInstance();
41391
41410
  }
41392
41411
  }
41393
41412
  class MockSDKCreator extends SDKCreator {
41394
- getInstance() {
41395
- return new MockSDK();
41413
+ getServiceInstance() {
41414
+ return new MockSDKService();
41396
41415
  }
41397
41416
  }
41398
41417