zmp-sdk 2.18.5-rc.1 → 2.18.7

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.
@@ -2086,9 +2086,7 @@
2086
2086
  return window.Debug(name);
2087
2087
  }
2088
2088
  return function (...args) {
2089
- if (process.env.NODE_ENV === 'development') {
2090
- console.log(name, ...args);
2091
- }
2089
+ if (process.env.NODE_ENV === 'development') ;
2092
2090
  };
2093
2091
  }
2094
2092
 
@@ -2798,7 +2796,7 @@
2798
2796
  fail.call(null, errorParsed, this);
2799
2797
  }
2800
2798
  else {
2801
- console.error('Error:', errorParsed);
2799
+ reject(errorParsed);
2802
2800
  }
2803
2801
  }
2804
2802
  }));
@@ -2825,12 +2823,9 @@
2825
2823
  }
2826
2824
  }
2827
2825
  const { handler } = catchDecoratorStore;
2828
- if (!_.isNull(handler) && _.isFunction(handler)) {
2829
- handler.call(null, key, error, this);
2830
- }
2831
- else {
2832
- console.warn(error.message);
2833
- }
2826
+ const errorParsed = handler.call(null, key, error, this);
2827
+ window.zmpSentry && window.zmpSentry.throwError(errorParsed.toString());
2828
+ throw errorParsed;
2834
2829
  }
2835
2830
  };
2836
2831
  return descriptor;
@@ -4062,7 +4057,7 @@
4062
4057
  }
4063
4058
  _ZJSBridgeProvider_bridge = new WeakMap();
4064
4059
 
4065
- var version = "2.18.5-rc.1";
4060
+ var version = "2.18.7";
4066
4061
 
4067
4062
  class Basics {
4068
4063
  /**
@@ -7217,17 +7212,17 @@
7217
7212
  const resData = yield response.json();
7218
7213
  if (resData.error === 0 && resData.data) {
7219
7214
  users = uIds.map((item) => {
7220
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
7215
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
7221
7216
  return {
7222
- id: item,
7217
+ id: ((_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.user_id_by_app) || "",
7223
7218
  profile: {
7224
- name: (_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.name,
7225
- avatar: (_f = (_e = (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.picture) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.url
7219
+ name: (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.name,
7220
+ avatar: (_h = (_g = (_f = (_e = resData.data[item]) === null || _e === void 0 ? void 0 : _e.user_info) === null || _f === void 0 ? void 0 : _f.picture) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.url
7226
7221
  },
7227
- code: ((_g = resData.data[item]) === null || _g === void 0 ? void 0 : _g.error) !== 0 ? -1 : 0,
7228
- message: `Get profile: ${_.isUndefined((_h = resData.data[item]) === null || _h === void 0 ? void 0 : _h.message)
7222
+ code: ((_j = resData.data[item]) === null || _j === void 0 ? void 0 : _j.error) !== 0 ? -1 : 0,
7223
+ message: `Get profile: ${_.isUndefined((_k = resData.data[item]) === null || _k === void 0 ? void 0 : _k.message)
7229
7224
  ? 'Unknown error'
7230
- : (_j = resData.data[item]) === null || _j === void 0 ? void 0 : _j.message}`
7225
+ : (_l = resData.data[item]) === null || _l === void 0 ? void 0 : _l.message}`
7231
7226
  };
7232
7227
  });
7233
7228
  }
package/dist/index.es.js CHANGED
@@ -2083,9 +2083,7 @@ function Debug(name) {
2083
2083
  return window.Debug(name);
2084
2084
  }
2085
2085
  return function (...args) {
2086
- if (process.env.NODE_ENV === 'development') {
2087
- console.log(name, ...args);
2088
- }
2086
+ if (process.env.NODE_ENV === 'development') ;
2089
2087
  };
2090
2088
  }
2091
2089
 
@@ -2795,7 +2793,7 @@ const handleError = (target, propertyName, descriptor) => {
2795
2793
  fail.call(null, errorParsed, this);
2796
2794
  }
2797
2795
  else {
2798
- console.error('Error:', errorParsed);
2796
+ reject(errorParsed);
2799
2797
  }
2800
2798
  }
2801
2799
  }));
@@ -2822,12 +2820,9 @@ const handleErrorSync = (target, key, descriptor) => {
2822
2820
  }
2823
2821
  }
2824
2822
  const { handler } = catchDecoratorStore;
2825
- if (!_.isNull(handler) && _.isFunction(handler)) {
2826
- handler.call(null, key, error, this);
2827
- }
2828
- else {
2829
- console.warn(error.message);
2830
- }
2823
+ const errorParsed = handler.call(null, key, error, this);
2824
+ window.zmpSentry && window.zmpSentry.throwError(errorParsed.toString());
2825
+ throw errorParsed;
2831
2826
  }
2832
2827
  };
2833
2828
  return descriptor;
@@ -4059,7 +4054,7 @@ class ZJSBridgeProvider {
4059
4054
  }
4060
4055
  _ZJSBridgeProvider_bridge = new WeakMap();
4061
4056
 
4062
- var version$1 = "2.18.5-rc.1";
4057
+ var version$1 = "2.18.7";
4063
4058
 
4064
4059
  class Basics {
4065
4060
  /**
@@ -8572,17 +8567,17 @@ class SDKCreator {
8572
8567
  const resData = yield response.json();
8573
8568
  if (resData.error === 0 && resData.data) {
8574
8569
  users = uIds.map((item) => {
8575
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
8570
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
8576
8571
  return {
8577
- id: item,
8572
+ id: ((_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.user_id_by_app) || "",
8578
8573
  profile: {
8579
- name: (_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.name,
8580
- avatar: (_f = (_e = (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.picture) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.url
8574
+ name: (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.name,
8575
+ avatar: (_h = (_g = (_f = (_e = resData.data[item]) === null || _e === void 0 ? void 0 : _e.user_info) === null || _f === void 0 ? void 0 : _f.picture) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.url
8581
8576
  },
8582
- code: ((_g = resData.data[item]) === null || _g === void 0 ? void 0 : _g.error) !== 0 ? -1 : 0,
8583
- message: `Get profile: ${_.isUndefined((_h = resData.data[item]) === null || _h === void 0 ? void 0 : _h.message)
8577
+ code: ((_j = resData.data[item]) === null || _j === void 0 ? void 0 : _j.error) !== 0 ? -1 : 0,
8578
+ message: `Get profile: ${_.isUndefined((_k = resData.data[item]) === null || _k === void 0 ? void 0 : _k.message)
8584
8579
  ? 'Unknown error'
8585
- : (_j = resData.data[item]) === null || _j === void 0 ? void 0 : _j.message}`
8580
+ : (_l = resData.data[item]) === null || _l === void 0 ? void 0 : _l.message}`
8586
8581
  };
8587
8582
  });
8588
8583
  }
package/dist/index.js CHANGED
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- function e(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a}function t(e,t){return function(i,n){t(i,n,e)}}function i(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function n(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function o(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i}Object.defineProperty(exports,"__esModule",{value:!0});var r=Object.prototype;var a=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)};var s=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),l=Object.prototype.hasOwnProperty;var c=function(e){if(!a(e))return s(e);var t=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&t.push(i);return t},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e,t){return e(t={exports:{}},t.exports),t.exports}var p="object"==typeof u&&u&&u.Object===Object&&u,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")(),f=v.Symbol,m=Object.prototype,g=m.hasOwnProperty,y=m.toString,_=f?f.toStringTag:void 0;var E=function(e){var t=g.call(e,_),i=e[_];try{e[_]=void 0;var n=!0}catch(e){}var o=y.call(e);return n&&(t?e[_]=i:delete e[_]),o},S=Object.prototype.toString;var A=function(e){return S.call(e)},T=f?f.toStringTag:void 0;var b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?E(e):A(e)};var O=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var w,N=function(e){if(!O(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},P=v["__core-js_shared__"],C=(w=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var I=function(e){return!!C&&C in e},k=Function.prototype.toString;var R=function(e){if(null!=e){try{return k.call(e)}catch(e){}try{return e+""}catch(e){}}return""},B=/^\[object .+?Constructor\]$/,D=Function.prototype,j=Object.prototype,L=D.toString,M=j.hasOwnProperty,x=RegExp("^"+L.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var U=function(e){return!(!O(e)||I(e))&&(N(e)?x:B).test(R(e))};var W=function(e,t){return null==e?void 0:e[t]};var z=function(e,t){var i=W(e,t);return U(i)?i:void 0},F=z(v,"DataView"),G=z(v,"Map"),H=z(v,"Promise"),$=z(v,"Set"),V=z(v,"WeakMap"),Z=R(F),J=R(G),K=R(H),Q=R($),q=R(V),Y=b;(F&&"[object DataView]"!=Y(new F(new ArrayBuffer(1)))||G&&"[object Map]"!=Y(new G)||H&&"[object Promise]"!=Y(H.resolve())||$&&"[object Set]"!=Y(new $)||V&&"[object WeakMap]"!=Y(new V))&&(Y=function(e){var t=b(e),i="[object Object]"==t?e.constructor:void 0,n=i?R(i):"";if(n)switch(n){case Z:return"[object DataView]";case J:return"[object Map]";case K:return"[object Promise]";case Q:return"[object Set]";case q:return"[object WeakMap]"}return t});var X=Y;var ee=function(e){return null!=e&&"object"==typeof e};var te=function(e){return ee(e)&&"[object Arguments]"==b(e)},ie=Object.prototype,ne=ie.hasOwnProperty,oe=ie.propertyIsEnumerable,re=te(function(){return arguments}())?te:function(e){return ee(e)&&ne.call(e,"callee")&&!oe.call(e,"callee")},ae=Array.isArray;var se=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var le=function(e){return null!=e&&se(e.length)&&!N(e)};var ce=function(){return!1},ue=d((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i?v.Buffer:void 0,r=(o?o.isBuffer:void 0)||ce;e.exports=r})),de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de["[object Arguments]"]=de["[object Array]"]=de["[object ArrayBuffer]"]=de["[object Boolean]"]=de["[object DataView]"]=de["[object Date]"]=de["[object Error]"]=de["[object Function]"]=de["[object Map]"]=de["[object Number]"]=de["[object Object]"]=de["[object RegExp]"]=de["[object Set]"]=de["[object String]"]=de["[object WeakMap]"]=!1;var pe=function(e){return ee(e)&&se(e.length)&&!!de[b(e)]};var he=function(e){return function(t){return e(t)}},ve=d((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&p.process,r=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=r})),fe=ve&&ve.isTypedArray,me=fe?he(fe):pe,ge=Object.prototype.hasOwnProperty;var ye=function(e){if(null==e)return!0;if(le(e)&&(ae(e)||"string"==typeof e||"function"==typeof e.splice||ue(e)||me(e)||re(e)))return!e.length;var t=X(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(a(e))return!c(e).length;for(var i in e)if(ge.call(e,i))return!1;return!0};var _e=function(e){return void 0===e};var Ee=function(e){return null===e};var Se=function(e){return"string"==typeof e||!ae(e)&&ee(e)&&"[object String]"==b(e)};var Ae=function(e){return"number"==typeof e||ee(e)&&"[object Number]"==b(e)};var Te=function(e){return ee(e)&&"[object RegExp]"==b(e)},be=ve&&ve.isRegExp,Oe=be?he(be):Te;var we=function(e){return"symbol"==typeof e||ee(e)&&"[object Symbol]"==b(e)},Ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pe=/^\w*$/;var Ce=function(e,t){if(ae(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!we(e))||(Pe.test(e)||!Ne.test(e)||null!=t&&e in Object(t))},Ie=z(Object,"create");var ke=function(){this.__data__=Ie?Ie(null):{},this.size=0};var Re=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Be=Object.prototype.hasOwnProperty;var De=function(e){var t=this.__data__;if(Ie){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Be.call(t,e)?t[e]:void 0},je=Object.prototype.hasOwnProperty;var Le=function(e){var t=this.__data__;return Ie?void 0!==t[e]:je.call(t,e)};var Me=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ie&&void 0===t?"__lodash_hash_undefined__":t,this};function xe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}xe.prototype.clear=ke,xe.prototype.delete=Re,xe.prototype.get=De,xe.prototype.has=Le,xe.prototype.set=Me;var Ue=xe;var We=function(){this.__data__=[],this.size=0};var ze=function(e,t){return e===t||e!=e&&t!=t};var Fe=function(e,t){for(var i=e.length;i--;)if(ze(e[i][0],t))return i;return-1},Ge=Array.prototype.splice;var He=function(e){var t=this.__data__,i=Fe(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ge.call(t,i,1),--this.size,!0)};var $e=function(e){var t=this.__data__,i=Fe(t,e);return i<0?void 0:t[i][1]};var Ve=function(e){return Fe(this.__data__,e)>-1};var Ze=function(e,t){var i=this.__data__,n=Fe(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function Je(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Je.prototype.clear=We,Je.prototype.delete=He,Je.prototype.get=$e,Je.prototype.has=Ve,Je.prototype.set=Ze;var Ke=Je;var Qe=function(){this.size=0,this.__data__={hash:new Ue,map:new(G||Ke),string:new Ue}};var qe=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ye=function(e,t){var i=e.__data__;return qe(t)?i["string"==typeof t?"string":"hash"]:i.map};var Xe=function(e){var t=Ye(this,e).delete(e);return this.size-=t?1:0,t};var et=function(e){return Ye(this,e).get(e)};var tt=function(e){return Ye(this,e).has(e)};var it=function(e,t){var i=Ye(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function nt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}nt.prototype.clear=Qe,nt.prototype.delete=Xe,nt.prototype.get=et,nt.prototype.has=tt,nt.prototype.set=it;var ot=nt;function rt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var a=e.apply(this,n);return i.cache=r.set(o,a)||r,a};return i.cache=new(rt.Cache||ot),i}rt.Cache=ot;var at=rt;var st=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lt=/\\(\\)?/g,ct=function(e){var t=at(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(st,(function(e,i,n,o){t.push(n?o.replace(lt,"$1"):i||e)})),t}));var ut=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o},dt=f?f.prototype:void 0,pt=dt?dt.toString:void 0;var ht=function e(t){if("string"==typeof t)return t;if(ae(t))return ut(t,e)+"";if(we(t))return pt?pt.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var vt=function(e){return null==e?"":ht(e)};var ft=function(e,t){return ae(e)?e:Ce(e,t)?[e]:ct(vt(e))};var mt=function(e){if("string"==typeof e||we(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var gt=function(e,t){for(var i=0,n=(t=ft(t,e)).length;null!=e&&i<n;)e=e[mt(t[i++])];return i&&i==n?e:void 0};var yt=function(e,t,i){var n=null==e?void 0:gt(e,t);return void 0===n?i:n},_t=function(){try{var e=z(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Et=function(e,t,i){"__proto__"==t&&_t?_t(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},St=Object.prototype.hasOwnProperty;var At=function(e,t,i){var n=e[t];St.call(e,t)&&ze(n,i)&&(void 0!==i||t in e)||Et(e,t,i)},Tt=/^(?:0|[1-9]\d*)$/;var bt=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Tt.test(e))&&e>-1&&e%1==0&&e<t};var Ot=function(e,t,i,n){if(!O(e))return e;for(var o=-1,r=(t=ft(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var l=mt(t[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=a){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=O(u)?u:bt(t[o+1])?[]:{})}At(s,l,c),s=s[l]}return e};var wt,Nt,Pt,Ct,It,kt,Rt,Bt,Dt,jt,Lt,Mt={isEmpty:ye,isNull:Ee,isUndefined:_e,isFunction:N,isObject:O,isString:Se,isNumber:Ae,isArray:ae,isRegExp:Oe,get:yt,set:function(e,t,i){return null==e?e:Ot(e,t,i)}};function xt(e){return"function"==typeof window.Debug?window.Debug(e):function(...t){"development"===process.env.NODE_ENV&&console.log(e,...t)}}exports.NetworkType=void 0,(wt=exports.NetworkType||(exports.NetworkType={})).none="none",wt.wifi="wifi",wt.cellular="cellular",wt.unknown="unknown",exports.PlatformType=void 0,(Nt=exports.PlatformType||(exports.PlatformType={})).wp="wp",Nt.android="android",Nt.iOS="iOS",Nt.unknown="unknown",exports.ProfileType=void 0,(Pt=exports.ProfileType||(exports.ProfileType={}))[Pt.user=1]="user",Pt[Pt.oa=0]="oa",Pt[Pt.aliasOA=2]="aliasOA",exports.ChatType=void 0,(Ct=exports.ChatType||(exports.ChatType={}))[Ct.user=1]="user",Ct[Ct.oa=0]="oa",exports.PostFeedType=void 0,(It=exports.PostFeedType||(exports.PostFeedType={}))[It.image=1]="image",It[It.link=4]="link",It[It.profile=5]="profile",exports.ShareSheetType=void 0,(kt=exports.ShareSheetType||(exports.ShareSheetType={}))[kt.image=1]="image",kt[kt.gif=11]="gif",kt[kt.video=12]="video",kt[kt.link=4]="link",kt[kt.oa=5]="oa",kt[kt.zmp=20]="zmp",exports.OrientationType=void 0,(Rt=exports.OrientationType||(exports.OrientationType={}))[Rt.auto=1]="auto",Rt[Rt.portrait=2]="portrait",Rt[Rt.landscape=3]="landscape",exports.VibrateType=void 0,(Bt=exports.VibrateType||(exports.VibrateType={}))[Bt.oneShot=0]="oneShot",exports.NativeCode=void 0,(Dt=exports.NativeCode||(exports.NativeCode={}))[Dt.token_invalid=-2]="token_invalid",Dt[Dt.not_permission=-1]="not_permission",Dt[Dt.client_not_support=-5]="client_not_support",Dt[Dt.decode_failed=-4]="decode_failed",exports.Events=void 0,(jt=exports.Events||(exports.Events={})).AppPaused="h5.event.paused",jt.AppResumed="h5.event.resumed",jt.NetworkChanged="h5.event.connection.changed",jt.OnDataCallback="h5.event.webview.result",jt.OpenApp="h5.event.open.mp",exports.MediaPickerType=void 0,(Lt=exports.MediaPickerType||(exports.MediaPickerType={}))[Lt.photo=4]="photo",Lt[Lt.video=5]="video",Lt[Lt.file=6]="file",Lt[Lt.multi_photo=7]="multi_photo",Lt[Lt.multi_video=8]="multi_video";const Ut=e=>{const t=document.cookie;if(t){const o=t.split("; ");if(o&&o.length>0)for(var i=e.length+1,n=o.length-1;n>=0;n--){let t=o[n];if(t&&0===t.indexOf(e)&&(t=t.substring(i,t.length),t))return t=t.replace(/["']/g,""),t}}return null},Wt=e=>Ut(`${window.location.host}_`+e),zt=e=>Ut((()=>{const e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""})()+e),Ft=window.zAppID,Gt=window.APP_ID,Ht=window.APP_CONFIG||{},$t="h5.zdn.vn_zoauth",Vt="h5.zdn.vn_zlink3rd",Zt="h5.zdn.vn_zoauth_vrf",Jt="https://graph.zalo.me/v2.0/me",Kt="https://h5.zalo.me/openapi/access_token",Qt="https://oauth.zaloapp.com/v3/access_token",qt="https://graph.zalo.me/v2.0/me/friends/list",Yt=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),Xt={GET_DOWNLOADED_STICKER:{name:"action.get.downloaded.sticker",have_callback:!0},OPEN_SHARE_STICKER:{name:"action.open.share.sticker"},OPEN_PROFILE:{name:"action.open.profile"},OPEN_FEED_DETAIL:{name:"action.open.feeddetail"},OPEN_FRIEND_RADA:{name:"action.open.friendrada"},OPEN_INAPP:{name:"action.open.inapp"},OPEN_OUTAPP:{name:"action.open.outapp"},OPEN_PAGE:{name:"action.open.page"},OPEN_PHOTODETAIL:{name:"action.open.photodetail"},OPEN_GALARY:{name:"action.open.galary"},OPEN_GAMECENTER:{name:"action.open.gamecenter"},OPEN_GAMENEWS:{name:"action.open.gamenews"},OPEN_TAB_CONTACT:{name:"action.open.tab.contact"},OPEN_TAB_SOCIAL:{name:"action.open.tab.social"},OPEN_FRIENDSUGGEST:{name:"action.open.friendsuggest"},OPEN_GROUPLIST:{name:"action.open.grouplist"},OPEN_NEARBY:{name:"action.open.nearby"},OPEN_ROOM:{name:"action.open.room"},OPEN_STICKERSTORE:{name:"action.open.stickerstore"},OPEN_CREATECHAT:{name:"action.open.createchat"},COPY_LINK_CATESTICKER:{name:"action.copy.link.catesticker"},REQUEST_BUY_STICKER:{name:"action.request.buy.sticker"},OPEN_CHAT:{name:"action.open.chat"},OPEN_TAB_CHAT:{name:"action.open.tab.chat"},OPEN_CHATGROUP:{name:"action.open.chatgroup"},OPEN_ADDFRIEND:{name:"action.open.addfriend"},OPEN_TAB_MORE:{name:"action.open.tab.more"},OPEN_POSTFEED:{name:"action.open.postfeed"},OPEN_LOGINDEVICES:{name:"action.open.logindevices"},OPEN_SENDSTICKER:{name:"action.open.sendsticker"},REPORT_ABUSE:{name:"action.report.abuse",have_callback:!0},FOLLOW_OA:{name:"action.follow.oa",have_callback:!0},UNFOLLOW_OA:{name:"action.unfollow.oa",have_callback:!0},OPEN_GAMEDETAIL:{name:"action.open.gamedetail"},OPEN_SHARESHEET:{name:"action.open.sharesheet",have_callback:!0},REQUEST_PERMISSION_CAMERA:{name:"action.request.permission.camera"},CHANGE_TITLE_HEADER:{name:"action.change.title.header",skip_jump:!0},WEBVIEW_CLEARCACHE:{name:"action.webview.clearcache"},WEBVIEW_CONFIRMCACHE:{name:"action.webview.confirmcache"},WEBVIEW_ISVISIBLE:{name:"action.webview.isvisible"},WEBVIEW_NETWORKTYPE:{name:"action.webview.networktype",skip_jump:!0},CHANGE_BUTTON_HEADER:{name:"action.change.button.header"},CREATE_OPTIONS_MENU:{name:"action.create.options.menu",skip_jump:!0,have_callback:!0},CREATE_SHORTCUT:{name:"action.create.shortcut"},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{name:"action.change.actionbar.leftbutton.type",skip_jump:!0,have_callback:!0},WINDOW_CLOSE:{name:"action.window.close",skip_jump:!0,have_callback:!0},WEBVIEW_CHECKRESERROR:{name:"action.webview.checkResError"},IAP_REQUESTPAYMENT:{name:"action.iap.requestpayment"},ZBROWSER_GETSTATS:{name:"action.zbrowser.getstats"},ZBROWSER_JSBRIDGE:{name:"action.zbrowser.jsbridge",skip_jump:!0,have_callback:!0},PROMPT_AUTHENTICATION:{name:"action.prompt.authentication"},CHANGE_ACTIONBAR_COLOR:{name:"action.change.actionbar.color",skip_jump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{name:"action.prompt.authentication.check_state"},OPEN_APPSTORE:{name:"action.open.appstore"},GET_LOCATION:{name:"action.get.location",have_callback:!0},QUERY_LOCATION_HIDE:{name:"action.query.location.hide",have_callback:!0},SHOW_TOAST:{name:"action.show.toast",have_callback:!0},OPEN_APP:{name:"action.open.app"},HIDE_KEYBOARD:{name:"action.hide.keyboard"},OPEN_PHONE:{name:"action.open.phone"},OPEN_QR:{name:"action.open.qr"},OPEN_SMS:{name:"action.open.sms"},VIEW_MYQR:{name:"action.view.myqr",have_callback:!0},KEEP_SCREEN:{name:"action.keep.screen",have_callback:!0},CHANGE_AUTOROTATE:{name:"action.change.autorotate",skip_jump:!0},CHECK_APP_INSTALLED:{name:"action.check.app.installed"},QUERY_SHOW:{name:"action.query.show"},QUERY_HIDE:{name:"action.query.hide"},OPEN_INAPPRW:{name:"action.open.inapprw"},ZALORUN_GETTRACKINGSTATUS:{name:"action.zalorun.getTrackingStatus",have_callback:!0},ZALORUN_SETTRACKINGSTATUS:{name:"action.zalorun.setTrackingStatus",have_callback:!0},ZALORUN_GETDAYSTEP:{name:"action.zalorun.getDayStep",have_callback:!0},ZALORUN_FORCESUBMITDATA:{name:"action.zalorun.forceSubmitData",have_callback:!0},ZALORUN_SETWEIGHT:{name:"action.zalorun.setWeight",have_callback:!0},OPEN_PROFILE_EXT:{name:"action.open.profile.ext"},DOWNLOAD_CATE:{name:"action.download.cate",have_callback:!0},JUMP_LOGIN:{name:"action.jump.login",skip_jump:!0,white_list:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{name:"action.open.adtima.ads.interstitial"},OPEN_ADTIMA_ADS:{name:"action.open.adtima.ads"},GET_ADIDCLIENT:{name:"action.get.adidclient"},SCAN_IBEACON:{name:"action.scan.ibeacon"},INTERACTIVE_VIBRATION:{name:"action.interactive.vibration"},SAVE_IMAGE_GALLERY:{name:"action.save.image.gallery",version_live:{iOS:408}},OPEN_MP:{name:"action.open.mp",version_live:{iOS:402}},CHANGE_ACTIONBAR:{name:"action.change.actionbar",version_live:{iOS:402},skip_jump:!0},ZBROWSER_MPDS:{name:"action.zbrowser.mpds",version_live:{iOS:402}},WEBVIEW_SET_RESULT:{name:"action.webview.set.result",version_live:{iOS:416}},MP_GET_NUMBER:{name:"action.mp.get.number",version_live:{iOS:416}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432}},GET_SUPPORTED_ACTIONS:{name:"action.get.supported.actions",white_list:!0},MP_JOIN_WIFI:{name:"action.mp.join.wifi",version_live:{android:0,iOS:999},have_permission:!1,white_list:!1},PICK_MEDIA:{name:"action.pick.media",version_live:{iOS:999}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},ei=0,ti=-1400,ii=-1500,ni=-1401,oi=-1403,ri=-1404,ai={SUCCESS:"Success",READ_MORE:"Read more at: https://miniapp.zalo.me/docs/api",LOGIN_REQUIRED:"Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login",LOGIN_FAILED:"Login failed.",NOT_PERMISSION:"You don't have permission to call this api",CLIENT_NOT_SUPPORT:"This API is not supported in this Zalo version",DECODE_FAILED:"Can not decode your data. Read more at: https://miniapp.zalo.me/docs/api/error"},si="apps/get-info",li={android:12100571,iOS:400,wp:0,unknown:0},ci=[Xt.GET_DOWNLOADED_STICKER.name,Xt.OPEN_SHARE_STICKER.name,Xt.OPEN_PROFILE.name,Xt.OPEN_FEED_DETAIL.name,Xt.OPEN_FRIEND_RADA.name,Xt.OPEN_INAPP.name,Xt.OPEN_OUTAPP.name,Xt.OPEN_PAGE.name,Xt.OPEN_PHOTODETAIL.name,Xt.OPEN_GALARY.name,Xt.OPEN_GAMECENTER.name,Xt.OPEN_GAMENEWS.name,Xt.OPEN_TAB_CONTACT.name,Xt.OPEN_TAB_SOCIAL.name,Xt.OPEN_FRIENDSUGGEST.name,Xt.OPEN_GROUPLIST.name,Xt.OPEN_NEARBY.name,Xt.OPEN_ROOM.name,Xt.OPEN_STICKERSTORE.name,Xt.OPEN_CREATECHAT.name,Xt.COPY_LINK_CATESTICKER.name,Xt.REQUEST_BUY_STICKER.name,Xt.OPEN_CHAT.name,Xt.OPEN_TAB_CHAT.name,Xt.OPEN_CHATGROUP.name,Xt.OPEN_ADDFRIEND.name,Xt.OPEN_TAB_MORE.name,Xt.OPEN_POSTFEED.name,Xt.OPEN_LOGINDEVICES.name,Xt.OPEN_SENDSTICKER.name,Xt.REPORT_ABUSE.name,Xt.FOLLOW_OA.name,Xt.UNFOLLOW_OA.name,Xt.OPEN_GAMEDETAIL.name,Xt.OPEN_SHARESHEET.name,Xt.REQUEST_PERMISSION_CAMERA.name,Xt.CHANGE_TITLE_HEADER.name,Xt.WEBVIEW_CLEARCACHE.name,Xt.WEBVIEW_CONFIRMCACHE.name,Xt.WEBVIEW_ISVISIBLE.name,Xt.WEBVIEW_NETWORKTYPE.name,Xt.CHANGE_BUTTON_HEADER.name,Xt.CREATE_OPTIONS_MENU.name,Xt.CREATE_SHORTCUT.name,Xt.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,Xt.WINDOW_CLOSE.name,Xt.WEBVIEW_CHECKRESERROR.name,Xt.IAP_REQUESTPAYMENT.name,Xt.ZBROWSER_GETSTATS.name,Xt.ZBROWSER_JSBRIDGE.name,Xt.PROMPT_AUTHENTICATION.name,Xt.CHANGE_ACTIONBAR_COLOR.name,Xt.PROMPT_AUTHENTICATION_CHECK_STATE.name,Xt.OPEN_APPSTORE.name,Xt.GET_LOCATION.name,Xt.QUERY_LOCATION_HIDE.name,Xt.SHOW_TOAST.name,Xt.OPEN_APP.name,Xt.HIDE_KEYBOARD.name,Xt.OPEN_PHONE.name,Xt.OPEN_QR.name,Xt.OPEN_SMS.name,Xt.VIEW_MYQR.name,Xt.KEEP_SCREEN.name,Xt.CHANGE_AUTOROTATE.name,Xt.CHECK_APP_INSTALLED.name,Xt.QUERY_SHOW.name,Xt.QUERY_HIDE.name,Xt.OPEN_INAPPRW.name,Xt.ZALORUN_GETTRACKINGSTATUS.name,Xt.ZALORUN_SETTRACKINGSTATUS.name,Xt.ZALORUN_GETDAYSTEP.name,Xt.ZALORUN_FORCESUBMITDATA.name,Xt.ZALORUN_SETWEIGHT.name,Xt.OPEN_PROFILE_EXT.name,Xt.DOWNLOAD_CATE.name,Xt.JUMP_LOGIN.name,Xt.OPEN_ADTIMA_ADS_INTERSTITIAL.name,Xt.OPEN_ADTIMA_ADS.name,Xt.GET_ADIDCLIENT.name,Xt.SCAN_IBEACON.name,Xt.SAVE_IMAGE_GALLERY.name,Xt.OPEN_MP.name,Xt.CHANGE_ACTIONBAR.name,Xt.INTERACTIVE_VIBRATION.name,Xt.ZBROWSER_MPDS.name],ui=0,di=3,pi=1,hi=0;class vi{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class fi extends vi{constructor(e,t){super(e,t),this.message=`${t}. ${ai.READ_MORE}`,this.handler()}handler(){switch(this.code){case exports.NativeCode.token_invalid:this.code=ni,this.message=ai.LOGIN_REQUIRED;break;case exports.NativeCode.not_permission:this.code=oi,this.message=ai.NOT_PERMISSION;break;case exports.NativeCode.client_not_support:this.code=ri,this.message=ai.CLIENT_NOT_SUPPORT;break;case exports.NativeCode.decode_failed:this.message=ai.DECODE_FAILED}}}const mi={handler:null,setHandler(e){this.handler=e}};mi.setHandler(((e,t)=>t instanceof vi?(t.api=e,t):new vi(-2001,Mt.isNull(t.message)?"Unknown Error":t.message,e)));const gi=(e,t,n)=>{const o=n.value;return n.value=function(...e){return i(this,void 0,void 0,(function*(){const{success:n,fail:r}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>i(this,void 0,void 0,(function*(){try{const t=yield o.apply(this,e);!Mt.isNull(n)&&Mt.isFunction(n)?n.call(null,t,this):a(t)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===ni||(null==e?void 0:e.code)===oi)){let t=!1;this instanceof oo&&(t=this.getLoginStatus()),t||(e=new vi(ni,ai.LOGIN_REQUIRED))}const{handler:i}=mi,n=i.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(n.toString()),!Mt.isNull(r)&&Mt.isFunction(r)?r.call(null,n,this):console.error("Error:",n)}}))))}))},n},yi=(e,t,i)=>{const n=i.value;return i.value=function(...e){try{return n.apply(this,e)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===ni||(null==e?void 0:e.code)===oi)){let t=!1;this instanceof oo&&(t=this.getLoginStatus()),t||(e=new vi(ni,ai.LOGIN_REQUIRED))}const{handler:i}=mi;!Mt.isNull(i)&&Mt.isFunction(i)?i.call(null,t,e,this):console.warn(e.message)}},i},_i=(e,t)=>({code:ei,message:t||ai.SUCCESS,data:e||{}}),Ei={badRequest:e=>new vi(ti,e),loginFailed:()=>new vi(ti,ai.LOGIN_FAILED),loginRequired:()=>new vi(ni,ai.LOGIN_REQUIRED),missingParam:e=>new vi(ti,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new vi(ti,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new vi(ii,"Can not get app info to share"),lengthInvalid:e=>new vi(ti,`${e} length is invalid.`)};const Si={encode:function(e){var t=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(void 0===n)return;if(null===n)return void t.push(i);t.push(encodeURIComponent(i)+"="+encodeURIComponent(n))}return t.join("&")},decode:function(e,t){var i={};if(""===e)return i;for(var n=e.split("&"),o=0;o<n.length;o++){var r=n[o].split("=",2),a=decodeURIComponent(r[0]);if(t&&Object.prototype.hasOwnProperty.call(i,a))throw new URIError("Duplicate key: "+a);i[a]=2===r.length?decodeURIComponent(r[1]):null}return i},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Si.encode(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var i=e.split("=");i&&2==i.length&&(t[i[0]]=decodeURIComponent(i[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e?"undefined":typeof e))return e;var t=Object.keys(e),i=[];return t.map((function(t){var n=e[t],o=[t,n="object"==(void 0===n?"undefined":typeof n)?JSON.stringify(n):encodeURIComponent(n)].join("=");i.push(o)})),i.join("&")}},Ai=new RegExp("[\\u0300-\\u036f]","g"),Ti=new RegExp("[đ|Đ]","g"),bi=new RegExp("\\s","g"),Oi=xt("zmp:utils:common"),wi=e=>{try{new URL(e)}catch(e){return!1}return!0},Ni=()=>navigator.userAgent||navigator.vendor||window.opera,Pi=()=>{const e=Ni().toLowerCase();return{isWP:/iemobile/.test(e),isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}},Ci=e=>{const t=document.getElementsByTagName("meta");for(let i=0;i<t.length;i++)if(t[i].getAttribute("name")===e||t[i].getAttribute("property")===e)return t[i].getAttribute("content");return""},Ii=()=>{const e=Ni().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},ki=()=>{let e=Pi();return e.isWP?exports.PlatformType.wp:e.isAndroid?exports.PlatformType.android:e.isIOS?exports.PlatformType.iOS:exports.PlatformType.unknown},Ri=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&wi(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!wi(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},Bi=e=>(e=>{let t=Wt(e);return t||(t=zt(e),t)?t:Ut(e)})(e),Di=e=>{if(Mt.isObject(JSON)&&JSON.parse&&Mt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");return JSON.parse(t,((e,t)=>t))}return Mt.isObject(e)?e:new Function("return "+e)()},ji=e=>{if(Mt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var i=e.length,n=0;n<i;n++)t.push(ji(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+ji(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Li=()=>{try{const e=Number(Ii()),t=ki();return e>=li[t]}catch(e){return!0}},Mi=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"),xi=e=>{try{if(e){Oi(e);const t=e.replace(/\\/g,"").replace(/&#39;/g,"'");return Oi("formattedValue",t,JSON.parse(t),typeof JSON.parse(t)),JSON.parse(t)}return null}catch(t){return Oi("parse json error:",t),e}},Ui=(e,t,n,o,r,a)=>i(void 0,void 0,void 0,(function*(){const i=new URL(location.href),s=new URLSearchParams;let l=`${i.pathname}${i.search}`;a&&(l=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const c=new URL(`https://zalo.me/app/link${l}`);s.append("title",n),s.append("description",o||""),s.append("thumbnail",r),s.append("url",c.href),s.append("accessToken",t||"");const u=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),d=yield u.json();if(!d||0!==d.err)throw Ei.cannotGetShareInfo();return c.search=`${c.search}&zshareId=${d.data.shareId}`,Object.assign(Object.assign({},d.data),{shareableLink:c.href})})),Wi=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>Ri(i,e))):Ri(i,e)))return{error:!0,errorMessage:e};if(t){if(Array.isArray(null==t?void 0:t.values))return{error:!(null==t?void 0:t.values.includes(i)),errorMessage:null==t?void 0:t.values.toString()};if(Mt.isNumber(null==t?void 0:t.maxLength))return{error:(Mt.isString(i)||Mt.isArray(i))&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Mt.isNumber(null==t?void 0:t.min)&&Mt.isNumber(null==t?void 0:t.max))return{error:i<(null==t?void 0:t.min)||i>(null==t?void 0:t.max),errorMessage:`data must be in between ${null==t?void 0:t.min} and ${null==t?void 0:t.max}`};if(Mt.isNumber(null==t?void 0:t.min))return{error:i<(null==t?void 0:t.min),errorMessage:`data must >= ${null==t?void 0:t.min}`};if(Mt.isNumber(null==t?void 0:t.max))return{error:i>(null==t?void 0:t.max),errorMessage:`data must <= ${null==t?void 0:t.max}`};if(Mt.isRegExp(null==t?void 0:t.regex))return{error:!t.regex.test(i),errorMessage:"data must valid"}}return{error:!1}},zi=(e,t,n)=>i(void 0,void 0,void 0,(function*(){const i={appId:e,versionStatus:t};Mt.isUndefined(n)||(i.currentVersion=n);const o=Si.appendToUrl(`https://h5.zalo.me/${si}`,i),r=yield fetch(o,{credentials:"include"});if(r.ok){const e=yield r.json();if(e.err<0||!e.data)throw new Error(e);return{name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl,logoUrl:e.data.logoUrl}}throw new Error("Can't get app info")}));var Fi=d((function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,r=n.length,a=new Array(r);o<r;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,r,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,r),!0;case 6:return u.fn.call(u.context,t,n,o,r,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(d-1);p<d;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,o){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var s=this._events[r];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,r);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[r]=1===c.length?c[0]:c:a(this,r)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}));class Gi extends Fi{constructor(){super(),this.debug=xt("zmp:event-emitter")}static getInstance(){return Gi.instance||(Gi.instance=new Gi),Gi.instance}h5ConfirmHandleEvent(e,t,i){ZaloJavaScriptInterface.jsH5EventCallback(e,t,i||"")}on(e,t,i){this.debug(`register ${e}: ${i}`);return super.on(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}once(e,t,i){this.debug(`register once ${e}: ${i}`);return super.once(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}}var Hi={},$i=function(e,t,i){var n=t||"default";return function(){var t=n in Hi?Hi[n](e,i):e;return t.apply(this,arguments)}};$i.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];Hi[t]=e};var Vi={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Zi(e){try{return null===e?Vi:JSON.parse(e)}catch(e){return Vi}}var Ji,Ki={execute:function(e,t,i,n){i.suppress_http_code=1;var o=Si.encode(i);"post"!=t&&(e=Si.appendToUrl(e,o),o="");var r=function(e,t){if(!self.XMLHttpRequest)return null;var i=new XMLHttpRequest,n=function(){};if(!("withCredentials"in i))return null;i.open(e,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded");var o={send:function(e){i.send(e)}},r=$i((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=$i((function(){a=n,"onerror"in o&&o.onerror(i)}),"entry","XMLHttpRequest:error");return i.onload=function(){r()},i.onerror=function(){a()},i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r():a())},o}(t,e);return!!r&&(r.onload=function(e){n(Zi(e.responseText))},r.onerror=function(e){e.responseText?n(Zi(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class Qi extends Fi{constructor(){super(),this.debug=xt("zmp:ZaloJSBridge"),this.events=Gi.getInstance(),this._accessTk=Bi("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=Bi("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=Ni(),this._device=Pi(),this._jsCallFuncCallbacks={},this.events.on(exports.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3)}static getInstance(){return Qi.instance||(Qi.instance=new Qi),Qi.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{Ki.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Di(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Di(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n)}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=xi(i);this.debug(n);const o=this.handleEventData(t,n);this.events.emit(t,e,o)}handleEventData(e,t){try{switch(e){case exports.Events.OpenApp:const{url:e}=t,i=new URL(e),n=i.pathname.split(`/zapps/${Gt}`)[1];return{path:`${n||"/"}${i.search}`};default:return t}}catch(e){return t}}defaultCallback(e){null!=e&&(e=Di(e))}jsCall(e,t,i,n=!1,o=3,r=!0){try{const a=e.name,s=((e="")=>`${e.normalize("NFD").replace(Ai,"").replace(Ti,"d").replace(bi,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(a);if(!this._device.isMobile||Mt.isEmpty(a))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a}),!1;null==t&&(t={}),i||(i=this.defaultCallback);const l={error_code:-14,error_message:"Request Timeout!",data:{},action:a};this._jsCallFuncCallbacks[s]={timeout:r&&e.have_callback&&setTimeout((()=>{this.onJSCall(s,l)}),8e3),callback:i};try{return t=ji(t),n?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onJSCall('${s}')`)}catch(r){if(!(o-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a,js_error:r};return this.onJSCall(s,e),!1}setTimeout((()=>{this.jsCall(e,t,i,n,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class qi{constructor(){this.debug=xt("zmp:ZJSBridgeProvider"),Ji.set(this,void 0),o(this,Ji,Qi.getInstance(),"f")}setZAccSession(e){n(this,Ji,"f").accessTk=e}setJSToken(e){n(this,Ji,"f").jsAccessTk=e}callNative(e,t,o){return this.debug(e.name,t),new Promise(((r,a)=>{const s=n=>i(this,void 0,void 0,(function*(){try{const i=new fi(n.error_code,`${n.action}: ${n.error_message}`);if(null==o?void 0:o.callback){const e=yield o.callback(n,i);return r(e)}if(n&&n.error_code>=0)r(n.data||{});else if(n&&n.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e.name}: call native fail`,{extra:{data:t,rs:n}})}catch(e){}return a(i)}}catch(e){return a(e)}})),l=Pi().isIOS,c=(e=>{var t;const i=Ii(),n=(null===(t=null==e?void 0:e.version_live)||void 0===t?void 0:t.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e.name))||i>=n})(e);if(l&&!c){const t=new fi(-5,`${e}: Client isn't support this action`);return a(t)}(null==o?void 0:o.delay)?setTimeout((()=>{n(this,Ji,"f").jsCall(e,t,s,null==o?void 0:o.isMultiCallback,null==o?void 0:o.nRetry,null==o?void 0:o.haveTimeout)}),o.delay):n(this,Ji,"f").jsCall(e,t,s,null==o?void 0:o.isMultiCallback,null==o?void 0:o.nRetry,null==o?void 0:o.haveTimeout)}))}}Ji=new WeakMap;var Yi,Xi,en,tn,nn;class on{static getVersion(){return"2.18.5-rc.1"}static getSystemInfo(){return{version:Ci("version-id")||"",apiVersion:"2.18.5-rc.1",zaloVersion:Ii(),platform:ki(),language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}static getAppInfo(){return i(this,void 0,void 0,(function*(){const e=this.getAppId(),t=this.getSystemInfo();return yield zi(e,0,t.version)}))}}class rn{static setNavigationBarTitle(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return i(this,void 0,void 0,(function*(){const t={};let i;Mt.isEmpty(e.textColor)||(t.textColor=e.textColor),Mt.isString(e.color)&&e.color.length>0?(Mt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Mt.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i=6),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{actionbarType:i,dataConfig:Object.assign(Object.assign({},e.dataConfig),t)}))),yield this.callNative(Xt.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e){return i(this,void 0,void 0,(function*(){const t="none"===e.type||"home"===e.type?di:ui,i="home"===e.type||"both"===e.type?pi:hi;this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:t,dataConfig:Object.assign(Object.assign({},e.dataConfig),{viewInLeftType:t}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:i})}))),yield this.callNative(Xt.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.CREATE_OPTIONS_MENU,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class an{static setBackgroundColor(e){return i(this,void 0,void 0,(function*(){Mt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(Xt.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class sn{constructor(e,t,i,n){this.title=n,this.severity=t;const o=new Date;if(this.time=o.toLocaleTimeString(),this.content=e,i>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}Yi=new WeakMap,Xi=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap;const ln=new class{constructor(){Yi.set(this,3),Xi.set(this,["none","error","warn","info"]),en.set(this,"[zmp] > "),tn.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),nn.set(this,((e,t,i)=>{n(this,tn,"f")[n(this,Xi,"f")[e]]++;const r=n(this,Xi,"f")[e];if(o(this,en,n(this,en,"f")+("string"!=typeof t?new sn(t,r,e,i).toString():t),"f"),!(e>n(this,Yi,"f")))switch(e){case 1:console.error(n(this,en,"f"));break;case 2:console.warn(n(this,en,"f"));break;case 3:console.info(n(this,en,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){o(this,Yi,e,"f")}info(e){n(this,nn,"f").call(this,3,e)}warn(e,t){n(this,nn,"f").call(this,2,e,t)}error(e,t){n(this,nn,"f").call(this,1,e,t)}getMetrics(){return n(this,tn,"f")}};class cn{static setDeviceOrientation(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.CHANGE_AUTOROTATE,{autoRotate:exports.OrientationType[e.rotate]})}))}static getNetworkType(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((e=>{const t=e.network;let i;const n=Pi().isAndroid;switch(t){case Yt(n).NONE:i=exports.NetworkType.none;break;case Yt(n).WIFI:i=exports.NetworkType.wifi;break;case Yt(n)["2G"]:case Yt(n)["3G"]:case Yt(n)["4G"]:i=exports.NetworkType.cellular;break;default:i=exports.NetworkType.unknown}return{networkType:i}}))}))}static onNetworkStatusChange(e){return i(this,void 0,void 0,(function*(){yield this.events.on(exports.Events.NetworkChanged,(t=>{const i=t&&t.state;this.getNetworkType().then((t=>{const n={isConnected:"CONNECTED"===i,networkType:t&&t.networkType};e(n)})).catch((e=>{ln.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,n,o,r,a;return i(this,void 0,void 0,(function*(){const i={subaction:0,scanning_type:Mt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Mt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Mt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Mt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Mt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Mt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Mt.isNumber(null===(n=null==e?void 0:e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Mt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Mt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Mt.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.callNative(Xt.SCAN_IBEACON,Object.assign({},i)),!0}))}static stopBeaconDiscovery(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.SCAN_IBEACON,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const i={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(i)})),t}))}))}static stopBluetoothDevicesDiscovery(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothDeviceFound(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothAdapterStateChange(){return i(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return i(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.callNative({name:""},t)}))}static getBluetoothDevices(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static getBluetoothAdapterState(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static closeBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static scanQRCode(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.HIDE_KEYBOARD,{})}))}static openPhone(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.PROMPT_AUTHENTICATION,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,i,n,o;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.error_code,message:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_message,payToken:null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.pay_token}}}))}))}static checkStateBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.PROMPT_AUTHENTICATION_CHECK_STATE,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.INTERACTIVE_VIBRATION,{type:exports.VibrateType[e.type],vibrate_time:e.milliseconds})}))}static connectWifi(e){return i(this,void 0,void 0,(function*(){let t="open";return Mt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.callNative(Xt.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}}var un,dn,pn,hn,vn,fn,mn,gn,yn,_n,En,Sn,An,Tn,bn,On,wn,Nn,Pn,Cn,In,kn,Rn,Bn,Dn,jn,Ln,Mn;class xn{constructor(e){un.set(this,localStorage),dn.set(this,void 0),pn.set(this,void 0),Pi(),o(this,pn,{keys:new Set,currentSize:0,limitSize:5242880},"f"),o(this,dn,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in n(this,un,"f")){if(e){if(t.split("_")[0]!==e)continue}n(this,pn,"f").keys.add(t)}}catch(e){ln.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return n(this,dn,"f")&&(e=`${n(this,dn,"f")}_${e}`),n(this,pn,"f").keys.has(e)?n(this,un,"f").getItem(e):null}set(e){return i(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){n(this,dn,"f")&&(e=`${n(this,dn,"f")}_${e}`),n(this,un,"f").setItem(e,t),n(this,pn,"f").keys.add(e)}getInfo(){return i(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let i,n,o=0;for(n in e){const r=n.split("_")[0];e.hasOwnProperty(n)&&(t&&r!==t||(i=2*(e[n].length+n.length),o+=i))}return o})(n(this,un,"f"),n(this,dn,"f"));return{currentSize:Mt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number(5120..toFixed(2))}}remove(e){return i(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){n(this,dn,"f")&&(e=`${n(this,dn,"f")}_${e}`),n(this,pn,"f").keys.has(e)&&(n(this,un,"f").removeItem(e),n(this,pn,"f").keys.delete(e))}clear(){return i(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){n(this,pn,"f").keys.forEach((e=>{n(this,dn,"f")&&e.indexOf(n(this,dn,"f"))<0||(n(this,un,"f").removeItem(e),n(this,pn,"f").keys.delete(e))}))}}un=new WeakMap,dn=new WeakMap,pn=new WeakMap;class Un extends qi{constructor(e){super(),hn.set(this,void 0),vn.set(this,void 0),o(this,vn,{keys:new Set,currentSize:0,limitSize:5242880},"f"),o(this,hn,e,"f")}get(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return i(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return i(this,void 0,void 0,(function*(){const e=yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:Mt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return i(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:n(this,hn,"f")})}))}}hn=new WeakMap,vn=new WeakMap;class Wn{getDataFromStorage(e){return i(this,void 0,void 0,(function*(){const t=this.getInstance(),i=yield t.get(e),n={};return i.forEach(((e,t)=>{n[t]=xi(e)})),n}))}putDataToStorage(e){return i(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Mt.isUndefined(t)||Mt.isNull(t)||(i[e]=Mi(t))})),yield t.set(i)}))}removeDataFromStorage(e){return i(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return i(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return i(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class zn extends Wn{constructor(e){super(),fn.set(this,void 0),o(this,fn,e,"f")}getInstance(){return new xn(n(this,fn,"f"))}}fn=new WeakMap;class Fn extends Wn{constructor(e){super(),mn.set(this,void 0),o(this,mn,e,"f")}getInstance(){return new Un(n(this,mn,"f"))}}mn=new WeakMap;class Gn{static setStorage(e){return i(this,void 0,void 0,(function*(){let t=new zn(this.getAppId());return Li()&&(t=new Fn(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return i(this,void 0,void 0,(function*(){let t=new zn(this.getAppId());Li()&&(t=new Fn(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return i(this,void 0,void 0,(function*(){let e=new zn(this.getAppId());return Li()&&(e=new Fn(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return i(this,void 0,void 0,(function*(){let t=new zn(this.getAppId());return Li()&&(t=new Fn(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return i(this,void 0,void 0,(function*(){let e=new zn(this.getAppId());Li()&&(e=new Fn(this.getAppId())),yield e.clearStorage()}))}}class Hn{static getUserInfo(e){return i(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let n="id,name,picture";(null==e?void 0:e.avatarType)&&(n=`${n}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${Jt}?fields=${n}`,{headers:{access_token:t||""}}).then((e=>i(this,void 0,void 0,(function*(){const t=yield e.json(),i={id:t.id,name:t.name,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.MP_GET_NUMBER,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}}class $n{static closeApp(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.WINDOW_CLOSE,{})}))}static openMiniApp(e){return i(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,i=(null==e?void 0:e.params)||{},n=Object.entries(i).map((function([e,t]){return[e,t].join("=")})).join("&"),o=yield zi(t,0);yield this.callNative(Xt.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:{appId:t,appAvtUrl:o.logoUrl||"",appName:o.name||""}})}))}static openWebview(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.OPEN_INAPP,{url:e.url})}))}static closeLoading(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class Vn{static getLocation(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.GET_LOCATION,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,callback:(e,t)=>{if(0===e.error_code){const t=e.data,i={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(i)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class Zn{static requestCameraPermission(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.REQUEST_PERMISSION_CAMERA,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return i(this,void 0,void 0,(function*(){let t={};return Mt.isEmpty(e.imageBase64Data)?Mt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.callNative(Xt.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class Jn{static viewOAQr(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.VIEW_MYQR,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_PROFILE,{uId:e.id,type:exports.ProfileType[e.type],zapp:this.getZAppId(),sourceId:e.sourceId,sourceIndex:e.sourceIndex})}))}static openChat(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_CHAT,{uId:e.id,type:exports.ChatType[e.type],zapp:this.getZAppId(),sourceId:e.sourceId,sourceIndex:e.sourceIndex})}))}static openPostFeed(e){return i(this,void 0,void 0,(function*(){let t={};switch(e.type){case"image":t={photoUrl:e.data.imageUrl};break;case"link":t={link:e.data.link,title:e.data.title,thumb:e.data.thumb,description:e.data.description};break;case"profile":t={avt:e.data.avatar,uid:e.data.id,dpn:e.data.displayName}}return yield this.callNative(Xt.OPEN_POSTFEED,Object.assign(Object.assign({type:exports.PostFeedType[e.type]},t),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.FOLLOW_OA,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(e){return i(this,void 0,void 0,(function*(){let t={};switch(e.type){case"image":let i=[];Array.isArray(e.data.imageUrls)&&e.data.imageUrls.length>0?i=e.data.imageUrls:i.push(e.data.imageUrl),t={photoUrls:i,photoUrl:e.data.imageUrl,caption:e.data.caption};break;case"gif":t={photoUrl:e.data.imageUrl,gifUrl:e.data.gifUrl,width:e.data.width,height:e.data.height};break;case"video":t={videoThumb:e.data.videoThumb,videoUrl:e.data.videoUrl,width:e.data.width,height:e.data.height};break;case"link":t={link:e.data.link,chatOnly:e.data.chatOnly?1:0};break;case"oa":t={uid:e.data.id};break;case"zmp":const n=yield this.getAccessToken(),o=yield Ui(this.getAppId(),n||"",e.data.title||"",e.data.description||"",e.data.thumbnail||"",e.data.path);window.forceShareZMP?t={data:{ZInstantAPIInfo:{url:`${o.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${o.shareId}`},previewMsgText:{msg:{en:"Mini App",vi:"Chương trình nhỏ"}},enableReactions:1}}:(t={link:o.shareableLink,chatOnly:e.data.chatOnly?1:0},e.type="link")}return yield this.callNative(Xt.OPEN_SHARESHEET,Object.assign(Object.assign({type:exports.ShareSheetType[e.type]},t),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e,t,n){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.CREATE_SHORTCUT,{url:e,title:t,iconUrl:n})}))}static openProfilePicker(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,callback:(e,t)=>0===e.error_code&&Array.isArray(e.data)?Promise.resolve(e.data.map((e=>e.id))):Promise.reject(t)})}))}static getActionsSupported(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,callback:(e,t)=>{const i=ki();if(Array.isArray(e.actions)&&e.actions.length>0){const t=Object.keys(Xt).filter((e=>Xt[e].skip_jump)),i={actions:[...e.actions,...t]};return Promise.resolve(i)}if(i===exports.PlatformType.iOS){const e={actions:ci};return Promise.resolve(e)}return Promise.reject(t)}})}))}static openMediaPicker(e,t,n,o){return i(this,void 0,void 0,(function*(){const i={type:0,url:"https://zapi-server.tungnt.xyz/upload/photos",maxSize:1048576};return yield this.callNative(Xt.PICK_MEDIA,{media_type:exports.MediaPickerType[e],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),t),silent_request:n,upload:i,max_select_item:o},{isMultiCallback:!0,callback:(e,t)=>{var i,n;if(0===e.error_code){const t=xi(null===(i=e.data)||void 0===i?void 0:i.result_content),o={urls:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.urls};return Promise.resolve(o)}return Promise.reject(t)}})}))}static openOutApp(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_OUTAPP,{url:e})}))}}class Kn{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=Si.getParamsAsObject(i))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.WEBVIEW_SET_RESULT,{result:Mi(e.data)})}))}static onCallbackData(e){return i(this,void 0,void 0,(function*(){yield this.events.on(exports.Events.OnDataCallback,(t=>{e({data:t})}))}))}}class Qn extends qi{constructor(){var e,t,i,r,a,s,l,c,u,d,p,h,v,f,m,g,y;super(),gn.set(this,Ft),yn.set(this,Gt),_n.set(this,Ht),En.set(this,void 0),Sn.set(this,void 0),An.set(this,void 0),Tn.set(this,null),bn.set(this,{timer:{getToken:0}}),On.set(this,void 0),wn.set(this,void 0),Nn.set(this,null),this.events=Gi.getInstance(),this.isIOS=Pi().isIOS,Pn.set(this,void 0),this.getActionBarConfig=()=>n(this,Pn,"f"),this.setActionBarConfig=e=>{o(this,Pn,e(n(this,Pn,"f")),"f")},Cn.set(this,(()=>new Promise(((e,t)=>{Mt.isUndefined(n(this,Nn,"f"))||Mt.isNull(n(this,Nn,"f"))?this.callNative(Xt.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=i.find((e=>e.name===Vt));n&&(this.setJSToken(n.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(n.value)),o(this,Nn,i,"f"),e(i)})).catch((e=>{t(e)})):e(n(this,Nn,"f"))})))),In.set(this,rn.setNavigationBarRightButton),this.getVersion=on.getVersion,this.getSystemInfo=on.getSystemInfo,this.setNavigationBarTitle=rn.setNavigationBarTitle,this.setNavigationBarColor=rn.setNavigationBarColor,this.setNavigationBarLeftButton=rn.setNavigationBarLeftButton,this.setBackgroundColor=an.setBackgroundColor,this.setDeviceOrientation=cn.setDeviceOrientation,this.setStorage=Gn.setStorage,this.getStorage=Gn.getStorage,this.getStorageInfo=Gn.getStorageInfo,this.removeStorage=Gn.removeStorage,this.clearStorage=Gn.clearStorage,this.getUserInfo=Hn.getUserInfo,this.getNetworkType=cn.getNetworkType,this.onNetworkStatusChange=cn.onNetworkStatusChange,this.startBeaconDiscovery=cn.startBeaconDiscovery,this.stopBeaconDiscovery=cn.stopBeaconDiscovery,this.getBeacons=cn.getBeacons,this.closeApp=$n.closeApp,this.getLocation=Vn.getLocation,this.stopBluetoothDevicesDiscovery=cn.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=cn.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=cn.openBluetoothAdapter,this.onBluetoothDeviceFound=cn.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=cn.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=cn.getConnectedBluetoothDevices,this.getBluetoothDevices=cn.getBluetoothDevices,this.getBluetoothAdapterState=cn.getBluetoothAdapterState,this.closeBluetoothAdapter=cn.closeBluetoothAdapter,this.scanQRCode=cn.scanQRCode,this.openProfile=Jn.openProfile,this.openChat=Jn.openChat,this.openPostFeed=Jn.openPostFeed,this.followOA=Jn.followOA,this.unFollowOA=Jn.unfollowOA,this.openShareSheet=Jn.openShareSheet,this.requestCameraPermission=Zn.requestCameraPermission,this.createShortcut=Jn.createShortcut,this.openBioAuthentication=cn.openBioAuthentication,this.checkStateBioAuthentication=cn.checkStateBioAuthentication,this.sendLocation=Vn.sendLocation,this.showToast=cn.showToast,this.hideKeyboard=cn.hideKeyboard,this.openPhone=cn.openPhone,this.openSMS=cn.openSMS,this.viewOAQr=Jn.viewOAQr,this.keepScreen=cn.keepScreen,this.saveImageToPhotosAlbum=Zn.saveImageToPhotosAlbum,this.openMiniApp=$n.openMiniApp,this.vibrate=cn.vibrate,this.openWebview=$n.openWebview,this.getRouteParams=Kn.getRouteParams,this.getAppInfo=on.getAppInfo,this.sendDataToPreviousMiniApp=Kn.sendDataToPreviousMiniApp,this.onCallbackData=Kn.onCallbackData,this.getPhoneNumber=Hn.getPhoneNumber,this.openProfilePicker=Jn.openProfilePicker,kn.set(this,Jn.getActionsSupported),this.connectWifi=cn.connectWifi,this.openMediaPicker=Jn.openMediaPicker,this.openOutApp=Jn.openOutApp,this.closeLoading=$n.closeLoading,o(this,En,null,"f"),o(this,Sn,null,"f"),o(this,An,null,"f"),this.isShowNavBar=!0,o(this,On,0,"f"),o(this,wn,0,"f");const _="home"===(null===(t=null===(e=n(this,_n,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(r=null===(i=n(this,_n,"f"))||void 0===i?void 0:i.app)||void 0===r?void 0:r.leftButton)?pi:hi,E=new URL(location.href),S=Mt.isString(null===(s=null===(a=n(this,_n,"f"))||void 0===a?void 0:a.app)||void 0===s?void 0:s.headerColor)&&(null===(u=null===(c=null===(l=n(this,_n,"f"))||void 0===l?void 0:l.app)||void 0===c?void 0:c.headerColor)||void 0===u?void 0:u.length)>0?5:6,A="none"===(null===(p=null===(d=n(this,_n,"f"))||void 0===d?void 0:d.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(v=null===(h=n(this,_n,"f"))||void 0===h?void 0:h.app)||void 0===v?void 0:v.leftButton)?di:ui;o(this,Pn,{actionbarType:S,buttonType:A,dataConfig:{backgroundColor:(null===(m=null===(f=n(this,_n,"f"))||void 0===f?void 0:f.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(y=null===(g=n(this,_n,"f"))||void 0===g?void 0:g.app)||void 0===y?void 0:y.textColor)||"",viewInLeftType:A,confirmToExit:1},homeConfig:{enable:_,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return Qn.instance||(Qn.instance=new Qn),Qn.instance}getLoginStatus(){return Mt.isString(n(this,An,"f"))&&n(this,An,"f").length>0}getAppId(){return n(this,yn,"f")}getZAppId(){return n(this,gn,"f")}login(e){return i(this,void 0,void 0,(function*(){const e=yield n(this,Cn,"f").call(this),t=e.find((e=>e.name===$t)),i=e.find((e=>e.name===Zt));if(!Mt.isUndefined(t)&&!Mt.isNull(t)&&Mt.isString(t.value)){if(o(this,En,t.value,"f"),Mt.isUndefined(i)||Mt.isNull(i)||!Mt.isString(i.value)?yield this.loginZaloV3():(o(this,Sn,i.value,"f"),yield this.loginZaloV4()),!n(this,An,"f"))throw Ei.loginFailed();return n(this,An,"f")}throw Ei.loginFailed()}))}loginZaloV3(){return i(this,void 0,void 0,(function*(){return yield fetch(`${Qt}?app_id=${n(this,gn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${n(this,yn,"f")}/&code=${n(this,En,"f")}&isSDK=true123`).then((e=>i(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){o(this,An,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return o(this,wn,e,"f"),o(this,On,(new Date).getTime(),"f"),this.setZAccSession(n(this,An,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n(this,An,"f")||""),n(this,An,"f")}return null}))))}))}loginZaloV4(){return i(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",n(this,yn,"f")),e.append("code",n(this,En,"f")||""),e.append("code_verifier",n(this,Sn,"f")||""),Mt.isNull(n(this,Tn,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",n(this,Tn,"f")||""));return yield fetch(Kt,Object.assign({method:"POST",body:e},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).then((e=>i(this,void 0,void 0,(function*(){const t=yield e.json();if(t.refresh_token&&o(this,Tn,t.refresh_token,"f"),t.access_token){o(this,An,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return o(this,wn,e,"f"),o(this,On,(new Date).getTime(),"f"),this.setZAccSession(n(this,An,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n(this,An,"f")||""),n(this,An,"f")}return null}))))}))}getAccessToken(e){return i(this,void 0,void 0,(function*(){const e=(new Date).getTime()-n(this,On,"f");if(!n(this,An,"f"))throw Ei.loginRequired();return e<n(this,wn,"f")?n(this,An,"f"):yield this.login()}))}}gn=new WeakMap,yn=new WeakMap,_n=new WeakMap,En=new WeakMap,Sn=new WeakMap,An=new WeakMap,Tn=new WeakMap,bn=new WeakMap,On=new WeakMap,wn=new WeakMap,Nn=new WeakMap,Pn=new WeakMap,Cn=new WeakMap,In=new WeakMap,kn=new WeakMap;class qn{constructor(){Rn.set(this,Ft),Bn.set(this,Ht),Dn.set(this,"DEFAULT ZOAUTH"),jn.set(this,"DEFAULT ACCESS TOKEN"),Ln.set(this,{timer:{getToken:0}}),Mn.set(this,!1),this.getLoginStatus=()=>n(this,Mn,"f"),this.getAppId=()=>n(this,Rn,"f"),this.login=()=>(o(this,Mn,!0,"f"),Promise.resolve(n(this,Dn,"f"))),this.getAccessToken=()=>Promise.resolve(n(this,jn,"f")),this.getVersion=on.getVersion,this.getSystemInfo=on.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>i(this,void 0,void 0,(function*(){const t=new zn(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>i(this,void 0,void 0,(function*(){const t=new zn(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>i(this,void 0,void 0,(function*(){const e=new zn(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>i(this,void 0,void 0,(function*(){const t=new zn(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>i(this,void 0,void 0,(function*(){const e=new zn(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let e;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":e=exports.NetworkType.none;break;case"4g":e=exports.NetworkType.wifi;break;case"3g":case"2g":e=exports.NetworkType.cellular;break;default:e=exports.NetworkType.unknown}const t={networkType:e};return Promise.resolve(t)},this.onNetworkStatusChange=e=>{const t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=t.effectiveType;return t.addEventListener("change",(function(){let t;switch(i){case"none":t=exports.NetworkType.none;break;case"4g":t=exports.NetworkType.wifi;break;case"3g":case"2g":t=exports.NetworkType.cellular;break;default:t=exports.NetworkType.unknown}e({isConnected:!0,networkType:t})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e.url),Promise.resolve()),this.getRouteParams=Kn.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve([])),this.connectWifi=()=>(console.warn("This api only works on zalo app"),Promise.resolve()),this.openOutApp=e=>(location.href=e,Promise.resolve()),this.closeLoading=e=>Promise.resolve()}on(e,t,i){throw new Error("Method not implemented.")}once(e,t,i){throw new Error("Method not implemented.")}off(e,t,i,n){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}openMediaPicker(e,t,i,n){return console.warn("This api only works on zalo app"),Promise.resolve({urls:[]})}}Rn=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap;const Yn=Symbol("required"),Xn=Symbol("checkType"),eo=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(Yn,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(Yn,r,i,n)},to=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(Xn,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(Xn,a,n,o)};const io=(e,t,i)=>{const n=i.value,o=n.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return i.value=function(){const i=Reflect.getOwnMetadata(Yn,e,t),r=Reflect.getOwnMetadata(Xn,e,t);return r&&r.forEach((e=>{const{parameterIndex:t,type:i,properties:n,defaultValue:r}=e;let a=arguments[t],s=o[t];const l=typeof a;if(!Mt.isUndefined(a)){if(!Ri(a,i))throw Ei.wrongTypeParam(s,i,Array.isArray(a)?"array":null===a?"null":l);"object"===i&&Object.entries(n).forEach((([e,i])=>{const n=e.split("?")[0],o=Mt.get(a,n);if(Mt.isUndefined(o)||Mt.isNull(o)){if(!e.includes("?"))throw Ei.missingParam(e);Mt.isObject(Mt.get(a,n.split(".")[0]))&&r&&!Mt.isUndefined(Mt.get(r,n))&&Mt.set(arguments[t],n,Mt.get(r,n))}else if(Mt.isFunction(i)){const e=i(o);if(e&&e.error)throw Ei.wrongTypeParam(`${s}.${n}`,e.errorMessage,typeof o)}}))}})),i&&i.forEach((e=>{const{parameterIndex:t,option:i,fields:n}=e,o=arguments[t],r=null==i?void 0:i.if,a=null==i?void 0:i.defaultValue;let s=!0;r&&(s=Object.keys(r).every((e=>Mt.get(o,e)===r[e]))),s&&n.forEach((e=>{const i=e=>{let i=!1;return Mt.isEmpty(Mt.get(o,e))&&(Mt.isUndefined(Mt.get(a,e))||Mt.set(arguments[t],e,Mt.get(a,e)),i=!0),i};if(Array.isArray(e)&&e.length>0&&e.every(i))throw Ei.missingParam(e.join(" or "));if(Mt.isString(e)&&i(e))throw Ei.missingParam(e)}))})),n.apply(this,arguments)},i};var no;class oo{constructor(){this.events=Gi.getInstance(),no.set(this,void 0),o(this,no,this.getServiceInstance(),"f"),this.events.addListener=(e,t,i)=>{const n=e;return this.events.addListener(exports.Events[n],t,i)}}login(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").login(e)}))}getLoginStatus(){return n(this,no,"f").getLoginStatus()}getAccessToken(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getAccessToken(e)}))}getVersion(){return n(this,no,"f").getVersion()}getSystemInfo(){return n(this,no,"f").getSystemInfo()}setNavigationBarTitle(e){return i(this,void 0,void 0,(function*(){return n(this,no,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setDeviceOrientation(e)}))}setStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setStorage(e)}))}getStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getStorage(e)}))}getStorageInfo(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getStorageInfo(e)}))}removeStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").removeStorage(e)}))}clearStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").clearStorage(e)}))}getUserInfo(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getUserInfo(e)}))}getNetworkType(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getBeacons(e)}))}closeApp(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").closeApp(e)}))}getLocation(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").closeBluetoothAdapter()}))}scanQRCode(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").scanQRCode(e)}))}openProfile(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openProfile(e)}))}openChat(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openChat(e)}))}openPostFeed(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openPostFeed(e)}))}followOA(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").followOA(e)}))}unfollowOA(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").unFollowOA(e)}))}openShareSheet(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openShareSheet(e)}))}requestCameraPermission(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").requestCameraPermission(e)}))}createShortcut(e){return i(this,void 0,void 0,(function*(){const t=yield zi(Gt,0),i=Pi().isIOS,o=t.logoUrl||Ci("og:image:url")||"",r=t.name||document.title,a=e.params?new URLSearchParams(e.params):new URLSearchParams;if(a.append("utm_source","zalo-shortcut"),a.append("utm_medium","default"),a.append("utm_campaign","default"),i){a.append("appId",Gt),a.append("appName",r),a.append("appIcon",o);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield n(this,no,"f").openOutApp(encodeURI(e))}else yield n(this,no,"f").createShortcut(`https://zalo.me/app/link/zapps/${Gt}/?${a.toString()}`,r,o);return _i()}))}openBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").sendLocation(e)}))}showToast(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").showToast(e)}))}hideKeyboard(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").hideKeyboard(e)}))}openPhone(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openPhone(e)}))}openSMS(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openSMS(e)}))}viewOAQr(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").viewOAQr(e)}))}keepScreen(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").keepScreen(e)}))}saveImageToGallery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return i(this,void 0,void 0,(function*(){if(!Mt.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield n(this,no,"f").openMiniApp(e)}))}vibrate(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").vibrate(e)}))}openWebview(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openWebview(e)}))}getRouteParams(){return n(this,no,"f").getRouteParams()}getAppInfo(e){return n(this,no,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return n(this,no,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onCallbackData(e)}))}getPhoneNumber(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getPhoneNumber()}))}openProfilePicker(e){return i(this,void 0,void 0,(function*(){const t=yield n(this,no,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(qt,{method:"POST",headers:{"Content-Type":"application/json",access_token:e||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})}),o=yield n.json();if(0!==o.error||!o.data)throw new Error(o.message);i=t.map((e=>{var t,i,n,r,a,s,l,c,u;return{id:e,profile:{name:null===(i=null===(t=o.data[e])||void 0===t?void 0:t.user_info)||void 0===i?void 0:i.name,avatar:null===(s=null===(a=null===(r=null===(n=o.data[e])||void 0===n?void 0:n.user_info)||void 0===r?void 0:r.picture)||void 0===a?void 0:a.data)||void 0===s?void 0:s.url},code:0!==(null===(l=o.data[e])||void 0===l?void 0:l.error)?-1:0,message:`Get profile: ${Mt.isUndefined(null===(c=o.data[e])||void 0===c?void 0:c.message)?"Unknown error":null===(u=o.data[e])||void 0===u?void 0:u.message}`}}))}catch(e){i=t.map((t=>({id:t,profile:{name:"",avatar:""},code:-1,message:`Can't get profile: ${e.message}`})))}return{users:i||[]}}))}connectWifi(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").connectWifi(e)}))}openMediaPicker(e){var t,o,r;return i(this,void 0,void 0,(function*(){const i={};Mt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(o=e.editView)||void 0===o?void 0:o.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio;const a=!0===e.silentRequest?1:0,s=e.maxSelectItem;return yield n(this,no,"f").openMediaPicker(e.type,i,a,s)}))}getShareableLink(e){return i(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return(yield Ui(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)).shareableLink}))}closeLoading(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").closeLoading("user action")}))}}no=new WeakMap,e([gi],oo.prototype,"login",null),e([yi],oo.prototype,"getLoginStatus",null),e([gi],oo.prototype,"getAccessToken",null),e([yi],oo.prototype,"getVersion",null),e([yi],oo.prototype,"getSystemInfo",null),e([gi,io,t(0,to("object",{title:Wi("string")}))],oo.prototype,"setNavigationBarTitle",null),e([gi,io,t(0,to("object",{color:Wi("string"),"textColor?":Wi("string",{values:["white","black"]}),"statusBarColor?":Wi("string")}))],oo.prototype,"setNavigationBarColor",null),e([gi,io,t(0,to("object",{backgroundColor:Wi("string"),"textColor?":Wi("string",{values:["white","black"]})}))],oo.prototype,"setBackgroundColor",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["none","back","home","both"]})}))],oo.prototype,"setNavigationBarLeftButton",null),e([gi,io,t(0,to("object",{rotate:Wi("string",{values:["auto","portrait","landscape"]})}))],oo.prototype,"setDeviceOrientation",null),e([gi,io,t(0,to("object",{data:Wi("object")}))],oo.prototype,"setStorage",null),e([gi,io,t(0,to("object",{keys:Wi("array<string>")}))],oo.prototype,"getStorage",null),e([gi],oo.prototype,"getStorageInfo",null),e([gi,io,t(0,to("object",{keys:Wi("array<string>")}))],oo.prototype,"removeStorage",null),e([gi],oo.prototype,"clearStorage",null),e([gi,io,t(0,to("object",{"avatarType?":Wi("string",{values:["small","normal","large"]})}))],oo.prototype,"getUserInfo",null),e([gi],oo.prototype,"getNetworkType",null),e([gi],oo.prototype,"onNetworkStatusChange",null),e([gi],oo.prototype,"startBeaconDiscovery",null),e([gi],oo.prototype,"stopBeaconDiscovery",null),e([gi],oo.prototype,"getBeacons",null),e([gi],oo.prototype,"closeApp",null),e([gi],oo.prototype,"getLocation",null),e([gi],oo.prototype,"stopBluetoothDevicesDiscovery",null),e([gi],oo.prototype,"startBluetoothDevicesDiscovery",null),e([gi],oo.prototype,"openBluetoothAdapter",null),e([gi],oo.prototype,"onBluetoothDeviceFound",null),e([gi],oo.prototype,"onBluetoothAdapterStateChange",null),e([gi],oo.prototype,"getConnectedBluetoothDevices",null),e([gi],oo.prototype,"getBluetoothDevices",null),e([gi],oo.prototype,"getBluetoothAdapterState",null),e([gi],oo.prototype,"closeBluetoothAdapter",null),e([gi],oo.prototype,"scanQRCode",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["user","oa","aliasOA"]}),id:Wi("string")}))],oo.prototype,"openProfile",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["user","oa"]}),id:Wi("string")}))],oo.prototype,"openChat",null),e([gi,io,t(0,eo(["data.imageUrl"],{if:{type:"image"}})),t(0,eo(["data.link"],{if:{type:"link"}})),t(0,eo(["data.id"],{if:{type:"profile"}})),t(0,to("object",{type:Wi("string",{values:["image","link","profile"]}),data:Wi("object"),"data.imageUrl?":Wi("url"),"data.link?":Wi("url"),"data.title?":Wi("string"),"data.thumb?":Wi("url"),"data.description?":Wi("string"),"data.avatar?":Wi("url"),"data.id?":Wi("string"),"data.displayName?":Wi("string")}))],oo.prototype,"openPostFeed",null),e([gi,io,t(0,to("object",{id:Wi("string"),"showDialogConfirm?":Wi("boolean")}))],oo.prototype,"followOA",null),e([gi,io,t(0,to("object",{id:Wi("string")}))],oo.prototype,"unfollowOA",null),e([gi,io,t(0,eo([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),t(0,eo(["data.link"],{if:{type:"link"}})),t(0,eo(["data.id"],{if:{type:"oa"}})),t(0,eo(["data.gifUrl"],{if:{type:"gif"}})),t(0,eo(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),t(0,eo(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),t(0,to("object",{type:Wi("string",{values:["image","gif","video","link","oa","zmp"]}),data:Wi("object"),"data.imageUrl?":Wi("url"),"data.imageUrls?":Wi("array<url>",{maxLength:10}),"data.caption?":Wi("string"),"data.gifUrl?":Wi("url"),"data.width?":Wi("number"),"data.height?":Wi("number"),"data.videoThumb?":Wi("url"),"data.videoUrl?":Wi("url"),"data.link?":Wi("url"),"data.chatOnly?":Wi("boolean"),"data.id?":Wi("string"),"data.thumbnail?":Wi("url"),"data.path?":Wi("string"),"data.title?":Wi("string",{maxLength:100}),"data.description?":Wi(["string"],{maxLength:400})}))],oo.prototype,"openShareSheet",null),e([gi],oo.prototype,"requestCameraPermission",null),e([gi],oo.prototype,"createShortcut",null),e([gi,io,t(0,to("object",{secretData:Wi("string"),"ui?":Wi("object"),"ui.title?":Wi("string"),"ui.subTitle?":Wi("string"),"ui.negativeButtonText?":Wi("string"),"requireFingerprint?":Wi("boolean")},{requireFingerprint:!0,ui:{title:"Xác thực",subTitle:"Sử dụng sinh trắc học của bạn để xác thực",negativeButtonText:"Đóng"}}))],oo.prototype,"openBioAuthentication",null),e([gi],oo.prototype,"checkStateBioAuthentication",null),e([gi,io,t(0,to("object",{toUserId:Wi("string"),"title?":Wi("string")}))],oo.prototype,"sendLocation",null),e([gi,io,t(0,to("object",{message:Wi("string")}))],oo.prototype,"showToast",null),e([gi],oo.prototype,"hideKeyboard",null),e([gi,io,t(0,to("object",{phoneNumber:Wi("string")}))],oo.prototype,"openPhone",null),e([gi,io,t(0,to("object",{content:Wi("string"),phoneNumber:Wi("string",{regex:/^\+?\d+$/})}))],oo.prototype,"openSMS",null),e([gi,io,t(0,to("object",{id:Wi("string"),"displayName?":Wi("string")},{displayName:""}))],oo.prototype,"viewOAQr",null),e([gi],oo.prototype,"keepScreen",null),e([gi,io,t(0,to("object",{"imageBase64Data?":Wi("string"),"imageUrl?":Wi("url")}))],oo.prototype,"saveImageToGallery",null),e([gi,io,t(0,to("object",{"imageBase64Data?":Wi("string"),"imageUrl?":Wi("url")}))],oo.prototype,"saveImageToPhotosAlbum",null),e([gi,io,t(0,to("object",{appId:Wi("string"),"params?":Wi("object")}))],oo.prototype,"openMiniApp",null),e([gi,io,t(0,to("object",{"type?":Wi("string",{values:["oneShot"]}),"milliseconds?":Wi("number")},{type:"oneShot",milliseconds:500}))],oo.prototype,"vibrate",null),e([gi,io,t(0,to("object",{url:Wi("string")}))],oo.prototype,"openWebview",null),e([yi],oo.prototype,"getRouteParams",null),e([gi],oo.prototype,"getAppInfo",null),e([gi],oo.prototype,"sendDataToPreviousMiniApp",null),e([gi],oo.prototype,"onCallbackData",null),e([gi],oo.prototype,"getPhoneNumber",null),e([gi,io,t(0,to("object",{"maxProfile?":Wi("number",{min:1,max:10})},{maxProfile:1}))],oo.prototype,"openProfilePicker",null),e([gi,io,t(0,eo(["SSID"])),t(0,to("object",{SSID:Wi("string"),"password?":Wi("string"),"hiddenSSID?":Wi("boolean")}))],oo.prototype,"connectWifi",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["photo","video","file","multi_photo","multi_video"]}),"editView?":Wi("object"),"editView.enable?":Wi("boolean"),"editView.aspectRatio?":Wi("string",{regex:/^\d+:\d+$/}),"silentRequest?":Wi("boolean"),"maxSelectItem?":Wi("number",{min:1})}))],oo.prototype,"openMediaPicker",null),e([gi,io,t(0,to("object",{title:Wi("string",{maxLength:100}),"thumbnail?":Wi("url"),"path?":Wi("string"),description:Wi(["string"],{maxLength:400})},{description:""}))],oo.prototype,"getShareableLink",null),e([gi,io],oo.prototype,"closeLoading",null);class ro extends oo{getServiceInstance(){return Qn.getInstance()}}class ao extends oo{getServiceInstance(){return new qn}}const so=Pi();exports.default=void 0,window.onJSCall=e=>function(t){Qi.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){Qi.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){Qi.getInstance().nativeEventHandler(e,t,i)}},so.isZalo?exports.default=new ro:exports.default=new ao,window.ZaloMiniAppSDK=exports.default,exports.SDKCreator=oo,exports.default=exports.default;
16
+ function e(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a}function t(e,t){return function(i,n){t(i,n,e)}}function i(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function n(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function o(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i}Object.defineProperty(exports,"__esModule",{value:!0});var r=Object.prototype;var a=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)};var s=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),l=Object.prototype.hasOwnProperty;var c=function(e){if(!a(e))return s(e);var t=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&t.push(i);return t},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e,t){return e(t={exports:{}},t.exports),t.exports}var p="object"==typeof u&&u&&u.Object===Object&&u,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")(),f=v.Symbol,m=Object.prototype,g=m.hasOwnProperty,y=m.toString,_=f?f.toStringTag:void 0;var E=function(e){var t=g.call(e,_),i=e[_];try{e[_]=void 0;var n=!0}catch(e){}var o=y.call(e);return n&&(t?e[_]=i:delete e[_]),o},S=Object.prototype.toString;var A=function(e){return S.call(e)},T=f?f.toStringTag:void 0;var b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?E(e):A(e)};var O=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var w,N=function(e){if(!O(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},P=v["__core-js_shared__"],C=(w=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"";var I=function(e){return!!C&&C in e},k=Function.prototype.toString;var R=function(e){if(null!=e){try{return k.call(e)}catch(e){}try{return e+""}catch(e){}}return""},B=/^\[object .+?Constructor\]$/,D=Function.prototype,j=Object.prototype,L=D.toString,M=j.hasOwnProperty,x=RegExp("^"+L.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var U=function(e){return!(!O(e)||I(e))&&(N(e)?x:B).test(R(e))};var W=function(e,t){return null==e?void 0:e[t]};var z=function(e,t){var i=W(e,t);return U(i)?i:void 0},F=z(v,"DataView"),G=z(v,"Map"),H=z(v,"Promise"),$=z(v,"Set"),V=z(v,"WeakMap"),Z=R(F),J=R(G),K=R(H),Q=R($),q=R(V),Y=b;(F&&"[object DataView]"!=Y(new F(new ArrayBuffer(1)))||G&&"[object Map]"!=Y(new G)||H&&"[object Promise]"!=Y(H.resolve())||$&&"[object Set]"!=Y(new $)||V&&"[object WeakMap]"!=Y(new V))&&(Y=function(e){var t=b(e),i="[object Object]"==t?e.constructor:void 0,n=i?R(i):"";if(n)switch(n){case Z:return"[object DataView]";case J:return"[object Map]";case K:return"[object Promise]";case Q:return"[object Set]";case q:return"[object WeakMap]"}return t});var X=Y;var ee=function(e){return null!=e&&"object"==typeof e};var te=function(e){return ee(e)&&"[object Arguments]"==b(e)},ie=Object.prototype,ne=ie.hasOwnProperty,oe=ie.propertyIsEnumerable,re=te(function(){return arguments}())?te:function(e){return ee(e)&&ne.call(e,"callee")&&!oe.call(e,"callee")},ae=Array.isArray;var se=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var le=function(e){return null!=e&&se(e.length)&&!N(e)};var ce=function(){return!1},ue=d((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i?v.Buffer:void 0,r=(o?o.isBuffer:void 0)||ce;e.exports=r})),de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de["[object Arguments]"]=de["[object Array]"]=de["[object ArrayBuffer]"]=de["[object Boolean]"]=de["[object DataView]"]=de["[object Date]"]=de["[object Error]"]=de["[object Function]"]=de["[object Map]"]=de["[object Number]"]=de["[object Object]"]=de["[object RegExp]"]=de["[object Set]"]=de["[object String]"]=de["[object WeakMap]"]=!1;var pe=function(e){return ee(e)&&se(e.length)&&!!de[b(e)]};var he=function(e){return function(t){return e(t)}},ve=d((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&p.process,r=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=r})),fe=ve&&ve.isTypedArray,me=fe?he(fe):pe,ge=Object.prototype.hasOwnProperty;var ye=function(e){if(null==e)return!0;if(le(e)&&(ae(e)||"string"==typeof e||"function"==typeof e.splice||ue(e)||me(e)||re(e)))return!e.length;var t=X(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(a(e))return!c(e).length;for(var i in e)if(ge.call(e,i))return!1;return!0};var _e=function(e){return void 0===e};var Ee=function(e){return null===e};var Se=function(e){return"string"==typeof e||!ae(e)&&ee(e)&&"[object String]"==b(e)};var Ae=function(e){return"number"==typeof e||ee(e)&&"[object Number]"==b(e)};var Te=function(e){return ee(e)&&"[object RegExp]"==b(e)},be=ve&&ve.isRegExp,Oe=be?he(be):Te;var we=function(e){return"symbol"==typeof e||ee(e)&&"[object Symbol]"==b(e)},Ne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pe=/^\w*$/;var Ce=function(e,t){if(ae(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!we(e))||(Pe.test(e)||!Ne.test(e)||null!=t&&e in Object(t))},Ie=z(Object,"create");var ke=function(){this.__data__=Ie?Ie(null):{},this.size=0};var Re=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Be=Object.prototype.hasOwnProperty;var De=function(e){var t=this.__data__;if(Ie){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return Be.call(t,e)?t[e]:void 0},je=Object.prototype.hasOwnProperty;var Le=function(e){var t=this.__data__;return Ie?void 0!==t[e]:je.call(t,e)};var Me=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ie&&void 0===t?"__lodash_hash_undefined__":t,this};function xe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}xe.prototype.clear=ke,xe.prototype.delete=Re,xe.prototype.get=De,xe.prototype.has=Le,xe.prototype.set=Me;var Ue=xe;var We=function(){this.__data__=[],this.size=0};var ze=function(e,t){return e===t||e!=e&&t!=t};var Fe=function(e,t){for(var i=e.length;i--;)if(ze(e[i][0],t))return i;return-1},Ge=Array.prototype.splice;var He=function(e){var t=this.__data__,i=Fe(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ge.call(t,i,1),--this.size,!0)};var $e=function(e){var t=this.__data__,i=Fe(t,e);return i<0?void 0:t[i][1]};var Ve=function(e){return Fe(this.__data__,e)>-1};var Ze=function(e,t){var i=this.__data__,n=Fe(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function Je(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}Je.prototype.clear=We,Je.prototype.delete=He,Je.prototype.get=$e,Je.prototype.has=Ve,Je.prototype.set=Ze;var Ke=Je;var Qe=function(){this.size=0,this.__data__={hash:new Ue,map:new(G||Ke),string:new Ue}};var qe=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ye=function(e,t){var i=e.__data__;return qe(t)?i["string"==typeof t?"string":"hash"]:i.map};var Xe=function(e){var t=Ye(this,e).delete(e);return this.size-=t?1:0,t};var et=function(e){return Ye(this,e).get(e)};var tt=function(e){return Ye(this,e).has(e)};var it=function(e,t){var i=Ye(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function nt(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}nt.prototype.clear=Qe,nt.prototype.delete=Xe,nt.prototype.get=et,nt.prototype.has=tt,nt.prototype.set=it;var ot=nt;function rt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var a=e.apply(this,n);return i.cache=r.set(o,a)||r,a};return i.cache=new(rt.Cache||ot),i}rt.Cache=ot;var at=rt;var st=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lt=/\\(\\)?/g,ct=function(e){var t=at(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(st,(function(e,i,n,o){t.push(n?o.replace(lt,"$1"):i||e)})),t}));var ut=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o},dt=f?f.prototype:void 0,pt=dt?dt.toString:void 0;var ht=function e(t){if("string"==typeof t)return t;if(ae(t))return ut(t,e)+"";if(we(t))return pt?pt.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var vt=function(e){return null==e?"":ht(e)};var ft=function(e,t){return ae(e)?e:Ce(e,t)?[e]:ct(vt(e))};var mt=function(e){if("string"==typeof e||we(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var gt=function(e,t){for(var i=0,n=(t=ft(t,e)).length;null!=e&&i<n;)e=e[mt(t[i++])];return i&&i==n?e:void 0};var yt=function(e,t,i){var n=null==e?void 0:gt(e,t);return void 0===n?i:n},_t=function(){try{var e=z(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Et=function(e,t,i){"__proto__"==t&&_t?_t(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},St=Object.prototype.hasOwnProperty;var At=function(e,t,i){var n=e[t];St.call(e,t)&&ze(n,i)&&(void 0!==i||t in e)||Et(e,t,i)},Tt=/^(?:0|[1-9]\d*)$/;var bt=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Tt.test(e))&&e>-1&&e%1==0&&e<t};var Ot=function(e,t,i,n){if(!O(e))return e;for(var o=-1,r=(t=ft(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var l=mt(t[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=a){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=O(u)?u:bt(t[o+1])?[]:{})}At(s,l,c),s=s[l]}return e};var wt,Nt,Pt,Ct,It,kt,Rt,Bt,Dt,jt,Lt,Mt={isEmpty:ye,isNull:Ee,isUndefined:_e,isFunction:N,isObject:O,isString:Se,isNumber:Ae,isArray:ae,isRegExp:Oe,get:yt,set:function(e,t,i){return null==e?e:Ot(e,t,i)}};function xt(e){return"function"==typeof window.Debug?window.Debug(e):function(...e){process.env.NODE_ENV}}exports.NetworkType=void 0,(wt=exports.NetworkType||(exports.NetworkType={})).none="none",wt.wifi="wifi",wt.cellular="cellular",wt.unknown="unknown",exports.PlatformType=void 0,(Nt=exports.PlatformType||(exports.PlatformType={})).wp="wp",Nt.android="android",Nt.iOS="iOS",Nt.unknown="unknown",exports.ProfileType=void 0,(Pt=exports.ProfileType||(exports.ProfileType={}))[Pt.user=1]="user",Pt[Pt.oa=0]="oa",Pt[Pt.aliasOA=2]="aliasOA",exports.ChatType=void 0,(Ct=exports.ChatType||(exports.ChatType={}))[Ct.user=1]="user",Ct[Ct.oa=0]="oa",exports.PostFeedType=void 0,(It=exports.PostFeedType||(exports.PostFeedType={}))[It.image=1]="image",It[It.link=4]="link",It[It.profile=5]="profile",exports.ShareSheetType=void 0,(kt=exports.ShareSheetType||(exports.ShareSheetType={}))[kt.image=1]="image",kt[kt.gif=11]="gif",kt[kt.video=12]="video",kt[kt.link=4]="link",kt[kt.oa=5]="oa",kt[kt.zmp=20]="zmp",exports.OrientationType=void 0,(Rt=exports.OrientationType||(exports.OrientationType={}))[Rt.auto=1]="auto",Rt[Rt.portrait=2]="portrait",Rt[Rt.landscape=3]="landscape",exports.VibrateType=void 0,(Bt=exports.VibrateType||(exports.VibrateType={}))[Bt.oneShot=0]="oneShot",exports.NativeCode=void 0,(Dt=exports.NativeCode||(exports.NativeCode={}))[Dt.token_invalid=-2]="token_invalid",Dt[Dt.not_permission=-1]="not_permission",Dt[Dt.client_not_support=-5]="client_not_support",Dt[Dt.decode_failed=-4]="decode_failed",exports.Events=void 0,(jt=exports.Events||(exports.Events={})).AppPaused="h5.event.paused",jt.AppResumed="h5.event.resumed",jt.NetworkChanged="h5.event.connection.changed",jt.OnDataCallback="h5.event.webview.result",jt.OpenApp="h5.event.open.mp",exports.MediaPickerType=void 0,(Lt=exports.MediaPickerType||(exports.MediaPickerType={}))[Lt.photo=4]="photo",Lt[Lt.video=5]="video",Lt[Lt.file=6]="file",Lt[Lt.multi_photo=7]="multi_photo",Lt[Lt.multi_video=8]="multi_video";const Ut=e=>{const t=document.cookie;if(t){const o=t.split("; ");if(o&&o.length>0)for(var i=e.length+1,n=o.length-1;n>=0;n--){let t=o[n];if(t&&0===t.indexOf(e)&&(t=t.substring(i,t.length),t))return t=t.replace(/["']/g,""),t}}return null},Wt=e=>Ut(`${window.location.host}_`+e),zt=e=>Ut((()=>{const e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""})()+e),Ft=window.zAppID,Gt=window.APP_ID,Ht=window.APP_CONFIG||{},$t="h5.zdn.vn_zoauth",Vt="h5.zdn.vn_zlink3rd",Zt="h5.zdn.vn_zoauth_vrf",Jt="https://graph.zalo.me/v2.0/me",Kt="https://h5.zalo.me/openapi/access_token",Qt="https://oauth.zaloapp.com/v3/access_token",qt="https://graph.zalo.me/v2.0/me/friends/list",Yt=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),Xt={GET_DOWNLOADED_STICKER:{name:"action.get.downloaded.sticker",have_callback:!0},OPEN_SHARE_STICKER:{name:"action.open.share.sticker"},OPEN_PROFILE:{name:"action.open.profile"},OPEN_FEED_DETAIL:{name:"action.open.feeddetail"},OPEN_FRIEND_RADA:{name:"action.open.friendrada"},OPEN_INAPP:{name:"action.open.inapp"},OPEN_OUTAPP:{name:"action.open.outapp"},OPEN_PAGE:{name:"action.open.page"},OPEN_PHOTODETAIL:{name:"action.open.photodetail"},OPEN_GALARY:{name:"action.open.galary"},OPEN_GAMECENTER:{name:"action.open.gamecenter"},OPEN_GAMENEWS:{name:"action.open.gamenews"},OPEN_TAB_CONTACT:{name:"action.open.tab.contact"},OPEN_TAB_SOCIAL:{name:"action.open.tab.social"},OPEN_FRIENDSUGGEST:{name:"action.open.friendsuggest"},OPEN_GROUPLIST:{name:"action.open.grouplist"},OPEN_NEARBY:{name:"action.open.nearby"},OPEN_ROOM:{name:"action.open.room"},OPEN_STICKERSTORE:{name:"action.open.stickerstore"},OPEN_CREATECHAT:{name:"action.open.createchat"},COPY_LINK_CATESTICKER:{name:"action.copy.link.catesticker"},REQUEST_BUY_STICKER:{name:"action.request.buy.sticker"},OPEN_CHAT:{name:"action.open.chat"},OPEN_TAB_CHAT:{name:"action.open.tab.chat"},OPEN_CHATGROUP:{name:"action.open.chatgroup"},OPEN_ADDFRIEND:{name:"action.open.addfriend"},OPEN_TAB_MORE:{name:"action.open.tab.more"},OPEN_POSTFEED:{name:"action.open.postfeed"},OPEN_LOGINDEVICES:{name:"action.open.logindevices"},OPEN_SENDSTICKER:{name:"action.open.sendsticker"},REPORT_ABUSE:{name:"action.report.abuse",have_callback:!0},FOLLOW_OA:{name:"action.follow.oa",have_callback:!0},UNFOLLOW_OA:{name:"action.unfollow.oa",have_callback:!0},OPEN_GAMEDETAIL:{name:"action.open.gamedetail"},OPEN_SHARESHEET:{name:"action.open.sharesheet",have_callback:!0},REQUEST_PERMISSION_CAMERA:{name:"action.request.permission.camera"},CHANGE_TITLE_HEADER:{name:"action.change.title.header",skip_jump:!0},WEBVIEW_CLEARCACHE:{name:"action.webview.clearcache"},WEBVIEW_CONFIRMCACHE:{name:"action.webview.confirmcache"},WEBVIEW_ISVISIBLE:{name:"action.webview.isvisible"},WEBVIEW_NETWORKTYPE:{name:"action.webview.networktype",skip_jump:!0},CHANGE_BUTTON_HEADER:{name:"action.change.button.header"},CREATE_OPTIONS_MENU:{name:"action.create.options.menu",skip_jump:!0,have_callback:!0},CREATE_SHORTCUT:{name:"action.create.shortcut"},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{name:"action.change.actionbar.leftbutton.type",skip_jump:!0,have_callback:!0},WINDOW_CLOSE:{name:"action.window.close",skip_jump:!0,have_callback:!0},WEBVIEW_CHECKRESERROR:{name:"action.webview.checkResError"},IAP_REQUESTPAYMENT:{name:"action.iap.requestpayment"},ZBROWSER_GETSTATS:{name:"action.zbrowser.getstats"},ZBROWSER_JSBRIDGE:{name:"action.zbrowser.jsbridge",skip_jump:!0,have_callback:!0},PROMPT_AUTHENTICATION:{name:"action.prompt.authentication"},CHANGE_ACTIONBAR_COLOR:{name:"action.change.actionbar.color",skip_jump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{name:"action.prompt.authentication.check_state"},OPEN_APPSTORE:{name:"action.open.appstore"},GET_LOCATION:{name:"action.get.location",have_callback:!0},QUERY_LOCATION_HIDE:{name:"action.query.location.hide",have_callback:!0},SHOW_TOAST:{name:"action.show.toast",have_callback:!0},OPEN_APP:{name:"action.open.app"},HIDE_KEYBOARD:{name:"action.hide.keyboard"},OPEN_PHONE:{name:"action.open.phone"},OPEN_QR:{name:"action.open.qr"},OPEN_SMS:{name:"action.open.sms"},VIEW_MYQR:{name:"action.view.myqr",have_callback:!0},KEEP_SCREEN:{name:"action.keep.screen",have_callback:!0},CHANGE_AUTOROTATE:{name:"action.change.autorotate",skip_jump:!0},CHECK_APP_INSTALLED:{name:"action.check.app.installed"},QUERY_SHOW:{name:"action.query.show"},QUERY_HIDE:{name:"action.query.hide"},OPEN_INAPPRW:{name:"action.open.inapprw"},ZALORUN_GETTRACKINGSTATUS:{name:"action.zalorun.getTrackingStatus",have_callback:!0},ZALORUN_SETTRACKINGSTATUS:{name:"action.zalorun.setTrackingStatus",have_callback:!0},ZALORUN_GETDAYSTEP:{name:"action.zalorun.getDayStep",have_callback:!0},ZALORUN_FORCESUBMITDATA:{name:"action.zalorun.forceSubmitData",have_callback:!0},ZALORUN_SETWEIGHT:{name:"action.zalorun.setWeight",have_callback:!0},OPEN_PROFILE_EXT:{name:"action.open.profile.ext"},DOWNLOAD_CATE:{name:"action.download.cate",have_callback:!0},JUMP_LOGIN:{name:"action.jump.login",skip_jump:!0,white_list:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{name:"action.open.adtima.ads.interstitial"},OPEN_ADTIMA_ADS:{name:"action.open.adtima.ads"},GET_ADIDCLIENT:{name:"action.get.adidclient"},SCAN_IBEACON:{name:"action.scan.ibeacon"},INTERACTIVE_VIBRATION:{name:"action.interactive.vibration"},SAVE_IMAGE_GALLERY:{name:"action.save.image.gallery",version_live:{iOS:408}},OPEN_MP:{name:"action.open.mp",version_live:{iOS:402}},CHANGE_ACTIONBAR:{name:"action.change.actionbar",version_live:{iOS:402},skip_jump:!0},ZBROWSER_MPDS:{name:"action.zbrowser.mpds",version_live:{iOS:402}},WEBVIEW_SET_RESULT:{name:"action.webview.set.result",version_live:{iOS:416}},MP_GET_NUMBER:{name:"action.mp.get.number",version_live:{iOS:416}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432}},GET_SUPPORTED_ACTIONS:{name:"action.get.supported.actions",white_list:!0},MP_JOIN_WIFI:{name:"action.mp.join.wifi",version_live:{android:0,iOS:999},have_permission:!1,white_list:!1},PICK_MEDIA:{name:"action.pick.media",version_live:{iOS:999}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},ei=0,ti=-1400,ii=-1500,ni=-1401,oi=-1403,ri=-1404,ai={SUCCESS:"Success",READ_MORE:"Read more at: https://miniapp.zalo.me/docs/api",LOGIN_REQUIRED:"Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login",LOGIN_FAILED:"Login failed.",NOT_PERMISSION:"You don't have permission to call this api",CLIENT_NOT_SUPPORT:"This API is not supported in this Zalo version",DECODE_FAILED:"Can not decode your data. Read more at: https://miniapp.zalo.me/docs/api/error"},si="apps/get-info",li={android:12100571,iOS:400,wp:0,unknown:0},ci=[Xt.GET_DOWNLOADED_STICKER.name,Xt.OPEN_SHARE_STICKER.name,Xt.OPEN_PROFILE.name,Xt.OPEN_FEED_DETAIL.name,Xt.OPEN_FRIEND_RADA.name,Xt.OPEN_INAPP.name,Xt.OPEN_OUTAPP.name,Xt.OPEN_PAGE.name,Xt.OPEN_PHOTODETAIL.name,Xt.OPEN_GALARY.name,Xt.OPEN_GAMECENTER.name,Xt.OPEN_GAMENEWS.name,Xt.OPEN_TAB_CONTACT.name,Xt.OPEN_TAB_SOCIAL.name,Xt.OPEN_FRIENDSUGGEST.name,Xt.OPEN_GROUPLIST.name,Xt.OPEN_NEARBY.name,Xt.OPEN_ROOM.name,Xt.OPEN_STICKERSTORE.name,Xt.OPEN_CREATECHAT.name,Xt.COPY_LINK_CATESTICKER.name,Xt.REQUEST_BUY_STICKER.name,Xt.OPEN_CHAT.name,Xt.OPEN_TAB_CHAT.name,Xt.OPEN_CHATGROUP.name,Xt.OPEN_ADDFRIEND.name,Xt.OPEN_TAB_MORE.name,Xt.OPEN_POSTFEED.name,Xt.OPEN_LOGINDEVICES.name,Xt.OPEN_SENDSTICKER.name,Xt.REPORT_ABUSE.name,Xt.FOLLOW_OA.name,Xt.UNFOLLOW_OA.name,Xt.OPEN_GAMEDETAIL.name,Xt.OPEN_SHARESHEET.name,Xt.REQUEST_PERMISSION_CAMERA.name,Xt.CHANGE_TITLE_HEADER.name,Xt.WEBVIEW_CLEARCACHE.name,Xt.WEBVIEW_CONFIRMCACHE.name,Xt.WEBVIEW_ISVISIBLE.name,Xt.WEBVIEW_NETWORKTYPE.name,Xt.CHANGE_BUTTON_HEADER.name,Xt.CREATE_OPTIONS_MENU.name,Xt.CREATE_SHORTCUT.name,Xt.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,Xt.WINDOW_CLOSE.name,Xt.WEBVIEW_CHECKRESERROR.name,Xt.IAP_REQUESTPAYMENT.name,Xt.ZBROWSER_GETSTATS.name,Xt.ZBROWSER_JSBRIDGE.name,Xt.PROMPT_AUTHENTICATION.name,Xt.CHANGE_ACTIONBAR_COLOR.name,Xt.PROMPT_AUTHENTICATION_CHECK_STATE.name,Xt.OPEN_APPSTORE.name,Xt.GET_LOCATION.name,Xt.QUERY_LOCATION_HIDE.name,Xt.SHOW_TOAST.name,Xt.OPEN_APP.name,Xt.HIDE_KEYBOARD.name,Xt.OPEN_PHONE.name,Xt.OPEN_QR.name,Xt.OPEN_SMS.name,Xt.VIEW_MYQR.name,Xt.KEEP_SCREEN.name,Xt.CHANGE_AUTOROTATE.name,Xt.CHECK_APP_INSTALLED.name,Xt.QUERY_SHOW.name,Xt.QUERY_HIDE.name,Xt.OPEN_INAPPRW.name,Xt.ZALORUN_GETTRACKINGSTATUS.name,Xt.ZALORUN_SETTRACKINGSTATUS.name,Xt.ZALORUN_GETDAYSTEP.name,Xt.ZALORUN_FORCESUBMITDATA.name,Xt.ZALORUN_SETWEIGHT.name,Xt.OPEN_PROFILE_EXT.name,Xt.DOWNLOAD_CATE.name,Xt.JUMP_LOGIN.name,Xt.OPEN_ADTIMA_ADS_INTERSTITIAL.name,Xt.OPEN_ADTIMA_ADS.name,Xt.GET_ADIDCLIENT.name,Xt.SCAN_IBEACON.name,Xt.SAVE_IMAGE_GALLERY.name,Xt.OPEN_MP.name,Xt.CHANGE_ACTIONBAR.name,Xt.INTERACTIVE_VIBRATION.name,Xt.ZBROWSER_MPDS.name],ui=0,di=3,pi=1,hi=0;class vi{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class fi extends vi{constructor(e,t){super(e,t),this.message=`${t}. ${ai.READ_MORE}`,this.handler()}handler(){switch(this.code){case exports.NativeCode.token_invalid:this.code=ni,this.message=ai.LOGIN_REQUIRED;break;case exports.NativeCode.not_permission:this.code=oi,this.message=ai.NOT_PERMISSION;break;case exports.NativeCode.client_not_support:this.code=ri,this.message=ai.CLIENT_NOT_SUPPORT;break;case exports.NativeCode.decode_failed:this.message=ai.DECODE_FAILED}}}const mi={handler:null,setHandler(e){this.handler=e}};mi.setHandler(((e,t)=>t instanceof vi?(t.api=e,t):new vi(-2001,Mt.isNull(t.message)?"Unknown Error":t.message,e)));const gi=(e,t,n)=>{const o=n.value;return n.value=function(...e){return i(this,void 0,void 0,(function*(){const{success:n,fail:r}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>i(this,void 0,void 0,(function*(){try{const t=yield o.apply(this,e);!Mt.isNull(n)&&Mt.isFunction(n)?n.call(null,t,this):a(t)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===ni||(null==e?void 0:e.code)===oi)){let t=!1;this instanceof oo&&(t=this.getLoginStatus()),t||(e=new vi(ni,ai.LOGIN_REQUIRED))}const{handler:i}=mi,n=i.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(n.toString()),!Mt.isNull(r)&&Mt.isFunction(r)?r.call(null,n,this):s(n)}}))))}))},n},yi=(e,t,i)=>{const n=i.value;return i.value=function(...e){try{return n.apply(this,e)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===ni||(null==e?void 0:e.code)===oi)){let t=!1;this instanceof oo&&(t=this.getLoginStatus()),t||(e=new vi(ni,ai.LOGIN_REQUIRED))}const{handler:i}=mi,n=i.call(null,t,e,this);throw window.zmpSentry&&window.zmpSentry.throwError(n.toString()),n}},i},_i=(e,t)=>({code:ei,message:t||ai.SUCCESS,data:e||{}}),Ei={badRequest:e=>new vi(ti,e),loginFailed:()=>new vi(ti,ai.LOGIN_FAILED),loginRequired:()=>new vi(ni,ai.LOGIN_REQUIRED),missingParam:e=>new vi(ti,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new vi(ti,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new vi(ii,"Can not get app info to share"),lengthInvalid:e=>new vi(ti,`${e} length is invalid.`)};const Si={encode:function(e){var t=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(void 0===n)return;if(null===n)return void t.push(i);t.push(encodeURIComponent(i)+"="+encodeURIComponent(n))}return t.join("&")},decode:function(e,t){var i={};if(""===e)return i;for(var n=e.split("&"),o=0;o<n.length;o++){var r=n[o].split("=",2),a=decodeURIComponent(r[0]);if(t&&Object.prototype.hasOwnProperty.call(i,a))throw new URIError("Duplicate key: "+a);i[a]=2===r.length?decodeURIComponent(r[1]):null}return i},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Si.encode(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var i=e.split("=");i&&2==i.length&&(t[i[0]]=decodeURIComponent(i[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e?"undefined":typeof e))return e;var t=Object.keys(e),i=[];return t.map((function(t){var n=e[t],o=[t,n="object"==(void 0===n?"undefined":typeof n)?JSON.stringify(n):encodeURIComponent(n)].join("=");i.push(o)})),i.join("&")}},Ai=new RegExp("[\\u0300-\\u036f]","g"),Ti=new RegExp("[đ|Đ]","g"),bi=new RegExp("\\s","g"),Oi=xt("zmp:utils:common"),wi=e=>{try{new URL(e)}catch(e){return!1}return!0},Ni=()=>navigator.userAgent||navigator.vendor||window.opera,Pi=()=>{const e=Ni().toLowerCase();return{isWP:/iemobile/.test(e),isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}},Ci=e=>{const t=document.getElementsByTagName("meta");for(let i=0;i<t.length;i++)if(t[i].getAttribute("name")===e||t[i].getAttribute("property")===e)return t[i].getAttribute("content");return""},Ii=()=>{const e=Ni().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},ki=()=>{let e=Pi();return e.isWP?exports.PlatformType.wp:e.isAndroid?exports.PlatformType.android:e.isIOS?exports.PlatformType.iOS:exports.PlatformType.unknown},Ri=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&wi(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!wi(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},Bi=e=>(e=>{let t=Wt(e);return t||(t=zt(e),t)?t:Ut(e)})(e),Di=e=>{if(Mt.isObject(JSON)&&JSON.parse&&Mt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");return JSON.parse(t,((e,t)=>t))}return Mt.isObject(e)?e:new Function("return "+e)()},ji=e=>{if(Mt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var i=e.length,n=0;n<i;n++)t.push(ji(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+ji(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Li=()=>{try{const e=Number(Ii()),t=ki();return e>=li[t]}catch(e){return!0}},Mi=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"),xi=e=>{try{if(e){Oi(e);const t=e.replace(/\\/g,"").replace(/&#39;/g,"'");return Oi("formattedValue",t,JSON.parse(t),typeof JSON.parse(t)),JSON.parse(t)}return null}catch(t){return Oi("parse json error:",t),e}},Ui=(e,t,n,o,r,a)=>i(void 0,void 0,void 0,(function*(){const i=new URL(location.href),s=new URLSearchParams;let l=`${i.pathname}${i.search}`;a&&(l=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const c=new URL(`https://zalo.me/app/link${l}`);s.append("title",n),s.append("description",o||""),s.append("thumbnail",r),s.append("url",c.href),s.append("accessToken",t||"");const u=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),d=yield u.json();if(!d||0!==d.err)throw Ei.cannotGetShareInfo();return c.search=`${c.search}&zshareId=${d.data.shareId}`,Object.assign(Object.assign({},d.data),{shareableLink:c.href})})),Wi=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>Ri(i,e))):Ri(i,e)))return{error:!0,errorMessage:e};if(t){if(Array.isArray(null==t?void 0:t.values))return{error:!(null==t?void 0:t.values.includes(i)),errorMessage:null==t?void 0:t.values.toString()};if(Mt.isNumber(null==t?void 0:t.maxLength))return{error:(Mt.isString(i)||Mt.isArray(i))&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Mt.isNumber(null==t?void 0:t.min)&&Mt.isNumber(null==t?void 0:t.max))return{error:i<(null==t?void 0:t.min)||i>(null==t?void 0:t.max),errorMessage:`data must be in between ${null==t?void 0:t.min} and ${null==t?void 0:t.max}`};if(Mt.isNumber(null==t?void 0:t.min))return{error:i<(null==t?void 0:t.min),errorMessage:`data must >= ${null==t?void 0:t.min}`};if(Mt.isNumber(null==t?void 0:t.max))return{error:i>(null==t?void 0:t.max),errorMessage:`data must <= ${null==t?void 0:t.max}`};if(Mt.isRegExp(null==t?void 0:t.regex))return{error:!t.regex.test(i),errorMessage:"data must valid"}}return{error:!1}},zi=(e,t,n)=>i(void 0,void 0,void 0,(function*(){const i={appId:e,versionStatus:t};Mt.isUndefined(n)||(i.currentVersion=n);const o=Si.appendToUrl(`https://h5.zalo.me/${si}`,i),r=yield fetch(o,{credentials:"include"});if(r.ok){const e=yield r.json();if(e.err<0||!e.data)throw new Error(e);return{name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl,logoUrl:e.data.logoUrl}}throw new Error("Can't get app info")}));var Fi=d((function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,r=n.length,a=new Array(r);o<r;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,r,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,r),!0;case 6:return u.fn.call(u.context,t,n,o,r,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(d-1);p<d;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,o){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var s=this._events[r];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,r);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[r]=1===c.length?c[0]:c:a(this,r)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}));class Gi extends Fi{constructor(){super(),this.debug=xt("zmp:event-emitter")}static getInstance(){return Gi.instance||(Gi.instance=new Gi),Gi.instance}h5ConfirmHandleEvent(e,t,i){ZaloJavaScriptInterface.jsH5EventCallback(e,t,i||"")}on(e,t,i){this.debug(`register ${e}: ${i}`);return super.on(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}once(e,t,i){this.debug(`register once ${e}: ${i}`);return super.once(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}}var Hi={},$i=function(e,t,i){var n=t||"default";return function(){var t=n in Hi?Hi[n](e,i):e;return t.apply(this,arguments)}};$i.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];Hi[t]=e};var Vi={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Zi(e){try{return null===e?Vi:JSON.parse(e)}catch(e){return Vi}}var Ji,Ki={execute:function(e,t,i,n){i.suppress_http_code=1;var o=Si.encode(i);"post"!=t&&(e=Si.appendToUrl(e,o),o="");var r=function(e,t){if(!self.XMLHttpRequest)return null;var i=new XMLHttpRequest,n=function(){};if(!("withCredentials"in i))return null;i.open(e,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded");var o={send:function(e){i.send(e)}},r=$i((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=$i((function(){a=n,"onerror"in o&&o.onerror(i)}),"entry","XMLHttpRequest:error");return i.onload=function(){r()},i.onerror=function(){a()},i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r():a())},o}(t,e);return!!r&&(r.onload=function(e){n(Zi(e.responseText))},r.onerror=function(e){e.responseText?n(Zi(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class Qi extends Fi{constructor(){super(),this.debug=xt("zmp:ZaloJSBridge"),this.events=Gi.getInstance(),this._accessTk=Bi("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=Bi("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=Ni(),this._device=Pi(),this._jsCallFuncCallbacks={},this.events.on(exports.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3)}static getInstance(){return Qi.instance||(Qi.instance=new Qi),Qi.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{Ki.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Di(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Di(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n)}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=xi(i);this.debug(n);const o=this.handleEventData(t,n);this.events.emit(t,e,o)}handleEventData(e,t){try{switch(e){case exports.Events.OpenApp:const{url:e}=t,i=new URL(e),n=i.pathname.split(`/zapps/${Gt}`)[1];return{path:`${n||"/"}${i.search}`};default:return t}}catch(e){return t}}defaultCallback(e){null!=e&&(e=Di(e))}jsCall(e,t,i,n=!1,o=3,r=!0){try{const a=e.name,s=((e="")=>`${e.normalize("NFD").replace(Ai,"").replace(Ti,"d").replace(bi,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(a);if(!this._device.isMobile||Mt.isEmpty(a))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a}),!1;null==t&&(t={}),i||(i=this.defaultCallback);const l={error_code:-14,error_message:"Request Timeout!",data:{},action:a};this._jsCallFuncCallbacks[s]={timeout:r&&e.have_callback&&setTimeout((()=>{this.onJSCall(s,l)}),8e3),callback:i};try{return t=ji(t),n?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onJSCall('${s}')`)}catch(r){if(!(o-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a,js_error:r};return this.onJSCall(s,e),!1}setTimeout((()=>{this.jsCall(e,t,i,n,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class qi{constructor(){this.debug=xt("zmp:ZJSBridgeProvider"),Ji.set(this,void 0),o(this,Ji,Qi.getInstance(),"f")}setZAccSession(e){n(this,Ji,"f").accessTk=e}setJSToken(e){n(this,Ji,"f").jsAccessTk=e}callNative(e,t,o){return this.debug(e.name,t),new Promise(((r,a)=>{const s=n=>i(this,void 0,void 0,(function*(){try{const i=new fi(n.error_code,`${n.action}: ${n.error_message}`);if(null==o?void 0:o.callback){const e=yield o.callback(n,i);return r(e)}if(n&&n.error_code>=0)r(n.data||{});else if(n&&n.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e.name}: call native fail`,{extra:{data:t,rs:n}})}catch(e){}return a(i)}}catch(e){return a(e)}})),l=Pi().isIOS,c=(e=>{var t;const i=Ii(),n=(null===(t=null==e?void 0:e.version_live)||void 0===t?void 0:t.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e.name))||i>=n})(e);if(l&&!c){const t=new fi(-5,`${e}: Client isn't support this action`);return a(t)}(null==o?void 0:o.delay)?setTimeout((()=>{n(this,Ji,"f").jsCall(e,t,s,null==o?void 0:o.isMultiCallback,null==o?void 0:o.nRetry,null==o?void 0:o.haveTimeout)}),o.delay):n(this,Ji,"f").jsCall(e,t,s,null==o?void 0:o.isMultiCallback,null==o?void 0:o.nRetry,null==o?void 0:o.haveTimeout)}))}}Ji=new WeakMap;var Yi,Xi,en,tn,nn;class on{static getVersion(){return"2.18.7"}static getSystemInfo(){return{version:Ci("version-id")||"",apiVersion:"2.18.7",zaloVersion:Ii(),platform:ki(),language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}static getAppInfo(){return i(this,void 0,void 0,(function*(){const e=this.getAppId(),t=this.getSystemInfo();return yield zi(e,0,t.version)}))}}class rn{static setNavigationBarTitle(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return i(this,void 0,void 0,(function*(){const t={};let i;Mt.isEmpty(e.textColor)||(t.textColor=e.textColor),Mt.isString(e.color)&&e.color.length>0?(Mt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Mt.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i=6),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{actionbarType:i,dataConfig:Object.assign(Object.assign({},e.dataConfig),t)}))),yield this.callNative(Xt.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e){return i(this,void 0,void 0,(function*(){const t="none"===e.type||"home"===e.type?di:ui,i="home"===e.type||"both"===e.type?pi:hi;this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:t,dataConfig:Object.assign(Object.assign({},e.dataConfig),{viewInLeftType:t}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:i})}))),yield this.callNative(Xt.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.CREATE_OPTIONS_MENU,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class an{static setBackgroundColor(e){return i(this,void 0,void 0,(function*(){Mt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(Xt.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class sn{constructor(e,t,i,n){this.title=n,this.severity=t;const o=new Date;if(this.time=o.toLocaleTimeString(),this.content=e,i>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}Yi=new WeakMap,Xi=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap;const ln=new class{constructor(){Yi.set(this,3),Xi.set(this,["none","error","warn","info"]),en.set(this,"[zmp] > "),tn.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),nn.set(this,((e,t,i)=>{n(this,tn,"f")[n(this,Xi,"f")[e]]++;const r=n(this,Xi,"f")[e];if(o(this,en,n(this,en,"f")+("string"!=typeof t?new sn(t,r,e,i).toString():t),"f"),!(e>n(this,Yi,"f")))switch(e){case 1:console.error(n(this,en,"f"));break;case 2:console.warn(n(this,en,"f"));break;case 3:console.info(n(this,en,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){o(this,Yi,e,"f")}info(e){n(this,nn,"f").call(this,3,e)}warn(e,t){n(this,nn,"f").call(this,2,e,t)}error(e,t){n(this,nn,"f").call(this,1,e,t)}getMetrics(){return n(this,tn,"f")}};class cn{static setDeviceOrientation(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.CHANGE_AUTOROTATE,{autoRotate:exports.OrientationType[e.rotate]})}))}static getNetworkType(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((e=>{const t=e.network;let i;const n=Pi().isAndroid;switch(t){case Yt(n).NONE:i=exports.NetworkType.none;break;case Yt(n).WIFI:i=exports.NetworkType.wifi;break;case Yt(n)["2G"]:case Yt(n)["3G"]:case Yt(n)["4G"]:i=exports.NetworkType.cellular;break;default:i=exports.NetworkType.unknown}return{networkType:i}}))}))}static onNetworkStatusChange(e){return i(this,void 0,void 0,(function*(){yield this.events.on(exports.Events.NetworkChanged,(t=>{const i=t&&t.state;this.getNetworkType().then((t=>{const n={isConnected:"CONNECTED"===i,networkType:t&&t.networkType};e(n)})).catch((e=>{ln.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,n,o,r,a;return i(this,void 0,void 0,(function*(){const i={subaction:0,scanning_type:Mt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Mt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Mt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Mt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Mt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Mt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Mt.isNumber(null===(n=null==e?void 0:e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Mt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Mt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Mt.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.callNative(Xt.SCAN_IBEACON,Object.assign({},i)),!0}))}static stopBeaconDiscovery(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.SCAN_IBEACON,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const i={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(i)})),t}))}))}static stopBluetoothDevicesDiscovery(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothDeviceFound(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothAdapterStateChange(){return i(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return i(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.callNative({name:""},t)}))}static getBluetoothDevices(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static getBluetoothAdapterState(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static closeBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static scanQRCode(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.HIDE_KEYBOARD,{})}))}static openPhone(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.PROMPT_AUTHENTICATION,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,i,n,o;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.error_code,message:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_message,payToken:null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.pay_token}}}))}))}static checkStateBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.PROMPT_AUTHENTICATION_CHECK_STATE,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.INTERACTIVE_VIBRATION,{type:exports.VibrateType[e.type],vibrate_time:e.milliseconds})}))}static connectWifi(e){return i(this,void 0,void 0,(function*(){let t="open";return Mt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.callNative(Xt.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}}var un,dn,pn,hn,vn,fn,mn,gn,yn,_n,En,Sn,An,Tn,bn,On,wn,Nn,Pn,Cn,In,kn,Rn,Bn,Dn,jn,Ln,Mn;class xn{constructor(e){un.set(this,localStorage),dn.set(this,void 0),pn.set(this,void 0),Pi(),o(this,pn,{keys:new Set,currentSize:0,limitSize:5242880},"f"),o(this,dn,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in n(this,un,"f")){if(e){if(t.split("_")[0]!==e)continue}n(this,pn,"f").keys.add(t)}}catch(e){ln.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return n(this,dn,"f")&&(e=`${n(this,dn,"f")}_${e}`),n(this,pn,"f").keys.has(e)?n(this,un,"f").getItem(e):null}set(e){return i(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){n(this,dn,"f")&&(e=`${n(this,dn,"f")}_${e}`),n(this,un,"f").setItem(e,t),n(this,pn,"f").keys.add(e)}getInfo(){return i(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let i,n,o=0;for(n in e){const r=n.split("_")[0];e.hasOwnProperty(n)&&(t&&r!==t||(i=2*(e[n].length+n.length),o+=i))}return o})(n(this,un,"f"),n(this,dn,"f"));return{currentSize:Mt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number(5120..toFixed(2))}}remove(e){return i(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){n(this,dn,"f")&&(e=`${n(this,dn,"f")}_${e}`),n(this,pn,"f").keys.has(e)&&(n(this,un,"f").removeItem(e),n(this,pn,"f").keys.delete(e))}clear(){return i(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){n(this,pn,"f").keys.forEach((e=>{n(this,dn,"f")&&e.indexOf(n(this,dn,"f"))<0||(n(this,un,"f").removeItem(e),n(this,pn,"f").keys.delete(e))}))}}un=new WeakMap,dn=new WeakMap,pn=new WeakMap;class Un extends qi{constructor(e){super(),hn.set(this,void 0),vn.set(this,void 0),o(this,vn,{keys:new Set,currentSize:0,limitSize:5242880},"f"),o(this,hn,e,"f")}get(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return i(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return i(this,void 0,void 0,(function*(){const e=yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:Mt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return i(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:n(this,hn,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:n(this,hn,"f")})}))}}hn=new WeakMap,vn=new WeakMap;class Wn{getDataFromStorage(e){return i(this,void 0,void 0,(function*(){const t=this.getInstance(),i=yield t.get(e),n={};return i.forEach(((e,t)=>{n[t]=xi(e)})),n}))}putDataToStorage(e){return i(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Mt.isUndefined(t)||Mt.isNull(t)||(i[e]=Mi(t))})),yield t.set(i)}))}removeDataFromStorage(e){return i(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return i(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return i(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class zn extends Wn{constructor(e){super(),fn.set(this,void 0),o(this,fn,e,"f")}getInstance(){return new xn(n(this,fn,"f"))}}fn=new WeakMap;class Fn extends Wn{constructor(e){super(),mn.set(this,void 0),o(this,mn,e,"f")}getInstance(){return new Un(n(this,mn,"f"))}}mn=new WeakMap;class Gn{static setStorage(e){return i(this,void 0,void 0,(function*(){let t=new zn(this.getAppId());return Li()&&(t=new Fn(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return i(this,void 0,void 0,(function*(){let t=new zn(this.getAppId());Li()&&(t=new Fn(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return i(this,void 0,void 0,(function*(){let e=new zn(this.getAppId());return Li()&&(e=new Fn(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return i(this,void 0,void 0,(function*(){let t=new zn(this.getAppId());return Li()&&(t=new Fn(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return i(this,void 0,void 0,(function*(){let e=new zn(this.getAppId());Li()&&(e=new Fn(this.getAppId())),yield e.clearStorage()}))}}class Hn{static getUserInfo(e){return i(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let n="id,name,picture";(null==e?void 0:e.avatarType)&&(n=`${n}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${Jt}?fields=${n}`,{headers:{access_token:t||""}}).then((e=>i(this,void 0,void 0,(function*(){const t=yield e.json(),i={id:t.id,name:t.name,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.MP_GET_NUMBER,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}}class $n{static closeApp(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.WINDOW_CLOSE,{})}))}static openMiniApp(e){return i(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,i=(null==e?void 0:e.params)||{},n=Object.entries(i).map((function([e,t]){return[e,t].join("=")})).join("&"),o=yield zi(t,0);yield this.callNative(Xt.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:{appId:t,appAvtUrl:o.logoUrl||"",appName:o.name||""}})}))}static openWebview(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.OPEN_INAPP,{url:e.url})}))}static closeLoading(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class Vn{static getLocation(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.GET_LOCATION,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,callback:(e,t)=>{if(0===e.error_code){const t=e.data,i={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(i)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class Zn{static requestCameraPermission(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.REQUEST_PERMISSION_CAMERA,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return i(this,void 0,void 0,(function*(){let t={};return Mt.isEmpty(e.imageBase64Data)?Mt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.callNative(Xt.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class Jn{static viewOAQr(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.VIEW_MYQR,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_PROFILE,{uId:e.id,type:exports.ProfileType[e.type],zapp:this.getZAppId(),sourceId:e.sourceId,sourceIndex:e.sourceIndex})}))}static openChat(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_CHAT,{uId:e.id,type:exports.ChatType[e.type],zapp:this.getZAppId(),sourceId:e.sourceId,sourceIndex:e.sourceIndex})}))}static openPostFeed(e){return i(this,void 0,void 0,(function*(){let t={};switch(e.type){case"image":t={photoUrl:e.data.imageUrl};break;case"link":t={link:e.data.link,title:e.data.title,thumb:e.data.thumb,description:e.data.description};break;case"profile":t={avt:e.data.avatar,uid:e.data.id,dpn:e.data.displayName}}return yield this.callNative(Xt.OPEN_POSTFEED,Object.assign(Object.assign({type:exports.PostFeedType[e.type]},t),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.FOLLOW_OA,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return i(this,void 0,void 0,(function*(){yield this.callNative(Xt.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(e){return i(this,void 0,void 0,(function*(){let t={};switch(e.type){case"image":let i=[];Array.isArray(e.data.imageUrls)&&e.data.imageUrls.length>0?i=e.data.imageUrls:i.push(e.data.imageUrl),t={photoUrls:i,photoUrl:e.data.imageUrl,caption:e.data.caption};break;case"gif":t={photoUrl:e.data.imageUrl,gifUrl:e.data.gifUrl,width:e.data.width,height:e.data.height};break;case"video":t={videoThumb:e.data.videoThumb,videoUrl:e.data.videoUrl,width:e.data.width,height:e.data.height};break;case"link":t={link:e.data.link,chatOnly:e.data.chatOnly?1:0};break;case"oa":t={uid:e.data.id};break;case"zmp":const n=yield this.getAccessToken(),o=yield Ui(this.getAppId(),n||"",e.data.title||"",e.data.description||"",e.data.thumbnail||"",e.data.path);window.forceShareZMP?t={data:{ZInstantAPIInfo:{url:`${o.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${o.shareId}`},previewMsgText:{msg:{en:"Mini App",vi:"Chương trình nhỏ"}},enableReactions:1}}:(t={link:o.shareableLink,chatOnly:e.data.chatOnly?1:0},e.type="link")}return yield this.callNative(Xt.OPEN_SHARESHEET,Object.assign(Object.assign({type:exports.ShareSheetType[e.type]},t),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e,t,n){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.CREATE_SHORTCUT,{url:e,title:t,iconUrl:n})}))}static openProfilePicker(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,callback:(e,t)=>0===e.error_code&&Array.isArray(e.data)?Promise.resolve(e.data.map((e=>e.id))):Promise.reject(t)})}))}static getActionsSupported(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,callback:(e,t)=>{const i=ki();if(Array.isArray(e.actions)&&e.actions.length>0){const t=Object.keys(Xt).filter((e=>Xt[e].skip_jump)),i={actions:[...e.actions,...t]};return Promise.resolve(i)}if(i===exports.PlatformType.iOS){const e={actions:ci};return Promise.resolve(e)}return Promise.reject(t)}})}))}static openMediaPicker(e,t,n,o){return i(this,void 0,void 0,(function*(){const i={type:0,url:"https://zapi-server.tungnt.xyz/upload/photos",maxSize:1048576};return yield this.callNative(Xt.PICK_MEDIA,{media_type:exports.MediaPickerType[e],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),t),silent_request:n,upload:i,max_select_item:o},{isMultiCallback:!0,callback:(e,t)=>{var i,n;if(0===e.error_code){const t=xi(null===(i=e.data)||void 0===i?void 0:i.result_content),o={urls:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.urls};return Promise.resolve(o)}return Promise.reject(t)}})}))}static openOutApp(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.OPEN_OUTAPP,{url:e})}))}}class Kn{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=Si.getParamsAsObject(i))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return i(this,void 0,void 0,(function*(){return yield this.callNative(Xt.WEBVIEW_SET_RESULT,{result:Mi(e.data)})}))}static onCallbackData(e){return i(this,void 0,void 0,(function*(){yield this.events.on(exports.Events.OnDataCallback,(t=>{e({data:t})}))}))}}class Qn extends qi{constructor(){var e,t,i,r,a,s,l,c,u,d,p,h,v,f,m,g,y;super(),gn.set(this,Ft),yn.set(this,Gt),_n.set(this,Ht),En.set(this,void 0),Sn.set(this,void 0),An.set(this,void 0),Tn.set(this,null),bn.set(this,{timer:{getToken:0}}),On.set(this,void 0),wn.set(this,void 0),Nn.set(this,null),this.events=Gi.getInstance(),this.isIOS=Pi().isIOS,Pn.set(this,void 0),this.getActionBarConfig=()=>n(this,Pn,"f"),this.setActionBarConfig=e=>{o(this,Pn,e(n(this,Pn,"f")),"f")},Cn.set(this,(()=>new Promise(((e,t)=>{Mt.isUndefined(n(this,Nn,"f"))||Mt.isNull(n(this,Nn,"f"))?this.callNative(Xt.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=i.find((e=>e.name===Vt));n&&(this.setJSToken(n.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(n.value)),o(this,Nn,i,"f"),e(i)})).catch((e=>{t(e)})):e(n(this,Nn,"f"))})))),In.set(this,rn.setNavigationBarRightButton),this.getVersion=on.getVersion,this.getSystemInfo=on.getSystemInfo,this.setNavigationBarTitle=rn.setNavigationBarTitle,this.setNavigationBarColor=rn.setNavigationBarColor,this.setNavigationBarLeftButton=rn.setNavigationBarLeftButton,this.setBackgroundColor=an.setBackgroundColor,this.setDeviceOrientation=cn.setDeviceOrientation,this.setStorage=Gn.setStorage,this.getStorage=Gn.getStorage,this.getStorageInfo=Gn.getStorageInfo,this.removeStorage=Gn.removeStorage,this.clearStorage=Gn.clearStorage,this.getUserInfo=Hn.getUserInfo,this.getNetworkType=cn.getNetworkType,this.onNetworkStatusChange=cn.onNetworkStatusChange,this.startBeaconDiscovery=cn.startBeaconDiscovery,this.stopBeaconDiscovery=cn.stopBeaconDiscovery,this.getBeacons=cn.getBeacons,this.closeApp=$n.closeApp,this.getLocation=Vn.getLocation,this.stopBluetoothDevicesDiscovery=cn.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=cn.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=cn.openBluetoothAdapter,this.onBluetoothDeviceFound=cn.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=cn.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=cn.getConnectedBluetoothDevices,this.getBluetoothDevices=cn.getBluetoothDevices,this.getBluetoothAdapterState=cn.getBluetoothAdapterState,this.closeBluetoothAdapter=cn.closeBluetoothAdapter,this.scanQRCode=cn.scanQRCode,this.openProfile=Jn.openProfile,this.openChat=Jn.openChat,this.openPostFeed=Jn.openPostFeed,this.followOA=Jn.followOA,this.unFollowOA=Jn.unfollowOA,this.openShareSheet=Jn.openShareSheet,this.requestCameraPermission=Zn.requestCameraPermission,this.createShortcut=Jn.createShortcut,this.openBioAuthentication=cn.openBioAuthentication,this.checkStateBioAuthentication=cn.checkStateBioAuthentication,this.sendLocation=Vn.sendLocation,this.showToast=cn.showToast,this.hideKeyboard=cn.hideKeyboard,this.openPhone=cn.openPhone,this.openSMS=cn.openSMS,this.viewOAQr=Jn.viewOAQr,this.keepScreen=cn.keepScreen,this.saveImageToPhotosAlbum=Zn.saveImageToPhotosAlbum,this.openMiniApp=$n.openMiniApp,this.vibrate=cn.vibrate,this.openWebview=$n.openWebview,this.getRouteParams=Kn.getRouteParams,this.getAppInfo=on.getAppInfo,this.sendDataToPreviousMiniApp=Kn.sendDataToPreviousMiniApp,this.onCallbackData=Kn.onCallbackData,this.getPhoneNumber=Hn.getPhoneNumber,this.openProfilePicker=Jn.openProfilePicker,kn.set(this,Jn.getActionsSupported),this.connectWifi=cn.connectWifi,this.openMediaPicker=Jn.openMediaPicker,this.openOutApp=Jn.openOutApp,this.closeLoading=$n.closeLoading,o(this,En,null,"f"),o(this,Sn,null,"f"),o(this,An,null,"f"),this.isShowNavBar=!0,o(this,On,0,"f"),o(this,wn,0,"f");const _="home"===(null===(t=null===(e=n(this,_n,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(r=null===(i=n(this,_n,"f"))||void 0===i?void 0:i.app)||void 0===r?void 0:r.leftButton)?pi:hi,E=new URL(location.href),S=Mt.isString(null===(s=null===(a=n(this,_n,"f"))||void 0===a?void 0:a.app)||void 0===s?void 0:s.headerColor)&&(null===(u=null===(c=null===(l=n(this,_n,"f"))||void 0===l?void 0:l.app)||void 0===c?void 0:c.headerColor)||void 0===u?void 0:u.length)>0?5:6,A="none"===(null===(p=null===(d=n(this,_n,"f"))||void 0===d?void 0:d.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(v=null===(h=n(this,_n,"f"))||void 0===h?void 0:h.app)||void 0===v?void 0:v.leftButton)?di:ui;o(this,Pn,{actionbarType:S,buttonType:A,dataConfig:{backgroundColor:(null===(m=null===(f=n(this,_n,"f"))||void 0===f?void 0:f.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(y=null===(g=n(this,_n,"f"))||void 0===g?void 0:g.app)||void 0===y?void 0:y.textColor)||"",viewInLeftType:A,confirmToExit:1},homeConfig:{enable:_,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return Qn.instance||(Qn.instance=new Qn),Qn.instance}getLoginStatus(){return Mt.isString(n(this,An,"f"))&&n(this,An,"f").length>0}getAppId(){return n(this,yn,"f")}getZAppId(){return n(this,gn,"f")}login(e){return i(this,void 0,void 0,(function*(){const e=yield n(this,Cn,"f").call(this),t=e.find((e=>e.name===$t)),i=e.find((e=>e.name===Zt));if(!Mt.isUndefined(t)&&!Mt.isNull(t)&&Mt.isString(t.value)){if(o(this,En,t.value,"f"),Mt.isUndefined(i)||Mt.isNull(i)||!Mt.isString(i.value)?yield this.loginZaloV3():(o(this,Sn,i.value,"f"),yield this.loginZaloV4()),!n(this,An,"f"))throw Ei.loginFailed();return n(this,An,"f")}throw Ei.loginFailed()}))}loginZaloV3(){return i(this,void 0,void 0,(function*(){return yield fetch(`${Qt}?app_id=${n(this,gn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${n(this,yn,"f")}/&code=${n(this,En,"f")}&isSDK=true123`).then((e=>i(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){o(this,An,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return o(this,wn,e,"f"),o(this,On,(new Date).getTime(),"f"),this.setZAccSession(n(this,An,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n(this,An,"f")||""),n(this,An,"f")}return null}))))}))}loginZaloV4(){return i(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",n(this,yn,"f")),e.append("code",n(this,En,"f")||""),e.append("code_verifier",n(this,Sn,"f")||""),Mt.isNull(n(this,Tn,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",n(this,Tn,"f")||""));return yield fetch(Kt,Object.assign({method:"POST",body:e},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).then((e=>i(this,void 0,void 0,(function*(){const t=yield e.json();if(t.refresh_token&&o(this,Tn,t.refresh_token,"f"),t.access_token){o(this,An,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return o(this,wn,e,"f"),o(this,On,(new Date).getTime(),"f"),this.setZAccSession(n(this,An,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n(this,An,"f")||""),n(this,An,"f")}return null}))))}))}getAccessToken(e){return i(this,void 0,void 0,(function*(){const e=(new Date).getTime()-n(this,On,"f");if(!n(this,An,"f"))throw Ei.loginRequired();return e<n(this,wn,"f")?n(this,An,"f"):yield this.login()}))}}gn=new WeakMap,yn=new WeakMap,_n=new WeakMap,En=new WeakMap,Sn=new WeakMap,An=new WeakMap,Tn=new WeakMap,bn=new WeakMap,On=new WeakMap,wn=new WeakMap,Nn=new WeakMap,Pn=new WeakMap,Cn=new WeakMap,In=new WeakMap,kn=new WeakMap;class qn{constructor(){Rn.set(this,Ft),Bn.set(this,Ht),Dn.set(this,"DEFAULT ZOAUTH"),jn.set(this,"DEFAULT ACCESS TOKEN"),Ln.set(this,{timer:{getToken:0}}),Mn.set(this,!1),this.getLoginStatus=()=>n(this,Mn,"f"),this.getAppId=()=>n(this,Rn,"f"),this.login=()=>(o(this,Mn,!0,"f"),Promise.resolve(n(this,Dn,"f"))),this.getAccessToken=()=>Promise.resolve(n(this,jn,"f")),this.getVersion=on.getVersion,this.getSystemInfo=on.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>i(this,void 0,void 0,(function*(){const t=new zn(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>i(this,void 0,void 0,(function*(){const t=new zn(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>i(this,void 0,void 0,(function*(){const e=new zn(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>i(this,void 0,void 0,(function*(){const t=new zn(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>i(this,void 0,void 0,(function*(){const e=new zn(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let e;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":e=exports.NetworkType.none;break;case"4g":e=exports.NetworkType.wifi;break;case"3g":case"2g":e=exports.NetworkType.cellular;break;default:e=exports.NetworkType.unknown}const t={networkType:e};return Promise.resolve(t)},this.onNetworkStatusChange=e=>{const t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=t.effectiveType;return t.addEventListener("change",(function(){let t;switch(i){case"none":t=exports.NetworkType.none;break;case"4g":t=exports.NetworkType.wifi;break;case"3g":case"2g":t=exports.NetworkType.cellular;break;default:t=exports.NetworkType.unknown}e({isConnected:!0,networkType:t})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e.url),Promise.resolve()),this.getRouteParams=Kn.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve([])),this.connectWifi=()=>(console.warn("This api only works on zalo app"),Promise.resolve()),this.openOutApp=e=>(location.href=e,Promise.resolve()),this.closeLoading=e=>Promise.resolve()}on(e,t,i){throw new Error("Method not implemented.")}once(e,t,i){throw new Error("Method not implemented.")}off(e,t,i,n){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}openMediaPicker(e,t,i,n){return console.warn("This api only works on zalo app"),Promise.resolve({urls:[]})}}Rn=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap;const Yn=Symbol("required"),Xn=Symbol("checkType"),eo=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(Yn,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(Yn,r,i,n)},to=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(Xn,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(Xn,a,n,o)};const io=(e,t,i)=>{const n=i.value,o=n.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return i.value=function(){const i=Reflect.getOwnMetadata(Yn,e,t),r=Reflect.getOwnMetadata(Xn,e,t);return r&&r.forEach((e=>{const{parameterIndex:t,type:i,properties:n,defaultValue:r}=e;let a=arguments[t],s=o[t];const l=typeof a;if(!Mt.isUndefined(a)){if(!Ri(a,i))throw Ei.wrongTypeParam(s,i,Array.isArray(a)?"array":null===a?"null":l);"object"===i&&Object.entries(n).forEach((([e,i])=>{const n=e.split("?")[0],o=Mt.get(a,n);if(Mt.isUndefined(o)||Mt.isNull(o)){if(!e.includes("?"))throw Ei.missingParam(e);Mt.isObject(Mt.get(a,n.split(".")[0]))&&r&&!Mt.isUndefined(Mt.get(r,n))&&Mt.set(arguments[t],n,Mt.get(r,n))}else if(Mt.isFunction(i)){const e=i(o);if(e&&e.error)throw Ei.wrongTypeParam(`${s}.${n}`,e.errorMessage,typeof o)}}))}})),i&&i.forEach((e=>{const{parameterIndex:t,option:i,fields:n}=e,o=arguments[t],r=null==i?void 0:i.if,a=null==i?void 0:i.defaultValue;let s=!0;r&&(s=Object.keys(r).every((e=>Mt.get(o,e)===r[e]))),s&&n.forEach((e=>{const i=e=>{let i=!1;return Mt.isEmpty(Mt.get(o,e))&&(Mt.isUndefined(Mt.get(a,e))||Mt.set(arguments[t],e,Mt.get(a,e)),i=!0),i};if(Array.isArray(e)&&e.length>0&&e.every(i))throw Ei.missingParam(e.join(" or "));if(Mt.isString(e)&&i(e))throw Ei.missingParam(e)}))})),n.apply(this,arguments)},i};var no;class oo{constructor(){this.events=Gi.getInstance(),no.set(this,void 0),o(this,no,this.getServiceInstance(),"f"),this.events.addListener=(e,t,i)=>{const n=e;return this.events.addListener(exports.Events[n],t,i)}}login(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").login(e)}))}getLoginStatus(){return n(this,no,"f").getLoginStatus()}getAccessToken(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getAccessToken(e)}))}getVersion(){return n(this,no,"f").getVersion()}getSystemInfo(){return n(this,no,"f").getSystemInfo()}setNavigationBarTitle(e){return i(this,void 0,void 0,(function*(){return n(this,no,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setDeviceOrientation(e)}))}setStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").setStorage(e)}))}getStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getStorage(e)}))}getStorageInfo(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getStorageInfo(e)}))}removeStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").removeStorage(e)}))}clearStorage(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").clearStorage(e)}))}getUserInfo(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getUserInfo(e)}))}getNetworkType(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getBeacons(e)}))}closeApp(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").closeApp(e)}))}getLocation(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").closeBluetoothAdapter()}))}scanQRCode(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").scanQRCode(e)}))}openProfile(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openProfile(e)}))}openChat(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openChat(e)}))}openPostFeed(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openPostFeed(e)}))}followOA(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").followOA(e)}))}unfollowOA(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").unFollowOA(e)}))}openShareSheet(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openShareSheet(e)}))}requestCameraPermission(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").requestCameraPermission(e)}))}createShortcut(e){return i(this,void 0,void 0,(function*(){const t=yield zi(Gt,0),i=Pi().isIOS,o=t.logoUrl||Ci("og:image:url")||"",r=t.name||document.title,a=e.params?new URLSearchParams(e.params):new URLSearchParams;if(a.append("utm_source","zalo-shortcut"),a.append("utm_medium","default"),a.append("utm_campaign","default"),i){a.append("appId",Gt),a.append("appName",r),a.append("appIcon",o);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield n(this,no,"f").openOutApp(encodeURI(e))}else yield n(this,no,"f").createShortcut(`https://zalo.me/app/link/zapps/${Gt}/?${a.toString()}`,r,o);return _i()}))}openBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").sendLocation(e)}))}showToast(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").showToast(e)}))}hideKeyboard(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").hideKeyboard(e)}))}openPhone(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").openPhone(e)}))}openSMS(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openSMS(e)}))}viewOAQr(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").viewOAQr(e)}))}keepScreen(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").keepScreen(e)}))}saveImageToGallery(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return i(this,void 0,void 0,(function*(){if(!Mt.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield n(this,no,"f").openMiniApp(e)}))}vibrate(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").vibrate(e)}))}openWebview(e){return i(this,void 0,void 0,(function*(){yield n(this,no,"f").openWebview(e)}))}getRouteParams(){return n(this,no,"f").getRouteParams()}getAppInfo(e){return n(this,no,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return n(this,no,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").onCallbackData(e)}))}getPhoneNumber(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").getPhoneNumber()}))}openProfilePicker(e){return i(this,void 0,void 0,(function*(){const t=yield n(this,no,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(qt,{method:"POST",headers:{"Content-Type":"application/json",access_token:e||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})}),o=yield n.json();if(0!==o.error||!o.data)throw new Error(o.message);i=t.map((e=>{var t,i,n,r,a,s,l,c,u,d,p;return{id:(null===(i=null===(t=o.data[e])||void 0===t?void 0:t.user_info)||void 0===i?void 0:i.user_id_by_app)||"",profile:{name:null===(r=null===(n=o.data[e])||void 0===n?void 0:n.user_info)||void 0===r?void 0:r.name,avatar:null===(c=null===(l=null===(s=null===(a=o.data[e])||void 0===a?void 0:a.user_info)||void 0===s?void 0:s.picture)||void 0===l?void 0:l.data)||void 0===c?void 0:c.url},code:0!==(null===(u=o.data[e])||void 0===u?void 0:u.error)?-1:0,message:`Get profile: ${Mt.isUndefined(null===(d=o.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=o.data[e])||void 0===p?void 0:p.message}`}}))}catch(e){i=t.map((t=>({id:t,profile:{name:"",avatar:""},code:-1,message:`Can't get profile: ${e.message}`})))}return{users:i||[]}}))}connectWifi(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").connectWifi(e)}))}openMediaPicker(e){var t,o,r;return i(this,void 0,void 0,(function*(){const i={};Mt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(o=e.editView)||void 0===o?void 0:o.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio;const a=!0===e.silentRequest?1:0,s=e.maxSelectItem;return yield n(this,no,"f").openMediaPicker(e.type,i,a,s)}))}getShareableLink(e){return i(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return(yield Ui(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)).shareableLink}))}closeLoading(e){return i(this,void 0,void 0,(function*(){return yield n(this,no,"f").closeLoading("user action")}))}}no=new WeakMap,e([gi],oo.prototype,"login",null),e([yi],oo.prototype,"getLoginStatus",null),e([gi],oo.prototype,"getAccessToken",null),e([yi],oo.prototype,"getVersion",null),e([yi],oo.prototype,"getSystemInfo",null),e([gi,io,t(0,to("object",{title:Wi("string")}))],oo.prototype,"setNavigationBarTitle",null),e([gi,io,t(0,to("object",{color:Wi("string"),"textColor?":Wi("string",{values:["white","black"]}),"statusBarColor?":Wi("string")}))],oo.prototype,"setNavigationBarColor",null),e([gi,io,t(0,to("object",{backgroundColor:Wi("string"),"textColor?":Wi("string",{values:["white","black"]})}))],oo.prototype,"setBackgroundColor",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["none","back","home","both"]})}))],oo.prototype,"setNavigationBarLeftButton",null),e([gi,io,t(0,to("object",{rotate:Wi("string",{values:["auto","portrait","landscape"]})}))],oo.prototype,"setDeviceOrientation",null),e([gi,io,t(0,to("object",{data:Wi("object")}))],oo.prototype,"setStorage",null),e([gi,io,t(0,to("object",{keys:Wi("array<string>")}))],oo.prototype,"getStorage",null),e([gi],oo.prototype,"getStorageInfo",null),e([gi,io,t(0,to("object",{keys:Wi("array<string>")}))],oo.prototype,"removeStorage",null),e([gi],oo.prototype,"clearStorage",null),e([gi,io,t(0,to("object",{"avatarType?":Wi("string",{values:["small","normal","large"]})}))],oo.prototype,"getUserInfo",null),e([gi],oo.prototype,"getNetworkType",null),e([gi],oo.prototype,"onNetworkStatusChange",null),e([gi],oo.prototype,"startBeaconDiscovery",null),e([gi],oo.prototype,"stopBeaconDiscovery",null),e([gi],oo.prototype,"getBeacons",null),e([gi],oo.prototype,"closeApp",null),e([gi],oo.prototype,"getLocation",null),e([gi],oo.prototype,"stopBluetoothDevicesDiscovery",null),e([gi],oo.prototype,"startBluetoothDevicesDiscovery",null),e([gi],oo.prototype,"openBluetoothAdapter",null),e([gi],oo.prototype,"onBluetoothDeviceFound",null),e([gi],oo.prototype,"onBluetoothAdapterStateChange",null),e([gi],oo.prototype,"getConnectedBluetoothDevices",null),e([gi],oo.prototype,"getBluetoothDevices",null),e([gi],oo.prototype,"getBluetoothAdapterState",null),e([gi],oo.prototype,"closeBluetoothAdapter",null),e([gi],oo.prototype,"scanQRCode",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["user","oa","aliasOA"]}),id:Wi("string")}))],oo.prototype,"openProfile",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["user","oa"]}),id:Wi("string")}))],oo.prototype,"openChat",null),e([gi,io,t(0,eo(["data.imageUrl"],{if:{type:"image"}})),t(0,eo(["data.link"],{if:{type:"link"}})),t(0,eo(["data.id"],{if:{type:"profile"}})),t(0,to("object",{type:Wi("string",{values:["image","link","profile"]}),data:Wi("object"),"data.imageUrl?":Wi("url"),"data.link?":Wi("url"),"data.title?":Wi("string"),"data.thumb?":Wi("url"),"data.description?":Wi("string"),"data.avatar?":Wi("url"),"data.id?":Wi("string"),"data.displayName?":Wi("string")}))],oo.prototype,"openPostFeed",null),e([gi,io,t(0,to("object",{id:Wi("string"),"showDialogConfirm?":Wi("boolean")}))],oo.prototype,"followOA",null),e([gi,io,t(0,to("object",{id:Wi("string")}))],oo.prototype,"unfollowOA",null),e([gi,io,t(0,eo([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),t(0,eo(["data.link"],{if:{type:"link"}})),t(0,eo(["data.id"],{if:{type:"oa"}})),t(0,eo(["data.gifUrl"],{if:{type:"gif"}})),t(0,eo(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),t(0,eo(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),t(0,to("object",{type:Wi("string",{values:["image","gif","video","link","oa","zmp"]}),data:Wi("object"),"data.imageUrl?":Wi("url"),"data.imageUrls?":Wi("array<url>",{maxLength:10}),"data.caption?":Wi("string"),"data.gifUrl?":Wi("url"),"data.width?":Wi("number"),"data.height?":Wi("number"),"data.videoThumb?":Wi("url"),"data.videoUrl?":Wi("url"),"data.link?":Wi("url"),"data.chatOnly?":Wi("boolean"),"data.id?":Wi("string"),"data.thumbnail?":Wi("url"),"data.path?":Wi("string"),"data.title?":Wi("string",{maxLength:100}),"data.description?":Wi(["string"],{maxLength:400})}))],oo.prototype,"openShareSheet",null),e([gi],oo.prototype,"requestCameraPermission",null),e([gi],oo.prototype,"createShortcut",null),e([gi,io,t(0,to("object",{secretData:Wi("string"),"ui?":Wi("object"),"ui.title?":Wi("string"),"ui.subTitle?":Wi("string"),"ui.negativeButtonText?":Wi("string"),"requireFingerprint?":Wi("boolean")},{requireFingerprint:!0,ui:{title:"Xác thực",subTitle:"Sử dụng sinh trắc học của bạn để xác thực",negativeButtonText:"Đóng"}}))],oo.prototype,"openBioAuthentication",null),e([gi],oo.prototype,"checkStateBioAuthentication",null),e([gi,io,t(0,to("object",{toUserId:Wi("string"),"title?":Wi("string")}))],oo.prototype,"sendLocation",null),e([gi,io,t(0,to("object",{message:Wi("string")}))],oo.prototype,"showToast",null),e([gi],oo.prototype,"hideKeyboard",null),e([gi,io,t(0,to("object",{phoneNumber:Wi("string")}))],oo.prototype,"openPhone",null),e([gi,io,t(0,to("object",{content:Wi("string"),phoneNumber:Wi("string",{regex:/^\+?\d+$/})}))],oo.prototype,"openSMS",null),e([gi,io,t(0,to("object",{id:Wi("string"),"displayName?":Wi("string")},{displayName:""}))],oo.prototype,"viewOAQr",null),e([gi],oo.prototype,"keepScreen",null),e([gi,io,t(0,to("object",{"imageBase64Data?":Wi("string"),"imageUrl?":Wi("url")}))],oo.prototype,"saveImageToGallery",null),e([gi,io,t(0,to("object",{"imageBase64Data?":Wi("string"),"imageUrl?":Wi("url")}))],oo.prototype,"saveImageToPhotosAlbum",null),e([gi,io,t(0,to("object",{appId:Wi("string"),"params?":Wi("object")}))],oo.prototype,"openMiniApp",null),e([gi,io,t(0,to("object",{"type?":Wi("string",{values:["oneShot"]}),"milliseconds?":Wi("number")},{type:"oneShot",milliseconds:500}))],oo.prototype,"vibrate",null),e([gi,io,t(0,to("object",{url:Wi("string")}))],oo.prototype,"openWebview",null),e([yi],oo.prototype,"getRouteParams",null),e([gi],oo.prototype,"getAppInfo",null),e([gi],oo.prototype,"sendDataToPreviousMiniApp",null),e([gi],oo.prototype,"onCallbackData",null),e([gi],oo.prototype,"getPhoneNumber",null),e([gi,io,t(0,to("object",{"maxProfile?":Wi("number",{min:1,max:10})},{maxProfile:1}))],oo.prototype,"openProfilePicker",null),e([gi,io,t(0,eo(["SSID"])),t(0,to("object",{SSID:Wi("string"),"password?":Wi("string"),"hiddenSSID?":Wi("boolean")}))],oo.prototype,"connectWifi",null),e([gi,io,t(0,to("object",{type:Wi("string",{values:["photo","video","file","multi_photo","multi_video"]}),"editView?":Wi("object"),"editView.enable?":Wi("boolean"),"editView.aspectRatio?":Wi("string",{regex:/^\d+:\d+$/}),"silentRequest?":Wi("boolean"),"maxSelectItem?":Wi("number",{min:1})}))],oo.prototype,"openMediaPicker",null),e([gi,io,t(0,to("object",{title:Wi("string",{maxLength:100}),"thumbnail?":Wi("url"),"path?":Wi("string"),description:Wi(["string"],{maxLength:400})},{description:""}))],oo.prototype,"getShareableLink",null),e([gi,io],oo.prototype,"closeLoading",null);class ro extends oo{getServiceInstance(){return Qn.getInstance()}}class ao extends oo{getServiceInstance(){return new qn}}const so=Pi();exports.default=void 0,window.onJSCall=e=>function(t){Qi.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){Qi.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){Qi.getInstance().nativeEventHandler(e,t,i)}},so.isZalo?exports.default=new ro:exports.default=new ao,window.ZaloMiniAppSDK=exports.default,exports.SDKCreator=oo,exports.default=exports.default;
package/dist/index.umd.js CHANGED
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function t(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a}function i(e,t){return function(i,n){t(i,n,e)}}function n(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function o(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function r(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i}var a=Object.prototype;var s=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||a)};var l=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),c=Object.prototype.hasOwnProperty;var u=function(e){if(!s(e))return l(e);var t=[];for(var i in Object(e))c.call(e,i)&&"constructor"!=i&&t.push(i);return t},d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var h="object"==typeof d&&d&&d.Object===Object&&d,v="object"==typeof self&&self&&self.Object===Object&&self,f=h||v||Function("return this")(),m=f.Symbol,g=Object.prototype,y=g.hasOwnProperty,_=g.toString,E=m?m.toStringTag:void 0;var S=function(e){var t=y.call(e,E),i=e[E];try{e[E]=void 0;var n=!0}catch(e){}var o=_.call(e);return n&&(t?e[E]=i:delete e[E]),o},A=Object.prototype.toString;var T=function(e){return A.call(e)},O=m?m.toStringTag:void 0;var b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?S(e):T(e)};var w=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var N,P=function(e){if(!w(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},C=f["__core-js_shared__"],I=(N=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var k=function(e){return!!I&&I in e},R=Function.prototype.toString;var B=function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""},D=/^\[object .+?Constructor\]$/,j=Function.prototype,L=Object.prototype,M=j.toString,U=L.hasOwnProperty,W=RegExp("^"+M.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var x=function(e){return!(!w(e)||k(e))&&(P(e)?W:D).test(B(e))};var z=function(e,t){return null==e?void 0:e[t]};var F=function(e,t){var i=z(e,t);return x(i)?i:void 0},G=F(f,"DataView"),H=F(f,"Map"),$=F(f,"Promise"),V=F(f,"Set"),Z=F(f,"WeakMap"),J="[object Map]",K="[object Promise]",Q="[object Set]",q="[object WeakMap]",Y="[object DataView]",X=B(G),ee=B(H),te=B($),ie=B(V),ne=B(Z),oe=b;(G&&oe(new G(new ArrayBuffer(1)))!=Y||H&&oe(new H)!=J||$&&oe($.resolve())!=K||V&&oe(new V)!=Q||Z&&oe(new Z)!=q)&&(oe=function(e){var t=b(e),i="[object Object]"==t?e.constructor:void 0,n=i?B(i):"";if(n)switch(n){case X:return Y;case ee:return J;case te:return K;case ie:return Q;case ne:return q}return t});var re=oe;var ae=function(e){return null!=e&&"object"==typeof e};var se=function(e){return ae(e)&&"[object Arguments]"==b(e)},le=Object.prototype,ce=le.hasOwnProperty,ue=le.propertyIsEnumerable,de=se(function(){return arguments}())?se:function(e){return ae(e)&&ce.call(e,"callee")&&!ue.call(e,"callee")},pe=Array.isArray;var he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve=function(e){return null!=e&&he(e.length)&&!P(e)};var fe=function(){return!1},me=p((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i?f.Buffer:void 0,r=(o?o.isBuffer:void 0)||fe;e.exports=r})),ge={};ge["[object Float32Array]"]=ge["[object Float64Array]"]=ge["[object Int8Array]"]=ge["[object Int16Array]"]=ge["[object Int32Array]"]=ge["[object Uint8Array]"]=ge["[object Uint8ClampedArray]"]=ge["[object Uint16Array]"]=ge["[object Uint32Array]"]=!0,ge["[object Arguments]"]=ge["[object Array]"]=ge["[object ArrayBuffer]"]=ge["[object Boolean]"]=ge["[object DataView]"]=ge["[object Date]"]=ge["[object Error]"]=ge["[object Function]"]=ge["[object Map]"]=ge["[object Number]"]=ge["[object Object]"]=ge["[object RegExp]"]=ge["[object Set]"]=ge["[object String]"]=ge["[object WeakMap]"]=!1;var ye=function(e){return ae(e)&&he(e.length)&&!!ge[b(e)]};var _e=function(e){return function(t){return e(t)}},Ee=p((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&h.process,r=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=r})),Se=Ee&&Ee.isTypedArray,Ae=Se?_e(Se):ye,Te=Object.prototype.hasOwnProperty;var Oe=function(e){if(null==e)return!0;if(ve(e)&&(pe(e)||"string"==typeof e||"function"==typeof e.splice||me(e)||Ae(e)||de(e)))return!e.length;var t=re(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!u(e).length;for(var i in e)if(Te.call(e,i))return!1;return!0};var be=function(e){return void 0===e};var we=function(e){return null===e};var Ne=function(e){return"string"==typeof e||!pe(e)&&ae(e)&&"[object String]"==b(e)};var Pe=function(e){return"number"==typeof e||ae(e)&&"[object Number]"==b(e)};var Ce=function(e){return ae(e)&&"[object RegExp]"==b(e)},Ie=Ee&&Ee.isRegExp,ke=Ie?_e(Ie):Ce;var Re=function(e){return"symbol"==typeof e||ae(e)&&"[object Symbol]"==b(e)},Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,De=/^\w*$/;var je=function(e,t){if(pe(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Re(e))||(De.test(e)||!Be.test(e)||null!=t&&e in Object(t))},Le=F(Object,"create");var Me=function(){this.__data__=Le?Le(null):{},this.size=0};var Ue=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},We=Object.prototype.hasOwnProperty;var xe=function(e){var t=this.__data__;if(Le){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return We.call(t,e)?t[e]:void 0},ze=Object.prototype.hasOwnProperty;var Fe=function(e){var t=this.__data__;return Le?void 0!==t[e]:ze.call(t,e)};var Ge=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};function He(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}He.prototype.clear=Me,He.prototype.delete=Ue,He.prototype.get=xe,He.prototype.has=Fe,He.prototype.set=Ge;var $e=He;var Ve=function(){this.__data__=[],this.size=0};var Ze=function(e,t){return e===t||e!=e&&t!=t};var Je=function(e,t){for(var i=e.length;i--;)if(Ze(e[i][0],t))return i;return-1},Ke=Array.prototype.splice;var Qe=function(e){var t=this.__data__,i=Je(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ke.call(t,i,1),--this.size,!0)};var qe=function(e){var t=this.__data__,i=Je(t,e);return i<0?void 0:t[i][1]};var Ye=function(e){return Je(this.__data__,e)>-1};var Xe=function(e,t){var i=this.__data__,n=Je(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function et(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}et.prototype.clear=Ve,et.prototype.delete=Qe,et.prototype.get=qe,et.prototype.has=Ye,et.prototype.set=Xe;var tt=et;var it=function(){this.size=0,this.__data__={hash:new $e,map:new(H||tt),string:new $e}};var nt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ot=function(e,t){var i=e.__data__;return nt(t)?i["string"==typeof t?"string":"hash"]:i.map};var rt=function(e){var t=ot(this,e).delete(e);return this.size-=t?1:0,t};var at=function(e){return ot(this,e).get(e)};var st=function(e){return ot(this,e).has(e)};var lt=function(e,t){var i=ot(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ct(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ct.prototype.clear=it,ct.prototype.delete=rt,ct.prototype.get=at,ct.prototype.has=st,ct.prototype.set=lt;var ut=ct;function dt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var a=e.apply(this,n);return i.cache=r.set(o,a)||r,a};return i.cache=new(dt.Cache||ut),i}dt.Cache=ut;var pt=dt;var ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vt=/\\(\\)?/g,ft=function(e){var t=pt(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ht,(function(e,i,n,o){t.push(n?o.replace(vt,"$1"):i||e)})),t}));var mt=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o},gt=m?m.prototype:void 0,yt=gt?gt.toString:void 0;var _t=function e(t){if("string"==typeof t)return t;if(pe(t))return mt(t,e)+"";if(Re(t))return yt?yt.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var Et=function(e){return null==e?"":_t(e)};var St=function(e,t){return pe(e)?e:je(e,t)?[e]:ft(Et(e))};var At=function(e){if("string"==typeof e||Re(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var Tt=function(e,t){for(var i=0,n=(t=St(t,e)).length;null!=e&&i<n;)e=e[At(t[i++])];return i&&i==n?e:void 0};var Ot=function(e,t,i){var n=null==e?void 0:Tt(e,t);return void 0===n?i:n},bt=function(){try{var e=F(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var wt=function(e,t,i){"__proto__"==t&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},Nt=Object.prototype.hasOwnProperty;var Pt=function(e,t,i){var n=e[t];Nt.call(e,t)&&Ze(n,i)&&(void 0!==i||t in e)||wt(e,t,i)},Ct=/^(?:0|[1-9]\d*)$/;var It=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Ct.test(e))&&e>-1&&e%1==0&&e<t};var kt=function(e,t,i,n){if(!w(e))return e;for(var o=-1,r=(t=St(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var l=At(t[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=a){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=w(u)?u:It(t[o+1])?[]:{})}Pt(s,l,c),s=s[l]}return e};var Rt,Bt,Dt,jt,Lt,Mt,Ut,Wt,xt,zt,Ft,Gt={isEmpty:Oe,isNull:we,isUndefined:be,isFunction:P,isObject:w,isString:Ne,isNumber:Pe,isArray:pe,isRegExp:ke,get:Ot,set:function(e,t,i){return null==e?e:kt(e,t,i)}};function Ht(e){return"function"==typeof window.Debug?window.Debug(e):function(...t){"development"===process.env.NODE_ENV&&console.log(e,...t)}}e.NetworkType=void 0,(Rt=e.NetworkType||(e.NetworkType={})).none="none",Rt.wifi="wifi",Rt.cellular="cellular",Rt.unknown="unknown",e.PlatformType=void 0,(Bt=e.PlatformType||(e.PlatformType={})).wp="wp",Bt.android="android",Bt.iOS="iOS",Bt.unknown="unknown",e.ProfileType=void 0,(Dt=e.ProfileType||(e.ProfileType={}))[Dt.user=1]="user",Dt[Dt.oa=0]="oa",Dt[Dt.aliasOA=2]="aliasOA",e.ChatType=void 0,(jt=e.ChatType||(e.ChatType={}))[jt.user=1]="user",jt[jt.oa=0]="oa",e.PostFeedType=void 0,(Lt=e.PostFeedType||(e.PostFeedType={}))[Lt.image=1]="image",Lt[Lt.link=4]="link",Lt[Lt.profile=5]="profile",e.ShareSheetType=void 0,(Mt=e.ShareSheetType||(e.ShareSheetType={}))[Mt.image=1]="image",Mt[Mt.gif=11]="gif",Mt[Mt.video=12]="video",Mt[Mt.link=4]="link",Mt[Mt.oa=5]="oa",Mt[Mt.zmp=20]="zmp",e.OrientationType=void 0,(Ut=e.OrientationType||(e.OrientationType={}))[Ut.auto=1]="auto",Ut[Ut.portrait=2]="portrait",Ut[Ut.landscape=3]="landscape",e.VibrateType=void 0,(Wt=e.VibrateType||(e.VibrateType={}))[Wt.oneShot=0]="oneShot",e.NativeCode=void 0,(xt=e.NativeCode||(e.NativeCode={}))[xt.token_invalid=-2]="token_invalid",xt[xt.not_permission=-1]="not_permission",xt[xt.client_not_support=-5]="client_not_support",xt[xt.decode_failed=-4]="decode_failed",e.Events=void 0,(zt=e.Events||(e.Events={})).AppPaused="h5.event.paused",zt.AppResumed="h5.event.resumed",zt.NetworkChanged="h5.event.connection.changed",zt.OnDataCallback="h5.event.webview.result",zt.OpenApp="h5.event.open.mp",e.MediaPickerType=void 0,(Ft=e.MediaPickerType||(e.MediaPickerType={}))[Ft.photo=4]="photo",Ft[Ft.video=5]="video",Ft[Ft.file=6]="file",Ft[Ft.multi_photo=7]="multi_photo",Ft[Ft.multi_video=8]="multi_video";const $t=e=>{const t=document.cookie;if(t){const o=t.split("; ");if(o&&o.length>0)for(var i=e.length+1,n=o.length-1;n>=0;n--){let t=o[n];if(t&&0===t.indexOf(e)&&(t=t.substring(i,t.length),t))return t=t.replace(/["']/g,""),t}}return null},Vt=e=>$t(`${window.location.host}_`+e),Zt=e=>$t((()=>{const e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""})()+e),Jt=1048576,Kt=window.zAppID,Qt=window.APP_ID,qt=window.APP_CONFIG||{},Yt="h5.zdn.vn_zoauth",Xt="h5.zdn.vn_zlink3rd",ei="h5.zdn.vn_zoauth_vrf",ti="https://graph.zalo.me/v2.0/me",ii="https://h5.zalo.me/openapi/access_token",ni="https://oauth.zaloapp.com/v3/access_token",oi="https://graph.zalo.me/v2.0/me/friends/list",ri=5*Jt,ai=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),si={GET_DOWNLOADED_STICKER:{name:"action.get.downloaded.sticker",have_callback:!0},OPEN_SHARE_STICKER:{name:"action.open.share.sticker"},OPEN_PROFILE:{name:"action.open.profile"},OPEN_FEED_DETAIL:{name:"action.open.feeddetail"},OPEN_FRIEND_RADA:{name:"action.open.friendrada"},OPEN_INAPP:{name:"action.open.inapp"},OPEN_OUTAPP:{name:"action.open.outapp"},OPEN_PAGE:{name:"action.open.page"},OPEN_PHOTODETAIL:{name:"action.open.photodetail"},OPEN_GALARY:{name:"action.open.galary"},OPEN_GAMECENTER:{name:"action.open.gamecenter"},OPEN_GAMENEWS:{name:"action.open.gamenews"},OPEN_TAB_CONTACT:{name:"action.open.tab.contact"},OPEN_TAB_SOCIAL:{name:"action.open.tab.social"},OPEN_FRIENDSUGGEST:{name:"action.open.friendsuggest"},OPEN_GROUPLIST:{name:"action.open.grouplist"},OPEN_NEARBY:{name:"action.open.nearby"},OPEN_ROOM:{name:"action.open.room"},OPEN_STICKERSTORE:{name:"action.open.stickerstore"},OPEN_CREATECHAT:{name:"action.open.createchat"},COPY_LINK_CATESTICKER:{name:"action.copy.link.catesticker"},REQUEST_BUY_STICKER:{name:"action.request.buy.sticker"},OPEN_CHAT:{name:"action.open.chat"},OPEN_TAB_CHAT:{name:"action.open.tab.chat"},OPEN_CHATGROUP:{name:"action.open.chatgroup"},OPEN_ADDFRIEND:{name:"action.open.addfriend"},OPEN_TAB_MORE:{name:"action.open.tab.more"},OPEN_POSTFEED:{name:"action.open.postfeed"},OPEN_LOGINDEVICES:{name:"action.open.logindevices"},OPEN_SENDSTICKER:{name:"action.open.sendsticker"},REPORT_ABUSE:{name:"action.report.abuse",have_callback:!0},FOLLOW_OA:{name:"action.follow.oa",have_callback:!0},UNFOLLOW_OA:{name:"action.unfollow.oa",have_callback:!0},OPEN_GAMEDETAIL:{name:"action.open.gamedetail"},OPEN_SHARESHEET:{name:"action.open.sharesheet",have_callback:!0},REQUEST_PERMISSION_CAMERA:{name:"action.request.permission.camera"},CHANGE_TITLE_HEADER:{name:"action.change.title.header",skip_jump:!0},WEBVIEW_CLEARCACHE:{name:"action.webview.clearcache"},WEBVIEW_CONFIRMCACHE:{name:"action.webview.confirmcache"},WEBVIEW_ISVISIBLE:{name:"action.webview.isvisible"},WEBVIEW_NETWORKTYPE:{name:"action.webview.networktype",skip_jump:!0},CHANGE_BUTTON_HEADER:{name:"action.change.button.header"},CREATE_OPTIONS_MENU:{name:"action.create.options.menu",skip_jump:!0,have_callback:!0},CREATE_SHORTCUT:{name:"action.create.shortcut"},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{name:"action.change.actionbar.leftbutton.type",skip_jump:!0,have_callback:!0},WINDOW_CLOSE:{name:"action.window.close",skip_jump:!0,have_callback:!0},WEBVIEW_CHECKRESERROR:{name:"action.webview.checkResError"},IAP_REQUESTPAYMENT:{name:"action.iap.requestpayment"},ZBROWSER_GETSTATS:{name:"action.zbrowser.getstats"},ZBROWSER_JSBRIDGE:{name:"action.zbrowser.jsbridge",skip_jump:!0,have_callback:!0},PROMPT_AUTHENTICATION:{name:"action.prompt.authentication"},CHANGE_ACTIONBAR_COLOR:{name:"action.change.actionbar.color",skip_jump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{name:"action.prompt.authentication.check_state"},OPEN_APPSTORE:{name:"action.open.appstore"},GET_LOCATION:{name:"action.get.location",have_callback:!0},QUERY_LOCATION_HIDE:{name:"action.query.location.hide",have_callback:!0},SHOW_TOAST:{name:"action.show.toast",have_callback:!0},OPEN_APP:{name:"action.open.app"},HIDE_KEYBOARD:{name:"action.hide.keyboard"},OPEN_PHONE:{name:"action.open.phone"},OPEN_QR:{name:"action.open.qr"},OPEN_SMS:{name:"action.open.sms"},VIEW_MYQR:{name:"action.view.myqr",have_callback:!0},KEEP_SCREEN:{name:"action.keep.screen",have_callback:!0},CHANGE_AUTOROTATE:{name:"action.change.autorotate",skip_jump:!0},CHECK_APP_INSTALLED:{name:"action.check.app.installed"},QUERY_SHOW:{name:"action.query.show"},QUERY_HIDE:{name:"action.query.hide"},OPEN_INAPPRW:{name:"action.open.inapprw"},ZALORUN_GETTRACKINGSTATUS:{name:"action.zalorun.getTrackingStatus",have_callback:!0},ZALORUN_SETTRACKINGSTATUS:{name:"action.zalorun.setTrackingStatus",have_callback:!0},ZALORUN_GETDAYSTEP:{name:"action.zalorun.getDayStep",have_callback:!0},ZALORUN_FORCESUBMITDATA:{name:"action.zalorun.forceSubmitData",have_callback:!0},ZALORUN_SETWEIGHT:{name:"action.zalorun.setWeight",have_callback:!0},OPEN_PROFILE_EXT:{name:"action.open.profile.ext"},DOWNLOAD_CATE:{name:"action.download.cate",have_callback:!0},JUMP_LOGIN:{name:"action.jump.login",skip_jump:!0,white_list:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{name:"action.open.adtima.ads.interstitial"},OPEN_ADTIMA_ADS:{name:"action.open.adtima.ads"},GET_ADIDCLIENT:{name:"action.get.adidclient"},SCAN_IBEACON:{name:"action.scan.ibeacon"},INTERACTIVE_VIBRATION:{name:"action.interactive.vibration"},SAVE_IMAGE_GALLERY:{name:"action.save.image.gallery",version_live:{iOS:408}},OPEN_MP:{name:"action.open.mp",version_live:{iOS:402}},CHANGE_ACTIONBAR:{name:"action.change.actionbar",version_live:{iOS:402},skip_jump:!0},ZBROWSER_MPDS:{name:"action.zbrowser.mpds",version_live:{iOS:402}},WEBVIEW_SET_RESULT:{name:"action.webview.set.result",version_live:{iOS:416}},MP_GET_NUMBER:{name:"action.mp.get.number",version_live:{iOS:416}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432}},GET_SUPPORTED_ACTIONS:{name:"action.get.supported.actions",white_list:!0},MP_JOIN_WIFI:{name:"action.mp.join.wifi",version_live:{android:0,iOS:999},have_permission:!1,white_list:!1},PICK_MEDIA:{name:"action.pick.media",version_live:{iOS:999}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},li=0,ci=-1400,ui=-1500,di=-1401,pi=-1403,hi=-1404,vi={SUCCESS:"Success",READ_MORE:"Read more at: https://miniapp.zalo.me/docs/api",LOGIN_REQUIRED:"Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login",LOGIN_FAILED:"Login failed.",NOT_PERMISSION:"You don't have permission to call this api",CLIENT_NOT_SUPPORT:"This API is not supported in this Zalo version",DECODE_FAILED:"Can not decode your data. Read more at: https://miniapp.zalo.me/docs/api/error"},fi="apps/get-info",mi={android:12100571,iOS:400,wp:0,unknown:0},gi=[si.GET_DOWNLOADED_STICKER.name,si.OPEN_SHARE_STICKER.name,si.OPEN_PROFILE.name,si.OPEN_FEED_DETAIL.name,si.OPEN_FRIEND_RADA.name,si.OPEN_INAPP.name,si.OPEN_OUTAPP.name,si.OPEN_PAGE.name,si.OPEN_PHOTODETAIL.name,si.OPEN_GALARY.name,si.OPEN_GAMECENTER.name,si.OPEN_GAMENEWS.name,si.OPEN_TAB_CONTACT.name,si.OPEN_TAB_SOCIAL.name,si.OPEN_FRIENDSUGGEST.name,si.OPEN_GROUPLIST.name,si.OPEN_NEARBY.name,si.OPEN_ROOM.name,si.OPEN_STICKERSTORE.name,si.OPEN_CREATECHAT.name,si.COPY_LINK_CATESTICKER.name,si.REQUEST_BUY_STICKER.name,si.OPEN_CHAT.name,si.OPEN_TAB_CHAT.name,si.OPEN_CHATGROUP.name,si.OPEN_ADDFRIEND.name,si.OPEN_TAB_MORE.name,si.OPEN_POSTFEED.name,si.OPEN_LOGINDEVICES.name,si.OPEN_SENDSTICKER.name,si.REPORT_ABUSE.name,si.FOLLOW_OA.name,si.UNFOLLOW_OA.name,si.OPEN_GAMEDETAIL.name,si.OPEN_SHARESHEET.name,si.REQUEST_PERMISSION_CAMERA.name,si.CHANGE_TITLE_HEADER.name,si.WEBVIEW_CLEARCACHE.name,si.WEBVIEW_CONFIRMCACHE.name,si.WEBVIEW_ISVISIBLE.name,si.WEBVIEW_NETWORKTYPE.name,si.CHANGE_BUTTON_HEADER.name,si.CREATE_OPTIONS_MENU.name,si.CREATE_SHORTCUT.name,si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,si.WINDOW_CLOSE.name,si.WEBVIEW_CHECKRESERROR.name,si.IAP_REQUESTPAYMENT.name,si.ZBROWSER_GETSTATS.name,si.ZBROWSER_JSBRIDGE.name,si.PROMPT_AUTHENTICATION.name,si.CHANGE_ACTIONBAR_COLOR.name,si.PROMPT_AUTHENTICATION_CHECK_STATE.name,si.OPEN_APPSTORE.name,si.GET_LOCATION.name,si.QUERY_LOCATION_HIDE.name,si.SHOW_TOAST.name,si.OPEN_APP.name,si.HIDE_KEYBOARD.name,si.OPEN_PHONE.name,si.OPEN_QR.name,si.OPEN_SMS.name,si.VIEW_MYQR.name,si.KEEP_SCREEN.name,si.CHANGE_AUTOROTATE.name,si.CHECK_APP_INSTALLED.name,si.QUERY_SHOW.name,si.QUERY_HIDE.name,si.OPEN_INAPPRW.name,si.ZALORUN_GETTRACKINGSTATUS.name,si.ZALORUN_SETTRACKINGSTATUS.name,si.ZALORUN_GETDAYSTEP.name,si.ZALORUN_FORCESUBMITDATA.name,si.ZALORUN_SETWEIGHT.name,si.OPEN_PROFILE_EXT.name,si.DOWNLOAD_CATE.name,si.JUMP_LOGIN.name,si.OPEN_ADTIMA_ADS_INTERSTITIAL.name,si.OPEN_ADTIMA_ADS.name,si.GET_ADIDCLIENT.name,si.SCAN_IBEACON.name,si.SAVE_IMAGE_GALLERY.name,si.OPEN_MP.name,si.CHANGE_ACTIONBAR.name,si.INTERACTIVE_VIBRATION.name,si.ZBROWSER_MPDS.name],yi=0,_i=3,Ei=1,Si=0;class Ai{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class Ti extends Ai{constructor(e,t){super(e,t),this.message=`${t}. ${vi.READ_MORE}`,this.handler()}handler(){switch(this.code){case e.NativeCode.token_invalid:this.code=di,this.message=vi.LOGIN_REQUIRED;break;case e.NativeCode.not_permission:this.code=pi,this.message=vi.NOT_PERMISSION;break;case e.NativeCode.client_not_support:this.code=hi,this.message=vi.CLIENT_NOT_SUPPORT;break;case e.NativeCode.decode_failed:this.message=vi.DECODE_FAILED}}}const Oi={handler:null,setHandler(e){this.handler=e}};Oi.setHandler(((e,t)=>t instanceof Ai?(t.api=e,t):new Ai(-2001,Gt.isNull(t.message)?"Unknown Error":t.message,e)));const bi=(e,t,i)=>{const o=i.value;return i.value=function(...e){return n(this,void 0,void 0,(function*(){const{success:i,fail:r}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>n(this,void 0,void 0,(function*(){try{const t=yield o.apply(this,e);!Gt.isNull(i)&&Gt.isFunction(i)?i.call(null,t,this):a(t)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof vo&&(t=this.getLoginStatus()),t||(e=new Ai(di,vi.LOGIN_REQUIRED))}const{handler:i}=Oi,n=i.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(n.toString()),!Gt.isNull(r)&&Gt.isFunction(r)?r.call(null,n,this):console.error("Error:",n)}}))))}))},i},wi=(e,t,i)=>{const n=i.value;return i.value=function(...e){try{return n.apply(this,e)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof vo&&(t=this.getLoginStatus()),t||(e=new Ai(di,vi.LOGIN_REQUIRED))}const{handler:i}=Oi;!Gt.isNull(i)&&Gt.isFunction(i)?i.call(null,t,e,this):console.warn(e.message)}},i},Ni=(e,t)=>({code:li,message:t||vi.SUCCESS,data:e||{}}),Pi={badRequest:e=>new Ai(ci,e),loginFailed:()=>new Ai(ci,vi.LOGIN_FAILED),loginRequired:()=>new Ai(di,vi.LOGIN_REQUIRED),missingParam:e=>new Ai(ci,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new Ai(ci,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new Ai(ui,"Can not get app info to share"),lengthInvalid:e=>new Ai(ci,`${e} length is invalid.`)};const Ci={encode:function(e){var t=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(void 0===n)return;if(null===n)return void t.push(i);t.push(encodeURIComponent(i)+"="+encodeURIComponent(n))}return t.join("&")},decode:function(e,t){var i={};if(""===e)return i;for(var n=e.split("&"),o=0;o<n.length;o++){var r=n[o].split("=",2),a=decodeURIComponent(r[0]);if(t&&Object.prototype.hasOwnProperty.call(i,a))throw new URIError("Duplicate key: "+a);i[a]=2===r.length?decodeURIComponent(r[1]):null}return i},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Ci.encode(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var i=e.split("=");i&&2==i.length&&(t[i[0]]=decodeURIComponent(i[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e?"undefined":typeof e))return e;var t=Object.keys(e),i=[];return t.map((function(t){var n=e[t],o=[t,n="object"==(void 0===n?"undefined":typeof n)?JSON.stringify(n):encodeURIComponent(n)].join("=");i.push(o)})),i.join("&")}},Ii=new RegExp("[\\u0300-\\u036f]","g"),ki=new RegExp("[đ|Đ]","g"),Ri=new RegExp("\\s","g"),Bi=Ht("zmp:utils:common"),Di=e=>{try{new URL(e)}catch(e){return!1}return!0},ji=()=>navigator.userAgent||navigator.vendor||window.opera,Li=()=>{const e=ji().toLowerCase();return{isWP:/iemobile/.test(e),isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}},Mi=e=>{const t=document.getElementsByTagName("meta");for(let i=0;i<t.length;i++)if(t[i].getAttribute("name")===e||t[i].getAttribute("property")===e)return t[i].getAttribute("content");return""},Ui=()=>{const e=ji().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},Wi=()=>{let t=Li();return t.isWP?e.PlatformType.wp:t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown},xi=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&Di(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!Di(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},zi=e=>(e=>{let t=Vt(e);return t||(t=Zt(e),t)?t:$t(e)})(e),Fi=e=>{if(Gt.isObject(JSON)&&JSON.parse&&Gt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");return JSON.parse(t,((e,t)=>t))}return Gt.isObject(e)?e:new Function("return "+e)()},Gi=e=>{if(Gt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var i=e.length,n=0;n<i;n++)t.push(Gi(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+Gi(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Hi=()=>{try{const e=Number(Ui()),t=Wi();return e>=mi[t]}catch(e){return!0}},$i=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"),Vi=e=>{try{if(e){Bi(e);const t=e.replace(/\\/g,"").replace(/&#39;/g,"'");return Bi("formattedValue",t,JSON.parse(t),typeof JSON.parse(t)),JSON.parse(t)}return null}catch(t){return Bi("parse json error:",t),e}},Zi=(e,t,i,o,r,a)=>n(void 0,void 0,void 0,(function*(){const n=new URL(location.href),s=new URLSearchParams;let l=`${n.pathname}${n.search}`;a&&(l=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const c=new URL(`https://zalo.me/app/link${l}`);s.append("title",i),s.append("description",o||""),s.append("thumbnail",r),s.append("url",c.href),s.append("accessToken",t||"");const u=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),d=yield u.json();if(!d||0!==d.err)throw Pi.cannotGetShareInfo();return c.search=`${c.search}&zshareId=${d.data.shareId}`,Object.assign(Object.assign({},d.data),{shareableLink:c.href})})),Ji=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>xi(i,e))):xi(i,e)))return{error:!0,errorMessage:e};if(t){if(Array.isArray(null==t?void 0:t.values))return{error:!(null==t?void 0:t.values.includes(i)),errorMessage:null==t?void 0:t.values.toString()};if(Gt.isNumber(null==t?void 0:t.maxLength))return{error:(Gt.isString(i)||Gt.isArray(i))&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Gt.isNumber(null==t?void 0:t.min)&&Gt.isNumber(null==t?void 0:t.max))return{error:i<(null==t?void 0:t.min)||i>(null==t?void 0:t.max),errorMessage:`data must be in between ${null==t?void 0:t.min} and ${null==t?void 0:t.max}`};if(Gt.isNumber(null==t?void 0:t.min))return{error:i<(null==t?void 0:t.min),errorMessage:`data must >= ${null==t?void 0:t.min}`};if(Gt.isNumber(null==t?void 0:t.max))return{error:i>(null==t?void 0:t.max),errorMessage:`data must <= ${null==t?void 0:t.max}`};if(Gt.isRegExp(null==t?void 0:t.regex))return{error:!t.regex.test(i),errorMessage:"data must valid"}}return{error:!1}},Ki=(e,t,i)=>n(void 0,void 0,void 0,(function*(){const n={appId:e,versionStatus:t};Gt.isUndefined(i)||(n.currentVersion=i);const o=Ci.appendToUrl(`https://h5.zalo.me/${fi}`,n),r=yield fetch(o,{credentials:"include"});if(r.ok){const e=yield r.json();if(e.err<0||!e.data)throw new Error(e);return{name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl,logoUrl:e.data.logoUrl}}throw new Error("Can't get app info")}));var Qi=p((function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,r=n.length,a=new Array(r);o<r;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,r,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,r),!0;case 6:return u.fn.call(u.context,t,n,o,r,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(d-1);p<d;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,o){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var s=this._events[r];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,r);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[r]=1===c.length?c[0]:c:a(this,r)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}));class qi extends Qi{constructor(){super(),this.debug=Ht("zmp:event-emitter")}static getInstance(){return qi.instance||(qi.instance=new qi),qi.instance}h5ConfirmHandleEvent(e,t,i){ZaloJavaScriptInterface.jsH5EventCallback(e,t,i||"")}on(e,t,i){this.debug(`register ${e}: ${i}`);return super.on(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}once(e,t,i){this.debug(`register once ${e}: ${i}`);return super.once(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}}var Yi={},Xi=function(e,t,i){var n=t||"default";return function(){var t=n in Yi?Yi[n](e,i):e;return t.apply(this,arguments)}};Xi.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];Yi[t]=e};var en={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function tn(e){try{return null===e?en:JSON.parse(e)}catch(e){return en}}var nn,on={execute:function(e,t,i,n){i.suppress_http_code=1;var o=Ci.encode(i);"post"!=t&&(e=Ci.appendToUrl(e,o),o="");var r=function(e,t){if(!self.XMLHttpRequest)return null;var i=new XMLHttpRequest,n=function(){};if(!("withCredentials"in i))return null;i.open(e,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded");var o={send:function(e){i.send(e)}},r=Xi((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=Xi((function(){a=n,"onerror"in o&&o.onerror(i)}),"entry","XMLHttpRequest:error");return i.onload=function(){r()},i.onerror=function(){a()},i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r():a())},o}(t,e);return!!r&&(r.onload=function(e){n(tn(e.responseText))},r.onerror=function(e){e.responseText?n(tn(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class rn extends Qi{constructor(){super(),this.debug=Ht("zmp:ZaloJSBridge"),this.events=qi.getInstance(),this._accessTk=zi("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=zi("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=ji(),this._device=Li(),this._jsCallFuncCallbacks={},this.events.on(e.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3)}static getInstance(){return rn.instance||(rn.instance=new rn),rn.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{on.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Fi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Fi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n)}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=Vi(i);this.debug(n);const o=this.handleEventData(t,n);this.events.emit(t,e,o)}handleEventData(t,i){try{switch(t){case e.Events.OpenApp:const{url:t}=i,n=new URL(t),o=n.pathname.split(`/zapps/${Qt}`)[1];return{path:`${o||"/"}${n.search}`};default:return i}}catch(e){return i}}defaultCallback(e){null!=e&&(e=Fi(e))}jsCall(e,t,i,n=!1,o=3,r=!0){try{const a=e.name,s=((e="")=>`${e.normalize("NFD").replace(Ii,"").replace(ki,"d").replace(Ri,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(a);if(!this._device.isMobile||Gt.isEmpty(a))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a}),!1;null==t&&(t={}),i||(i=this.defaultCallback);const l={error_code:-14,error_message:"Request Timeout!",data:{},action:a};this._jsCallFuncCallbacks[s]={timeout:r&&e.have_callback&&setTimeout((()=>{this.onJSCall(s,l)}),8e3),callback:i};try{return t=Gi(t),n?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onJSCall('${s}')`)}catch(r){if(!(o-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a,js_error:r};return this.onJSCall(s,e),!1}setTimeout((()=>{this.jsCall(e,t,i,n,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class an{constructor(){this.debug=Ht("zmp:ZJSBridgeProvider"),nn.set(this,void 0),r(this,nn,rn.getInstance(),"f")}setZAccSession(e){o(this,nn,"f").accessTk=e}setJSToken(e){o(this,nn,"f").jsAccessTk=e}callNative(e,t,i){return this.debug(e.name,t),new Promise(((r,a)=>{const s=o=>n(this,void 0,void 0,(function*(){try{const n=new Ti(o.error_code,`${o.action}: ${o.error_message}`);if(null==i?void 0:i.callback){const e=yield i.callback(o,n);return r(e)}if(o&&o.error_code>=0)r(o.data||{});else if(o&&o.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e.name}: call native fail`,{extra:{data:t,rs:o}})}catch(e){}return a(n)}}catch(e){return a(e)}})),l=Li().isIOS,c=(e=>{var t;const i=Ui(),n=(null===(t=null==e?void 0:e.version_live)||void 0===t?void 0:t.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e.name))||i>=n})(e);if(l&&!c){const t=new Ti(-5,`${e}: Client isn't support this action`);return a(t)}(null==i?void 0:i.delay)?setTimeout((()=>{o(this,nn,"f").jsCall(e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}),i.delay):o(this,nn,"f").jsCall(e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}))}}nn=new WeakMap;var sn,ln,cn,un,dn,pn="2.18.5-rc.1";class hn{static getVersion(){return pn}static getSystemInfo(){return{version:Mi("version-id")||"",apiVersion:pn,zaloVersion:Ui(),platform:Wi(),language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}static getAppInfo(){return n(this,void 0,void 0,(function*(){const e=this.getAppId(),t=this.getSystemInfo();return yield Ki(e,0,t.version)}))}}class vn{static setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){const t={};let i;Gt.isEmpty(e.textColor)||(t.textColor=e.textColor),Gt.isString(e.color)&&e.color.length>0?(Gt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Gt.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i=6),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{actionbarType:i,dataConfig:Object.assign(Object.assign({},e.dataConfig),t)}))),yield this.callNative(si.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){const t="none"===e.type||"home"===e.type?_i:yi,i="home"===e.type||"both"===e.type?Ei:Si;this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:t,dataConfig:Object.assign(Object.assign({},e.dataConfig),{viewInLeftType:t}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:i})}))),yield this.callNative(si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CREATE_OPTIONS_MENU,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class fn{static setBackgroundColor(e){return n(this,void 0,void 0,(function*(){Gt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(si.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class mn{constructor(e,t,i,n){this.title=n,this.severity=t;const o=new Date;if(this.time=o.toLocaleTimeString(),this.content=e,i>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}sn=new WeakMap,ln=new WeakMap,cn=new WeakMap,un=new WeakMap,dn=new WeakMap;const gn=new class{constructor(){sn.set(this,3),ln.set(this,["none","error","warn","info"]),cn.set(this,"[zmp] > "),un.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),dn.set(this,((e,t,i)=>{o(this,un,"f")[o(this,ln,"f")[e]]++;const n=o(this,ln,"f")[e];if(r(this,cn,o(this,cn,"f")+("string"!=typeof t?new mn(t,n,e,i).toString():t),"f"),!(e>o(this,sn,"f")))switch(e){case 1:console.error(o(this,cn,"f"));break;case 2:console.warn(o(this,cn,"f"));break;case 3:console.info(o(this,cn,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){r(this,sn,e,"f")}info(e){o(this,dn,"f").call(this,3,e)}warn(e,t){o(this,dn,"f").call(this,2,e,t)}error(e,t){o(this,dn,"f").call(this,1,e,t)}getMetrics(){return o(this,un,"f")}};class yn{static setDeviceOrientation(t){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_AUTOROTATE,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((t=>{const i=t.network;let n;const o=Li().isAndroid;switch(i){case ai(o).NONE:n=e.NetworkType.none;break;case ai(o).WIFI:n=e.NetworkType.wifi;break;case ai(o)["2G"]:case ai(o)["3G"]:case ai(o)["4G"]:n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return{networkType:n}}))}))}static onNetworkStatusChange(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.NetworkChanged,(e=>{const i=e&&e.state;this.getNetworkType().then((e=>{const n={isConnected:"CONNECTED"===i,networkType:e&&e.networkType};t(n)})).catch((e=>{gn.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,i,o,r,a;return n(this,void 0,void 0,(function*(){const n={subaction:0,scanning_type:Gt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Gt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Gt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Gt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Gt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Gt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Gt.isNumber(null===(i=null==e?void 0:e.scanConfig)||void 0===i?void 0:i.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Gt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Gt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Gt.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.callNative(si.SCAN_IBEACON,Object.assign({},n)),!0}))}static stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.SCAN_IBEACON,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const i={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(i)})),t}))}))}static stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.callNative({name:""},t)}))}static getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.HIDE_KEYBOARD,{})}))}static openPhone(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.PROMPT_AUTHENTICATION,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,i,n,o;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.error_code,message:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_message,payToken:null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.pay_token}}}))}))}static checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.PROMPT_AUTHENTICATION_CHECK_STATE,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.INTERACTIVE_VIBRATION,{type:e.VibrateType[t.type],vibrate_time:t.milliseconds})}))}static connectWifi(e){return n(this,void 0,void 0,(function*(){let t="open";return Gt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.callNative(si.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}}var _n,En,Sn,An,Tn,On,bn,wn,Nn,Pn,Cn,In,kn,Rn,Bn,Dn,jn,Ln,Mn,Un,Wn,xn,zn,Fn,Gn,Hn,$n,Vn;class Zn{constructor(e){_n.set(this,localStorage),En.set(this,void 0),Sn.set(this,void 0),Li(),r(this,Sn,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,En,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in o(this,_n,"f")){if(e){if(t.split("_")[0]!==e)continue}o(this,Sn,"f").keys.add(t)}}catch(e){gn.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return o(this,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,Sn,"f").keys.has(e)?o(this,_n,"f").getItem(e):null}set(e){return n(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){o(this,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,_n,"f").setItem(e,t),o(this,Sn,"f").keys.add(e)}getInfo(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let i,n,o=0;for(n in e){const r=n.split("_")[0];e.hasOwnProperty(n)&&(t&&r!==t||(i=2*(e[n].length+n.length),o+=i))}return o})(o(this,_n,"f"),o(this,En,"f"));return{currentSize:Gt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number(5120..toFixed(2))}}remove(e){return n(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){o(this,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,Sn,"f").keys.has(e)&&(o(this,_n,"f").removeItem(e),o(this,Sn,"f").keys.delete(e))}clear(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){o(this,Sn,"f").keys.forEach((e=>{o(this,En,"f")&&e.indexOf(o(this,En,"f"))<0||(o(this,_n,"f").removeItem(e),o(this,Sn,"f").keys.delete(e))}))}}_n=new WeakMap,En=new WeakMap,Sn=new WeakMap;class Jn extends an{constructor(e){super(),An.set(this,void 0),Tn.set(this,void 0),r(this,Tn,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,An,e,"f")}get(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return n(this,void 0,void 0,(function*(){const e=yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:Gt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return n(this,void 0,void 0,(function*(){yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:o(this,An,"f")})}))}}An=new WeakMap,Tn=new WeakMap;class Kn{getDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i=yield t.get(e),n={};return i.forEach(((e,t)=>{n[t]=Vi(e)})),n}))}putDataToStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Gt.isUndefined(t)||Gt.isNull(t)||(i[e]=$i(t))})),yield t.set(i)}))}removeDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class Qn extends Kn{constructor(e){super(),On.set(this,void 0),r(this,On,e,"f")}getInstance(){return new Zn(o(this,On,"f"))}}On=new WeakMap;class qn extends Kn{constructor(e){super(),bn.set(this,void 0),r(this,bn,e,"f")}getInstance(){return new Jn(o(this,bn,"f"))}}bn=new WeakMap;class Yn{static setStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());return Hi()&&(t=new qn(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());Hi()&&(t=new qn(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return n(this,void 0,void 0,(function*(){let e=new Qn(this.getAppId());return Hi()&&(e=new qn(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());return Hi()&&(t=new qn(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return n(this,void 0,void 0,(function*(){let e=new Qn(this.getAppId());Hi()&&(e=new qn(this.getAppId())),yield e.clearStorage()}))}}class Xn{static getUserInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let i="id,name,picture";(null==e?void 0:e.avatarType)&&(i=`${i}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${ti}?fields=${i}`,{headers:{access_token:t||""}}).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json(),i={id:t.id,name:t.name,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_GET_NUMBER,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}}class eo{static closeApp(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.WINDOW_CLOSE,{})}))}static openMiniApp(e){return n(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,i=(null==e?void 0:e.params)||{},n=Object.entries(i).map((function([e,t]){return[e,t].join("=")})).join("&"),o=yield Ki(t,0);yield this.callNative(si.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:{appId:t,appAvtUrl:o.logoUrl||"",appName:o.name||""}})}))}static openWebview(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_INAPP,{url:e.url})}))}static closeLoading(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class to{static getLocation(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.GET_LOCATION,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,callback:(e,t)=>{if(0===e.error_code){const t=e.data,i={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(i)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class io{static requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.REQUEST_PERMISSION_CAMERA,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){let t={};return Gt.isEmpty(e.imageBase64Data)?Gt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.callNative(si.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class no{static viewOAQr(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.VIEW_MYQR,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_PROFILE,{uId:t.id,type:e.ProfileType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openChat(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_CHAT,{uId:t.id,type:e.ChatType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openPostFeed(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":i={photoUrl:t.data.imageUrl};break;case"link":i={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":i={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.callNative(si.OPEN_POSTFEED,Object.assign(Object.assign({type:e.PostFeedType[t.type]},i),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.FOLLOW_OA,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":let e=[];Array.isArray(t.data.imageUrls)&&t.data.imageUrls.length>0?e=t.data.imageUrls:e.push(t.data.imageUrl),i={photoUrls:e,photoUrl:t.data.imageUrl,caption:t.data.caption};break;case"gif":i={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":i={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":i={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":i={uid:t.data.id};break;case"zmp":const n=yield this.getAccessToken(),o=yield Zi(this.getAppId(),n||"",t.data.title||"",t.data.description||"",t.data.thumbnail||"",t.data.path);window.forceShareZMP?i={data:{ZInstantAPIInfo:{url:`${o.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${o.shareId}`},previewMsgText:{msg:{en:"Mini App",vi:"Chương trình nhỏ"}},enableReactions:1}}:(i={link:o.shareableLink,chatOnly:t.data.chatOnly?1:0},t.type="link")}return yield this.callNative(si.OPEN_SHARESHEET,Object.assign(Object.assign({type:e.ShareSheetType[t.type]},i),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e,t,i){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.CREATE_SHORTCUT,{url:e,title:t,iconUrl:i})}))}static openProfilePicker(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,callback:(e,t)=>0===e.error_code&&Array.isArray(e.data)?Promise.resolve(e.data.map((e=>e.id))):Promise.reject(t)})}))}static getActionsSupported(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,callback:(t,i)=>{const n=Wi();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(si).filter((e=>si[e].skip_jump)),i={actions:[...t.actions,...e]};return Promise.resolve(i)}if(n===e.PlatformType.iOS){const e={actions:gi};return Promise.resolve(e)}return Promise.reject(i)}})}))}static openMediaPicker(t,i,o,r){return n(this,void 0,void 0,(function*(){const n={type:0,url:"https://zapi-server.tungnt.xyz/upload/photos",maxSize:1048576};return yield this.callNative(si.PICK_MEDIA,{media_type:e.MediaPickerType[t],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),i),silent_request:o,upload:n,max_select_item:r},{isMultiCallback:!0,callback:(e,t)=>{var i,n;if(0===e.error_code){const t=Vi(null===(i=e.data)||void 0===i?void 0:i.result_content),o={urls:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.urls};return Promise.resolve(o)}return Promise.reject(t)}})}))}static openOutApp(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_OUTAPP,{url:e})}))}}class oo{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=Ci.getParamsAsObject(i))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.WEBVIEW_SET_RESULT,{result:$i(e.data)})}))}static onCallbackData(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.OnDataCallback,(e=>{t({data:e})}))}))}}class ro extends an{constructor(){var e,t,i,n,a,s,l,c,u,d,p,h,v,f,m,g,y;super(),wn.set(this,Kt),Nn.set(this,Qt),Pn.set(this,qt),Cn.set(this,void 0),In.set(this,void 0),kn.set(this,void 0),Rn.set(this,null),Bn.set(this,{timer:{getToken:0}}),Dn.set(this,void 0),jn.set(this,void 0),Ln.set(this,null),this.events=qi.getInstance(),this.isIOS=Li().isIOS,Mn.set(this,void 0),this.getActionBarConfig=()=>o(this,Mn,"f"),this.setActionBarConfig=e=>{r(this,Mn,e(o(this,Mn,"f")),"f")},Un.set(this,(()=>new Promise(((e,t)=>{Gt.isUndefined(o(this,Ln,"f"))||Gt.isNull(o(this,Ln,"f"))?this.callNative(si.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=i.find((e=>e.name===Xt));n&&(this.setJSToken(n.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(n.value)),r(this,Ln,i,"f"),e(i)})).catch((e=>{t(e)})):e(o(this,Ln,"f"))})))),Wn.set(this,vn.setNavigationBarRightButton),this.getVersion=hn.getVersion,this.getSystemInfo=hn.getSystemInfo,this.setNavigationBarTitle=vn.setNavigationBarTitle,this.setNavigationBarColor=vn.setNavigationBarColor,this.setNavigationBarLeftButton=vn.setNavigationBarLeftButton,this.setBackgroundColor=fn.setBackgroundColor,this.setDeviceOrientation=yn.setDeviceOrientation,this.setStorage=Yn.setStorage,this.getStorage=Yn.getStorage,this.getStorageInfo=Yn.getStorageInfo,this.removeStorage=Yn.removeStorage,this.clearStorage=Yn.clearStorage,this.getUserInfo=Xn.getUserInfo,this.getNetworkType=yn.getNetworkType,this.onNetworkStatusChange=yn.onNetworkStatusChange,this.startBeaconDiscovery=yn.startBeaconDiscovery,this.stopBeaconDiscovery=yn.stopBeaconDiscovery,this.getBeacons=yn.getBeacons,this.closeApp=eo.closeApp,this.getLocation=to.getLocation,this.stopBluetoothDevicesDiscovery=yn.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=yn.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=yn.openBluetoothAdapter,this.onBluetoothDeviceFound=yn.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=yn.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=yn.getConnectedBluetoothDevices,this.getBluetoothDevices=yn.getBluetoothDevices,this.getBluetoothAdapterState=yn.getBluetoothAdapterState,this.closeBluetoothAdapter=yn.closeBluetoothAdapter,this.scanQRCode=yn.scanQRCode,this.openProfile=no.openProfile,this.openChat=no.openChat,this.openPostFeed=no.openPostFeed,this.followOA=no.followOA,this.unFollowOA=no.unfollowOA,this.openShareSheet=no.openShareSheet,this.requestCameraPermission=io.requestCameraPermission,this.createShortcut=no.createShortcut,this.openBioAuthentication=yn.openBioAuthentication,this.checkStateBioAuthentication=yn.checkStateBioAuthentication,this.sendLocation=to.sendLocation,this.showToast=yn.showToast,this.hideKeyboard=yn.hideKeyboard,this.openPhone=yn.openPhone,this.openSMS=yn.openSMS,this.viewOAQr=no.viewOAQr,this.keepScreen=yn.keepScreen,this.saveImageToPhotosAlbum=io.saveImageToPhotosAlbum,this.openMiniApp=eo.openMiniApp,this.vibrate=yn.vibrate,this.openWebview=eo.openWebview,this.getRouteParams=oo.getRouteParams,this.getAppInfo=hn.getAppInfo,this.sendDataToPreviousMiniApp=oo.sendDataToPreviousMiniApp,this.onCallbackData=oo.onCallbackData,this.getPhoneNumber=Xn.getPhoneNumber,this.openProfilePicker=no.openProfilePicker,xn.set(this,no.getActionsSupported),this.connectWifi=yn.connectWifi,this.openMediaPicker=no.openMediaPicker,this.openOutApp=no.openOutApp,this.closeLoading=eo.closeLoading,r(this,Cn,null,"f"),r(this,In,null,"f"),r(this,kn,null,"f"),this.isShowNavBar=!0,r(this,Dn,0,"f"),r(this,jn,0,"f");const _="home"===(null===(t=null===(e=o(this,Pn,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(n=null===(i=o(this,Pn,"f"))||void 0===i?void 0:i.app)||void 0===n?void 0:n.leftButton)?Ei:Si,E=new URL(location.href),S=Gt.isString(null===(s=null===(a=o(this,Pn,"f"))||void 0===a?void 0:a.app)||void 0===s?void 0:s.headerColor)&&(null===(u=null===(c=null===(l=o(this,Pn,"f"))||void 0===l?void 0:l.app)||void 0===c?void 0:c.headerColor)||void 0===u?void 0:u.length)>0?5:6,A="none"===(null===(p=null===(d=o(this,Pn,"f"))||void 0===d?void 0:d.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(v=null===(h=o(this,Pn,"f"))||void 0===h?void 0:h.app)||void 0===v?void 0:v.leftButton)?_i:yi;r(this,Mn,{actionbarType:S,buttonType:A,dataConfig:{backgroundColor:(null===(m=null===(f=o(this,Pn,"f"))||void 0===f?void 0:f.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(y=null===(g=o(this,Pn,"f"))||void 0===g?void 0:g.app)||void 0===y?void 0:y.textColor)||"",viewInLeftType:A,confirmToExit:1},homeConfig:{enable:_,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return ro.instance||(ro.instance=new ro),ro.instance}getLoginStatus(){return Gt.isString(o(this,kn,"f"))&&o(this,kn,"f").length>0}getAppId(){return o(this,Nn,"f")}getZAppId(){return o(this,wn,"f")}login(e){return n(this,void 0,void 0,(function*(){const e=yield o(this,Un,"f").call(this),t=e.find((e=>e.name===Yt)),i=e.find((e=>e.name===ei));if(!Gt.isUndefined(t)&&!Gt.isNull(t)&&Gt.isString(t.value)){if(r(this,Cn,t.value,"f"),Gt.isUndefined(i)||Gt.isNull(i)||!Gt.isString(i.value)?yield this.loginZaloV3():(r(this,In,i.value,"f"),yield this.loginZaloV4()),!o(this,kn,"f"))throw Pi.loginFailed();return o(this,kn,"f")}throw Pi.loginFailed()}))}loginZaloV3(){return n(this,void 0,void 0,(function*(){return yield fetch(`${ni}?app_id=${o(this,wn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${o(this,Nn,"f")}/&code=${o(this,Cn,"f")}&isSDK=true123`).then((e=>n(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){r(this,kn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,jn,e,"f"),r(this,Dn,(new Date).getTime(),"f"),this.setZAccSession(o(this,kn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,kn,"f")||""),o(this,kn,"f")}return null}))))}))}loginZaloV4(){return n(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",o(this,Nn,"f")),e.append("code",o(this,Cn,"f")||""),e.append("code_verifier",o(this,In,"f")||""),Gt.isNull(o(this,Rn,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",o(this,Rn,"f")||""));return yield fetch(ii,Object.assign({method:"POST",body:e},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json();if(t.refresh_token&&r(this,Rn,t.refresh_token,"f"),t.access_token){r(this,kn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,jn,e,"f"),r(this,Dn,(new Date).getTime(),"f"),this.setZAccSession(o(this,kn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,kn,"f")||""),o(this,kn,"f")}return null}))))}))}getAccessToken(e){return n(this,void 0,void 0,(function*(){const e=(new Date).getTime()-o(this,Dn,"f");if(!o(this,kn,"f"))throw Pi.loginRequired();return e<o(this,jn,"f")?o(this,kn,"f"):yield this.login()}))}}wn=new WeakMap,Nn=new WeakMap,Pn=new WeakMap,Cn=new WeakMap,In=new WeakMap,kn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,Un=new WeakMap,Wn=new WeakMap,xn=new WeakMap;class ao{constructor(){zn.set(this,Kt),Fn.set(this,qt),Gn.set(this,"DEFAULT ZOAUTH"),Hn.set(this,"DEFAULT ACCESS TOKEN"),$n.set(this,{timer:{getToken:0}}),Vn.set(this,!1),this.getLoginStatus=()=>o(this,Vn,"f"),this.getAppId=()=>o(this,zn,"f"),this.login=()=>(r(this,Vn,!0,"f"),Promise.resolve(o(this,Gn,"f"))),this.getAccessToken=()=>Promise.resolve(o(this,Hn,"f")),this.getVersion=hn.getVersion,this.getSystemInfo=hn.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>n(this,void 0,void 0,(function*(){const e=new Qn(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>n(this,void 0,void 0,(function*(){const e=new Qn(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}const i={networkType:t};return Promise.resolve(i)},this.onNetworkStatusChange=t=>{const i=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=i.effectiveType;return i.addEventListener("change",(function(){let i;switch(n){case"none":i=e.NetworkType.none;break;case"4g":i=e.NetworkType.wifi;break;case"3g":case"2g":i=e.NetworkType.cellular;break;default:i=e.NetworkType.unknown}t({isConnected:!0,networkType:i})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e.url),Promise.resolve()),this.getRouteParams=oo.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve([])),this.connectWifi=()=>(console.warn("This api only works on zalo app"),Promise.resolve()),this.openOutApp=e=>(location.href=e,Promise.resolve()),this.closeLoading=e=>Promise.resolve()}on(e,t,i){throw new Error("Method not implemented.")}once(e,t,i){throw new Error("Method not implemented.")}off(e,t,i,n){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}openMediaPicker(e,t,i,n){return console.warn("This api only works on zalo app"),Promise.resolve({urls:[]})}}zn=new WeakMap,Fn=new WeakMap,Gn=new WeakMap,Hn=new WeakMap,$n=new WeakMap,Vn=new WeakMap;const so=Symbol("required"),lo=Symbol("checkType"),co=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(so,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(so,r,i,n)},uo=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(lo,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(lo,a,n,o)};const po=(e,t,i)=>{const n=i.value,o=n.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return i.value=function(){const i=Reflect.getOwnMetadata(so,e,t),r=Reflect.getOwnMetadata(lo,e,t);return r&&r.forEach((e=>{const{parameterIndex:t,type:i,properties:n,defaultValue:r}=e;let a=arguments[t],s=o[t];const l=typeof a;if(!Gt.isUndefined(a)){if(!xi(a,i))throw Pi.wrongTypeParam(s,i,Array.isArray(a)?"array":null===a?"null":l);"object"===i&&Object.entries(n).forEach((([e,i])=>{const n=e.split("?")[0],o=Gt.get(a,n);if(Gt.isUndefined(o)||Gt.isNull(o)){if(!e.includes("?"))throw Pi.missingParam(e);Gt.isObject(Gt.get(a,n.split(".")[0]))&&r&&!Gt.isUndefined(Gt.get(r,n))&&Gt.set(arguments[t],n,Gt.get(r,n))}else if(Gt.isFunction(i)){const e=i(o);if(e&&e.error)throw Pi.wrongTypeParam(`${s}.${n}`,e.errorMessage,typeof o)}}))}})),i&&i.forEach((e=>{const{parameterIndex:t,option:i,fields:n}=e,o=arguments[t],r=null==i?void 0:i.if,a=null==i?void 0:i.defaultValue;let s=!0;r&&(s=Object.keys(r).every((e=>Gt.get(o,e)===r[e]))),s&&n.forEach((e=>{const i=e=>{let i=!1;return Gt.isEmpty(Gt.get(o,e))&&(Gt.isUndefined(Gt.get(a,e))||Gt.set(arguments[t],e,Gt.get(a,e)),i=!0),i};if(Array.isArray(e)&&e.length>0&&e.every(i))throw Pi.missingParam(e.join(" or "));if(Gt.isString(e)&&i(e))throw Pi.missingParam(e)}))})),n.apply(this,arguments)},i};var ho;class vo{constructor(){this.events=qi.getInstance(),ho.set(this,void 0),r(this,ho,this.getServiceInstance(),"f"),this.events.addListener=(t,i,n)=>{const o=t;return this.events.addListener(e.Events[o],i,n)}}login(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").login(e)}))}getLoginStatus(){return o(this,ho,"f").getLoginStatus()}getAccessToken(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getAccessToken(e)}))}getVersion(){return o(this,ho,"f").getVersion()}getSystemInfo(){return o(this,ho,"f").getSystemInfo()}setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){return o(this,ho,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setDeviceOrientation(e)}))}setStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setStorage(e)}))}getStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getStorage(e)}))}getStorageInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getStorageInfo(e)}))}removeStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").removeStorage(e)}))}clearStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").clearStorage(e)}))}getUserInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getUserInfo(e)}))}getNetworkType(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBeacons(e)}))}closeApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeApp(e)}))}getLocation(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeBluetoothAdapter()}))}scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").scanQRCode(e)}))}openProfile(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openProfile(e)}))}openChat(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openChat(e)}))}openPostFeed(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openPostFeed(e)}))}followOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").followOA(e)}))}unfollowOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").unFollowOA(e)}))}openShareSheet(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openShareSheet(e)}))}requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").requestCameraPermission(e)}))}createShortcut(e){return n(this,void 0,void 0,(function*(){const t=yield Ki(Qt,0),i=Li().isIOS,n=t.logoUrl||Mi("og:image:url")||"",r=t.name||document.title,a=e.params?new URLSearchParams(e.params):new URLSearchParams;if(a.append("utm_source","zalo-shortcut"),a.append("utm_medium","default"),a.append("utm_campaign","default"),i){a.append("appId",Qt),a.append("appName",r),a.append("appIcon",n);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield o(this,ho,"f").openOutApp(encodeURI(e))}else yield o(this,ho,"f").createShortcut(`https://zalo.me/app/link/zapps/${Qt}/?${a.toString()}`,r,n);return Ni()}))}openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").sendLocation(e)}))}showToast(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").showToast(e)}))}hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").hideKeyboard(e)}))}openPhone(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openPhone(e)}))}openSMS(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openSMS(e)}))}viewOAQr(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").viewOAQr(e)}))}keepScreen(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").keepScreen(e)}))}saveImageToGallery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return n(this,void 0,void 0,(function*(){if(!Gt.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield o(this,ho,"f").openMiniApp(e)}))}vibrate(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").vibrate(e)}))}openWebview(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openWebview(e)}))}getRouteParams(){return o(this,ho,"f").getRouteParams()}getAppInfo(e){return o(this,ho,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return o(this,ho,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onCallbackData(e)}))}getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getPhoneNumber()}))}openProfilePicker(e){return n(this,void 0,void 0,(function*(){const t=yield o(this,ho,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(oi,{method:"POST",headers:{"Content-Type":"application/json",access_token:e||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})}),o=yield n.json();if(0!==o.error||!o.data)throw new Error(o.message);i=t.map((e=>{var t,i,n,r,a,s,l,c,u;return{id:e,profile:{name:null===(i=null===(t=o.data[e])||void 0===t?void 0:t.user_info)||void 0===i?void 0:i.name,avatar:null===(s=null===(a=null===(r=null===(n=o.data[e])||void 0===n?void 0:n.user_info)||void 0===r?void 0:r.picture)||void 0===a?void 0:a.data)||void 0===s?void 0:s.url},code:0!==(null===(l=o.data[e])||void 0===l?void 0:l.error)?-1:0,message:`Get profile: ${Gt.isUndefined(null===(c=o.data[e])||void 0===c?void 0:c.message)?"Unknown error":null===(u=o.data[e])||void 0===u?void 0:u.message}`}}))}catch(e){i=t.map((t=>({id:t,profile:{name:"",avatar:""},code:-1,message:`Can't get profile: ${e.message}`})))}return{users:i||[]}}))}connectWifi(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").connectWifi(e)}))}openMediaPicker(e){var t,i,r;return n(this,void 0,void 0,(function*(){const n={};Gt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(i=e.editView)||void 0===i?void 0:i.enable)?n.enable=1:n.enable=0,n.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio;const a=!0===e.silentRequest?1:0,s=e.maxSelectItem;return yield o(this,ho,"f").openMediaPicker(e.type,n,a,s)}))}getShareableLink(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return(yield Zi(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)).shareableLink}))}closeLoading(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeLoading("user action")}))}}ho=new WeakMap,t([bi],vo.prototype,"login",null),t([wi],vo.prototype,"getLoginStatus",null),t([bi],vo.prototype,"getAccessToken",null),t([wi],vo.prototype,"getVersion",null),t([wi],vo.prototype,"getSystemInfo",null),t([bi,po,i(0,uo("object",{title:Ji("string")}))],vo.prototype,"setNavigationBarTitle",null),t([bi,po,i(0,uo("object",{color:Ji("string"),"textColor?":Ji("string",{values:["white","black"]}),"statusBarColor?":Ji("string")}))],vo.prototype,"setNavigationBarColor",null),t([bi,po,i(0,uo("object",{backgroundColor:Ji("string"),"textColor?":Ji("string",{values:["white","black"]})}))],vo.prototype,"setBackgroundColor",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["none","back","home","both"]})}))],vo.prototype,"setNavigationBarLeftButton",null),t([bi,po,i(0,uo("object",{rotate:Ji("string",{values:["auto","portrait","landscape"]})}))],vo.prototype,"setDeviceOrientation",null),t([bi,po,i(0,uo("object",{data:Ji("object")}))],vo.prototype,"setStorage",null),t([bi,po,i(0,uo("object",{keys:Ji("array<string>")}))],vo.prototype,"getStorage",null),t([bi],vo.prototype,"getStorageInfo",null),t([bi,po,i(0,uo("object",{keys:Ji("array<string>")}))],vo.prototype,"removeStorage",null),t([bi],vo.prototype,"clearStorage",null),t([bi,po,i(0,uo("object",{"avatarType?":Ji("string",{values:["small","normal","large"]})}))],vo.prototype,"getUserInfo",null),t([bi],vo.prototype,"getNetworkType",null),t([bi],vo.prototype,"onNetworkStatusChange",null),t([bi],vo.prototype,"startBeaconDiscovery",null),t([bi],vo.prototype,"stopBeaconDiscovery",null),t([bi],vo.prototype,"getBeacons",null),t([bi],vo.prototype,"closeApp",null),t([bi],vo.prototype,"getLocation",null),t([bi],vo.prototype,"stopBluetoothDevicesDiscovery",null),t([bi],vo.prototype,"startBluetoothDevicesDiscovery",null),t([bi],vo.prototype,"openBluetoothAdapter",null),t([bi],vo.prototype,"onBluetoothDeviceFound",null),t([bi],vo.prototype,"onBluetoothAdapterStateChange",null),t([bi],vo.prototype,"getConnectedBluetoothDevices",null),t([bi],vo.prototype,"getBluetoothDevices",null),t([bi],vo.prototype,"getBluetoothAdapterState",null),t([bi],vo.prototype,"closeBluetoothAdapter",null),t([bi],vo.prototype,"scanQRCode",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["user","oa","aliasOA"]}),id:Ji("string")}))],vo.prototype,"openProfile",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["user","oa"]}),id:Ji("string")}))],vo.prototype,"openChat",null),t([bi,po,i(0,co(["data.imageUrl"],{if:{type:"image"}})),i(0,co(["data.link"],{if:{type:"link"}})),i(0,co(["data.id"],{if:{type:"profile"}})),i(0,uo("object",{type:Ji("string",{values:["image","link","profile"]}),data:Ji("object"),"data.imageUrl?":Ji("url"),"data.link?":Ji("url"),"data.title?":Ji("string"),"data.thumb?":Ji("url"),"data.description?":Ji("string"),"data.avatar?":Ji("url"),"data.id?":Ji("string"),"data.displayName?":Ji("string")}))],vo.prototype,"openPostFeed",null),t([bi,po,i(0,uo("object",{id:Ji("string"),"showDialogConfirm?":Ji("boolean")}))],vo.prototype,"followOA",null),t([bi,po,i(0,uo("object",{id:Ji("string")}))],vo.prototype,"unfollowOA",null),t([bi,po,i(0,co([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),i(0,co(["data.link"],{if:{type:"link"}})),i(0,co(["data.id"],{if:{type:"oa"}})),i(0,co(["data.gifUrl"],{if:{type:"gif"}})),i(0,co(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),i(0,co(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),i(0,uo("object",{type:Ji("string",{values:["image","gif","video","link","oa","zmp"]}),data:Ji("object"),"data.imageUrl?":Ji("url"),"data.imageUrls?":Ji("array<url>",{maxLength:10}),"data.caption?":Ji("string"),"data.gifUrl?":Ji("url"),"data.width?":Ji("number"),"data.height?":Ji("number"),"data.videoThumb?":Ji("url"),"data.videoUrl?":Ji("url"),"data.link?":Ji("url"),"data.chatOnly?":Ji("boolean"),"data.id?":Ji("string"),"data.thumbnail?":Ji("url"),"data.path?":Ji("string"),"data.title?":Ji("string",{maxLength:100}),"data.description?":Ji(["string"],{maxLength:400})}))],vo.prototype,"openShareSheet",null),t([bi],vo.prototype,"requestCameraPermission",null),t([bi],vo.prototype,"createShortcut",null),t([bi,po,i(0,uo("object",{secretData:Ji("string"),"ui?":Ji("object"),"ui.title?":Ji("string"),"ui.subTitle?":Ji("string"),"ui.negativeButtonText?":Ji("string"),"requireFingerprint?":Ji("boolean")},{requireFingerprint:!0,ui:{title:"Xác thực",subTitle:"Sử dụng sinh trắc học của bạn để xác thực",negativeButtonText:"Đóng"}}))],vo.prototype,"openBioAuthentication",null),t([bi],vo.prototype,"checkStateBioAuthentication",null),t([bi,po,i(0,uo("object",{toUserId:Ji("string"),"title?":Ji("string")}))],vo.prototype,"sendLocation",null),t([bi,po,i(0,uo("object",{message:Ji("string")}))],vo.prototype,"showToast",null),t([bi],vo.prototype,"hideKeyboard",null),t([bi,po,i(0,uo("object",{phoneNumber:Ji("string")}))],vo.prototype,"openPhone",null),t([bi,po,i(0,uo("object",{content:Ji("string"),phoneNumber:Ji("string",{regex:/^\+?\d+$/})}))],vo.prototype,"openSMS",null),t([bi,po,i(0,uo("object",{id:Ji("string"),"displayName?":Ji("string")},{displayName:""}))],vo.prototype,"viewOAQr",null),t([bi],vo.prototype,"keepScreen",null),t([bi,po,i(0,uo("object",{"imageBase64Data?":Ji("string"),"imageUrl?":Ji("url")}))],vo.prototype,"saveImageToGallery",null),t([bi,po,i(0,uo("object",{"imageBase64Data?":Ji("string"),"imageUrl?":Ji("url")}))],vo.prototype,"saveImageToPhotosAlbum",null),t([bi,po,i(0,uo("object",{appId:Ji("string"),"params?":Ji("object")}))],vo.prototype,"openMiniApp",null),t([bi,po,i(0,uo("object",{"type?":Ji("string",{values:["oneShot"]}),"milliseconds?":Ji("number")},{type:"oneShot",milliseconds:500}))],vo.prototype,"vibrate",null),t([bi,po,i(0,uo("object",{url:Ji("string")}))],vo.prototype,"openWebview",null),t([wi],vo.prototype,"getRouteParams",null),t([bi],vo.prototype,"getAppInfo",null),t([bi],vo.prototype,"sendDataToPreviousMiniApp",null),t([bi],vo.prototype,"onCallbackData",null),t([bi],vo.prototype,"getPhoneNumber",null),t([bi,po,i(0,uo("object",{"maxProfile?":Ji("number",{min:1,max:10})},{maxProfile:1}))],vo.prototype,"openProfilePicker",null),t([bi,po,i(0,co(["SSID"])),i(0,uo("object",{SSID:Ji("string"),"password?":Ji("string"),"hiddenSSID?":Ji("boolean")}))],vo.prototype,"connectWifi",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["photo","video","file","multi_photo","multi_video"]}),"editView?":Ji("object"),"editView.enable?":Ji("boolean"),"editView.aspectRatio?":Ji("string",{regex:/^\d+:\d+$/}),"silentRequest?":Ji("boolean"),"maxSelectItem?":Ji("number",{min:1})}))],vo.prototype,"openMediaPicker",null),t([bi,po,i(0,uo("object",{title:Ji("string",{maxLength:100}),"thumbnail?":Ji("url"),"path?":Ji("string"),description:Ji(["string"],{maxLength:400})},{description:""}))],vo.prototype,"getShareableLink",null),t([bi,po],vo.prototype,"closeLoading",null);class fo extends vo{getServiceInstance(){return ro.getInstance()}}class mo extends vo{getServiceInstance(){return new ao}}const go=Li();e.default=void 0,window.onJSCall=e=>function(t){rn.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){rn.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){rn.getInstance().nativeEventHandler(e,t,i)}},go.isZalo?e.default=new fo:e.default=new mo,window.ZaloMiniAppSDK=e.default,e.SDKCreator=vo,e.default=e.default,Object.defineProperty(e,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */function t(e,t,i,n){var o,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,i,a):o(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a}function i(e,t){return function(i,n){t(i,n,e)}}function n(e,t,i,n){return new(i||(i=Promise))((function(o,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function o(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function r(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,i):o?o.value=i:t.set(e,i),i}var a=Object.prototype;var s=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||a)};var l=function(e,t){return function(i){return e(t(i))}}(Object.keys,Object),c=Object.prototype.hasOwnProperty;var u=function(e){if(!s(e))return l(e);var t=[];for(var i in Object(e))c.call(e,i)&&"constructor"!=i&&t.push(i);return t},d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var h="object"==typeof d&&d&&d.Object===Object&&d,v="object"==typeof self&&self&&self.Object===Object&&self,f=h||v||Function("return this")(),m=f.Symbol,g=Object.prototype,y=g.hasOwnProperty,_=g.toString,E=m?m.toStringTag:void 0;var S=function(e){var t=y.call(e,E),i=e[E];try{e[E]=void 0;var n=!0}catch(e){}var o=_.call(e);return n&&(t?e[E]=i:delete e[E]),o},A=Object.prototype.toString;var T=function(e){return A.call(e)},O=m?m.toStringTag:void 0;var b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?S(e):T(e)};var w=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var N,P=function(e){if(!w(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},C=f["__core-js_shared__"],I=(N=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var k=function(e){return!!I&&I in e},R=Function.prototype.toString;var B=function(e){if(null!=e){try{return R.call(e)}catch(e){}try{return e+""}catch(e){}}return""},D=/^\[object .+?Constructor\]$/,j=Function.prototype,L=Object.prototype,M=j.toString,U=L.hasOwnProperty,W=RegExp("^"+M.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var x=function(e){return!(!w(e)||k(e))&&(P(e)?W:D).test(B(e))};var z=function(e,t){return null==e?void 0:e[t]};var F=function(e,t){var i=z(e,t);return x(i)?i:void 0},G=F(f,"DataView"),H=F(f,"Map"),$=F(f,"Promise"),V=F(f,"Set"),Z=F(f,"WeakMap"),J="[object Map]",K="[object Promise]",Q="[object Set]",q="[object WeakMap]",Y="[object DataView]",X=B(G),ee=B(H),te=B($),ie=B(V),ne=B(Z),oe=b;(G&&oe(new G(new ArrayBuffer(1)))!=Y||H&&oe(new H)!=J||$&&oe($.resolve())!=K||V&&oe(new V)!=Q||Z&&oe(new Z)!=q)&&(oe=function(e){var t=b(e),i="[object Object]"==t?e.constructor:void 0,n=i?B(i):"";if(n)switch(n){case X:return Y;case ee:return J;case te:return K;case ie:return Q;case ne:return q}return t});var re=oe;var ae=function(e){return null!=e&&"object"==typeof e};var se=function(e){return ae(e)&&"[object Arguments]"==b(e)},le=Object.prototype,ce=le.hasOwnProperty,ue=le.propertyIsEnumerable,de=se(function(){return arguments}())?se:function(e){return ae(e)&&ce.call(e,"callee")&&!ue.call(e,"callee")},pe=Array.isArray;var he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve=function(e){return null!=e&&he(e.length)&&!P(e)};var fe=function(){return!1},me=p((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i?f.Buffer:void 0,r=(o?o.isBuffer:void 0)||fe;e.exports=r})),ge={};ge["[object Float32Array]"]=ge["[object Float64Array]"]=ge["[object Int8Array]"]=ge["[object Int16Array]"]=ge["[object Int32Array]"]=ge["[object Uint8Array]"]=ge["[object Uint8ClampedArray]"]=ge["[object Uint16Array]"]=ge["[object Uint32Array]"]=!0,ge["[object Arguments]"]=ge["[object Array]"]=ge["[object ArrayBuffer]"]=ge["[object Boolean]"]=ge["[object DataView]"]=ge["[object Date]"]=ge["[object Error]"]=ge["[object Function]"]=ge["[object Map]"]=ge["[object Number]"]=ge["[object Object]"]=ge["[object RegExp]"]=ge["[object Set]"]=ge["[object String]"]=ge["[object WeakMap]"]=!1;var ye=function(e){return ae(e)&&he(e.length)&&!!ge[b(e)]};var _e=function(e){return function(t){return e(t)}},Ee=p((function(e,t){var i=t&&!t.nodeType&&t,n=i&&e&&!e.nodeType&&e,o=n&&n.exports===i&&h.process,r=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=r})),Se=Ee&&Ee.isTypedArray,Ae=Se?_e(Se):ye,Te=Object.prototype.hasOwnProperty;var Oe=function(e){if(null==e)return!0;if(ve(e)&&(pe(e)||"string"==typeof e||"function"==typeof e.splice||me(e)||Ae(e)||de(e)))return!e.length;var t=re(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(s(e))return!u(e).length;for(var i in e)if(Te.call(e,i))return!1;return!0};var be=function(e){return void 0===e};var we=function(e){return null===e};var Ne=function(e){return"string"==typeof e||!pe(e)&&ae(e)&&"[object String]"==b(e)};var Pe=function(e){return"number"==typeof e||ae(e)&&"[object Number]"==b(e)};var Ce=function(e){return ae(e)&&"[object RegExp]"==b(e)},Ie=Ee&&Ee.isRegExp,ke=Ie?_e(Ie):Ce;var Re=function(e){return"symbol"==typeof e||ae(e)&&"[object Symbol]"==b(e)},Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,De=/^\w*$/;var je=function(e,t){if(pe(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Re(e))||(De.test(e)||!Be.test(e)||null!=t&&e in Object(t))},Le=F(Object,"create");var Me=function(){this.__data__=Le?Le(null):{},this.size=0};var Ue=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},We=Object.prototype.hasOwnProperty;var xe=function(e){var t=this.__data__;if(Le){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return We.call(t,e)?t[e]:void 0},ze=Object.prototype.hasOwnProperty;var Fe=function(e){var t=this.__data__;return Le?void 0!==t[e]:ze.call(t,e)};var Ge=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};function He(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}He.prototype.clear=Me,He.prototype.delete=Ue,He.prototype.get=xe,He.prototype.has=Fe,He.prototype.set=Ge;var $e=He;var Ve=function(){this.__data__=[],this.size=0};var Ze=function(e,t){return e===t||e!=e&&t!=t};var Je=function(e,t){for(var i=e.length;i--;)if(Ze(e[i][0],t))return i;return-1},Ke=Array.prototype.splice;var Qe=function(e){var t=this.__data__,i=Je(t,e);return!(i<0)&&(i==t.length-1?t.pop():Ke.call(t,i,1),--this.size,!0)};var qe=function(e){var t=this.__data__,i=Je(t,e);return i<0?void 0:t[i][1]};var Ye=function(e){return Je(this.__data__,e)>-1};var Xe=function(e,t){var i=this.__data__,n=Je(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function et(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}et.prototype.clear=Ve,et.prototype.delete=Qe,et.prototype.get=qe,et.prototype.has=Ye,et.prototype.set=Xe;var tt=et;var it=function(){this.size=0,this.__data__={hash:new $e,map:new(H||tt),string:new $e}};var nt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ot=function(e,t){var i=e.__data__;return nt(t)?i["string"==typeof t?"string":"hash"]:i.map};var rt=function(e){var t=ot(this,e).delete(e);return this.size-=t?1:0,t};var at=function(e){return ot(this,e).get(e)};var st=function(e){return ot(this,e).has(e)};var lt=function(e,t){var i=ot(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ct(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ct.prototype.clear=it,ct.prototype.delete=rt,ct.prototype.get=at,ct.prototype.has=st,ct.prototype.set=lt;var ut=ct;function dt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=t?t.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var a=e.apply(this,n);return i.cache=r.set(o,a)||r,a};return i.cache=new(dt.Cache||ut),i}dt.Cache=ut;var pt=dt;var ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vt=/\\(\\)?/g,ft=function(e){var t=pt(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ht,(function(e,i,n,o){t.push(n?o.replace(vt,"$1"):i||e)})),t}));var mt=function(e,t){for(var i=-1,n=null==e?0:e.length,o=Array(n);++i<n;)o[i]=t(e[i],i,e);return o},gt=m?m.prototype:void 0,yt=gt?gt.toString:void 0;var _t=function e(t){if("string"==typeof t)return t;if(pe(t))return mt(t,e)+"";if(Re(t))return yt?yt.call(t):"";var i=t+"";return"0"==i&&1/t==-Infinity?"-0":i};var Et=function(e){return null==e?"":_t(e)};var St=function(e,t){return pe(e)?e:je(e,t)?[e]:ft(Et(e))};var At=function(e){if("string"==typeof e||Re(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var Tt=function(e,t){for(var i=0,n=(t=St(t,e)).length;null!=e&&i<n;)e=e[At(t[i++])];return i&&i==n?e:void 0};var Ot=function(e,t,i){var n=null==e?void 0:Tt(e,t);return void 0===n?i:n},bt=function(){try{var e=F(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var wt=function(e,t,i){"__proto__"==t&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i},Nt=Object.prototype.hasOwnProperty;var Pt=function(e,t,i){var n=e[t];Nt.call(e,t)&&Ze(n,i)&&(void 0!==i||t in e)||wt(e,t,i)},Ct=/^(?:0|[1-9]\d*)$/;var It=function(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Ct.test(e))&&e>-1&&e%1==0&&e<t};var kt=function(e,t,i,n){if(!w(e))return e;for(var o=-1,r=(t=St(t,e)).length,a=r-1,s=e;null!=s&&++o<r;){var l=At(t[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=a){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=w(u)?u:It(t[o+1])?[]:{})}Pt(s,l,c),s=s[l]}return e};var Rt,Bt,Dt,jt,Lt,Mt,Ut,Wt,xt,zt,Ft,Gt={isEmpty:Oe,isNull:we,isUndefined:be,isFunction:P,isObject:w,isString:Ne,isNumber:Pe,isArray:pe,isRegExp:ke,get:Ot,set:function(e,t,i){return null==e?e:kt(e,t,i)}};function Ht(e){return"function"==typeof window.Debug?window.Debug(e):function(...e){process.env.NODE_ENV}}e.NetworkType=void 0,(Rt=e.NetworkType||(e.NetworkType={})).none="none",Rt.wifi="wifi",Rt.cellular="cellular",Rt.unknown="unknown",e.PlatformType=void 0,(Bt=e.PlatformType||(e.PlatformType={})).wp="wp",Bt.android="android",Bt.iOS="iOS",Bt.unknown="unknown",e.ProfileType=void 0,(Dt=e.ProfileType||(e.ProfileType={}))[Dt.user=1]="user",Dt[Dt.oa=0]="oa",Dt[Dt.aliasOA=2]="aliasOA",e.ChatType=void 0,(jt=e.ChatType||(e.ChatType={}))[jt.user=1]="user",jt[jt.oa=0]="oa",e.PostFeedType=void 0,(Lt=e.PostFeedType||(e.PostFeedType={}))[Lt.image=1]="image",Lt[Lt.link=4]="link",Lt[Lt.profile=5]="profile",e.ShareSheetType=void 0,(Mt=e.ShareSheetType||(e.ShareSheetType={}))[Mt.image=1]="image",Mt[Mt.gif=11]="gif",Mt[Mt.video=12]="video",Mt[Mt.link=4]="link",Mt[Mt.oa=5]="oa",Mt[Mt.zmp=20]="zmp",e.OrientationType=void 0,(Ut=e.OrientationType||(e.OrientationType={}))[Ut.auto=1]="auto",Ut[Ut.portrait=2]="portrait",Ut[Ut.landscape=3]="landscape",e.VibrateType=void 0,(Wt=e.VibrateType||(e.VibrateType={}))[Wt.oneShot=0]="oneShot",e.NativeCode=void 0,(xt=e.NativeCode||(e.NativeCode={}))[xt.token_invalid=-2]="token_invalid",xt[xt.not_permission=-1]="not_permission",xt[xt.client_not_support=-5]="client_not_support",xt[xt.decode_failed=-4]="decode_failed",e.Events=void 0,(zt=e.Events||(e.Events={})).AppPaused="h5.event.paused",zt.AppResumed="h5.event.resumed",zt.NetworkChanged="h5.event.connection.changed",zt.OnDataCallback="h5.event.webview.result",zt.OpenApp="h5.event.open.mp",e.MediaPickerType=void 0,(Ft=e.MediaPickerType||(e.MediaPickerType={}))[Ft.photo=4]="photo",Ft[Ft.video=5]="video",Ft[Ft.file=6]="file",Ft[Ft.multi_photo=7]="multi_photo",Ft[Ft.multi_video=8]="multi_video";const $t=e=>{const t=document.cookie;if(t){const o=t.split("; ");if(o&&o.length>0)for(var i=e.length+1,n=o.length-1;n>=0;n--){let t=o[n];if(t&&0===t.indexOf(e)&&(t=t.substring(i,t.length),t))return t=t.replace(/["']/g,""),t}}return null},Vt=e=>$t(`${window.location.host}_`+e),Zt=e=>$t((()=>{const e=window.location.host;if(e){if(e.indexOf("zalo.me")>=0)return"zalo.me_";if(e.indexOf("baomoi.com")>=0)return"baomoi.com_";if(e.indexOf("mp3.zing.vn")>=0)return"mp3.zing.vn_";if(e.indexOf("zaloapp.com")>=0)return"zaloapp.com_"}return""})()+e),Jt=1048576,Kt=window.zAppID,Qt=window.APP_ID,qt=window.APP_CONFIG||{},Yt="h5.zdn.vn_zoauth",Xt="h5.zdn.vn_zlink3rd",ei="h5.zdn.vn_zoauth_vrf",ti="https://graph.zalo.me/v2.0/me",ii="https://h5.zalo.me/openapi/access_token",ni="https://oauth.zaloapp.com/v3/access_token",oi="https://graph.zalo.me/v2.0/me/friends/list",ri=5*Jt,ai=e=>({NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}),si={GET_DOWNLOADED_STICKER:{name:"action.get.downloaded.sticker",have_callback:!0},OPEN_SHARE_STICKER:{name:"action.open.share.sticker"},OPEN_PROFILE:{name:"action.open.profile"},OPEN_FEED_DETAIL:{name:"action.open.feeddetail"},OPEN_FRIEND_RADA:{name:"action.open.friendrada"},OPEN_INAPP:{name:"action.open.inapp"},OPEN_OUTAPP:{name:"action.open.outapp"},OPEN_PAGE:{name:"action.open.page"},OPEN_PHOTODETAIL:{name:"action.open.photodetail"},OPEN_GALARY:{name:"action.open.galary"},OPEN_GAMECENTER:{name:"action.open.gamecenter"},OPEN_GAMENEWS:{name:"action.open.gamenews"},OPEN_TAB_CONTACT:{name:"action.open.tab.contact"},OPEN_TAB_SOCIAL:{name:"action.open.tab.social"},OPEN_FRIENDSUGGEST:{name:"action.open.friendsuggest"},OPEN_GROUPLIST:{name:"action.open.grouplist"},OPEN_NEARBY:{name:"action.open.nearby"},OPEN_ROOM:{name:"action.open.room"},OPEN_STICKERSTORE:{name:"action.open.stickerstore"},OPEN_CREATECHAT:{name:"action.open.createchat"},COPY_LINK_CATESTICKER:{name:"action.copy.link.catesticker"},REQUEST_BUY_STICKER:{name:"action.request.buy.sticker"},OPEN_CHAT:{name:"action.open.chat"},OPEN_TAB_CHAT:{name:"action.open.tab.chat"},OPEN_CHATGROUP:{name:"action.open.chatgroup"},OPEN_ADDFRIEND:{name:"action.open.addfriend"},OPEN_TAB_MORE:{name:"action.open.tab.more"},OPEN_POSTFEED:{name:"action.open.postfeed"},OPEN_LOGINDEVICES:{name:"action.open.logindevices"},OPEN_SENDSTICKER:{name:"action.open.sendsticker"},REPORT_ABUSE:{name:"action.report.abuse",have_callback:!0},FOLLOW_OA:{name:"action.follow.oa",have_callback:!0},UNFOLLOW_OA:{name:"action.unfollow.oa",have_callback:!0},OPEN_GAMEDETAIL:{name:"action.open.gamedetail"},OPEN_SHARESHEET:{name:"action.open.sharesheet",have_callback:!0},REQUEST_PERMISSION_CAMERA:{name:"action.request.permission.camera"},CHANGE_TITLE_HEADER:{name:"action.change.title.header",skip_jump:!0},WEBVIEW_CLEARCACHE:{name:"action.webview.clearcache"},WEBVIEW_CONFIRMCACHE:{name:"action.webview.confirmcache"},WEBVIEW_ISVISIBLE:{name:"action.webview.isvisible"},WEBVIEW_NETWORKTYPE:{name:"action.webview.networktype",skip_jump:!0},CHANGE_BUTTON_HEADER:{name:"action.change.button.header"},CREATE_OPTIONS_MENU:{name:"action.create.options.menu",skip_jump:!0,have_callback:!0},CREATE_SHORTCUT:{name:"action.create.shortcut"},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{name:"action.change.actionbar.leftbutton.type",skip_jump:!0,have_callback:!0},WINDOW_CLOSE:{name:"action.window.close",skip_jump:!0,have_callback:!0},WEBVIEW_CHECKRESERROR:{name:"action.webview.checkResError"},IAP_REQUESTPAYMENT:{name:"action.iap.requestpayment"},ZBROWSER_GETSTATS:{name:"action.zbrowser.getstats"},ZBROWSER_JSBRIDGE:{name:"action.zbrowser.jsbridge",skip_jump:!0,have_callback:!0},PROMPT_AUTHENTICATION:{name:"action.prompt.authentication"},CHANGE_ACTIONBAR_COLOR:{name:"action.change.actionbar.color",skip_jump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{name:"action.prompt.authentication.check_state"},OPEN_APPSTORE:{name:"action.open.appstore"},GET_LOCATION:{name:"action.get.location",have_callback:!0},QUERY_LOCATION_HIDE:{name:"action.query.location.hide",have_callback:!0},SHOW_TOAST:{name:"action.show.toast",have_callback:!0},OPEN_APP:{name:"action.open.app"},HIDE_KEYBOARD:{name:"action.hide.keyboard"},OPEN_PHONE:{name:"action.open.phone"},OPEN_QR:{name:"action.open.qr"},OPEN_SMS:{name:"action.open.sms"},VIEW_MYQR:{name:"action.view.myqr",have_callback:!0},KEEP_SCREEN:{name:"action.keep.screen",have_callback:!0},CHANGE_AUTOROTATE:{name:"action.change.autorotate",skip_jump:!0},CHECK_APP_INSTALLED:{name:"action.check.app.installed"},QUERY_SHOW:{name:"action.query.show"},QUERY_HIDE:{name:"action.query.hide"},OPEN_INAPPRW:{name:"action.open.inapprw"},ZALORUN_GETTRACKINGSTATUS:{name:"action.zalorun.getTrackingStatus",have_callback:!0},ZALORUN_SETTRACKINGSTATUS:{name:"action.zalorun.setTrackingStatus",have_callback:!0},ZALORUN_GETDAYSTEP:{name:"action.zalorun.getDayStep",have_callback:!0},ZALORUN_FORCESUBMITDATA:{name:"action.zalorun.forceSubmitData",have_callback:!0},ZALORUN_SETWEIGHT:{name:"action.zalorun.setWeight",have_callback:!0},OPEN_PROFILE_EXT:{name:"action.open.profile.ext"},DOWNLOAD_CATE:{name:"action.download.cate",have_callback:!0},JUMP_LOGIN:{name:"action.jump.login",skip_jump:!0,white_list:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{name:"action.open.adtima.ads.interstitial"},OPEN_ADTIMA_ADS:{name:"action.open.adtima.ads"},GET_ADIDCLIENT:{name:"action.get.adidclient"},SCAN_IBEACON:{name:"action.scan.ibeacon"},INTERACTIVE_VIBRATION:{name:"action.interactive.vibration"},SAVE_IMAGE_GALLERY:{name:"action.save.image.gallery",version_live:{iOS:408}},OPEN_MP:{name:"action.open.mp",version_live:{iOS:402}},CHANGE_ACTIONBAR:{name:"action.change.actionbar",version_live:{iOS:402},skip_jump:!0},ZBROWSER_MPDS:{name:"action.zbrowser.mpds",version_live:{iOS:402}},WEBVIEW_SET_RESULT:{name:"action.webview.set.result",version_live:{iOS:416}},MP_GET_NUMBER:{name:"action.mp.get.number",version_live:{iOS:416}},MP_OPEN_PROFILE_PICKER:{name:"action.mp.open.profile.picker",version_live:{iOS:432}},GET_SUPPORTED_ACTIONS:{name:"action.get.supported.actions",white_list:!0},MP_JOIN_WIFI:{name:"action.mp.join.wifi",version_live:{android:0,iOS:999},have_permission:!1,white_list:!1},PICK_MEDIA:{name:"action.pick.media",version_live:{iOS:999}},MP_CLOSE_LOADINGVIEW:{name:"action.mp.close.loadingview"}},li=0,ci=-1400,ui=-1500,di=-1401,pi=-1403,hi=-1404,vi={SUCCESS:"Success",READ_MORE:"Read more at: https://miniapp.zalo.me/docs/api",LOGIN_REQUIRED:"Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login",LOGIN_FAILED:"Login failed.",NOT_PERMISSION:"You don't have permission to call this api",CLIENT_NOT_SUPPORT:"This API is not supported in this Zalo version",DECODE_FAILED:"Can not decode your data. Read more at: https://miniapp.zalo.me/docs/api/error"},fi="apps/get-info",mi={android:12100571,iOS:400,wp:0,unknown:0},gi=[si.GET_DOWNLOADED_STICKER.name,si.OPEN_SHARE_STICKER.name,si.OPEN_PROFILE.name,si.OPEN_FEED_DETAIL.name,si.OPEN_FRIEND_RADA.name,si.OPEN_INAPP.name,si.OPEN_OUTAPP.name,si.OPEN_PAGE.name,si.OPEN_PHOTODETAIL.name,si.OPEN_GALARY.name,si.OPEN_GAMECENTER.name,si.OPEN_GAMENEWS.name,si.OPEN_TAB_CONTACT.name,si.OPEN_TAB_SOCIAL.name,si.OPEN_FRIENDSUGGEST.name,si.OPEN_GROUPLIST.name,si.OPEN_NEARBY.name,si.OPEN_ROOM.name,si.OPEN_STICKERSTORE.name,si.OPEN_CREATECHAT.name,si.COPY_LINK_CATESTICKER.name,si.REQUEST_BUY_STICKER.name,si.OPEN_CHAT.name,si.OPEN_TAB_CHAT.name,si.OPEN_CHATGROUP.name,si.OPEN_ADDFRIEND.name,si.OPEN_TAB_MORE.name,si.OPEN_POSTFEED.name,si.OPEN_LOGINDEVICES.name,si.OPEN_SENDSTICKER.name,si.REPORT_ABUSE.name,si.FOLLOW_OA.name,si.UNFOLLOW_OA.name,si.OPEN_GAMEDETAIL.name,si.OPEN_SHARESHEET.name,si.REQUEST_PERMISSION_CAMERA.name,si.CHANGE_TITLE_HEADER.name,si.WEBVIEW_CLEARCACHE.name,si.WEBVIEW_CONFIRMCACHE.name,si.WEBVIEW_ISVISIBLE.name,si.WEBVIEW_NETWORKTYPE.name,si.CHANGE_BUTTON_HEADER.name,si.CREATE_OPTIONS_MENU.name,si.CREATE_SHORTCUT.name,si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,si.WINDOW_CLOSE.name,si.WEBVIEW_CHECKRESERROR.name,si.IAP_REQUESTPAYMENT.name,si.ZBROWSER_GETSTATS.name,si.ZBROWSER_JSBRIDGE.name,si.PROMPT_AUTHENTICATION.name,si.CHANGE_ACTIONBAR_COLOR.name,si.PROMPT_AUTHENTICATION_CHECK_STATE.name,si.OPEN_APPSTORE.name,si.GET_LOCATION.name,si.QUERY_LOCATION_HIDE.name,si.SHOW_TOAST.name,si.OPEN_APP.name,si.HIDE_KEYBOARD.name,si.OPEN_PHONE.name,si.OPEN_QR.name,si.OPEN_SMS.name,si.VIEW_MYQR.name,si.KEEP_SCREEN.name,si.CHANGE_AUTOROTATE.name,si.CHECK_APP_INSTALLED.name,si.QUERY_SHOW.name,si.QUERY_HIDE.name,si.OPEN_INAPPRW.name,si.ZALORUN_GETTRACKINGSTATUS.name,si.ZALORUN_SETTRACKINGSTATUS.name,si.ZALORUN_GETDAYSTEP.name,si.ZALORUN_FORCESUBMITDATA.name,si.ZALORUN_SETWEIGHT.name,si.OPEN_PROFILE_EXT.name,si.DOWNLOAD_CATE.name,si.JUMP_LOGIN.name,si.OPEN_ADTIMA_ADS_INTERSTITIAL.name,si.OPEN_ADTIMA_ADS.name,si.GET_ADIDCLIENT.name,si.SCAN_IBEACON.name,si.SAVE_IMAGE_GALLERY.name,si.OPEN_MP.name,si.CHANGE_ACTIONBAR.name,si.INTERACTIVE_VIBRATION.name,si.ZBROWSER_MPDS.name],yi=0,_i=3,Ei=1,Si=0;class Ai{constructor(e,t,i){this.code=e,this.message=t,this.api=i}toString(){return`api: ${this.api}; code: ${this.code}; message: ${this.message}`}}class Ti extends Ai{constructor(e,t){super(e,t),this.message=`${t}. ${vi.READ_MORE}`,this.handler()}handler(){switch(this.code){case e.NativeCode.token_invalid:this.code=di,this.message=vi.LOGIN_REQUIRED;break;case e.NativeCode.not_permission:this.code=pi,this.message=vi.NOT_PERMISSION;break;case e.NativeCode.client_not_support:this.code=hi,this.message=vi.CLIENT_NOT_SUPPORT;break;case e.NativeCode.decode_failed:this.message=vi.DECODE_FAILED}}}const Oi={handler:null,setHandler(e){this.handler=e}};Oi.setHandler(((e,t)=>t instanceof Ai?(t.api=e,t):new Ai(-2001,Gt.isNull(t.message)?"Unknown Error":t.message,e)));const bi=(e,t,i)=>{const o=i.value;return i.value=function(...e){return n(this,void 0,void 0,(function*(){const{success:i,fail:r}=Array.isArray(e)&&e.length>0&&e[0];return new Promise(((a,s)=>n(this,void 0,void 0,(function*(){try{const t=yield o.apply(this,e);!Gt.isNull(i)&&Gt.isFunction(i)?i.call(null,t,this):a(t)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof vo&&(t=this.getLoginStatus()),t||(e=new Ai(di,vi.LOGIN_REQUIRED))}const{handler:i}=Oi,n=i.call(null,t,e,this);window.zmpSentry&&window.zmpSentry.throwError(n.toString()),!Gt.isNull(r)&&Gt.isFunction(r)?r.call(null,n,this):s(n)}}))))}))},i},wi=(e,t,i)=>{const n=i.value;return i.value=function(...e){try{return n.apply(this,e)}catch(e){if("login"!==(null==e?void 0:e.api)&&((null==e?void 0:e.code)===di||(null==e?void 0:e.code)===pi)){let t=!1;this instanceof vo&&(t=this.getLoginStatus()),t||(e=new Ai(di,vi.LOGIN_REQUIRED))}const{handler:i}=Oi,n=i.call(null,t,e,this);throw window.zmpSentry&&window.zmpSentry.throwError(n.toString()),n}},i},Ni=(e,t)=>({code:li,message:t||vi.SUCCESS,data:e||{}}),Pi={badRequest:e=>new Ai(ci,e),loginFailed:()=>new Ai(ci,vi.LOGIN_FAILED),loginRequired:()=>new Ai(di,vi.LOGIN_REQUIRED),missingParam:e=>new Ai(ci,`Missing required argument: ${e}`),wrongTypeParam:(e,t,i)=>new Ai(ci,`Wrong type of parameter '${e}'. Expected ${t}, but got ${i}`),cannotGetShareInfo:()=>new Ai(ui,"Can not get app info to share"),lengthInvalid:e=>new Ai(ci,`${e} length is invalid.`)};const Ci={encode:function(e){var t=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(void 0===n)return;if(null===n)return void t.push(i);t.push(encodeURIComponent(i)+"="+encodeURIComponent(n))}return t.join("&")},decode:function(e,t){var i={};if(""===e)return i;for(var n=e.split("&"),o=0;o<n.length;o++){var r=n[o].split("=",2),a=decodeURIComponent(r[0]);if(t&&Object.prototype.hasOwnProperty.call(i,a))throw new URIError("Duplicate key: "+a);i[a]=2===r.length?decodeURIComponent(r[1]):null}return i},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Ci.encode(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var i=e.split("=");i&&2==i.length&&(t[i[0]]=decodeURIComponent(i[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e?"undefined":typeof e))return e;var t=Object.keys(e),i=[];return t.map((function(t){var n=e[t],o=[t,n="object"==(void 0===n?"undefined":typeof n)?JSON.stringify(n):encodeURIComponent(n)].join("=");i.push(o)})),i.join("&")}},Ii=new RegExp("[\\u0300-\\u036f]","g"),ki=new RegExp("[đ|Đ]","g"),Ri=new RegExp("\\s","g"),Bi=Ht("zmp:utils:common"),Di=e=>{try{new URL(e)}catch(e){return!1}return!0},ji=()=>navigator.userAgent||navigator.vendor||window.opera,Li=()=>{const e=ji().toLowerCase();return{isWP:/iemobile/.test(e),isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}},Mi=e=>{const t=document.getElementsByTagName("meta");for(let i=0;i<t.length;i++)if(t[i].getAttribute("name")===e||t[i].getAttribute("property")===e)return t[i].getAttribute("content");return""},Ui=()=>{const e=ji().toLowerCase().split("zalo")[1];if(e){return e.replace(" ","").split("/")[1]||""}return""},Wi=()=>{let t=Li();return t.isWP?e.PlatformType.wp:t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown},xi=(e,t)=>{const i=t.toLowerCase(),n=i.split(/[<>]/i),o="array"===n[0];return!!("url"===i&&Di(e)||o&&("array"===i&&Array.isArray(e)||((e,t)=>Array.isArray(t)&&!t.some((t=>"url"===e?!Di(t):typeof t!==e)))(n[1],e))||!Array.isArray(e)&&typeof e===t)},zi=e=>(e=>{let t=Vt(e);return t||(t=Zt(e),t)?t:$t(e)})(e),Fi=e=>{if(Gt.isObject(JSON)&&JSON.parse&&Gt.isString(e)){const t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");return JSON.parse(t,((e,t)=>t))}return Gt.isObject(e)?e:new Function("return "+e)()},Gi=e=>{if(Gt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=new Array;for(var i=e.length,n=0;n<i;n++)t.push(Gi(e[n]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var o in t=new Array,e)t.push('"'+o+'":'+Gi(e[o]));return"{"+t.join(",")+"}"}return e.toString()},Hi=()=>{try{const e=Number(Ui()),t=Wi();return e>=mi[t]}catch(e){return!0}},$i=e=>JSON.stringify(e).replace(/"/g,'\\"').replace(/'/g,"&#39;"),Vi=e=>{try{if(e){Bi(e);const t=e.replace(/\\/g,"").replace(/&#39;/g,"'");return Bi("formattedValue",t,JSON.parse(t),typeof JSON.parse(t)),JSON.parse(t)}return null}catch(t){return Bi("parse json error:",t),e}},Zi=(e,t,i,o,r,a)=>n(void 0,void 0,void 0,(function*(){const n=new URL(location.href),s=new URLSearchParams;let l=`${n.pathname}${n.search}`;a&&(l=`/zapps/${e}${"/"===a[0]?"":"/"}${a}`);const c=new URL(`https://zalo.me/app/link${l}`);s.append("title",i),s.append("description",o||""),s.append("thumbnail",r),s.append("url",c.href),s.append("accessToken",t||"");const u=yield fetch("https://h5.zalo.me/openapi/create-sharelink",Object.assign({method:"POST",body:s},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})),d=yield u.json();if(!d||0!==d.err)throw Pi.cannotGetShareInfo();return c.search=`${c.search}&zshareId=${d.data.shareId}`,Object.assign(Object.assign({},d.data),{shareableLink:c.href})})),Ji=(e,t)=>i=>{if(!(Array.isArray(e)?e.some((e=>xi(i,e))):xi(i,e)))return{error:!0,errorMessage:e};if(t){if(Array.isArray(null==t?void 0:t.values))return{error:!(null==t?void 0:t.values.includes(i)),errorMessage:null==t?void 0:t.values.toString()};if(Gt.isNumber(null==t?void 0:t.maxLength))return{error:(Gt.isString(i)||Gt.isArray(i))&&i.length>(null==t?void 0:t.maxLength),errorMessage:`data length must <= ${null==t?void 0:t.maxLength}`};if(Gt.isNumber(null==t?void 0:t.min)&&Gt.isNumber(null==t?void 0:t.max))return{error:i<(null==t?void 0:t.min)||i>(null==t?void 0:t.max),errorMessage:`data must be in between ${null==t?void 0:t.min} and ${null==t?void 0:t.max}`};if(Gt.isNumber(null==t?void 0:t.min))return{error:i<(null==t?void 0:t.min),errorMessage:`data must >= ${null==t?void 0:t.min}`};if(Gt.isNumber(null==t?void 0:t.max))return{error:i>(null==t?void 0:t.max),errorMessage:`data must <= ${null==t?void 0:t.max}`};if(Gt.isRegExp(null==t?void 0:t.regex))return{error:!t.regex.test(i),errorMessage:"data must valid"}}return{error:!1}},Ki=(e,t,i)=>n(void 0,void 0,void 0,(function*(){const n={appId:e,versionStatus:t};Gt.isUndefined(i)||(n.currentVersion=i);const o=Ci.appendToUrl(`https://h5.zalo.me/${fi}`,n),r=yield fetch(o,{credentials:"include"});if(r.ok){const e=yield r.json();if(e.err<0||!e.data)throw new Error(e);return{name:e.data.name,version:e.data.version,description:e.data.description,appUrl:e.data.appUrl,qrCodeUrl:e.data.qrCodeUrl,logoUrl:e.data.logoUrl}}throw new Error("Can't get app info")}));var Qi=p((function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,r||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,r=n.length,a=new Array(r);o<r;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,r,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,o),!0;case 5:return u.fn.call(u.context,t,n,o,r),!0;case 6:return u.fn.call(u.context,t,n,o,r,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,o);break;default:if(!l)for(p=1,l=new Array(d-1);p<d;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,o){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var s=this._events[r];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,r);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||o&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[r]=1===c.length?c[0]:c:a(this,r)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}));class qi extends Qi{constructor(){super(),this.debug=Ht("zmp:event-emitter")}static getInstance(){return qi.instance||(qi.instance=new qi),qi.instance}h5ConfirmHandleEvent(e,t,i){ZaloJavaScriptInterface.jsH5EventCallback(e,t,i||"")}on(e,t,i){this.debug(`register ${e}: ${i}`);return super.on(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}once(e,t,i){this.debug(`register once ${e}: ${i}`);return super.once(e,((n,o)=>{this.h5ConfirmHandleEvent(n,e,i),t(o)}),i)}}var Yi={},Xi=function(e,t,i){var n=t||"default";return function(){var t=n in Yi?Yi[n](e,i):e;return t.apply(this,arguments)}};Xi.setWrapper=function(e){var t=arguments.length<=1||void 0===arguments[1]?"default":arguments[1];Yi[t]=e};var en={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function tn(e){try{return null===e?en:JSON.parse(e)}catch(e){return en}}var nn,on={execute:function(e,t,i,n){i.suppress_http_code=1;var o=Ci.encode(i);"post"!=t&&(e=Ci.appendToUrl(e,o),o="");var r=function(e,t){if(!self.XMLHttpRequest)return null;var i=new XMLHttpRequest,n=function(){};if(!("withCredentials"in i))return null;i.open(e,t,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded");var o={send:function(e){i.send(e)}},r=Xi((function(){r=n,"onload"in o&&o.onload(i)}),"entry","XMLHttpRequest:load"),a=Xi((function(){a=n,"onerror"in o&&o.onerror(i)}),"entry","XMLHttpRequest:error");return i.onload=function(){r()},i.onerror=function(){a()},i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r():a())},o}(t,e);return!!r&&(r.onload=function(e){n(tn(e.responseText))},r.onerror=function(e){e.responseText?n(tn(e.responseText)):n({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},r.send(o),!0)}};class rn extends Qi{constructor(){super(),this.debug=Ht("zmp:ZaloJSBridge"),this.events=qi.getInstance(),this._accessTk=zi("zacc_session")||"DEFAULT_ACCESS_TOKEN",this._jsAccessTk=zi("zlink3rd")||"DEFAULT_JS_TOKEN",this.results=[],this._userAgent=ji(),this._device=Li(),this._jsCallFuncCallbacks={},this.events.on(e.Events.AppPaused,(()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}})),this.sendLogTimer?clearInterval(this.sendLogTimer):this.sendLogTimer=setInterval((()=>{if(this.results.length>0){let e=this.results;this.results=[];try{this.sendLogData(e)}catch(e){}}}),5e3)}static getInstance(){return rn.instance||(rn.instance=new rn),rn.instance}set accessTk(e){this._accessTk=e}set jsAccessTk(e){this._jsAccessTk=e}sendLogData(e){try{on.execute("https://h5.zalo.me/log/async","post",{appId:window.APP_ID,data:JSON.stringify(e)},(e=>{}))}catch(e){}}onJSCall(e,t){try{this.debug("onJSCall",e,t);const i=Fi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n),this._jsCallFuncCallbacks[e]=null,delete this._jsCallFuncCallbacks[e]}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onJSCall","error",e)}}onMultiJSCall(e,t){try{this.debug("onMultiJSCall",e,t);const i=Fi(t);if(this._jsCallFuncCallbacks[e]){const t=this._jsCallFuncCallbacks[e].callback,n=this._jsCallFuncCallbacks[e].timeout;if(t){try{t.call(this,i)}catch(e){console.error("Call callback error",e)}n&&clearTimeout(n)}}this.results.push({action:i.action,error:i.error_code})}catch(e){console.log("onMultiJSCall","error",e)}}nativeEventHandler(e,t,i){this.debug(`eventId: ${e}, eventName: ${t}, eventData: ${i}`);const n=Vi(i);this.debug(n);const o=this.handleEventData(t,n);this.events.emit(t,e,o)}handleEventData(t,i){try{switch(t){case e.Events.OpenApp:const{url:t}=i,n=new URL(t),o=n.pathname.split(`/zapps/${Qt}`)[1];return{path:`${o||"/"}${n.search}`};default:return i}}catch(e){return i}}defaultCallback(e){null!=e&&(e=Fi(e))}jsCall(e,t,i,n=!1,o=3,r=!0){try{const a=e.name,s=((e="")=>`${e.normalize("NFD").replace(Ii,"").replace(ki,"d").replace(Ri,"").toLowerCase()}_${Math.random().toString(36).substr(2,4)}`)(a);if(!this._device.isMobile||Gt.isEmpty(a))return this.onJSCall(s,{error_code:-13,error_message:"params invalid!",data:{device:this._device.isMobile,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a}),!1;null==t&&(t={}),i||(i=this.defaultCallback);const l={error_code:-14,error_message:"Request Timeout!",data:{},action:a};this._jsCallFuncCallbacks[s]={timeout:r&&e.have_callback&&setTimeout((()=>{this.onJSCall(s,l)}),8e3),callback:i};try{return t=Gi(t),n?this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onMultiJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onMultiJSCall('${s}')`):this._device.isIOS?ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,window.onJSCall(s)):ZaloJavaScriptInterface.jsCall(this._jsAccessTk,a,this._accessTk,t,`window.onJSCall('${s}')`)}catch(r){if(!(o-- >0)){const e={error_code:-5,error_message:"Not ready!",data:{userAgent:this._userAgent,options:t,jsToken:this._jsAccessTk,access_token:this._accessTk},action:a,js_error:r};return this.onJSCall(s,e),!1}setTimeout((()=>{this.jsCall(e,t,i,n,o)}),500)}}catch(e){console.log("jsCall","error",e)}return!1}}class an{constructor(){this.debug=Ht("zmp:ZJSBridgeProvider"),nn.set(this,void 0),r(this,nn,rn.getInstance(),"f")}setZAccSession(e){o(this,nn,"f").accessTk=e}setJSToken(e){o(this,nn,"f").jsAccessTk=e}callNative(e,t,i){return this.debug(e.name,t),new Promise(((r,a)=>{const s=o=>n(this,void 0,void 0,(function*(){try{const n=new Ti(o.error_code,`${o.action}: ${o.error_message}`);if(null==i?void 0:i.callback){const e=yield i.callback(o,n);return r(e)}if(o&&o.error_code>=0)r(o.data||{});else if(o&&o.error_code<0){try{window.zmpSentry&&window.zmpSentry.captureMessage(`${e.name}: call native fail`,{extra:{data:t,rs:o}})}catch(e){}return a(n)}}catch(e){return a(e)}})),l=Li().isIOS,c=(e=>{var t;const i=Ui(),n=(null===(t=null==e?void 0:e.version_live)||void 0===t?void 0:t.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e.name))||i>=n})(e);if(l&&!c){const t=new Ti(-5,`${e}: Client isn't support this action`);return a(t)}(null==i?void 0:i.delay)?setTimeout((()=>{o(this,nn,"f").jsCall(e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}),i.delay):o(this,nn,"f").jsCall(e,t,s,null==i?void 0:i.isMultiCallback,null==i?void 0:i.nRetry,null==i?void 0:i.haveTimeout)}))}}nn=new WeakMap;var sn,ln,cn,un,dn,pn="2.18.7";class hn{static getVersion(){return pn}static getSystemInfo(){return{version:Mi("version-id")||"",apiVersion:pn,zaloVersion:Ui(),platform:Wi(),language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}static getAppInfo(){return n(this,void 0,void 0,(function*(){const e=this.getAppId(),t=this.getSystemInfo();return yield Ki(e,0,t.version)}))}}class vn{static setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_TITLE_HEADER,{title:e.title},{haveTimeout:!1})}))}static setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){const t={};let i;Gt.isEmpty(e.textColor)||(t.textColor=e.textColor),Gt.isString(e.color)&&e.color.length>0?(Gt.isEmpty(e.color)||(t.backgroundColor=e.color),i=5):(Gt.isEmpty(e.statusBarColor)||(t.backgroundColor=e.statusBarColor),i=6),this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{actionbarType:i,dataConfig:Object.assign(Object.assign({},e.dataConfig),t)}))),yield this.callNative(si.CHANGE_ACTIONBAR,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){const t="none"===e.type||"home"===e.type?_i:yi,i="home"===e.type||"both"===e.type?Ei:Si;this.setActionBarConfig((e=>Object.assign(Object.assign({},e),{buttonType:t,dataConfig:Object.assign(Object.assign({},e.dataConfig),{viewInLeftType:t}),homeConfig:Object.assign(Object.assign({},e.homeConfig),{enable:i})}))),yield this.callNative(si.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE,Object.assign({},this.getActionBarConfig()),{haveTimeout:!1})}))}static setNavigationBarRightButton(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CREATE_OPTIONS_MENU,{supportToolBar:e.supportToolBar,reset:e.reset,menuListItems:e.menuListItems,zapp:this.getAppId()})}))}}class fn{static setBackgroundColor(e){return n(this,void 0,void 0,(function*(){Gt.isString(e.backgroundColor)&&e.backgroundColor.length>0&&(yield this.callNative(si.CHANGE_ACTIONBAR,{actionbarType:this.isShowNavBar?5:6,dataConfig:{backgroundColor:e.backgroundColor,textColor:e.textColor}}))}))}}class mn{constructor(e,t,i,n){this.title=n,this.severity=t;const o=new Date;if(this.time=o.toLocaleTimeString(),this.content=e,i>0){const e=(new Error).stack;this.stack=e?e.replace("Error\n",""):""}}toString(){return(this.content.stack?[this.title,this.severity.toUpperCase(),this.time,this.content,this.content.stack.replace("Error:","")]:[this.title,this.severity.toUpperCase(),this.time,JSON.stringify(this.content),this.stack]).join(" ")}}sn=new WeakMap,ln=new WeakMap,cn=new WeakMap,un=new WeakMap,dn=new WeakMap;const gn=new class{constructor(){sn.set(this,3),ln.set(this,["none","error","warn","info"]),cn.set(this,"[zmp] > "),un.set(this,{error:0,warn:0,info:0,firstError:null,lastError:null}),dn.set(this,((e,t,i)=>{o(this,un,"f")[o(this,ln,"f")[e]]++;const n=o(this,ln,"f")[e];if(r(this,cn,o(this,cn,"f")+("string"!=typeof t?new mn(t,n,e,i).toString():t),"f"),!(e>o(this,sn,"f")))switch(e){case 1:console.error(o(this,cn,"f"));break;case 2:console.warn(o(this,cn,"f"));break;case 3:console.info(o(this,cn,"f"));break;default:throw new Error("internal")}}))}setLogLevel(e){r(this,sn,e,"f")}info(e){o(this,dn,"f").call(this,3,e)}warn(e,t){o(this,dn,"f").call(this,2,e,t)}error(e,t){o(this,dn,"f").call(this,1,e,t)}getMetrics(){return o(this,un,"f")}};class yn{static setDeviceOrientation(t){return n(this,void 0,void 0,(function*(){yield this.callNative(si.CHANGE_AUTOROTATE,{autoRotate:e.OrientationType[t.rotate]})}))}static getNetworkType(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.WEBVIEW_NETWORKTYPE,{url:window.location.href,featureId:""}).then((t=>{const i=t.network;let n;const o=Li().isAndroid;switch(i){case ai(o).NONE:n=e.NetworkType.none;break;case ai(o).WIFI:n=e.NetworkType.wifi;break;case ai(o)["2G"]:case ai(o)["3G"]:case ai(o)["4G"]:n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return{networkType:n}}))}))}static onNetworkStatusChange(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.NetworkChanged,(e=>{const i=e&&e.state;this.getNetworkType().then((e=>{const n={isConnected:"CONNECTED"===i,networkType:e&&e.networkType};t(n)})).catch((e=>{gn.error(e,"onNetworkStatusChange")}))}))}))}static startBeaconDiscovery(e){var t,i,o,r,a;return n(this,void 0,void 0,(function*(){const n={subaction:0,scanning_type:Gt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Gt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Gt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Gt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Gt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Gt.isNumber(null===(t=null==e?void 0:e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Gt.isNumber(null===(i=null==e?void 0:e.scanConfig)||void 0===i?void 0:i.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Gt.isNumber(null===(o=null==e?void 0:e.scanConfig)||void 0===o?void 0:o.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Gt.isNumber(null===(r=null==e?void 0:e.scanConfig)||void 0===r?void 0:r.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Gt.isNumber(null===(a=null==e?void 0:e.scanConfig)||void 0===a?void 0:a.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}};return yield this.callNative(si.SCAN_IBEACON,Object.assign({},n)),!0}))}static stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.SCAN_IBEACON,Object.assign({},{subaction:2})),!0}))}static getBeacons(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.SCAN_IBEACON,Object.assign({},{subaction:1}),{isMultiCallback:!0}).then((e=>{const t={beacons:[]};return Array.isArray(e)&&e.forEach((e=>{const i={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};t.beacons.push(i)})),t}))}))}static stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},Object.assign({},e))}))}static openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return Promise.resolve()}))}static getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){const t={services:e.services||[]};return this.callNative({name:""},t)}))}static getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return this.callNative({name:""},{})}))}static scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_QR,{skipOpenLink:!0})}))}static showToast(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.SHOW_TOAST,{toast:e.message})}))}static hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.HIDE_KEYBOARD,{})}))}static openPhone(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_PHONE,{phoneNum:e.phoneNumber,phoneCode:e.phoneNumber})}))}static openSMS(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_SMS,{content:e.content,phoneCode:e.phoneNumber})}))}static keepScreen(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.KEEP_SCREEN,{data:{keep_screen_on:e.keepScreenOn?1:0}})}))}static openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.PROMPT_AUTHENTICATION,{secret_data:e.secretData,app_id:this.getZAppId(),ui:{title:e.ui.title,sub_title:e.ui.subTitle,negative_text:e.ui.negativeButtonText},require_fingerprint:e.requireFingerprint?1:0}).then((e=>{var t,i,n,o;return{code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.domain,code:null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.error_code,message:null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.error_message,payToken:null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.pay_token}}}))}))}static checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.PROMPT_AUTHENTICATION_CHECK_STATE,{}).then((e=>({bioState:null==e?void 0:e.bio_state})))}))}static vibrate(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.INTERACTIVE_VIBRATION,{type:e.VibrateType[t.type],vibrate_time:t.milliseconds})}))}static connectWifi(e){return n(this,void 0,void 0,(function*(){let t="open";return Gt.isString(e.password)&&e.password.length>0&&(t="wpa_wpa2"),yield this.callNative(si.MP_JOIN_WIFI,{ssid:e.SSID,securityType:t,password:e.password,hiddenSsid:e.hiddenSSID})}))}}var _n,En,Sn,An,Tn,On,bn,wn,Nn,Pn,Cn,In,kn,Rn,Bn,Dn,jn,Ln,Mn,Un,Wn,xn,zn,Fn,Gn,Hn,$n,Vn;class Zn{constructor(e){_n.set(this,localStorage),En.set(this,void 0),Sn.set(this,void 0),Li(),r(this,Sn,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,En,e,"f"),this.findAllCurrentDataByApp(e)}findAllCurrentDataByApp(e){try{let t;for(t in o(this,_n,"f")){if(e){if(t.split("_")[0]!==e)continue}o(this,Sn,"f").keys.add(t)}}catch(e){gn.error(e,"LocalResourceStorage > findAllCurrentDataByApp")}}get(e){let t=new Map;return e.forEach((e=>{t.set(e,this.getSync(e))})),Promise.resolve(t)}getSync(e){return o(this,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,Sn,"f").keys.has(e)?o(this,_n,"f").getItem(e):null}set(e){return n(this,void 0,void 0,(function*(){return Object.entries(e).forEach((([e,t])=>{this.setSync(e,t.replace(/\\"/g,'"'))})),Promise.resolve({errorKeys:[]})}))}setSync(e,t){o(this,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,_n,"f").setItem(e,t),o(this,Sn,"f").keys.add(e)}getInfo(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.getInfoSync())}))}getInfoSync(){const e=((e,t)=>{let i,n,o=0;for(n in e){const r=n.split("_")[0];e.hasOwnProperty(n)&&(t&&r!==t||(i=2*(e[n].length+n.length),o+=i))}return o})(o(this,_n,"f"),o(this,En,"f"));return{currentSize:Gt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number(5120..toFixed(2))}}remove(e){return n(this,void 0,void 0,(function*(){return e.forEach((e=>{this.removeSync(e)})),Promise.resolve({errorKeys:[]})}))}removeSync(e){o(this,En,"f")&&(e=`${o(this,En,"f")}_${e}`),o(this,Sn,"f").keys.has(e)&&(o(this,_n,"f").removeItem(e),o(this,Sn,"f").keys.delete(e))}clear(){return n(this,void 0,void 0,(function*(){return Promise.resolve(this.clearSync())}))}clearSync(){o(this,Sn,"f").keys.forEach((e=>{o(this,En,"f")&&e.indexOf(o(this,En,"f"))<0||(o(this,_n,"f").removeItem(e),o(this,Sn,"f").keys.delete(e))}))}}_n=new WeakMap,En=new WeakMap,Sn=new WeakMap;class Jn extends an{constructor(e){super(),An.set(this,void 0),Tn.set(this,void 0),r(this,Tn,{keys:new Set,currentSize:0,limitSize:ri},"f"),r(this,An,e,"f")}get(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get",mpds_data:{keys:e},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=new Map;return e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),t}))}))}set(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.set",mpds_data:{map:e},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}getInfo(){return n(this,void 0,void 0,(function*(){const e=yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.get.size",mpds_data:{},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=0;return e&&e.mpds_data&&e.mpds_data.size&&(t=e.mpds_data.size),t}));return{currentSize:Gt.isNumber(e)?Number(e/1024):0,limitSize:Number(5120)}}))}remove(e){return n(this,void 0,void 0,(function*(){return{errorKeys:yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:o(this,An,"f")},{isMultiCallback:!1}).then((e=>{let t=[];return e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),t}))}}))}clear(){return n(this,void 0,void 0,(function*(){yield this.callNative(si.ZBROWSER_MPDS,{mpds_action:"mpds.clear.appData",mpds_data:{},appId:o(this,An,"f")})}))}}An=new WeakMap,Tn=new WeakMap;class Kn{getDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i=yield t.get(e),n={};return i.forEach(((e,t)=>{n[t]=Vi(e)})),n}))}putDataToStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance(),i={};return Object.entries(e).forEach((([e,t])=>{Gt.isUndefined(t)||Gt.isNull(t)||(i[e]=$i(t))})),yield t.set(i)}))}removeDataFromStorage(e){return n(this,void 0,void 0,(function*(){const t=this.getInstance();return yield t.remove(e)}))}clearStorage(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();yield e.clear()}))}getStorageInfo(){return n(this,void 0,void 0,(function*(){const e=this.getInstance();return yield e.getInfo()}))}}class Qn extends Kn{constructor(e){super(),On.set(this,void 0),r(this,On,e,"f")}getInstance(){return new Zn(o(this,On,"f"))}}On=new WeakMap;class qn extends Kn{constructor(e){super(),bn.set(this,void 0),r(this,bn,e,"f")}getInstance(){return new Jn(o(this,bn,"f"))}}bn=new WeakMap;class Yn{static setStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());return Hi()&&(t=new qn(this.getAppId())),yield t.putDataToStorage(e.data)}))}static getStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());Hi()&&(t=new qn(this.getAppId()));return yield t.getDataFromStorage(e.keys)}))}static getStorageInfo(e){return n(this,void 0,void 0,(function*(){let e=new Qn(this.getAppId());return Hi()&&(e=new qn(this.getAppId())),yield e.getStorageInfo()}))}static removeStorage(e){return n(this,void 0,void 0,(function*(){let t=new Qn(this.getAppId());return Hi()&&(t=new qn(this.getAppId())),yield t.removeDataFromStorage(e.keys)}))}static clearStorage(e={}){return n(this,void 0,void 0,(function*(){let e=new Qn(this.getAppId());Hi()&&(e=new qn(this.getAppId())),yield e.clearStorage()}))}}class Xn{static getUserInfo(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();let i="id,name,picture";(null==e?void 0:e.avatarType)&&(i=`${i}.type(${null==e?void 0:e.avatarType})`);return{userInfo:yield fetch(`${ti}?fields=${i}`,{headers:{access_token:t||""}}).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json(),i={id:t.id,name:t.name,birthday:"",gender:"",avatar:t.picture&&t.picture.data&&t.picture.data.url};return console.warn("'birthday' and 'gender' are deprecated"),i}))))}}))}static getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_GET_NUMBER,{},{isMultiCallback:!0,callback:(e,t)=>{if(0===e.error_code){const t={number:e.data};return Promise.resolve(t)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}}class eo{static closeApp(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.WINDOW_CLOSE,{})}))}static openMiniApp(e){return n(this,void 0,void 0,(function*(){const t=null==e?void 0:e.appId,i=(null==e?void 0:e.params)||{},n=Object.entries(i).map((function([e,t]){return[e,t].join("=")})).join("&"),o=yield Ki(t,0);yield this.callNative(si.OPEN_MP,{mpUrl:`https://h5.zdn.vn/zapps/${t}/${n.length>0?"?"+n:""}`,mpInfo:{appId:t,appAvtUrl:o.logoUrl||"",appName:o.name||""}})}))}static openWebview(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.OPEN_INAPP,{url:e.url})}))}static closeLoading(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.MP_CLOSE_LOADINGVIEW,{at:(new Date).getTime(),when:e,url:location.href})}))}}class to{static getLocation(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.GET_LOCATION,{silent_request:!1,permission_description:"Cho phép Zalo truy cập vào vị trí của thiết bị này?"},{isMultiCallback:!0,haveTimeout:!1,callback:(e,t)=>{if(0===e.error_code){const t=e.data,i={latitude:t.latitude,longitude:t.longitude,timestamp:t.timestamp,provider:t.provider};return Promise.resolve(i)}return Promise.reject(t)},delay:this.isIOS?400:0})}))}static sendLocation(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.QUERY_LOCATION_HIDE,{title:e.title,touserid:e.toUserId,zapp:this.getZAppId()})}))}}class io{static requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.REQUEST_PERMISSION_CAMERA,{},{callback:(e,t)=>-2===e.error_code||e.error_code>=0?Promise.resolve({userAllow:-2!==e.error_code,message:e.error_message}):Promise.reject(t)})}))}static saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){let t={};return Gt.isEmpty(e.imageBase64Data)?Gt.isEmpty(e.imageUrl)||(t={imageUrl:e.imageUrl}):t={imageBase64Data:e.imageBase64Data},yield this.callNative(si.SAVE_IMAGE_GALLERY,Object.assign({},t))}))}}class no{static viewOAQr(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.VIEW_MYQR,{dpn:e.displayName,uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openProfile(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_PROFILE,{uId:t.id,type:e.ProfileType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openChat(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_CHAT,{uId:t.id,type:e.ChatType[t.type],zapp:this.getZAppId(),sourceId:t.sourceId,sourceIndex:t.sourceIndex})}))}static openPostFeed(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":i={photoUrl:t.data.imageUrl};break;case"link":i={link:t.data.link,title:t.data.title,thumb:t.data.thumb,description:t.data.description};break;case"profile":i={avt:t.data.avatar,uid:t.data.id,dpn:t.data.displayName}}return yield this.callNative(si.OPEN_POSTFEED,Object.assign(Object.assign({type:e.PostFeedType[t.type]},i),{zapp:this.getZAppId()})).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static followOA(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.FOLLOW_OA,{uid:e.id,showDialogConfirm:!0,zapp:this.getZAppId()},{haveTimeout:!1})}))}static unfollowOA(e){return n(this,void 0,void 0,(function*(){yield this.callNative(si.UNFOLLOW_OA,{uid:e.id,zapp:this.getZAppId()},{haveTimeout:!1})}))}static openShareSheet(t){return n(this,void 0,void 0,(function*(){let i={};switch(t.type){case"image":let e=[];Array.isArray(t.data.imageUrls)&&t.data.imageUrls.length>0?e=t.data.imageUrls:e.push(t.data.imageUrl),i={photoUrls:e,photoUrl:t.data.imageUrl,caption:t.data.caption};break;case"gif":i={photoUrl:t.data.imageUrl,gifUrl:t.data.gifUrl,width:t.data.width,height:t.data.height};break;case"video":i={videoThumb:t.data.videoThumb,videoUrl:t.data.videoUrl,width:t.data.width,height:t.data.height};break;case"link":i={link:t.data.link,chatOnly:t.data.chatOnly?1:0};break;case"oa":i={uid:t.data.id};break;case"zmp":const n=yield this.getAccessToken(),o=yield Zi(this.getAppId(),n||"",t.data.title||"",t.data.description||"",t.data.thumbnail||"",t.data.path);window.forceShareZMP?i={data:{ZInstantAPIInfo:{url:`${o.zinstantApi}`,zinstantdata_id:`templateId=11412&appId=${this.getAppId()}&shareId=${o.shareId}`},previewMsgText:{msg:{en:"Mini App",vi:"Chương trình nhỏ"}},enableReactions:1}}:(i={link:o.shareableLink,chatOnly:t.data.chatOnly?1:0},t.type="link")}return yield this.callNative(si.OPEN_SHARESHEET,Object.assign(Object.assign({type:e.ShareSheetType[t.type]},i),{zapp:this.getZAppId()}),{haveTimeout:!1}).then((e=>({status:e.status,shareType:e.share_type,numberOfUser:e.uid_to_size})))}))}static createShortcut(e,t,i){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.CREATE_SHORTCUT,{url:e,title:t,iconUrl:i})}))}static openProfilePicker(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.MP_OPEN_PROFILE_PICKER,{maxProfile:e},{isMultiCallback:!0,callback:(e,t)=>0===e.error_code&&Array.isArray(e.data)?Promise.resolve(e.data.map((e=>e.id))):Promise.reject(t)})}))}static getActionsSupported(t){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.GET_SUPPORTED_ACTIONS,{},{isMultiCallback:!1,callback:(t,i)=>{const n=Wi();if(Array.isArray(t.actions)&&t.actions.length>0){const e=Object.keys(si).filter((e=>si[e].skip_jump)),i={actions:[...t.actions,...e]};return Promise.resolve(i)}if(n===e.PlatformType.iOS){const e={actions:gi};return Promise.resolve(e)}return Promise.reject(i)}})}))}static openMediaPicker(t,i,o,r){return n(this,void 0,void 0,(function*(){const n={type:0,url:"https://zapi-server.tungnt.xyz/upload/photos",maxSize:1048576};return yield this.callNative(si.PICK_MEDIA,{media_type:e.MediaPickerType[t],edit_view:Object.assign(Object.assign({},{enable:1,aspect_ratio:"1:1"}),i),silent_request:o,upload:n,max_select_item:r},{isMultiCallback:!0,callback:(e,t)=>{var i,n;if(0===e.error_code){const t=Vi(null===(i=e.data)||void 0===i?void 0:i.result_content),o={urls:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.urls};return Promise.resolve(o)}return Promise.reject(t)}})}))}static openOutApp(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.OPEN_OUTAPP,{url:e})}))}}class oo{static getRouteParams(){let e={};const t=window.location.href;try{let i=new URL(t).searchParams.toString();i&&(e=Ci.getParamsAsObject(i))}catch(e){throw new Error("Url không hợp lệ")}return e}static sendDataToPreviousMiniApp(e){return n(this,void 0,void 0,(function*(){return yield this.callNative(si.WEBVIEW_SET_RESULT,{result:$i(e.data)})}))}static onCallbackData(t){return n(this,void 0,void 0,(function*(){yield this.events.on(e.Events.OnDataCallback,(e=>{t({data:e})}))}))}}class ro extends an{constructor(){var e,t,i,n,a,s,l,c,u,d,p,h,v,f,m,g,y;super(),wn.set(this,Kt),Nn.set(this,Qt),Pn.set(this,qt),Cn.set(this,void 0),In.set(this,void 0),kn.set(this,void 0),Rn.set(this,null),Bn.set(this,{timer:{getToken:0}}),Dn.set(this,void 0),jn.set(this,void 0),Ln.set(this,null),this.events=qi.getInstance(),this.isIOS=Li().isIOS,Mn.set(this,void 0),this.getActionBarConfig=()=>o(this,Mn,"f"),this.setActionBarConfig=e=>{r(this,Mn,e(o(this,Mn,"f")),"f")},Un.set(this,(()=>new Promise(((e,t)=>{Gt.isUndefined(o(this,Ln,"f"))||Gt.isNull(o(this,Ln,"f"))?this.callNative(si.JUMP_LOGIN,{}).then((t=>{const i=t&&t.cookiesOAuthLogins||[],n=i.find((e=>e.name===Xt));n&&(this.setJSToken(n.value),window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(n.value)),r(this,Ln,i,"f"),e(i)})).catch((e=>{t(e)})):e(o(this,Ln,"f"))})))),Wn.set(this,vn.setNavigationBarRightButton),this.getVersion=hn.getVersion,this.getSystemInfo=hn.getSystemInfo,this.setNavigationBarTitle=vn.setNavigationBarTitle,this.setNavigationBarColor=vn.setNavigationBarColor,this.setNavigationBarLeftButton=vn.setNavigationBarLeftButton,this.setBackgroundColor=fn.setBackgroundColor,this.setDeviceOrientation=yn.setDeviceOrientation,this.setStorage=Yn.setStorage,this.getStorage=Yn.getStorage,this.getStorageInfo=Yn.getStorageInfo,this.removeStorage=Yn.removeStorage,this.clearStorage=Yn.clearStorage,this.getUserInfo=Xn.getUserInfo,this.getNetworkType=yn.getNetworkType,this.onNetworkStatusChange=yn.onNetworkStatusChange,this.startBeaconDiscovery=yn.startBeaconDiscovery,this.stopBeaconDiscovery=yn.stopBeaconDiscovery,this.getBeacons=yn.getBeacons,this.closeApp=eo.closeApp,this.getLocation=to.getLocation,this.stopBluetoothDevicesDiscovery=yn.stopBluetoothDevicesDiscovery,this.startBluetoothDevicesDiscovery=yn.stopBluetoothDevicesDiscovery,this.openBluetoothAdapter=yn.openBluetoothAdapter,this.onBluetoothDeviceFound=yn.onBluetoothDeviceFound,this.onBluetoothAdapterStateChange=yn.onBluetoothAdapterStateChange,this.getConnectedBluetoothDevices=yn.getConnectedBluetoothDevices,this.getBluetoothDevices=yn.getBluetoothDevices,this.getBluetoothAdapterState=yn.getBluetoothAdapterState,this.closeBluetoothAdapter=yn.closeBluetoothAdapter,this.scanQRCode=yn.scanQRCode,this.openProfile=no.openProfile,this.openChat=no.openChat,this.openPostFeed=no.openPostFeed,this.followOA=no.followOA,this.unFollowOA=no.unfollowOA,this.openShareSheet=no.openShareSheet,this.requestCameraPermission=io.requestCameraPermission,this.createShortcut=no.createShortcut,this.openBioAuthentication=yn.openBioAuthentication,this.checkStateBioAuthentication=yn.checkStateBioAuthentication,this.sendLocation=to.sendLocation,this.showToast=yn.showToast,this.hideKeyboard=yn.hideKeyboard,this.openPhone=yn.openPhone,this.openSMS=yn.openSMS,this.viewOAQr=no.viewOAQr,this.keepScreen=yn.keepScreen,this.saveImageToPhotosAlbum=io.saveImageToPhotosAlbum,this.openMiniApp=eo.openMiniApp,this.vibrate=yn.vibrate,this.openWebview=eo.openWebview,this.getRouteParams=oo.getRouteParams,this.getAppInfo=hn.getAppInfo,this.sendDataToPreviousMiniApp=oo.sendDataToPreviousMiniApp,this.onCallbackData=oo.onCallbackData,this.getPhoneNumber=Xn.getPhoneNumber,this.openProfilePicker=no.openProfilePicker,xn.set(this,no.getActionsSupported),this.connectWifi=yn.connectWifi,this.openMediaPicker=no.openMediaPicker,this.openOutApp=no.openOutApp,this.closeLoading=eo.closeLoading,r(this,Cn,null,"f"),r(this,In,null,"f"),r(this,kn,null,"f"),this.isShowNavBar=!0,r(this,Dn,0,"f"),r(this,jn,0,"f");const _="home"===(null===(t=null===(e=o(this,Pn,"f"))||void 0===e?void 0:e.app)||void 0===t?void 0:t.leftButton)||"both"===(null===(n=null===(i=o(this,Pn,"f"))||void 0===i?void 0:i.app)||void 0===n?void 0:n.leftButton)?Ei:Si,E=new URL(location.href),S=Gt.isString(null===(s=null===(a=o(this,Pn,"f"))||void 0===a?void 0:a.app)||void 0===s?void 0:s.headerColor)&&(null===(u=null===(c=null===(l=o(this,Pn,"f"))||void 0===l?void 0:l.app)||void 0===c?void 0:c.headerColor)||void 0===u?void 0:u.length)>0?5:6,A="none"===(null===(p=null===(d=o(this,Pn,"f"))||void 0===d?void 0:d.app)||void 0===p?void 0:p.leftButton)||"home"===(null===(v=null===(h=o(this,Pn,"f"))||void 0===h?void 0:h.app)||void 0===v?void 0:v.leftButton)?_i:yi;r(this,Mn,{actionbarType:S,buttonType:A,dataConfig:{backgroundColor:(null===(m=null===(f=o(this,Pn,"f"))||void 0===f?void 0:f.app)||void 0===m?void 0:m.headerColor)||"",textColor:(null===(y=null===(g=o(this,Pn,"f"))||void 0===g?void 0:g.app)||void 0===y?void 0:y.textColor)||"",viewInLeftType:A,confirmToExit:1},homeConfig:{enable:_,url:`https://h5.zdn.vn/zapps/${this.getAppId()}/${E.search}`}},"f")}static getInstance(){return ro.instance||(ro.instance=new ro),ro.instance}getLoginStatus(){return Gt.isString(o(this,kn,"f"))&&o(this,kn,"f").length>0}getAppId(){return o(this,Nn,"f")}getZAppId(){return o(this,wn,"f")}login(e){return n(this,void 0,void 0,(function*(){const e=yield o(this,Un,"f").call(this),t=e.find((e=>e.name===Yt)),i=e.find((e=>e.name===ei));if(!Gt.isUndefined(t)&&!Gt.isNull(t)&&Gt.isString(t.value)){if(r(this,Cn,t.value,"f"),Gt.isUndefined(i)||Gt.isNull(i)||!Gt.isString(i.value)?yield this.loginZaloV3():(r(this,In,i.value,"f"),yield this.loginZaloV4()),!o(this,kn,"f"))throw Pi.loginFailed();return o(this,kn,"f")}throw Pi.loginFailed()}))}loginZaloV3(){return n(this,void 0,void 0,(function*(){return yield fetch(`${ni}?app_id=${o(this,wn,"f")}&redirect_uri=https://h5.zdn.vn/zapps/${o(this,Nn,"f")}/&code=${o(this,Cn,"f")}&isSDK=true123`).then((e=>n(this,void 0,void 0,(function*(){let t=yield e.json();if(t.access_token){r(this,kn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,jn,e,"f"),r(this,Dn,(new Date).getTime(),"f"),this.setZAccSession(o(this,kn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,kn,"f")||""),o(this,kn,"f")}return null}))))}))}loginZaloV4(){return n(this,void 0,void 0,(function*(){const e=new URLSearchParams;e.append("app_id",o(this,Nn,"f")),e.append("code",o(this,Cn,"f")||""),e.append("code_verifier",o(this,In,"f")||""),Gt.isNull(o(this,Rn,"f"))?e.append("grant_type","authorization_code"):(e.append("grant_type","refresh_token"),e.append("refresh_token",o(this,Rn,"f")||""));return yield fetch(ii,Object.assign({method:"POST",body:e},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).then((e=>n(this,void 0,void 0,(function*(){const t=yield e.json();if(t.refresh_token&&r(this,Rn,t.refresh_token,"f"),t.access_token){r(this,kn,t.access_token,"f");const e=1e3*parseInt(t.expires_in);return r(this,jn,e,"f"),r(this,Dn,(new Date).getTime(),"f"),this.setZAccSession(o(this,kn,"f")||""),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(o(this,kn,"f")||""),o(this,kn,"f")}return null}))))}))}getAccessToken(e){return n(this,void 0,void 0,(function*(){const e=(new Date).getTime()-o(this,Dn,"f");if(!o(this,kn,"f"))throw Pi.loginRequired();return e<o(this,jn,"f")?o(this,kn,"f"):yield this.login()}))}}wn=new WeakMap,Nn=new WeakMap,Pn=new WeakMap,Cn=new WeakMap,In=new WeakMap,kn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,Un=new WeakMap,Wn=new WeakMap,xn=new WeakMap;class ao{constructor(){zn.set(this,Kt),Fn.set(this,qt),Gn.set(this,"DEFAULT ZOAUTH"),Hn.set(this,"DEFAULT ACCESS TOKEN"),$n.set(this,{timer:{getToken:0}}),Vn.set(this,!1),this.getLoginStatus=()=>o(this,Vn,"f"),this.getAppId=()=>o(this,zn,"f"),this.login=()=>(r(this,Vn,!0,"f"),Promise.resolve(o(this,Gn,"f"))),this.getAccessToken=()=>Promise.resolve(o(this,Hn,"f")),this.getVersion=hn.getVersion,this.getSystemInfo=hn.getSystemInfo,this.setNavigationBarTitle=()=>Promise.resolve(),this.setNavigationBarColor=()=>Promise.resolve(),this.setBackgroundColor=()=>Promise.resolve(),this.setNavigationBarLeftButton=()=>Promise.resolve(),this.setDeviceOrientation=()=>Promise.resolve(),this.setStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.putDataToStorage(e.data),{errorKeys:[]}})),this.getStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.getDataFromStorage(e.keys)})),this.getStorageInfo=e=>n(this,void 0,void 0,(function*(){const e=new Qn(this.getAppId());return yield e.getStorageInfo()})),this.removeStorage=e=>n(this,void 0,void 0,(function*(){const t=new Qn(this.getAppId());return yield t.removeDataFromStorage(e.keys)})),this.clearStorage=e=>n(this,void 0,void 0,(function*(){const e=new Qn(this.getAppId());return yield e.clearStorage()})),this.getUserInfo=()=>(console.warn("birthday and gender are deprecated"),Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})),this.getNetworkType=()=>{let t;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}const i={networkType:t};return Promise.resolve(i)},this.onNetworkStatusChange=t=>{const i=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=i.effectiveType;return i.addEventListener("change",(function(){let i;switch(n){case"none":i=e.NetworkType.none;break;case"4g":i=e.NetworkType.wifi;break;case"3g":case"2g":i=e.NetworkType.cellular;break;default:i=e.NetworkType.unknown}t({isConnected:!0,networkType:i})})),Promise.resolve()},this.startBeaconDiscovery=e=>Promise.resolve(!0),this.stopBeaconDiscovery=e=>Promise.resolve(!0),this.getBeacons=e=>Promise.resolve({beacons:[]}),this.closeApp=()=>Promise.resolve(),this.getLocation=()=>Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"}),this.onBackButtonClick=()=>Promise.resolve(),this.stopBluetoothDevicesDiscovery=()=>Promise.resolve(),this.startBluetoothDevicesDiscovery=()=>Promise.resolve(),this.openBluetoothAdapter=()=>Promise.resolve(),this.onBluetoothDeviceFound=()=>Promise.resolve(),this.onBluetoothAdapterStateChange=()=>Promise.resolve(),this.getConnectedBluetoothDevices=()=>Promise.resolve(),this.getBluetoothDevices=()=>Promise.resolve(),this.getBluetoothAdapterState=()=>Promise.resolve(),this.closeBluetoothAdapter=()=>Promise.resolve(),this.scanQRCode=()=>Promise.resolve({content:"132"}),this.openProfile=()=>Promise.resolve(),this.openChat=()=>Promise.resolve(),this.openPostFeed=()=>Promise.resolve({status:1,shareType:0,numberOfUser:0}),this.followOA=()=>Promise.resolve(),this.unFollowOA=()=>Promise.resolve(),this.openShareSheet=()=>Promise.resolve({status:2,shareType:0,numberOfUser:0}),this.requestCameraPermission=()=>Promise.resolve({userAllow:!0,message:"Success"}),this.createShortcut=()=>Promise.resolve(),this.openBioAuthentication=()=>Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}}),this.checkStateBioAuthentication=()=>Promise.resolve({bioState:""}),this.sendLocation=()=>Promise.resolve(),this.showToast=()=>Promise.resolve(),this.hideKeyboard=()=>Promise.resolve(),this.openPhone=()=>Promise.resolve(),this.openSMS=()=>Promise.resolve(),this.viewOAQr=()=>Promise.resolve(),this.keepScreen=()=>Promise.resolve(),this.saveImageToPhotosAlbum=()=>Promise.resolve(),this.openMiniApp=e=>Promise.resolve(),this.vibrate=()=>Promise.resolve(),this.openWebview=e=>(location.replace(e.url),Promise.resolve()),this.getRouteParams=oo.getRouteParams,this.getAppInfo=()=>Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""}),this.sendDataToPreviousMiniApp=e=>Promise.resolve(),this.onCallbackData=e=>(e({data:""}),Promise.resolve()),this.getPhoneNumber=()=>(console.warn("This api only works on zalo app"),Promise.resolve({number:""})),this.openProfilePicker=()=>(console.warn("This api only works on zalo app"),Promise.resolve([])),this.connectWifi=()=>(console.warn("This api only works on zalo app"),Promise.resolve()),this.openOutApp=e=>(location.href=e,Promise.resolve()),this.closeLoading=e=>Promise.resolve()}on(e,t,i){throw new Error("Method not implemented.")}once(e,t,i){throw new Error("Method not implemented.")}off(e,t,i,n){throw new Error("Method not implemented.")}removeAllListeners(e){throw new Error("Method not implemented.")}openMediaPicker(e,t,i,n){return console.warn("This api only works on zalo app"),Promise.resolve({urls:[]})}}zn=new WeakMap,Fn=new WeakMap,Gn=new WeakMap,Hn=new WeakMap,$n=new WeakMap,Vn=new WeakMap;const so=Symbol("required"),lo=Symbol("checkType"),co=(e,t)=>(i,n,o)=>{let r=Reflect.getOwnMetadata(so,i,n)||[];r.push({parameterIndex:o,fields:e,option:t}),Reflect.defineMetadata(so,r,i,n)},uo=(e,t,i)=>(n,o,r)=>{let a=Reflect.getOwnMetadata(lo,n,o)||[];a.push({parameterIndex:r,type:e,properties:t,defaultValue:i}),Reflect.defineMetadata(lo,a,n,o)};const po=(e,t,i)=>{const n=i.value,o=n.toString().match(/\(.*?\)/)[0].replace(/[()]/gi,"").replace(/\s/gi,"").split(",");return i.value=function(){const i=Reflect.getOwnMetadata(so,e,t),r=Reflect.getOwnMetadata(lo,e,t);return r&&r.forEach((e=>{const{parameterIndex:t,type:i,properties:n,defaultValue:r}=e;let a=arguments[t],s=o[t];const l=typeof a;if(!Gt.isUndefined(a)){if(!xi(a,i))throw Pi.wrongTypeParam(s,i,Array.isArray(a)?"array":null===a?"null":l);"object"===i&&Object.entries(n).forEach((([e,i])=>{const n=e.split("?")[0],o=Gt.get(a,n);if(Gt.isUndefined(o)||Gt.isNull(o)){if(!e.includes("?"))throw Pi.missingParam(e);Gt.isObject(Gt.get(a,n.split(".")[0]))&&r&&!Gt.isUndefined(Gt.get(r,n))&&Gt.set(arguments[t],n,Gt.get(r,n))}else if(Gt.isFunction(i)){const e=i(o);if(e&&e.error)throw Pi.wrongTypeParam(`${s}.${n}`,e.errorMessage,typeof o)}}))}})),i&&i.forEach((e=>{const{parameterIndex:t,option:i,fields:n}=e,o=arguments[t],r=null==i?void 0:i.if,a=null==i?void 0:i.defaultValue;let s=!0;r&&(s=Object.keys(r).every((e=>Gt.get(o,e)===r[e]))),s&&n.forEach((e=>{const i=e=>{let i=!1;return Gt.isEmpty(Gt.get(o,e))&&(Gt.isUndefined(Gt.get(a,e))||Gt.set(arguments[t],e,Gt.get(a,e)),i=!0),i};if(Array.isArray(e)&&e.length>0&&e.every(i))throw Pi.missingParam(e.join(" or "));if(Gt.isString(e)&&i(e))throw Pi.missingParam(e)}))})),n.apply(this,arguments)},i};var ho;class vo{constructor(){this.events=qi.getInstance(),ho.set(this,void 0),r(this,ho,this.getServiceInstance(),"f"),this.events.addListener=(t,i,n)=>{const o=t;return this.events.addListener(e.Events[o],i,n)}}login(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").login(e)}))}getLoginStatus(){return o(this,ho,"f").getLoginStatus()}getAccessToken(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getAccessToken(e)}))}getVersion(){return o(this,ho,"f").getVersion()}getSystemInfo(){return o(this,ho,"f").getSystemInfo()}setNavigationBarTitle(e){return n(this,void 0,void 0,(function*(){return o(this,ho,"f").setNavigationBarTitle(e)}))}setNavigationBarColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setNavigationBarColor(e)}))}setBackgroundColor(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setBackgroundColor(e)}))}setNavigationBarLeftButton(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setNavigationBarLeftButton(e)}))}setDeviceOrientation(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setDeviceOrientation(e)}))}setStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").setStorage(e)}))}getStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getStorage(e)}))}getStorageInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getStorageInfo(e)}))}removeStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").removeStorage(e)}))}clearStorage(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").clearStorage(e)}))}getUserInfo(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getUserInfo(e)}))}getNetworkType(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getNetworkType(e)}))}onNetworkStatusChange(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onNetworkStatusChange(e)}))}startBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").startBeaconDiscovery(e)}))}stopBeaconDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").stopBeaconDiscovery(e)}))}getBeacons(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBeacons(e)}))}closeApp(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeApp(e)}))}getLocation(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getLocation(e)}))}stopBluetoothDevicesDiscovery(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").stopBluetoothDevicesDiscovery()}))}startBluetoothDevicesDiscovery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").startBluetoothDevicesDiscovery(e)}))}openBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openBluetoothAdapter()}))}onBluetoothDeviceFound(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onBluetoothDeviceFound()}))}onBluetoothAdapterStateChange(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onBluetoothAdapterStateChange()}))}getConnectedBluetoothDevices(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getConnectedBluetoothDevices(e)}))}getBluetoothDevices(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBluetoothDevices()}))}getBluetoothAdapterState(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getBluetoothAdapterState()}))}closeBluetoothAdapter(){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeBluetoothAdapter()}))}scanQRCode(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").scanQRCode(e)}))}openProfile(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openProfile(e)}))}openChat(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openChat(e)}))}openPostFeed(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openPostFeed(e)}))}followOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").followOA(e)}))}unfollowOA(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").unFollowOA(e)}))}openShareSheet(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openShareSheet(e)}))}requestCameraPermission(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").requestCameraPermission(e)}))}createShortcut(e){return n(this,void 0,void 0,(function*(){const t=yield Ki(Qt,0),i=Li().isIOS,n=t.logoUrl||Mi("og:image:url")||"",r=t.name||document.title,a=e.params?new URLSearchParams(e.params):new URLSearchParams;if(a.append("utm_source","zalo-shortcut"),a.append("utm_medium","default"),a.append("utm_campaign","default"),i){a.append("appId",Qt),a.append("appName",r),a.append("appIcon",n);const e=`https://mini.zalo.me/shortcut.html?${a.toString()}`;yield o(this,ho,"f").openOutApp(encodeURI(e))}else yield o(this,ho,"f").createShortcut(`https://zalo.me/app/link/zapps/${Qt}/?${a.toString()}`,r,n);return Ni()}))}openBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openBioAuthentication(e)}))}checkStateBioAuthentication(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").checkStateBioAuthentication(e)}))}sendLocation(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").sendLocation(e)}))}showToast(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").showToast(e)}))}hideKeyboard(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").hideKeyboard(e)}))}openPhone(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").openPhone(e)}))}openSMS(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openSMS(e)}))}viewOAQr(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").viewOAQr(e)}))}keepScreen(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").keepScreen(e)}))}saveImageToGallery(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").saveImageToPhotosAlbum(e)}))}saveImageToPhotosAlbum(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").saveImageToPhotosAlbum(e)}))}openMiniApp(e){return n(this,void 0,void 0,(function*(){if(!Gt.isEmpty(e.params)){const t=e.params||{};Object.keys(t).forEach((e=>{"object"==typeof t[e]&&(t[e]=JSON.stringify(t[e])),t[e]=""+encodeURIComponent(t[e])})),e.params=t}yield o(this,ho,"f").openMiniApp(e)}))}vibrate(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").vibrate(e)}))}openWebview(e){return n(this,void 0,void 0,(function*(){yield o(this,ho,"f").openWebview(e)}))}getRouteParams(){return o(this,ho,"f").getRouteParams()}getAppInfo(e){return o(this,ho,"f").getAppInfo()}sendDataToPreviousMiniApp(e){return o(this,ho,"f").sendDataToPreviousMiniApp(e)}onCallbackData(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").onCallbackData(e)}))}getPhoneNumber(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").getPhoneNumber()}))}openProfilePicker(e){return n(this,void 0,void 0,(function*(){const t=yield o(this,ho,"f").openProfilePicker(e.maxProfile);let i;if(t.length>0)try{const e=yield this.getAccessToken(),n=yield fetch(oi,{method:"POST",headers:{"Content-Type":"application/json",access_token:e||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})}),o=yield n.json();if(0!==o.error||!o.data)throw new Error(o.message);i=t.map((e=>{var t,i,n,r,a,s,l,c,u,d,p;return{id:(null===(i=null===(t=o.data[e])||void 0===t?void 0:t.user_info)||void 0===i?void 0:i.user_id_by_app)||"",profile:{name:null===(r=null===(n=o.data[e])||void 0===n?void 0:n.user_info)||void 0===r?void 0:r.name,avatar:null===(c=null===(l=null===(s=null===(a=o.data[e])||void 0===a?void 0:a.user_info)||void 0===s?void 0:s.picture)||void 0===l?void 0:l.data)||void 0===c?void 0:c.url},code:0!==(null===(u=o.data[e])||void 0===u?void 0:u.error)?-1:0,message:`Get profile: ${Gt.isUndefined(null===(d=o.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=o.data[e])||void 0===p?void 0:p.message}`}}))}catch(e){i=t.map((t=>({id:t,profile:{name:"",avatar:""},code:-1,message:`Can't get profile: ${e.message}`})))}return{users:i||[]}}))}connectWifi(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").connectWifi(e)}))}openMediaPicker(e){var t,i,r;return n(this,void 0,void 0,(function*(){const n={};Gt.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(i=e.editView)||void 0===i?void 0:i.enable)?n.enable=1:n.enable=0,n.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio;const a=!0===e.silentRequest?1:0,s=e.maxSelectItem;return yield o(this,ho,"f").openMediaPicker(e.type,n,a,s)}))}getShareableLink(e){return n(this,void 0,void 0,(function*(){const t=yield this.getAccessToken();return(yield Zi(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)).shareableLink}))}closeLoading(e){return n(this,void 0,void 0,(function*(){return yield o(this,ho,"f").closeLoading("user action")}))}}ho=new WeakMap,t([bi],vo.prototype,"login",null),t([wi],vo.prototype,"getLoginStatus",null),t([bi],vo.prototype,"getAccessToken",null),t([wi],vo.prototype,"getVersion",null),t([wi],vo.prototype,"getSystemInfo",null),t([bi,po,i(0,uo("object",{title:Ji("string")}))],vo.prototype,"setNavigationBarTitle",null),t([bi,po,i(0,uo("object",{color:Ji("string"),"textColor?":Ji("string",{values:["white","black"]}),"statusBarColor?":Ji("string")}))],vo.prototype,"setNavigationBarColor",null),t([bi,po,i(0,uo("object",{backgroundColor:Ji("string"),"textColor?":Ji("string",{values:["white","black"]})}))],vo.prototype,"setBackgroundColor",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["none","back","home","both"]})}))],vo.prototype,"setNavigationBarLeftButton",null),t([bi,po,i(0,uo("object",{rotate:Ji("string",{values:["auto","portrait","landscape"]})}))],vo.prototype,"setDeviceOrientation",null),t([bi,po,i(0,uo("object",{data:Ji("object")}))],vo.prototype,"setStorage",null),t([bi,po,i(0,uo("object",{keys:Ji("array<string>")}))],vo.prototype,"getStorage",null),t([bi],vo.prototype,"getStorageInfo",null),t([bi,po,i(0,uo("object",{keys:Ji("array<string>")}))],vo.prototype,"removeStorage",null),t([bi],vo.prototype,"clearStorage",null),t([bi,po,i(0,uo("object",{"avatarType?":Ji("string",{values:["small","normal","large"]})}))],vo.prototype,"getUserInfo",null),t([bi],vo.prototype,"getNetworkType",null),t([bi],vo.prototype,"onNetworkStatusChange",null),t([bi],vo.prototype,"startBeaconDiscovery",null),t([bi],vo.prototype,"stopBeaconDiscovery",null),t([bi],vo.prototype,"getBeacons",null),t([bi],vo.prototype,"closeApp",null),t([bi],vo.prototype,"getLocation",null),t([bi],vo.prototype,"stopBluetoothDevicesDiscovery",null),t([bi],vo.prototype,"startBluetoothDevicesDiscovery",null),t([bi],vo.prototype,"openBluetoothAdapter",null),t([bi],vo.prototype,"onBluetoothDeviceFound",null),t([bi],vo.prototype,"onBluetoothAdapterStateChange",null),t([bi],vo.prototype,"getConnectedBluetoothDevices",null),t([bi],vo.prototype,"getBluetoothDevices",null),t([bi],vo.prototype,"getBluetoothAdapterState",null),t([bi],vo.prototype,"closeBluetoothAdapter",null),t([bi],vo.prototype,"scanQRCode",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["user","oa","aliasOA"]}),id:Ji("string")}))],vo.prototype,"openProfile",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["user","oa"]}),id:Ji("string")}))],vo.prototype,"openChat",null),t([bi,po,i(0,co(["data.imageUrl"],{if:{type:"image"}})),i(0,co(["data.link"],{if:{type:"link"}})),i(0,co(["data.id"],{if:{type:"profile"}})),i(0,uo("object",{type:Ji("string",{values:["image","link","profile"]}),data:Ji("object"),"data.imageUrl?":Ji("url"),"data.link?":Ji("url"),"data.title?":Ji("string"),"data.thumb?":Ji("url"),"data.description?":Ji("string"),"data.avatar?":Ji("url"),"data.id?":Ji("string"),"data.displayName?":Ji("string")}))],vo.prototype,"openPostFeed",null),t([bi,po,i(0,uo("object",{id:Ji("string"),"showDialogConfirm?":Ji("boolean")}))],vo.prototype,"followOA",null),t([bi,po,i(0,uo("object",{id:Ji("string")}))],vo.prototype,"unfollowOA",null),t([bi,po,i(0,co([["data.imageUrl","data.imageUrls"]],{if:{type:"image"}})),i(0,co(["data.link"],{if:{type:"link"}})),i(0,co(["data.id"],{if:{type:"oa"}})),i(0,co(["data.gifUrl"],{if:{type:"gif"}})),i(0,co(["data.videoThumb","data.videoUrl"],{if:{type:"video"}})),i(0,co(["data.thumbnail","data.title","data.description"],{if:{type:"zmp"},defaultValue:{data:{description:""}}})),i(0,uo("object",{type:Ji("string",{values:["image","gif","video","link","oa","zmp"]}),data:Ji("object"),"data.imageUrl?":Ji("url"),"data.imageUrls?":Ji("array<url>",{maxLength:10}),"data.caption?":Ji("string"),"data.gifUrl?":Ji("url"),"data.width?":Ji("number"),"data.height?":Ji("number"),"data.videoThumb?":Ji("url"),"data.videoUrl?":Ji("url"),"data.link?":Ji("url"),"data.chatOnly?":Ji("boolean"),"data.id?":Ji("string"),"data.thumbnail?":Ji("url"),"data.path?":Ji("string"),"data.title?":Ji("string",{maxLength:100}),"data.description?":Ji(["string"],{maxLength:400})}))],vo.prototype,"openShareSheet",null),t([bi],vo.prototype,"requestCameraPermission",null),t([bi],vo.prototype,"createShortcut",null),t([bi,po,i(0,uo("object",{secretData:Ji("string"),"ui?":Ji("object"),"ui.title?":Ji("string"),"ui.subTitle?":Ji("string"),"ui.negativeButtonText?":Ji("string"),"requireFingerprint?":Ji("boolean")},{requireFingerprint:!0,ui:{title:"Xác thực",subTitle:"Sử dụng sinh trắc học của bạn để xác thực",negativeButtonText:"Đóng"}}))],vo.prototype,"openBioAuthentication",null),t([bi],vo.prototype,"checkStateBioAuthentication",null),t([bi,po,i(0,uo("object",{toUserId:Ji("string"),"title?":Ji("string")}))],vo.prototype,"sendLocation",null),t([bi,po,i(0,uo("object",{message:Ji("string")}))],vo.prototype,"showToast",null),t([bi],vo.prototype,"hideKeyboard",null),t([bi,po,i(0,uo("object",{phoneNumber:Ji("string")}))],vo.prototype,"openPhone",null),t([bi,po,i(0,uo("object",{content:Ji("string"),phoneNumber:Ji("string",{regex:/^\+?\d+$/})}))],vo.prototype,"openSMS",null),t([bi,po,i(0,uo("object",{id:Ji("string"),"displayName?":Ji("string")},{displayName:""}))],vo.prototype,"viewOAQr",null),t([bi],vo.prototype,"keepScreen",null),t([bi,po,i(0,uo("object",{"imageBase64Data?":Ji("string"),"imageUrl?":Ji("url")}))],vo.prototype,"saveImageToGallery",null),t([bi,po,i(0,uo("object",{"imageBase64Data?":Ji("string"),"imageUrl?":Ji("url")}))],vo.prototype,"saveImageToPhotosAlbum",null),t([bi,po,i(0,uo("object",{appId:Ji("string"),"params?":Ji("object")}))],vo.prototype,"openMiniApp",null),t([bi,po,i(0,uo("object",{"type?":Ji("string",{values:["oneShot"]}),"milliseconds?":Ji("number")},{type:"oneShot",milliseconds:500}))],vo.prototype,"vibrate",null),t([bi,po,i(0,uo("object",{url:Ji("string")}))],vo.prototype,"openWebview",null),t([wi],vo.prototype,"getRouteParams",null),t([bi],vo.prototype,"getAppInfo",null),t([bi],vo.prototype,"sendDataToPreviousMiniApp",null),t([bi],vo.prototype,"onCallbackData",null),t([bi],vo.prototype,"getPhoneNumber",null),t([bi,po,i(0,uo("object",{"maxProfile?":Ji("number",{min:1,max:10})},{maxProfile:1}))],vo.prototype,"openProfilePicker",null),t([bi,po,i(0,co(["SSID"])),i(0,uo("object",{SSID:Ji("string"),"password?":Ji("string"),"hiddenSSID?":Ji("boolean")}))],vo.prototype,"connectWifi",null),t([bi,po,i(0,uo("object",{type:Ji("string",{values:["photo","video","file","multi_photo","multi_video"]}),"editView?":Ji("object"),"editView.enable?":Ji("boolean"),"editView.aspectRatio?":Ji("string",{regex:/^\d+:\d+$/}),"silentRequest?":Ji("boolean"),"maxSelectItem?":Ji("number",{min:1})}))],vo.prototype,"openMediaPicker",null),t([bi,po,i(0,uo("object",{title:Ji("string",{maxLength:100}),"thumbnail?":Ji("url"),"path?":Ji("string"),description:Ji(["string"],{maxLength:400})},{description:""}))],vo.prototype,"getShareableLink",null),t([bi,po],vo.prototype,"closeLoading",null);class fo extends vo{getServiceInstance(){return ro.getInstance()}}class mo extends vo{getServiceInstance(){return new ao}}const go=Li();e.default=void 0,window.onJSCall=e=>function(t){rn.getInstance().onJSCall(e,t)},window.onMultiJSCall=e=>function(t){rn.getInstance().onMultiJSCall(e,t)},window.zaloJSV2={zalo_h5_event_handler:function(e,t,i){rn.getInstance().nativeEventHandler(e,t,i)}},go.isZalo?e.default=new fo:e.default=new mo,window.ZaloMiniAppSDK=e.default,e.SDKCreator=vo,e.default=e.default,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -402,7 +402,7 @@ export declare type OnCallbackData = {
402
402
  * Get user info data type
403
403
  */
404
404
  export declare type GetUserInfoDataType<T> = CallbackType<T> & {
405
- avatarType: 'small' | 'normal' | 'large';
405
+ avatarType?: 'small' | 'normal' | 'large';
406
406
  };
407
407
  export declare type OpenProfilePicker<T> = CallbackType<T> & {
408
408
  maxProfile: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-sdk",
3
- "version": "2.18.5-rc.1",
3
+ "version": "2.18.7",
4
4
  "description": "Zalo Mini App SDK",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",