zmp-sdk
Version:
Zalo Mini App SDK
24 lines (21 loc) • 256 kB
JavaScript
/**
* @timeBuild 05-03-2026 15:45:57
* @license zmp-sdk
*
* Copyright @ 2026. Zalo Group.
*
* This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";function t(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var n,r=1048576,i=window.zAppID,o=window.APP_ID,a="https://zalo.me/s",s="https://h5.zdn.vn/zapps",u="h5.zdn.vn",c="/zapps",l={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},d={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(n||(n={}));var p,f,h=0,m=-2e3,v=-1400,y=-1500,g=-1401,_=-1404,w=-1408,b=-1409,T=-2004,E=-2005,P=-2006,S=-2007,I=-700,A="Success",O="Unknown error. Please try again later.",k="Request limit exceeded. Please try again later.",C="Request timeout. Please try again later.",N="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",M="Login failed",R="This API is not supported in this version of Zalo",x="User Authentication Required. Please grant User Authentication permission before requesting User Permission",D="Unable to pick media",L="Unable to save image",U="Unable to save video",j="Unable to save file",B="Download failed. Please check your URL again.",Z={SUCCESS:{code:h,message:A},UNKNOWN_ERROR:{code:m,message:O},UNAUTHORIZED:{code:g,message:N},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:_,message:R},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:w,message:C},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"},DUPLICATE_REQUEST:{code:-1410,message:"Duplicate request. Please try again later."},DEVICE_NOT_SUPPORT:{code:-600,message:"This device does not support NFC"},SERVICE_NOT_READY:{code:-602,message:"NFC service is not ready. Please check in your setting"},UNREADABLE:{code:-603,message:"NFC tag is unreadable"},INVALID_MRZ:{code:-604,message:"Invalid MRZ data. Please try again later."},PROCESSING:{code:-605,message:"Processing NFC tag. Please wait a moment."},CANCEL:{code:-606,message:"User cancel"},SCAN_TIMEOUT:{code:-601,message:"NFC scan timeout. Please try again later."},MPDS_ACTION_INVALID:{code:-3e3,message:"Action name from input data does not match declared API actions"},MPDS_SOURCE_INVALID:{code:-3005,message:"This API not called from Mini App"},MPDS_APPID_INVALID:{code:-3006,message:"AppId from input data does not match the currently opened AppId"}},z={addRating:{limit:1},authorize:{},isAllowedInteractWithOA:{},favoriteApp:{},followOA:{},getLocation:{},getPhoneNumber:{},getShareableLink:{},getSetting:{},getAppInfo:{},getUserInfo:{},interactOA:{},openProfilePicker:{},openShareSheet:{},unfollowOA:{},checkTransaction:{limit:5},createOrder:{limit:5},createOrderIAP:{limit:5},selectPaymentMethod:{},requestSendNotification:{}},W={GET_DOWNLOADED_STICKER:{haveCallback:!0},OPEN_SHARE_STICKER:{},OPEN_PROFILE:{requireAccessToken:!0},OPEN_FEED_DETAIL:{},OPEN_FRIEND_RADA:{},OPEN_INAPP:{},OPEN_OUTAPP:{requireAccessToken:!0},OPEN_PAGE:{},OPEN_PHOTODETAIL:{},OPEN_GALARY:{},OPEN_GAMECENTER:{},OPEN_GAMENEWS:{},OPEN_TAB_CONTACT:{},OPEN_TAB_SOCIAL:{},OPEN_FRIENDSUGGEST:{},OPEN_GROUPLIST:{},OPEN_NEARBY:{},OPEN_ROOM:{},OPEN_STICKERSTORE:{},OPEN_CREATECHAT:{},COPY_LINK_CATESTICKER:{},REQUEST_BUY_STICKER:{},OPEN_CHAT:{requireAccessToken:!0},OPEN_TAB_CHAT:{},OPEN_CHATGROUP:{},OPEN_ADDFRIEND:{},OPEN_TAB_MORE:{},OPEN_POSTFEED:{requireAccessToken:!0},OPEN_LOGINDEVICES:{},OPEN_SENDSTICKER:{},REPORT_ABUSE:{haveCallback:!0},FOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:Z.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:Z.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:Z.USER_DENIED}},iOS:{"-2":{mapTo:Z.USER_DENIED}}}},CHANGE_TITLE_HEADER:{skipJump:!0},WEBVIEW_CLEARCACHE:{},WEBVIEW_CONFIRMCACHE:{},WEBVIEW_ISVISIBLE:{},WEBVIEW_NETWORKTYPE:{skipJump:!0},CHANGE_BUTTON_HEADER:{},CREATE_OPTIONS_MENU:{skipJump:!0,haveCallback:!0},CREATE_SHORTCUT:{requireAccessToken:!0},CHANGE_ACTIONBAR_LEFTBUTTON_TYPE:{skipJump:!0,haveCallback:!0},WINDOW_CLOSE:{skipJump:!0,haveCallback:!0},WEBVIEW_CHECKRESERROR:{},IAP_REQUESTPAYMENT:{haveCallback:!0},ZBROWSER_GETSTATS:{},ZBROWSER_JSBRIDGE:{skipJump:!0,haveCallback:!0},PROMPT_AUTHENTICATION:{},CHANGE_ACTIONBAR_COLOR:{skipJump:!0},PROMPT_AUTHENTICATION_CHECK_STATE:{},OPEN_APPSTORE:{},GET_LOCATION:{haveCallback:!0,errorList:{android:{"-1":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{errorList:{iOS:{"-9":{mapTo:Z.UNKNOWN_ERROR},"-10":{mapTo:Z.USER_CANCEL}}}},VIEW_MYQR:{haveCallback:!0,timeout:!0,requireAccessToken:!0},KEEP_SCREEN:{haveCallback:!0,timeout:2},CHANGE_AUTOROTATE:{skipJump:!0},CHECK_APP_INSTALLED:{},QUERY_SHOW:{},QUERY_HIDE:{},OPEN_INAPPRW:{},ZALORUN_GETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_SETTRACKINGSTATUS:{haveCallback:!0},ZALORUN_GETDAYSTEP:{haveCallback:!0},ZALORUN_FORCESUBMITDATA:{haveCallback:!0},ZALORUN_SETWEIGHT:{haveCallback:!0},OPEN_PROFILE_EXT:{},DOWNLOAD_CATE:{haveCallback:!0},JUMP_LOGIN:{skipJump:!0,whiteList:!0},OPEN_ADTIMA_ADS_INTERSTITIAL:{},OPEN_ADTIMA_ADS:{},GET_ADIDCLIENT:{},SCAN_IBEACON:{},SAVE_VIDEO_GALLERY:{versionLive:{iOS:628},errorList:{android:{"-101":{mapTo:{code:P,message:U},needMoreDetail:!0},"-102":{mapTo:{code:P,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:P,message:U},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:E,message:L},needMoreDetail:!0},"-102":{mapTo:{code:E,message:L},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:L},needMoreDetail:!0}}}},OPEN_MP:{versionLive:{iOS:402}},CHANGE_ACTIONBAR:{haveCallback:!0,timeout:2,versionLive:{iOS:402},skipJump:!0},ZBROWSER_MPDS:{haveCallback:!0,timeout:2,versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.UNKNOWN_ERROR},"-105":{mapTo:Z.MPDS_SOURCE_INVALID},"-106":{mapTo:Z.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.MPDS_APPID_INVALID},"-102":{mapTo:Z.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.UNKNOWN_ERROR},"-105":{mapTo:Z.MPDS_SOURCE_INVALID},"-106":{mapTo:Z.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:Z.MPDS_ACTION_INVALID},"-101":{mapTo:Z.MPDS_APPID_INVALID},"-102":{mapTo:Z.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:Z.USER_DENIED},"-101":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:Z.USER_DENIED},"-10":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:Z.USER_CANCEL}},iOS:{"-101":{mapTo:Z.USER_CANCEL}}}},GET_SUPPORTED_ACTIONS:{whiteList:!0},MP_JOIN_WIFI:{haveCallback:!0,timeout:!0,versionLive:{android:0,iOS:0},havePermission:!1,whiteList:!1},PICK_MEDIA:{requireAccessToken:!0,versionLive:{iOS:440},errorList:{android:{"-101":{mapTo:Z.USER_CANCEL},999:{mapTo:{code:T,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:T,message:D}},"-101":{mapTo:Z.USER_CANCEL}}}},MP_CLOSE_LOADINGVIEW:{skipJump:!0},CHANGE_BOTTOMBAR:{haveCallback:!0,timeout:2,skipJump:!0},MA_MENU_MINIMIZE:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_PERMISSION:{skipJump:!1,versionLive:{iOS:520}},MA_MENU_FAVORITES:{skipJump:!1,versionLive:{iOS:520}},MP_SEND_NOTIFICATION:{skipJump:!1,versionLive:{iOS:530},errorList:{android:{"-1":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:Z.USER_DENIED},"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:Z.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:Z.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:Z.UNKNOWN_ERROR},"-600":{mapTo:Z.DEVICE_NOT_SUPPORT},"-602":{mapTo:Z.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:Z.UNKNOWN_ERROR},"-600":{mapTo:Z.DEVICE_NOT_SUPPORT},"-601":{mapTo:Z.SCAN_TIMEOUT},"-602":{mapTo:Z.SERVICE_NOT_READY},"-603":{mapTo:Z.UNREADABLE},"-604":{mapTo:Z.INVALID_MRZ},"-605":{mapTo:Z.PROCESSING},"-606":{mapTo:Z.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:S,message:j},needMoreDetail:!0},"-102":{mapTo:{code:S,message:j},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:S,message:j},needMoreDetail:!0}}}},LFS_FILE_INFO:{skipJump:!1},LFS_LIST:{skipJump:!1},LFS_FILE_SAVE:{skipJump:!1},LFS_FILE_REMOVE:{skipJump:!1},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1},OPEN_DOCUMENT:{skipJump:!1,errorList:{all:{"-10":{mapTo:{code:I,message:B}},"-700":{mapTo:{code:I,message:B}},"-701":{mapTo:{code:-701,message:"Unsupported file type"}},"-702":{mapTo:{code:-702,message:"Download failed. Please check your network or file path again."}},"-703":{mapTo:{code:-703,message:"Open document failed"}}}}},GET_DEVICE_INFO:{skipJump:!1},MP_OPEN_ZINSTANTVIEW:{skipJump:!1,timeout:!0,versionLive:{android:25081840,iOS:674}},OPEN_SETTING:{skipJump:!1}},F={android:{"-4":Z.DECODE_FAILED,"-5":Z.CLIENT_NOT_SUPPORT,"-14":Z.TIME_OUT},iOS:{"-9":Z.DECODE_FAILED,"-5":Z.CLIENT_NOT_SUPPORT,"-14":Z.TIME_OUT}},G={android:12100615,iOS:460,wp:0,unknown:0},V=5*r,H="https://payment-mini.zalo.me/api/order/create-v2",K="https://payment-mini.zalo.me/api/order/iap-create",J="https://payment-mini.zalo.me/api/transaction",q="https://payment-mini.zalo.me/api/order/purchase",Q="DEFERRED",Y="IMMEDIATE_AND_CHARGE_FULL_PRICE",$={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},X=5,ee=6,te="#1843EF",ne=0,re={"-12101":"Invalid params","-12102":"Session expire","-12103":"Not permission","-12104":"Not Authorize","-12105":"Unknown exception","-12106":"Cannot create order","-12107":"Transaction not found","-12108":"Cannot update order","-12109":"Cannot decode param","-12110":"Version not support","-12111":"Receipt expire","-12112":"Product not found","-12113":"Subscription other GW","-12114":"Product already subcription","-12115":"Not exist","-12116":"Already exist","-12117":"Not allow","-12118":"Not permit","-12119":"Internal error","-2":"Unable to pay","-6":"Unable to register","-7":"Registered account","-832":"Purchased by another account","-833":"Register for another account","-834":"Unable to register","-2010":"System is maintaining","-3999":"Not in Vietnam","-12129":"Purchased by another account",123:"An error has occurred"};!function(e){e.DEV_TRACKING="devTracking"}(p||(p={})),function(e){e[e.APP_INITIALIZING=95]="APP_INITIALIZING",e[e.APP_READY=96]="APP_READY"}(f||(f={}));var ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ye,ge,_e,we,be,Te,Ee,Pe,Se,Ie,Ae="checkoutKitWidget-ifCKW",Oe="https://h5.zalo.me",ke={CHECKOUT_KIT:"https://h5.zalo.me/widgets/checkoutkit_widget.html",FUNCTION_BUTTON:"https://h5.zalo.me/widgets/function_button_widget.html",OA:"https://h5.zalo.me/widgets/oa_widget.html",CUSTOM_OA:"https://h5.zalo.me/widgets/oa_widget_custom.html"},Ce=["close","pay"];function Ne(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function Me(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ne(o,r,i,a,s,"next",e)}function s(e){Ne(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function De(e,t){if(e){if("string"==typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(e,t):void 0}}function Le(e){return function(e){if(Array.isArray(e))return Re(e)}(e)||xe(e)||De(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ue(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function je(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Be(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,Le(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ze(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}Be.async=function(e){return Me((function(){var t,n,r,i,o=arguments;return Ue(this,(function(a){switch(a.label){case 0:for(t=o.length,n=new Array(t),r=0;r<t;r++)n[r]=o[r];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.apply(void 0,Le(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},e.NetworkType=void 0,(ie=e.NetworkType||(e.NetworkType={})).none="none",ie.wifi="wifi",ie.cellular="cellular",ie.unknown="unknown",e.PlatformType=void 0,(oe=e.PlatformType||(e.PlatformType={})).wp="wp",oe.android="android",oe.iOS="iOS",oe.unknown="unknown",e.Events=void 0,(ae=e.Events||(e.Events={})).AppPaused="h5.event.paused",ae.AppResumed="h5.event.resumed",ae.NetworkChanged="h5.event.connection.changed",ae.OnDataCallback="h5.event.webview.result",ae.WebviewClosed="h5.event.webview.close",ae.OpenApp="h5.event.open.mp",ae.AppClose="h5.event.action.close",ae.PaymentCallback="payment.callback",ae.PaymentResult="action.payment.result",ae.PaymentDone="action.payment.done",ae.PaymentClose="action.payment.close",ae.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(se=e.JumpStatus||(e.JumpStatus={})).DOING="doing",se.DONE="done",e.ProfileType=void 0,(ue=e.ProfileType||(e.ProfileType={}))[ue.user=1]="user",ue[ue.oa=0]="oa",ue[ue.aliasOA=2]="aliasOA",e.ChatType=void 0,(ce=e.ChatType||(e.ChatType={}))[ce.user=1]="user",ce[ce.oa=0]="oa",e.PostFeedType=void 0,(le=e.PostFeedType||(e.PostFeedType={}))[le.image=1]="image",le[le.multi_image=2]="multi_image",le[le.link=4]="link",le[le.profile=5]="profile",e.ScanNFCType=void 0,(de=e.ScanNFCType||(e.ScanNFCType={}))[de.cccd=1]="cccd",e.ShareSheetType=void 0,(pe=e.ShareSheetType||(e.ShareSheetType={}))[pe.image=1]="image",pe[pe.gif=11]="gif",pe[pe.video=12]="video",pe[pe.link=4]="link",pe[pe.oa=5]="oa",pe[pe.zmp=20]="zmp",pe[pe.multi_image=21]="multi_image",pe[pe.zmp_deep_link=4]="zmp_deep_link",pe[pe.text=22]="text",e.OrientationType=void 0,(fe=e.OrientationType||(e.OrientationType={}))[fe.auto=1]="auto",fe[fe.portrait=2]="portrait",fe[fe.landscape=3]="landscape",e.VibrateType=void 0,(he=e.VibrateType||(e.VibrateType={}))[he.oneShot=0]="oneShot",e.MediaPickerType=void 0,(me=e.MediaPickerType||(e.MediaPickerType={}))[me.zcamera=3]="zcamera",me[me.zcamera_photo=1]="zcamera_photo",me[me.zcamera_video=2]="zcamera_video",me[me.zcamera_scan=7]="zcamera_scan",me[me.photo=4]="photo",me[me.video=5]="video",me[me.file=6]="file",e.IAPPayType=void 0,(ve=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",ve.ONETIME="ONETIME",e.ProrationMode=void 0,(ye=e.ProrationMode||(e.ProrationMode={}))[ye.UNKNOW=0]="UNKNOW",ye[ye.DEFERRED=1]="DEFERRED",ye[ye.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(ge=e.StatusBarType||(e.StatusBarType={}))[ge.normal=1]="normal",ge[ge.hidden=0]="hidden",ge[ge.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(_e=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[_e.show=1]="show",_e[_e.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(we=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[we.show=1]="show",we[we.hide=0]="hide",e.TextAlignType=void 0,(be=e.TextAlignType||(e.TextAlignType={}))[be.left=0]="left",be[be.center=1]="center",e.OpenProfilePickerType=void 0,(e.OpenProfilePickerType||(e.OpenProfilePickerType={})).TOOL_DEL_FRIEND="tool_del_friend",e.CameraEvents=void 0,(Te=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",Te.OnStartCallback="h5.event.camera.start",Te.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(Ee=e.FacingMode||(e.FacingMode={})).FRONT="user",Ee.BACK="environment",e.PhotoFormat=void 0,(Pe=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",Pe.PNG="image/png",Pe.JPEG="image/jpeg",e.PhotoQuality=void 0,(Se=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",Se.NORMAL="normal",Se.LOW="low",e.StreamType=void 0,(Ie=e.StreamType||(e.StreamType={})).VIDEO="video",Ie.AUDIO="audio";var ze,We=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function Fe(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ge(){var e=function(){var e=Be((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{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)}}(e);return{appEnv:Ze(),platform:t,platformName:We(t),zaloVersion:Fe(e).trim()}}}();if(e)return e}var Ve=(null===(ze=Ge())||void 0===ze?void 0:ze.appEnv)||{};function He(e){He.on&&He.engine(e)}He.on=!1,He.engine=function(e){var t=e.name,n=e.type,r=e.state,i=e.request,o=e.response,a=e.stage;console[n]([t,a,r,i,o].filter(Boolean).map((function(e){return"object"==typeof e?JSON.stringify(e):e})).join("; "))};var Ke=function(e,t){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==t||null===(r=t.fail)||void 0===r||r.call(t,i),He({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Je(e,t,n[t])}))}return e}function Qe(e,t){return function(e){if(Array.isArray(e))return e}(e)||xe(e)||De(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ye="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function $e(){throw new Error("setTimeout has not been defined")}function Xe(){throw new Error("clearTimeout has not been defined")}var et=$e,tt=Xe;function nt(e){if(et===setTimeout)return setTimeout(e,0);if((et===$e||!et)&&setTimeout)return et=setTimeout,setTimeout(e,0);try{return et(e,0)}catch(t){try{return et.call(null,e,0)}catch(t){return et.call(this,e,0)}}}"function"==typeof Ye.setTimeout&&(et=setTimeout),"function"==typeof Ye.clearTimeout&&(tt=clearTimeout);var rt,it=[],ot=!1,at=-1;function st(){ot&&rt&&(ot=!1,rt.length?it=rt.concat(it):at=-1,it.length&&ut())}function ut(){if(!ot){var e=nt(st);ot=!0;for(var t=it.length;t;){for(rt=it,it=[];++at<t;)rt&&rt[at].run();at=-1,t=it.length}rt=null,ot=!1,function(e){if(tt===clearTimeout)return clearTimeout(e);if((tt===Xe||!tt)&&clearTimeout)return tt=clearTimeout,clearTimeout(e);try{tt(e)}catch(t){try{return tt.call(null,e)}catch(t){return tt.call(this,e)}}}(e)}}function ct(e,t){this.fun=e,this.array=t}ct.prototype.run=function(){this.fun.apply(null,this.array)};function lt(){}var dt=lt,pt=lt,ft=lt,ht=lt,mt=lt,vt=lt,yt=lt;var gt=Ye.performance||{},_t=gt.now||gt.mozNow||gt.msNow||gt.oNow||gt.webkitNow||function(){return(new Date).getTime()};var wt=new Date;var bt,Tt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];it.push(new ct(e,t)),1!==it.length||ot||nt(ut)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:dt,addListener:pt,once:ft,off:ht,removeListener:mt,removeAllListeners:vt,emit:yt,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*_t.call(gt),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-wt)/1e3}},Et=Tt,Pt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function St(e){return e&&e.constructor===Symbol?"symbol":typeof e}function It(e){return"function"==typeof window.Debug?window.Debug(e):function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n]}}!function(e){!function(t){var n="object"==typeof Pt?Pt:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===n.Reflect?n.Reflect=e:r=i(n.Reflect,r),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof Et&&Et.env&&"true"===Et.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!G(e))throw new TypeError;if(!H(t))throw new TypeError;return P(e,t)}if(!G(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!D(r)&&!L(r))throw new TypeError;return L(r)&&(r=void 0),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!j(n))throw new TypeError;if(!D(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!j(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),O(e,t,n)}function _(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;D(n)||(n=F(n));var r=I(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!L(r)){if(!H(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!L(o)){if(!j(o))throw new TypeError;r=o}}return r}function I(e,t,n){var r=f.get(e);if(D(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(D(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(O(e,t,n))return!0;var r=X(t);return!L(r)&&A(e,r,n)}function O(e,t,n){var r=I(t,n,!1);return!D(r)&&z(r.has(e))}function k(e,t,n){if(O(e,t,n))return C(e,t,n);var r=X(t);return L(r)?void 0:k(e,r,n)}function C(e,t,n){var r=I(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){I(n,r,!0).set(e,t)}function M(e,t){var n=R(e,t),r=X(e);if(null===r)return n;var i=M(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,u=n;s<u.length;s++){var c=u[s];o.has(c)||(o.add(c),a.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];o.has(c)||(o.add(c),a.push(c))}return a}function R(e,t){var n=[],r=I(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Y(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{$(i)}finally{throw e}}o++}}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function D(e){return void 0===e}function L(e){return null===e}function U(e){return"symbol"==typeof e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=J(e,r);if(void 0!==i){var o=i.call(e,n);if(j(o))throw new TypeError;return o}return Z(e,"default"===n?"number":n)}function Z(e,t){if("string"===t){var n=e.toString;if(V(n))if(!j(i=n.call(e)))return i;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(V(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(V(o))if(!j(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=B(e,3);return U(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function V(e){return"function"==typeof e}function H(e){return"function"==typeof e}function K(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}function J(e,t){var n=e[t];if(null!=n){if(!V(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!V(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function Y(e){var t=e.next();return!t.done&&t}function $(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(bt||(bt={}));var At=Object.prototype.toString;var Ot="[object Null]",kt="[object Undefined]";function Ct(e){return null==e?void 0===e?kt:Ot:function(e){return At.call(e)}(e)}function Nt(e){return null!=e&&"object"==typeof e}var Mt={isEmpty:function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},isNull:function(e){return null===e},isUndefined:function(e){return void 0===e},isFunction:function(e){return"function"==typeof e},isObject:function(e){return null!==e&&("function"==typeof e||"object"==typeof e)},isString:function(e){return null!=e&&"string"==typeof e.valueOf()},isNumber:function(e){return"number"==typeof e||Nt(e)&&"[object Number]"==Ct(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return Nt(e)&&"[object RegExp]"==Ct(e)},get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=function(n){return String.prototype.split.call(t,n).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e)},i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===i||i===e?n:i},isPromise:function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}};function Rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Dt(e)}function Lt(e){return Dt(e)}function Ut(e,t,n){return Ut="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Lt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Ut(e,t,n)}function jt(e,t,n){return Ut(e,t,n)}function Bt(e,t){return Bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bt(e,t)}function Zt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bt(e,t)}function zt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Lt(e);if(t){var i=Lt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==St(t)&&"function"!=typeof t?zt(e):t}(this,n)}}var Ft=function(e,t){return e(t={exports:{}},t.exports),t.exports
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})),Gt={enablePaymentDone:!1};function Vt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Ht="ACTION_CALLBACK";function Kt(t,n,r,i){switch(!0){case"string"==typeof r||null===r:return[{eventName:t,eventId:n,data:r}];case t===e.Events.OpenApp&&(null==i?void 0:i.enablePaymentDone):var o=function(e){var t=new URL(e,window.location.origin),n=t.pathname.split("/")[3].toUpperCase().replace(/-/g,"_"),r={},i=t.searchParams.get("orderId"),o=t.searchParams.get("zmpOrderId"),a=t.searchParams.get("appTransID")||t.searchParams.get("apptransid");switch(n){case"MOMO":case"MOMO_SANDBOX":r.orderId=o,r.transId=i;break;default:r.orderId=o||i,r.transId=a}return r}(r.path);return[{eventName:e.Events.PaymentDone,eventId:n,data:o}];case t===e.Events.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==r?void 0:r.eventType))return[{eventName:e.Events.OnDataCallback,eventId:n,data:r},{eventName:e.Events.PaymentDone,eventId:n,data:Vt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Jt=function(t){Zt(r,t);var n=Wt(r);function r(){var e;return Rt(this,r),(e=n.apply(this,arguments)).debug=It("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Ht||t===e.Events.PaymentCallback)return jt(Lt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return jt(Lt(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Ht)return jt(Lt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return jt(Lt(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(Ft);function qt(e){Jt.getInstance().emit(Ht,e)}function Qt(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(void 0===r)return;if(null===r)return void t.push(n);t.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return t.join("&")}window.onNativeMessage=function(e,t){return function(n){qt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=It("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=Cn(r);i("stringToData",a);var s=function(t,n){if(!n||"string"==typeof n)return n;try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a),u=Kt(n,t,s,Gt);null==u||u.forEach((function(e){Jt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Ae);t&&zn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Jt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Yt={encode:Qt,decode:function(e,t){var n={};if(""===e)return n;for(var r=e.split("&"),i=0;i<r.length;i++){var o=r[i].split("=",2),a=decodeURIComponent(o[0]);if(t&&Object.prototype.hasOwnProperty.call(n,a))throw new URIError("Duplicate key: "+a);n[a]=2===o.length?decodeURIComponent(o[1]):null}return n},appendToUrl:function(e,t){return e+(-1!==e.indexOf("?")?"&":"?")+("string"==typeof t?t:Qt(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":St(e)))return e;var t=Object.keys(e),n=[];return t.map((function(t){var r=e[t],i=[t,r="object"==(void 0===r||void 0===r?"undefined":St(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},$t={},Xt=function(e,t,n){var r=t||"default";return function(){return(r in $t?$t[r](e,n):e).apply(this,arguments)}};Xt.setWrapper=function(e){$t[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=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,rn={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Yt.encode(n);"post"!=t&&(e=Yt.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=Xt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Xt((function(){a=r,"onerror"in i&&i.onerror(n)}),"entry","XMLHttpRequest:error");return n.onload=function(){o()},n.onerror=function(){a()},n.onreadystatechange=function(){4==n.readyState&&(200==n.status?o():a())},i}(t,e);return!!o&&(o.onload=function(e){r(tn(e.responseText))},o.onerror=function(e){e.responseText?r(tn(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},on=rn,an=(nn=Me((function(e,t,n){var r,i,o,a;return Ue(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Mt.isUndefined(n)||(r.currentVersion=n),i=Yt.appendToUrl(d.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType,appId:e,zaloAppId:a.data.zaloAppId}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return nn.apply(this,arguments)});function sn(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));on.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var un=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},cn=function(){var e;return"android"===((null===(e=Ge())||void 0===e?void 0:e.platformName)||"").toLowerCase()},ln=function(){var e;return"ios"===((null===(e=Ge())||void 0===e?void 0:e.platformName)||"").toLowerCase()};function dn(e){var t=String(e);try{if(/^\d{9}$/.test(t)&&"0"===t[5])return Number(t.slice(0,5)+t.slice(6))}catch(e){}return Number(t)}var pn=function(){var e,t=0;if(window.zaloVersionCode)return dn(window.zaloVersionCode);var n=Number((null===(e=Ge())||void 0===e?void 0:e.zaloVersion)||"0");return n>=24112e3?t=n:cn()?t=n%1e4:ln()&&(t=n),dn(t)};function fn(e,t){if(window.isAPISupport&&"function"==typeof window.isAPISupport)return window.isAPISupport(e,t);var n=pn();return cn()?n>=e:!!ln()&&n>=t}function hn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var mn,vn=function(){function e(t,n,r,i){Rt(this,e),this.code=t,this.message=n,this.api=r,this.detail=i}var t=e.prototype;return t.toString=function(){return"api: ".concat(String(this.api),"; code: ").concat(this.code,"; message: ").concat(JSON.stringify(this.message))},t.toJSON=function(){return{code:this.code,message:this.message,api:this.api,detail:this.detail}},e}(),yn=function(e,t){return hn(e,vn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return hn(e,Error)?new vn(m,e.message,t).toJSON():Mt.isEmpty(null==e?void 0:e.message)||Mt.isEmpty(null==e?void 0:e.code)?new vn(m,O,t,e).toJSON():new vn(e.code,e.message,t,e.detail).toJSON()}(e,t)},gn=(mn=Me((function(e){var t;return Ue(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(d.GET_AUTH_SETTING,qe({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return mn.apply(this,arguments)}),_n=Me((function(){return Ue(this,(function(e){return[2,new Promise(function(){var e=Me((function(e,t){var n,r,i,o;return Ue(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,In.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=In.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new vn(g,N,"getSetting")),[4,gn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new vn(i.err,i.msg,"getSetting")),[3,4];case 3:return o=a.sent(),t(o),[3,4];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))})),wn=function(){var t,n,r,i=Ge(),o={},a=Jt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=Nn(t.result),i=Dn(null==r?void 0:r.action),u=Mt.isEmpty(null==r?void 0:r.error_code)?0:null==r?void 0:r.error_code,c=null==r?void 0:r.error_message,l=(null==r?void 0:r.data)||r;if(i&&0===u){var d=JSON.parse(null==r?