zmp-sdk 2.46.5 → 2.47.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/apis/checkoutKit/index.js +1 -0
- package/apis/apis/checkoutKit/purchase.js +1 -0
- package/apis/apis/checkoutKit/showWidget.js +1 -0
- package/apis/apis/showCustomOAWidget.js +1 -1
- package/apis/apis/showFunctionButtonWidget.js +1 -1
- package/apis/apis/showOAWidget.js +1 -1
- package/apis/common/apis/general/getSystemInfo.js +1 -1
- package/apis/common/apis/general/openShareSheet.js +1 -1
- package/apis/common/apis/general/scanNFC.js +1 -1
- package/apis/common/apis/general/storage/index.js +1 -1
- package/apis/common/eventEmitter.js +1 -1
- package/apis/common/utils.js +1 -1
- package/apis/constants.js +1 -1
- package/apis/index.d.ts +141 -7
- package/apis/index.es.js +1 -1
- package/apis/index.js +1 -1
- package/apis/package.json.js +1 -1
- package/apis/utils/common.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +1611 -1473
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @timeBuild
|
|
2
|
+
* @timeBuild 19-06-2025 17:24:34
|
|
3
3
|
* @license zmp-sdk
|
|
4
4
|
*
|
|
5
5
|
* Copyright @ 2025. Zalo Group.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!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,T=-1409,b=-2004,E=-2005,S=-2006,P=-2007,I="Success",A="Unknown error. Please try again later.",O="Request limit exceeded. Please try again later.",k="Request timeout. Please try again later.",C="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",N="Login failed",M="This API is not supported in this version of Zalo",R="User Authentication Required. Please grant User Authentication permission before requesting User Permission",x="Unable to pick media",D="Unable to save image",U="Unable to save video",L="Unable to save file",j={SUCCESS:{code:h,message:I},UNKNOWN_ERROR:{code:m,message:A},UNAUTHORIZED:{code:g,message:C},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:_,message:M},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:w,message:k},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"}},B={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:{}},Z={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:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:j.USER_DENIED}},iOS:{"-2":{mapTo:j.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:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.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:j.UNKNOWN_ERROR},"-10":{mapTo:j.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:S,message:U},needMoreDetail:!0},"-102":{mapTo:{code:S,message:U},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:S,message:U},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:E,message:D},needMoreDetail:!0},"-102":{mapTo:{code:E,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:D},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:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:j.USER_DENIED},"-101":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-10":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:j.USER_CANCEL}},iOS:{"-101":{mapTo:j.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:j.USER_CANCEL},999:{mapTo:{code:b,message:x},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:b,message:x}}}}},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:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-602":{mapTo:j.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-601":{mapTo:j.SCAN_TIMEOUT},"-602":{mapTo:j.SERVICE_NOT_READY},"-603":{mapTo:j.UNREADABLE},"-604":{mapTo:j.INVALID_MRZ},"-605":{mapTo:j.PROCESSING},"-606":{mapTo:j.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:P,message:L},needMoreDetail:!0},"-102":{mapTo:{code:P,message:L},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:P,message:L},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},z={android:{"-4":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT},iOS:{"-9":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT}},W={android:12100615,iOS:460,wp:0,unknown:0},F=5*r,G="https://payment-mini.zalo.me/api/order/create-v2",V="https://payment-mini.zalo.me/api/order/iap-create",H="https://payment-mini.zalo.me/api/transaction",K="https://payment-mini.zalo.me/api/order/purchase",J="DEFERRED",q="IMMEDIATE_AND_CHARGE_FULL_PRICE",Q={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},Y=5,$=6,X="#1843EF",ee=0,te={"-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 ne,re,ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ye,ge,_e,we,Te,be,Ee,Se,Pe="https://h5.zalo.me",Ie={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"};function Ae(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 Oe(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ae(o,r,i,a,s,"next",e)}function s(e){Ae(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ke(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 Ce(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ne(e,t){if(e){if("string"==typeof e)return ke(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)?ke(e,t):void 0}}function Me(e){return function(e){if(Array.isArray(e))return ke(e)}(e)||Ce(e)||Ne(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 Re(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 xe(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,Me(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function De(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")}}xe.async=function(e){return Oe((function(){var t,n,r,i,o=arguments;return Re(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,Me(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,(ne=e.NetworkType||(e.NetworkType={})).none="none",ne.wifi="wifi",ne.cellular="cellular",ne.unknown="unknown",e.PlatformType=void 0,(re=e.PlatformType||(e.PlatformType={})).wp="wp",re.android="android",re.iOS="iOS",re.unknown="unknown",e.Events=void 0,(ie=e.Events||(e.Events={})).AppPaused="h5.event.paused",ie.AppResumed="h5.event.resumed",ie.NetworkChanged="h5.event.connection.changed",ie.OnDataCallback="h5.event.webview.result",ie.WebviewClosed="h5.event.webview.close",ie.OpenApp="h5.event.open.mp",ie.AppClose="h5.event.action.close",ie.PaymentCallback="payment.callback",ie.PaymentResult="action.payment.result",ie.PaymentDone="action.payment.done",ie.PaymentClose="action.payment.close",ie.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(oe=e.JumpStatus||(e.JumpStatus={})).DOING="doing",oe.DONE="done",e.ProfileType=void 0,(ae=e.ProfileType||(e.ProfileType={}))[ae.user=1]="user",ae[ae.oa=0]="oa",ae[ae.aliasOA=2]="aliasOA",e.ChatType=void 0,(se=e.ChatType||(e.ChatType={}))[se.user=1]="user",se[se.oa=0]="oa",e.PostFeedType=void 0,(ue=e.PostFeedType||(e.PostFeedType={}))[ue.image=1]="image",ue[ue.multi_image=2]="multi_image",ue[ue.link=4]="link",ue[ue.profile=5]="profile",e.ScanNFCType=void 0,(ce=e.ScanNFCType||(e.ScanNFCType={}))[ce.cccd=1]="cccd",e.ShareSheetType=void 0,(le=e.ShareSheetType||(e.ShareSheetType={}))[le.image=1]="image",le[le.gif=11]="gif",le[le.video=12]="video",le[le.link=4]="link",le[le.oa=5]="oa",le[le.zmp=20]="zmp",le[le.multi_image=21]="multi_image",le[le.zmp_deep_link=4]="zmp_deep_link",le[le.text=22]="text",e.OrientationType=void 0,(de=e.OrientationType||(e.OrientationType={}))[de.auto=1]="auto",de[de.portrait=2]="portrait",de[de.landscape=3]="landscape",e.VibrateType=void 0,(pe=e.VibrateType||(e.VibrateType={}))[pe.oneShot=0]="oneShot",e.MediaPickerType=void 0,(fe=e.MediaPickerType||(e.MediaPickerType={}))[fe.zcamera=3]="zcamera",fe[fe.zcamera_photo=1]="zcamera_photo",fe[fe.zcamera_video=2]="zcamera_video",fe[fe.zcamera_scan=7]="zcamera_scan",fe[fe.photo=4]="photo",fe[fe.video=5]="video",fe[fe.file=6]="file",e.IAPPayType=void 0,(he=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",he.ONETIME="ONETIME",e.ProrationMode=void 0,(me=e.ProrationMode||(e.ProrationMode={}))[me.UNKNOW=0]="UNKNOW",me[me.DEFERRED=1]="DEFERRED",me[me.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(ve=e.StatusBarType||(e.StatusBarType={}))[ve.normal=1]="normal",ve[ve.hidden=0]="hidden",ve[ve.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(ye=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[ye.show=1]="show",ye[ye.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(ge=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[ge.show=1]="show",ge[ge.hide=0]="hide",e.TextAlignType=void 0,(_e=e.TextAlignType||(e.TextAlignType={}))[_e.left=0]="left",_e[_e.center=1]="center",e.CameraEvents=void 0,(we=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",we.OnStartCallback="h5.event.camera.start",we.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(Te=e.FacingMode||(e.FacingMode={})).FRONT="user",Te.BACK="environment",e.PhotoFormat=void 0,(be=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",be.PNG="image/png",be.JPEG="image/jpeg",e.PhotoQuality=void 0,(Ee=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",Ee.NORMAL="normal",Ee.LOW="low",e.StreamType=void 0,(Se=e.StreamType||(e.StreamType={})).VIDEO="video",Se.AUDIO="audio";var Ue,Le=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function je(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Be(){var e=function(){var e=xe((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:De(),platform:t,platformName:Le(t),zaloVersion:je(e).trim()}}}();if(e)return e}var Ze=(null===(Ue=Be())||void 0===Ue?void 0:Ue.appEnv)||{};function ze(e){ze.on&&ze.engine(e)}ze.on=!1,ze.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 We=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),ze({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ge(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){Fe(e,t,n[t])}))}return e}function Ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ce(e)||Ne(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 He="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Ke(){throw new Error("setTimeout has not been defined")}function Je(){throw new Error("clearTimeout has not been defined")}var qe=Ke,Qe=Je;function Ye(e){if(qe===setTimeout)return setTimeout(e,0);if((qe===Ke||!qe)&&setTimeout)return qe=setTimeout,setTimeout(e,0);try{return qe(e,0)}catch(t){try{return qe.call(null,e,0)}catch(t){return qe.call(this,e,0)}}}"function"==typeof He.setTimeout&&(qe=setTimeout),"function"==typeof He.clearTimeout&&(Qe=clearTimeout);var $e,Xe=[],et=!1,tt=-1;function nt(){et&&$e&&(et=!1,$e.length?Xe=$e.concat(Xe):tt=-1,Xe.length&&rt())}function rt(){if(!et){var e=Ye(nt);et=!0;for(var t=Xe.length;t;){for($e=Xe,Xe=[];++tt<t;)$e&&$e[tt].run();tt=-1,t=Xe.length}$e=null,et=!1,function(e){if(Qe===clearTimeout)return clearTimeout(e);if((Qe===Je||!Qe)&&clearTimeout)return Qe=clearTimeout,clearTimeout(e);try{Qe(e)}catch(t){try{return Qe.call(null,e)}catch(t){return Qe.call(this,e)}}}(e)}}function it(e,t){this.fun=e,this.array=t}it.prototype.run=function(){this.fun.apply(null,this.array)};function ot(){}var at=ot,st=ot,ut=ot,ct=ot,lt=ot,dt=ot,pt=ot;var ft=He.performance||{},ht=ft.now||ft.mozNow||ft.msNow||ft.oNow||ft.webkitNow||function(){return(new Date).getTime()};var mt=new Date;var vt,yt={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];Xe.push(new it(e,t)),1!==Xe.length||et||Ye(rt)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:at,addListener:st,once:ut,off:ct,removeListener:lt,removeAllListeners:dt,emit:pt,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*ht.call(ft),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-mt)/1e3}},gt=yt,_t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function wt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function Tt(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 _t?_t:"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 gt&>.env&&"true"===gt.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 S(e,t)}if(!G(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!D(r)&&!U(r))throw new TypeError;return U(r)&&(r=void 0),P(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 T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function b(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 S(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!D(r)&&!U(r)){if(!H(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!U(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!U(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 U(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 U(e){return null===e}function L(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 L(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",T),e("getOwnMetadataKeys",b),e("deleteMetadata",E)}(r)}()}(vt||(vt={}));var bt=Object.prototype.toString;var Et="[object Null]",St="[object Undefined]";function Pt(e){return null==e?void 0===e?St:Et:function(e){return bt.call(e)}(e)}function It(e){return null!=e&&"object"==typeof e}var At={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||It(e)&&"[object Number]"==Pt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return It(e)&&"[object RegExp]"==Pt(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 Ot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kt(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 Ct(e){return Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ct(e)}function Nt(e){return Ct(e)}function Mt(e,t,n){return Mt="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=Nt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Mt(e,t,n)}function Rt(e,t,n){return Mt(e,t,n)}function xt(e,t){return xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xt(e,t)}function Dt(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&&xt(e,t)}function Ut(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lt(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=Nt(e);if(t){var i=Nt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==wt(t)&&"function"!=typeof t?Ut(e):t}(this,n)}}var jt=function(e,t){return e(t={exports:{}},t.exports),t.exports
|
|
10
|
+
!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,T=-1409,b=-2004,E=-2005,P=-2006,S=-2007,I="Success",A="Unknown error. Please try again later.",O="Request limit exceeded. Please try again later.",C="Request timeout. Please try again later.",k="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",N="Login failed",M="This API is not supported in this version of Zalo",R="User Authentication Required. Please grant User Authentication permission before requesting User Permission",x="Unable to pick media",D="Unable to save image",U="Unable to save video",L="Unable to save file",j={SUCCESS:{code:h,message:I},UNKNOWN_ERROR:{code:m,message:A},UNAUTHORIZED:{code:g,message:k},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:_,message:M},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"}},B={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:{}},Z={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:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:j.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:j.USER_DENIED}},iOS:{"-2":{mapTo:j.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:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.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:j.UNKNOWN_ERROR},"-10":{mapTo:j.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:D},needMoreDetail:!0},"-102":{mapTo:{code:E,message:D},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:E,message:D},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:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.UNKNOWN_ERROR},"-105":{mapTo:j.MPDS_SOURCE_INVALID},"-106":{mapTo:j.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:j.MPDS_ACTION_INVALID},"-101":{mapTo:j.MPDS_APPID_INVALID},"-102":{mapTo:j.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:j.USER_DENIED},"-101":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-10":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:j.USER_CANCEL}},iOS:{"-101":{mapTo:j.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:j.USER_CANCEL},999:{mapTo:{code:b,message:x},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:b,message:x}}}}},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:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:j.USER_DENIED},"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:j.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:j.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-602":{mapTo:j.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:j.UNKNOWN_ERROR},"-600":{mapTo:j.DEVICE_NOT_SUPPORT},"-601":{mapTo:j.SCAN_TIMEOUT},"-602":{mapTo:j.SERVICE_NOT_READY},"-603":{mapTo:j.UNREADABLE},"-604":{mapTo:j.INVALID_MRZ},"-605":{mapTo:j.PROCESSING},"-606":{mapTo:j.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:S,message:L},needMoreDetail:!0},"-102":{mapTo:{code:S,message:L},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:S,message:L},needMoreDetail:!0}}}},MP_APP_LIFECYCLE_TRACKING:{skipJump:!1}},z={android:{"-4":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT},iOS:{"-9":j.DECODE_FAILED,"-5":j.CLIENT_NOT_SUPPORT,"-14":j.TIME_OUT}},W={android:12100615,iOS:460,wp:0,unknown:0},F=5*r,G="https://payment-mini.zalo.me/api/order/create-v2",V="https://payment-mini.zalo.me/api/order/iap-create",H="https://payment-mini.zalo.me/api/transaction",K="https://payment-mini.zalo.me/api/order/purchase",J="DEFERRED",q="IMMEDIATE_AND_CHARGE_FULL_PRICE",Q={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},Y=5,$=6,X="#1843EF",ee=0,te={"-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 ne,re,ie,oe,ae,se,ue,ce,le,de,pe,fe,he,me,ve,ye,ge,_e,we,Te,be,Ee,Pe,Se="checkoutKitWidget-ifCKW",Ie="https://h5.zalo.me",Ae={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"};function Oe(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 Ce(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Oe(o,r,i,a,s,"next",e)}function s(e){Oe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ke(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 Ne(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Me(e,t){if(e){if("string"==typeof e)return ke(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)?ke(e,t):void 0}}function Re(e){return function(e){if(Array.isArray(e))return ke(e)}(e)||Ne(e)||Me(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 xe(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 De(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,Re(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ue(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")}}De.async=function(e){return Ce((function(){var t,n,r,i,o=arguments;return xe(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,Re(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,(ne=e.NetworkType||(e.NetworkType={})).none="none",ne.wifi="wifi",ne.cellular="cellular",ne.unknown="unknown",e.PlatformType=void 0,(re=e.PlatformType||(e.PlatformType={})).wp="wp",re.android="android",re.iOS="iOS",re.unknown="unknown",e.Events=void 0,(ie=e.Events||(e.Events={})).AppPaused="h5.event.paused",ie.AppResumed="h5.event.resumed",ie.NetworkChanged="h5.event.connection.changed",ie.OnDataCallback="h5.event.webview.result",ie.WebviewClosed="h5.event.webview.close",ie.OpenApp="h5.event.open.mp",ie.AppClose="h5.event.action.close",ie.PaymentCallback="payment.callback",ie.PaymentResult="action.payment.result",ie.PaymentDone="action.payment.done",ie.PaymentClose="action.payment.close",ie.DownloadProgress="h5.event.webview.download.progress",e.JumpStatus=void 0,(oe=e.JumpStatus||(e.JumpStatus={})).DOING="doing",oe.DONE="done",e.ProfileType=void 0,(ae=e.ProfileType||(e.ProfileType={}))[ae.user=1]="user",ae[ae.oa=0]="oa",ae[ae.aliasOA=2]="aliasOA",e.ChatType=void 0,(se=e.ChatType||(e.ChatType={}))[se.user=1]="user",se[se.oa=0]="oa",e.PostFeedType=void 0,(ue=e.PostFeedType||(e.PostFeedType={}))[ue.image=1]="image",ue[ue.multi_image=2]="multi_image",ue[ue.link=4]="link",ue[ue.profile=5]="profile",e.ScanNFCType=void 0,(ce=e.ScanNFCType||(e.ScanNFCType={}))[ce.cccd=1]="cccd",e.ShareSheetType=void 0,(le=e.ShareSheetType||(e.ShareSheetType={}))[le.image=1]="image",le[le.gif=11]="gif",le[le.video=12]="video",le[le.link=4]="link",le[le.oa=5]="oa",le[le.zmp=20]="zmp",le[le.multi_image=21]="multi_image",le[le.zmp_deep_link=4]="zmp_deep_link",le[le.text=22]="text",e.OrientationType=void 0,(de=e.OrientationType||(e.OrientationType={}))[de.auto=1]="auto",de[de.portrait=2]="portrait",de[de.landscape=3]="landscape",e.VibrateType=void 0,(pe=e.VibrateType||(e.VibrateType={}))[pe.oneShot=0]="oneShot",e.MediaPickerType=void 0,(fe=e.MediaPickerType||(e.MediaPickerType={}))[fe.zcamera=3]="zcamera",fe[fe.zcamera_photo=1]="zcamera_photo",fe[fe.zcamera_video=2]="zcamera_video",fe[fe.zcamera_scan=7]="zcamera_scan",fe[fe.photo=4]="photo",fe[fe.video=5]="video",fe[fe.file=6]="file",e.IAPPayType=void 0,(he=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",he.ONETIME="ONETIME",e.ProrationMode=void 0,(me=e.ProrationMode||(e.ProrationMode={}))[me.UNKNOW=0]="UNKNOW",me[me.DEFERRED=1]="DEFERRED",me[me.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(ve=e.StatusBarType||(e.StatusBarType={}))[ve.normal=1]="normal",ve[ve.hidden=0]="hidden",ve[ve.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(ye=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[ye.show=1]="show",ye[ye.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(ge=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[ge.show=1]="show",ge[ge.hide=0]="hide",e.TextAlignType=void 0,(_e=e.TextAlignType||(e.TextAlignType={}))[_e.left=0]="left",_e[_e.center=1]="center",e.CameraEvents=void 0,(we=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",we.OnStartCallback="h5.event.camera.start",we.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(Te=e.FacingMode||(e.FacingMode={})).FRONT="user",Te.BACK="environment",e.PhotoFormat=void 0,(be=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",be.PNG="image/png",be.JPEG="image/jpeg",e.PhotoQuality=void 0,(Ee=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",Ee.NORMAL="normal",Ee.LOW="low",e.StreamType=void 0,(Pe=e.StreamType||(e.StreamType={})).VIDEO="video",Pe.AUDIO="audio";var Le,je=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function Be(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ze(){var e=function(){var e=De((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:Ue(),platform:t,platformName:je(t),zaloVersion:Be(e).trim()}}}();if(e)return e}var ze=(null===(Le=Ze())||void 0===Le?void 0:Le.appEnv)||{};function We(e){We.on&&We.engine(e)}We.on=!1,We.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 Fe=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),We({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ve(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){Ge(e,t,n[t])}))}return e}function He(e,t){return function(e){if(Array.isArray(e))return e}(e)||Ne(e)||Me(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 Ke="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Je(){throw new Error("setTimeout has not been defined")}function qe(){throw new Error("clearTimeout has not been defined")}var Qe=Je,Ye=qe;function $e(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===Je||!Qe)&&setTimeout)return Qe=setTimeout,setTimeout(e,0);try{return Qe(e,0)}catch(t){try{return Qe.call(null,e,0)}catch(t){return Qe.call(this,e,0)}}}"function"==typeof Ke.setTimeout&&(Qe=setTimeout),"function"==typeof Ke.clearTimeout&&(Ye=clearTimeout);var Xe,et=[],tt=!1,nt=-1;function rt(){tt&&Xe&&(tt=!1,Xe.length?et=Xe.concat(et):nt=-1,et.length&&it())}function it(){if(!tt){var e=$e(rt);tt=!0;for(var t=et.length;t;){for(Xe=et,et=[];++nt<t;)Xe&&Xe[nt].run();nt=-1,t=et.length}Xe=null,tt=!1,function(e){if(Ye===clearTimeout)return clearTimeout(e);if((Ye===qe||!Ye)&&clearTimeout)return Ye=clearTimeout,clearTimeout(e);try{Ye(e)}catch(t){try{return Ye.call(null,e)}catch(t){return Ye.call(this,e)}}}(e)}}function ot(e,t){this.fun=e,this.array=t}ot.prototype.run=function(){this.fun.apply(null,this.array)};function at(){}var st=at,ut=at,ct=at,lt=at,dt=at,pt=at,ft=at;var ht=Ke.performance||{},mt=ht.now||ht.mozNow||ht.msNow||ht.oNow||ht.webkitNow||function(){return(new Date).getTime()};var vt=new Date;var yt,gt={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];et.push(new ot(e,t)),1!==et.length||tt||$e(it)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:st,addListener:ut,once:ct,off:lt,removeListener:dt,removeAllListeners:pt,emit:ft,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*mt.call(ht),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-vt)/1e3}},_t=gt,wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function bt(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 wt?wt:"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 _t&&_t.env&&"true"===_t.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)&&!U(r))throw new TypeError;return U(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)),C(e,t,n)}function w(e,t,n){if(!j(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function b(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)&&!U(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)&&!U(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!U(r)&&A(e,r,n)}function O(e,t,n){var r=I(t,n,!1);return!D(r)&&z(r.has(e))}function C(e,t,n){if(O(e,t,n))return k(e,t,n);var r=X(t);return U(r)?void 0:C(e,r,n)}function k(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 U(e){return null===e}function L(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 L(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",T),e("getOwnMetadataKeys",b),e("deleteMetadata",E)}(r)}()}(yt||(yt={}));var Et=Object.prototype.toString;var Pt="[object Null]",St="[object Undefined]";function It(e){return null==e?void 0===e?St:Pt:function(e){return Et.call(e)}(e)}function At(e){return null!=e&&"object"==typeof e}var Ot={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||At(e)&&"[object Number]"==It(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return At(e)&&"[object RegExp]"==It(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 Ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kt(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 Nt(e){return Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Nt(e)}function Mt(e){return Nt(e)}function Rt(e,t,n){return Rt="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=Mt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Rt(e,t,n)}function xt(e,t,n){return Rt(e,t,n)}function Dt(e,t){return Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Dt(e,t)}function Ut(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&&Dt(e,t)}function Lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jt(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=Mt(e);if(t){var i=Mt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==Tt(t)&&"function"!=typeof t?Lt(e):t}(this,n)}}var Bt=function(e,t){return e(t={exports:{}},t.exports),t.exports
|
|
11
11
|
/*! *****************************************************************************
|
|
12
12
|
Copyright (C) Microsoft. All rights reserved.
|
|
13
13
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
|
|
22
22
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
23
23
|
and limitations under the License.
|
|
24
|
-
***************************************************************************** */}((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})),Bt={enablePaymentDone:!1};function Zt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var zt="ACTION_CALLBACK";function Wt(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:Zt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Ft=function(t){Dt(r,t);var n=Lt(r);function r(){var e;return Ot(this,r),(e=n.apply(this,arguments)).debug=Tt("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===zt||t===e.Events.PaymentCallback)return Rt(Nt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return Rt(Nt(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===zt)return Rt(Nt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return Rt(Nt(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}(jt);function Gt(e){Ft.getInstance().emit(zt,e)}function Vt(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){Gt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=Tt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=En(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);Wt(n,t,s,Bt).forEach((function(e){Ft.getInstance().emit(e.eventName,e.eventId,e.data)}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Ft.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Ht={encode:Vt,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:Vt(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":wt(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":wt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Kt={},Jt=function(e,t,n){var r=t||"default";return function(){return(r in Kt?Kt[r](e,n):e).apply(this,arguments)}};Jt.setWrapper=function(e){Kt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var qt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Qt(e){try{return null===e?qt:JSON.parse(e)}catch(e){return qt}}var Yt,$t={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ht.encode(n);"post"!=t&&(e=Ht.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=Jt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Jt((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(Qt(e.responseText))},o.onerror=function(e){e.responseText?r(Qt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Xt=$t,en=(Yt=Oe((function(e,t,n){var r,i,o,a;return Re(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},At.isUndefined(n)||(r.currentVersion=n),i=Ht.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}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Yt.apply(this,arguments)});function tn(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Xt.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var nn=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},rn=function(){var e;return"android"===((null===(e=Be())||void 0===e?void 0:e.platformName)||"").toLowerCase()};var on=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=Be())||void 0===t?void 0:t.zaloVersion)||"0");if(n>=24112e3)e=n;else{var r,i=((null===(r=Be())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return function(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)}(e)},an=function(e,t){var n=on();return rn()&&n<e||function(){var e;return"ios"===((null===(e=Be())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function sn(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var un,cn=function(){function e(t,n,r,i){Ot(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}(),ln=function(e,t){return sn(e,cn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return sn(e,Error)?new cn(m,e.message,t).toJSON():At.isEmpty(null==e?void 0:e.message)||At.isEmpty(null==e?void 0:e.code)?new cn(m,A,t,e).toJSON():new cn(e.code,e.message,t,e.detail).toJSON()}(e,t)},dn=(un=Oe((function(e){var t;return Re(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,Ge({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return un.apply(this,arguments)}),pn=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n,r,i,o;return Re(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,_n.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=_n.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new cn(g,C,"getSetting")),[4,dn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new cn(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)}}())]}))})),fn=function(){var t,n,r,i=Be(),o={},a=Ft.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=Sn(t.result),i=On(null==r?void 0:r.action),u=At.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?void 0:r.data);u=At.isEmpty(null==d?void 0:d.error_code)?0:null==d?void 0:d.error_code,c=null==d?void 0:d.error_message,l=(null==d?void 0:d.data)||d}var p={error_code:u,error_message:c,data:l,action:(null==r?void 0:r.action)||t.actionName};if(n&&o[n]){var f=o[n],h=f.callback,m=f.timeout,v=f.isMultiCallback,y=f.options,g=f.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?At.isFunction(r)&&r(e):At.isFunction(i)&&i(e)}(p,h),!v&&delete o[n],m&&clearTimeout(m);var _={action:null==p?void 0:p.action,error:null==p?void 0:p.error_code,message:null==p?void 0:p.error_message,data:{}};try{if("action.open.inapp"===p.action||"action.open.outapp"===p.action){var w=new URL(null==y?void 0:y.url),T="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:T}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var b=null==y?void 0:y.uid;_.data={uid:b}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,S=null==y?void 0:y.type;_.data={uid:E,openChatType:S}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Ft.getInstance().on(zt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],tn(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],tn(e)}}),5e3),u=!0),r=Oe((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,T,b,E,S,P,I,A,O,C,N,x,D,U;return Re(this,(function(L){switch(L.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=Mn(t),(null==s?void 0:s.actionName)&&s.actionName.length>0&&(d=null==s?void 0:s.actionName),p=(null==s?void 0:s.isMultiCallback)||!1,f=!1!==(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)||!0),h=(null==s?void 0:s.haveCallback)||!1,m=(null==s?void 0:s.skipJump)||!1,v=(null==s?void 0:s.requireAccessToken)||!1,y=kn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Gt({serialId:l,result:{error_code:w,error_message:k,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,pn()]:[3,2];case 1:if(!1===(null==(b=L.sent())||null===(T=b.authSetting)||void 0===T?void 0:T["scope.userInfo"]))return Gt({serialId:l,result:{error_code:g,error_message:R,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];L.label=2;case 2:return S=On(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||At.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!bn(t)||S&&!1===S.isSupported?(Gt({serialId:l,result:{error_code:_,error_message:M,data:{isMobile:null==i||null===(P=i.platform)||void 0===P?void 0:P.isMobile},action:t}}),[2]):(I=Tn(n),m?[3,4]:[4,_n.getJSAccessToken()]);case 3:return O=L.sent(),[3,5];case 4:O="",L.label=5;case 5:A=O,L.label=6;case 6:return L.trys.push([6,10,,11]),m||!v?[3,8]:[4,_n.getAccessToken()];case 7:return N=L.sent(),[3,9];case 8:N="",L.label=9;case 9:return C=N,[3,11];case 10:return x=L.sent(),Gt({serialId:l,result:{error_code:null==x?void 0:x.code,error_message:null==x?void 0:x.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(D=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=D,a.on(e.Events.DownloadProgress,D))}catch(e){}return U=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,C,I,U)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),hn={success:function(e,t){return{code:h,message:t||I,data:e||{}}},error:{failLimit:function(){return new cn(T,O)},badRequest:function(e){return new cn(v,e)},loginFailed:function(e){return new cn(g,"".concat(N,": ").concat(e))},loginRequired:function(){return new cn(g,C)},cannotGetShareInfo:function(){return new cn(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(te).find((function(t){return t===e.toString()}));return new cn(e,t||A)},clientNotSupport:function(){return new cn(_,M)}}},mn=function(t){var n,r,i,o=null===(n=Be())||void 0===n?void 0:n.platformName,a=Nn(t.action),s=Z[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new cn(m,"Can not get auth code: ".concat(t.error_message));if(_n.jumpStatus!==e.JumpStatus.DONE&&!u)return new cn(j.UNAUTHORIZED.code,j.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new cn(j.FORBIDDEN.code,j.FORBIDDEN.message);if(o&&(null===(r=z[o])||void 0===r?void 0:r[t.error_code]))return new cn(z[o][t.error_code].code,z[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;if(null==l?void 0:l.needMoreDetail)h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message);return new cn(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new cn(t.error_code,t.error_message)},vn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=At.isEmpty(t)?void 0:t[r];if(o)return ze({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?mn(i):null==i?void 0:i.data)}}return At.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=Z[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){fn(e,t,o,Ge({},i,a))}),s)},yn=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){At.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),gn=function(){function t(){Ot(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=B[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return Oe((function(){return Re(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,ze({stage:n.REQUEST,type:"log",name:"jump"}),fn("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||tn([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){tn([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return Oe((function(){var i;return Re(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=Oe((function(e){var t,n,i;return Re(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return Oe((function(){var i,o;return Re(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),At.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,Ge({method:"POST",body:i},o)).then(function(){var e=Oe((function(e){var t,n,i,o;return Re(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Oe((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Re(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,tn([{action:d,error:-104,message:"no user auth",data:{}}]),hn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),tn([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(tn([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(hn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,tn([{action:d,error:-102,message:"no oauth",data:{}}]),hn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Oe((function(){var t,n,r,i,o,a;return Re(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=On("action.mp.user.authorize"))&&r.isSupported?[4,pn()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,yn()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return Oe((function(){var t;return Re(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=Oe((function(i){var o,a,s,u;return Re(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?At.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&kt(r.prototype,a),u&&kt(r,u),t}(),_n=gn.getInstance(),wn=Tt("zmp:utils:common"),Tn=function(e){if(At.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=[];for(var n=e.length,r=0;r<n;r++)t.push(Tn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+Tn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},bn=function(e){var t,n=Z[e],r=on(),i="versionLive"in n&&(null==n||null===(t=n.versionLive)||void 0===t?void 0:t.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||r>=i},En=function(e){try{if(e){wn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return wn("formattedValue",t,n,void 0===n?"undefined":wt(n)),n}return null}catch(t){return wn("parse json error:",t),e}},Sn=function(e){if(At.isObject(JSON)&&JSON.parse&&At.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return At.isObject(e)?e:new Function("return "+e)()},Pn=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},In=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var An=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},On=function(e){if(void 0!==e){var t=_n.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},kn=function(e){if(void 0===e)return!1;var t=_n.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Cn=function(){var e=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n;return Re(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,_n.jumpAndGetToken()];case 1:return t.sent(),n=_n.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}(),Nn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},Mn=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())},Rn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=Ve(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))};function xn(e,t,n,r){var i,o;!function(e,t){if(B[e]){var n=_n.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&_n.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw ln(hn.error.failLimit(),e);_n.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=hn.error.badRequest(s);throw c.detail=a,ln(c,e)}u.push(i.data)}));var c=r.apply(void 0,Me(u));return At.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!At.isNull(a)&&At.isFunction(a))return a(e);t(c)})).catch((function(t){var r=ln(t,e);if(!At.isNull(s)&&At.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!At.isNull(s)&&At.isFunction(s))return s(t);throw ln(t,e)}}function Dn(e){return Un.apply(this,arguments)}function Un(){return(Un=Oe((function(e){return Re(this,(function(t){return[2,xn("login",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,_n.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(We("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Ln(e){return jn.apply(this,arguments)}function jn(){return(jn=Oe((function(e){return Re(this,(function(t){return[2,xn("getAccessToken",[],[e],Oe((function(){var e;return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Cn()]:[3,3];case 1:return e=!t.sent(),[4,_n.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(We("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Bn,Zn="2.46.5";function zn(){return xn("getVersion",[],[],(function(){return Zn}))}function Wn(){var e;return{version:Pn("version-id")||"",apiVersion:Zn,zaloVersion:String(on()),platform:(null===(e=Be())||void 0===e?void 0:e.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Fn(){return xn("getSystemInfo",[],[],(function(){return Wn()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Bn||(Bn={}));const Gn=Bn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vn=e=>{switch(typeof e){case"undefined":return Gn.undefined;case"string":return Gn.string;case"number":return isNaN(e)?Gn.nan:Gn.number;case"boolean":return Gn.boolean;case"function":return Gn.function;case"bigint":return Gn.bigint;case"symbol":return Gn.symbol;case"object":return Array.isArray(e)?Gn.array:null===e?Gn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Gn.promise:"undefined"!=typeof Map&&e instanceof Map?Gn.map:"undefined"!=typeof Set&&e instanceof Set?Gn.set:"undefined"!=typeof Date&&e instanceof Date?Gn.date:Gn.object;default:return Gn.unknown}},Hn=Bn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Kn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Bn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Kn.create=e=>new Kn(e);const Jn=(e,t)=>{let n;switch(e.code){case Hn.invalid_type:n=e.received===Gn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Hn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Bn.jsonStringifyReplacer)}`;break;case Hn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Bn.joinValues(e.keys,", ")}`;break;case Hn.invalid_union:n="Invalid input";break;case Hn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Bn.joinValues(e.options)}`;break;case Hn.invalid_enum_value:n=`Invalid enum value. Expected ${Bn.joinValues(e.options)}, received '${e.received}'`;break;case Hn.invalid_arguments:n="Invalid function arguments";break;case Hn.invalid_return_type:n="Invalid function return type";break;case Hn.invalid_date:n="Invalid date";break;case Hn.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Bn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Hn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case Hn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case Hn.custom:n="Invalid input";break;case Hn.invalid_intersection_types:n="Intersection results could not be merged";break;case Hn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Hn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Bn.assertNever(e)}return{message:n}};let qn=Jn;function Qn(){return qn}const Yn=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function $n(e,t){const n=Yn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qn(),Jn].filter((e=>!!e))});e.common.issues.push(n)}class Xn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return er;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return Xn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return er;if("aborted"===i.status)return er;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const er=Object.freeze({status:"aborted"}),tr=e=>({status:"dirty",value:e}),nr=e=>({status:"valid",value:e}),rr=e=>"aborted"===e.status,ir=e=>"dirty"===e.status,or=e=>"valid"===e.status,ar=e=>"undefined"!=typeof Promise&&e instanceof Promise;var sr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(sr||(sr={}));class ur{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const cr=(e,t)=>{if(or(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new Kn(e.common.issues)}};function lr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class dr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Vn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Vn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xn,ctx:{common:e.parent.common,data:e.data,parsedType:Vn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ar(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return cr(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(ar(r)?r:Promise.resolve(r));return cr(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:Hn.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new qr({schema:this,typeName:ai.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Qr.create(this,this._def)}nullable(){return Yr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return Jr.create(this,this._def)}or(e){return Rr.create([this,e],this._def)}and(e){return Lr.create(this,e,this._def)}transform(e){return new qr({...lr(this._def),schema:this,typeName:ai.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new $r({...lr(this._def),innerType:this,defaultValue:t,typeName:ai.ZodDefault})}brand(){return new ni({typeName:ai.ZodBranded,type:this,...lr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Xr({...lr(this._def),innerType:this,catchValue:t,typeName:ai.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ri.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pr=/^c[^\s-]{8,}$/i,fr=/^[a-z][a-z0-9]*$/,hr=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,mr=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class vr extends dr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Hn.invalid_string,...sr.errToObj(n)}),this.nonempty=e=>this.min(1,sr.errToObj(e)),this.trim=()=>new vr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Gn.string){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.string,received:t.parsedType}),er}const t=new Xn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),$n(n,{code:Hn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),$n(n,{code:Hn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?$n(n,{code:Hn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&$n(n,{code:Hn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)mr.test(e.data)||(n=this._getOrReturnCtx(e,n),$n(n,{validation:"email",code:Hn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)hr.test(e.data)||(n=this._getOrReturnCtx(e,n),$n(n,{validation:"uuid",code:Hn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)pr.test(e.data)||(n=this._getOrReturnCtx(e,n),$n(n,{validation:"cuid",code:Hn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)fr.test(e.data)||(n=this._getOrReturnCtx(e,n),$n(n,{validation:"cuid2",code:Hn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),$n(n,{validation:"url",code:Hn.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),$n(n,{validation:"regex",code:Hn.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),$n(n,{code:Hn.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),$n(n,{code:Hn.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),$n(n,{code:Hn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Bn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new vr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...sr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...sr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...sr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...sr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...sr.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...sr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...sr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...sr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...sr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...sr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...sr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...sr.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function yr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}vr.create=e=>{var t;return new vr({checks:[],typeName:ai.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...lr(e)})};class gr extends dr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Gn.number){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.number,received:t.parsedType}),er}let t;const n=new Xn;for(const r of this._def.checks)if("int"===r.kind)Bn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),$n(t,{code:Hn.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),$n(t,{code:Hn.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),$n(t,{code:Hn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==yr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),$n(t,{code:Hn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),$n(t,{code:Hn.not_finite,message:r.message}),n.dirty()):Bn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,sr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,sr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,sr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,sr.toString(t))}setLimit(e,t,n,r){return new gr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:sr.toString(r)}]})}_addCheck(e){return new gr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:sr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:sr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:sr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:sr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:sr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:sr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:sr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Bn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}gr.create=e=>new gr({checks:[],typeName:ai.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...lr(e)});class _r extends dr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Gn.bigint){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.bigint,received:t.parsedType}),er}return nr(e.data)}}_r.create=e=>{var t;return new _r({typeName:ai.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...lr(e)})};class wr extends dr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Gn.boolean){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.boolean,received:t.parsedType}),er}return nr(e.data)}}wr.create=e=>new wr({typeName:ai.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...lr(e)});class Tr extends dr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Gn.date){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.date,received:t.parsedType}),er}if(isNaN(e.data.getTime())){return $n(this._getOrReturnCtx(e),{code:Hn.invalid_date}),er}const t=new Xn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),$n(n,{code:Hn.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),$n(n,{code:Hn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Bn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Tr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:sr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:sr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Tr.create=e=>new Tr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ai.ZodDate,...lr(e)});class br extends dr{_parse(e){if(this._getType(e)!==Gn.symbol){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.symbol,received:t.parsedType}),er}return nr(e.data)}}br.create=e=>new br({typeName:ai.ZodSymbol,...lr(e)});class Er extends dr{_parse(e){if(this._getType(e)!==Gn.undefined){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.undefined,received:t.parsedType}),er}return nr(e.data)}}Er.create=e=>new Er({typeName:ai.ZodUndefined,...lr(e)});class Sr extends dr{_parse(e){if(this._getType(e)!==Gn.null){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.null,received:t.parsedType}),er}return nr(e.data)}}Sr.create=e=>new Sr({typeName:ai.ZodNull,...lr(e)});class Pr extends dr{constructor(){super(...arguments),this._any=!0}_parse(e){return nr(e.data)}}Pr.create=e=>new Pr({typeName:ai.ZodAny,...lr(e)});class Ir extends dr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nr(e.data)}}Ir.create=e=>new Ir({typeName:ai.ZodUnknown,...lr(e)});class Ar extends dr{_parse(e){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.never,received:t.parsedType}),er}}Ar.create=e=>new Ar({typeName:ai.ZodNever,...lr(e)});class Or extends dr{_parse(e){if(this._getType(e)!==Gn.undefined){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.void,received:t.parsedType}),er}return nr(e.data)}}Or.create=e=>new Or({typeName:ai.ZodVoid,...lr(e)});class kr extends dr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Gn.array)return $n(t,{code:Hn.invalid_type,expected:Gn.array,received:t.parsedType}),er;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&($n(t,{code:e?Hn.too_big:Hn.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&($n(t,{code:Hn.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&($n(t,{code:Hn.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new ur(t,e,t.path,n))))).then((e=>Xn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new ur(t,e,t.path,n))));return Xn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new kr({...this._def,minLength:{value:e,message:sr.toString(t)}})}max(e,t){return new kr({...this._def,maxLength:{value:e,message:sr.toString(t)}})}length(e,t){return new kr({...this._def,exactLength:{value:e,message:sr.toString(t)}})}nonempty(e){return this.min(1,e)}}var Cr;function Nr(e){if(e instanceof Mr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Qr.create(Nr(r))}return new Mr({...e._def,shape:()=>t})}return e instanceof kr?kr.create(Nr(e.element)):e instanceof Qr?Qr.create(Nr(e.unwrap())):e instanceof Yr?Yr.create(Nr(e.unwrap())):e instanceof jr?jr.create(e.items.map((e=>Nr(e)))):e}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ai.ZodArray,...lr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Cr||(Cr={}));class Mr extends dr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Bn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Gn.object){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.object,received:t.parsedType}),er}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ar&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new ur(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Ar){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&($n(n,{code:Hn.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new ur(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>Xn.mergeObjectSync(t,e))):Xn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return sr.errToObj,new Mr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=sr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Mr({...this._def,unknownKeys:"strip"})}passthrough(){return new Mr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Mr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Mr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Cr.mergeShapes(this._def.shape(),e._def.shape()),typeName:ai.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Mr({...this._def,catchall:e})}pick(e){const t={};return Bn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Mr({...this._def,shape:()=>t})}omit(e){const t={};return Bn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Mr({...this._def,shape:()=>t})}deepPartial(){return Nr(this)}partial(e){const t={};return Bn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Mr({...this._def,shape:()=>t})}required(e){const t={};return Bn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Qr;)e=e._def.innerType;t[n]=e}})),new Mr({...this._def,shape:()=>t})}keyof(){return Vr(Bn.objectKeys(this.shape))}}Mr.create=(e,t)=>new Mr({shape:()=>e,unknownKeys:"strip",catchall:Ar.create(),typeName:ai.ZodObject,...lr(t)}),Mr.strictCreate=(e,t)=>new Mr({shape:()=>e,unknownKeys:"strict",catchall:Ar.create(),typeName:ai.ZodObject,...lr(t)}),Mr.lazycreate=(e,t)=>new Mr({shape:e,unknownKeys:"strip",catchall:Ar.create(),typeName:ai.ZodObject,...lr(t)});class Rr extends dr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new Kn(e.ctx.common.issues)));return $n(t,{code:Hn.invalid_union,unionErrors:n}),er}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new Kn(e)));return $n(t,{code:Hn.invalid_union,unionErrors:i}),er}}get options(){return this._def.options}}Rr.create=(e,t)=>new Rr({options:e,typeName:ai.ZodUnion,...lr(t)});const xr=e=>e instanceof Fr?xr(e.schema):e instanceof qr?xr(e.innerType()):e instanceof Gr?[e.value]:e instanceof Hr?e.options:e instanceof Kr?Object.keys(e.enum):e instanceof $r?xr(e._def.innerType):e instanceof Er?[void 0]:e instanceof Sr?[null]:null;class Dr extends dr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Gn.object)return $n(t,{code:Hn.invalid_type,expected:Gn.object,received:t.parsedType}),er;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):($n(t,{code:Hn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),er)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=xr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new Dr({typeName:ai.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...lr(n)})}}function Ur(e,t){const n=Vn(e),r=Vn(t);if(e===t)return{valid:!0,data:e};if(n===Gn.object&&r===Gn.object){const n=Bn.objectKeys(t),r=Bn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Ur(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Gn.array&&r===Gn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Ur(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Gn.date&&r===Gn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Lr extends dr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(rr(e)||rr(r))return er;const i=Ur(e.value,r.value);return i.valid?((ir(e)||ir(r))&&t.dirty(),{status:t.value,value:i.data}):($n(n,{code:Hn.invalid_intersection_types}),er)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Lr.create=(e,t,n)=>new Lr({left:e,right:t,typeName:ai.ZodIntersection,...lr(n)});class jr extends dr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.array)return $n(n,{code:Hn.invalid_type,expected:Gn.array,received:n.parsedType}),er;if(n.data.length<this._def.items.length)return $n(n,{code:Hn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),er;!this._def.rest&&n.data.length>this._def.items.length&&($n(n,{code:Hn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new ur(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Xn.mergeArray(t,e))):Xn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new jr({...this._def,rest:e})}}jr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jr({items:e,typeName:ai.ZodTuple,rest:null,...lr(t)})};class Br extends dr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.object)return $n(n,{code:Hn.invalid_type,expected:Gn.object,received:n.parsedType}),er;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new ur(n,e,n.path,e)),value:o._parse(new ur(n,n.data[e],n.path,e))});return n.common.async?Xn.mergeObjectAsync(t,r):Xn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Br(t instanceof dr?{keyType:e,valueType:t,typeName:ai.ZodRecord,...lr(n)}:{keyType:vr.create(),valueType:e,typeName:ai.ZodRecord,...lr(t)})}}class Zr extends dr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.map)return $n(n,{code:Hn.invalid_type,expected:Gn.map,received:n.parsedType}),er;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new ur(n,e,n.path,[o,"key"])),value:i._parse(new ur(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return er;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return er;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Zr.create=(e,t,n)=>new Zr({valueType:t,keyType:e,typeName:ai.ZodMap,...lr(n)});class zr extends dr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Gn.set)return $n(n,{code:Hn.invalid_type,expected:Gn.set,received:n.parsedType}),er;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&($n(n,{code:Hn.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&($n(n,{code:Hn.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return er;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new ur(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new zr({...this._def,minSize:{value:e,message:sr.toString(t)}})}max(e,t){return new zr({...this._def,maxSize:{value:e,message:sr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}zr.create=(e,t)=>new zr({valueType:e,minSize:null,maxSize:null,typeName:ai.ZodSet,...lr(t)});class Wr extends dr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Gn.function)return $n(t,{code:Hn.invalid_type,expected:Gn.function,received:t.parsedType}),er;function n(e,n){return Yn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Qn(),Jn].filter((e=>!!e)),issueData:{code:Hn.invalid_arguments,argumentsError:n}})}function r(e,n){return Yn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Qn(),Jn].filter((e=>!!e)),issueData:{code:Hn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Jr?nr((async(...e)=>{const t=new Kn([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):nr(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Kn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Kn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Wr({...this._def,args:jr.create(e).rest(Ir.create())})}returns(e){return new Wr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Wr({args:e||jr.create([]).rest(Ir.create()),returns:t||Ir.create(),typeName:ai.ZodFunction,...lr(n)})}}class Fr extends dr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Fr.create=(e,t)=>new Fr({getter:e,typeName:ai.ZodLazy,...lr(t)});class Gr extends dr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return $n(t,{received:t.data,code:Hn.invalid_literal,expected:this._def.value}),er}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Vr(e,t){return new Hr({values:e,typeName:ai.ZodEnum,...lr(t)})}Gr.create=(e,t)=>new Gr({value:e,typeName:ai.ZodLiteral,...lr(t)});class Hr extends dr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return $n(t,{expected:Bn.joinValues(n),received:t.parsedType,code:Hn.invalid_type}),er}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return $n(t,{received:t.data,code:Hn.invalid_enum_value,options:n}),er}return nr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Hr.create(e)}exclude(e){return Hr.create(this.options.filter((t=>!e.includes(t))))}}Hr.create=Vr;class Kr extends dr{_parse(e){const t=Bn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Gn.string&&n.parsedType!==Gn.number){const e=Bn.objectValues(t);return $n(n,{expected:Bn.joinValues(e),received:n.parsedType,code:Hn.invalid_type}),er}if(-1===t.indexOf(e.data)){const e=Bn.objectValues(t);return $n(n,{received:n.data,code:Hn.invalid_enum_value,options:e}),er}return nr(e.data)}get enum(){return this._def.values}}Kr.create=(e,t)=>new Kr({values:e,typeName:ai.ZodNativeEnum,...lr(t)});class Jr extends dr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Gn.promise&&!1===t.common.async)return $n(t,{code:Hn.invalid_type,expected:Gn.promise,received:t.parsedType}),er;const n=t.parsedType===Gn.promise?t.data:Promise.resolve(t.data);return nr(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Jr.create=(e,t)=>new Jr({type:e,typeName:ai.ZodPromise,...lr(t)});class qr extends dr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ai.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{$n(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?er:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?er:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!or(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>or(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Bn.assertNever(r)}}qr.create=(e,t,n)=>new qr({schema:e,typeName:ai.ZodEffects,effect:t,...lr(n)}),qr.createWithPreprocess=(e,t,n)=>new qr({schema:t,effect:{type:"preprocess",transform:e},typeName:ai.ZodEffects,...lr(n)});class Qr extends dr{_parse(e){return this._getType(e)===Gn.undefined?nr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qr.create=(e,t)=>new Qr({innerType:e,typeName:ai.ZodOptional,...lr(t)});class Yr extends dr{_parse(e){return this._getType(e)===Gn.null?nr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yr.create=(e,t)=>new Yr({innerType:e,typeName:ai.ZodNullable,...lr(t)});class $r extends dr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Gn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:ai.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...lr(t)});class Xr extends dr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return ar(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}Xr.create=(e,t)=>new Xr({innerType:e,typeName:ai.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...lr(t)});class ei extends dr{_parse(e){if(this._getType(e)!==Gn.nan){const t=this._getOrReturnCtx(e);return $n(t,{code:Hn.invalid_type,expected:Gn.nan,received:t.parsedType}),er}return{status:"valid",value:e.data}}}ei.create=e=>new ei({typeName:ai.ZodNaN,...lr(e)});const ti=Symbol("zod_brand");class ni extends dr{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ri extends dr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?er:"dirty"===e.status?(t.dirty(),tr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?er:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ri({in:e,out:t,typeName:ai.ZodPipeline})}}const ii=(e,t={},n)=>e?Pr.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):Pr.create(),oi={object:Mr.lazycreate};var ai;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(ai||(ai={}));const si=vr.create,ui=gr.create,ci=ei.create,li=_r.create,di=wr.create,pi=Tr.create,fi=br.create,hi=Er.create,mi=Sr.create,vi=Pr.create,yi=Ir.create,gi=Ar.create,_i=Or.create,wi=kr.create,Ti=Mr.create,bi=Mr.strictCreate,Ei=Rr.create,Si=Dr.create,Pi=Lr.create,Ii=jr.create,Ai=Br.create,Oi=Zr.create,ki=zr.create,Ci=Wr.create,Ni=Fr.create,Mi=Gr.create,Ri=Hr.create,xi=Kr.create,Di=Jr.create,Ui=qr.create,Li=Qr.create,ji=Yr.create,Bi=qr.createWithPreprocess,Zi=ri.create,zi={string:e=>vr.create({...e,coerce:!0}),number:e=>gr.create({...e,coerce:!0}),boolean:e=>wr.create({...e,coerce:!0}),bigint:e=>_r.create({...e,coerce:!0}),date:e=>Tr.create({...e,coerce:!0})},Wi=er;var Fi=Object.freeze({__proto__:null,defaultErrorMap:Jn,setErrorMap:function(e){qn=e},getErrorMap:Qn,makeIssue:Yn,EMPTY_PATH:[],addIssueToContext:$n,ParseStatus:Xn,INVALID:er,DIRTY:tr,OK:nr,isAborted:rr,isDirty:ir,isValid:or,isAsync:ar,get util(){return Bn},ZodParsedType:Gn,getParsedType:Vn,ZodType:dr,ZodString:vr,ZodNumber:gr,ZodBigInt:_r,ZodBoolean:wr,ZodDate:Tr,ZodSymbol:br,ZodUndefined:Er,ZodNull:Sr,ZodAny:Pr,ZodUnknown:Ir,ZodNever:Ar,ZodVoid:Or,ZodArray:kr,get objectUtil(){return Cr},ZodObject:Mr,ZodUnion:Rr,ZodDiscriminatedUnion:Dr,ZodIntersection:Lr,ZodTuple:jr,ZodRecord:Br,ZodMap:Zr,ZodSet:zr,ZodFunction:Wr,ZodLazy:Fr,ZodLiteral:Gr,ZodEnum:Hr,ZodNativeEnum:Kr,ZodPromise:Jr,ZodEffects:qr,ZodTransformer:qr,ZodOptional:Qr,ZodNullable:Yr,ZodDefault:$r,ZodCatch:Xr,ZodNaN:ei,BRAND:ti,ZodBranded:ni,ZodPipeline:ri,custom:ii,Schema:dr,ZodSchema:dr,late:oi,get ZodFirstPartyTypeKind(){return ai},coerce:zi,any:vi,array:wi,bigint:li,boolean:di,date:pi,discriminatedUnion:Si,effect:Ui,enum:Ri,function:Ci,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ii((t=>t instanceof e),t,!0),intersection:Pi,lazy:Ni,literal:Mi,map:Oi,nan:ci,nativeEnum:xi,never:gi,null:mi,nullable:ji,number:ui,object:Ti,oboolean:()=>di().optional(),onumber:()=>ui().optional(),optional:Li,ostring:()=>si().optional(),pipeline:Zi,preprocess:Bi,promise:Di,record:Ai,set:ki,strictObject:bi,string:si,symbol:fi,transformer:Ui,tuple:Ii,undefined:hi,union:Ei,unknown:yi,void:_i,NEVER:Wi,ZodIssueCode:Hn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Kn}),Gi=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,I,A,O,k;Ot(this,t),this.initConfig=window.APP_CONFIG;var C=At.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?Y:$;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?Q.HIDE_BACK:Q.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?Q.SHOW_HOME:Q.HIDE_HOME,D=new URL(location.href),U=An(null===(w=this.initConfig)||void 0===w||null===(T=w.app)||void 0===T?void 0:T.statusBar);"boolean"==typeof(null===(b=this.initConfig)||void 0===b||null===(E=b.app)||void 0===E?void 0:E.actionBarHidden)&&(C=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?$:Y);this.config={actionbarType:C,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||X,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(k=O.app)||void 0===k?void 0:k.textAlign)||ee,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return Oe((function(){var r,i;return Re(this,(function(o){return void 0===(void 0===e?"undefined":wt(e))&&null===(void 0===e?"undefined":wt(e))||(r="none"===e||"home"===e?Q.HIDE_BACK:Q.SHOW_BACK,i="home"===e||"both"===e?Q.SHOW_HOME:Q.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){vn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ge({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return Oe((function(){var r,i,o;return Re(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Be())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();vn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return Oe((function(){var r,i,o;return Re(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Be())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();vn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return Oe((function(){var r;return Re(this,(function(i){return r=n.config,At.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),At.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),At.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=$:!1===t.hideActionBar&&(r.actionbarType=Y),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){vn("CHANGE_ACTIONBAR",Ge({},r),{success:function(){var o;n.config=Ge({},r);var a,s=null===(o=Be())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===$;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),Vi=Gi.getInstance(),Hi=[Ti({title:si()}).optional()];function Ki(e){return Ji.apply(this,arguments)}function Ji(){return Ji=Oe((function(e){return Re(this,(function(t){return[2,xn("setNavigationBarTitle",Hi,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Vi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ji.apply(this,arguments)}var qi=[Ti({color:si(),textColor:Fi.enum(["black","white"]).optional(),statusBarColor:si().optional()}).optional()];function Qi(e){return Yi.apply(this,arguments)}function Yi(){return Yi=Oe((function(e){return Re(this,(function(t){return[2,xn("setNavigationBarColor",qi,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Vi.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yi.apply(this,arguments)}var $i=[Ti({type:Fi.enum(["none","back","home","both"])}).optional()];function Xi(e){return eo.apply(this,arguments)}function eo(){return eo=Oe((function(e){return Re(this,(function(t){return[2,xn("setNavigationBarLeftButton",$i,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Vi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),eo.apply(this,arguments)}function to(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function no(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,to(e,t,"get"))}function ro(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function io(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,to(e,t,"set"),n),n}var oo,ao,so=function(){function e(){Ot(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Fe({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),uo=new WeakMap,co=new WeakMap,lo=new WeakMap,po=function(e){Dt(n,e);var t=Lt(n);function n(e){var r;return Ot(this,n),ro(Ut(r=t.call(this)),uo,{writable:!0,value:localStorage}),ro(Ut(r),co,{writable:!0,value:void 0}),ro(Ut(r),lo,{writable:!0,value:void 0}),io(Ut(r),lo,{keys:new Set,currentSize:0,limitSize:F}),io(Ut(r),co,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in no(this,uo)){if(e)if(t.split("_")[0]!==e)continue;no(this,lo).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return no(this,co)&&(e="".concat(no(this,co),"_").concat(e)),no(this,lo).keys.has(e)?no(this,uo).getItem(e):null},r.set=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ve(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){no(this,co)&&(e="".concat(no(this,co),"_").concat(e)),no(this,uo).setItem(e,t),no(this,lo).keys.add(e)},r.getInfo=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(no(this,uo),no(this,co));return{currentSize:At.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((F/1024).toFixed(2))}},r.remove=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){no(this,co)&&(e="".concat(no(this,co),"_").concat(e)),no(this,lo).keys.has(e)&&(no(this,uo).removeItem(e),no(this,lo).keys.delete(e))},r.clearAsync=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;no(this,lo).keys.forEach((function(t){no(e,co)&&t.indexOf(no(e,co))<0||(no(e,uo).removeItem(t),no(e,lo).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=Ve(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(so),fo=new WeakMap,ho=new WeakMap,mo=function(e){Dt(n,e);var t=Lt(n);function n(e){var r;return Ot(this,n),ro(Ut(r=t.call(this)),fo,{writable:!0,value:void 0}),ro(Ut(r),ho,{writable:!0,value:void 0}),io(Ut(r),ho,{keys:new Set,currentSize:0,limitSize:F}),io(Ut(r),fo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return[2,new Promise((function(n,r){vn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:no(t,fo)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:no(this,fo)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return[2,new Promise((function(n,r){vn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:no(t,fo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:no(this,fo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:no(e,fo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:At.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(F/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:no(this,fo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:At.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(F/1024)}},r.remove=function(e){var t=this;return Oe((function(){return Re(this,(function(n){return[2,new Promise((function(n,r){vn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:no(t,fo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:no(this,fo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:no(e,fo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:no(this,fo)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=mn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(so),vo=function(){function e(){Ot(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Oe((function(){var n,r;return Re(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=En(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Oe((function(){var n,r;return Re(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ve(e,2),n=t[0],i=t[1];At.isUndefined(i)||At.isNull(i)||(r[n]=In(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return Oe((function(){return Re(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return Oe((function(){return Re(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),yo=new WeakMap,go=function(e){Dt(n,e);var t=Lt(n);function n(e){var r;return Ot(this,n),ro(Ut(r=t.call(this)),yo,{writable:!0,value:void 0}),io(Ut(r),yo,e),r}return n.prototype.getInstance=function(){return new po(no(this,yo))},n}(vo),_o=new WeakMap,wo=function(e){Dt(n,e);var t=Lt(n);function n(e){var r;return Ot(this,n),ro(Ut(r=t.call(this)),_o,{writable:!0,value:void 0}),io(Ut(r),_o,e),r}return n.prototype.getInstance=function(){return new mo(no(this,_o))},n}(vo),To=new go(o),bo=on(),Eo=(null===(oo=Be())||void 0===oo?void 0:oo.platformName)||"unknown";bo>0&&bo>={android:12100571,iOS:400,wp:0,unknown:0}[Eo]&&(null===(ao=Be())||void 0===ao?void 0:ao.appEnv.isMp)&&(To=new wo(o));var So=To,Po=[Ti({data:Fi.record(si(),Fi.any())}).optional()];function Io(e){return Ao.apply(this,arguments)}function Ao(){return Ao=Oe((function(e){return Re(this,(function(t){return[2,xn("setStorage",Po,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,So.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(We("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ao.apply(this,arguments)}var Oo=[Ti({keys:Fi.array(si())}).optional()];function ko(e){return Co.apply(this,arguments)}function Co(){return Co=Oe((function(e){return Re(this,(function(t){return[2,xn("getStorage",Oo,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,So.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(We("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Co.apply(this,arguments)}function No(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=Oe((function(e){return Re(this,(function(t){return[2,xn("getStorageInfo",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,So.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(We("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ro=[Ti({keys:Fi.array(si())}).optional()];function xo(e){return Do.apply(this,arguments)}function Do(){return Do=Oe((function(e){return Re(this,(function(t){return[2,xn("removeStorage",Ro,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,So.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(We("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Do.apply(this,arguments)}var Uo=[Ti({prefix:si().optional()}).optional()];function Lo(e){return jo.apply(this,arguments)}function jo(){return(jo=Oe((function(e){return Re(this,(function(t){return[2,xn("clearStorage",Uo,[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp||Ze.isMpWeb?[4,So.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(We("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=function(){var e=Oe((function(e,t){var n,r,i,a;return Re(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Cn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,_n.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=Oe((function(e){var t,n,r,i,o,a;return Re(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&i<0)throw o=(null==r?void 0:r.message)||A,new cn(i,o);return a=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:a,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Zo=[Ti({avatarType:Fi.enum(["small","normal","large"]).optional(),autoRequestPermission:Fi.boolean().default(!1).optional()}).optional()];function zo(e){return Wo.apply(this,arguments)}function Wo(){return Wo=Oe((function(e){return Re(this,(function(t){return[2,xn("getUserInfo",Zo,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(i){switch(i.label){case 0:if(!Ze.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Bo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return Ze.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(We("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wo.apply(this,arguments)}var Fo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Go=Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Be())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Fo(s).NONE:o=e.NetworkType.none;break;case Fo(s).WIFI:o=e.NetworkType.wifi;break;case Fo(s)["2G"]:case Fo(s)["3G"]:case Fo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function Vo(e){return Ho.apply(this,arguments)}function Ho(){return(Ho=Oe((function(t){return Re(this,(function(n){return[2,xn("getNetworkType",[],[t],Oe((function(){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?[4,Go()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ze.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(We("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Ko=[Fi.function().args(Ti({isConnected:Fi.boolean(),networkType:Fi.enum(["none","wifi","cellular","unknown"])})).returns(Fi.void())];function Jo(t){return xn("onNetworkStatusChange",Ko,[t],(function(t){var n=t;if(Ze.isMp)!function(t){Ft.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Go().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Ze.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){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}n({isConnected:!0,networkType:t})}))}}))}var qo=function(){var e=Oe((function(e){var t,n,r,i,o,a;return Re(this,(function(s){return a={subaction:0,scanning_type:At.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:At.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:At.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:At.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:At.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:At.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:At.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:At.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:At.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:At.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){vn("SCAN_IBEACON",Ge({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Qo=[Ti({scanningType:Fi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Fi.number().optional(),monitorInterval:Fi.number().optional(),domain:Fi.string().optional(),scanConfig:Ti({scanTime:Fi.number().optional(),timeBetweenScan:Fi.number().optional(),beaconTimeout:Fi.number().optional(),delayCheckConnectedTimeout:Fi.number().optional(),beaconConnectedTimeout:Fi.number().optional()}).optional(),items:Fi.array(Ti({id:Fi.string().optional(),distance:Fi.number().optional(),monitor:Ti({enable:Fi.boolean().optional(),movingRange:Fi.number().optional()}).optional()})).optional(),scanFromSource:Fi.string().optional()}).optional()];function Yo(e){return $o.apply(this,arguments)}function $o(){return($o=Oe((function(e){return Re(this,(function(t){return[2,xn("startBeaconDiscovery",Qo,[e],Oe((function(){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,qo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(We("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Xo=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function ea(e){return ta.apply(this,arguments)}function ta(){return(ta=Oe((function(e){return Re(this,(function(t){return[2,xn("stopBeaconDiscovery",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Xo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(We("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var na=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function ra(e){return ia.apply(this,arguments)}function ia(){return(ia=Oe((function(e){return Re(this,(function(t){return[2,xn("getBeacons",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,na()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(We("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var oa=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function aa(e){return sa.apply(this,arguments)}function sa(){return(sa=Oe((function(e){return Re(this,(function(t){return[2,xn("closeApp",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,oa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var ua=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ca(e){return la.apply(this,arguments)}function la(){return(la=Oe((function(e){return Re(this,(function(t){return[2,xn("scanQRCode",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,ua()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(We("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var da=function(){var t=Oe((function(t,n,r,o){return Re(this,(function(a){return[2,new Promise((function(a,s){vn("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),pa=[Ti({id:si(),type:Fi.enum(["user","oa","aliasOA"]),sourceId:Fi.any().optional(),sourceIndex:Fi.any().optional()}).optional()];function fa(e){return ha.apply(this,arguments)}function ha(){return ha=Oe((function(e){return Re(this,(function(t){return[2,xn("openProfile",pa,[e],function(){var e=Oe((function(e){var t,n,r,i;return Re(this,(function(o){switch(o.label){case 0:return Ze.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,da(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ha.apply(this,arguments)}var ma=function(){var t=Oe((function(t,n){var r,o,a,s=arguments;return Re(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){vn("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),va=[Ti({id:si(),type:Fi.enum(["user","oa"]),sourceId:Fi.any().optional(),sourceIndex:Fi.any().optional(),message:si().optional()}).optional()];function ya(e){return ga.apply(this,arguments)}function ga(){return ga=Oe((function(e){return Re(this,(function(t){return[2,xn("openChat",va,[e],function(){var e=Oe((function(e){var t,n,r,i,o;return Re(this,(function(a){switch(a.label){case 0:return Ze.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ma(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ga.apply(this,arguments)}function _a(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var wa=function(){var t=Oe((function(t,n){var r,o;return Re(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(t,n){vn("OPEN_POSTFEED",_a(Ge({type:e.PostFeedType[o]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Ta=[Fi.union([Ti({type:Fi.enum(["image"]),data:Ti({imageUrl:si().url().optional(),imageUrls:Fi.array(si().url()).optional()})}),Ti({type:Fi.enum(["link"]),data:Ti({link:si().url(),title:si().max(100).optional(),thumb:si().url().optional(),description:si().max(400).default("").optional()})}),Ti({type:Fi.enum(["profile"]),data:Ti({id:si().optional()})})])];function ba(e){return Ea.apply(this,arguments)}function Ea(){return Ea=Oe((function(e){return Re(this,(function(t){return[2,xn("openPostFeed",Ta,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(t=e.type,n=e.data,[4,wa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(We("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ea.apply(this,arguments)}var Sa=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Pa=[Ti({id:si(),showDialogConfirm:Fi.boolean().optional()}).optional()];function Ia(e){return Aa.apply(this,arguments)}function Aa(){return Aa=Oe((function(e){return Re(this,(function(t){return[2,xn("followOA",Pa,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=e.id,[4,Sa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Aa.apply(this,arguments)}var Oa=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ka=[Ti({id:si()}).optional()];function Ca(e){return Na.apply(this,arguments)}function Na(){return Na=Oe((function(e){return Re(this,(function(t){return[2,xn("unfollowOA",ka,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=e.id,[4,Oa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Na.apply(this,arguments)}var Ma=function(){var e=Oe((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return Re(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,Ge({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw hn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,_a(Ge({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ra=function(){var t=Oe((function(t,n){var r,a,s,u,c,l,d,p,f,h,m;return Re(this,(function(v){switch(v.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return c=[],l=on(),d=(null===(u=Be())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=W[d]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?c=null==n?void 0:n.imageUrls:c.push(null==n?void 0:n.imageUrl),r={photoUrls:c,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,_n.getAccessToken()];case 8:case 11:return s=v.sent(),[4,Ma(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return p=v.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(o,"&shareId=").concat(p.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return f=v.sent().shareableLink,h=new URL(f),m=h.searchParams.getAll("zshareId"),h.searchParams.delete("zshareId"),m.length>0&&h.searchParams.append("zshareId",m[0]),r={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){vn("OPEN_SHARESHEET",_a(Ge({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),xa=[Fi.union([Ti({type:Fi.enum(["text"]),data:Ti({text:si(),description:si().default("").optional(),autoParseLink:Fi.boolean().default(!1).optional()})}),Ti({type:Fi.enum(["image"]),data:Ti({imageUrl:si().url().optional(),imageUrls:Fi.array(si().url()).max(10).optional()})}),Ti({type:Fi.enum(["link"]),data:Ti({link:si().url(),chatOnly:Fi.boolean().optional()})}),Ti({type:Fi.enum(["oa"]),data:Ti({id:si()})}),Ti({type:Fi.enum(["gif"]),data:Ti({gifUrl:si().url(),imageUrl:si().url().optional(),width:ui().min(0).optional(),height:ui().min(0).optional()})}),Ti({type:Fi.enum(["video"]),data:Ti({videoThumb:si().url(),videoUrl:si().url(),width:ui().min(0).optional(),height:ui().min(0).optional()})}),Ti({type:Fi.enum(["zmp","zmp_deep_link"]),data:Ti({title:si().max(100),thumbnail:si().url(),path:si().optional(),description:si().max(400).default("").optional()})})])];function Da(e){return Ua.apply(this,arguments)}function Ua(){return Ua=Oe((function(e){return Re(this,(function(t){return[2,xn("openShareSheet",xa,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(t=e.type,n=e.data,[4,Ra(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(We("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ua.apply(this,arguments)}var La=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Be())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Be())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function ja(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=Oe((function(e){return Re(this,(function(t){return[2,xn("requestCameraPermission",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return[4,La()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Za=function(){var e=Oe((function(e,t,n){return Re(this,(function(r){return[2,new Promise((function(r,i){vn("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),za=Oe((function(){var e,t,n,r=arguments;return Re(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=Wn(),[4,en(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Wa=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Fa=[Ti({params:Fi.record(si(),si()).optional()}).optional()];function Ga(e){return Va.apply(this,arguments)}function Va(){return Va=Oe((function(e){return Re(this,(function(t){return[2,xn("createShortcut",Fa,[e],function(){var e=Oe((function(e){var t,n,r,i,s,u,c,l;return Re(this,(function(d){switch(d.label){case 0:return Ze.isMp?[4,za(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Be())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||Pn("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Wa(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Za("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,hn.success()];case 6:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Va.apply(this,arguments)}var Ha=function(){var e=Oe((function(e,t,n){return Re(this,(function(r){return[2,new Promise((function(r,o){vn("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ka=[Ti({secretData:si(),ui:Ti({title:si().default("Xác thực").optional(),subTitle:si().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:si().default("Đóng").optional()}).optional(),requireFingerprint:di().default(!0).optional()}).optional()];function Ja(e){return qa.apply(this,arguments)}function qa(){return qa=Oe((function(e){return Re(this,(function(t){return[2,xn("openBioAuthentication",Ka,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(i){switch(i.label){case 0:return Ze.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ha(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(We("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qa.apply(this,arguments)}var Qa=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function Ya(e){return $a.apply(this,arguments)}function $a(){return($a=Oe((function(e){return Re(this,(function(t){return[2,xn("checkStateBioAuthentication",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Qa()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ze.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(We("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Xa=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),es=[Ti({message:si()}).optional()];function ts(e){return ns.apply(this,arguments)}function ns(){return ns=Oe((function(e){return Re(this,(function(t){return[2,xn("showToast",es,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Xa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ns.apply(this,arguments)}var rs=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function is(e){return os.apply(this,arguments)}function os(){return(os=Oe((function(e){return Re(this,(function(t){return[2,xn("hideKeyboard",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,rs()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var as=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ss=[Ti({phoneNumber:si()})];function us(e){return cs.apply(this,arguments)}function cs(){return cs=Oe((function(e){return Re(this,(function(t){return[2,xn("openPhone",ss,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,as(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cs.apply(this,arguments)}var ls=function(){var e=Oe((function(e,t){return Re(this,(function(n){return[2,new Promise((function(n,r){vn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ds=[Ti({content:si(),phoneNumber:si()})];function ps(e){return fs.apply(this,arguments)}function fs(){return fs=Oe((function(e){return Re(this,(function(t){return[2,xn("openSMS",ds,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,ls(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fs.apply(this,arguments)}var hs=function(){var e=Oe((function(e){var t,n=arguments;return Re(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){vn("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ms=[Ti({id:si(),displayName:si().default("").optional()})];function vs(e){return ys.apply(this,arguments)}function ys(){return ys=Oe((function(e){return Re(this,(function(t){return[2,xn("viewOAQr",ms,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,hs(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ys.apply(this,arguments)}var gs=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),_s=[Ti({keepScreenOn:di()})];function ws(e){return Ts.apply(this,arguments)}function Ts(){return Ts=Oe((function(e){return Re(this,(function(t){return[2,xn("keepScreen",_s,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,gs(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ts.apply(this,arguments)}function bs(e){return Es.apply(this,arguments)}function Es(){return(Es=Oe((function(e){return Re(this,(function(t){return[2,xn("onKeepScreen",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,gs(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function Ss(e){return Ps.apply(this,arguments)}function Ps(){return(Ps=Oe((function(e){return Re(this,(function(t){return[2,xn("offKeepScreen",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,gs(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Is=function(){var e=Oe((function(e,t,n){var r;return Re(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){vn("SAVE_IMAGE_GALLERY",_a(Ge({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),As=[Ti({imageBase64Data:si().optional(),imageUrl:si().url().optional()}).optional()];function Os(e){return ks.apply(this,arguments)}function ks(){return ks=Oe((function(e){return Re(this,(function(t){return[2,xn("saveImageToGallery",As,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Is(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ks.apply(this,arguments)}var Cs=function(){var e=Oe((function(e,t){var n;return Re(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){vn("SAVE_VIDEO_GALLERY",Ge({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ns=[Ti({videoUrl:si().url()}).optional()];function Ms(e){return Rs.apply(this,arguments)}function Rs(){return Rs=Oe((function(e){return Re(this,(function(t){return[2,xn("saveVideoToGallery",Ns,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Cs(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rs.apply(this,arguments)}var xs=function(){var e=Oe((function(e){var t,n,r,i,o,a,u=arguments;return Re(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,za(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=Ve(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){vn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),Ds=[Ti({appId:si(),path:si().optional(),params:Fi.record(si(),si()).optional()})];function Us(e){return Ls.apply(this,arguments)}function Ls(){return Ls=Oe((function(e){return Re(this,(function(t){return[2,xn("openMiniApp",Ds,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,xs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var js=Oe((function(){var t,n,r=arguments;return Re(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){vn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Bs=[Ti({type:Fi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:ui().optional()})];function Zs(e){return zs.apply(this,arguments)}function zs(){return zs=Oe((function(e){return Re(this,(function(t){return[2,xn("vibrate",Bs,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,js(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zs.apply(this,arguments)}var Ws=function(){var e=Oe((function(e,t){var n,r,i,o;return Re(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=At.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?nn(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?nn(null==t?void 0:t.leftButton):"back"},!r&&At.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){vn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Fs=[Ti({url:si(),config:Ti({style:Fi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Fi.enum(["back","none"]).default("back").optional()}).optional()})];function Gs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=Oe((function(e){return Re(this,(function(t){return[2,xn("openWebview",Fs,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Ws(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}function Hs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ht.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Ks(){return xn("getRouteParams",[],[],(function(){return Hs()}))}function Js(e){return qs.apply(this,arguments)}function qs(){return(qs=Oe((function(e){return Re(this,(function(t){return[2,xn("getAppInfo",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,za()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(We("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Qs=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("WEBVIEW_SET_RESULT",{result:In(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ys=[Ti({data:Fi.any()})];function $s(e){return Xs.apply(this,arguments)}function Xs(){return Xs=Oe((function(e){return Re(this,(function(t){return[2,xn("sendDataToPreviousMiniApp",Ys,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Qs(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xs.apply(this,arguments)}var eu=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){var n,r;vn("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(hn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Be())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function tu(e){return nu.apply(this,arguments)}function nu(){return(nu=Oe((function(e){return Re(this,(function(t){return[2,xn("getPhoneNumber",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,eu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(We("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var ru=Oe((function(){var e,t=arguments;return Re(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){vn("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),iu=[Ti({maxProfile:ui().min(1).max(10).optional().default(1)})];function ou(e){return au.apply(this,arguments)}function au(){return au=Oe((function(e){return Re(this,(function(t){return[2,xn("openProfilePicker",iu,[e],function(){var e=Oe((function(e){var t,n,r,i,o;return Re(this,(function(a){switch(a.label){case 0:return Ze.isMp?[4,ru(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,_n.getAccessToken()];case 3:return r=a.sent(),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(At.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return Ze.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(We("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),au.apply(this,arguments)}var su=function(){var e=Oe((function(e,t,n){var r;return Re(this,(function(i){return r=t&&At.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){vn("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),uu=[Ti({SSID:si(),password:si().optional(),hiddenSSID:di().optional()})];function cu(e){return lu.apply(this,arguments)}function lu(){return lu=Oe((function(e){return Re(this,(function(t){return[2,xn("connectWifi",uu,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,su(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lu.apply(this,arguments)}var du=function(){var t=Oe((function(t,n,r,i,o,a){var s,u;return Re(this,(function(c){return s={type:0,url:n,max_size:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){vn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ge({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),pu=[Ti({type:Fi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:si().url(),maxItemSize:ui().min(0).optional(),editView:Ti({enable:di().optional(),aspectRatio:si().regex(/^d+:d+$/).optional()}).optional(),silentRequest:di().optional(),maxSelectItem:ui().min(1).optional()})];function fu(e){return hu.apply(this,arguments)}function hu(){return hu=Oe((function(e){return Re(this,(function(t){return[2,xn("openMediaPicker",pu,[e],function(){var e=Oe((function(e){var t,n,r,i,o,a;return Re(this,(function(s){switch(s.label){case 0:return Ze.isMp?(i={},At.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,du(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ze.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(We("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hu.apply(this,arguments)}var mu=[Ti({title:si().max(100),description:si().max(400).default(""),thumbnail:si().url().optional(),path:si().optional()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=Oe((function(e){return Re(this,(function(t){return[2,xn("getShareableLink",mu,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return[4,_n.getAccessToken()];case 1:return t=n.sent(),[4,Ma(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function _u(e){return wu.apply(this,arguments)}function wu(){return(wu=Oe((function(e){return Re(this,(function(t){return[2,xn("closeLoading",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,gu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Tu(e){return bu.apply(this,arguments)}function bu(){return bu=Oe((function(e){return Re(this,(function(t){return[2,xn("requestUpdateZalo",[],[e],Oe((function(){var e,t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(n=(null===(e=Be())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Wa(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("requestUpdateZalo",{}))]}}))})))]}))})),bu.apply(this,arguments)}var Eu=Ft.getInstance();Eu.addListener=function(t,n,r){var i=t;return Eu.addListener(e.Events[i],n,r)};var Su=[Fi.function()];function Pu(t){return xn("onConfirmToExit",Su,[t],(function(t){var n=t;Ze.isMp&&(Eu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Vi.setNavigationBarLeftButton(void 0,2))}))}function Iu(){return xn("offConfirmToExit",[],[],(function(){Ze.isMp&&(Eu.off(e.Events.AppClose),Vi.setNavigationBarLeftButton(void 0,0))}))}function Au(){return xn("getDeviceId",[],[],(function(){return Ze.isMp&&_n.getSync(l.DEVICE_ID)||""}))}function Ou(e){return ku.apply(this,arguments)}function ku(){return(ku=Oe((function(e){return Re(this,(function(t){return[2,xn("getDeviceIdAsync",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,_n.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Cu(){return xn("getContext",[],[],(function(){if(Ze.isMp){var e=_n.getSync(l.CONTEXT_ID)||"";return{type:_n.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function Nu(e){return Mu.apply(this,arguments)}function Mu(){return(Mu=Oe((function(e){return Re(this,(function(t){return[2,xn("getContextAsync",[],[e],Oe((function(){var e;return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,_n.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,_n.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function Ru(e){return xu.apply(this,arguments)}function xu(){return(xu=Oe((function(e){return Re(this,(function(t){return[2,xn("getAuthCode",[],[e],Oe((function(){var e,t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?[4,_n.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,_n.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,_n.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw tn([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),hn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function Du(e){return Uu.apply(this,arguments)}function Uu(){return(Uu=Oe((function(e){return Re(this,(function(t){return[2,xn("getZPIToken",[],[e],Oe((function(){var e,t,n,r;return Re(this,(function(i){switch(i.label){case 0:return Ze.isMp?[4,_n.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,_n.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,_n.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,_n.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var Lu=[si()];function ju(e){return xn("setAccessToken",Lu,[e],(function(e){var t=e;_n.setAccessToken(t)}))}var Bu=[Ti({url:si().url()})];function Zu(e){return zu.apply(this,arguments)}function zu(){return zu=Oe((function(e){return Re(this,(function(t){return[2,xn("openOutApp",Bu,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Wa(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zu.apply(this,arguments)}var Wu=[Ti({count:ui().min(1).optional().default(1),sourceType:Fi.array(Fi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Fi.enum(["back","front"]).default("front").optional()})];function Fu(e){return Gu.apply(this,arguments)}function Gu(){return Gu=Oe((function(e){return Re(this,(function(t){return[2,xn("chooseImage",Wu,[e],function(){var e=Oe((function(e){var t,n,r,i;return Re(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gu.apply(this,arguments)}var Vu=Oe((function(){var e,t,n=arguments;return Re(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){vn("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(hn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Hu(e){return Ku.apply(this,arguments)}function Ku(){return(Ku=Oe((function(e){return Re(this,(function(t){return[2,xn("getLocation",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Vu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(We("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Ju=[Fi.function().args(Ti({data:Fi.any()})).returns(Fi.void())];function qu(t){return xn("onCallbackData",Ju,[t],(function(){!function(t){Ft.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Qu=function(){var e=Oe((function(e){var t,n,r,i,a,s,u,c,l,d,p;return Re(this,(function(f){switch(f.label){case 0:return e||(e=Hs()),"object"==typeof e&&((n=e.zmpOrderId||e.orderId)||(t=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(r=Ht.getParameterByName("orderId",e),i=Ht.getParameterByName("appTransID",e)||Ht.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,_n.getAccessToken().catch((function(){throw hn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(H),c={orderId:n||"",transId:t||"",appId:o},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw hn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err,msg:l.msg},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ge({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Yu=function(){var t=Oe((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S,P,I,A,O;return Re(this,(function(k){switch(k.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},k.label=1;case 1:return k.trys.push([1,6,,7]),[4,_n.getAccessToken().catch((function(){throw hn.error.loginRequired}))];case 2:return h=k.sent(),f.headers.authorization="Bearer ".concat(h),[4,fetch(G,_a(Ge({method:"POST"},f),{body:l}))];case 3:return[4,k.sent().json()];case 4:if(!(m=k.sent()).data||0!==m.err)throw hn.error.badRequest(m.msg);return v=m.data.id,y=m.data.jwt,g=m.data.messageToken||"",_=window.APP_VERSION,w=window.APP_ENV,T={miniAppId:c,orderId:v},b=m.data.method,E=m.data.isCustom,y&&(T.token=y),_&&(T.version=_),w&&(T.env=w),b&&(T.method=b),E&&(T.isCustom=E),S=Ht.encode(T),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),I=on(),A=rn()&&I<742?"normal":"bottomSheet",Bt.enablePaymentDone=Ft.getInstance().eventNames().includes(e.Events.PaymentDone),[4,Ws(P,{style:A}).then((function(){var t=!1;Ft.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Oe((function(){var n;return Re(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Ft.getInstance().emit(e.Events.PaymentDone,v,{orderId:v}),[4,Qu({zmpOrderId:v})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Ft.getInstance().emit(e.Events.PaymentClose,n.err,_a(Ge({},n),{zmpOrderId:v})),r.label=2;case 2:return[2]}}))})),500)})),Ft.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Ft.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Bt.enablePaymentDone=!1}))}))];case 5:return k.sent(),[2,{orderId:v,messageToken:g}];case 6:throw O=k.sent(),console.log("Internal error"),O;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),$u=[Ti({amount:Fi.union([si(),ui()]),item:Fi.array(Fi.record(si(),Fi.any())),desc:Fi.string(),mac:Fi.string(),extradata:Fi.any().optional(),payload:Fi.any().optional(),method:Fi.union([Fi.string(),Fi.object({id:Fi.string(),isCustom:Fi.boolean()})]).optional()})];function Xu(e){return ec.apply(this,arguments)}function ec(){return ec=Oe((function(e){return Re(this,(function(t){return[2,xn("createOrder",$u,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Yu(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(We("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ec.apply(this,arguments)}var tc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),nc=function(){var e=Oe((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return Re(this,(function(g){switch(g.label){case 0:a=o,(s=new URLSearchParams).append("amount",e.toString()),s.append("appId",a),t&&s.append("desc",encodeURIComponent(t)),n&&s.append("method",n),r&&s.append("transId",r),i&&s.append("mac",i),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,_n.getAccessToken().catch((function(){throw hn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,_n.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=_n.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];g.label=4;case 4:return g.trys.push([4,6,,7]),[4,tc()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(K,_a(Ge({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw hn.error.badRequest(f.msg);return h=f.data.id,m=f.data.messageToken||"",v=f.data.transId||"",[2,{orderId:h,messageToken:m,transId:v}];case 10:throw y=g.sent(),console.log("Internal error"),y;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),rc=[Ti({amount:Fi.union([Fi.string(),Fi.number()]),desc:Fi.string(),method:Fi.string(),transId:Fi.string().optional(),mac:Fi.string().optional()})];function ic(e){return oc.apply(this,arguments)}function oc(){return oc=Oe((function(e){return Re(this,(function(t){return[2,xn("purchase",rc,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,nc(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(We("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oc.apply(this,arguments)}var ac=function(){var e=Oe((function(e,t){return Re(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;vn("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),sc=[Ti({channels:wi(Ti({method:si(),subMethod:si().optional(),subInfo:si().optional()})).optional(),selectedMethod:Ti({method:si(),subMethod:si().optional()}).optional()}).optional()];function uc(e){return cc.apply(this,arguments)}function cc(){return cc=Oe((function(e){return Re(this,(function(t){return[2,xn("selectPaymentMethod",sc,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?(t=e.channels,n=e.selectedMethod,[4,ac(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(We("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cc.apply(this,arguments)}var lc=[Ti({data:Fi.union([si(),Fi.record(si(),si().nullish())])})];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=Oe((function(e){return Re(this,(function(t){return[2,xn("checkTransaction",lc,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Qu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(We("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=function(){var t=Oe((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T;return Re(this,(function(b){switch(b.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===q&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===J&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Be())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Be())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,_n.getAccessToken().catch((function(){throw hn.error.loginRequired}))];case 2:return y=b.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(V,_a(Ge({method:"POST"},v),{body:f}))];case 3:return[4,b.sent().json()];case 4:if(!(g=b.sent()).data||!g.data.store||0!==g.err)throw hn.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){vn("IAP_REQUESTPAYMENT",Ge({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw T=b.sent(),console.log("Internal error"),T;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),hc=[Ti({productId:si(),payType:Fi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Fi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:si().optional(),method:Fi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:si().optional()})];function mc(e){return vc.apply(this,arguments)}function vc(){return vc=Oe((function(e){return Re(this,(function(t){return[2,xn("createOrderIAP",hc,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,fc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(We("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vc.apply(this,arguments)}var yc=[Ti({hide:di().default(!1).optional()}).optional()];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=Oe((function(e){return Re(this,(function(t){return[2,xn("setAndroidBottomNavigationBar",yc,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Vi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}var wc=[Ti({hide:di().default(!1).optional()}).optional()];function Tc(e){return bc.apply(this,arguments)}function bc(){return bc=Oe((function(e){return Re(this,(function(t){return[2,xn("setIOSBottomSafeArea",wc,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Vi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bc.apply(this,arguments)}var Ec=[Ti({type:Fi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Fi.string().optional()}).optional()];function Sc(e){return Pc.apply(this,arguments)}function Pc(){return Pc=Oe((function(e){return Re(this,(function(t){return[2,xn("setStatusBar",Ec,[e],function(){var e=Oe((function(e){return Re(this,(function(t){switch(t.label){case 0:return Ze.isMp?[4,Vi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}var Ic=[Ti({headerTextColor:Fi.enum(["black","white"]).optional(),headerColor:Fi.string().optional(),actionBar:Ti({hide:Fi.boolean().optional(),title:Fi.string().optional(),leftButton:Fi.enum(["back","none"]).optional(),textAlign:Fi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Fi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Fi.boolean().optional(),hideIOSSafeAreaBottom:Fi.boolean().optional()})];function Ac(e){return Oc.apply(this,arguments)}function Oc(){return Oc=Oe((function(e){return Re(this,(function(t){return[2,xn("configAppView",Ic,[e],function(){var e=Oe((function(e){var t,n,r,i,o,a,s;return Re(this,(function(u){switch(u.label){case 0:return Ze.isMp?At.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Vi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return At.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,Vi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Vi.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,Vi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Vi.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oc.apply(this,arguments)}var kc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Cc(e){return Nc.apply(this,arguments)}function Nc(){return(Nc=Oe((function(e){return Re(this,(function(t){return[2,xn("minimizeApp",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,kc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Mc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Rc(e){return xc.apply(this,arguments)}function xc(){return(xc=Oe((function(e){return Re(this,(function(t){return[2,xn("openPermissionSetting",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Mc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Dc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Uc(e){return Lc.apply(this,arguments)}function Lc(){return(Lc=Oe((function(e){return Re(this,(function(t){return[2,xn("favoriteApp",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var jc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=Oe((function(e){return Re(this,(function(t){return[2,xn("openGroupList",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,jc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var zc=Oe((function(){var e;return Re(this,(function(t){switch(t.label){case 0:return[4,_n.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){vn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Wc(e){return Fc.apply(this,arguments)}function Fc(){return(Fc=Oe((function(e){return Re(this,(function(t){return[2,xn("requestSendNotification",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,zc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Gc=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Vc(e){return Hc.apply(this,arguments)}function Hc(){return(Hc=Oe((function(e){return Re(this,(function(t){return[2,xn("addRating",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Gc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Kc,Jc=(Kc=Oe((function(e,t,n){var r,i;return Re(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,Ge({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Kc.apply(this,arguments)}),qc=function(){var e=Oe((function(e){return Re(this,(function(t){return[2,new Promise((function(t,n){vn("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Qc=[Ti({oaId:si()})];function Yc(e){return $c.apply(this,arguments)}function $c(){return $c=Oe((function(e){return Re(this,(function(t){return[2,xn("interactOA",Qc,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(i){switch(i.label){case 0:return Ze.isMp?(t=e.oaId,[4,_n.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||At.isEmpty(n)?[3,3]:[4,Jc(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,qc(t)];case 4:return[2,i.sent()];case 5:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$c.apply(this,arguments)}var Xc=[Ti({oaId:si()})];function el(e){return tl.apply(this,arguments)}function tl(){return tl=Oe((function(e){return Re(this,(function(t){return[2,xn("isAllowedInteractWithOA",Xc,[e],function(){var e=Oe((function(e){var t,n,r;return Re(this,(function(i){switch(i.label){case 0:return Ze.isMp?(t=e.oaId,[4,_n.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||At.isEmpty(n)?[3,3]:[4,Jc(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Ze.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(We("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tl.apply(this,arguments)}function nl(e){return rl.apply(this,arguments)}function rl(){return(rl=Oe((function(e){return Re(this,(function(t){return[2,xn("getSetting",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,pn()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(We("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var il=Fi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),ol=[Ti({scopes:Fi.array(il).max(2).optional()}).optional()];function al(e){return sl.apply(this,arguments)}function sl(){return sl=Oe((function(e){return Re(this,(function(t){return[2,xn("authorize",ol,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=null==e?void 0:e.scopes,an(724,573)?[2,Promise.reject(hn.error.clientNotSupport())]:[4,yn(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),sl.apply(this,arguments)}var ul=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n;return Re(this,(function(r){switch(r.label){case 0:return At.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(hn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function cl(e){return xn("checkZaloCameraPermission",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return[4,ul()];case 1:return[2,e.sent()]}}))})))}var ll=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n,r,i;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,_n.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=_n.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function dl(e){return pl.apply(this,arguments)}function pl(){return(pl=Oe((function(e){return Re(this,(function(t){return[2,xn("getUserID",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,ll()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(We("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var fl=Oe((function(){return Re(this,(function(e){return[2,new Promise(function(){var e=Oe((function(e,t){var n,r,i;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,_n.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=_n.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function hl(e){return ml.apply(this,arguments)}function ml(){return(ml=Oe((function(e){return Re(this,(function(t){return[2,xn("getIDToken",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,fl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(We("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var vl={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},yl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},gl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Ot(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Ft.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:yl.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:yl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:yl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:yl.video}var n=t.prototype;return n.on=function(t,n){Ft.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Ft.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return Oe((function(){var n,r,i,o,a,s;return Re(this,(function(u){switch(u.label){case 0:return At.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||yl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||yl.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return Oe((function(){var n,r;return Re(this,(function(i){return n=Ft.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=Oe((function(n,r){var i;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Ft.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return Oe((function(){return Re(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=Oe((function(n){return Re(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return Oe((function(){return Re(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return Oe((function(){return Re(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Ft.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||vl.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),_l=Ti({play:Fi.function(),pause:Fi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),wl=[Ti({videoElement:_l,mediaConstraints:Fi.object({width:Fi.number().min(100).optional(),height:Fi.number().min(100).optional(),facingMode:Fi.string().optional(),audio:Fi.boolean().optional(),video:Fi.boolean().optional(),deviceId:Fi.string().optional(),mirrored:Fi.boolean().optional()}).nullish()}).optional()];function Tl(e){return xn("createCameraContext",wl,[e],(function(e){return new gl(e.videoElement,e.mediaConstraints)}))}var bl=function(){function e(){var t,n;Ot(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Me(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;At.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?At.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?At.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function El(e){return Sl.apply(this,arguments)}function Sl(){return(Sl=Oe((function(e){return Re(this,(function(t){return[2,xn("setupAd",[],[e],(function(){return bl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Pl=[Ti({ids:Fi.union([Fi.string(),Fi.array(Fi.string())]),config:Ti({display:Fi.boolean().optional(),onClose:Fi.function().optional()}).optional()})];function Il(e){return Al.apply(this,arguments)}function Al(){return Al=Oe((function(e){return Re(this,(function(t){return[2,xn("loadAd",Pl,[e],function(){var e=Oe((function(e){return Re(this,(function(t){return bl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Al.apply(this,arguments)}var Ol=[Ti({id:Fi.string()})];function kl(e){return Cl.apply(this,arguments)}function Cl(){return Cl=Oe((function(e){return Re(this,(function(t){return[2,xn("displayAd",Ol,[e],function(){var e=Oe((function(e){return Re(this,(function(t){return bl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cl.apply(this,arguments)}var Nl=[Ti({id:Fi.string().optional()}).optional()];function Ml(e){return Rl.apply(this,arguments)}function Rl(){return Rl=Oe((function(e){return Re(this,(function(t){return[2,xn("refreshAd",Nl,[e],function(){var e=Oe((function(e){return Re(this,(function(t){return bl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rl.apply(this,arguments)}var xl=[Ti({id:si(),guidingText:si().optional(),color:si().optional(),onStatusChange:Fi.function().optional(),onError:Fi.function().optional()}).catchall(Fi.any())];function Dl(e){return Ul.apply(this,arguments)}function Ul(){return Ul=Oe((function(e){return Re(this,(function(n){return[2,xn("showOAWidget",xl,[e],function(){var e=Oe((function(e){var n,r,i,o,a,s,u,c;return Re(this,(function(l){if(Ze.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAF-".concat(e.id,"-").concat(Date.now()),(c=new URL(Ie.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ve(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=Oe((function(e){var t,n,i,o,a,s,l,d;return Re(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Pe)?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,_n.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=_n.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Pe),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?da(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ul.apply(this,arguments)}var Ll=[Fi.object({id:Fi.string(),type:Fi.string(),text:Fi.string(),color:Fi.string().optional(),disabled:Fi.boolean().optional(),onDataReceived:Fi.function().optional(),onError:Fi.function().optional()}).catchall(Fi.any())];function jl(e){return Bl.apply(this,arguments)}function Bl(){return Bl=Oe((function(e){return Re(this,(function(n){return[2,xn("showFunctionButtonWidget",Ll,[e],function(){var e=Oe((function(e){var n,r,i,o,a,s,u;return Re(this,(function(c){if(Ze.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").concat(Date.now()),(u=new URL(Ie.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=Ve(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=Ve(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=Oe((function(e){var t,n,a,c,l,d,p,f,h,m,v,y,g;return Re(this,(function(_){switch(_.label){case 0:return t=e.data,e.origin.startsWith(Pe)?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,_n.jumpAndGetToken()]):[3,4];case 1:return _.sent(),f=null===(l=_n.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=_n.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Ln()];case 2:return m=_.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Pe),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(y={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Pe)}},null==r||r.apply(void 0,Me(Object.values(v)).concat([y]))):"onError"===a&&(null==(g=t.payload)?void 0:g.type)===o.type&&(null==i||i(null==g?void 0:g.data)),_.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bl.apply(this,arguments)}var Zl=function(){var t=Oe((function(t,n){var r;return Re(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){vn("SCAN_NFC",{type:e.ScanNFCType[t],data:r},{success:function(e){if("cccd"===t){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,S={dg1:null!==(r=e.dg1)&&void 0!==r?r:"",dg2:null!==(i=e.dg2)&&void 0!==i?i:"",dg3:null!==(o=e.dg3)&&void 0!==o?o:"",dg4:null!==(a=e.dg4)&&void 0!==a?a:"",dg5:null!==(s=e.dg5)&&void 0!==s?s:"",dg6:null!==(u=e.dg6)&&void 0!==u?u:"",dg7:null!==(c=e.dg7)&&void 0!==c?c:"",dg8:null!==(l=e.dg8)&&void 0!==l?l:"",dg9:null!==(d=e.dg9)&&void 0!==d?d:"",dg10:null!==(p=e.dg10)&&void 0!==p?p:"",dg11:null!==(f=e.dg11)&&void 0!==f?f:"",dg12:null!==(h=e.dg12)&&void 0!==h?h:"",dg13:null!==(m=e.dg13)&&void 0!==m?m:"",dg14:null!==(v=e.dg14)&&void 0!==v?v:"",dg15:null!==(y=e.dg15)&&void 0!==y?y:"",dg16:null!==(g=e.dg16)&&void 0!==g?g:"",com:null!==(_=e.com)&&void 0!==_?_:"",sod:null!==(w=e.sod)&&void 0!==w?w:"",challenge:null!==(T=e.challenge)&&void 0!==T?T:"",aAResult:null!==(b=e.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(E=e.eACCAResult)&&void 0!==E?E:""};n(S)}else n({})},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),zl=[Ti({type:Fi.enum(["cccd"]),data:Ti({mrz:si().max(90)})})];function Wl(e){return Fl.apply(this,arguments)}function Fl(){return Fl=Oe((function(e){return Re(this,(function(t){return[2,xn("scanNFC",zl,[e],function(){var e=Oe((function(e){var t,n;return Re(this,(function(r){switch(r.label){case 0:return Ze.isMp?an(754,620)?[2,Promise.reject(hn.error.clientNotSupport())]:(t=e.type,n=e.data,[4,Zl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fl.apply(this,arguments)}var Gl=Oe((function(){return Re(this,(function(e){return[2,new Promise((function(e,t){vn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function Vl(e){return Hl.apply(this,arguments)}function Hl(){return(Hl=Oe((function(e){return Re(this,(function(t){return[2,xn("checkNFC",[],[e],Oe((function(){return Re(this,(function(e){switch(e.label){case 0:return Ze.isMp?[4,Gl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(We("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var Kl=[Fi.string().trim().min(1)];var Jl=[Fi.string().trim().min(1),Fi.string().trim()];var ql=[Fi.string().trim().min(1)];var Ql={getItem:function(e){return xn("getItem",Kl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ze.isMp||Ze.isMpWeb){if(an(757,625))throw hn.error.clientNotSupport();return So.getItem(t[0])}throw We("getItem",{})}))},setItem:function(e,t){return xn("setItem",Jl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ze.isMp||Ze.isMpWeb){if(an(757,625))throw hn.error.clientNotSupport();return So.setItem(t[0],t[1])}throw We("setItem",{})}))},clear:function(){return xn("clear",[],[],(function(){if(Ze.isMp||Ze.isMpWeb){if(an(757,625))throw hn.error.clientNotSupport();return So.clearStorageSync()}throw We("clear",{})}))},removeItem:function(e){return xn("removeItem",ql,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(Ze.isMp||Ze.isMpWeb){if(an(757,625))throw hn.error.clientNotSupport();return So.removeItem(t[0])}throw We("removeItem",{})}))},getStorageInfo:function(){return xn("getStorageInfoSync",[],[],(function(){if(Ze.isMp||Ze.isMpWeb){if(an(757,625))throw hn.error.clientNotSupport();return So.getStorageInfoSync()}throw We("getStorageInfoSync",{})}))}},Yl={purchase:ic,createOrder:Xu,checkTransaction:dc,createOrderIAP:mc,selectPaymentMethod:uc},$l=Yl,Xl=function(){var e=Oe((function(e,t){return Re(this,(function(n){return[2,new Promise((function(n,r){vn("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ed=[Ti({url:Fi.string().url()}).optional()];function td(e){return nd.apply(this,arguments)}function nd(){return nd=Oe((function(e){return Re(this,(function(t){return[2,xn("downloadFile",ed,[e],function(){var e=Oe((function(e){var t;return Re(this,(function(n){switch(n.label){case 0:return Ze.isMp?(t=e.url,[4,Xl(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nd.apply(this,arguments)}var rd=Fi.enum(["APP_INITIALIZING","APP_READY"]),id=Fi.any();var od={logEvent:function(e,t){return xn("logEvent",[rd,id],[e,t],(function(e,t){if(Ze.isMp||Ze.isMpWeb){var n,r,i,o=_a(Ge({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),tn([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Ge({eventType:e},o)}])}throw We("logEvent",{})}))}},ad=[Ti({id:si(),textColor:Fi.string().optional(),fontSize:Fi.string().optional(),buttonHeight:Fi.string().optional(),buttonColor:Fi.string().optional(),buttonTextColor:Fi.string().optional(),buttonRadius:Fi.string().optional(),buttonText:Fi.string().optional(),checkboxBGColor:Fi.string().optional(),checkboxCheckmarkColor:Fi.string().optional(),onClick:Fi.function().optional(),onStatusChange:Fi.function().optional(),onError:Fi.function().optional()}).catchall(Fi.any())];function sd(e){return ud.apply(this,arguments)}function ud(){return ud=Oe((function(e){return Re(this,(function(n){return[2,xn("showCustomOAWidget",ad,[e],function(){var e=Oe((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return Re(this,(function(E){if(Ze.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAF-".concat(e.id,"-").concat(Date.now()),g=new URL(Ie.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=Ve(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),S=w,P=(new TextEncoder).encode(S),I=Array.from(P).map((function(e){return String.fromCharCode(e)})).join(""),T=btoa(I),b=encodeURIComponent(T),Rn(g.searchParams,"data",b),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.addEventListener("message",function(){var e=Oe((function(e){var t,n,r,i,o,a,s,u,c;return Re(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Pe)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,_n.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=_n.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Pe),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?da(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?(c={callAction:function(e,t){var r;null==n||null===(r=n.contentWindow)||void 0===r||r.postMessage({type:"context.callAction",payload:{actionName:e,actionData:t}},Pe)}},null==f||f.apply(void 0,Me(Object.values(t.payload)).concat([c]))):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}var S,P,I;return Ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(We("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ud.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:zn},Dn();var cd=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:cn,login:Dn,getAccessToken:Ln,getVersion:zn,getSystemInfo:Fn,setNavigationBarTitle:Ki,setNavigationBarColor:Qi,setNavigationBarLeftButton:Xi,setStorage:Io,getStorage:ko,getStorageInfo:No,removeStorage:xo,clearStorage:Lo,getUserInfo:zo,getNetworkType:Vo,onNetworkStatusChange:Jo,startBeaconDiscovery:Yo,stopBeaconDiscovery:ea,getBeacons:ra,closeApp:aa,scanQRCode:ca,openProfile:fa,openChat:ya,openPostFeed:ba,followOA:Ia,unfollowOA:Ca,openShareSheet:Da,requestCameraPermission:ja,createShortcut:Ga,openBioAuthentication:Ja,checkStateBioAuthentication:Ya,showToast:ts,hideKeyboard:is,openPhone:us,openSMS:ps,viewOAQr:vs,keepScreen:ws,onKeepScreen:bs,offKeepScreen:Ss,saveImageToGallery:Os,saveVideoToGallery:Ms,openMiniApp:Us,vibrate:Zs,openWebview:Gs,getRouteParams:Ks,getAppInfo:Js,sendDataToPreviousMiniApp:$s,getPhoneNumber:tu,openProfilePicker:ou,connectWifi:cu,openMediaPicker:fu,getShareableLink:vu,closeLoading:_u,requestUpdateZalo:Tu,onConfirmToExit:Pu,offConfirmToExit:Iu,getDeviceId:Au,getDeviceIdAsync:Ou,getContext:Cu,getContextAsync:Nu,getAuthCode:Ru,getZPIToken:Du,setAccessToken:ju,openOutApp:Zu,chooseImage:Fu,getLocation:Hu,onCallbackData:qu,createOrder:Xu,purchase:ic,selectPaymentMethod:uc,checkTransaction:dc,createOrderIAP:mc,events:Eu,setAndroidBottomNavigationBar:gc,setIOSBottomSafeArea:Tc,setStatusBar:Sc,configAppView:Ac,minimizeApp:Cc,openPermissionSetting:Rc,favoriteApp:Uc,openGroupList:Bc,requestSendNotification:Wc,addRating:Vc,interactOA:Yc,interactOa:Yc,isAllowedInteractWithOA:el,getSetting:nl,authorize:al,checkZaloCameraPermission:cl,getUserID:dl,getIDToken:hl,createCameraContext:Tl,setupAd:El,loadAd:Il,displayAd:kl,refreshAd:Ml,showOAWidget:Dl,showFunctionButtonWidget:jl,scanNFC:Wl,checkNFC:Vl,nativeStorage:Ql,Payment:Yl,CheckoutSDK:$l,downloadFile:td,trackingManager:od,showCustomOAWidget:sd,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:gl}),ld=t(cd,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Be())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,cd))}(),e.AppError=cn,e.CheckoutSDK=$l,e.EventName=e.Events,e.Payment=Yl,e.ZMACameraImp=gl,e.addRating=Vc,e.authorize=al,e.checkNFC=Vl,e.checkStateBioAuthentication=Ya,e.checkTransaction=dc,e.checkZaloCameraPermission=cl,e.chooseImage=Fu,e.clearStorage=Lo,e.closeApp=aa,e.closeLoading=_u,e.configAppView=Ac,e.connectWifi=cu,e.createCameraContext=Tl,e.createOrder=Xu,e.createOrderIAP=mc,e.createShortcut=Ga,e.default=ld,e.displayAd=kl,e.downloadFile=td,e.events=Eu,e.favoriteApp=Uc,e.followOA=Ia,e.getAccessToken=Ln,e.getAppInfo=Js,e.getAuthCode=Ru,e.getBeacons=ra,e.getContext=Cu,e.getContextAsync=Nu,e.getDeviceId=Au,e.getDeviceIdAsync=Ou,e.getIDToken=hl,e.getLocation=Hu,e.getNetworkType=Vo,e.getPhoneNumber=tu,e.getRouteParams=Ks,e.getSetting=nl,e.getShareableLink=vu,e.getStorage=ko,e.getStorageInfo=No,e.getSystemInfo=Fn,e.getUserID=dl,e.getUserInfo=zo,e.getVersion=zn,e.getZPIToken=Du,e.hideKeyboard=is,e.interactOA=Yc,e.interactOa=Yc,e.isAllowedInteractWithOA=el,e.keepScreen=ws,e.loadAd=Il,e.login=Dn,e.minimizeApp=Cc,e.nativeStorage=Ql,e.offConfirmToExit=Iu,e.offKeepScreen=Ss,e.onCallbackData=qu,e.onConfirmToExit=Pu,e.onKeepScreen=bs,e.onNetworkStatusChange=Jo,e.openBioAuthentication=Ja,e.openChat=ya,e.openGroupList=Bc,e.openMediaPicker=fu,e.openMiniApp=Us,e.openOutApp=Zu,e.openPermissionSetting=Rc,e.openPhone=us,e.openPostFeed=ba,e.openProfile=fa,e.openProfilePicker=ou,e.openSMS=ps,e.openShareSheet=Da,e.openWebview=Gs,e.purchase=ic,e.refreshAd=Ml,e.removeStorage=xo,e.requestCameraPermission=ja,e.requestSendNotification=Wc,e.requestUpdateZalo=Tu,e.saveImageToGallery=Os,e.saveVideoToGallery=Ms,e.scanNFC=Wl,e.scanQRCode=ca,e.selectPaymentMethod=uc,e.sendDataToPreviousMiniApp=$s,e.setAccessToken=ju,e.setAndroidBottomNavigationBar=gc,e.setIOSBottomSafeArea=Tc,e.setNavigationBarColor=Qi,e.setNavigationBarLeftButton=Xi,e.setNavigationBarTitle=Ki,e.setStatusBar=Sc,e.setStorage=Io,e.setupAd=El,e.showCustomOAWidget=sd,e.showFunctionButtonWidget=jl,e.showOAWidget=Dl,e.showToast=ts,e.startBeaconDiscovery=Yo,e.stopBeaconDiscovery=ea,e.trackingManager=od,e.unfollowOA=Ca,e.vibrate=Zs,e.viewOAQr=vs,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
24
|
+
***************************************************************************** */}((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})),Zt={enablePaymentDone:!1};function zt(e){var t=e.data;return{orderId:t.zmpOrderId||t.orderId,transId:t.appTransID||t.apptransid||t.transId}}var Wt="ACTION_CALLBACK";function Ft(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:zt(r)}];break;default:return[{eventName:t,eventId:n,data:r}]}}var Gt=function(t){Ut(r,t);var n=jt(r);function r(){var e;return Ct(this,r),(e=n.apply(this,arguments)).debug=bt("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===Wt||t===e.Events.PaymentCallback)return xt(Mt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return xt(Mt(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===Wt)return xt(Mt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return xt(Mt(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}(Bt);function Vt(e){Gt.getInstance().emit(Wt,e)}function Ht(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){Vt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=bt("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=Pn(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=Ft(n,t,s,Zt);null==u||u.forEach((function(e){Gt.getInstance().emit(e.eventName,e.eventId,e.data);var t=document.getElementById(Se);t&&Dn(t,"appEvent",{eventName:e.eventName,eventId:e.eventId,data:e.data})}))}},window.zaloNative2JS={nativeCall:function(t,n,r){Gt.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Kt={encode:Ht,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:Ht(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":Tt(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":Tt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Jt={},qt=function(e,t,n){var r=t||"default";return function(){return(r in Jt?Jt[r](e,n):e).apply(this,arguments)}};qt.setWrapper=function(e){Jt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Qt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Yt(e){try{return null===e?Qt:JSON.parse(e)}catch(e){return Qt}}var $t,Xt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Kt.encode(n);"post"!=t&&(e=Kt.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=qt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=qt((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(Yt(e.responseText))},o.onerror=function(e){e.responseText?r(Yt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},en=Xt,tn=($t=Ce((function(e,t,n){var r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Ot.isUndefined(n)||(r.currentVersion=n),i=Kt.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}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return $t.apply(this,arguments)});function nn(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));en.execute(d.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){}))}catch(e){}}var rn=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},on=function(){var e;return"android"===((null===(e=Ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()},an=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=Ze())||void 0===t?void 0:t.zaloVersion)||"");if(n>=24112e3)e=n;else{var r,i=((null===(r=Ze())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return e},sn=function(e,t){var n=an();return on()&&n<e||function(){var e;return"ios"===((null===(e=Ze())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function un(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var cn,ln=function(){function e(t,n,r,i){Ct(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}(),dn=function(e,t){return un(e,ln)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return un(e,Error)?new ln(m,e.message,t).toJSON():Ot.isEmpty(null==e?void 0:e.message)||Ot.isEmpty(null==e?void 0:e.code)?new ln(m,A,t,e).toJSON():new ln(e.code,e.message,t,e.detail).toJSON()}(e,t)},pn=(cn=Ce((function(e){var t;return xe(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,Ve({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return cn.apply(this,arguments)}),fn=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,wn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=wn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new ln(g,k,"getSetting")),[4,pn(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new ln(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)}}())]}))})),hn=function(){var t,n,r,i=Ze(),o={},a=Gt.getInstance(),s=[],u=!1;return u||(n=function(t){var n=t.serialId,r=Sn(t.result),i=Cn(null==r?void 0:r.action),u=Ot.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?void 0:r.data);u=Ot.isEmpty(null==d?void 0:d.error_code)?0:null==d?void 0:d.error_code,c=null==d?void 0:d.error_message,l=(null==d?void 0:d.data)||d}var p={error_code:u,error_message:c,data:l,action:(null==r?void 0:r.action)||t.actionName};if(n&&o[n]){var f=o[n],h=f.callback,m=f.timeout,v=f.isMultiCallback,y=f.options,g=f.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Ot.isFunction(r)&&r(e):Ot.isFunction(i)&&i(e)}(p,h),!v&&delete o[n],m&&clearTimeout(m);var _={action:null==p?void 0:p.action,error:null==p?void 0:p.error_code,message:null==p?void 0:p.error_message,data:{}};try{if("action.open.inapp"===p.action||"action.open.outapp"===p.action){var w=new URL(null==y?void 0:y.url),T="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:T}}if("action.follow.oa"===p.action||"action.unfollow.oa"===p.action){var b=null==y?void 0:y.uid;_.data={uid:b}}if("action.open.chat"===p.action){var E=null==y?void 0:y.uId,P=null==y?void 0:y.type;_.data={uid:E,openChatType:P}}(null==y?void 0:y.onProgress)&&g&&a.off(e.Events.DownloadProgress,g)}catch(e){}s.push(_)}},Gt.getInstance().on(Wt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],nn(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],nn(e)}}),5e3),u=!0),r=Ce((function(t,n,r,s){var u,c,l,d,p,f,h,m,v,y,T,b,E,P,S,I,A,O,k,N,x,D,U;return xe(this,(function(L){switch(L.label){case 0:return c=Math.floor(1e6*Math.random()),l="".concat(t,"_").concat(c),d=Rn(t),(null==s?void 0:s.actionName)&&s.actionName.length>0&&(d=null==s?void 0:s.actionName),p=(null==s?void 0:s.isMultiCallback)||!1,f=!1!==(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)||!0),h=(null==s?void 0:s.haveCallback)||!1,m=(null==s?void 0:s.skipJump)||!1,v=(null==s?void 0:s.requireAccessToken)||!1,y=kn(d),n&&r&&(o[l]={options:n,callback:r,isMultiCallback:p},f&&h&&(o[l].timeout=setTimeout((function(){return Vt({serialId:l,result:{error_code:w,error_message:C,data:{timeout:f},action:t}}),null}),!0===f?8e3:1e3*f))),y?[4,fn()]:[3,2];case 1:if(!1===(null==(b=L.sent())||null===(T=b.authSetting)||void 0===T?void 0:T["scope.userInfo"]))return Vt({serialId:l,result:{error_code:g,error_message:R,data:{isMobile:null==i||null===(E=i.platform)||void 0===E?void 0:E.isMobile},action:t}}),[2];L.label=2;case 2:return P=Cn(d),!(null==i||null===(u=i.platform)||void 0===u?void 0:u.isMobile)||!t||Ot.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!En(t)||P&&!1===P.isSupported?(Vt({serialId:l,result:{error_code:_,error_message:M,data:{isMobile:null==i||null===(S=i.platform)||void 0===S?void 0:S.isMobile},action:t}}),[2]):(I=bn(n),m?[3,4]:[4,wn.getJSAccessToken()]);case 3:return O=L.sent(),[3,5];case 4:O="",L.label=5;case 5:A=O,L.label=6;case 6:return L.trys.push([6,10,,11]),m||!v?[3,8]:[4,wn.getAccessToken()];case 7:return N=L.sent(),[3,9];case 8:N="",L.label=9;case 9:return k=N,[3,11];case 10:return x=L.sent(),Vt({serialId:l,result:{error_code:null==x?void 0:x.code,error_message:null==x?void 0:x.message,action:t}}),[2];case 11:try{n&&(null==n?void 0:n.onProgress)&&(D=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==n?void 0:n.onProgress)},o[l].downloadListener=D,a.on(e.Events.DownloadProgress,D))}catch(e){}return U=i.platform.isIOS?window.onNativeMessage(l,d):'window.onNativeMessage("'.concat(l,'", "').concat(d,'")'),[2,ZaloJavaScriptInterface.jsCall(A,d,k,I,U)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),mn={success:function(e,t){return{code:h,message:t||I,data:e||{}}},error:{failLimit:function(){return new ln(T,O)},badRequest:function(e){return new ln(v,e)},loginFailed:function(e){return new ln(g,"".concat(N,": ").concat(e))},loginRequired:function(){return new ln(g,k)},cannotGetShareInfo:function(){return new ln(y,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(te).find((function(t){return t===e.toString()}));return new ln(e,t||A)},clientNotSupport:function(){return new ln(_,M)}}},vn=function(t){var n,r,i,o=null===(n=Ze())||void 0===n?void 0:n.platformName,a=Mn(t.action),s=Z[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new ln(m,"Can not get auth code: ".concat(t.error_message));if(wn.jumpStatus!==e.JumpStatus.DONE&&!u)return new ln(j.UNAUTHORIZED.code,j.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new ln(j.FORBIDDEN.code,j.FORBIDDEN.message);if(o&&(null===(r=z[o])||void 0===r?void 0:r[t.error_code]))return new ln(z[o][t.error_code].code,z[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;if(null==l?void 0:l.needMoreDetail)h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message);return new ln(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new ln(t.error_code,t.error_message)},yn=function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=Ot.isEmpty(t)?void 0:t[r];if(o)return We({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?vn(i):null==i?void 0:i.data)}}return Ot.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=Z[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){hn(e,t,o,Ve({},i,a))}),s)},gn=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Ot.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),_n=function(){function t(){Ct(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={},this.retryLimitMap={}}var r,a,u,c=t.prototype;return c.initRetryLimit=function(e){var t=B[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},c.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},c.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},c.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},c.jump=function(){var t=this;return Ce((function(){return xe(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,We({stage:n.REQUEST,type:"log",name:"jump"}),hn("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||nn([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){nn([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return Ce((function(){var i;return xe(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=Ce((function(e){var t,n,i;return xe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return Ce((function(){var i,o;return xe(this,(function(a){switch(a.label){case 0:return(i=new URLSearchParams).append("app_id",e),i.append("code",t),i.append("code_verifier",n),Ot.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,Ve({method:"POST",body:i},o)).then(function(){var e=Ce((function(e){var t,n,i,o;return xe(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Ce((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(r.getAccessTokenCount<=1||r._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return xe(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(r=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):e?[4,t.verifyUserAuthorized()]:[3,4];case 3:return s=m.sent(),[3,5];case 4:s=!0,m.label=5;case 5:return a=s,t._accessToken.length>0&&n<t.accessTokenExpiresIn&&a?(r.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 7:if(c=m.sent(),d="zmp.getaccesstoken.fail",!a)throw r.getAccessTokenCount--,nn([{action:d,error:-104,message:"no user auth",data:{}}]),mn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),c?[4,t.loginZaloV4(o,u,c)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,u)];case 11:p=m.sent(),m.label=12;case 12:return[3,14];case 13:return f=m.sent(),p="",console.log("Can not get access token",f),nn([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return r.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(nn([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(mn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw r.getAccessTokenCount--,nn([{action:d,error:-102,message:"no oauth",data:{}}]),mn.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return Ce((function(){var t,n,r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return n=!0,[4,e.jumpAndGetToken()];case 1:if(s.sent(),!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,7];s.label=2;case 2:return s.trys.push([2,6,,7]),(r=Cn("action.mp.user.authorize"))&&r.isSupported?[4,fn()]:[3,5];case 3:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,5]:[4,gn()];case 4:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=5;case 5:return[3,7];case 6:return s.sent(),n=!1,[3,7];case 7:return[2,n]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return Ce((function(){var t;return xe(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=Ce((function(i){var o,a,s,u;return xe(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?Ot.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&kt(r.prototype,a),u&&kt(r,u),t}(),wn=_n.getInstance(),Tn=bt("zmp:utils:common"),bn=function(e){if(Ot.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=[];for(var n=e.length,r=0;r<n;r++)t.push(bn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+bn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},En=function(e){var t,n=Z[e],r=(null===(t=Ze())||void 0===t?void 0:t.zaloVersion)||0,i=n&&"object"==typeof n&&"versionLive"in n&&n.versionLive&&"iOS"in n.versionLive?n.versionLive.iOS:0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(r)>=i},Pn=function(e){try{if(e){Tn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return Tn("formattedValue",t,n,void 0===n?"undefined":Tt(n)),n}return null}catch(t){return Tn("parse json error:",t),e}},Sn=function(e){if(Ot.isObject(JSON)&&JSON.parse&&Ot.isString(e)){var t=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(t,(function(e,t){return t}))}return Ot.isObject(e)?e:new Function("return "+e)()},In=function(e){for(var t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)if(t[n].getAttribute("name")===e||t[n].getAttribute("property")===e)return t[n].getAttribute("content");return""},An=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var On=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},Cn=function(e){if(void 0!==e){var t=wn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},kn=function(e){if(void 0===e)return!1;var t=wn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Nn=function(){var e=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n;return xe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,wn.jumpAndGetToken()];case 1:return t.sent(),n=wn.miniProgramConfig,e(!0===(null==n?void 0:n.canUseAccessTokenByDefault)),[3,3];case 2:return t.sent(),e(!1),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));return function(){return e.apply(this,arguments)}}(),Mn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},Rn=function(e){return e.startsWith("action.")?e:"action.".concat(e.replace(/\_/g,".").toLowerCase())},xn=function(e,t,n){"string"==typeof n&&n.length>0?e.set(t,n):"object"!=typeof n||Array.isArray(n)||Object.entries(n).forEach((function(n){var r=He(n,2),i=r[0],o=r[1];null!=o&&""!==o&&e.set("".concat(t).concat(i),String(o))}))},Dn=function(e,t,n){var r;null===(r=e.contentWindow)||void 0===r||r.postMessage({type:t,payload:n},Ie)};function Un(e,t,n,r){var i,o;!function(e,t){if(B[e]){var n=wn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&wn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw dn(mn.error.failLimit(),e);wn.increaseRetryLimit(e)}}(e);var a=Array.isArray(n)&&n.length>0&&(null===(i=n[0])||void 0===i?void 0:i.success),s=Array.isArray(n)&&n.length>0&&(null===(o=n[0])||void 0===o?void 0:o.fail);try{var u=n;t.length>0&&t.forEach((function(t,r){var i=t.safeParse(n[r]);if(!i.success){var o,a=null===(o=i.error)||void 0===o?void 0:o.issues,s=a.map((function(e,t){var n=e.path.length>0?e.path.map((function(e,t){return t>0?"[".concat(e,"]"):e})).join(""):"arg";return"Error ".concat(t+1,": Code: ").concat(e.code," ~ Path: ").concat(n," ~ Message: ").concat(e.message)})).join(" | "),c=mn.error.badRequest(s);throw c.detail=a,dn(c,e)}u.push(i.data)}));var c=r.apply(void 0,Re(u));return Ot.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Ot.isNull(a)&&Ot.isFunction(a))return a(e);t(c)})).catch((function(t){var r=dn(t,e);if(!Ot.isNull(s)&&Ot.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Ot.isNull(s)&&Ot.isFunction(s))return s(t);throw dn(t,e)}}function Ln(e){return jn.apply(this,arguments)}function jn(){return(jn=Ce((function(e){return xe(this,(function(t){return[2,Un("login",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Fe("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Bn(e){return Zn.apply(this,arguments)}function Zn(){return(Zn=Ce((function(e){return xe(this,(function(t){return[2,Un("getAccessToken",[],[e],Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Nn()]:[3,3];case 1:return e=!t.sent(),[4,wn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return ze.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Fe("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var zn,Wn="2.47.0-beta.2";function Fn(){return Un("getVersion",[],[],(function(){return Wn}))}function Gn(){var e,t;return{version:In("version-id")||"",apiVersion:Wn,zaloVersion:(null===(e=Ze())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Ze())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Vn(){return Un("getSystemInfo",[],[],(function(){return Gn()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(zn||(zn={}));const Hn=zn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kn=e=>{switch(typeof e){case"undefined":return Hn.undefined;case"string":return Hn.string;case"number":return isNaN(e)?Hn.nan:Hn.number;case"boolean":return Hn.boolean;case"function":return Hn.function;case"bigint":return Hn.bigint;case"symbol":return Hn.symbol;case"object":return Array.isArray(e)?Hn.array:null===e?Hn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Hn.promise:"undefined"!=typeof Map&&e instanceof Map?Hn.map:"undefined"!=typeof Set&&e instanceof Set?Hn.set:"undefined"!=typeof Date&&e instanceof Date?Hn.date:Hn.object;default:return Hn.unknown}},Jn=zn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class qn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,zn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}qn.create=e=>new qn(e);const Qn=(e,t)=>{let n;switch(e.code){case Jn.invalid_type:n=e.received===Hn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Jn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,zn.jsonStringifyReplacer)}`;break;case Jn.unrecognized_keys:n=`Unrecognized key(s) in object: ${zn.joinValues(e.keys,", ")}`;break;case Jn.invalid_union:n="Invalid input";break;case Jn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${zn.joinValues(e.options)}`;break;case Jn.invalid_enum_value:n=`Invalid enum value. Expected ${zn.joinValues(e.options)}, received '${e.received}'`;break;case Jn.invalid_arguments:n="Invalid function arguments";break;case Jn.invalid_return_type:n="Invalid function return type";break;case Jn.invalid_date:n="Invalid date";break;case Jn.invalid_string:"object"==typeof e.validation?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:zn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Jn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:"Invalid input";break;case Jn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:"Invalid input";break;case Jn.custom:n="Invalid input";break;case Jn.invalid_intersection_types:n="Intersection results could not be merged";break;case Jn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Jn.not_finite:n="Number must be finite";break;default:n=t.defaultError,zn.assertNever(e)}return{message:n}};let Yn=Qn;function $n(){return Yn}const Xn=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const u=r.filter((e=>!!e)).slice().reverse();for(const e of u)s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function er(e,t){const n=Xn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,$n(),Qn].filter((e=>!!e))});e.common.issues.push(n)}class tr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return nr;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return tr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return nr;if("aborted"===i.status)return nr;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}const nr=Object.freeze({status:"aborted"}),rr=e=>({status:"dirty",value:e}),ir=e=>({status:"valid",value:e}),or=e=>"aborted"===e.status,ar=e=>"dirty"===e.status,sr=e=>"valid"===e.status,ur=e=>"undefined"!=typeof Promise&&e instanceof Promise;var cr;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(cr||(cr={}));class lr{constructor(e,t,n,r){this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._path.concat(this._key)}}const dr=(e,t)=>{if(sr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new qn(e.common.issues)}};function pr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:i}}class fr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Kn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tr,ctx:{common:e.parent.common,data:e.data,parsedType:Kn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ur(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return dr(r,i)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(ur(r)?r:Promise.resolve(r));return dr(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const i=e(t),o=()=>r.addIssue({code:Jn.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(o(),!1))):!!i||(o(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Yr({schema:this,typeName:ui.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return $r.create(this,this._def)}nullable(){return Xr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this,this._def)}promise(){return Qr.create(this,this._def)}or(e){return Dr.create([this,e],this._def)}and(e){return Br.create(this,e,this._def)}transform(e){return new Yr({...pr(this._def),schema:this,typeName:ui.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ei({...pr(this._def),innerType:this,defaultValue:t,typeName:ui.ZodDefault})}brand(){return new ii({typeName:ui.ZodBranded,type:this,...pr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ti({...pr(this._def),innerType:this,catchValue:t,typeName:ui.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return oi.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hr=/^c[^\s-]{8,}$/i,mr=/^[a-z][a-z0-9]*$/,vr=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,yr=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/;class gr extends fr{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Jn.invalid_string,...cr.errToObj(n)}),this.nonempty=e=>this.min(1,cr.errToObj(e)),this.trim=()=>new gr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Hn.string){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.string,received:t.parsedType}),nr}const t=new tr;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Jn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Jn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,o=e.data.length<i.value;(r||o)&&(n=this._getOrReturnCtx(e,n),r?er(n,{code:Jn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&er(n,{code:Jn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)yr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"email",code:Jn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)vr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"uuid",code:Jn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)hr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"cuid",code:Jn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)mr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"cuid2",code:Jn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),er(n,{validation:"url",code:Jn.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"regex",code:Jn.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),er(n,{code:Jn.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),er(n,{code:Jn.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){((r=i).precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):0===r.precision?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{code:Jn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else zn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new gr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...cr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...cr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...cr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...cr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...cr.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...cr.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...cr.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...cr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...cr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...cr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...cr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...cr.errToObj(t)})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function _r(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}gr.create=e=>{var t;return new gr({checks:[],typeName:ui.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...pr(e)})};class wr extends fr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==Hn.number){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.number,received:t.parsedType}),nr}let t;const n=new tr;for(const r of this._def.checks)if("int"===r.kind)zn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),er(t,{code:Jn.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Jn.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Jn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==_r(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Jn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),er(t,{code:Jn.not_finite,message:r.message}),n.dirty()):zn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,cr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,cr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,cr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,cr.toString(t))}setLimit(e,t,n,r){return new wr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:cr.toString(r)}]})}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:cr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:cr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:cr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:cr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:cr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:cr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:cr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&zn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}wr.create=e=>new wr({checks:[],typeName:ui.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...pr(e)});class Tr extends fr{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Hn.bigint){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.bigint,received:t.parsedType}),nr}return ir(e.data)}}Tr.create=e=>{var t;return new Tr({typeName:ui.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...pr(e)})};class br extends fr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Hn.boolean){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.boolean,received:t.parsedType}),nr}return ir(e.data)}}br.create=e=>new br({typeName:ui.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...pr(e)});class Er extends fr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Hn.date){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.date,received:t.parsedType}),nr}if(isNaN(e.data.getTime())){return er(this._getOrReturnCtx(e),{code:Jn.invalid_date}),nr}const t=new tr;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Jn.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Jn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):zn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:cr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:cr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Er.create=e=>new Er({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ui.ZodDate,...pr(e)});class Pr extends fr{_parse(e){if(this._getType(e)!==Hn.symbol){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.symbol,received:t.parsedType}),nr}return ir(e.data)}}Pr.create=e=>new Pr({typeName:ui.ZodSymbol,...pr(e)});class Sr extends fr{_parse(e){if(this._getType(e)!==Hn.undefined){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.undefined,received:t.parsedType}),nr}return ir(e.data)}}Sr.create=e=>new Sr({typeName:ui.ZodUndefined,...pr(e)});class Ir extends fr{_parse(e){if(this._getType(e)!==Hn.null){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.null,received:t.parsedType}),nr}return ir(e.data)}}Ir.create=e=>new Ir({typeName:ui.ZodNull,...pr(e)});class Ar extends fr{constructor(){super(...arguments),this._any=!0}_parse(e){return ir(e.data)}}Ar.create=e=>new Ar({typeName:ui.ZodAny,...pr(e)});class Or extends fr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ir(e.data)}}Or.create=e=>new Or({typeName:ui.ZodUnknown,...pr(e)});class Cr extends fr{_parse(e){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.never,received:t.parsedType}),nr}}Cr.create=e=>new Cr({typeName:ui.ZodNever,...pr(e)});class kr extends fr{_parse(e){if(this._getType(e)!==Hn.undefined){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.void,received:t.parsedType}),nr}return ir(e.data)}}kr.create=e=>new kr({typeName:ui.ZodVoid,...pr(e)});class Nr extends fr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Hn.array)return er(t,{code:Jn.invalid_type,expected:Hn.array,received:t.parsedType}),nr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(er(t,{code:e?Jn.too_big:Jn.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(er(t,{code:Jn.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(er(t,{code:Jn.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new lr(t,e,t.path,n))))).then((e=>tr.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new lr(t,e,t.path,n))));return tr.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Nr({...this._def,minLength:{value:e,message:cr.toString(t)}})}max(e,t){return new Nr({...this._def,maxLength:{value:e,message:cr.toString(t)}})}length(e,t){return new Nr({...this._def,exactLength:{value:e,message:cr.toString(t)}})}nonempty(e){return this.min(1,e)}}var Mr;function Rr(e){if(e instanceof xr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$r.create(Rr(r))}return new xr({...e._def,shape:()=>t})}return e instanceof Nr?Nr.create(Rr(e.element)):e instanceof $r?$r.create(Rr(e.unwrap())):e instanceof Xr?Xr.create(Rr(e.unwrap())):e instanceof Zr?Zr.create(e.items.map((e=>Rr(e)))):e}Nr.create=(e,t)=>new Nr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ui.ZodArray,...pr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Mr||(Mr={}));class xr extends fr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=zn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Hn.object){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.object,received:t.parsedType}),nr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Cr&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new lr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Cr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(er(n,{code:Jn.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new lr(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>tr.mergeObjectSync(t,e))):tr.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return cr.errToObj,new xr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,i,o,a;const s=null!==(o=null===(i=(r=this._def).errorMap)||void 0===i?void 0:i.call(r,t,n).message)&&void 0!==o?o:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=cr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new xr({...this._def,unknownKeys:"strip"})}passthrough(){return new xr({...this._def,unknownKeys:"passthrough"})}extend(e){return new xr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Mr.mergeShapes(this._def.shape(),e._def.shape()),typeName:ui.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new xr({...this._def,catchall:e})}pick(e){const t={};return zn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new xr({...this._def,shape:()=>t})}omit(e){const t={};return zn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new xr({...this._def,shape:()=>t})}deepPartial(){return Rr(this)}partial(e){const t={};return zn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new xr({...this._def,shape:()=>t})}required(e){const t={};return zn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof $r;)e=e._def.innerType;t[n]=e}})),new xr({...this._def,shape:()=>t})}keyof(){return Kr(zn.objectKeys(this.shape))}}xr.create=(e,t)=>new xr({shape:()=>e,unknownKeys:"strip",catchall:Cr.create(),typeName:ui.ZodObject,...pr(t)}),xr.strictCreate=(e,t)=>new xr({shape:()=>e,unknownKeys:"strict",catchall:Cr.create(),typeName:ui.ZodObject,...pr(t)}),xr.lazycreate=(e,t)=>new xr({shape:e,unknownKeys:"strip",catchall:Cr.create(),typeName:ui.ZodObject,...pr(t)});class Dr extends fr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new qn(e.ctx.common.issues)));return er(t,{code:Jn.invalid_union,unionErrors:n}),nr}));{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map((e=>new qn(e)));return er(t,{code:Jn.invalid_union,unionErrors:i}),nr}}get options(){return this._def.options}}Dr.create=(e,t)=>new Dr({options:e,typeName:ui.ZodUnion,...pr(t)});const Ur=e=>e instanceof Vr?Ur(e.schema):e instanceof Yr?Ur(e.innerType()):e instanceof Hr?[e.value]:e instanceof Jr?e.options:e instanceof qr?Object.keys(e.enum):e instanceof ei?Ur(e._def.innerType):e instanceof Sr?[void 0]:e instanceof Ir?[null]:null;class Lr extends fr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hn.object)return er(t,{code:Jn.invalid_type,expected:Hn.object,received:t.parsedType}),nr;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(er(t,{code:Jn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),nr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Ur(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new Lr({typeName:ui.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...pr(n)})}}function jr(e,t){const n=Kn(e),r=Kn(t);if(e===t)return{valid:!0,data:e};if(n===Hn.object&&r===Hn.object){const n=zn.objectKeys(t),r=zn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=jr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Hn.array&&r===Hn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=jr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Hn.date&&r===Hn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Br extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(or(e)||or(r))return nr;const i=jr(e.value,r.value);return i.valid?((ar(e)||ar(r))&&t.dirty(),{status:t.value,value:i.data}):(er(n,{code:Jn.invalid_intersection_types}),nr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Br.create=(e,t,n)=>new Br({left:e,right:t,typeName:ui.ZodIntersection,...pr(n)});class Zr extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hn.array)return er(n,{code:Jn.invalid_type,expected:Hn.array,received:n.parsedType}),nr;if(n.data.length<this._def.items.length)return er(n,{code:Jn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nr;!this._def.rest&&n.data.length>this._def.items.length&&(er(n,{code:Jn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new lr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>tr.mergeArray(t,e))):tr.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Zr({...this._def,rest:e})}}Zr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zr({items:e,typeName:ui.ZodTuple,rest:null,...pr(t)})};class zr extends fr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hn.object)return er(n,{code:Jn.invalid_type,expected:Hn.object,received:n.parsedType}),nr;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new lr(n,e,n.path,e)),value:o._parse(new lr(n,n.data[e],n.path,e))});return n.common.async?tr.mergeObjectAsync(t,r):tr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new zr(t instanceof fr?{keyType:e,valueType:t,typeName:ui.ZodRecord,...pr(n)}:{keyType:gr.create(),valueType:e,typeName:ui.ZodRecord,...pr(t)})}}class Wr extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hn.map)return er(n,{code:Jn.invalid_type,expected:Hn.map,received:n.parsedType}),nr;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new lr(n,e,n.path,[o,"key"])),value:i._parse(new lr(n,t,n.path,[o,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of o){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return nr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of o){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return nr;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Wr.create=(e,t,n)=>new Wr({valueType:t,keyType:e,typeName:ui.ZodMap,...pr(n)});class Fr extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Hn.set)return er(n,{code:Jn.invalid_type,expected:Hn.set,received:n.parsedType}),nr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(er(n,{code:Jn.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(er(n,{code:Jn.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const n=new Set;for(const r of e){if("aborted"===r.status)return nr;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map(((e,t)=>i._parse(new lr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Fr({...this._def,minSize:{value:e,message:cr.toString(t)}})}max(e,t){return new Fr({...this._def,maxSize:{value:e,message:cr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Fr.create=(e,t)=>new Fr({valueType:e,minSize:null,maxSize:null,typeName:ui.ZodSet,...pr(t)});class Gr extends fr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hn.function)return er(t,{code:Jn.invalid_type,expected:Hn.function,received:t.parsedType}),nr;function n(e,n){return Xn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$n(),Qn].filter((e=>!!e)),issueData:{code:Jn.invalid_arguments,argumentsError:n}})}function r(e,n){return Xn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$n(),Qn].filter((e=>!!e)),issueData:{code:Jn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Qr?ir((async(...e)=>{const t=new qn([]),a=await this._def.args.parseAsync(e,i).catch((r=>{throw t.addIssue(n(e,r)),t})),s=await o(...a);return await this._def.returns._def.type.parseAsync(s,i).catch((e=>{throw t.addIssue(r(s,e)),t}))})):ir(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new qn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new qn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Gr({...this._def,args:Zr.create(e).rest(Or.create())})}returns(e){return new Gr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Gr({args:e||Zr.create([]).rest(Or.create()),returns:t||Or.create(),typeName:ui.ZodFunction,...pr(n)})}}class Vr extends fr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Vr.create=(e,t)=>new Vr({getter:e,typeName:ui.ZodLazy,...pr(t)});class Hr extends fr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return er(t,{received:t.data,code:Jn.invalid_literal,expected:this._def.value}),nr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Kr(e,t){return new Jr({values:e,typeName:ui.ZodEnum,...pr(t)})}Hr.create=(e,t)=>new Hr({value:e,typeName:ui.ZodLiteral,...pr(t)});class Jr extends fr{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return er(t,{expected:zn.joinValues(n),received:t.parsedType,code:Jn.invalid_type}),nr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return er(t,{received:t.data,code:Jn.invalid_enum_value,options:n}),nr}return ir(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return Jr.create(e)}exclude(e){return Jr.create(this.options.filter((t=>!e.includes(t))))}}Jr.create=Kr;class qr extends fr{_parse(e){const t=zn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Hn.string&&n.parsedType!==Hn.number){const e=zn.objectValues(t);return er(n,{expected:zn.joinValues(e),received:n.parsedType,code:Jn.invalid_type}),nr}if(-1===t.indexOf(e.data)){const e=zn.objectValues(t);return er(n,{received:n.data,code:Jn.invalid_enum_value,options:e}),nr}return ir(e.data)}get enum(){return this._def.values}}qr.create=(e,t)=>new qr({values:e,typeName:ui.ZodNativeEnum,...pr(t)});class Qr extends fr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Hn.promise&&!1===t.common.async)return er(t,{code:Jn.invalid_type,expected:Hn.promise,received:t.parsedType}),nr;const n=t.parsedType===Hn.promise?t.data:Promise.resolve(t.data);return ir(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Qr.create=(e,t)=>new Qr({type:e,typeName:ui.ZodPromise,...pr(t)});class Yr extends fr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ui.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null;if("preprocess"===r.type){const e=r.transform(n.data);return n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}const i={addIssue:e=>{er(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?nr:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?nr:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!sr(e))return e;const o=r.transform(e.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>sr(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}zn.assertNever(r)}}Yr.create=(e,t,n)=>new Yr({schema:e,typeName:ui.ZodEffects,effect:t,...pr(n)}),Yr.createWithPreprocess=(e,t,n)=>new Yr({schema:t,effect:{type:"preprocess",transform:e},typeName:ui.ZodEffects,...pr(n)});class $r extends fr{_parse(e){return this._getType(e)===Hn.undefined?ir(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:ui.ZodOptional,...pr(t)});class Xr extends fr{_parse(e){return this._getType(e)===Hn.null?ir(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xr.create=(e,t)=>new Xr({innerType:e,typeName:ui.ZodNullable,...pr(t)});class ei extends fr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Hn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ei.create=(e,t)=>new ei({innerType:e,typeName:ui.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...pr(t)});class ti extends fr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return ur(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue()}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}ti.create=(e,t)=>new ti({innerType:e,typeName:ui.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...pr(t)});class ni extends fr{_parse(e){if(this._getType(e)!==Hn.nan){const t=this._getOrReturnCtx(e);return er(t,{code:Jn.invalid_type,expected:Hn.nan,received:t.parsedType}),nr}return{status:"valid",value:e.data}}}ni.create=e=>new ni({typeName:ui.ZodNaN,...pr(e)});const ri=Symbol("zod_brand");class ii extends fr{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class oi extends fr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?nr:"dirty"===e.status?(t.dirty(),rr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?nr:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new oi({in:e,out:t,typeName:ui.ZodPipeline})}}const ai=(e,t={},n)=>e?Ar.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):Ar.create(),si={object:xr.lazycreate};var ui;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"}(ui||(ui={}));const ci=gr.create,li=wr.create,di=ni.create,pi=Tr.create,fi=br.create,hi=Er.create,mi=Pr.create,vi=Sr.create,yi=Ir.create,gi=Ar.create,_i=Or.create,wi=Cr.create,Ti=kr.create,bi=Nr.create,Ei=xr.create,Pi=xr.strictCreate,Si=Dr.create,Ii=Lr.create,Ai=Br.create,Oi=Zr.create,Ci=zr.create,ki=Wr.create,Ni=Fr.create,Mi=Gr.create,Ri=Vr.create,xi=Hr.create,Di=Jr.create,Ui=qr.create,Li=Qr.create,ji=Yr.create,Bi=$r.create,Zi=Xr.create,zi=Yr.createWithPreprocess,Wi=oi.create,Fi={string:e=>gr.create({...e,coerce:!0}),number:e=>wr.create({...e,coerce:!0}),boolean:e=>br.create({...e,coerce:!0}),bigint:e=>Tr.create({...e,coerce:!0}),date:e=>Er.create({...e,coerce:!0})},Gi=nr;var Vi=Object.freeze({__proto__:null,defaultErrorMap:Qn,setErrorMap:function(e){Yn=e},getErrorMap:$n,makeIssue:Xn,EMPTY_PATH:[],addIssueToContext:er,ParseStatus:tr,INVALID:nr,DIRTY:rr,OK:ir,isAborted:or,isDirty:ar,isValid:sr,isAsync:ur,get util(){return zn},ZodParsedType:Hn,getParsedType:Kn,ZodType:fr,ZodString:gr,ZodNumber:wr,ZodBigInt:Tr,ZodBoolean:br,ZodDate:Er,ZodSymbol:Pr,ZodUndefined:Sr,ZodNull:Ir,ZodAny:Ar,ZodUnknown:Or,ZodNever:Cr,ZodVoid:kr,ZodArray:Nr,get objectUtil(){return Mr},ZodObject:xr,ZodUnion:Dr,ZodDiscriminatedUnion:Lr,ZodIntersection:Br,ZodTuple:Zr,ZodRecord:zr,ZodMap:Wr,ZodSet:Fr,ZodFunction:Gr,ZodLazy:Vr,ZodLiteral:Hr,ZodEnum:Jr,ZodNativeEnum:qr,ZodPromise:Qr,ZodEffects:Yr,ZodTransformer:Yr,ZodOptional:$r,ZodNullable:Xr,ZodDefault:ei,ZodCatch:ti,ZodNaN:ni,BRAND:ri,ZodBranded:ii,ZodPipeline:oi,custom:ai,Schema:fr,ZodSchema:fr,late:si,get ZodFirstPartyTypeKind(){return ui},coerce:Fi,any:gi,array:bi,bigint:pi,boolean:fi,date:hi,discriminatedUnion:Ii,effect:ji,enum:Di,function:Mi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ai((t=>t instanceof e),t,!0),intersection:Ai,lazy:Ri,literal:xi,map:ki,nan:di,nativeEnum:Ui,never:wi,null:yi,nullable:Zi,number:li,object:Ei,oboolean:()=>fi().optional(),onumber:()=>li().optional(),optional:Bi,ostring:()=>ci().optional(),pipeline:Wi,preprocess:zi,promise:Li,record:Ci,set:Ni,strictObject:Pi,string:ci,symbol:mi,transformer:ji,tuple:Oi,undefined:vi,union:Si,unknown:_i,void:Ti,NEVER:Gi,ZodIssueCode:Jn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:qn}),Hi=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O,C;Ct(this,t),this.initConfig=window.APP_CONFIG;var k=Ot.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?Y:$;this.hideIOSSafeAreaBottom=!!(null===(u=this.initConfig)||void 0===u||null===(c=u.app)||void 0===c?void 0:c.hideIOSSafeAreaBottom),this.hideAndroidBottomNavigationBar=!!(null===(l=this.initConfig)||void 0===l||null===(d=l.app)||void 0===d?void 0:d.hideAndroidBottomNavigationBar);var N,M,R="none"===(null===(p=this.initConfig)||void 0===p||null===(f=p.app)||void 0===f?void 0:f.leftButton)||"home"===(null===(h=this.initConfig)||void 0===h||null===(m=h.app)||void 0===m?void 0:m.leftButton)?Q.HIDE_BACK:Q.SHOW_BACK,x="home"===(null===(v=this.initConfig)||void 0===v||null===(y=v.app)||void 0===y?void 0:y.leftButton)||"both"===(null===(g=this.initConfig)||void 0===g||null===(_=g.app)||void 0===_?void 0:_.leftButton)?Q.SHOW_HOME:Q.HIDE_HOME,D=new URL(location.href),U=On(null===(w=this.initConfig)||void 0===w||null===(T=w.app)||void 0===T?void 0:T.statusBar);"boolean"==typeof(null===(b=this.initConfig)||void 0===b||null===(E=b.app)||void 0===E?void 0:E.actionBarHidden)&&(k=(null===(N=this.initConfig)||void 0===N||null===(M=N.app)||void 0===M?void 0:M.actionBarHidden)?$:Y);this.config={actionbarType:k,buttonType:R,statusbarType:U,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||X,textColor:(null===(I=this.initConfig)||void 0===I||null===(A=I.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(O=this.initConfig)||void 0===O||null===(C=O.app)||void 0===C?void 0:C.textAlign)||ee,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return Ce((function(){var r,i;return xe(this,(function(o){return void 0===(void 0===e?"undefined":Tt(e))&&null===(void 0===e?"undefined":Tt(e))||(r="none"===e||"home"===e?Q.HIDE_BACK:Q.SHOW_BACK,i="home"===e||"both"===e?Q.SHOW_HOME:Q.HIDE_HOME,n.config.buttonType=r,n.config.dataConfig.viewInLeftType=r,n.config.homeConfig.enable=i),n.config.dataConfig.confirmToExit=t,[2,new Promise((function(e,t){yn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ve({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return Ce((function(){var r,i,o;return xe(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Ze())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();yn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return Ce((function(){var r,i,o;return xe(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Ze())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();yn("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return Ce((function(){var r;return xe(this,(function(i){return r=n.config,Ot.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),Ot.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),Ot.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=$:!1===t.hideActionBar&&(r.actionbarType=Y),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){yn("CHANGE_ACTIONBAR",Ve({},r),{success:function(){var o;n.config=Ve({},r);var a,s=null===(o=Ze())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===$;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),Ki=Hi.getInstance(),Ji=[Ei({title:ci()}).optional()];function qi(e){return Qi.apply(this,arguments)}function Qi(){return Qi=Ce((function(e){return xe(this,(function(t){return[2,Un("setNavigationBarTitle",Ji,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qi.apply(this,arguments)}var Yi=[Ei({color:ci(),textColor:Vi.enum(["black","white"]).optional(),statusBarColor:ci().optional()}).optional()];function $i(e){return Xi.apply(this,arguments)}function Xi(){return Xi=Ce((function(e){return xe(this,(function(t){return[2,Un("setNavigationBarColor",Yi,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.configHeader({hideActionBar:!(e.color.length>0),headerTextColor:e.textColor,headerColor:e.color.length>0?e.color:e.statusBarColor})]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xi.apply(this,arguments)}var eo=[Ei({type:Vi.enum(["none","back","home","both"])}).optional()];function to(e){return no.apply(this,arguments)}function no(){return no=Ce((function(e){return xe(this,(function(t){return[2,Un("setNavigationBarLeftButton",eo,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),no.apply(this,arguments)}function ro(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function io(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ro(e,t,"get"))}function oo(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function ao(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ro(e,t,"set"),n),n}var so,uo,co,lo=function(){function e(){Ct(this,e)}var t=e.prototype;return t.getSynchronize=function(e){return new Map},t.setSynchronize=function(e){return{errorKeys:[]}},t.getInfoSynchronize=function(){return{currentSize:0,limitSize:0}},t.removeSynchronize=function(e){return{errorKeys:[]}},t.clearSynchronize=function(){},t.getItem=function(e){return this.getSynchronize([e]).get(e)||null},t.setItem=function(e,t){if(this.setSynchronize(Ge({},e,t)).errorKeys.length>0)throw new Error("Failed to set item: ".concat(e))},t.removeItem=function(e){this.removeSynchronize([e])},t.clear=function(){this.clearSynchronize()},t.getStorageInfo=function(){return this.getInfoSynchronize()},e}(),po=new WeakMap,fo=new WeakMap,ho=new WeakMap,mo=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),po,{writable:!0,value:localStorage}),oo(Lt(r),fo,{writable:!0,value:void 0}),oo(Lt(r),ho,{writable:!0,value:void 0}),ao(Lt(r),ho,{keys:new Set,currentSize:0,limitSize:F}),ao(Lt(r),fo,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in io(this,po)){if(e)if(t.split("_")[0]!==e)continue;io(this,ho).keys.add(t)}}catch(e){}},r.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},r.getSync=function(e){return io(this,fo)&&(e="".concat(io(this,fo),"_").concat(e)),io(this,ho).keys.has(e)?io(this,po).getItem(e):null},r.set=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return Object.entries(e).forEach((function(e){var n=He(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){io(this,fo)&&(e="".concat(io(this,fo),"_").concat(e)),io(this,po).setItem(e,t),io(this,ho).keys.add(e)},r.getInfo=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},r.getInfoSync=function(){var e=function(e,t){var n,r=0;for(n in e){var i=n.split("_")[0];e.hasOwnProperty(n)&&(t&&i!==t||(r+=2*(e[n].length+n.length)))}return r}(io(this,po),io(this,fo));return{currentSize:Ot.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((F/1024).toFixed(2))}},r.remove=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){io(this,fo)&&(e="".concat(io(this,fo),"_").concat(e)),io(this,ho).keys.has(e)&&(io(this,po).removeItem(e),io(this,ho).keys.delete(e))},r.clearAsync=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;io(this,ho).keys.forEach((function(t){io(e,fo)&&t.indexOf(io(e,fo))<0||(io(e,po).removeItem(t),io(e,ho).keys.delete(t))}))},r.setSynchronize=function(e){var t=this;return Object.entries(e).forEach((function(e){var n=He(e,2),r=n[0],i=n[1];t.setSync(r,i)})),{errorKeys:[]}},r.getSynchronize=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),n},r.getInfoSynchronize=function(){return this.getInfoSync()},r.clearSynchronize=function(){this.clearSync()},n}(lo),vo=new WeakMap,yo=new WeakMap,go=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),vo,{writable:!0,value:void 0}),oo(Lt(r),yo,{writable:!0,value:void 0}),ao(Lt(r),yo,{keys:new Set,currentSize:0,limitSize:F}),ao(Lt(r),vo,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:io(t,vo)},{success:function(e){var t=new Map;e&&e.mpds_data&&e.mpds_data.map&&(t=new Map(Object.entries(e.mpds_data.map))),n(t)},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.getSynchronize=function(e){var t={mpds_action:"mpds.get",mpds_data:{keys:e},appId:io(this,vo)},n=new Map,r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.map&&(n=new Map(Object.entries(r.mpds_data.map))),n},r.set=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:io(t,vo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.setSynchronize=function(e){var t={mpds_action:"mpds.set",mpds_data:{map:e},appId:io(this,vo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.getInfo=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:io(e,vo)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Ot.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(F/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:io(this,vo)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Ot.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(F/1024)}},r.remove=function(e){var t=this;return Ce((function(){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:io(t,vo)},{success:function(e){var t=[];e&&e.mpds_data&&e.mpds_data.error_keys&&(t=e.mpds_data.error_keys),n({errorKeys:t})},fail:function(e){r(e)}},{isMultiCallback:!1})}))]}))}))()},r.removeSynchronize=function(e){var t={mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:io(this,vo)},n=[],r=this.handleResult(t);return r&&r.mpds_data&&r.mpds_data.error_keys&&(n=r.mpds_data.error_keys),{errorKeys:n}},r.clearAsync=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:io(e,vo)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:io(this,vo)};this.handleResult(e)},r.handleResult=function(e){var t=null;try{var n=ZaloJavaScriptInterface.processActionMPDS(JSON.stringify(e));if(n=JSON.parse(n)){if(0===n.error_code)return n.data;t=vn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(lo),_o=function(){function e(){Ct(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Ce((function(){var n,r;return xe(this,(function(i){switch(i.label){case 0:return[4,t.getInstance().get(e)];case 1:return n=i.sent(),r={},n.forEach((function(e,t){r[t]=Pn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Ce((function(){var n,r;return xe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=He(e,2),n=t[0],i=t[1];Ot.isUndefined(i)||Ot.isNull(i)||(r[n]=An(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.setItem=function(e,t){return this.getInstance().setItem(e,t)},t.removeDataFromStorage=function(e){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.removeItem=function(e){this.getInstance().removeItem(e)},t.clearStorage=function(){var e=this;return Ce((function(){return xe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clearAsync()];case 1:return t.sent(),[2]}}))}))()},t.clearStorageSync=function(){this.getInstance().clear()},t.getStorageInfo=function(){var e=this;return Ce((function(){return xe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},t.getStorageInfoSync=function(){return this.getInstance().getStorageInfo()},e}(),wo=new WeakMap,To=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),wo,{writable:!0,value:void 0}),ao(Lt(r),wo,e),r}return n.prototype.getInstance=function(){return new mo(io(this,wo))},n}(_o),bo=new WeakMap,Eo=function(e){Ut(n,e);var t=jt(n);function n(e){var r;return Ct(this,n),oo(Lt(r=t.call(this)),bo,{writable:!0,value:void 0}),ao(Lt(r),bo,e),r}return n.prototype.getInstance=function(){return new go(io(this,bo))},n}(_o),Po=new To(o),So=(null===(so=Ze())||void 0===so?void 0:so.zaloVersion)||"",Io=(null===(uo=Ze())||void 0===uo?void 0:uo.platformName)||"unknown";!!Ot.isString(So)&&parseInt(So,10)>={android:12100571,iOS:400,wp:0,unknown:0}[Io]&&(null===(co=Ze())||void 0===co?void 0:co.appEnv.isMp)&&(Po=new Eo(o));var Ao=Po,Oo=[Ei({data:Vi.record(ci(),Vi.any())}).optional()];function Co(e){return ko.apply(this,arguments)}function ko(){return ko=Ce((function(e){return xe(this,(function(t){return[2,Un("setStorage",Oo,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp||ze.isMpWeb?[4,Ao.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Fe("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ko.apply(this,arguments)}var No=[Ei({keys:Vi.array(ci())}).optional()];function Mo(e){return Ro.apply(this,arguments)}function Ro(){return Ro=Ce((function(e){return xe(this,(function(t){return[2,Un("getStorage",No,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp||ze.isMpWeb?[4,Ao.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Fe("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ro.apply(this,arguments)}function xo(e){return Do.apply(this,arguments)}function Do(){return(Do=Ce((function(e){return xe(this,(function(t){return[2,Un("getStorageInfo",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp||ze.isMpWeb?[4,Ao.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Fe("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Uo=[Ei({keys:Vi.array(ci())}).optional()];function Lo(e){return jo.apply(this,arguments)}function jo(){return jo=Ce((function(e){return xe(this,(function(t){return[2,Un("removeStorage",Uo,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp||ze.isMpWeb?[4,Ao.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Fe("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jo.apply(this,arguments)}var Bo=[Ei({prefix:ci().optional()}).optional()];function Zo(e){return zo.apply(this,arguments)}function zo(){return(zo=Ce((function(e){return xe(this,(function(t){return[2,Un("clearStorage",Bo,[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp||ze.isMpWeb?[4,Ao.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Fe("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Wo=function(){var e=Ce((function(e,t){var n,r,i,a;return xe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Nn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,wn.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:if(r=s.sent(),void 0!==(i=null==r?void 0:r.error)&&i<0)throw o=(null==r?void 0:r.message)||A,new ln(i,o);return a=null==r?void 0:r.user_id_by_oa,[2,{id:null==r?void 0:r.id,name:(null==r?void 0:r.name)||"",avatar:(null==r||null===(t=r.picture)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.url)||"",idByOA:a,followedOA:!!(null==r?void 0:r.is_follower),isSensitive:null==r?void 0:r.is_sensitive}]}}))}));return function(t){return e.apply(this,arguments)}}())];case 4:return[2,s.sent()]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Fo=[Ei({avatarType:Vi.enum(["small","normal","large"]).optional(),autoRequestPermission:Vi.boolean().default(!1).optional()}).optional()];function Go(e){return Vo.apply(this,arguments)}function Vo(){return Vo=Ce((function(e){return xe(this,(function(t){return[2,Un("getUserInfo",Fo,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:if(!ze.isMp)return[3,4];t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Wo(t,n)];case 2:return[2,{userInfo:i.sent()}];case 3:return r=i.sent(),[2,Promise.reject(r)];case 4:return ze.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Fe("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vo.apply(this,arguments)}var Ho=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Ko=Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Ze())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case Ho(s).NONE:o=e.NetworkType.none;break;case Ho(s).WIFI:o=e.NetworkType.wifi;break;case Ho(s)["2G"]:case Ho(s)["3G"]:case Ho(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function Jo(e){return qo.apply(this,arguments)}function qo(){return(qo=Ce((function(t){return xe(this,(function(n){return[2,Un("getNetworkType",[],[t],Ce((function(){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?[4,Ko()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(ze.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Fe("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Qo=[Vi.function().args(Ei({isConnected:Vi.boolean(),networkType:Vi.enum(["none","wifi","cellular","unknown"])})).returns(Vi.void())];function Yo(t){return Un("onNetworkStatusChange",Qo,[t],(function(t){var n=t;if(ze.isMp)!function(t){Gt.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Ko().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(ze.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){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}n({isConnected:!0,networkType:t})}))}}))}var $o=function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(this,(function(s){return a={subaction:0,scanning_type:Ot.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Ot.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Ot.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Ot.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Ot.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Ot.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Ot.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Ot.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Ot.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Ot.isNumber(null==e||null===(o=e.scanConfig)||void 0===o?void 0:o.beaconConnectedTimeout)?e.scanConfig.beaconConnectedTimeout:6e5},items:Array.isArray(null==e?void 0:e.items)?null==e?void 0:e.items:[]}},[2,new Promise((function(e,t){yn("SCAN_IBEACON",Ve({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Xo=[Ei({scanningType:Vi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Vi.number().optional(),monitorInterval:Vi.number().optional(),domain:Vi.string().optional(),scanConfig:Ei({scanTime:Vi.number().optional(),timeBetweenScan:Vi.number().optional(),beaconTimeout:Vi.number().optional(),delayCheckConnectedTimeout:Vi.number().optional(),beaconConnectedTimeout:Vi.number().optional()}).optional(),items:Vi.array(Ei({id:Vi.string().optional(),distance:Vi.number().optional(),monitor:Ei({enable:Vi.boolean().optional(),movingRange:Vi.number().optional()}).optional()})).optional(),scanFromSource:Vi.string().optional()}).optional()];function ea(e){return ta.apply(this,arguments)}function ta(){return(ta=Ce((function(e){return xe(this,(function(t){return[2,Un("startBeaconDiscovery",Xo,[e],Ce((function(){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,$o(e)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Fe("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var na=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function ra(e){return ia.apply(this,arguments)}function ia(){return(ia=Ce((function(e){return xe(this,(function(t){return[2,Un("stopBeaconDiscovery",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,na()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Fe("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var oa=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("SCAN_IBEACON",{subaction:1},{success:function(t){var n={beacons:[]};Array.isArray(t)&&t.forEach((function(e){var t={uuid:e.uuid,major:e.major,minor:e.minor,distance:e.distance,rssi:e.rssi};n.beacons.push(t)})),e(n)},fail:function(e){t(e)}},{isMultiCallback:!0})}))]}))}));function aa(e){return sa.apply(this,arguments)}function sa(){return(sa=Ce((function(e){return xe(this,(function(t){return[2,Un("getBeacons",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,oa()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Fe("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var ua=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ca(e){return la.apply(this,arguments)}function la(){return(la=Ce((function(e){return xe(this,(function(t){return[2,Un("closeApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,ua()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var da=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function pa(e){return fa.apply(this,arguments)}function fa(){return(fa=Ce((function(e){return xe(this,(function(t){return[2,Un("scanQRCode",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,da()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Fe("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var ha=function(){var t=Ce((function(t,n,r,o){return xe(this,(function(a){return[2,new Promise((function(a,s){yn("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),ma=[Ei({id:ci(),type:Vi.enum(["user","oa","aliasOA"]),sourceId:Vi.any().optional(),sourceIndex:Vi.any().optional()}).optional()];function va(e){return ya.apply(this,arguments)}function ya(){return ya=Ce((function(e){return xe(this,(function(t){return[2,Un("openProfile",ma,[e],function(){var e=Ce((function(e){var t,n,r,i;return xe(this,(function(o){switch(o.label){case 0:return ze.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,ha(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ya.apply(this,arguments)}var ga=function(){var t=Ce((function(t,n){var r,o,a,s=arguments;return xe(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){yn("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),_a=[Ei({id:ci(),type:Vi.enum(["user","oa"]),sourceId:Vi.any().optional(),sourceIndex:Vi.any().optional(),message:ci().optional()}).optional()];function wa(e){return Ta.apply(this,arguments)}function Ta(){return Ta=Ce((function(e){return xe(this,(function(t){return[2,Un("openChat",_a,[e],function(){var e=Ce((function(e){var t,n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return ze.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ga(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ta.apply(this,arguments)}function ba(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}var Ea=function(){var t=Ce((function(t,n){var r,o;return xe(this,(function(a){switch(r={},o=t,t){case"image":(null==n?void 0:n.imageUrls)?(o="multi_image",r={photoUrl:null==n?void 0:n.imageUrls}):r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(t,n){yn("OPEN_POSTFEED",ba(Ve({type:e.PostFeedType[o]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Pa=[Vi.union([Ei({type:Vi.enum(["image"]),data:Ei({imageUrl:ci().url().optional(),imageUrls:Vi.array(ci().url()).optional()})}),Ei({type:Vi.enum(["link"]),data:Ei({link:ci().url(),title:ci().max(100).optional(),thumb:ci().url().optional(),description:ci().max(400).default("").optional()})}),Ei({type:Vi.enum(["profile"]),data:Ei({id:ci().optional()})})])];function Sa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=Ce((function(e){return xe(this,(function(t){return[2,Un("openPostFeed",Pa,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(t=e.type,n=e.data,[4,Ea(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Fe("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var Aa=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Oa=[Ei({id:ci(),showDialogConfirm:Vi.boolean().optional()}).optional()];function Ca(e){return ka.apply(this,arguments)}function ka(){return ka=Ce((function(e){return xe(this,(function(t){return[2,Un("followOA",Oa,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=e.id,[4,Aa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ka.apply(this,arguments)}var Na=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ma=[Ei({id:ci()}).optional()];function Ra(e){return xa.apply(this,arguments)}function xa(){return xa=Ce((function(e){return xe(this,(function(t){return[2,Un("unfollowOA",Ma,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=e.id,[4,Na(t)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xa.apply(this,arguments)}var Da=function(){var e=Ce((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return xe(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,Ve({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw mn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,ba(Ve({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ua=function(){var t=Ce((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return xe(this,(function(y){switch(y.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return l=[],d=(null===(u=Ze())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=Ze())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=W[p]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),r={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,wn.getAccessToken()];case 8:case 11:return s=y.sent(),[4,Da(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return f=y.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(o,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),r={link:m.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){yn("OPEN_SHARESHEET",ba(Ve({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),La=[Vi.union([Ei({type:Vi.enum(["text"]),data:Ei({text:ci(),description:ci().default("").optional(),autoParseLink:Vi.boolean().default(!1).optional()})}),Ei({type:Vi.enum(["image"]),data:Ei({imageUrl:ci().url().optional(),imageUrls:Vi.array(ci().url()).max(10).optional()})}),Ei({type:Vi.enum(["link"]),data:Ei({link:ci().url(),chatOnly:Vi.boolean().optional()})}),Ei({type:Vi.enum(["oa"]),data:Ei({id:ci()})}),Ei({type:Vi.enum(["gif"]),data:Ei({gifUrl:ci().url(),imageUrl:ci().url().optional(),width:li().min(0).optional(),height:li().min(0).optional()})}),Ei({type:Vi.enum(["video"]),data:Ei({videoThumb:ci().url(),videoUrl:ci().url(),width:li().min(0).optional(),height:li().min(0).optional()})}),Ei({type:Vi.enum(["zmp","zmp_deep_link"]),data:Ei({title:ci().max(100),thumbnail:ci().url(),path:ci().optional(),description:ci().max(400).default("").optional()})})])];function ja(e){return Ba.apply(this,arguments)}function Ba(){return Ba=Ce((function(e){return xe(this,(function(t){return[2,Un("openShareSheet",La,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(t=e.type,n=e.data,[4,Ua(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Fe("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ba.apply(this,arguments)}var Za=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ze())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)?e({userAllow:void 0===t.error_code||(null==t?void 0:t.error_code)>=0,message:void 0===t.error_code?"User allowed":null==t?void 0:t.error_message}):e({userAllow:(null==t?void 0:t.error_code)>=0,message:null==t?void 0:t.error_message})},fail:function(n){var r,i;(null===(r=Ze())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)&&"number"==typeof(null==n?void 0:n.code)?e({userAllow:(null==n?void 0:n.code)>=0,message:null==n?void 0:n.message}):t(n)}},{isMultiCallback:!0})}))]}))}));function za(e){return Wa.apply(this,arguments)}function Wa(){return(Wa=Ce((function(e){return xe(this,(function(t){return[2,Un("requestCameraPermission",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,Za()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Fa=function(){var e=Ce((function(e,t,n){return xe(this,(function(r){return[2,new Promise((function(r,i){yn("CREATE_SHORTCUT",{url:e,title:t,iconUrl:n},{success:function(e){r(e)},fail:function(e){i(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ga=Ce((function(){var e,t,n,r=arguments;return xe(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=Gn(),[4,tn(e,t,n.version)];case 1:return[2,i.sent()]}}))})),Va=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ha=[Ei({params:Vi.record(ci(),ci()).optional()}).optional()];function Ka(e){return Ja.apply(this,arguments)}function Ja(){return Ja=Ce((function(e){return xe(this,(function(t){return[2,Un("createShortcut",Ha,[e],function(){var e=Ce((function(e){var t,n,r,i,s,u,c,l;return xe(this,(function(d){switch(d.label){case 0:return ze.isMp?[4,Ga(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Ze())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||In("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Va(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Fa("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,mn.success()];case 6:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ja.apply(this,arguments)}var qa=function(){var e=Ce((function(e,t,n){return xe(this,(function(r){return[2,new Promise((function(r,o){yn("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Qa=[Ei({secretData:ci(),ui:Ei({title:ci().default("Xác thực").optional(),subTitle:ci().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:ci().default("Đóng").optional()}).optional(),requireFingerprint:fi().default(!0).optional()}).optional()];function Ya(e){return $a.apply(this,arguments)}function $a(){return $a=Ce((function(e){return xe(this,(function(t){return[2,Un("openBioAuthentication",Qa,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,qa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Fe("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$a.apply(this,arguments)}var Xa=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("PROMPT_AUTHENTICATION_CHECK_STATE",{},{success:function(t){e(null==t?void 0:t.bio_state)},fail:function(e){t(e)}},{actionName:"action.prompt.authentication.check_state"})}))]}))}));function es(e){return ts.apply(this,arguments)}function ts(){return(ts=Ce((function(e){return xe(this,(function(t){return[2,Un("checkStateBioAuthentication",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Xa()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return ze.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Fe("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var ns=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),rs=[Ei({message:ci()}).optional()];function is(e){return os.apply(this,arguments)}function os(){return os=Ce((function(e){return xe(this,(function(t){return[2,Un("showToast",rs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,ns(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),os.apply(this,arguments)}var as=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function ss(e){return us.apply(this,arguments)}function us(){return(us=Ce((function(e){return xe(this,(function(t){return[2,Un("hideKeyboard",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,as()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var cs=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ls=[Ei({phoneNumber:ci()})];function ds(e){return ps.apply(this,arguments)}function ps(){return ps=Ce((function(e){return xe(this,(function(t){return[2,Un("openPhone",ls,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,cs(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ps.apply(this,arguments)}var fs=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),hs=[Ei({content:ci(),phoneNumber:ci()})];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=Ce((function(e){return xe(this,(function(t){return[2,Un("openSMS",hs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,fs(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=Ce((function(e){var t,n=arguments;return xe(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){yn("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),gs=[Ei({id:ci(),displayName:ci().default("").optional()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=Ce((function(e){return xe(this,(function(t){return[2,Un("viewOAQr",gs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,ys(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}var Ts=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("KEEP_SCREEN",{data:{keep_screen_on:e?1:0}},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),bs=[Ei({keepScreenOn:fi()})];function Es(e){return Ps.apply(this,arguments)}function Ps(){return Ps=Ce((function(e){return xe(this,(function(t){return[2,Un("keepScreen",bs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ts(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ps.apply(this,arguments)}function Ss(e){return Is.apply(this,arguments)}function Is(){return(Is=Ce((function(e){return xe(this,(function(t){return[2,Un("onKeepScreen",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Ts(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function As(e){return Os.apply(this,arguments)}function Os(){return(Os=Ce((function(e){return xe(this,(function(t){return[2,Un("offKeepScreen",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Ts(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var Cs=function(){var e=Ce((function(e,t,n){var r;return xe(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){yn("SAVE_IMAGE_GALLERY",ba(Ve({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),ks=[Ei({imageBase64Data:ci().optional(),imageUrl:ci().url().optional()}).optional()];function Ns(e){return Ms.apply(this,arguments)}function Ms(){return Ms=Ce((function(e){return xe(this,(function(t){return[2,Un("saveImageToGallery",ks,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Cs(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ms.apply(this,arguments)}var Rs=function(){var e=Ce((function(e,t){var n;return xe(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){yn("SAVE_VIDEO_GALLERY",Ve({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),xs=[Ei({videoUrl:ci().url()}).optional()];function Ds(e){return Us.apply(this,arguments)}function Us(){return Us=Ce((function(e){return xe(this,(function(t){return[2,Un("saveVideoToGallery",xs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Rs(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Us.apply(this,arguments)}var Ls=function(){var e=Ce((function(e){var t,n,r,i,o,a,u=arguments;return xe(this,(function(c){switch(c.label){case 0:t=u.length>1&&void 0!==u[1]?u[1]:"/",n=u.length>2&&void 0!==u[2]?u[2]:{},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Ga(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){yn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),js=[Ei({appId:ci(),path:ci().optional(),params:Vi.record(ci(),ci()).optional()})];function Bs(e){return Zs.apply(this,arguments)}function Zs(){return Zs=Ce((function(e){return xe(this,(function(t){return[2,Un("openMiniApp",js,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ls(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zs.apply(this,arguments)}var zs=Ce((function(){var t,n,r=arguments;return xe(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){yn("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),Ws=[Ei({type:Vi.enum(["oneShot"]).default("oneShot").optional(),milliseconds:li().optional()})];function Fs(e){return Gs.apply(this,arguments)}function Gs(){return Gs=Ce((function(e){return xe(this,(function(t){return[2,Un("vibrate",Ws,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,zs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gs.apply(this,arguments)}var Vs=function(){var e=Ce((function(e,t){var n,r,i,o;return xe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=Ot.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?rn(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?rn(null==t?void 0:t.leftButton):"back"},!r&&Ot.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){yn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Hs=[Ei({url:ci(),config:Ei({style:Vi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Vi.enum(["back","none"]).default("back").optional()}).optional()})];function Ks(e){return Js.apply(this,arguments)}function Js(){return Js=Ce((function(e){return xe(this,(function(t){return[2,Un("openWebview",Hs,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Vs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Js.apply(this,arguments)}function qs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Kt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Qs(){return Un("getRouteParams",[],[],(function(){return qs()}))}function Ys(e){return $s.apply(this,arguments)}function $s(){return($s=Ce((function(e){return xe(this,(function(t){return[2,Un("getAppInfo",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Ga()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Fe("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Xs=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("WEBVIEW_SET_RESULT",{result:An(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),eu=[Ei({data:Vi.any()})];function tu(e){return nu.apply(this,arguments)}function nu(){return nu=Ce((function(e){return xe(this,(function(t){return[2,Un("sendDataToPreviousMiniApp",eu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Xs(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nu.apply(this,arguments)}var ru=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){var n,r;yn("MP_GET_NUMBER",{forceUpdate:!0},{success:function(n){var r={};if(null==n?void 0:n.token)return r.token=null==n?void 0:n.token,e(r);t(mn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ze())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function iu(e){return ou.apply(this,arguments)}function ou(){return(ou=Ce((function(e){return xe(this,(function(t){return[2,Un("getPhoneNumber",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,ru()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Fe("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var au=Ce((function(){var e,t=arguments;return xe(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){yn("MP_OPEN_PROFILE_PICKER",{maxProfile:e},{success:function(e){Array.isArray(e)?t(e.map((function(e){return e.id}))):t([])},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))})),su=[Ei({maxProfile:li().min(1).max(10).optional().default(1)})];function uu(e){return cu.apply(this,arguments)}function cu(){return cu=Ce((function(e){return xe(this,(function(t){return[2,Un("openProfilePicker",su,[e],function(){var e=Ce((function(e){var t,n,r,i,o;return xe(this,(function(a){switch(a.label){case 0:return ze.isMp?[4,au(null==e?void 0:e.maxProfile)]:[3,8];case 1:if(!((t=a.sent()).length>0))return[3,7];a.label=2;case 2:return a.trys.push([2,6,,7]),[4,wn.getAccessToken()];case 3:return r=a.sent(),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(Ot.isUndefined(null===(d=i.data[e])||void 0===d?void 0:d.message)?"Unknown error":null===(p=i.data[e])||void 0===p?void 0:p.message)}})),[3,7];case 6:return o=a.sent(),n=t.map((function(e){return{id:e,profile:{name:"",avatar:""},code:-1,message:"Can't get profile: ".concat(o.message)}})),[3,7];case 7:return[2,{users:n||[]}];case 8:return ze.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Fe("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cu.apply(this,arguments)}var lu=function(){var e=Ce((function(e,t,n){var r;return xe(this,(function(i){return r=t&&Ot.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){yn("MP_JOIN_WIFI",{ssid:e,securityType:r,password:t,hiddenSsid:n},{success:function(e){i(e)},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),du=[Ei({SSID:ci(),password:ci().optional(),hiddenSSID:fi().optional()})];function pu(e){return fu.apply(this,arguments)}function fu(){return fu=Ce((function(e){return xe(this,(function(t){return[2,Un("connectWifi",du,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,lu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fu.apply(this,arguments)}var hu=function(){var t=Ce((function(t,n,r,i,o,a){var s,u;return xe(this,(function(c){return s={type:0,url:n,max_size:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){yn("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ve({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),mu=[Ei({type:Vi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:ci().url(),maxItemSize:li().min(0).optional(),editView:Ei({enable:fi().optional(),aspectRatio:ci().regex(/^d+:d+$/).optional()}).optional(),silentRequest:fi().optional(),maxSelectItem:li().min(1).optional()})];function vu(e){return yu.apply(this,arguments)}function yu(){return yu=Ce((function(e){return xe(this,(function(t){return[2,Un("openMediaPicker",mu,[e],function(){var e=Ce((function(e){var t,n,r,i,o,a;return xe(this,(function(s){switch(s.label){case 0:return ze.isMp?(i={},Ot.isUndefined(null===(t=e.editView)||void 0===t?void 0:t.enable)||(null===(n=e.editView)||void 0===n?void 0:n.enable)?i.enable=1:i.enable=0,i.aspect_ratio=null===(r=e.editView)||void 0===r?void 0:r.aspectRatio,o=!0===e.silentRequest?1:0,a=e.maxSelectItem,[4,hu(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return ze.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Fe("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yu.apply(this,arguments)}var gu=[Ei({title:ci().max(100),description:ci().max(400).default(""),thumbnail:ci().url().optional(),path:ci().optional()})];function _u(e){return wu.apply(this,arguments)}function wu(){return wu=Ce((function(e){return xe(this,(function(t){return[2,Un("getShareableLink",gu,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return[4,wn.getAccessToken()];case 1:return t=n.sent(),[4,Da(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wu.apply(this,arguments)}var Tu=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("MP_CLOSE_LOADINGVIEW",{at:(new Date).getTime(),when:e,url:location.href},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}();function bu(e){return Eu.apply(this,arguments)}function Eu(){return(Eu=Ce((function(e){return xe(this,(function(t){return[2,Un("closeLoading",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Tu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function Pu(e){return Su.apply(this,arguments)}function Su(){return Su=Ce((function(e){return xe(this,(function(t){return[2,Un("requestUpdateZalo",[],[e],Ce((function(){var e,t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(n=(null===(e=Ze())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,Va(n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("requestUpdateZalo",{}))]}}))})))]}))})),Su.apply(this,arguments)}var Iu=Gt.getInstance();Iu.addListener=function(t,n,r){var i=t;return Iu.addListener(e.Events[i],n,r)};var Au=[Vi.function()];function Ou(t){return Un("onConfirmToExit",Au,[t],(function(t){var n=t;ze.isMp&&(Iu.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Ki.setNavigationBarLeftButton(void 0,2))}))}function Cu(){return Un("offConfirmToExit",[],[],(function(){ze.isMp&&(Iu.off(e.Events.AppClose),Ki.setNavigationBarLeftButton(void 0,0))}))}function ku(){return Un("getDeviceId",[],[],(function(){return ze.isMp&&wn.getSync(l.DEVICE_ID)||""}))}function Nu(e){return Mu.apply(this,arguments)}function Mu(){return(Mu=Ce((function(e){return xe(this,(function(t){return[2,Un("getDeviceIdAsync",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Ru(){return Un("getContext",[],[],(function(){if(ze.isMp){var e=wn.getSync(l.CONTEXT_ID)||"";return{type:wn.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function xu(e){return Du.apply(this,arguments)}function Du(){return(Du=Ce((function(e){return xe(this,(function(t){return[2,Un("getContextAsync",[],[e],Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,wn.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function Uu(e){return Lu.apply(this,arguments)}function Lu(){return(Lu=Ce((function(e){return xe(this,(function(t){return[2,Un("getAuthCode",[],[e],Ce((function(){var e,t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,wn.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,wn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw nn([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),mn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function ju(e){return Bu.apply(this,arguments)}function Bu(){return(Bu=Ce((function(e){return xe(this,(function(t){return[2,Un("getZPIToken",[],[e],Ce((function(){var e,t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?[4,wn.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,wn.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,wn.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,wn.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var Zu=[ci()];function zu(e){return Un("setAccessToken",Zu,[e],(function(e){var t=e;wn.setAccessToken(t)}))}var Wu=[Ei({url:ci().url()})];function Fu(e){return Gu.apply(this,arguments)}function Gu(){return Gu=Ce((function(e){return xe(this,(function(t){return[2,Un("openOutApp",Wu,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Va(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gu.apply(this,arguments)}var Vu=[Ei({count:li().min(1).optional().default(1),sourceType:Vi.array(Vi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Vi.enum(["back","front"]).default("front").optional()})];function Hu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=Ce((function(e){return xe(this,(function(t){return[2,Un("chooseImage",Vu,[e],function(){var e=Ce((function(e){var t,n,r,i;return xe(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Ju=Ce((function(){var e,t,n=arguments;return xe(this,(function(r){return e=n.length>0&&void 0!==n[0]&&n[0],t=n.length>1&&void 0!==n[1]?n[1]:"Cho phép Zalo truy cập vào vị trí của thiết bị này?",[2,new Promise((function(n,r){yn("GET_LOCATION",{silent_request:e,permission_description:t,forceUpdate:!0},{success:function(e){var t={};if(null==e?void 0:e.token)return t.token=null==e?void 0:e.token,n(t);r(mn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function qu(e){return Qu.apply(this,arguments)}function Qu(){return(Qu=Ce((function(e){return xe(this,(function(t){return[2,Un("getLocation",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Ju()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({token:""})]:[2,Promise.reject(Fe("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Yu=[Vi.function().args(Ei({data:Vi.any()})).returns(Vi.void())];function $u(t){return Un("onCallbackData",Yu,[t],(function(){!function(t){Gt.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Xu=function(){var e=Ce((function(e){var t,n,r,i,a,s,u,c,l,d,p;return xe(this,(function(f){switch(f.label){case 0:return e||(e=qs()),"object"==typeof e&&((n=e.zmpOrderId||e.orderId)||(t=e.appTransID||e.apptransid||e.transId)),"string"==typeof e&&(r=Kt.getParameterByName("orderId",e),i=Kt.getParameterByName("appTransID",e)||Kt.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(H),c={orderId:n||"",transId:t||"",appId:o},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw mn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err,msg:l.msg},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ve({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),ec=function(){var t=Ce((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,T,b,E,P,S,I,A,O;return xe(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),l.append("mac",i),r&&l.append("desc",encodeURIComponent(r)),a&&(d=a,"object"==typeof a&&(d=JSON.stringify(a)),l.append("extradata",encodeURIComponent(d))),s&&(p=s,"object"==typeof s&&(p=JSON.stringify(s)),l.append("payload",encodeURIComponent(p))),u&&("string"==typeof u?(l.append("method",u),l.append("isCustom","false")):"object"==typeof u&&(l.append("method",u.id),l.append("isCustom",JSON.stringify(u.isCustom)))),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 2:return h=C.sent(),f.headers.authorization="Bearer ".concat(h),[4,fetch(G,ba(Ve({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(m=C.sent()).data||0!==m.err)throw mn.error.badRequest(m.msg);return v=m.data.id,y=m.data.jwt,g=m.data.messageToken||"",_=window.APP_VERSION,w=window.APP_ENV,T={miniAppId:c,orderId:v},b=m.data.method,E=m.data.isCustom,y&&(T.token=y),_&&(T.version=_),w&&(T.env=w),b&&(T.method=b),E&&(T.isCustom=E),P=Kt.encode(T),S=new URL("?".concat(P),"https://payment-mini.zalo.me").toString(),I=an(),A=on()&&I<742?"normal":"bottomSheet",Zt.enablePaymentDone=Gt.getInstance().eventNames().includes(e.Events.PaymentDone),[4,Vs(S,{style:A}).then((function(){var t=!1;Gt.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(Ce((function(){var n;return xe(this,(function(r){switch(r.label){case 0:return t?[3,2]:(Gt.getInstance().emit(e.Events.PaymentDone,v,{orderId:v}),[4,Xu({zmpOrderId:v})]);case 1:(n=r.sent()).err>=0&&!n.isCustom&&Gt.getInstance().emit(e.Events.PaymentClose,n.err,ba(Ve({},n),{zmpOrderId:v})),r.label=2;case 2:return[2]}}))})),500)})),Gt.getInstance().once(e.Events.OpenApp,(function(){t=!0})),Gt.getInstance().once(e.Events.PaymentDone,(function(){t=!0,Zt.enablePaymentDone=!1}))}))];case 5:return C.sent(),[2,{orderId:v,messageToken:g}];case 6:throw O=C.sent(),console.log("Internal error"),O;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),tc=[Ei({amount:Vi.union([ci(),li()]),item:Vi.array(Vi.record(ci(),Vi.any())),desc:Vi.string(),mac:Vi.string(),extradata:Vi.any().optional(),payload:Vi.any().optional(),method:Vi.union([Vi.string(),Vi.object({id:Vi.string(),isCustom:Vi.boolean()})]).optional()})];function nc(e){return rc.apply(this,arguments)}function rc(){return rc=Ce((function(e){return xe(this,(function(t){return[2,Un("createOrder",tc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,ec(e.amount,e.item,e.desc,e.mac,e.extradata,e.payload,e.method)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Fe("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rc.apply(this,arguments)}var ic=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),oc=function(){var e=Ce((function(e,t,n,r,i){var a,s,u,c,l,d,p,f,h,m,v,y;return xe(this,(function(g){switch(g.label){case 0:a=o,(s=new URLSearchParams).append("amount",e.toString()),s.append("appId",a),t&&s.append("desc",encodeURIComponent(t)),n&&s.append("method",n),r&&s.append("transId",r),i&&s.append("mac",i),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,wn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=wn.miniProgramConfig)||void 0===c?void 0:c.showConfirmToPayment,console.log("showConfirmToPayment",d),!d)return[3,7];g.label=4;case 4:return g.trys.push([4,6,,7]),[4,ic()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(K,ba(Ve({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw mn.error.badRequest(f.msg);return h=f.data.id,m=f.data.messageToken||"",v=f.data.transId||"",[2,{orderId:h,messageToken:m,transId:v}];case 10:throw y=g.sent(),console.log("Internal error"),y;case 11:return[2]}}))}));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),ac=[Ei({amount:Vi.union([Vi.string(),Vi.number()]),desc:Vi.string(),method:Vi.string(),transId:Vi.string().optional(),mac:Vi.string().optional()})];function sc(e){return uc.apply(this,arguments)}function uc(){return uc=Ce((function(e){return xe(this,(function(t){return[2,Un("purchase",ac,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,oc(e.amount,e.desc,e.method,null==e?void 0:e.transId,null==e?void 0:e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Fe("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uc.apply(this,arguments)}var cc=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;yn("MP_SELECT_PAYMENT_METHOD",{isBinding:i,channels:e,selectedMethod:t,forceUpdate:!0},{success:function(e){console.log(e),n(e)},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),lc=[Ei({channels:bi(Ei({method:ci(),subMethod:ci().optional(),subInfo:ci().optional()})).optional(),selectedMethod:Ei({method:ci(),subMethod:ci().optional()}).optional()}).optional()];function dc(e){return pc.apply(this,arguments)}function pc(){return pc=Ce((function(e){return xe(this,(function(t){return[2,Un("selectPaymentMethod",lc,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?(t=e.channels,n=e.selectedMethod,[4,cc(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Fe("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pc.apply(this,arguments)}var fc=[Ei({data:Vi.union([ci(),Vi.record(ci(),ci().nullish())])})];function hc(e){return mc.apply(this,arguments)}function mc(){return mc=Ce((function(e){return xe(this,(function(t){return[2,Un("checkTransaction",fc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Xu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Fe("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mc.apply(this,arguments)}var vc=function(){var t=Ce((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,T;return xe(this,(function(b){switch(b.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===q&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===J&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Ze())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Ze())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,wn.getAccessToken().catch((function(){throw mn.error.loginRequired}))];case 2:return y=b.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(V,ba(Ve({method:"POST"},v),{body:f}))];case 3:return[4,b.sent().json()];case 4:if(!(g=b.sent()).data||!g.data.store||0!==g.err)throw mn.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){yn("IAP_REQUESTPAYMENT",Ve({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw T=b.sent(),console.log("Internal error"),T;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),yc=[Ei({productId:ci(),payType:Vi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Vi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:ci().optional(),method:Vi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:ci().optional()})];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=Ce((function(e){return xe(this,(function(t){return[2,Un("createOrderIAP",yc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,vc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Fe("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}var wc=[Ei({hide:fi().default(!1).optional()}).optional()];function Tc(e){return bc.apply(this,arguments)}function bc(){return bc=Ce((function(e){return xe(this,(function(t){return[2,Un("setAndroidBottomNavigationBar",wc,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bc.apply(this,arguments)}var Ec=[Ei({hide:fi().default(!1).optional()}).optional()];function Pc(e){return Sc.apply(this,arguments)}function Sc(){return Sc=Ce((function(e){return xe(this,(function(t){return[2,Un("setIOSBottomSafeArea",Ec,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sc.apply(this,arguments)}var Ic=[Ei({type:Vi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Vi.string().optional()}).optional()];function Ac(e){return Oc.apply(this,arguments)}function Oc(){return Oc=Ce((function(e){return xe(this,(function(t){return[2,Un("setStatusBar",Ic,[e],function(){var e=Ce((function(e){return xe(this,(function(t){switch(t.label){case 0:return ze.isMp?[4,Ki.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oc.apply(this,arguments)}var Cc=[Ei({headerTextColor:Vi.enum(["black","white"]).optional(),headerColor:Vi.string().optional(),actionBar:Ei({hide:Vi.boolean().optional(),title:Vi.string().optional(),leftButton:Vi.enum(["back","none"]).optional(),textAlign:Vi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Vi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Vi.boolean().optional(),hideIOSSafeAreaBottom:Vi.boolean().optional()})];function kc(e){return Nc.apply(this,arguments)}function Nc(){return Nc=Ce((function(e){return xe(this,(function(t){return[2,Un("configAppView",Cc,[e],function(){var e=Ce((function(e){var t,n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return ze.isMp?Ot.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ki.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Ot.isUndefined(null===(n=e.actionBar)||void 0===n?void 0:n.title)||!(null===(r=e.actionBar)||void 0===r?void 0:r.title)?[3,4]:[4,Ki.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ki.configHeader({hideActionBar:null===(i=e.actionBar)||void 0===i?void 0:i.hide,statusBarType:e.statusBarType,headerTextColor:e.headerTextColor,headerColor:e.headerColor,textAlign:null===(o=e.actionBar)||void 0===o?void 0:o.textAlign})];case 5:u.sent(),u.label=6;case 6:return u.trys.push([6,11,,12]),"boolean"!=typeof e.hideAndroidBottomNavigationBar?[3,8]:[4,Ki.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ki.setIOSBottomSafeArea(e.hideIOSSafeAreaBottom)];case 9:u.sent(),u.label=10;case 10:return[3,12];case 11:return u.sent(),[3,12];case 12:return[2];case 13:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nc.apply(this,arguments)}var Mc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Rc(e){return xc.apply(this,arguments)}function xc(){return(xc=Ce((function(e){return xe(this,(function(t){return[2,Un("minimizeApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Mc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Dc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Uc(e){return Lc.apply(this,arguments)}function Lc(){return(Lc=Ce((function(e){return xe(this,(function(t){return[2,Un("openPermissionSetting",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Dc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var jc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=Ce((function(e){return xe(this,(function(t){return[2,Un("favoriteApp",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,jc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var zc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Wc(e){return Fc.apply(this,arguments)}function Fc(){return(Fc=Ce((function(e){return xe(this,(function(t){return[2,Un("openGroupList",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,zc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Gc=Ce((function(){var e;return xe(this,(function(t){switch(t.label){case 0:return[4,wn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){yn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Vc(e){return Hc.apply(this,arguments)}function Hc(){return(Hc=Ce((function(e){return xe(this,(function(t){return[2,Un("requestSendNotification",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Gc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Kc=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Jc(e){return qc.apply(this,arguments)}function qc(){return(qc=Ce((function(e){return xe(this,(function(t){return[2,Un("addRating",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Kc()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Qc,Yc=(Qc=Ce((function(e,t,n){var r,i;return xe(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,Ve({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Qc.apply(this,arguments)}),$c=function(){var e=Ce((function(e){return xe(this,(function(t){return[2,new Promise((function(t,n){yn("MP_INTERACT_OA",{oaId:e,forceUpdate:!0},{success:function(e){t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Xc=[Ei({oaId:ci()})];function el(e){return tl.apply(this,arguments)}function tl(){return tl=Ce((function(e){return xe(this,(function(t){return[2,Un("interactOA",Xc,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?(t=e.oaId,[4,wn.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||Ot.isEmpty(n)?[3,3]:[4,Yc(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,$c(t)];case 4:return[2,i.sent()];case 5:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tl.apply(this,arguments)}var nl=[Ei({oaId:ci()})];function rl(e){return il.apply(this,arguments)}function il(){return il=Ce((function(e){return xe(this,(function(t){return[2,Un("isAllowedInteractWithOA",nl,[e],function(){var e=Ce((function(e){var t,n,r;return xe(this,(function(i){switch(i.label){case 0:return ze.isMp?(t=e.oaId,[4,wn.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||Ot.isEmpty(n)?[3,3]:[4,Yc(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return ze.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Fe("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),il.apply(this,arguments)}function ol(e){return al.apply(this,arguments)}function al(){return(al=Ce((function(e){return xe(this,(function(t){return[2,Un("getSetting",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,fn()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Fe("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var sl=Vi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),ul=[Ei({scopes:Vi.array(sl).max(2).optional()}).optional()];function cl(e){return ll.apply(this,arguments)}function ll(){return ll=Ce((function(e){return xe(this,(function(t){return[2,Un("authorize",ul,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=null==e?void 0:e.scopes,sn(724,573)?[2,Promise.reject(mn.error.clientNotSupport())]:[4,gn(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ll.apply(this,arguments)}var dl=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n;return xe(this,(function(r){switch(r.label){case 0:return Ot.isUndefined(ZaloJavaScriptInterface)||"function"!=typeof ZaloJavaScriptInterface.checkCameraPermission?[3,2]:[4,ZaloJavaScriptInterface.checkCameraPermission()];case 1:return n=r.sent(),[2,e({userAllow:"grant"===n})];case 2:return t(mn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function pl(e){return Un("checkZaloCameraPermission",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return[4,dl()];case 1:return[2,e.sent()]}}))})))}var fl=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,wn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=wn.miniProgramConfig)||void 0===n?void 0:n.userId,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function hl(e){return ml.apply(this,arguments)}function ml(){return(ml=Ce((function(e){return xe(this,(function(t){return[2,Un("getUserID",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,fl()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Fe("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var vl=Ce((function(){return xe(this,(function(e){return[2,new Promise(function(){var e=Ce((function(e,t){var n,r,i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,wn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=wn.miniProgramConfig)||void 0===n?void 0:n.idToken,e(r),[3,3];case 2:return i=o.sent(),t(i),[3,3];case 3:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function yl(e){return gl.apply(this,arguments)}function gl(){return(gl=Ce((function(e){return xe(this,(function(t){return[2,Un("getIDToken",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,vl()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Fe("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var _l={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},wl={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Tl=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;Ct(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Gt.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:wl.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:wl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:wl.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:wl.video}var n=t.prototype;return n.on=function(t,n){Gt.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Gt.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return Ce((function(){var n,r,i,o,a,s;return xe(this,(function(u){switch(u.label){case 0:return Ot.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||wl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||wl.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return Ce((function(){var n,r;return xe(this,(function(i){return n=Gt.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=Ce((function(n,r){var i;return xe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Gt.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return Ce((function(){return xe(this,(function(t){return[2,new Promise((function(t,n){try{e._stop();var r=e.getCurrentMediaConstraints();if(!1===r.video&&!r.audio)return void t(e._facingMode);navigator.mediaDevices.getUserMedia(r).then(function(){var n=Ce((function(n){return xe(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return Ce((function(){return xe(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return Ce((function(){return xe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Gt.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||_l.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),bl=Ei({play:Vi.function(),pause:Vi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),El=[Ei({videoElement:bl,mediaConstraints:Vi.object({width:Vi.number().min(100).optional(),height:Vi.number().min(100).optional(),facingMode:Vi.string().optional(),audio:Vi.boolean().optional(),video:Vi.boolean().optional(),deviceId:Vi.string().optional(),mirrored:Vi.boolean().optional()}).nullish()}).optional()];function Pl(e){return Un("createCameraContext",El,[e],(function(e){return new Tl(e.videoElement,e.mediaConstraints)}))}var Sl=function(){function e(){var t,n;Ct(this,e),this.sdkLoaded=!1,this.queue=[];var r=window.AdtimaZMA={config:{cateId:null===(t=window.zmpGlobal)||void 0===t||null===(n=t.appInfo)||void 0===n?void 0:n.cateType,appId:window.APP_ID},queue:[],load:function(e,t){r.queue=Re(r.queue).concat([[e,t]])}}}var t=e.prototype;return t.loadSDK=function(){var e=this,t=document.createElement("script");t.src="https://adtima-static.zascdn.me/resource/js/zma/sdk.js?q=".concat(Math.floor((new Date).getTime()/864e5)),t.onload=function(){e.sdkLoaded=!0,e.processQueue()},t.onerror=function(){e.sdkLoaded=!0},document.body.appendChild(t)},t.load=function(e,t){var n;Ot.isFunction(null===(n=window.AdtimaZMA)||void 0===n?void 0:n.load)&&window.AdtimaZMA.load(e,t)},t.display=function(e){var t;this.sdkLoaded?Ot.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.display)&&window.AdtimaZMA.display(e):this.queue.push(this.display.bind(this,e))},t.refresh=function(e){var t;this.sdkLoaded?Ot.isFunction(null===(t=window.AdtimaZMA)||void 0===t?void 0:t.refresh)&&window.AdtimaZMA.refresh(e):this.queue.push(this.refresh.bind(this,e))},t.processQueue=function(){for(;this.queue.length>0;){var e=this.queue.shift();e&&e()}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}();function Il(e){return Al.apply(this,arguments)}function Al(){return(Al=Ce((function(e){return xe(this,(function(t){return[2,Un("setupAd",[],[e],(function(){return Sl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Ol=[Ei({ids:Vi.union([Vi.string(),Vi.array(Vi.string())]),config:Ei({display:Vi.boolean().optional(),onClose:Vi.function().optional()}).optional()})];function Cl(e){return kl.apply(this,arguments)}function kl(){return kl=Ce((function(e){return xe(this,(function(t){return[2,Un("loadAd",Ol,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return Sl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kl.apply(this,arguments)}var Nl=[Ei({id:Vi.string()})];function Ml(e){return Rl.apply(this,arguments)}function Rl(){return Rl=Ce((function(e){return xe(this,(function(t){return[2,Un("displayAd",Nl,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return Sl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rl.apply(this,arguments)}var xl=[Ei({id:Vi.string().optional()}).optional()];function Dl(e){return Ul.apply(this,arguments)}function Ul(){return Ul=Ce((function(e){return xe(this,(function(t){return[2,Un("refreshAd",xl,[e],function(){var e=Ce((function(e){return xe(this,(function(t){return Sl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ul.apply(this,arguments)}var Ll=[Ei({id:ci(),guidingText:ci().optional(),color:ci().optional(),onStatusChange:Vi.function().optional(),onError:Vi.function().optional()}).catchall(Vi.any())];function jl(e){return Bl.apply(this,arguments)}function Bl(){return Bl=Ce((function(e){return xe(this,(function(n){return[2,Un("showOAWidget",Ll,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u,c;return xe(this,(function(l){if(ze.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="ifOAW-".concat(e.id,"-").concat(Date.now()),(c=new URL(Ae.OA)).searchParams.set("id",u),c.searchParams.set("appId",window.APP_ID),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&c.searchParams.set("data-".concat(n),String(r))})),s.id=u,s.src=c.href,s.style.width="100%",s.style.height="100%",s.style.border="none",n.innerHTML=s.outerHTML,window.addEventListener("message",function(){var e=Ce((function(e){var t,n,i,o,a,s,l,d;return xe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(n=document.getElementById(u),i=t.type,(o=new URL(t.href)).origin!==c.origin||o.pathname!==c.pathname||t.id!==u?[3,3]:"followOA"!==i&&"getOAInfo"!==i?[3,2]:[4,wn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=wn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},Ie),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?ha(t.payload.id,"oa"):"heightChange"===i&&(n.style.height="".concat(t.payload,"px")),p.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bl.apply(this,arguments)}var Zl=[Vi.object({id:Vi.string(),type:Vi.string(),text:Vi.string(),color:Vi.string().optional(),disabled:Vi.boolean().optional(),onDataReceived:Vi.function().optional(),onError:Vi.function().optional()}).catchall(Vi.any())];function zl(e){return Wl.apply(this,arguments)}function Wl(){return Wl=Ce((function(e){return xe(this,(function(n){return[2,Un("showFunctionButtonWidget",Zl,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u;return xe(this,(function(c){if(ze.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="ifFBW-".concat(e.id,"-").concat(Date.now()),(u=new URL(Ae.FUNCTION_BUTTON)).searchParams.set("id",s),u.searchParams.set("appId",window.APP_ID),Object.entries(o).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&u.searchParams.set("data-".concat(n),String(r))})),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",Object.entries(o).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&a.setAttribute("data-".concat(n),String(r))})),n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=Ce((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return xe(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(n=document.getElementById(s),a=t.type,(c=new URL(t.href)).origin!==u.origin||c.pathname!==u.pathname||t.id!==s?[3,4]:"buttonClicked"!==a?[3,3]:[4,wn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=wn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=wn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Bn()];case 2:return m=g.sent(),null==n||null===(p=n.contentWindow)||void 0===p||p.postMessage({type:a,payload:{jwt:f,encryptKey:h,accessToken:m}},Ie),[3,4];case 3:"onSuccess"===a?(null==(v=t.payload)?void 0:v.type)===o.type&&(null==r||r(null==v?void 0:v.data)):"onError"===a&&(null==(y=t.payload)?void 0:y.type)===o.type&&(null==i||i(null==y?void 0:y.data)),g.label=4;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showFunctionButtonWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wl.apply(this,arguments)}var Fl=function(){var t=Ce((function(t,n){var r;return xe(this,(function(i){return r={},"cccd"===t&&(r={mrz:null==n?void 0:n.mrz}),[2,new Promise((function(n,i){yn("SCAN_NFC",{type:e.ScanNFCType[t],data:r},{success:function(e){if("cccd"===t){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b,E={dg1:null!==(r=e.dg1)&&void 0!==r?r:"",dg2:null!==(i=e.dg2)&&void 0!==i?i:"",dg3:null!==(o=e.dg3)&&void 0!==o?o:"",dg4:null!==(a=e.dg4)&&void 0!==a?a:"",dg5:null!==(s=e.dg5)&&void 0!==s?s:"",dg6:null!==(u=e.dg6)&&void 0!==u?u:"",dg7:null!==(c=e.dg7)&&void 0!==c?c:"",dg8:null!==(l=e.dg8)&&void 0!==l?l:"",dg9:null!==(d=e.dg9)&&void 0!==d?d:"",dg10:null!==(p=e.dg10)&&void 0!==p?p:"",dg11:null!==(f=e.dg11)&&void 0!==f?f:"",dg12:null!==(h=e.dg12)&&void 0!==h?h:"",dg13:null!==(m=e.dg13)&&void 0!==m?m:"",dg14:null!==(v=e.dg14)&&void 0!==v?v:"",dg15:null!==(y=e.dg15)&&void 0!==y?y:"",dg16:null!==(g=e.dg16)&&void 0!==g?g:"",sod:null!==(_=e.sod)&&void 0!==_?_:"",challenge:null!==(w=e.challenge)&&void 0!==w?w:"",aAResult:null!==(T=e.aAResult)&&void 0!==T?T:"",eACCAResult:null!==(b=e.eACCAResult)&&void 0!==b?b:""};n(E)}else n({})},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Gl=[Ei({type:Vi.enum(["cccd"]),data:Ei({mrz:ci().max(90)})})];function Vl(e){return Hl.apply(this,arguments)}function Hl(){return Hl=Ce((function(e){return xe(this,(function(t){return[2,Un("scanNFC",Gl,[e],function(){var e=Ce((function(e){var t,n;return xe(this,(function(r){switch(r.label){case 0:return ze.isMp?sn(754,620)?[2,Promise.reject(mn.error.clientNotSupport())]:(t=e.type,n=e.data,[4,Fl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hl.apply(this,arguments)}var Kl=Ce((function(){return xe(this,(function(e){return[2,new Promise((function(e,t){yn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function Jl(e){return ql.apply(this,arguments)}function ql(){return(ql=Ce((function(e){return xe(this,(function(t){return[2,Un("checkNFC",[],[e],Ce((function(){return xe(this,(function(e){switch(e.label){case 0:return ze.isMp?[4,Kl()]:[3,2];case 1:return[2,e.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Fe("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var Ql=[Vi.string().trim().min(1)];var Yl=[Vi.string().trim().min(1),Vi.string().trim()];var $l=[Vi.string().trim().min(1)];var Xl={getItem:function(e){return Un("getItem",Ql,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Ao.getItem(t[0])}throw Fe("getItem",{})}))},setItem:function(e,t){return Un("setItem",Yl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Ao.setItem(t[0],t[1])}throw Fe("setItem",{})}))},clear:function(){return Un("clear",[],[],(function(){if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Ao.clearStorageSync()}throw Fe("clear",{})}))},removeItem:function(e){return Un("removeItem",$l,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Ao.removeItem(t[0])}throw Fe("removeItem",{})}))},getStorageInfo:function(){return Un("getStorageInfoSync",[],[],(function(){if(ze.isMp||ze.isMpWeb){if(sn(757,625))throw mn.error.clientNotSupport();return Ao.getStorageInfoSync()}throw Fe("getStorageInfoSync",{})}))}},ed={purchase:sc,createOrder:nc,checkTransaction:hc,createOrderIAP:gc,selectPaymentMethod:dc},td=ed,nd=function(){var e=Ce((function(e,t){return xe(this,(function(n){return[2,new Promise((function(n,r){yn("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),rd=[Ei({url:Vi.string().url()}).optional()];function id(e){return od.apply(this,arguments)}function od(){return od=Ce((function(e){return xe(this,(function(t){return[2,Un("downloadFile",rd,[e],function(){var e=Ce((function(e){var t;return xe(this,(function(n){switch(n.label){case 0:return ze.isMp?(t=e.url,[4,nd(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),od.apply(this,arguments)}var ad=Vi.enum(["APP_INITIALIZING","APP_READY"]),sd=Vi.any();var ud={logEvent:function(e,t){return Un("logEvent",[ad,sd],[e,t],(function(e,t){if(ze.isMp||ze.isMpWeb){var n,r,i,o=ba(Ve({},"object"==typeof t&&null!==t?t:{}),{duration:Math.round(performance.now()),timestamp:Date.now()});return null===window||void 0===window||null===(n=window.zmpGlobal)||void 0===n||null===(r=n.eventManager)||void 0===r||null===(i=r.logEventForClient)||void 0===i||i.call(r,{type:p.DEV_TRACKING,eventCode:"APP_INITIALIZING"===e?f.APP_INITIALIZING:f.APP_READY}),nn([{action:"zmp.app.lifecycle.tracking",error:0,message:"",data:Ve({eventType:e},o)}])}throw Fe("logEvent",{})}))}},cd=[Ei({id:ci(),textColor:Vi.string().optional(),fontSize:Vi.string().optional(),buttonHeight:Vi.string().optional(),buttonColor:Vi.string().optional(),buttonTextColor:Vi.string().optional(),buttonRadius:Vi.string().optional(),buttonText:Vi.string().optional(),checkboxBGColor:Vi.string().optional(),checkboxCheckmarkColor:Vi.string().optional(),onClick:Vi.function().optional(),onStatusChange:Vi.function().optional(),onError:Vi.function().optional()}).catchall(Vi.any())];function ld(e){return dd.apply(this,arguments)}function dd(){return dd=Ce((function(e){return xe(this,(function(n){return[2,Un("showCustomOAWidget",cd,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,T,b;return xe(this,(function(E){if(ze.isMp){try{n=document.getElementById(e.id),r=e.textColor,i=e.fontSize,o=e.buttonHeight,a=e.buttonColor,s=e.buttonTextColor,u=e.buttonRadius,c=e.buttonText,l=e.checkboxBGColor,d=e.checkboxCheckmarkColor,p=e.onStatusChange,f=e.onClick,h=e.onError,m=t(e,["textColor","fontSize","buttonHeight","buttonColor","buttonTextColor","buttonRadius","buttonText","checkboxBGColor","checkboxCheckmarkColor","onStatusChange","onClick","onError"]),n&&(v=document.createElement("iframe"),y="ifCOAW-".concat(e.id,"-").concat(Date.now()),g=new URL(Ae.CUSTOM_OA),_={id:y,appId:window.APP_ID,textColor:r,fontSize:i,buttonHeight:o,buttonColor:a,buttonTextColor:s,buttonRadius:u,buttonText:c,checkboxBGColor:l,checkboxCheckmarkColor:d},Object.entries(m).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&(_["data-".concat(n)]=String(r))})),w=JSON.stringify(_),T=btoa(w),b=encodeURIComponent(T),xn(g.searchParams,"data",b),v.id=y,v.src=g.href,v.style.width="100%",v.style.height="100%",v.style.border="none",n.innerHTML=v.outerHTML,window.addEventListener("message",function(){var e=Ce((function(e){var t,n,r,i,o,a,s,u,c;return xe(this,(function(l){switch(l.label){case 0:return t=e.data,e.origin.startsWith(Ie)?(n=document.getElementById(y),r=t.type,(i=new URL(t.href)).origin!==g.origin||i.pathname!==g.pathname||t.id!==y?[3,3]:"followOA"!==r&&"getOAInfo"!==r?[3,2]:[4,wn.jumpAndGetToken()]):[3,3];case 1:return l.sent(),s=null===(o=wn.miniProgramConfig)||void 0===o?void 0:o.jwt,null==n||null===(a=n.contentWindow)||void 0===a||a.postMessage({type:r,payload:{jwt:s}},Ie),[3,3];case 2:"oaInfo"===r?null==p||p(null===(u=t.payload)||void 0===u?void 0:u.followed):"openOA"===r?ha(t.payload.id,"oa"):"heightChange"===r?n.style.height="".concat(t.payload,"px"):"onClick"===r?null==f||f(null===(c=t.payload)||void 0===c?void 0:c.status):"onError"===r&&(null==h||h(t.payload)),l.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showCustomOAWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dd.apply(this,arguments)}var pd=[Ei({id:ci(),onMethodChange:Vi.function().optional()}).catchall(Vi.any())];function fd(){return fd=Ce((function(e){return xe(this,(function(n){return[2,Un("showWidget",pd,[e],function(){var e=Ce((function(e){var n,r,i,o,a,s,u,c,l,d,p;return xe(this,(function(f){if(ze.isMp){try{n=document.getElementById(e.id),r=e.onMethodChange,i=e.fail,o=t(e,["onMethodChange","fail"]),n&&((a=document.getElementById(Se))&&(document.body.removeChild(a),a=null),a=document.createElement("iframe"),s=Se,u=new URL(Ae.CHECKOUT_KIT),c={id:s,appId:window.APP_ID},Object.entries(o).forEach((function(e){var t=He(e,2),n=t[0],r=t[1];r&&(c["data-".concat(n)]=String(r))})),l=JSON.stringify(c),d=btoa(l),p=encodeURIComponent(d),xn(u.searchParams,"data",p),a.id=s,a.src=u.href,a.style.width="100%",a.style.height="100%",a.style.border="none",n.innerHTML=a.outerHTML,window.addEventListener("message",function(){var e=Ce((function(e){var t,n,o,a,c,l,d,p,f,h;return xe(this,(function(m){switch(m.label){case 0:if(t=e.data,!e.origin.startsWith(Ie))return[3,9];if(n=t.type,o=document.getElementById(s),(a=new URL(t.href)).origin!==u.origin||a.pathname!==u.pathname||t.id!==s)return[3,9];switch(n){case"getInfo":return[3,1];case"getToken":return[3,2];case"heightChange":return[3,4];case"callAction":return[3,5];case"onMethodChange":return[3,6];case"onError":return[3,7]}return[3,8];case 1:return Dn(o,n,{appId:window.APP_ID,zaloVersion:an(),appPlatform:null===(c=Ze())||void 0===c?void 0:c.platformName}),[3,9];case 2:return[4,wn.jumpAndGetToken()];case 3:return m.sent(),d=null===(l=wn.miniProgramConfig)||void 0===l?void 0:l.jwt,Dn(o,n,{jwt:d}),[3,9];case 4:return o.style.height="".concat(t.payload,"px"),[3,9];case 5:return p=t.payload,f=p.actionName,h=p.actionData,String(f).length>0&&yn(f,h,{success:function(e){Dn(o,n,{status:0,actionName:f,data:e})},fail:function(e){Dn(o,n,{status:-1,actionName:f,data:e})}},{}),[3,9];case 6:return null==r||r.apply(void 0,Re(Object.values(t.payload))),[3,9];case 7:null==i||i(t.payload),m.label=8;case 8:return[3,9];case 9:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),!1))}catch(e){console.log(e)}return[2,Promise.resolve()]}return ze.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Fe("showWidget",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fd.apply(this,arguments)}var hd=[Ei({amount:Vi.union([Vi.string(),Vi.number()]),desc:Vi.string(),payload:Vi.object({}).catchall(Vi.any()).optional()}).catchall(Vi.any())];function md(){return md=Ce((function(e){return xe(this,(function(n){return[2,Un("purchase",hd,[e],function(){var e=Ce((function(e){return xe(this,(function(n){return ze.isMp?[2,new Promise((function(n,r){var i=document.getElementById(Se),o=new URL(Ae.CHECKOUT_KIT);if(!(i&&un(i,HTMLIFrameElement)&&i.src.startsWith(o.origin)&&i.src.includes(o.pathname)))return r(Fe("purchase",{message:"Widget not found or not initialized."}));e.amount,e.desc,e.payload;var a=t(e,["amount","desc","payload"]),s="purchase";Dn(i,s,Ve({amount:String(e.amount),desc:e.desc,payload:e.payload||{}},a)),window.addEventListener("message",function(){var e=Ce((function(e){var t,i,a;return xe(this,(function(u){if(t=e.data,e.origin.startsWith(Ie)&&(i=t.type,(a=new URL(t.href)).origin===o.origin&&a.pathname===o.pathname&&t.id===Se)){if(i===s)return[2,n(t.payload)];if("onError"===i)return[2,r(t.payload)]}return[2]}))}));return function(t){return e.apply(this,arguments)}}())}))]:ze.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Fe("purchase",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),md.apply(this,arguments)}var vd={showWidget:function(e){return fd.apply(this,arguments)},purchase:function(e){return md.apply(this,arguments)}};window.ZaloMiniAppSDK={getVersion:Fn},Ln();var yd=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},AppError:ln,login:Ln,getAccessToken:Bn,getVersion:Fn,getSystemInfo:Vn,setNavigationBarTitle:qi,setNavigationBarColor:$i,setNavigationBarLeftButton:to,setStorage:Co,getStorage:Mo,getStorageInfo:xo,removeStorage:Lo,clearStorage:Zo,getUserInfo:Go,getNetworkType:Jo,onNetworkStatusChange:Yo,startBeaconDiscovery:ea,stopBeaconDiscovery:ra,getBeacons:aa,closeApp:ca,scanQRCode:pa,openProfile:va,openChat:wa,openPostFeed:Sa,followOA:Ca,unfollowOA:Ra,openShareSheet:ja,requestCameraPermission:za,createShortcut:Ka,openBioAuthentication:Ya,checkStateBioAuthentication:es,showToast:is,hideKeyboard:ss,openPhone:ds,openSMS:ms,viewOAQr:_s,keepScreen:Es,onKeepScreen:Ss,offKeepScreen:As,saveImageToGallery:Ns,saveVideoToGallery:Ds,openMiniApp:Bs,vibrate:Fs,openWebview:Ks,getRouteParams:Qs,getAppInfo:Ys,sendDataToPreviousMiniApp:tu,getPhoneNumber:iu,openProfilePicker:uu,connectWifi:pu,openMediaPicker:vu,getShareableLink:_u,closeLoading:bu,requestUpdateZalo:Pu,onConfirmToExit:Ou,offConfirmToExit:Cu,getDeviceId:ku,getDeviceIdAsync:Nu,getContext:Ru,getContextAsync:xu,getAuthCode:Uu,getZPIToken:ju,setAccessToken:zu,openOutApp:Fu,chooseImage:Hu,getLocation:qu,onCallbackData:$u,createOrder:nc,purchase:sc,selectPaymentMethod:dc,checkTransaction:hc,createOrderIAP:gc,events:Iu,setAndroidBottomNavigationBar:Tc,setIOSBottomSafeArea:Pc,setStatusBar:Ac,configAppView:kc,minimizeApp:Rc,openPermissionSetting:Uc,favoriteApp:Bc,openGroupList:Wc,requestSendNotification:Vc,addRating:Jc,interactOA:el,interactOa:el,isAllowedInteractWithOA:rl,getSetting:ol,authorize:cl,checkZaloCameraPermission:pl,getUserID:hl,getIDToken:yl,createCameraContext:Pl,setupAd:Il,loadAd:Cl,displayAd:Ml,refreshAd:Dl,showOAWidget:jl,showFunctionButtonWidget:zl,scanNFC:Vl,checkNFC:Jl,nativeStorage:Xl,Payment:ed,CheckoutSDK:td,downloadFile:id,trackingManager:ud,showCustomOAWidget:ld,CheckoutKit:vd,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Tl}),gd=t(yd,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Ze())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,yd))}(),e.AppError=ln,e.CheckoutKit=vd,e.CheckoutSDK=td,e.EventName=e.Events,e.Payment=ed,e.ZMACameraImp=Tl,e.addRating=Jc,e.authorize=cl,e.checkNFC=Jl,e.checkStateBioAuthentication=es,e.checkTransaction=hc,e.checkZaloCameraPermission=pl,e.chooseImage=Hu,e.clearStorage=Zo,e.closeApp=ca,e.closeLoading=bu,e.configAppView=kc,e.connectWifi=pu,e.createCameraContext=Pl,e.createOrder=nc,e.createOrderIAP=gc,e.createShortcut=Ka,e.default=gd,e.displayAd=Ml,e.downloadFile=id,e.events=Iu,e.favoriteApp=Bc,e.followOA=Ca,e.getAccessToken=Bn,e.getAppInfo=Ys,e.getAuthCode=Uu,e.getBeacons=aa,e.getContext=Ru,e.getContextAsync=xu,e.getDeviceId=ku,e.getDeviceIdAsync=Nu,e.getIDToken=yl,e.getLocation=qu,e.getNetworkType=Jo,e.getPhoneNumber=iu,e.getRouteParams=Qs,e.getSetting=ol,e.getShareableLink=_u,e.getStorage=Mo,e.getStorageInfo=xo,e.getSystemInfo=Vn,e.getUserID=hl,e.getUserInfo=Go,e.getVersion=Fn,e.getZPIToken=ju,e.hideKeyboard=ss,e.interactOA=el,e.interactOa=el,e.isAllowedInteractWithOA=rl,e.keepScreen=Es,e.loadAd=Cl,e.login=Ln,e.minimizeApp=Rc,e.nativeStorage=Xl,e.offConfirmToExit=Cu,e.offKeepScreen=As,e.onCallbackData=$u,e.onConfirmToExit=Ou,e.onKeepScreen=Ss,e.onNetworkStatusChange=Yo,e.openBioAuthentication=Ya,e.openChat=wa,e.openGroupList=Wc,e.openMediaPicker=vu,e.openMiniApp=Bs,e.openOutApp=Fu,e.openPermissionSetting=Uc,e.openPhone=ds,e.openPostFeed=Sa,e.openProfile=va,e.openProfilePicker=uu,e.openSMS=ms,e.openShareSheet=ja,e.openWebview=Ks,e.purchase=sc,e.refreshAd=Dl,e.removeStorage=Lo,e.requestCameraPermission=za,e.requestSendNotification=Vc,e.requestUpdateZalo=Pu,e.saveImageToGallery=Ns,e.saveVideoToGallery=Ds,e.scanNFC=Vl,e.scanQRCode=pa,e.selectPaymentMethod=dc,e.sendDataToPreviousMiniApp=tu,e.setAccessToken=zu,e.setAndroidBottomNavigationBar=Tc,e.setIOSBottomSafeArea=Pc,e.setNavigationBarColor=$i,e.setNavigationBarLeftButton=to,e.setNavigationBarTitle=qi,e.setStatusBar=Ac,e.setStorage=Co,e.setupAd=Il,e.showCustomOAWidget=ld,e.showFunctionButtonWidget=zl,e.showOAWidget=jl,e.showToast=is,e.startBeaconDiscovery=ea,e.stopBeaconDiscovery=ra,e.trackingManager=ud,e.unfollowOA=Ra,e.vibrate=Fs,e.viewOAQr=_s,Object.defineProperty(e,"__esModule",{value:!0})}));
|