zmp-sdk 2.43.4 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/apis/downloadFile.js +1 -0
- package/apis/apis/native-storage/clear.js +1 -1
- package/apis/apis/native-storage/getItem.js +1 -1
- package/apis/apis/native-storage/getStorageInfoSync.js +1 -1
- package/apis/apis/native-storage/removeItem.js +1 -1
- package/apis/apis/native-storage/setItem.js +1 -1
- package/apis/apis/saveImageToGallery.js +1 -1
- package/apis/apis/saveVideoToGallery.js +1 -0
- package/apis/common/apis/general/saveFile.js +1 -0
- package/apis/common/apis/general/saveImageToGallery.js +1 -1
- package/apis/common/apis/general/saveVideoToGallery.js +1 -0
- package/apis/common/call/zaloNative.js +1 -1
- package/apis/constants.js +1 -1
- package/apis/index.d.ts +93 -3
- package/apis/index.es.js +1 -1
- package/apis/index.js +1 -1
- package/apis/package.json.js +1 -1
- package/apis/types/enum.js +1 -1
- package/apis/utils/common.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +98 -3
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/browser.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @timeBuild
|
|
2
|
+
* @timeBuild 16-12-2024 11:34:10
|
|
3
3
|
* @license zmp-sdk
|
|
4
4
|
*
|
|
5
5
|
* Copyright @ 2024. Zalo Group.
|
|
@@ -7,4 +7,4 @@
|
|
|
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(){"use strict";function e(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 t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={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"},l={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"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O,k,C,N,M,R,x=0,D=-2e3,U=-1400,L=-1500,j=-1401,B=-1404,Z=-1408,z=-1409,W=-2004,F=-2005,V="Success",G="Unknown error. Please try again later.",H="Request limit exceeded. Please try again later.",K="Request timeout. Please try again later.",J="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",q="Login failed",Q="This API is not supported in this version of Zalo",$="User Authentication Required. Please grant User Authentication permission before requesting User Permission",Y="Unable to pick media",X="Unable to save image",ee={SUCCESS:{code:x,message:V},UNKNOWN_ERROR:{code:D,message:G},UNAUTHORIZED:{code:j,message:J},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:B,message:Q},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:Z,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"}},te={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:{}},ne={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:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:ee.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:ee.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:ee.USER_DENIED}},iOS:{"-2":{mapTo:ee.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:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},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:{},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:F,message:X},needMoreDetail:!0},"-102":{mapTo:{code:F,message:X},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:X},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:ee.MPDS_ACTION_INVALID},"-101":{mapTo:ee.UNKNOWN_ERROR},"-105":{mapTo:ee.MPDS_SOURCE_INVALID},"-106":{mapTo:ee.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:ee.MPDS_ACTION_INVALID},"-101":{mapTo:ee.MPDS_APPID_INVALID},"-102":{mapTo:ee.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:ee.MPDS_ACTION_INVALID},"-101":{mapTo:ee.UNKNOWN_ERROR},"-105":{mapTo:ee.MPDS_SOURCE_INVALID},"-106":{mapTo:ee.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:ee.MPDS_ACTION_INVALID},"-101":{mapTo:ee.MPDS_APPID_INVALID},"-102":{mapTo:ee.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:ee.USER_DENIED},"-101":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-10":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:ee.USER_CANCEL}},iOS:{"-101":{mapTo:ee.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:ee.USER_CANCEL},999:{mapTo:{code:W,message:Y},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:Y}}}}},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:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ee.USER_DENIED},"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:ee.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ee.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:ee.UNKNOWN_ERROR},"-600":{mapTo:ee.DEVICE_NOT_SUPPORT},"-602":{mapTo:ee.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:ee.UNKNOWN_ERROR},"-600":{mapTo:ee.DEVICE_NOT_SUPPORT},"-601":{mapTo:ee.SCAN_TIMEOUT},"-602":{mapTo:ee.SERVICE_NOT_READY},"-603":{mapTo:ee.UNREADABLE},"-604":{mapTo:ee.INVALID_MRZ},"-605":{mapTo:ee.PROCESSING},"-606":{mapTo:ee.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1}},re={android:{"-4":ee.DECODE_FAILED,"-5":ee.CLIENT_NOT_SUPPORT,"-14":ee.TIME_OUT},iOS:{"-9":ee.DECODE_FAILED,"-5":ee.CLIENT_NOT_SUPPORT,"-14":ee.TIME_OUT}},ie={android:12100615,iOS:460,wp:0,unknown:0},oe=5*n,ae="https://payment-mini.zalo.me/api/order/create",se="https://payment-mini.zalo.me/api/order/iap-create",ue="https://payment-mini.zalo.me/api/transaction",ce="https://payment-mini.zalo.me/api/order/purchase",le="DEFERRED",de="IMMEDIATE_AND_CHARGE_FULL_PRICE",pe={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},fe=5,he=6,me="#1843EF",ve=0,ye={"-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 ge(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 _e(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ge(o,r,i,a,s,"next",e)}function s(e){ge(o,r,i,a,s,"throw",e)}a(void 0)}))}}function we(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 be(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Te(e,t){if(e){if("string"==typeof e)return we(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)?we(e,t):void 0}}function Ee(e){return function(e){if(Array.isArray(e))return we(e)}(e)||be(e)||Te(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 Se(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 Pe(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,Ee(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ie(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}Pe.async=function(e){return _e((function(){var t,n,r,i,o=arguments;return Se(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,Ee(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]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.multi_image=2]="multi_image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.cccd=1]="cccd"}(g||(g={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(_||(_={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(w||(w={})),function(e){e[e.oneShot=0]="oneShot"}(b||(b={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(T||(T={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(E||(E={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(S||(S={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(P||(P={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(I||(I={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(A||(A={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(O||(O={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(k||(k={})),function(e){e.FRONT="user",e.BACK="environment"}(C||(C={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(N||(N={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(M||(M={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(R||(R={}));var Ae,Oe=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function ke(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Ce(){var e=function(){var e=Pe((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:Ie(),platform:t,platformName:Oe(t),zaloVersion:ke(e).trim()}}}();if(e)return e}var Ne=(null===(Ae=Ce())||void 0===Ae?void 0:Ae.appEnv)||{};function Me(e){Me.on&&Me.engine(e)}Me.on=!1,Me.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 Re=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Me({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function De(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){xe(e,t,n[t])}))}return e}function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||be(e)||Te(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 Le="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function je(){throw new Error("setTimeout has not been defined")}function Be(){throw new Error("clearTimeout has not been defined")}var Ze=je,ze=Be;function We(e){if(Ze===setTimeout)return setTimeout(e,0);if((Ze===je||!Ze)&&setTimeout)return Ze=setTimeout,setTimeout(e,0);try{return Ze(e,0)}catch(t){try{return Ze.call(null,e,0)}catch(t){return Ze.call(this,e,0)}}}"function"==typeof Le.setTimeout&&(Ze=setTimeout),"function"==typeof Le.clearTimeout&&(ze=clearTimeout);var Fe,Ve=[],Ge=!1,He=-1;function Ke(){Ge&&Fe&&(Ge=!1,Fe.length?Ve=Fe.concat(Ve):He=-1,Ve.length&&Je())}function Je(){if(!Ge){var e=We(Ke);Ge=!0;for(var t=Ve.length;t;){for(Fe=Ve,Ve=[];++He<t;)Fe&&Fe[He].run();He=-1,t=Ve.length}Fe=null,Ge=!1,function(e){if(ze===clearTimeout)return clearTimeout(e);if((ze===Be||!ze)&&clearTimeout)return ze=clearTimeout,clearTimeout(e);try{ze(e)}catch(t){try{return ze.call(null,e)}catch(t){return ze.call(this,e)}}}(e)}}function qe(e,t){this.fun=e,this.array=t}qe.prototype.run=function(){this.fun.apply(null,this.array)};function Qe(){}var $e=Qe,Ye=Qe,Xe=Qe,et=Qe,tt=Qe,nt=Qe,rt=Qe;var it=Le.performance||{},ot=it.now||it.mozNow||it.msNow||it.oNow||it.webkitNow||function(){return(new Date).getTime()};var at=new Date;var st,ut={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];Ve.push(new qe(e,t)),1!==Ve.length||Ge||We(Je)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:$e,addListener:Ye,once:Xe,off:et,removeListener:tt,removeAllListeners:nt,emit:rt,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*ot.call(it),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-at)/1e3}},ct=ut,lt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function dt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function pt(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 lt?lt:"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 ct&&ct.env&&"true"===ct.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(!V(e))throw new TypeError;if(!H(t))throw new TypeError;return S(e,t)}if(!V(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 b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;D(n)||(n=F(n));var r=I(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function 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=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(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(G(n))if(!j(i=n.call(e)))return i;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(G(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 V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(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(!G(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(st||(st={}));var ft=Object.prototype.toString;var ht="[object Null]",mt="[object Undefined]";function vt(e){return null==e?void 0===e?mt:ht:function(e){return ft.call(e)}(e)}function yt(e){return null!=e&&"object"==typeof e}var gt={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||yt(e)&&"[object Number]"==vt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return yt(e)&&"[object RegExp]"==vt(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 _t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wt(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 bt(e){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bt(e)}function Tt(e){return bt(e)}function Et(e,t,n){return Et="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=Tt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},Et(e,t,n)}function St(e,t,n){return Et(e,t,n)}function Pt(e,t){return Pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pt(e,t)}function It(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&&Pt(e,t)}function At(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ot(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=Tt(e);if(t){var i=Tt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==dt(t)&&"function"!=typeof t?At(e):t}(this,n)}}var kt,Ct,Nt=(kt=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},kt(Ct={exports:{}},Ct.exports),Ct.exports),Mt="ACTION_CALLBACK";var Rt=function(e){It(n,e);var t=Ot(n);function n(){var e;return _t(this,n),(e=t.apply(this,arguments)).debug=pt("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===Mt||e===f.PaymentCallback)return St(Tt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return St(Tt(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===Mt)return St(Tt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return St(Tt(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(Nt);function xt(e){Rt.getInstance().emit(Mt,e)}function Dt(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){xt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=pt("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=fn(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);Rt.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){Rt.getInstance().emit(f.PaymentCallback,e,t,n)}};var Ut={encode:Dt,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:Dt(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":dt(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":dt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Lt={},jt=function(e,t,n){var r=t||"default";return function(){return(r in Lt?Lt[r](e,n):e).apply(this,arguments)}};jt.setWrapper=function(e){Lt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Bt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Zt(e){try{return null===e?Bt:JSON.parse(e)}catch(e){return Bt}}var zt,Wt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ut.encode(n);"post"!=t&&(e=Ut.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(Zt(e.responseText))},o.onerror=function(e){e.responseText?r(Zt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Ft=Wt,Vt=(zt=_e((function(e,t,n){var r,i,o,a;return Se(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},gt.isUndefined(n)||(r.currentVersion=n),i=Ut.appendToUrl(l.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 zt.apply(this,arguments)});function Gt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Ft.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Ht=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Kt=function(){var e;return"android"===((null===(e=Ce())||void 0===e?void 0:e.platformName)||"").toLowerCase()},Jt=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=Ce())||void 0===t?void 0:t.zaloVersion)||"");if(n>=24112e3)e=n;else{var r,i=((null===(r=Ce())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return e},qt=function(e,t){var n=Jt();return Kt()&&n<e||function(){var e;return"ios"===((null===(e=Ce())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function Qt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var $t,Yt=function(){function e(t,n,r,i){_t(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}(),Xt=function(e,t){return Qt(e,Yt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Qt(e,Error)?new Yt(D,e.message,t).toJSON():gt.isEmpty(null==e?void 0:e.message)||gt.isEmpty(null==e?void 0:e.code)?new Yt(D,G,t,e).toJSON():new Yt(e.code,e.message,t,e.detail).toJSON()}(e,t)},en=($t=_e((function(e){var t;return Se(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,De({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return $t.apply(this,arguments)}),tn=_e((function(){return Se(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i,o;return Se(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,cn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=cn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Yt(j,J,"getSetting")),[4,en(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Yt(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)}}())]}))})),nn=function(){var e,t,n,r=Ce(),i={},o=Rt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=hn(e.result),r=gn(null==n?void 0:n.action),o=gt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,s=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===o){var c=JSON.parse(null==n?void 0:n.data);o=gt.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,s=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:o,error_message:s,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var d=i[t],p=d.callback,f=d.timeout,h=d.isMultiCallback,m=d.options;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?gt.isFunction(r)&&r(e):gt.isFunction(i)&&i(e)}(l,p),!h&&delete i[t],f&&clearTimeout(f);var v={action:null==l?void 0:l.action,error:null==l?void 0:l.error_code,message:null==l?void 0:l.error_message,data:{}};try{if("action.open.inapp"===l.action||"action.open.outapp"===l.action){var y=new URL(null==m?void 0:m.url),g="".concat(y.protocol,"//").concat(y.host).concat(y.pathname);v.data={url:g}}if("action.follow.oa"===l.action||"action.unfollow.oa"===l.action){var _=null==m?void 0:m.uid;v.data={uid:_}}if("action.open.chat"===l.action){var w=null==m?void 0:m.uId,b=null==m?void 0:m.type;v.data={uid:w,openChatType:b}}}catch(e){}a.push(v)}},Rt.getInstance().on(Mt,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],Gt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Gt(e)}}),5e3),s=!0),n=_e((function(e,t,n,o){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,I,A;return Se(this,(function(O){switch(O.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c=Tn(e),(null==o?void 0:o.actionName)&&o.actionName.length>0&&(c=null==o?void 0:o.actionName),l=(null==o?void 0:o.isMultiCallback)||!1,d=!1!==(null==o?void 0:o.timeout)&&((null==o?void 0:o.timeout)||!0),p=(null==o?void 0:o.haveCallback)||!1,f=(null==o?void 0:o.skipJump)||!1,h=(null==o?void 0:o.requireAccessToken)||!1,m=_n(c),t&&n&&(i[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(i[u].timeout=setTimeout((function(){return xt({serialId:u,result:{error_code:Z,error_message:K,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,tn()]:[3,2];case 1:if(!1===(null==(y=O.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return xt({serialId:u,result:{error_code:j,error_message:$,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];O.label=2;case 2:return _=gn(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||gt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!pn(e)||_&&!1===_.isSupported?(xt({serialId:u,result:{error_code:B,error_message:Q,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=dn(t),f?[3,4]:[4,cn.getJSAccessToken()]);case 3:return E=O.sent(),[3,5];case 4:E="",O.label=5;case 5:T=E,O.label=6;case 6:return O.trys.push([6,10,,11]),f||!h?[3,8]:[4,cn.getAccessToken()];case 7:return P=O.sent(),[3,9];case 8:P="",O.label=9;case 9:return S=P,[3,11];case 10:return I=O.sent(),xt({serialId:u,result:{error_code:null==I?void 0:I.code,error_message:null==I?void 0:I.message,action:e}}),[2];case 11:return A=r.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,S,b,A)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),rn={success:function(e,t){return{code:x,message:t||V,data:e||{}}},error:{failLimit:function(){return new Yt(z,H)},badRequest:function(e){return new Yt(U,e)},loginFailed:function(e){return new Yt(j,"".concat(q,": ").concat(e))},loginRequired:function(){return new Yt(j,J)},cannotGetShareInfo:function(){return new Yt(L,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ye).find((function(t){return t===e.toString()}));return new Yt(e,t||G)},clientNotSupport:function(){return new Yt(B,Q)}}},on=function(e){var t,n,r,i=null===(t=Ce())||void 0===t?void 0:t.platformName,o=bn(e.action),a=ne[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new Yt(D,"Can not get auth code: ".concat(e.error_message));if(cn.jumpStatus!==h.DONE&&!s)return new Yt(ee.UNAUTHORIZED.code,ee.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new Yt(ee.FORBIDDEN.code,ee.FORBIDDEN.message);if(i&&(null===(n=re[i])||void 0===n?void 0:n[e.error_code]))return new Yt(re[i][e.error_code].code,re[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;if(null==c?void 0:c.needMoreDetail)f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message);return new Yt(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new Yt(e.error_code,e.error_message)},an=function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=gt.isEmpty(n)?void 0:n[r];if(o)return Me({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?on(i):null==i?void 0:i.data)}}return gt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=ne[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){nn(e,n,o,De({},i,a))}),s)},sn=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){gt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),un=function(){function e(){_t(this,e),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 n,o,s,u=e.prototype;return u.initRetryLimit=function(e){var t=te[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},u.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},u.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},u.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},u.jump=function(){var e=this;return _e((function(){return Se(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Me({stage:t.REQUEST,type:"log",name:"jump"}),nn("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||Gt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Gt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return _e((function(){var i;return Se(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=_e((function(e){var t,n,i;return Se(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()]}}))}))()},u.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 _e((function(){var i,o;return Se(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),gt.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(l.GET_ACCESS_TOKEN,De({method:"POST",body:i},o)).then(function(){var e=_e((function(e){var t,n,i,o;return Se(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()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return _e((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=_e((function(){return Se(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(o.getAccessTokenCount<=1||o._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Se(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(o=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(o.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?(o.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 7:if(l=m.sent(),d="zmp.getaccesstoken.fail",!a)throw o.getAccessTokenCount--,Gt([{action:d,error:-104,message:"no user auth",data:{}}]),rn.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),l?[4,t.loginZaloV4(i,u,l)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,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),Gt([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return o.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Gt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(rn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Gt([{action:d,error:-102,message:"no oauth",data:{}}]),rn.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return _e((function(){var t,n,r,i,o,a;return Se(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=gn("action.mp.user.authorize"))&&r.isSupported?[4,tn()]:[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,sn()];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]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return _e((function(){var t;return Se(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=_e((function(r){var i,o,a,s;return Se(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?gt.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{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}}])&&wt(n.prototype,o),s&&wt(n,s),e}(),cn=un.getInstance(),ln=pt("zmp:utils:common"),dn=function(e){if(gt.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=[];for(var n=e.length,r=0;r<n;r++)t.push(dn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+dn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},pn=function(e){var t,n,r=ne[e],i=(null===(t=Ce())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},fn=function(e){try{if(e){ln(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return ln("formattedValue",t,JSON.parse(t),dt(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return ln("parse json error:",t),e}},hn=function(e){if(gt.isObject(JSON)&&JSON.parse&>.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 gt.isObject(e)?e:new Function("return "+e)()},mn=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""},vn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var yn=function(e){return"hidden"===e?P.hidden:"transparent"===e?P.transparent:P.normal},gn=function(e){if(void 0!==e){var t=cn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},_n=function(e){if(void 0===e)return!1;var t=cn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},wn=function(){var e=_e((function(){return Se(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Se(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,cn.jumpAndGetToken()];case 1:return t.sent(),n=cn.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)}}(),bn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},Tn=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function En(e,t,n,r){var i,o;!function(e,t){if(te[e]){var n=cn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&cn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw Xt(rn.error.failLimit(),e);cn.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=rn.error.badRequest(s);throw c.detail=a,Xt(c,e)}u.push(i.data)}));var c=r.apply(void 0,Ee(u));return gt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!gt.isNull(a)&>.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Xt(t,e);if(!gt.isNull(s)&>.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!gt.isNull(s)&>.isFunction(s))return s(t);throw Xt(t,e)}}function Sn(e){return Pn.apply(this,arguments)}function Pn(){return(Pn=_e((function(e){return Se(this,(function(t){return[2,En("login",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,cn.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ne.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Re("login",{}))]}}))})))]}))}))).apply(this,arguments)}function In(e){return An.apply(this,arguments)}function An(){return(An=_e((function(e){return Se(this,(function(t){return[2,En("getAccessToken",[],[e],_e((function(){var e;return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,wn()]:[3,3];case 1:return e=!t.sent(),[4,cn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ne.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Re("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var On,kn="2.43.4";function Cn(){return En("getVersion",[],[],(function(){return kn}))}function Nn(){var e,t;return{version:mn("version-id")||"",apiVersion:kn,zaloVersion:(null===(e=Ce())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Ce())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Mn(){return En("getSystemInfo",[],[],(function(){return Nn()}))}!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}(On||(On={}));const Rn=On.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xn=e=>{switch(typeof e){case"undefined":return Rn.undefined;case"string":return Rn.string;case"number":return isNaN(e)?Rn.nan:Rn.number;case"boolean":return Rn.boolean;case"function":return Rn.function;case"bigint":return Rn.bigint;case"symbol":return Rn.symbol;case"object":return Array.isArray(e)?Rn.array:null===e?Rn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Rn.promise:"undefined"!=typeof Map&&e instanceof Map?Rn.map:"undefined"!=typeof Set&&e instanceof Set?Rn.set:"undefined"!=typeof Date&&e instanceof Date?Rn.date:Rn.object;default:return Rn.unknown}},Dn=On.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 Un 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,On.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()}}Un.create=e=>new Un(e);const Ln=(e,t)=>{let n;switch(e.code){case Dn.invalid_type:n=e.received===Rn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Dn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,On.jsonStringifyReplacer)}`;break;case Dn.unrecognized_keys:n=`Unrecognized key(s) in object: ${On.joinValues(e.keys,", ")}`;break;case Dn.invalid_union:n="Invalid input";break;case Dn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${On.joinValues(e.options)}`;break;case Dn.invalid_enum_value:n=`Invalid enum value. Expected ${On.joinValues(e.options)}, received '${e.received}'`;break;case Dn.invalid_arguments:n="Invalid function arguments";break;case Dn.invalid_return_type:n="Invalid function return type";break;case Dn.invalid_date:n="Invalid date";break;case Dn.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}"`:On.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Dn.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 Dn.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 Dn.custom:n="Invalid input";break;case Dn.invalid_intersection_types:n="Intersection results could not be merged";break;case Dn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Dn.not_finite:n="Number must be finite";break;default:n=t.defaultError,On.assertNever(e)}return{message:n}};let jn=Ln;function Bn(){return jn}const Zn=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 zn(e,t){const n=Zn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Bn(),Ln].filter((e=>!!e))});e.common.issues.push(n)}class Wn{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 Fn;"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 Wn.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 Fn;if("aborted"===i.status)return Fn;"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 Fn=Object.freeze({status:"aborted"}),Vn=e=>({status:"dirty",value:e}),Gn=e=>({status:"valid",value:e}),Hn=e=>"aborted"===e.status,Kn=e=>"dirty"===e.status,Jn=e=>"valid"===e.status,qn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Qn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Qn||(Qn={}));class $n{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 Yn=(e,t)=>{if(Jn(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 Un(e.common.issues)}};function Xn(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 er{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 xn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Wn,ctx:{common:e.parent.common,data:e.data,parsedType:xn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(qn(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:xn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Yn(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:xn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(qn(r)?r:Promise.resolve(r));return Yn(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:Dn.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 jr({schema:this,typeName:qr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Br.create(this,this._def)}nullable(){return Zr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gr.create(this,this._def)}promise(){return Lr.create(this,this._def)}or(e){return Tr.create([this,e],this._def)}and(e){return Ir.create(this,e,this._def)}transform(e){return new jr({...Xn(this._def),schema:this,typeName:qr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new zr({...Xn(this._def),innerType:this,defaultValue:t,typeName:qr.ZodDefault})}brand(){return new Gr({typeName:qr.ZodBranded,type:this,...Xn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Wr({...Xn(this._def),innerType:this,catchValue:t,typeName:qr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Hr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tr=/^c[^\s-]{8,}$/i,nr=/^[a-z][a-z0-9]*$/,rr=/^([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,ir=/^(([^<>()[\]\\.,;:\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 or extends er{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Dn.invalid_string,...Qn.errToObj(n)}),this.nonempty=e=>this.min(1,Qn.errToObj(e)),this.trim=()=>new or({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Rn.string){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.string,received:t.parsedType}),Fn}const t=new Wn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),zn(n,{code:Dn.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),zn(n,{code:Dn.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?zn(n,{code:Dn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&zn(n,{code:Dn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)ir.test(e.data)||(n=this._getOrReturnCtx(e,n),zn(n,{validation:"email",code:Dn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)rr.test(e.data)||(n=this._getOrReturnCtx(e,n),zn(n,{validation:"uuid",code:Dn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)tr.test(e.data)||(n=this._getOrReturnCtx(e,n),zn(n,{validation:"cuid",code:Dn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)nr.test(e.data)||(n=this._getOrReturnCtx(e,n),zn(n,{validation:"cuid2",code:Dn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),zn(n,{validation:"url",code:Dn.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),zn(n,{validation:"regex",code:Dn.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),zn(n,{code:Dn.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),zn(n,{code:Dn.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),zn(n,{code:Dn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else On.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Qn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Qn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Qn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Qn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Qn.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,...Qn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Qn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Qn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Qn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Qn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Qn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Qn.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 ar(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)}or.create=e=>{var t;return new or({checks:[],typeName:qr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Xn(e)})};class sr extends er{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)!==Rn.number){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.number,received:t.parsedType}),Fn}let t;const n=new Wn;for(const r of this._def.checks)if("int"===r.kind)On.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),zn(t,{code:Dn.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),zn(t,{code:Dn.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),zn(t,{code:Dn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==ar(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),zn(t,{code:Dn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),zn(t,{code:Dn.not_finite,message:r.message}),n.dirty()):On.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Qn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Qn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Qn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Qn.toString(t))}setLimit(e,t,n,r){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Qn.toString(r)}]})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Qn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Qn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Qn.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&&On.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)}}sr.create=e=>new sr({checks:[],typeName:qr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Xn(e)});class ur extends er{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Rn.bigint){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.bigint,received:t.parsedType}),Fn}return Gn(e.data)}}ur.create=e=>{var t;return new ur({typeName:qr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Xn(e)})};class cr extends er{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Rn.boolean){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.boolean,received:t.parsedType}),Fn}return Gn(e.data)}}cr.create=e=>new cr({typeName:qr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Xn(e)});class lr extends er{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Rn.date){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.date,received:t.parsedType}),Fn}if(isNaN(e.data.getTime())){return zn(this._getOrReturnCtx(e),{code:Dn.invalid_date}),Fn}const t=new Wn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),zn(n,{code:Dn.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),zn(n,{code:Dn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):On.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new lr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Qn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Qn.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}}lr.create=e=>new lr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:qr.ZodDate,...Xn(e)});class dr extends er{_parse(e){if(this._getType(e)!==Rn.symbol){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.symbol,received:t.parsedType}),Fn}return Gn(e.data)}}dr.create=e=>new dr({typeName:qr.ZodSymbol,...Xn(e)});class pr extends er{_parse(e){if(this._getType(e)!==Rn.undefined){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.undefined,received:t.parsedType}),Fn}return Gn(e.data)}}pr.create=e=>new pr({typeName:qr.ZodUndefined,...Xn(e)});class fr extends er{_parse(e){if(this._getType(e)!==Rn.null){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.null,received:t.parsedType}),Fn}return Gn(e.data)}}fr.create=e=>new fr({typeName:qr.ZodNull,...Xn(e)});class hr extends er{constructor(){super(...arguments),this._any=!0}_parse(e){return Gn(e.data)}}hr.create=e=>new hr({typeName:qr.ZodAny,...Xn(e)});class mr extends er{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Gn(e.data)}}mr.create=e=>new mr({typeName:qr.ZodUnknown,...Xn(e)});class vr extends er{_parse(e){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.never,received:t.parsedType}),Fn}}vr.create=e=>new vr({typeName:qr.ZodNever,...Xn(e)});class yr extends er{_parse(e){if(this._getType(e)!==Rn.undefined){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.void,received:t.parsedType}),Fn}return Gn(e.data)}}yr.create=e=>new yr({typeName:qr.ZodVoid,...Xn(e)});class gr extends er{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Rn.array)return zn(t,{code:Dn.invalid_type,expected:Rn.array,received:t.parsedType}),Fn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(zn(t,{code:e?Dn.too_big:Dn.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&&(zn(t,{code:Dn.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&&(zn(t,{code:Dn.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 $n(t,e,t.path,n))))).then((e=>Wn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new $n(t,e,t.path,n))));return Wn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new gr({...this._def,minLength:{value:e,message:Qn.toString(t)}})}max(e,t){return new gr({...this._def,maxLength:{value:e,message:Qn.toString(t)}})}length(e,t){return new gr({...this._def,exactLength:{value:e,message:Qn.toString(t)}})}nonempty(e){return this.min(1,e)}}var _r;function wr(e){if(e instanceof br){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Br.create(wr(r))}return new br({...e._def,shape:()=>t})}return e instanceof gr?gr.create(wr(e.element)):e instanceof Br?Br.create(wr(e.unwrap())):e instanceof Zr?Zr.create(wr(e.unwrap())):e instanceof Ar?Ar.create(e.items.map((e=>wr(e)))):e}gr.create=(e,t)=>new gr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qr.ZodArray,...Xn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(_r||(_r={}));class br extends er{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=On.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Rn.object){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.object,received:t.parsedType}),Fn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof vr&&"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 $n(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof vr){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&&(zn(n,{code:Dn.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 $n(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=>Wn.mergeObjectSync(t,e))):Wn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Qn.errToObj,new br({...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=Qn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new br({...this._def,unknownKeys:"strip"})}passthrough(){return new br({...this._def,unknownKeys:"passthrough"})}extend(e){return new br({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new br({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>_r.mergeShapes(this._def.shape(),e._def.shape()),typeName:qr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new br({...this._def,catchall:e})}pick(e){const t={};return On.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new br({...this._def,shape:()=>t})}omit(e){const t={};return On.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new br({...this._def,shape:()=>t})}deepPartial(){return wr(this)}partial(e){const t={};return On.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new br({...this._def,shape:()=>t})}required(e){const t={};return On.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Br;)e=e._def.innerType;t[n]=e}})),new br({...this._def,shape:()=>t})}keyof(){return xr(On.objectKeys(this.shape))}}br.create=(e,t)=>new br({shape:()=>e,unknownKeys:"strip",catchall:vr.create(),typeName:qr.ZodObject,...Xn(t)}),br.strictCreate=(e,t)=>new br({shape:()=>e,unknownKeys:"strict",catchall:vr.create(),typeName:qr.ZodObject,...Xn(t)}),br.lazycreate=(e,t)=>new br({shape:e,unknownKeys:"strip",catchall:vr.create(),typeName:qr.ZodObject,...Xn(t)});class Tr extends er{_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 Un(e.ctx.common.issues)));return zn(t,{code:Dn.invalid_union,unionErrors:n}),Fn}));{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 Un(e)));return zn(t,{code:Dn.invalid_union,unionErrors:i}),Fn}}get options(){return this._def.options}}Tr.create=(e,t)=>new Tr({options:e,typeName:qr.ZodUnion,...Xn(t)});const Er=e=>e instanceof Mr?Er(e.schema):e instanceof jr?Er(e.innerType()):e instanceof Rr?[e.value]:e instanceof Dr?e.options:e instanceof Ur?Object.keys(e.enum):e instanceof zr?Er(e._def.innerType):e instanceof pr?[void 0]:e instanceof fr?[null]:null;class Sr extends er{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Rn.object)return zn(t,{code:Dn.invalid_type,expected:Rn.object,received:t.parsedType}),Fn;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}):(zn(t,{code:Dn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Fn)}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=Er(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 Sr({typeName:qr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Xn(n)})}}function Pr(e,t){const n=xn(e),r=xn(t);if(e===t)return{valid:!0,data:e};if(n===Rn.object&&r===Rn.object){const n=On.objectKeys(t),r=On.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=Pr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Rn.array&&r===Rn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Pr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Rn.date&&r===Rn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ir extends er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Hn(e)||Hn(r))return Fn;const i=Pr(e.value,r.value);return i.valid?((Kn(e)||Kn(r))&&t.dirty(),{status:t.value,value:i.data}):(zn(n,{code:Dn.invalid_intersection_types}),Fn)};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}))}}Ir.create=(e,t,n)=>new Ir({left:e,right:t,typeName:qr.ZodIntersection,...Xn(n)});class Ar extends er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.array)return zn(n,{code:Dn.invalid_type,expected:Rn.array,received:n.parsedType}),Fn;if(n.data.length<this._def.items.length)return zn(n,{code:Dn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Fn;!this._def.rest&&n.data.length>this._def.items.length&&(zn(n,{code:Dn.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 $n(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Wn.mergeArray(t,e))):Wn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Ar({...this._def,rest:e})}}Ar.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ar({items:e,typeName:qr.ZodTuple,rest:null,...Xn(t)})};class Or extends er{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!==Rn.object)return zn(n,{code:Dn.invalid_type,expected:Rn.object,received:n.parsedType}),Fn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new $n(n,e,n.path,e)),value:o._parse(new $n(n,n.data[e],n.path,e))});return n.common.async?Wn.mergeObjectAsync(t,r):Wn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Or(t instanceof er?{keyType:e,valueType:t,typeName:qr.ZodRecord,...Xn(n)}:{keyType:or.create(),valueType:e,typeName:qr.ZodRecord,...Xn(t)})}}class kr extends er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.map)return zn(n,{code:Dn.invalid_type,expected:Rn.map,received:n.parsedType}),Fn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new $n(n,e,n.path,[o,"key"])),value:i._parse(new $n(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 Fn;"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 Fn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}kr.create=(e,t,n)=>new kr({valueType:t,keyType:e,typeName:qr.ZodMap,...Xn(n)});class Cr extends er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.set)return zn(n,{code:Dn.invalid_type,expected:Rn.set,received:n.parsedType}),Fn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(zn(n,{code:Dn.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&&(zn(n,{code:Dn.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 Fn;"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 $n(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Cr({...this._def,minSize:{value:e,message:Qn.toString(t)}})}max(e,t){return new Cr({...this._def,maxSize:{value:e,message:Qn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Cr.create=(e,t)=>new Cr({valueType:e,minSize:null,maxSize:null,typeName:qr.ZodSet,...Xn(t)});class Nr extends er{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Rn.function)return zn(t,{code:Dn.invalid_type,expected:Rn.function,received:t.parsedType}),Fn;function n(e,n){return Zn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bn(),Ln].filter((e=>!!e)),issueData:{code:Dn.invalid_arguments,argumentsError:n}})}function r(e,n){return Zn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bn(),Ln].filter((e=>!!e)),issueData:{code:Dn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Lr?Gn((async(...e)=>{const t=new Un([]),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}))})):Gn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Un([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Un([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Nr({...this._def,args:Ar.create(e).rest(mr.create())})}returns(e){return new Nr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Nr({args:e||Ar.create([]).rest(mr.create()),returns:t||mr.create(),typeName:qr.ZodFunction,...Xn(n)})}}class Mr extends er{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})}}Mr.create=(e,t)=>new Mr({getter:e,typeName:qr.ZodLazy,...Xn(t)});class Rr extends er{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return zn(t,{received:t.data,code:Dn.invalid_literal,expected:this._def.value}),Fn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function xr(e,t){return new Dr({values:e,typeName:qr.ZodEnum,...Xn(t)})}Rr.create=(e,t)=>new Rr({value:e,typeName:qr.ZodLiteral,...Xn(t)});class Dr extends er{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return zn(t,{expected:On.joinValues(n),received:t.parsedType,code:Dn.invalid_type}),Fn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return zn(t,{received:t.data,code:Dn.invalid_enum_value,options:n}),Fn}return Gn(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 Dr.create(e)}exclude(e){return Dr.create(this.options.filter((t=>!e.includes(t))))}}Dr.create=xr;class Ur extends er{_parse(e){const t=On.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Rn.string&&n.parsedType!==Rn.number){const e=On.objectValues(t);return zn(n,{expected:On.joinValues(e),received:n.parsedType,code:Dn.invalid_type}),Fn}if(-1===t.indexOf(e.data)){const e=On.objectValues(t);return zn(n,{received:n.data,code:Dn.invalid_enum_value,options:e}),Fn}return Gn(e.data)}get enum(){return this._def.values}}Ur.create=(e,t)=>new Ur({values:e,typeName:qr.ZodNativeEnum,...Xn(t)});class Lr extends er{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Rn.promise&&!1===t.common.async)return zn(t,{code:Dn.invalid_type,expected:Rn.promise,received:t.parsedType}),Fn;const n=t.parsedType===Rn.promise?t.data:Promise.resolve(t.data);return Gn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Lr.create=(e,t)=>new Lr({type:e,typeName:qr.ZodPromise,...Xn(t)});class jr extends er{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qr.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=>{zn(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?Fn:("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?Fn:("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(!Jn(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=>Jn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}On.assertNever(r)}}jr.create=(e,t,n)=>new jr({schema:e,typeName:qr.ZodEffects,effect:t,...Xn(n)}),jr.createWithPreprocess=(e,t,n)=>new jr({schema:t,effect:{type:"preprocess",transform:e},typeName:qr.ZodEffects,...Xn(n)});class Br extends er{_parse(e){return this._getType(e)===Rn.undefined?Gn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Br.create=(e,t)=>new Br({innerType:e,typeName:qr.ZodOptional,...Xn(t)});class Zr extends er{_parse(e){return this._getType(e)===Rn.null?Gn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zr.create=(e,t)=>new Zr({innerType:e,typeName:qr.ZodNullable,...Xn(t)});class zr extends er{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Rn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}zr.create=(e,t)=>new zr({innerType:e,typeName:qr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Xn(t)});class Wr extends er{_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 qn(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}}Wr.create=(e,t)=>new Wr({innerType:e,typeName:qr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Xn(t)});class Fr extends er{_parse(e){if(this._getType(e)!==Rn.nan){const t=this._getOrReturnCtx(e);return zn(t,{code:Dn.invalid_type,expected:Rn.nan,received:t.parsedType}),Fn}return{status:"valid",value:e.data}}}Fr.create=e=>new Fr({typeName:qr.ZodNaN,...Xn(e)});const Vr=Symbol("zod_brand");class Gr extends er{_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 Hr extends er{_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?Fn:"dirty"===e.status?(t.dirty(),Vn(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?Fn:"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 Hr({in:e,out:t,typeName:qr.ZodPipeline})}}const Kr=(e,t={},n)=>e?hr.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})}})):hr.create(),Jr={object:br.lazycreate};var qr;!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"}(qr||(qr={}));const Qr=or.create,$r=sr.create,Yr=Fr.create,Xr=ur.create,ei=cr.create,ti=lr.create,ni=dr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=mr.create,si=vr.create,ui=yr.create,ci=gr.create,li=br.create,di=br.strictCreate,pi=Tr.create,fi=Sr.create,hi=Ir.create,mi=Ar.create,vi=Or.create,yi=kr.create,gi=Cr.create,_i=Nr.create,wi=Mr.create,bi=Rr.create,Ti=Dr.create,Ei=Ur.create,Si=Lr.create,Pi=jr.create,Ii=Br.create,Ai=Zr.create,Oi=jr.createWithPreprocess,ki=Hr.create,Ci={string:e=>or.create({...e,coerce:!0}),number:e=>sr.create({...e,coerce:!0}),boolean:e=>cr.create({...e,coerce:!0}),bigint:e=>ur.create({...e,coerce:!0}),date:e=>lr.create({...e,coerce:!0})},Ni=Fn;var Mi=Object.freeze({__proto__:null,defaultErrorMap:Ln,setErrorMap:function(e){jn=e},getErrorMap:Bn,makeIssue:Zn,EMPTY_PATH:[],addIssueToContext:zn,ParseStatus:Wn,INVALID:Fn,DIRTY:Vn,OK:Gn,isAborted:Hn,isDirty:Kn,isValid:Jn,isAsync:qn,get util(){return On},ZodParsedType:Rn,getParsedType:xn,ZodType:er,ZodString:or,ZodNumber:sr,ZodBigInt:ur,ZodBoolean:cr,ZodDate:lr,ZodSymbol:dr,ZodUndefined:pr,ZodNull:fr,ZodAny:hr,ZodUnknown:mr,ZodNever:vr,ZodVoid:yr,ZodArray:gr,get objectUtil(){return _r},ZodObject:br,ZodUnion:Tr,ZodDiscriminatedUnion:Sr,ZodIntersection:Ir,ZodTuple:Ar,ZodRecord:Or,ZodMap:kr,ZodSet:Cr,ZodFunction:Nr,ZodLazy:Mr,ZodLiteral:Rr,ZodEnum:Dr,ZodNativeEnum:Ur,ZodPromise:Lr,ZodEffects:jr,ZodTransformer:jr,ZodOptional:Br,ZodNullable:Zr,ZodDefault:zr,ZodCatch:Wr,ZodNaN:Fr,BRAND:Vr,ZodBranded:Gr,ZodPipeline:Hr,custom:Kr,Schema:er,ZodSchema:er,late:Jr,get ZodFirstPartyTypeKind(){return qr},coerce:Ci,any:oi,array:ci,bigint:Xr,boolean:ei,date:ti,discriminatedUnion:fi,effect:Pi,enum:Ti,function:_i,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Kr((t=>t instanceof e),t,!0),intersection:hi,lazy:wi,literal:bi,map:yi,nan:Yr,nativeEnum:Ei,never:si,null:ii,nullable:Ai,number:$r,object:li,oboolean:()=>ei().optional(),onumber:()=>$r().optional(),optional:Ii,ostring:()=>Qr().optional(),pipeline:ki,preprocess:Oi,promise:Si,record:vi,set:gi,strictObject:di,string:Qr,symbol:ni,transformer:Pi,tuple:mi,undefined:ri,union:pi,unknown:ai,void:ui,NEVER:Ni,ZodIssueCode:Dn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Un}),Ri=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O,k;_t(this,e),this.initConfig=window.APP_CONFIG;var C=gt.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?fe:he;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)?pe.HIDE_BACK:pe.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)?pe.SHOW_HOME:pe.HIDE_HOME,D=new URL(location.href),U=yn(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.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)?he:fe);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)||me,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)||ve,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(D.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return _e((function(){return Se(this,(function(t){return[2,new Promise((function(t,n){an("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return _e((function(){var r,i;return Se(this,(function(o){return void 0===(void 0===e?"undefined":dt(e))&&null===(void 0===e?"undefined":dt(e))||(r="none"===e||"home"===e?pe.HIDE_BACK:pe.SHOW_BACK,i="home"===e||"both"===e?pe.SHOW_HOME:pe.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){an("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",De({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return _e((function(){var n,r,i;return Se(this,(function(o){return r=e?I.hide:I.show,i=null===(n=Ce())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();an("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return _e((function(){var n,r,i;return Se(this,(function(o){return r=e?A.hide:A.show,i=null===(n=Ce())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();an("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return _e((function(){var n;return Se(this,(function(r){return n=t.config,gt.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),gt.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),gt.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=O.left:"center"===e.textAlign&&(n.dataConfig.textAlign=O.center)),!0===e.hideActionBar?n.actionbarType=he:!1===e.hideActionBar&&(n.actionbarType=fe),"normal"===e.statusBarType?n.statusbarType=P.normal:"hidden"===e.statusBarType?n.statusbarType=P.hidden:"transparent"===e.statusBarType&&(n.statusbarType=P.transparent),[2,new Promise((function(r,i){an("CHANGE_ACTIONBAR",De({},n),{success:function(){var i;t.config=De({},n);var o,a=null===(i=Ce())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===P.hidden?"hidden":o===P.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===he;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),xi=Ri.getInstance(),Di=[li({title:Qr()}).optional()];function Ui(e){return Li.apply(this,arguments)}function Li(){return Li=_e((function(e){return Se(this,(function(t){return[2,En("setNavigationBarTitle",Di,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xi.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Li.apply(this,arguments)}var ji=[li({color:Qr(),textColor:Mi.enum(["black","white"]).optional(),statusBarColor:Qr().optional()}).optional()];function Bi(e){return Zi.apply(this,arguments)}function Zi(){return Zi=_e((function(e){return Se(this,(function(t){return[2,En("setNavigationBarColor",ji,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xi.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 Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zi.apply(this,arguments)}var zi=[li({type:Mi.enum(["none","back","home","both"])}).optional()];function Wi(e){return Fi.apply(this,arguments)}function Fi(){return Fi=_e((function(e){return Se(this,(function(t){return[2,En("setNavigationBarLeftButton",zi,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xi.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fi.apply(this,arguments)}function Vi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Gi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Vi(e,t,"get"))}function Hi(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 Ki(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,Vi(e,t,"set"),n),n}var Ji,qi,Qi,$i=function(){function e(){_t(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(xe({},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}(),Yi=new WeakMap,Xi=new WeakMap,eo=new WeakMap,to=function(e){It(n,e);var t=Ot(n);function n(e){var r;return _t(this,n),Hi(At(r=t.call(this)),Yi,{writable:!0,value:localStorage}),Hi(At(r),Xi,{writable:!0,value:void 0}),Hi(At(r),eo,{writable:!0,value:void 0}),Ki(At(r),eo,{keys:new Set,currentSize:0,limitSize:oe}),Ki(At(r),Xi,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in Gi(this,Yi)){if(e)if(t.split("_")[0]!==e)continue;Gi(this,eo).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 Gi(this,Xi)&&(e="".concat(Gi(this,Xi),"_").concat(e)),Gi(this,eo).keys.has(e)?Gi(this,Yi).getItem(e):null},r.set=function(e){var t=this;return _e((function(){return Se(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ue(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){Gi(this,Xi)&&(e="".concat(Gi(this,Xi),"_").concat(e)),Gi(this,Yi).setItem(e,t),Gi(this,eo).keys.add(e)},r.getInfo=function(){var e=this;return _e((function(){return Se(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}(Gi(this,Yi),Gi(this,Xi));return{currentSize:gt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((oe/1024).toFixed(2))}},r.remove=function(e){var t=this;return _e((function(){return Se(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){Gi(this,Xi)&&(e="".concat(Gi(this,Xi),"_").concat(e)),Gi(this,eo).keys.has(e)&&(Gi(this,Yi).removeItem(e),Gi(this,eo).keys.delete(e))},r.clearAsync=function(){var e=this;return _e((function(){return Se(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;Gi(this,eo).keys.forEach((function(t){Gi(e,Xi)&&t.indexOf(Gi(e,Xi))<0||(Gi(e,Yi).removeItem(t),Gi(e,eo).keys.delete(t))}))},n}($i),no=new WeakMap,ro=new WeakMap,io=function(e){It(n,e);var t=Ot(n);function n(e){var r;return _t(this,n),Hi(At(r=t.call(this)),no,{writable:!0,value:void 0}),Hi(At(r),ro,{writable:!0,value:void 0}),Ki(At(r),ro,{keys:new Set,currentSize:0,limitSize:oe}),Ki(At(r),no,e),r}var r=n.prototype;return r.get=function(e){var t=this;return _e((function(){return Se(this,(function(n){return[2,new Promise((function(n,r){an("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Gi(t,no)},{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:Gi(this,no)},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 _e((function(){return Se(this,(function(n){return[2,new Promise((function(n,r){an("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Gi(t,no)},{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:Gi(this,no)},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 _e((function(){return Se(this,(function(t){return[2,new Promise((function(t,n){an("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Gi(e,no)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:gt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(oe/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:Gi(this,no)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:gt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(oe/1024)}},r.remove=function(e){var t=this;return _e((function(){return Se(this,(function(n){return[2,new Promise((function(n,r){an("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Gi(t,no)},{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:Gi(this,no)},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 _e((function(){return Se(this,(function(t){return[2,new Promise((function(t,n){an("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Gi(e,no)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:Gi(this,no)};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=on(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}($i),oo=function(){function e(){_t(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return _e((function(){var n,r;return Se(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]=fn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return _e((function(){var n,r;return Se(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ue(e,2),n=t[0],i=t[1];gt.isUndefined(i)||gt.isNull(i)||(r[n]=vn(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 _e((function(){return Se(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 _e((function(){return Se(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 _e((function(){return Se(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}(),ao=new WeakMap,so=function(e){It(n,e);var t=Ot(n);function n(e){var r;return _t(this,n),Hi(At(r=t.call(this)),ao,{writable:!0,value:void 0}),Ki(At(r),ao,e),r}return n.prototype.getInstance=function(){return new to(Gi(this,ao))},n}(oo),uo=new WeakMap,co=function(e){It(n,e);var t=Ot(n);function n(e){var r;return _t(this,n),Hi(At(r=t.call(this)),uo,{writable:!0,value:void 0}),Ki(At(r),uo,e),r}return n.prototype.getInstance=function(){return new io(Gi(this,uo))},n}(oo),lo=new so(i),po=(null===(Ji=Ce())||void 0===Ji?void 0:Ji.zaloVersion)||"",fo=(null===(qi=Ce())||void 0===qi?void 0:qi.platformName)||"unknown";!!gt.isString(po)&&parseInt(po,10)>={android:12100571,iOS:400,wp:0,unknown:0}[fo]&&(null===(Qi=Ce())||void 0===Qi?void 0:Qi.appEnv.isMp)&&(lo=new co(i));var ho=lo,mo=[li({data:Mi.record(Qr(),Mi.any())}).optional()];function vo(e){return yo.apply(this,arguments)}function yo(){return yo=_e((function(e){return Se(this,(function(t){return[2,En("setStorage",mo,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,ho.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),yo.apply(this,arguments)}var go=[li({keys:Mi.array(Qr())}).optional()];function _o(e){return wo.apply(this,arguments)}function wo(){return wo=_e((function(e){return Se(this,(function(t){return[2,En("getStorage",go,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,ho.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wo.apply(this,arguments)}function bo(e){return To.apply(this,arguments)}function To(){return(To=_e((function(e){return Se(this,(function(t){return[2,En("getStorageInfo",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,ho.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Eo=[li({keys:Mi.array(Qr())}).optional()];function So(e){return Po.apply(this,arguments)}function Po(){return Po=_e((function(e){return Se(this,(function(t){return[2,En("removeStorage",Eo,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,ho.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Re("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Po.apply(this,arguments)}var Io=[li({prefix:Qr().optional()}).optional()];function Ao(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=_e((function(e){return Se(this,(function(t){return[2,En("clearStorage",Io,[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,ho.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var ko=function(){var e=_e((function(e,t){var n,r,o,a;return Se(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,wn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,cn.getAccessToken(n)];case 3:return o=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(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=_e((function(e){var t,n,r,i;return Se(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=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:i,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)}}(),Co=[li({avatarType:Mi.enum(["small","normal","large"]).optional(),autoRequestPermission:Mi.boolean().default(!1).optional()}).optional()];function No(e){return Mo.apply(this,arguments)}function Mo(){return Mo=_e((function(e){return Se(this,(function(t){return[2,En("getUserInfo",Co,[e],function(){var e=_e((function(e){var t,n;return Se(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,ko(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Re("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mo.apply(this,arguments)}var Ro=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},xo=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=Ce())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case Ro(a).NONE:i=d.none;break;case Ro(a).WIFI:i=d.wifi;break;case Ro(a)["2G"]:case Ro(a)["3G"]:case Ro(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function Do(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=_e((function(e){return Se(this,(function(t){return[2,En("getNetworkType",[],[e],_e((function(){var e,t;return Se(this,(function(n){switch(n.label){case 0:return Ne.isMp?[4,xo()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(Ne.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Re("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Lo=[Mi.function().args(li({isConnected:Mi.boolean(),networkType:Mi.enum(["none","wifi","cellular","unknown"])})).returns(Mi.void())];function jo(e){return En("onNetworkStatusChange",Lo,[e],(function(e){var t=e;if(Ne.isMp)!function(e){Rt.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;xo().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(Ne.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var Bo=function(){var e=_e((function(e){var t,n,r,i,o,a;return Se(this,(function(s){return a={subaction:0,scanning_type:gt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:gt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:gt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:gt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:gt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:gt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:gt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:gt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:gt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:gt.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){an("SCAN_IBEACON",De({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Zo=[li({scanningType:Mi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Mi.number().optional(),monitorInterval:Mi.number().optional(),domain:Mi.string().optional(),scanConfig:li({scanTime:Mi.number().optional(),timeBetweenScan:Mi.number().optional(),beaconTimeout:Mi.number().optional(),delayCheckConnectedTimeout:Mi.number().optional(),beaconConnectedTimeout:Mi.number().optional()}).optional(),items:Mi.array(li({id:Mi.string().optional(),distance:Mi.number().optional(),monitor:li({enable:Mi.boolean().optional(),movingRange:Mi.number().optional()}).optional()})).optional(),scanFromSource:Mi.string().optional()}).optional()];function zo(e){return Wo.apply(this,arguments)}function Wo(){return(Wo=_e((function(e){return Se(this,(function(t){return[2,En("startBeaconDiscovery",Zo,[e],_e((function(){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Bo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Re("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Fo=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Vo(e){return Go.apply(this,arguments)}function Go(){return(Go=_e((function(e){return Se(this,(function(t){return[2,En("stopBeaconDiscovery",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Fo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Re("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ho=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("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 Ko(e){return Jo.apply(this,arguments)}function Jo(){return(Jo=_e((function(e){return Se(this,(function(t){return[2,En("getBeacons",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ho()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Re("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var qo=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Qo(e){return $o.apply(this,arguments)}function $o(){return($o=_e((function(e){return Se(this,(function(t){return[2,En("closeApp",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,qo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Yo=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Xo(e){return ea.apply(this,arguments)}function ea(){return(ea=_e((function(e){return Se(this,(function(t){return[2,En("scanQRCode",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Yo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Re("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var ta=function(){var e=_e((function(e,t,n,i){return Se(this,(function(o){return[2,new Promise((function(o,a){an("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),na=[li({id:Qr(),type:Mi.enum(["user","oa","aliasOA"]),sourceId:Mi.any().optional(),sourceIndex:Mi.any().optional()}).optional()];function ra(e){return ia.apply(this,arguments)}function ia(){return ia=_e((function(e){return Se(this,(function(t){return[2,En("openProfile",na,[e],function(){var e=_e((function(e){var t,n,r,i;return Se(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,ta(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ia.apply(this,arguments)}var oa=function(){var e=_e((function(e,t){var n,i,o,a=arguments;return Se(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){an("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),aa=[li({id:Qr(),type:Mi.enum(["user","oa"]),sourceId:Mi.any().optional(),sourceIndex:Mi.any().optional(),message:Qr().optional()}).optional()];function sa(e){return ua.apply(this,arguments)}function ua(){return ua=_e((function(e){return Se(this,(function(t){return[2,En("openChat",aa,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Se(this,(function(a){switch(a.label){case 0:return Ne.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,oa(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ua.apply(this,arguments)}function ca(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 la=function(){var e=_e((function(e,t){var n,i;return Se(this,(function(o){switch(n={},i=e,e){case"image":(null==t?void 0:t.imageUrls)?(i="multi_image",n={photoUrl:null==t?void 0:t.imageUrls}):n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(e,t){an("OPEN_POSTFEED",ca(De({type:y[i]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),da=[Mi.union([li({type:Mi.enum(["image"]),data:li({imageUrl:Qr().url().optional(),imageUrls:Mi.array(Qr().url()).optional()})}),li({type:Mi.enum(["link"]),data:li({link:Qr().url(),title:Qr().max(100).optional(),thumb:Qr().url().optional(),description:Qr().max(400).default("").optional()})}),li({type:Mi.enum(["profile"]),data:li({id:Qr().optional()})})])];function pa(e){return fa.apply(this,arguments)}function fa(){return fa=_e((function(e){return Se(this,(function(t){return[2,En("openPostFeed",da,[e],function(){var e=_e((function(e){var t,n;return Se(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,la(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Re("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fa.apply(this,arguments)}var ha=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ma=[li({id:Qr(),showDialogConfirm:Mi.boolean().optional()}).optional()];function va(e){return ya.apply(this,arguments)}function ya(){return ya=_e((function(e){return Se(this,(function(t){return[2,En("followOA",ma,[e],function(){var e=_e((function(e){var t;return Se(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,ha(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ya.apply(this,arguments)}var ga=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),_a=[li({id:Qr()}).optional()];function wa(e){return ba.apply(this,arguments)}function ba(){return ba=_e((function(e){return Se(this,(function(t){return[2,En("unfollowOA",_a,[e],function(){var e=_e((function(e){var t;return Se(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,ga(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ba.apply(this,arguments)}var Ta=function(){var e=_e((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return Se(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).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===(c=window.APP_VERSION)||void 0===c?void 0:c.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(l.CREATE_SHARE_LINK,De({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw rn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,ca(De({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ea=function(){var e=_e((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return Se(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){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 n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=Ce())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=Ce())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=ie[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,cn.getAccessToken()];case 8:case 11:return a=v.sent(),[4,Ta(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&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]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){an("OPEN_SHARESHEET",ca(De({type:_[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Sa=[Mi.union([li({type:Mi.enum(["text"]),data:li({text:Qr(),description:Qr().default("").optional(),autoParseLink:Mi.boolean().default(!1).optional()})}),li({type:Mi.enum(["image"]),data:li({imageUrl:Qr().url().optional(),imageUrls:Mi.array(Qr().url()).max(10).optional()})}),li({type:Mi.enum(["link"]),data:li({link:Qr().url(),chatOnly:Mi.boolean().optional()})}),li({type:Mi.enum(["oa"]),data:li({id:Qr()})}),li({type:Mi.enum(["gif"]),data:li({gifUrl:Qr().url(),imageUrl:Qr().url().optional(),width:$r().min(0).optional(),height:$r().min(0).optional()})}),li({type:Mi.enum(["video"]),data:li({videoThumb:Qr().url(),videoUrl:Qr().url(),width:$r().min(0).optional(),height:$r().min(0).optional()})}),li({type:Mi.enum(["zmp","zmp_deep_link"]),data:li({title:Qr().max(100),thumbnail:Qr().url(),path:Qr().optional(),description:Qr().max(400).default("").optional()})})])];function Pa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=_e((function(e){return Se(this,(function(t){return[2,En("openShareSheet",Sa,[e],function(){var e=_e((function(e){var t,n;return Se(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,Ea(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Re("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ia.apply(this,arguments)}var Aa=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Ce())||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=Ce())||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 Oa(e){return ka.apply(this,arguments)}function ka(){return(ka=_e((function(e){return Se(this,(function(t){return[2,En("requestCameraPermission",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return[4,Aa()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Ca=function(){var e=_e((function(e,t,n){return Se(this,(function(r){return[2,new Promise((function(r,i){an("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)}}(),Na=_e((function(){var e,t,n,r=arguments;return Se(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=Nn(),[4,Vt(e,t,n.version)];case 1:return[2,o.sent()]}}))})),Ma=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ra=[li({params:Mi.record(Qr(),Qr()).optional()}).optional()];function xa(e){return Da.apply(this,arguments)}function Da(){return Da=_e((function(e){return Se(this,(function(t){return[2,En("createShortcut",Ra,[e],function(){var e=_e((function(e){var t,n,r,a,s,u,c,l;return Se(this,(function(d){switch(d.label){case 0:return Ne.isMp?[4,Na(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=Ce())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||mn("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"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Ma(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Ca("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,rn.success()];case 6:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var Ua=function(){var e=_e((function(e,t,n){return Se(this,(function(i){return[2,new Promise((function(i,o){an("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,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,r,o;i({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===(r=e.data)||void 0===r?void 0:r.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)}}(),La=[li({secretData:Qr(),ui:li({title:Qr().default("Xác thực").optional(),subTitle:Qr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Qr().default("Đóng").optional()}).optional(),requireFingerprint:ei().default(!0).optional()}).optional()];function ja(e){return Ba.apply(this,arguments)}function Ba(){return Ba=_e((function(e){return Se(this,(function(t){return[2,En("openBioAuthentication",La,[e],function(){var e=_e((function(e){var t,n,r;return Se(this,(function(i){switch(i.label){case 0:return Ne.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ua(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Re("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ba.apply(this,arguments)}var Za=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("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 za(e){return Wa.apply(this,arguments)}function Wa(){return(Wa=_e((function(e){return Se(this,(function(t){return[2,En("checkStateBioAuthentication",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Za()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Re("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Fa=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Va=[li({message:Qr()}).optional()];function Ga(e){return Ha.apply(this,arguments)}function Ha(){return Ha=_e((function(e){return Se(this,(function(t){return[2,En("showToast",Va,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Fa(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ha.apply(this,arguments)}var Ka=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ja(e){return qa.apply(this,arguments)}function qa(){return(qa=_e((function(e){return Se(this,(function(t){return[2,En("hideKeyboard",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ka()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Qa=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),$a=[li({phoneNumber:Qr()})];function Ya(e){return Xa.apply(this,arguments)}function Xa(){return Xa=_e((function(e){return Se(this,(function(t){return[2,En("openPhone",$a,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Qa(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xa.apply(this,arguments)}var es=function(){var e=_e((function(e,t){return Se(this,(function(n){return[2,new Promise((function(n,r){an("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ts=[li({content:Qr(),phoneNumber:Qr()})];function ns(e){return rs.apply(this,arguments)}function rs(){return rs=_e((function(e){return Se(this,(function(t){return[2,En("openSMS",ts,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,es(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rs.apply(this,arguments)}var is=function(){var e=_e((function(e){var t,n=arguments;return Se(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){an("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),os=[li({id:Qr(),displayName:Qr().default("").optional()})];function as(e){return ss.apply(this,arguments)}function ss(){return ss=_e((function(e){return Se(this,(function(t){return[2,En("viewOAQr",os,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,is(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ss.apply(this,arguments)}var us=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("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)}}(),cs=[li({keepScreenOn:ei()})];function ls(e){return ds.apply(this,arguments)}function ds(){return ds=_e((function(e){return Se(this,(function(t){return[2,En("keepScreen",cs,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,us(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ds.apply(this,arguments)}function ps(e){return fs.apply(this,arguments)}function fs(){return(fs=_e((function(e){return Se(this,(function(t){return[2,En("onKeepScreen",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,us(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function hs(e){return ms.apply(this,arguments)}function ms(){return(ms=_e((function(e){return Se(this,(function(t){return[2,En("offKeepScreen",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,us(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var vs=function(){var e=_e((function(e,t){var n;return Se(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){an("SAVE_IMAGE_GALLERY",De({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ys=[li({imageBase64Data:Qr().optional(),imageUrl:Qr().url().optional()}).optional()];function gs(e){return _s.apply(this,arguments)}function _s(){return _s=_e((function(e){return Se(this,(function(t){return[2,En("saveImageToGallery",ys,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,vs(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_s.apply(this,arguments)}var ws=function(){var e=_e((function(e){var t,n,r,i,o,s,u=arguments;return Se(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,Na(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(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=Ue(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){an("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),bs=[li({appId:Qr(),path:Qr().optional(),params:Mi.record(Qr(),Qr()).optional()})];function Ts(e){return Es.apply(this,arguments)}function Es(){return Es=_e((function(e){return Se(this,(function(t){return[2,En("openMiniApp",bs,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ws(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Es.apply(this,arguments)}var Ss=_e((function(){var e,t,n=arguments;return Se(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){an("INTERACTIVE_VIBRATION",{type:b[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),Ps=[li({type:Mi.enum(["oneShot"]).default("oneShot"),milliseconds:$r().optional()})];function Is(e){return As.apply(this,arguments)}function As(){return As=_e((function(e){return Se(this,(function(t){return[2,En("vibrate",Ps,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ss(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),As.apply(this,arguments)}var Os=function(){var e=_e((function(e,t){var n,r,i,o;return Se(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=gt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Ht(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Ht(null==t?void 0:t.leftButton):"back"},!r&>.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){an("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ks=[li({url:Qr(),config:li({style:Mi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Mi.enum(["back","none"]).default("back").optional()}).optional()})];function Cs(e){return Ns.apply(this,arguments)}function Ns(){return Ns=_e((function(e){return Se(this,(function(t){return[2,En("openWebview",ks,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Os(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ns.apply(this,arguments)}function Ms(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ut.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Rs(){return En("getRouteParams",[],[],(function(){return Ms()}))}function xs(e){return Ds.apply(this,arguments)}function Ds(){return(Ds=_e((function(e){return Se(this,(function(t){return[2,En("getAppInfo",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Na()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Re("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Us=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("WEBVIEW_SET_RESULT",{result:vn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ls=[li({data:Mi.any()})];function js(e){return Bs.apply(this,arguments)}function Bs(){return Bs=_e((function(e){return Se(this,(function(t){return[2,En("sendDataToPreviousMiniApp",Ls,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Us(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bs.apply(this,arguments)}var Zs=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){var n,r;an("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(rn.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Ce())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function zs(e){return Ws.apply(this,arguments)}function Ws(){return(Ws=_e((function(e){return Se(this,(function(t){return[2,En("getPhoneNumber",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Zs()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Re("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Fs=_e((function(){var e,t=arguments;return Se(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){an("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})}))]}))})),Vs=[li({maxProfile:$r().min(1).max(10).optional().default(1)})];function Gs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=_e((function(e){return Se(this,(function(t){return[2,En("openProfilePicker",Vs,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Se(this,(function(a){switch(a.label){case 0:return Ne.isMp?[4,Fs(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,cn.getAccessToken()];case 3:return r=a.sent(),[4,fetch(l.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(gt.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 Ne.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Re("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hs.apply(this,arguments)}var Ks=function(){var e=_e((function(e,t,n){var r;return Se(this,(function(i){return r=t&>.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){an("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)}}(),Js=[li({SSID:Qr(),password:Qr().optional(),hiddenSSID:ei().optional()})];function qs(e){return Qs.apply(this,arguments)}function Qs(){return Qs=_e((function(e){return Se(this,(function(t){return[2,En("connectWifi",Js,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ks(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qs.apply(this,arguments)}var $s=function(){var e=_e((function(e,t,n,r,i,o){var a,s;return Se(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){an("PICK_MEDIA",{media_type:T[e],edit_view:De({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Ys=[li({type:Mi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Qr().url(),maxItemSize:$r().min(0).optional(),editView:li({enable:ei().optional(),aspectRatio:Qr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:ei().optional(),maxSelectItem:$r().min(1).optional()})];function Xs(e){return eu.apply(this,arguments)}function eu(){return eu=_e((function(e){return Se(this,(function(t){return[2,En("openMediaPicker",Ys,[e],function(){var e=_e((function(e){var t,n,r,i,o,a;return Se(this,(function(s){switch(s.label){case 0:return Ne.isMp?(i={},gt.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,$s(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ne.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Re("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),eu.apply(this,arguments)}var tu=[li({title:Qr().max(100),description:Qr().max(400).default(""),thumbnail:Qr().url().optional(),path:Qr().optional()})];function nu(e){return ru.apply(this,arguments)}function ru(){return ru=_e((function(e){return Se(this,(function(t){return[2,En("getShareableLink",tu,[e],function(){var e=_e((function(e){var t;return Se(this,(function(n){switch(n.label){case 0:return[4,cn.getAccessToken()];case 1:return t=n.sent(),[4,Ta(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)}}())]}))})),ru.apply(this,arguments)}var iu=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("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 ou(e){return au.apply(this,arguments)}function au(){return(au=_e((function(e){return Se(this,(function(t){return[2,En("closeLoading",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,iu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function su(e){return uu.apply(this,arguments)}function uu(){return uu=_e((function(e){return Se(this,(function(t){return[2,En("requestUpdateZalo",[],[e],_e((function(){var e,t,n;return Se(this,(function(r){switch(r.label){case 0:return Ne.isMp?(n=(null===(e=Ce())||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,Ma(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("requestUpdateZalo",{}))]}}))})))]}))})),uu.apply(this,arguments)}var cu=Rt.getInstance();cu.addListener=function(e,t,n){var r=e;return cu.addListener(f[r],t,n)};var lu=[Mi.function()];function du(e){return En("onConfirmToExit",lu,[e],(function(e){var t=e;Ne.isMp&&(cu.on(f.AppClose,t,'{"handle_h5": 1}'),xi.setNavigationBarLeftButton(void 0,2))}))}function pu(){return En("offConfirmToExit",[],[],(function(){Ne.isMp&&(cu.off(f.AppClose),xi.setNavigationBarLeftButton(void 0,0))}))}function fu(){return En("getDeviceId",[],[],(function(){return Ne.isMp&&cn.getSync(c.DEVICE_ID)||""}))}function hu(e){return mu.apply(this,arguments)}function mu(){return(mu=_e((function(e){return Se(this,(function(t){return[2,En("getDeviceIdAsync",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,cn.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function vu(){return En("getContext",[],[],(function(){if(Ne.isMp){var e=cn.getSync(c.CONTEXT_ID)||"";return{type:cn.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function yu(e){return gu.apply(this,arguments)}function gu(){return(gu=_e((function(e){return Se(this,(function(t){return[2,En("getContextAsync",[],[e],_e((function(){var e;return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,cn.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,cn.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function _u(e){return wu.apply(this,arguments)}function wu(){return(wu=_e((function(e){return Se(this,(function(t){return[2,En("getAuthCode",[],[e],_e((function(){var e,t;return Se(this,(function(n){switch(n.label){case 0:return Ne.isMp?[4,cn.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,cn.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,cn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Gt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),rn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function bu(e){return Tu.apply(this,arguments)}function Tu(){return(Tu=_e((function(e){return Se(this,(function(t){return[2,En("getZPIToken",[],[e],_e((function(){var e,t,n,r;return Se(this,(function(i){switch(i.label){case 0:return Ne.isMp?[4,cn.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,cn.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,cn.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,cn.jumpAndGetToken(c.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 Eu=[Qr()];function Su(e){return En("setAccessToken",Eu,[e],(function(e){var t=e;cn.setAccessToken(t)}))}var Pu=[li({url:Qr().url()})];function Iu(e){return Au.apply(this,arguments)}function Au(){return Au=_e((function(e){return Se(this,(function(t){return[2,En("openOutApp",Pu,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ma(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Au.apply(this,arguments)}var Ou=[li({count:$r().min(1).optional().default(1),sourceType:Mi.array(Mi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Mi.enum(["back","front"]).default("front").optional()})];function ku(e){return Cu.apply(this,arguments)}function Cu(){return Cu=_e((function(e){return Se(this,(function(t){return[2,En("chooseImage",Ou,[e],function(){var e=_e((function(e){var t,n,r,i;return Se(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)}}())]}))})),Cu.apply(this,arguments)}var Nu=_e((function(){var e,t,n=arguments;return Se(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){an("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(rn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Mu(e){return Ru.apply(this,arguments)}function Ru(){return(Ru=_e((function(e){return Se(this,(function(t){return[2,En("getLocation",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Nu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Re("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var xu=[Mi.function().args(li({data:Mi.any()})).returns(Mi.void())];function Du(e){return En("onCallbackData",xu,[e],(function(){!function(e){Rt.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Uu=function(){var e=_e((function(e){var t,n,r,o,a,s,u,c,l,d,p;return Se(this,(function(f){switch(f.label){case 0:return n="",e||(e=Ms()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ut.getParameterByName("orderId",e),o=Ut.getParameterByName("appTransID",e)||Ut.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,cn.getAccessToken().catch((function(){throw rn.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(ue),c={orderId:n,transId:t||"",appId:i},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 rn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,De({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Lu=function(){var e=_e((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O;return Se(this,(function(k){switch(k.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},k.label=1;case 1:return k.trys.push([1,6,,7]),[4,cn.getAccessToken().catch((function(){throw rn.error.loginRequired}))];case 2:return h=k.sent(),p.headers.authorization="Bearer ".concat(h),[4,fetch(ae,ca(De({method:"POST"},p),{body:c}))];case 3:return[4,k.sent().json()];case 4:if(!(m=k.sent()).data||0!==m.err)throw rn.error.badRequest(m.msg);return v=m.data.id,y=m.data.jwt,g=m.data.messageToken||"",_=window.APP_VERSION,w=window.APP_ENV,b={miniAppId:u,orderId:v},T=m.data.method,E=m.data.isCustom,y&&(b.token=y),_&&(b.version=_),w&&(b.env=w),T&&(b.method=T),E&&(b.isCustom=E),S=Ut.encode(b),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),I=Jt(),A=Kt()&&I<742?"normal":"bottomSheet",[4,Os(P,{style:A}).then((function(){var e=!1;Rt.getInstance().once(f.WebviewClosed,(function(){setTimeout(_e((function(){var t;return Se(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Uu({zmpOrderId:v})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&Rt.getInstance().emit(f.PaymentClose,t.err,ca(De({},t),{zmpOrderId:v})),n.label=2;case 2:return[2]}}))})),500)})),Rt.getInstance().once(f.OpenApp,(function(){e=!0}))}))];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(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),ju=[li({amount:Mi.union([Qr(),$r()]),item:Mi.array(Mi.record(Qr(),Mi.any())),desc:Qr(),extradata:Mi.any().optional(),payload:Mi.any().optional(),method:Mi.union([Mi.string(),Mi.object({id:Mi.string(),isCustom:Mi.boolean()})]).optional(),mac:Mi.string().optional()})];function Bu(e){return Zu.apply(this,arguments)}function Zu(){return Zu=_e((function(e){return Se(this,(function(t){return[2,En("createOrder",ju,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Lu(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Re("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Zu.apply(this,arguments)}var zu=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Wu=function(){var e=_e((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,y;return Se(this,(function(g){switch(g.label){case 0:a=i,(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),o&&s.append("mac",o),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,cn.getAccessToken().catch((function(){throw rn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,cn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=cn.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,zu()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(ce,ca(De({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw rn.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)}}(),Fu=[li({amount:Mi.union([Mi.string(),Mi.number()]),desc:Mi.string(),method:Mi.string(),transId:Mi.string().optional(),mac:Mi.string().optional()})];function Vu(e){return Gu.apply(this,arguments)}function Gu(){return Gu=_e((function(e){return Se(this,(function(t){return[2,En("purchase",Fu,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Wu(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 Ne.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Re("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gu.apply(this,arguments)}var Hu=function(){var e=_e((function(e,t){return Se(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;an("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)}}(),Ku=[li({channels:ci(li({method:Qr(),subMethod:Qr().optional(),subInfo:Qr().optional()})).optional(),selectedMethod:li({method:Qr(),subMethod:Qr().optional()}).optional()}).optional()];function Ju(e){return qu.apply(this,arguments)}function qu(){return qu=_e((function(e){return Se(this,(function(t){return[2,En("selectPaymentMethod",Ku,[e],function(){var e=_e((function(e){var t,n;return Se(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.channels,n=e.selectedMethod,[4,Hu(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Re("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qu.apply(this,arguments)}var Qu=[li({data:Mi.union([Qr(),Mi.record(Qr(),Qr())])})];function $u(e){return Yu.apply(this,arguments)}function Yu(){return Yu=_e((function(e){return Se(this,(function(t){return[2,En("checkTransaction",Qu,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Uu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Re("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yu.apply(this,arguments)}var Xu=function(){var e=_e((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return Se(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||E.SUBSCRIPTION),f=S.UNKNOW,n===de&&(f=S.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===le&&(f=S.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=Ce())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=Ce())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,cn.getAccessToken().catch((function(){throw rn.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(se,ca(De({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw rn.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){an("IAP_REQUESTPAYMENT",De({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),ec=[li({productId:Qr(),payType:Mi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Mi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Qr().optional(),method:Mi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Qr().optional()})];function tc(e){return nc.apply(this,arguments)}function nc(){return nc=_e((function(e){return Se(this,(function(t){return[2,En("createOrderIAP",ec,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Xu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Re("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nc.apply(this,arguments)}var rc=[li({hide:ei().default(!1).optional()}).optional()];function ic(e){return oc.apply(this,arguments)}function oc(){return oc=_e((function(e){return Se(this,(function(t){return[2,En("setAndroidBottomNavigationBar",rc,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xi.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oc.apply(this,arguments)}var ac=[li({hide:ei().default(!1).optional()}).optional()];function sc(e){return uc.apply(this,arguments)}function uc(){return uc=_e((function(e){return Se(this,(function(t){return[2,En("setIOSBottomSafeArea",ac,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xi.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uc.apply(this,arguments)}var cc=[li({type:Mi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Mi.string().optional()}).optional()];function lc(e){return dc.apply(this,arguments)}function dc(){return dc=_e((function(e){return Se(this,(function(t){return[2,En("setStatusBar",cc,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xi.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),dc.apply(this,arguments)}var pc=[li({headerTextColor:Mi.enum(["black","white"]).optional(),headerColor:Mi.string().optional(),actionBar:li({hide:Mi.boolean().optional(),title:Mi.string().optional(),leftButton:Mi.enum(["back","none"]).optional(),textAlign:Mi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Mi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Mi.boolean().optional(),hideIOSSafeAreaBottom:Mi.boolean().optional()})];function fc(e){return hc.apply(this,arguments)}function hc(){return hc=_e((function(e){return Se(this,(function(t){return[2,En("configAppView",pc,[e],function(){var e=_e((function(e){var t,n,r,i,o,a,s;return Se(this,(function(u){switch(u.label){case 0:return Ne.isMp?gt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,xi.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return gt.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,xi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,xi.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,xi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,xi.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 Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),hc.apply(this,arguments)}var mc=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function vc(e){return yc.apply(this,arguments)}function yc(){return(yc=_e((function(e){return Se(this,(function(t){return[2,En("minimizeApp",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,mc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var gc=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function _c(e){return wc.apply(this,arguments)}function wc(){return(wc=_e((function(e){return Se(this,(function(t){return[2,En("openPermissionSetting",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,gc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var bc=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Tc(e){return Ec.apply(this,arguments)}function Ec(){return(Ec=_e((function(e){return Se(this,(function(t){return[2,En("favoriteApp",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,bc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Sc=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Pc(e){return Ic.apply(this,arguments)}function Ic(){return(Ic=_e((function(e){return Se(this,(function(t){return[2,En("openGroupList",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Sc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Ac=_e((function(){var e;return Se(this,(function(t){switch(t.label){case 0:return[4,cn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){an("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Oc(e){return kc.apply(this,arguments)}function kc(){return(kc=_e((function(e){return Se(this,(function(t){return[2,En("requestSendNotification",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ac()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Nc(e){return Mc.apply(this,arguments)}function Mc(){return(Mc=_e((function(e){return Se(this,(function(t){return[2,En("addRating",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Cc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Rc,xc=(Rc=_e((function(e,t,n){var r,i;return Se(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(l.CHECK_INTERACT_OA,De({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Rc.apply(this,arguments)}),Dc=function(){var e=_e((function(e){return Se(this,(function(t){return[2,new Promise((function(t,n){an("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)}}(),Uc=[li({oaId:Qr()})];function Lc(e){return jc.apply(this,arguments)}function jc(){return jc=_e((function(e){return Se(this,(function(t){return[2,En("interactOA",Uc,[e],function(){var e=_e((function(e){var t,n,r;return Se(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.oaId,[4,cn.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||gt.isEmpty(n)?[3,3]:[4,xc(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,Dc(t)];case 4:return[2,o.sent()];case 5:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),jc.apply(this,arguments)}var Bc=[li({oaId:Qr()})];function Zc(e){return zc.apply(this,arguments)}function zc(){return zc=_e((function(e){return Se(this,(function(t){return[2,En("isAllowedInteractWithOA",Bc,[e],function(){var e=_e((function(e){var t,n,r;return Se(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.oaId,[4,cn.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||gt.isEmpty(n)?[3,3]:[4,xc(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Ne.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Re("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zc.apply(this,arguments)}function Wc(e){return Fc.apply(this,arguments)}function Fc(){return(Fc=_e((function(e){return Se(this,(function(t){return[2,En("getSetting",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,tn()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Re("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Vc=Mi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Gc=[li({scopes:Mi.array(Vc).max(2).optional()}).optional()];function Hc(e){return Kc.apply(this,arguments)}function Kc(){return Kc=_e((function(e){return Se(this,(function(t){return[2,En("authorize",Gc,[e],function(){var e=_e((function(e){var t;return Se(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=null==e?void 0:e.scopes,qt(724,573)?[2,Promise.reject(rn.error.clientNotSupport())]:[4,sn(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Kc.apply(this,arguments)}var Jc=_e((function(){return Se(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Se(this,(function(r){switch(r.label){case 0:return gt.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(rn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function qc(e){return En("checkZaloCameraPermission",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return[4,Jc()];case 1:return[2,e.sent()]}}))})))}var Qc=_e((function(){return Se(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Se(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,cn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=cn.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 $c(e){return Yc.apply(this,arguments)}function Yc(){return(Yc=_e((function(e){return Se(this,(function(t){return[2,En("getUserID",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Qc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Re("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Xc=_e((function(){return Se(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Se(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,cn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=cn.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 el(e){return tl.apply(this,arguments)}function tl(){return(tl=_e((function(e){return Se(this,(function(t){return[2,En("getIDToken",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Xc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Re("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var nl={format:N.JPEG,quality:M.NORMAL,mirrored:!1,useVideoSourceSize:!1},rl={width:1024,height:768,facingMode:C.FRONT,mirrored:!1,audio:!1,video:!0},il=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;_t(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(N.PNG),width:e.width,height:e.height};Rt.getInstance().emit(k.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:rl.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:rl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:rl.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:rl.video}var t=e.prototype;return t.on=function(e,t){Rt.getInstance().on(e,(function(e){t(e)})),e===k.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){Rt.getInstance().off(e),e===k.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return _e((function(){return Se(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]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return _e((function(){var n,r,i,o,a,s;return Se(this,(function(u){switch(u.label){case 0:return gt.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]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||rl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||rl.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}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==C.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==C.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return _e((function(){return Se(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==C.FRONT?C.BACK:C.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return _e((function(){var t,n;return Se(this,(function(r){return t=Rt.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=_e((function(t,n){var r;return Se(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),Rt.getInstance().emit(k.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return _e((function(){return Se(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)}))}))]}))}))()},t.stream=function(){var e=this;return _e((function(){return Se(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=_e((function(n){return Se(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)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==C.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return _e((function(){return Se(this,(function(r){switch(r.label){case 0:if(e===R.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return _e((function(){return Se(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return _e((function(){return Se(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),Rt.getInstance().emit(k.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||nl.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.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},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===C.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===C.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.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())},e}(),ol=li({play:Mi.function(),pause:Mi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),al=[li({videoElement:ol,mediaConstraints:Mi.object({width:Mi.number().min(100).optional(),height:Mi.number().min(100).optional(),facingMode:Mi.string().optional(),audio:Mi.boolean().optional(),video:Mi.boolean().optional(),deviceId:Mi.string().optional(),mirrored:Mi.boolean().optional()}).nullish()}).optional()];function sl(e){return En("createCameraContext",al,[e],(function(e){return new il(e.videoElement,e.mediaConstraints)}))}var ul=function(){function e(){var t,n;_t(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=Ee(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;gt.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?gt.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?gt.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 cl(e){return ll.apply(this,arguments)}function ll(){return(ll=_e((function(e){return Se(this,(function(t){return[2,En("setupAd",[],[e],(function(){return ul.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var dl=[li({ids:Mi.union([Mi.string(),Mi.array(Mi.string())]),config:li({display:Mi.boolean().optional(),onClose:Mi.function().optional()}).optional()})];function pl(e){return fl.apply(this,arguments)}function fl(){return fl=_e((function(e){return Se(this,(function(t){return[2,En("loadAd",dl,[e],function(){var e=_e((function(e){return Se(this,(function(t){return ul.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fl.apply(this,arguments)}var hl=[li({id:Mi.string()})];function ml(e){return vl.apply(this,arguments)}function vl(){return vl=_e((function(e){return Se(this,(function(t){return[2,En("displayAd",hl,[e],function(){var e=_e((function(e){return Se(this,(function(t){return ul.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vl.apply(this,arguments)}var yl=[li({id:Mi.string().optional()}).optional()];function gl(e){return _l.apply(this,arguments)}function _l(){return _l=_e((function(e){return Se(this,(function(t){return[2,En("refreshAd",yl,[e],function(){var e=_e((function(e){return Se(this,(function(t){return ul.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_l.apply(this,arguments)}var wl=[li({id:Qr(),guidingText:Qr().optional(),color:Qr().optional(),onStatusChange:Mi.function().optional()})];function bl(e){return Tl.apply(this,arguments)}function Tl(){return Tl=_e((function(t){return Se(this,(function(n){return[2,En("showOAWidget",wl,[t],function(){var t=_e((function(t){var n,r,i,o,a,s,u,c;return Se(this,(function(l){if(Ne.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ue(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=_e((function(e){var t,n,i,o,a,s,l,d;return Se(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(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,cn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=cn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?ta(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 Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Tl.apply(this,arguments)}var El=[li({id:Qr(),type:Qr(),text:Qr(),color:Qr().optional(),disabled:Mi.boolean().optional(),onDataReceived:Mi.function().optional(),onError:Mi.function().optional()})];function Sl(e){return Pl.apply(this,arguments)}function Pl(){return Pl=_e((function(t){return Se(this,(function(n){return[2,En("showFunctionButtonWidget",El,[t],function(){var t=_e((function(t){var n,r,i,o,a,s,u;return Se(this,(function(c){if(Ne.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Ue(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=Ue(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=_e((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return Se(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(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,cn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=cn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=cn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,In()];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}},"*"),[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 Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Pl.apply(this,arguments)}var Il=function(){var e=_e((function(e,t){var n;return Se(this,(function(r){return n={},"cccd"===e&&(n={mrz:null==t?void 0:t.mrz}),[2,new Promise((function(t,r){an("SCAN_NFC",{type:g[e],data:n},{success:function(n){if("cccd"===e){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E={dg1:null!==(r=n.dg1)&&void 0!==r?r:"",dg2:null!==(i=n.dg2)&&void 0!==i?i:"",dg3:null!==(o=n.dg3)&&void 0!==o?o:"",dg4:null!==(a=n.dg4)&&void 0!==a?a:"",dg5:null!==(s=n.dg5)&&void 0!==s?s:"",dg6:null!==(u=n.dg6)&&void 0!==u?u:"",dg7:null!==(c=n.dg7)&&void 0!==c?c:"",dg8:null!==(l=n.dg8)&&void 0!==l?l:"",dg9:null!==(d=n.dg9)&&void 0!==d?d:"",dg10:null!==(p=n.dg10)&&void 0!==p?p:"",dg11:null!==(f=n.dg11)&&void 0!==f?f:"",dg12:null!==(h=n.dg12)&&void 0!==h?h:"",dg13:null!==(m=n.dg13)&&void 0!==m?m:"",dg14:null!==(v=n.dg14)&&void 0!==v?v:"",dg15:null!==(y=n.dg15)&&void 0!==y?y:"",dg16:null!==(g=n.dg16)&&void 0!==g?g:"",sod:null!==(_=n.sod)&&void 0!==_?_:"",challenge:null!==(w=n.challenge)&&void 0!==w?w:"",aAResult:null!==(b=n.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(T=n.eACCAResult)&&void 0!==T?T:""};t(E)}else t({})},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Al=[li({type:Mi.enum(["cccd"]),data:li({mrz:Qr().max(90)})})];function Ol(e){return kl.apply(this,arguments)}function kl(){return kl=_e((function(e){return Se(this,(function(t){return[2,En("scanNFC",Al,[e],function(){var e=_e((function(e){var t,n;return Se(this,(function(r){switch(r.label){case 0:return Ne.isMp?qt(754,620)?[2,Promise.reject(rn.error.clientNotSupport())]:(t=e.type,n=e.data,[4,Il(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),kl.apply(this,arguments)}var Cl=_e((function(){return Se(this,(function(e){return[2,new Promise((function(e,t){an("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function Nl(e){return Ml.apply(this,arguments)}function Ml(){return(Ml=_e((function(e){return Se(this,(function(t){return[2,En("checkNFC",[],[e],_e((function(){return Se(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Cl()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var Rl=[Mi.string().trim().min(1)];var xl=[Mi.string().trim().min(1),Mi.string().trim()];var Dl=[Mi.string().trim().min(1)];var Ul={getItem:function(e){return En("getItem",Rl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.getItem(t[0]):Re("getItem",{})}))},setItem:function(e,t){return En("setItem",xl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.setItem(t[0],t[1]):Re("setItem",{})}))},clear:function(){return En("clear",[],[],(function(){return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.clearStorageSync():Promise.reject(Re("clear",{}))}))},removeItem:function(e){return En("removeItem",Dl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.removeItem(t[0]):Re("removeItem",{})}))},getStorageInfo:function(){return En("getStorageInfoSync",[],[],(function(){return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.getStorageInfoSync():Re("getStorageInfoSync",{})}))}},Ll={createOrder:Bu,checkTransaction:$u,createOrderIAP:tc,selectPaymentMethod:Ju},jl={purchase:Vu,selectPaymentMethod:Ju};window.ZaloMiniAppSDK={getVersion:Cn},Sn();var Bl=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Sn,getAccessToken:In,getVersion:Cn,getSystemInfo:Mn,setNavigationBarTitle:Ui,setNavigationBarColor:Bi,setNavigationBarLeftButton:Wi,setStorage:vo,getStorage:_o,getStorageInfo:bo,removeStorage:So,clearStorage:Ao,getUserInfo:No,getNetworkType:Do,onNetworkStatusChange:jo,startBeaconDiscovery:zo,stopBeaconDiscovery:Vo,getBeacons:Ko,closeApp:Qo,scanQRCode:Xo,openProfile:ra,openChat:sa,openPostFeed:pa,followOA:va,unfollowOA:wa,openShareSheet:Pa,requestCameraPermission:Oa,createShortcut:xa,openBioAuthentication:ja,checkStateBioAuthentication:za,showToast:Ga,hideKeyboard:Ja,openPhone:Ya,openSMS:ns,viewOAQr:as,keepScreen:ls,onKeepScreen:ps,offKeepScreen:hs,saveImageToGallery:gs,openMiniApp:Ts,vibrate:Is,openWebview:Cs,getRouteParams:Rs,getAppInfo:xs,sendDataToPreviousMiniApp:js,getPhoneNumber:zs,openProfilePicker:Gs,connectWifi:qs,openMediaPicker:Xs,getShareableLink:nu,closeLoading:ou,requestUpdateZalo:su,onConfirmToExit:du,offConfirmToExit:pu,getDeviceId:fu,getDeviceIdAsync:hu,getContext:vu,getContextAsync:yu,getAuthCode:_u,getZPIToken:bu,setAccessToken:Su,openOutApp:Iu,chooseImage:ku,getLocation:Mu,onCallbackData:Du,createOrder:Bu,purchase:Vu,selectPaymentMethod:Ju,checkTransaction:$u,createOrderIAP:tc,events:cu,setAndroidBottomNavigationBar:ic,setIOSBottomSafeArea:sc,setStatusBar:lc,configAppView:fc,minimizeApp:vc,openPermissionSetting:_c,favoriteApp:Tc,openGroupList:Pc,requestSendNotification:Oc,addRating:Nc,interactOA:Lc,interactOa:Lc,isAllowedInteractWithOA:Zc,getSetting:Wc,authorize:Hc,checkZaloCameraPermission:qc,getUserID:$c,getIDToken:el,createCameraContext:sl,setupAd:cl,loadAd:pl,displayAd:ml,refreshAd:gl,showOAWidget:bl,showFunctionButtonWidget:Sl,scanNFC:Ol,checkNFC:Nl,nativeStorage:Ul,Payment:Ll,CheckoutSDK:jl,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:il}),Zl=e(Bl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=Ce())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,Bl))}();var zl=Object.freeze({__proto__:null,default:Zl,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Sn,getAccessToken:In,getVersion:Cn,getSystemInfo:Mn,setNavigationBarTitle:Ui,setNavigationBarColor:Bi,setNavigationBarLeftButton:Wi,setStorage:vo,getStorage:_o,getStorageInfo:bo,removeStorage:So,clearStorage:Ao,getUserInfo:No,getNetworkType:Do,onNetworkStatusChange:jo,startBeaconDiscovery:zo,stopBeaconDiscovery:Vo,getBeacons:Ko,closeApp:Qo,scanQRCode:Xo,openProfile:ra,openChat:sa,openPostFeed:pa,followOA:va,unfollowOA:wa,openShareSheet:Pa,requestCameraPermission:Oa,createShortcut:xa,openBioAuthentication:ja,checkStateBioAuthentication:za,showToast:Ga,hideKeyboard:Ja,openPhone:Ya,openSMS:ns,viewOAQr:as,keepScreen:ls,onKeepScreen:ps,offKeepScreen:hs,saveImageToGallery:gs,openMiniApp:Ts,vibrate:Is,openWebview:Cs,getRouteParams:Rs,getAppInfo:xs,sendDataToPreviousMiniApp:js,getPhoneNumber:zs,openProfilePicker:Gs,connectWifi:qs,openMediaPicker:Xs,getShareableLink:nu,closeLoading:ou,requestUpdateZalo:su,onConfirmToExit:du,offConfirmToExit:pu,getDeviceId:fu,getDeviceIdAsync:hu,getContext:vu,getContextAsync:yu,getAuthCode:_u,getZPIToken:bu,setAccessToken:Su,openOutApp:Iu,chooseImage:ku,getLocation:Mu,onCallbackData:Du,createOrder:Bu,purchase:Vu,selectPaymentMethod:Ju,checkTransaction:$u,createOrderIAP:tc,events:cu,setAndroidBottomNavigationBar:ic,setIOSBottomSafeArea:sc,setStatusBar:lc,configAppView:fc,minimizeApp:vc,openPermissionSetting:_c,favoriteApp:Tc,openGroupList:Pc,requestSendNotification:Oc,addRating:Nc,interactOA:Lc,interactOa:Lc,isAllowedInteractWithOA:Zc,getSetting:Wc,authorize:Hc,checkZaloCameraPermission:qc,getUserID:$c,getIDToken:el,createCameraContext:sl,setupAd:cl,loadAd:pl,displayAd:ml,refreshAd:gl,showOAWidget:bl,showFunctionButtonWidget:Sl,scanNFC:Ol,checkNFC:Nl,nativeStorage:Ul,Payment:Ll,CheckoutSDK:jl,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:il,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ScanNFCType(){return g},get ShareSheetType(){return _},get OrientationType(){return w},get VibrateType(){return b},get MediaPickerType(){return T},get IAPPayType(){return E},get ProrationMode(){return S},get StatusBarType(){return P},get AndroidBottomNavigationBarType(){return I},get IOSSafeAreaBottomType(){return A},get TextAlignType(){return O}});window.ZaloMiniAppSDK=zl}();
|
|
10
|
+
!function(){"use strict";function e(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 t,n=1048576,r=window.zAppID,i=window.APP_ID,o="https://zalo.me/s",a="https://h5.zdn.vn/zapps",s="h5.zdn.vn",u="/zapps",c={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"},l={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"}(t||(t={}));var d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O,k,C,N,M,R,x=0,D=-2e3,U=-1400,L=-1500,j=-1401,B=-1404,Z=-1408,z=-1409,W=-2004,F=-2005,V=-2006,G=-2007,H="Success",K="Unknown error. Please try again later.",J="Request limit exceeded. Please try again later.",q="Request timeout. Please try again later.",Q="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",$="Login failed",Y="This API is not supported in this version of Zalo",X="User Authentication Required. Please grant User Authentication permission before requesting User Permission",ee="Unable to pick media",te="Unable to save image",ne="Unable to save video",re="Unable to save file",ie={SUCCESS:{code:x,message:H},UNKNOWN_ERROR:{code:D,message:K},UNAUTHORIZED:{code:j,message:Q},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:B,message:Y},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:Z,message:q},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"}},oe={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:{}},ae={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:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:ie.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:ie.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:ie.USER_DENIED}},iOS:{"-2":{mapTo:ie.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:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},QUERY_LOCATION_HIDE:{haveCallback:!0},SHOW_TOAST:{haveCallback:!0,timeout:2},OPEN_APP:{},HIDE_KEYBOARD:{},OPEN_PHONE:{},OPEN_QR:{},OPEN_SMS:{},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:V,message:ne},needMoreDetail:!0},"-102":{mapTo:{code:V,message:ne},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:V,message:ne},needMoreDetail:!0}}}},INTERACTIVE_VIBRATION:{},SAVE_IMAGE_GALLERY:{versionLive:{iOS:408},errorList:{android:{"-101":{mapTo:{code:F,message:te},needMoreDetail:!0},"-102":{mapTo:{code:F,message:te},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:F,message:te},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:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.UNKNOWN_ERROR},"-105":{mapTo:ie.MPDS_SOURCE_INVALID},"-106":{mapTo:ie.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.MPDS_APPID_INVALID},"-102":{mapTo:ie.UNKNOWN_ERROR}}}},ZBROWSER_MPDS_SYNC:{versionLive:{iOS:402},errorList:{android:{"-100":{mapTo:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.UNKNOWN_ERROR},"-105":{mapTo:ie.MPDS_SOURCE_INVALID},"-106":{mapTo:ie.MPDS_APPID_INVALID}},iOS:{"-10":{mapTo:ie.MPDS_ACTION_INVALID},"-101":{mapTo:ie.MPDS_APPID_INVALID},"-102":{mapTo:ie.UNKNOWN_ERROR}}}},WEBVIEW_SET_RESULT:{versionLive:{iOS:416}},MP_GET_NUMBER:{versionLive:{iOS:416},errorList:{android:{"-1":{mapTo:ie.USER_DENIED},"-101":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ie.USER_DENIED},"-10":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:ie.USER_CANCEL}},iOS:{"-101":{mapTo:ie.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:ie.USER_CANCEL},999:{mapTo:{code:W,message:ee},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:ee}}}}},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:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-1":{mapTo:ie.USER_DENIED},"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1,errorList:{android:{"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_USER_AUTHORIZE:{skipJump:!1,errorList:{android:{"-400":{mapTo:ie.DUPLICATE_REQUEST}},iOS:{"-400":{mapTo:ie.DUPLICATE_REQUEST}}}},MP_SELECT_PAYMENT_METHOD:{skipJump:!1},CHECK_NFC:{skipJump:!1,versionLive:{iOS:626},errorList:{all:{"-1":{mapTo:ie.UNKNOWN_ERROR},"-600":{mapTo:ie.DEVICE_NOT_SUPPORT},"-602":{mapTo:ie.SERVICE_NOT_READY}}}},SCAN_NFC:{skipJump:!1,haveCallback:!0,timeout:65,errorList:{all:{"-1":{mapTo:ie.UNKNOWN_ERROR},"-600":{mapTo:ie.DEVICE_NOT_SUPPORT},"-601":{mapTo:ie.SCAN_TIMEOUT},"-602":{mapTo:ie.SERVICE_NOT_READY},"-603":{mapTo:ie.UNREADABLE},"-604":{mapTo:ie.INVALID_MRZ},"-605":{mapTo:ie.PROCESSING},"-606":{mapTo:ie.CANCEL}}}},MP_CONFIRM_REQUEST_PAYMENT:{skipJump:!1},SAVE_FILE:{versionLive:{iOS:628},skipJump:!1,errorList:{android:{"-101":{mapTo:{code:G,message:re},needMoreDetail:!0},"-102":{mapTo:{code:G,message:re},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:G,message:re},needMoreDetail:!0}}}}},se={android:{"-4":ie.DECODE_FAILED,"-5":ie.CLIENT_NOT_SUPPORT,"-14":ie.TIME_OUT},iOS:{"-9":ie.DECODE_FAILED,"-5":ie.CLIENT_NOT_SUPPORT,"-14":ie.TIME_OUT}},ue={android:12100615,iOS:460,wp:0,unknown:0},ce=5*n,le="https://payment-mini.zalo.me/api/order/create",de="https://payment-mini.zalo.me/api/order/iap-create",pe="https://payment-mini.zalo.me/api/transaction",fe="https://payment-mini.zalo.me/api/order/purchase",he="DEFERRED",me="IMMEDIATE_AND_CHARGE_FULL_PRICE",ve={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ye=5,ge=6,_e="#1843EF",we=0,be={"-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 Te(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 Ee(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Te(o,r,i,a,s,"next",e)}function s(e){Te(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Se(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 Pe(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ie(e,t){if(e){if("string"==typeof e)return Se(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)?Se(e,t):void 0}}function Ae(e){return function(e){if(Array.isArray(e))return Se(e)}(e)||Pe(e)||Ie(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 Oe(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 ke(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,Ae(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Ce(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(s)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(u)),isMpWeb:window.location.hostname.includes("localhost")}}ke.async=function(e){return Ee((function(){var t,n,r,i,o=arguments;return Oe(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,Ae(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]}}))}))},function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(d||(d={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(p||(p={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result",e.PaymentClose="action.payment.close",e.DownloadProgress="h5.event.webview.download.progress"}(f||(f={})),function(e){e.DOING="doing",e.DONE="done"}(h||(h={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(m||(m={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(v||(v={})),function(e){e[e.image=1]="image",e[e.multi_image=2]="multi_image",e[e.link=4]="link",e[e.profile=5]="profile"}(y||(y={})),function(e){e[e.cccd=1]="cccd"}(g||(g={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link",e[e.text=22]="text"}(_||(_={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(w||(w={})),function(e){e[e.oneShot=0]="oneShot"}(b||(b={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(T||(T={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(E||(E={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(S||(S={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(P||(P={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(I||(I={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(A||(A={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(O||(O={})),function(e){e.OnFrameCallback="h5.event.camera.frame",e.OnStartCallback="h5.event.camera.start",e.OnStopCallback="h5.event.camera.stop"}(k||(k={})),function(e){e.FRONT="user",e.BACK="environment"}(C||(C={})),function(e){e.WEBP="image/webp",e.PNG="image/png",e.JPEG="image/jpeg"}(N||(N={})),function(e){e.HIGH="high",e.NORMAL="normal",e.LOW="low"}(M||(M={})),function(e){e.VIDEO="video",e.AUDIO="audio"}(R||(R={}));var Ne,Me=function(e){return e.isAndroid?p.android:e.isIOS?p.iOS:p.unknown};function Re(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function xe(){var e=function(){var e=ke((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:Ce(),platform:t,platformName:Me(t),zaloVersion:Re(e).trim()}}}();if(e)return e}var De=(null===(Ne=xe())||void 0===Ne?void 0:Ne.appEnv)||{};function Ue(e){Ue.on&&Ue.engine(e)}Ue.on=!1,Ue.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 Le=function(e,n){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==n||null===(r=n.fail)||void 0===r||r.call(n,i),Ue({stage:t.NOT_FOUND,type:"error",name:e,request:n,state:"fail",response:i})};function je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){je(e,t,n[t])}))}return e}function Ze(e,t){return function(e){if(Array.isArray(e))return e}(e)||Pe(e)||Ie(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 ze="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function We(){throw new Error("setTimeout has not been defined")}function Fe(){throw new Error("clearTimeout has not been defined")}var Ve=We,Ge=Fe;function He(e){if(Ve===setTimeout)return setTimeout(e,0);if((Ve===We||!Ve)&&setTimeout)return Ve=setTimeout,setTimeout(e,0);try{return Ve(e,0)}catch(t){try{return Ve.call(null,e,0)}catch(t){return Ve.call(this,e,0)}}}"function"==typeof ze.setTimeout&&(Ve=setTimeout),"function"==typeof ze.clearTimeout&&(Ge=clearTimeout);var Ke,Je=[],qe=!1,Qe=-1;function $e(){qe&&Ke&&(qe=!1,Ke.length?Je=Ke.concat(Je):Qe=-1,Je.length&&Ye())}function Ye(){if(!qe){var e=He($e);qe=!0;for(var t=Je.length;t;){for(Ke=Je,Je=[];++Qe<t;)Ke&&Ke[Qe].run();Qe=-1,t=Je.length}Ke=null,qe=!1,function(e){if(Ge===clearTimeout)return clearTimeout(e);if((Ge===Fe||!Ge)&&clearTimeout)return Ge=clearTimeout,clearTimeout(e);try{Ge(e)}catch(t){try{return Ge.call(null,e)}catch(t){return Ge.call(this,e)}}}(e)}}function Xe(e,t){this.fun=e,this.array=t}Xe.prototype.run=function(){this.fun.apply(null,this.array)};function et(){}var tt=et,nt=et,rt=et,it=et,ot=et,at=et,st=et;var ut=ze.performance||{},ct=ut.now||ut.mozNow||ut.msNow||ut.oNow||ut.webkitNow||function(){return(new Date).getTime()};var lt=new Date;var dt,pt={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];Je.push(new Xe(e,t)),1!==Je.length||qe||He(Ye)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:tt,addListener:nt,once:rt,off:it,removeListener:ot,removeAllListeners:at,emit:st,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*ct.call(ut),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-lt)/1e3}},ft=pt,ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function mt(e){return e&&e.constructor===Symbol?"symbol":typeof e}function vt(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 ht?ht:"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 ft&&ft.env&&"true"===ft.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(!V(e))throw new TypeError;if(!H(t))throw new TypeError;return S(e,t)}if(!V(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 b(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!j(e))throw new TypeError;return D(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!j(t))throw new TypeError;D(n)||(n=F(n));var r=I(t,n,!1);if(D(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function 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=$(i);if(!a)return n.length=o,n;var s=Q(a);try{n[o]=s}catch(e){try{Y(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(G(n))if(!j(i=n.call(e)))return i;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i}else{var r;if(G(r=e.valueOf))if(!j(i=r.call(e)))return i;var i,o=e.toString;if(G(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 V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function G(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(!G(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!G(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}function Q(e){return e.value}function $(e){var t=e.next();return!t.done&&t}function Y(e){var t=e.return;t&&t.call(e)}function X(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(new Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<e;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",h),e("metadata",m),e("defineMetadata",v),e("hasMetadata",y),e("hasOwnMetadata",g),e("getMetadata",_),e("getOwnMetadata",w),e("getMetadataKeys",b),e("getOwnMetadataKeys",T),e("deleteMetadata",E)}(r)}()}(dt||(dt={}));var yt=Object.prototype.toString;var gt="[object Null]",_t="[object Undefined]";function wt(e){return null==e?void 0===e?_t:gt:function(e){return yt.call(e)}(e)}function bt(e){return null!=e&&"object"==typeof e}var Tt={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||bt(e)&&"[object Number]"==wt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return bt(e)&&"[object RegExp]"==wt(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 Et(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function St(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 Pt(e){return Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Pt(e)}function It(e){return Pt(e)}function At(e,t,n){return At="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=It(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},At(e,t,n)}function Ot(e,t,n){return At(e,t,n)}function kt(e,t){return kt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},kt(e,t)}function Ct(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&&kt(e,t)}function Nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mt(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=It(e);if(t){var i=It(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==mt(t)&&"function"!=typeof t?Nt(e):t}(this,n)}}var Rt,xt,Dt=(Rt=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},Rt(xt={exports:{}},xt.exports),xt.exports),Ut="ACTION_CALLBACK";var Lt=function(e){Ct(n,e);var t=Mt(n);function n(){var e;return Et(this,n),(e=t.apply(this,arguments)).debug=vt("zmp:event-emitter"),e}var r=n.prototype;return r.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},r.on=function(e,t,r){var i=this;if(e===Ut||e===f.PaymentCallback)return Ot(It(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return Ot(It(n.prototype),"on",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},r.once=function(e,t,r){var i=this;if(e===Ut)return Ot(It(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return Ot(It(n.prototype),"once",this).call(this,e,(function(n,o){i.h5ConfirmHandleEvent(n,e,r),t(o)}),r)},n.getInstance=function(){return n.instance||(n.instance=new n),n.instance},n}(Dt);function jt(e){Lt.getInstance().emit(Ut,e)}function Bt(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){jt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var r=vt("zmp:zalo_h5_event_handler");r("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=yn(n);r("stringToData",o);var a=function(e,t){try{if(e===f.OpenApp){var n=t.url,r=new URL(n),o=r.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(r.search)}}return t}catch(e){return t}}(t,o);Lt.getInstance().emit(t,e,a)}},window.zaloNative2JS={nativeCall:function(e,t,n){Lt.getInstance().emit(f.PaymentCallback,e,t,n)}};var Zt={encode:Bt,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:Bt(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":mt(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":mt(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},zt={},Wt=function(e,t,n){var r=t||"default";return function(){return(r in zt?zt[r](e,n):e).apply(this,arguments)}};Wt.setWrapper=function(e){zt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Ft={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Vt(e){try{return null===e?Ft:JSON.parse(e)}catch(e){return Ft}}var Gt,Ht={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Zt.encode(n);"post"!=t&&(e=Zt.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=Wt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Wt((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(Vt(e.responseText))},o.onerror=function(e){e.responseText?r(Vt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Kt=Ht,Jt=(Gt=Ee((function(e,t,n){var r,i,o,a;return Oe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},Tt.isUndefined(n)||(r.currentVersion=n),i=Zt.appendToUrl(l.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 Gt.apply(this,arguments)});function qt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Kt.execute(l.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:e}})}catch(e){}}var Qt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},$t=function(){var e;return"android"===((null===(e=xe())||void 0===e?void 0:e.platformName)||"").toLowerCase()},Yt=function(){var e=0;if(window.zaloVersionCode)e=window.zaloVersionCode;else{var t,n=Number((null===(t=xe())||void 0===t?void 0:t.zaloVersion)||"");if(n>=24112e3)e=n;else{var r,i=((null===(r=xe())||void 0===r?void 0:r.platformName)||"").toLowerCase();"android"===i?e=n%1e4:"ios"===i&&(e=n)}}return e},Xt=function(e,t){var n=Yt();return $t()&&n<e||function(){var e;return"ios"===((null===(e=xe())||void 0===e?void 0:e.platformName)||"").toLowerCase()}()&&n<t};function en(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var tn,nn=function(){function e(t,n,r,i){Et(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}(),rn=function(e,t){return en(e,nn)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return en(e,Error)?new nn(D,e.message,t).toJSON():Tt.isEmpty(null==e?void 0:e.message)||Tt.isEmpty(null==e?void 0:e.code)?new nn(D,K,t,e).toJSON():new nn(e.code,e.message,t,e.detail).toJSON()}(e,t)},on=(tn=Ee((function(e){var t;return Oe(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(l.GET_AUTH_SETTING,Be({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return tn.apply(this,arguments)}),an=Ee((function(){return Oe(this,(function(e){return[2,new Promise(function(){var e=Ee((function(e,t){var n,r,i,o;return Oe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,fn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=fn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new nn(j,Q,"getSetting")),[4,on(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new nn(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)}}())]}))})),sn=function(){var e,t,n,r=xe(),i={},o=Lt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=gn(e.result),r=Tn(null==n?void 0:n.action),s=Tt.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,u=null==n?void 0:n.error_message,c=(null==n?void 0:n.data)||n;if(r&&0===s){var l=JSON.parse(null==n?void 0:n.data);s=Tt.isEmpty(null==l?void 0:l.error_code)?0:null==l?void 0:l.error_code,u=null==l?void 0:l.error_message,c=(null==l?void 0:l.data)||l}var d={error_code:s,error_message:u,data:c,action:(null==n?void 0:n.action)||e.actionName};if(t&&i[t]){var p=i[t],h=p.callback,m=p.timeout,v=p.isMultiCallback,y=p.options,g=p.downloadListener;!function(e,t){var n=t||{},r=n.success,i=n.fail;0===e.error_code?Tt.isFunction(r)&&r(e):Tt.isFunction(i)&&i(e)}(d,h),!v&&delete i[t],m&&clearTimeout(m);var _={action:null==d?void 0:d.action,error:null==d?void 0:d.error_code,message:null==d?void 0:d.error_message,data:{}};try{if("action.open.inapp"===d.action||"action.open.outapp"===d.action){var w=new URL(null==y?void 0:y.url),b="".concat(w.protocol,"//").concat(w.host).concat(w.pathname);_.data={url:b}}if("action.follow.oa"===d.action||"action.unfollow.oa"===d.action){var T=null==y?void 0:y.uid;_.data={uid:T}}if("action.open.chat"===d.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&&o.off(f.DownloadProgress,g)}catch(e){}a.push(_)}},Lt.getInstance().on(Ut,t),o.on(f.AppPaused,(function(){if(a.length>0){var e=a;a=[],qt(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],qt(e)}}),5e3),s=!0),n=Ee((function(e,t,n,a){var s,u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O,k,C;return Oe(this,(function(N){switch(N.label){case 0:return u=Math.floor(1e6*Math.random()),c="".concat(e,"_").concat(u),l=In(e),(null==a?void 0:a.actionName)&&a.actionName.length>0&&(l=null==a?void 0:a.actionName),d=(null==a?void 0:a.isMultiCallback)||!1,p=!1!==(null==a?void 0:a.timeout)&&((null==a?void 0:a.timeout)||!0),h=(null==a?void 0:a.haveCallback)||!1,m=(null==a?void 0:a.skipJump)||!1,v=(null==a?void 0:a.requireAccessToken)||!1,y=En(l),t&&n&&(i[c]={options:t,callback:n,isMultiCallback:d},p&&h&&(i[c].timeout=setTimeout((function(){return jt({serialId:c,result:{error_code:Z,error_message:q,data:{timeout:p},action:e}}),null}),!0===p?8e3:1e3*p))),y?[4,an()]:[3,2];case 1:if(!1===(null==(_=N.sent())||null===(g=_.authSetting)||void 0===g?void 0:g["scope.userInfo"]))return jt({serialId:c,result:{error_code:j,error_message:X,data:{isMobile:null==r||null===(w=r.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2];N.label=2;case 2:return b=Tn(l),!(null==r||null===(s=r.platform)||void 0===s?void 0:s.isMobile)||!e||Tt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!vn(e)||b&&!1===b.isSupported?(jt({serialId:c,result:{error_code:B,error_message:Y,data:{isMobile:null==r||null===(T=r.platform)||void 0===T?void 0:T.isMobile},action:e}}),[2]):(E=mn(t),m?[3,4]:[4,fn.getJSAccessToken()]);case 3:return P=N.sent(),[3,5];case 4:P="",N.label=5;case 5:S=P,N.label=6;case 6:return N.trys.push([6,10,,11]),m||!v?[3,8]:[4,fn.getAccessToken()];case 7:return A=N.sent(),[3,9];case 8:A="",N.label=9;case 9:return I=A,[3,11];case 10:return O=N.sent(),jt({serialId:c,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.message,action:e}}),[2];case 11:try{t&&(null==t?void 0:t.onProgress)&&(k=function(e){!function(e,t){e.url;var n=e.progress;t&&t(n)}(e,null==t?void 0:t.onProgress)},i[c].downloadListener=k,o.on(f.DownloadProgress,k))}catch(e){}return C=r.platform.isIOS?window.onNativeMessage(c,l):'window.onNativeMessage("'.concat(c,'", "').concat(l,'")'),[2,ZaloJavaScriptInterface.jsCall(S,l,I,E,C)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),un={success:function(e,t){return{code:x,message:t||H,data:e||{}}},error:{failLimit:function(){return new nn(z,J)},badRequest:function(e){return new nn(U,e)},loginFailed:function(e){return new nn(j,"".concat($,": ").concat(e))},loginRequired:function(){return new nn(j,Q)},cannotGetShareInfo:function(){return new nn(L,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(be).find((function(t){return t===e.toString()}));return new nn(e,t||K)},clientNotSupport:function(){return new nn(B,Y)}}},cn=function(e){var t,n,r,i=null===(t=xe())||void 0===t?void 0:t.platformName,o=Pn(e.action),a=ae[o],s=(null==a?void 0:a.skipJump)||!1,u=(null==a?void 0:a.errorList)||{};if("JUMP_LOGIN"===o)return new nn(D,"Can not get auth code: ".concat(e.error_message));if(fn.jumpStatus!==h.DONE&&!s)return new nn(ie.UNAUTHORIZED.code,ie.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new nn(ie.FORBIDDEN.code,ie.FORBIDDEN.message);if(i&&(null===(n=se[i])||void 0===n?void 0:n[e.error_code]))return new nn(se[i][e.error_code].code,se[i][e.error_code].message);var c=null==u||null===(r=u[i])||void 0===r?void 0:r[String(e.error_code)];if(c){var l,d,p,f=null===(l=c.mapTo)||void 0===l?void 0:l.message;if(null==c?void 0:c.needMoreDetail)f="".concat(null==c||null===(p=c.mapTo)||void 0===p?void 0:p.message,": ").concat(e.error_message);return new nn(null===(d=c.mapTo)||void 0===d?void 0:d.code,f)}return new nn(e.error_code,e.error_message)},ln=function(e,n,r,i){var o=function(e,n){function r(r){return function(i){var o=Tt.isEmpty(n)?void 0:n[r];if(o)return Ue({stage:t.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?cn(i):null==i?void 0:i.data)}}return Tt.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=ae[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){sn(e,n,o,Be({},i,a))}),s)},dn=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){Tt.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),pn=function(){function e(){Et(this,e),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 n,o,s,u=e.prototype;return u.initRetryLimit=function(e){var t=oe[e],n={lastCall:(new Date).getTime(),limit:t&&t.limit?t.limit:3,retry:0};return this.retryLimitMap[e]=n,n},u.resetRetryLimit=function(e){this.retryLimitMap[e].lastCall=(new Date).getTime(),this.retryLimitMap[e].retry=0},u.getRetryLimit=function(e){var t=this.retryLimitMap[e];return t&&t.lastCall&&t.retry||(t=this.initRetryLimit(e)),t},u.increaseRetryLimit=function(e){this.retryLimitMap[e].retry++},u.jump=function(){var e=this;return Ee((function(){return Oe(this,(function(n){return[2,new Promise((function(n,r){e._jumpStatus?e._jumpStatus===h.DONE?n(h.DONE):n(h.DOING):(e._jumpStatus=h.DOING,Ue({stage:t.REQUEST,type:"log",name:"jump"}),sn("JUMP_LOGIN",{},{success:function(t){var r=t.data;e._miniProgramConfig=(null==r?void 0:r.miniProgramConfig)||{};var i=(null==r?void 0:r.cookiesOAuthLogins)||[],o=i.find((function(e){return e.name===c.JS_TOKEN}));o&&(e._jsAccessToken=o.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(o.value)),e._cookies=i;var a=e._cookies.find((function(e){return e.name===c.ZOAUTH}));(null==a?void 0:a.value)||qt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){qt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),r(e)}},{skipJump:!0}))}))]}))}))()},u.loginZaloV3=function(e,t,n){var r=this;return Ee((function(){var i;return Oe(this,(function(o){switch(o.label){case 0:return i="".concat(l.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(a,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=Ee((function(e){var t,n,i;return Oe(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()]}}))}))()},u.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 Ee((function(){var i,o;return Oe(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),Tt.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(l.GET_ACCESS_TOKEN,Be({method:"POST",body:i},o)).then(function(){var e=Ee((function(e){var t,n,i,o;return Oe(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()]}}))}))()},u.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Ee((function(){var n,o,a,s,u,l,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(o.getAccessTokenCount<=1||o._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return Oe(this,(function(m){switch(m.label){case 0:return n=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(o=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken?(o.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?(o.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(c.ZOAUTH)]);case 6:return u=m.sent(),[4,t.jumpAndGetToken(c.ZOAUTH_VRF)];case 7:if(l=m.sent(),d="zmp.getaccesstoken.fail",!a)throw o.getAccessTokenCount--,qt([{action:d,error:-104,message:"no user auth",data:{}}]),un.error.loginFailed("User Authentication Required");if(!u)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),l?[4,t.loginZaloV4(i,u,l)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(i,r,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),qt([{action:d,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return o.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(qt([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(un.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,qt([{action:d,error:-102,message:"no oauth",data:{}}]),un.error.loginFailed("Zalo app has not been activated")}}))}))()},u.verifyUserAuthorized=function(){var e=this;return Ee((function(){var t,n,r,i,o,a;return Oe(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=Tn("action.mp.user.authorize"))&&r.isSupported?[4,an()]:[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,dn()];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]}}))}))()},u.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},u.getJSAccessToken=function(){var e=this;return Ee((function(){var t;return Oe(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(c.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},u.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},u.jumpAndGetToken=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;return new Promise(function(){var r=Ee((function(r){var i,o,a,s;return Oe(this,(function(u){switch(u.label){case 0:return!t&&n._cookies.length>0?Tt.isString(e)?(i=n._cookies.find((function(t){return t.name===e})),[2,r(null==i?void 0:i.value)]):[2,r("")]:(t&&n._jumpStatus===h.DONE&&(n._jumpStatus=void 0),o={name:e,cb:function(e){return r(e)}},[4,n.jump()]);case 1:return(a=u.sent())===h.DONE?(n._jumpStatus=a,n.WAITING_QUEUE.length&&(n.WAITING_QUEUE.forEach((function(e){var t=n._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),n.WAITING_QUEUE=[]),s=n._cookies.find((function(e){return e.name===o.name})),o.cb(null==s?void 0:s.value)):n.WAITING_QUEUE.push(o),[2]}}))}));return function(e){return r.apply(this,arguments)}}())},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},n=e,(o=[{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}}])&&St(n.prototype,o),s&&St(n,s),e}(),fn=pn.getInstance(),hn=vt("zmp:utils:common"),mn=function(e){if(Tt.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(mn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+mn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},vn=function(e){var t,n,r=ae[e],i=(null===(t=xe())||void 0===t?void 0:t.zaloVersion)||0,o="versionLive"in r&&(null==r||null===(n=r.versionLive)||void 0===n?void 0:n.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(e))||Number(i)>=o},yn=function(e){try{if(e){hn(e);var t=e.replace(/\\/g,"").replace(/'/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}var n=JSON.parse(t);return hn("formattedValue",t,n,void 0===n?"undefined":mt(n)),n}return null}catch(t){return hn("parse json error:",t),e}},gn=function(e){if(Tt.isObject(JSON)&&JSON.parse&&Tt.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 Tt.isObject(e)?e:new Function("return "+e)()},_n=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""},wn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var bn=function(e){return"hidden"===e?P.hidden:"transparent"===e?P.transparent:P.normal},Tn=function(e){if(void 0!==e){var t=fn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},En=function(e){if(void 0===e)return!1;var t=fn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},Sn=function(){var e=Ee((function(){return Oe(this,(function(e){return[2,new Promise(function(){var e=Ee((function(e,t){var n;return Oe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,fn.jumpAndGetToken()];case 1:return t.sent(),n=fn.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)}}(),Pn=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},In=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function An(e,t,n,r){var i,o;!function(e,t){if(oe[e]){var n=fn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&fn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw rn(un.error.failLimit(),e);fn.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=un.error.badRequest(s);throw c.detail=a,rn(c,e)}u.push(i.data)}));var c=r.apply(void 0,Ae(u));return Tt.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!Tt.isNull(a)&&Tt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=rn(t,e);if(!Tt.isNull(s)&&Tt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!Tt.isNull(s)&&Tt.isFunction(s))return s(t);throw rn(t,e)}}function On(e){return kn.apply(this,arguments)}function kn(){return(kn=Ee((function(e){return Oe(this,(function(t){return[2,An("login",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,fn.jumpAndGetToken(c.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return De.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Le("login",{}))]}}))})))]}))}))).apply(this,arguments)}function Cn(e){return Nn.apply(this,arguments)}function Nn(){return(Nn=Ee((function(e){return Oe(this,(function(t){return[2,An("getAccessToken",[],[e],Ee((function(){var e;return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Sn()]:[3,3];case 1:return e=!t.sent(),[4,fn.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return De.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Le("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Mn,Rn="2.44.0";function xn(){return An("getVersion",[],[],(function(){return Rn}))}function Dn(){var e,t;return{version:_n("version-id")||"",apiVersion:Rn,zaloVersion:(null===(e=xe())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=xe())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Un(){return An("getSystemInfo",[],[],(function(){return Dn()}))}!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}(Mn||(Mn={}));const Ln=Mn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),jn=e=>{switch(typeof e){case"undefined":return Ln.undefined;case"string":return Ln.string;case"number":return isNaN(e)?Ln.nan:Ln.number;case"boolean":return Ln.boolean;case"function":return Ln.function;case"bigint":return Ln.bigint;case"symbol":return Ln.symbol;case"object":return Array.isArray(e)?Ln.array:null===e?Ln.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Ln.promise:"undefined"!=typeof Map&&e instanceof Map?Ln.map:"undefined"!=typeof Set&&e instanceof Set?Ln.set:"undefined"!=typeof Date&&e instanceof Date?Ln.date:Ln.object;default:return Ln.unknown}},Bn=Mn.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 Zn 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,Mn.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()}}Zn.create=e=>new Zn(e);const zn=(e,t)=>{let n;switch(e.code){case Bn.invalid_type:n=e.received===Ln.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Bn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Mn.jsonStringifyReplacer)}`;break;case Bn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Mn.joinValues(e.keys,", ")}`;break;case Bn.invalid_union:n="Invalid input";break;case Bn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Mn.joinValues(e.options)}`;break;case Bn.invalid_enum_value:n=`Invalid enum value. Expected ${Mn.joinValues(e.options)}, received '${e.received}'`;break;case Bn.invalid_arguments:n="Invalid function arguments";break;case Bn.invalid_return_type:n="Invalid function return type";break;case Bn.invalid_date:n="Invalid date";break;case Bn.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}"`:Mn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Bn.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 Bn.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 Bn.custom:n="Invalid input";break;case Bn.invalid_intersection_types:n="Intersection results could not be merged";break;case Bn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Bn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Mn.assertNever(e)}return{message:n}};let Wn=zn;function Fn(){return Wn}const Vn=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 Gn(e,t){const n=Vn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Fn(),zn].filter((e=>!!e))});e.common.issues.push(n)}class Hn{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 Kn;"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 Hn.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 Kn;if("aborted"===i.status)return Kn;"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 Kn=Object.freeze({status:"aborted"}),Jn=e=>({status:"dirty",value:e}),qn=e=>({status:"valid",value:e}),Qn=e=>"aborted"===e.status,$n=e=>"dirty"===e.status,Yn=e=>"valid"===e.status,Xn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var er;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(er||(er={}));class tr{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 nr=(e,t)=>{if(Yn(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 Zn(e.common.issues)}};function rr(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 ir{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 jn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Hn,ctx:{common:e.parent.common,data:e.data,parsedType:jn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Xn(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:jn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return nr(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:jn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Xn(r)?r:Promise.resolve(r));return nr(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:Bn.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 Wr({schema:this,typeName:Xr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Fr.create(this,this._def)}nullable(){return Vr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tr.create(this,this._def)}promise(){return zr.create(this,this._def)}or(e){return Ir.create([this,e],this._def)}and(e){return Cr.create(this,e,this._def)}transform(e){return new Wr({...rr(this._def),schema:this,typeName:Xr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Gr({...rr(this._def),innerType:this,defaultValue:t,typeName:Xr.ZodDefault})}brand(){return new qr({typeName:Xr.ZodBranded,type:this,...rr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Hr({...rr(this._def),innerType:this,catchValue:t,typeName:Xr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Qr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const or=/^c[^\s-]{8,}$/i,ar=/^[a-z][a-z0-9]*$/,sr=/^([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,ur=/^(([^<>()[\]\\.,;:\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 cr extends ir{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Bn.invalid_string,...er.errToObj(n)}),this.nonempty=e=>this.min(1,er.errToObj(e)),this.trim=()=>new cr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Ln.string){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.string,received:t.parsedType}),Kn}const t=new Hn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Gn(n,{code:Bn.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),Gn(n,{code:Bn.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?Gn(n,{code:Bn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Gn(n,{code:Bn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)ur.test(e.data)||(n=this._getOrReturnCtx(e,n),Gn(n,{validation:"email",code:Bn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)sr.test(e.data)||(n=this._getOrReturnCtx(e,n),Gn(n,{validation:"uuid",code:Bn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)or.test(e.data)||(n=this._getOrReturnCtx(e,n),Gn(n,{validation:"cuid",code:Bn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)ar.test(e.data)||(n=this._getOrReturnCtx(e,n),Gn(n,{validation:"cuid2",code:Bn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Gn(n,{validation:"url",code:Bn.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),Gn(n,{validation:"regex",code:Bn.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),Gn(n,{code:Bn.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),Gn(n,{code:Bn.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),Gn(n,{code:Bn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else Mn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new cr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...er.errToObj(e)})}url(e){return this._addCheck({kind:"url",...er.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...er.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...er.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...er.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,...er.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...er.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...er.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...er.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...er.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...er.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...er.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 lr(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)}cr.create=e=>{var t;return new cr({checks:[],typeName:Xr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...rr(e)})};class dr extends ir{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)!==Ln.number){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.number,received:t.parsedType}),Kn}let t;const n=new Hn;for(const r of this._def.checks)if("int"===r.kind)Mn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Gn(t,{code:Bn.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),Gn(t,{code:Bn.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),Gn(t,{code:Bn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==lr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Gn(t,{code:Bn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Gn(t,{code:Bn.not_finite,message:r.message}),n.dirty()):Mn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,er.toString(t))}gt(e,t){return this.setLimit("min",e,!1,er.toString(t))}lte(e,t){return this.setLimit("max",e,!0,er.toString(t))}lt(e,t){return this.setLimit("max",e,!1,er.toString(t))}setLimit(e,t,n,r){return new dr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:er.toString(r)}]})}_addCheck(e){return new dr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:er.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:er.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:er.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:er.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:er.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:er.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:er.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&&Mn.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)}}dr.create=e=>new dr({checks:[],typeName:Xr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...rr(e)});class pr extends ir{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Ln.bigint){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.bigint,received:t.parsedType}),Kn}return qn(e.data)}}pr.create=e=>{var t;return new pr({typeName:Xr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...rr(e)})};class fr extends ir{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Ln.boolean){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.boolean,received:t.parsedType}),Kn}return qn(e.data)}}fr.create=e=>new fr({typeName:Xr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...rr(e)});class hr extends ir{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Ln.date){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.date,received:t.parsedType}),Kn}if(isNaN(e.data.getTime())){return Gn(this._getOrReturnCtx(e),{code:Bn.invalid_date}),Kn}const t=new Hn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Gn(n,{code:Bn.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),Gn(n,{code:Bn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Mn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new hr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:er.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:er.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}}hr.create=e=>new hr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Xr.ZodDate,...rr(e)});class mr extends ir{_parse(e){if(this._getType(e)!==Ln.symbol){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.symbol,received:t.parsedType}),Kn}return qn(e.data)}}mr.create=e=>new mr({typeName:Xr.ZodSymbol,...rr(e)});class vr extends ir{_parse(e){if(this._getType(e)!==Ln.undefined){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.undefined,received:t.parsedType}),Kn}return qn(e.data)}}vr.create=e=>new vr({typeName:Xr.ZodUndefined,...rr(e)});class yr extends ir{_parse(e){if(this._getType(e)!==Ln.null){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.null,received:t.parsedType}),Kn}return qn(e.data)}}yr.create=e=>new yr({typeName:Xr.ZodNull,...rr(e)});class gr extends ir{constructor(){super(...arguments),this._any=!0}_parse(e){return qn(e.data)}}gr.create=e=>new gr({typeName:Xr.ZodAny,...rr(e)});class _r extends ir{constructor(){super(...arguments),this._unknown=!0}_parse(e){return qn(e.data)}}_r.create=e=>new _r({typeName:Xr.ZodUnknown,...rr(e)});class wr extends ir{_parse(e){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.never,received:t.parsedType}),Kn}}wr.create=e=>new wr({typeName:Xr.ZodNever,...rr(e)});class br extends ir{_parse(e){if(this._getType(e)!==Ln.undefined){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.void,received:t.parsedType}),Kn}return qn(e.data)}}br.create=e=>new br({typeName:Xr.ZodVoid,...rr(e)});class Tr extends ir{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Ln.array)return Gn(t,{code:Bn.invalid_type,expected:Ln.array,received:t.parsedType}),Kn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Gn(t,{code:e?Bn.too_big:Bn.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&&(Gn(t,{code:Bn.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&&(Gn(t,{code:Bn.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 tr(t,e,t.path,n))))).then((e=>Hn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new tr(t,e,t.path,n))));return Hn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Tr({...this._def,minLength:{value:e,message:er.toString(t)}})}max(e,t){return new Tr({...this._def,maxLength:{value:e,message:er.toString(t)}})}length(e,t){return new Tr({...this._def,exactLength:{value:e,message:er.toString(t)}})}nonempty(e){return this.min(1,e)}}var Er;function Sr(e){if(e instanceof Pr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Fr.create(Sr(r))}return new Pr({...e._def,shape:()=>t})}return e instanceof Tr?Tr.create(Sr(e.element)):e instanceof Fr?Fr.create(Sr(e.unwrap())):e instanceof Vr?Vr.create(Sr(e.unwrap())):e instanceof Nr?Nr.create(e.items.map((e=>Sr(e)))):e}Tr.create=(e,t)=>new Tr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Xr.ZodArray,...rr(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Er||(Er={}));class Pr extends ir{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=Mn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Ln.object){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.object,received:t.parsedType}),Kn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof wr&&"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 tr(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof wr){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&&(Gn(n,{code:Bn.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 tr(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=>Hn.mergeObjectSync(t,e))):Hn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return er.errToObj,new Pr({...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=er.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Pr({...this._def,unknownKeys:"strip"})}passthrough(){return new Pr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Pr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Pr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>Er.mergeShapes(this._def.shape(),e._def.shape()),typeName:Xr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Pr({...this._def,catchall:e})}pick(e){const t={};return Mn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Pr({...this._def,shape:()=>t})}omit(e){const t={};return Mn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Pr({...this._def,shape:()=>t})}deepPartial(){return Sr(this)}partial(e){const t={};return Mn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Pr({...this._def,shape:()=>t})}required(e){const t={};return Mn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Fr;)e=e._def.innerType;t[n]=e}})),new Pr({...this._def,shape:()=>t})}keyof(){return jr(Mn.objectKeys(this.shape))}}Pr.create=(e,t)=>new Pr({shape:()=>e,unknownKeys:"strip",catchall:wr.create(),typeName:Xr.ZodObject,...rr(t)}),Pr.strictCreate=(e,t)=>new Pr({shape:()=>e,unknownKeys:"strict",catchall:wr.create(),typeName:Xr.ZodObject,...rr(t)}),Pr.lazycreate=(e,t)=>new Pr({shape:e,unknownKeys:"strip",catchall:wr.create(),typeName:Xr.ZodObject,...rr(t)});class Ir extends ir{_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 Zn(e.ctx.common.issues)));return Gn(t,{code:Bn.invalid_union,unionErrors:n}),Kn}));{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 Zn(e)));return Gn(t,{code:Bn.invalid_union,unionErrors:i}),Kn}}get options(){return this._def.options}}Ir.create=(e,t)=>new Ir({options:e,typeName:Xr.ZodUnion,...rr(t)});const Ar=e=>e instanceof Ur?Ar(e.schema):e instanceof Wr?Ar(e.innerType()):e instanceof Lr?[e.value]:e instanceof Br?e.options:e instanceof Zr?Object.keys(e.enum):e instanceof Gr?Ar(e._def.innerType):e instanceof vr?[void 0]:e instanceof yr?[null]:null;class Or extends ir{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ln.object)return Gn(t,{code:Bn.invalid_type,expected:Ln.object,received:t.parsedType}),Kn;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}):(Gn(t,{code:Bn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Kn)}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=Ar(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 Or({typeName:Xr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...rr(n)})}}function kr(e,t){const n=jn(e),r=jn(t);if(e===t)return{valid:!0,data:e};if(n===Ln.object&&r===Ln.object){const n=Mn.objectKeys(t),r=Mn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=kr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Ln.array&&r===Ln.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=kr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Ln.date&&r===Ln.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Cr extends ir{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Qn(e)||Qn(r))return Kn;const i=kr(e.value,r.value);return i.valid?(($n(e)||$n(r))&&t.dirty(),{status:t.value,value:i.data}):(Gn(n,{code:Bn.invalid_intersection_types}),Kn)};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}))}}Cr.create=(e,t,n)=>new Cr({left:e,right:t,typeName:Xr.ZodIntersection,...rr(n)});class Nr extends ir{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ln.array)return Gn(n,{code:Bn.invalid_type,expected:Ln.array,received:n.parsedType}),Kn;if(n.data.length<this._def.items.length)return Gn(n,{code:Bn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Kn;!this._def.rest&&n.data.length>this._def.items.length&&(Gn(n,{code:Bn.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 tr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Hn.mergeArray(t,e))):Hn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Nr({...this._def,rest:e})}}Nr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nr({items:e,typeName:Xr.ZodTuple,rest:null,...rr(t)})};class Mr extends ir{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!==Ln.object)return Gn(n,{code:Bn.invalid_type,expected:Ln.object,received:n.parsedType}),Kn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new tr(n,e,n.path,e)),value:o._parse(new tr(n,n.data[e],n.path,e))});return n.common.async?Hn.mergeObjectAsync(t,r):Hn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Mr(t instanceof ir?{keyType:e,valueType:t,typeName:Xr.ZodRecord,...rr(n)}:{keyType:cr.create(),valueType:e,typeName:Xr.ZodRecord,...rr(t)})}}class Rr extends ir{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ln.map)return Gn(n,{code:Bn.invalid_type,expected:Ln.map,received:n.parsedType}),Kn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new tr(n,e,n.path,[o,"key"])),value:i._parse(new tr(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 Kn;"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 Kn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Rr.create=(e,t,n)=>new Rr({valueType:t,keyType:e,typeName:Xr.ZodMap,...rr(n)});class xr extends ir{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ln.set)return Gn(n,{code:Bn.invalid_type,expected:Ln.set,received:n.parsedType}),Kn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Gn(n,{code:Bn.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&&(Gn(n,{code:Bn.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 Kn;"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 tr(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new xr({...this._def,minSize:{value:e,message:er.toString(t)}})}max(e,t){return new xr({...this._def,maxSize:{value:e,message:er.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}xr.create=(e,t)=>new xr({valueType:e,minSize:null,maxSize:null,typeName:Xr.ZodSet,...rr(t)});class Dr extends ir{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ln.function)return Gn(t,{code:Bn.invalid_type,expected:Ln.function,received:t.parsedType}),Kn;function n(e,n){return Vn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Fn(),zn].filter((e=>!!e)),issueData:{code:Bn.invalid_arguments,argumentsError:n}})}function r(e,n){return Vn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Fn(),zn].filter((e=>!!e)),issueData:{code:Bn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof zr?qn((async(...e)=>{const t=new Zn([]),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}))})):qn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Zn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Zn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Dr({...this._def,args:Nr.create(e).rest(_r.create())})}returns(e){return new Dr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Dr({args:e||Nr.create([]).rest(_r.create()),returns:t||_r.create(),typeName:Xr.ZodFunction,...rr(n)})}}class Ur extends ir{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})}}Ur.create=(e,t)=>new Ur({getter:e,typeName:Xr.ZodLazy,...rr(t)});class Lr extends ir{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Gn(t,{received:t.data,code:Bn.invalid_literal,expected:this._def.value}),Kn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function jr(e,t){return new Br({values:e,typeName:Xr.ZodEnum,...rr(t)})}Lr.create=(e,t)=>new Lr({value:e,typeName:Xr.ZodLiteral,...rr(t)});class Br extends ir{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Gn(t,{expected:Mn.joinValues(n),received:t.parsedType,code:Bn.invalid_type}),Kn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Gn(t,{received:t.data,code:Bn.invalid_enum_value,options:n}),Kn}return qn(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 Br.create(e)}exclude(e){return Br.create(this.options.filter((t=>!e.includes(t))))}}Br.create=jr;class Zr extends ir{_parse(e){const t=Mn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Ln.string&&n.parsedType!==Ln.number){const e=Mn.objectValues(t);return Gn(n,{expected:Mn.joinValues(e),received:n.parsedType,code:Bn.invalid_type}),Kn}if(-1===t.indexOf(e.data)){const e=Mn.objectValues(t);return Gn(n,{received:n.data,code:Bn.invalid_enum_value,options:e}),Kn}return qn(e.data)}get enum(){return this._def.values}}Zr.create=(e,t)=>new Zr({values:e,typeName:Xr.ZodNativeEnum,...rr(t)});class zr extends ir{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ln.promise&&!1===t.common.async)return Gn(t,{code:Bn.invalid_type,expected:Ln.promise,received:t.parsedType}),Kn;const n=t.parsedType===Ln.promise?t.data:Promise.resolve(t.data);return qn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}zr.create=(e,t)=>new zr({type:e,typeName:Xr.ZodPromise,...rr(t)});class Wr extends ir{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xr.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=>{Gn(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?Kn:("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?Kn:("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(!Yn(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=>Yn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}Mn.assertNever(r)}}Wr.create=(e,t,n)=>new Wr({schema:e,typeName:Xr.ZodEffects,effect:t,...rr(n)}),Wr.createWithPreprocess=(e,t,n)=>new Wr({schema:t,effect:{type:"preprocess",transform:e},typeName:Xr.ZodEffects,...rr(n)});class Fr extends ir{_parse(e){return this._getType(e)===Ln.undefined?qn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fr.create=(e,t)=>new Fr({innerType:e,typeName:Xr.ZodOptional,...rr(t)});class Vr extends ir{_parse(e){return this._getType(e)===Ln.null?qn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Vr.create=(e,t)=>new Vr({innerType:e,typeName:Xr.ZodNullable,...rr(t)});class Gr extends ir{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Ln.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Gr.create=(e,t)=>new Gr({innerType:e,typeName:Xr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...rr(t)});class Hr extends ir{_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 Xn(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}}Hr.create=(e,t)=>new Hr({innerType:e,typeName:Xr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...rr(t)});class Kr extends ir{_parse(e){if(this._getType(e)!==Ln.nan){const t=this._getOrReturnCtx(e);return Gn(t,{code:Bn.invalid_type,expected:Ln.nan,received:t.parsedType}),Kn}return{status:"valid",value:e.data}}}Kr.create=e=>new Kr({typeName:Xr.ZodNaN,...rr(e)});const Jr=Symbol("zod_brand");class qr extends ir{_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 Qr extends ir{_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?Kn:"dirty"===e.status?(t.dirty(),Jn(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?Kn:"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 Qr({in:e,out:t,typeName:Xr.ZodPipeline})}}const $r=(e,t={},n)=>e?gr.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})}})):gr.create(),Yr={object:Pr.lazycreate};var Xr;!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"}(Xr||(Xr={}));const ei=cr.create,ti=dr.create,ni=Kr.create,ri=pr.create,ii=fr.create,oi=hr.create,ai=mr.create,si=vr.create,ui=yr.create,ci=gr.create,li=_r.create,di=wr.create,pi=br.create,fi=Tr.create,hi=Pr.create,mi=Pr.strictCreate,vi=Ir.create,yi=Or.create,gi=Cr.create,_i=Nr.create,wi=Mr.create,bi=Rr.create,Ti=xr.create,Ei=Dr.create,Si=Ur.create,Pi=Lr.create,Ii=Br.create,Ai=Zr.create,Oi=zr.create,ki=Wr.create,Ci=Fr.create,Ni=Vr.create,Mi=Wr.createWithPreprocess,Ri=Qr.create,xi={string:e=>cr.create({...e,coerce:!0}),number:e=>dr.create({...e,coerce:!0}),boolean:e=>fr.create({...e,coerce:!0}),bigint:e=>pr.create({...e,coerce:!0}),date:e=>hr.create({...e,coerce:!0})},Di=Kn;var Ui=Object.freeze({__proto__:null,defaultErrorMap:zn,setErrorMap:function(e){Wn=e},getErrorMap:Fn,makeIssue:Vn,EMPTY_PATH:[],addIssueToContext:Gn,ParseStatus:Hn,INVALID:Kn,DIRTY:Jn,OK:qn,isAborted:Qn,isDirty:$n,isValid:Yn,isAsync:Xn,get util(){return Mn},ZodParsedType:Ln,getParsedType:jn,ZodType:ir,ZodString:cr,ZodNumber:dr,ZodBigInt:pr,ZodBoolean:fr,ZodDate:hr,ZodSymbol:mr,ZodUndefined:vr,ZodNull:yr,ZodAny:gr,ZodUnknown:_r,ZodNever:wr,ZodVoid:br,ZodArray:Tr,get objectUtil(){return Er},ZodObject:Pr,ZodUnion:Ir,ZodDiscriminatedUnion:Or,ZodIntersection:Cr,ZodTuple:Nr,ZodRecord:Mr,ZodMap:Rr,ZodSet:xr,ZodFunction:Dr,ZodLazy:Ur,ZodLiteral:Lr,ZodEnum:Br,ZodNativeEnum:Zr,ZodPromise:zr,ZodEffects:Wr,ZodTransformer:Wr,ZodOptional:Fr,ZodNullable:Vr,ZodDefault:Gr,ZodCatch:Hr,ZodNaN:Kr,BRAND:Jr,ZodBranded:qr,ZodPipeline:Qr,custom:$r,Schema:ir,ZodSchema:ir,late:Yr,get ZodFirstPartyTypeKind(){return Xr},coerce:xi,any:ci,array:fi,bigint:ri,boolean:ii,date:oi,discriminatedUnion:yi,effect:ki,enum:Ii,function:Ei,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>$r((t=>t instanceof e),t,!0),intersection:gi,lazy:Si,literal:Pi,map:bi,nan:ni,nativeEnum:Ai,never:di,null:ui,nullable:Ni,number:ti,object:hi,oboolean:()=>ii().optional(),onumber:()=>ti().optional(),optional:Ci,ostring:()=>ei().optional(),pipeline:Ri,preprocess:Mi,promise:Oi,record:wi,set:Ti,strictObject:mi,string:ei,symbol:ai,transformer:ki,tuple:_i,undefined:si,union:vi,unknown:li,void:pi,NEVER:Di,ZodIssueCode:Bn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Zn}),Li=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O,k;Et(this,e),this.initConfig=window.APP_CONFIG;var C=Tt.isString(null===(t=this.initConfig)||void 0===t||null===(n=t.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(o=r.app)||void 0===o||null===(s=o.headerColor)||void 0===s?void 0:s.length)>0?ye:ge;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)?ve.HIDE_BACK:ve.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)?ve.SHOW_HOME:ve.HIDE_HOME,D=new URL(location.href),U=bn(null===(w=this.initConfig)||void 0===w||null===(b=w.app)||void 0===b?void 0:b.statusBar);"boolean"==typeof(null===(T=this.initConfig)||void 0===T||null===(E=T.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)?ge:ye);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)||_e,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)||we,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(D.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return Ee((function(){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},t.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return Ee((function(){var r,i;return Oe(this,(function(o){return void 0===(void 0===e?"undefined":mt(e))&&null===(void 0===e?"undefined":mt(e))||(r="none"===e||"home"===e?ve.HIDE_BACK:ve.SHOW_BACK,i="home"===e||"both"===e?ve.SHOW_HOME:ve.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){ln("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Be({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},t.setAndroidBottomNavigationBar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Ee((function(){var n,r,i;return Oe(this,(function(o){return r=e?I.hide:I.show,i=null===(n=xe())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isAndroid))return n();ln("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideAndroidBottomNavigationBar=!!e,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.setIOSBottomSafeArea=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return Ee((function(){var n,r,i;return Oe(this,(function(o){return r=e?A.hide:A.show,i=null===(n=xe())||void 0===n?void 0:n.platform,[2,new Promise((function(n,o){if(!(null==i?void 0:i.isIOS))return n();ln("CHANGE_BOTTOMBAR",{bottombarType:r},{success:function(){t.hideIOSSafeAreaBottom=!!e,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!e,n()},fail:function(e){o(e)}},{timeout:!1,delay:200})}))]}))}))()},t.configHeader=function(e){var t=this;return Ee((function(){var n;return Oe(this,(function(r){return n=t.config,Tt.isString(e.headerColor)&&(n.dataConfig.backgroundColor=e.headerColor),Tt.isString(e.headerTextColor)&&(n.dataConfig.textColor=e.headerTextColor),Tt.isString(e.textAlign)&&("left"===e.textAlign?n.dataConfig.textAlign=O.left:"center"===e.textAlign&&(n.dataConfig.textAlign=O.center)),!0===e.hideActionBar?n.actionbarType=ge:!1===e.hideActionBar&&(n.actionbarType=ye),"normal"===e.statusBarType?n.statusbarType=P.normal:"hidden"===e.statusBarType?n.statusbarType=P.hidden:"transparent"===e.statusBarType&&(n.statusbarType=P.transparent),[2,new Promise((function(r,i){ln("CHANGE_ACTIONBAR",Be({},n),{success:function(){var i;t.config=Be({},n);var o,a=null===(i=xe())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===P.hidden?"hidden":o===P.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=t.config.actionbarType===ge;var s=null===document||void 0===document?void 0:document.querySelector(":root");if(null==a?void 0:a.isAndroid){var u=0;if(("hidden"===e.statusBarType||"transparent"===e.statusBarType)&&e.hideActionBar){var c=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(c)&&(c=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),u=c}u?null==s||s.style.setProperty("--zaui-safe-area-inset-top","".concat(u,"px")):null==s||s.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}r()},fail:function(e){i(e)}},{timeout:!1})}))]}))}))()},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),ji=Li.getInstance(),Bi=[hi({title:ei()}).optional()];function Zi(e){return zi.apply(this,arguments)}function zi(){return zi=Ee((function(e){return Oe(this,(function(t){return[2,An("setNavigationBarTitle",Bi,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ji.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zi.apply(this,arguments)}var Wi=[hi({color:ei(),textColor:Ui.enum(["black","white"]).optional(),statusBarColor:ei().optional()}).optional()];function Fi(e){return Vi.apply(this,arguments)}function Vi(){return Vi=Ee((function(e){return Oe(this,(function(t){return[2,An("setNavigationBarColor",Wi,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ji.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 De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vi.apply(this,arguments)}var Gi=[hi({type:Ui.enum(["none","back","home","both"])}).optional()];function Hi(e){return Ki.apply(this,arguments)}function Ki(){return Ki=Ee((function(e){return Oe(this,(function(t){return[2,An("setNavigationBarLeftButton",Gi,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ji.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ki.apply(this,arguments)}function Ji(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function qi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ji(e,t,"get"))}function Qi(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 $i(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,Ji(e,t,"set"),n),n}var Yi,Xi,eo,to=function(){function e(){Et(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(je({},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}(),no=new WeakMap,ro=new WeakMap,io=new WeakMap,oo=function(e){Ct(n,e);var t=Mt(n);function n(e){var r;return Et(this,n),Qi(Nt(r=t.call(this)),no,{writable:!0,value:localStorage}),Qi(Nt(r),ro,{writable:!0,value:void 0}),Qi(Nt(r),io,{writable:!0,value:void 0}),$i(Nt(r),io,{keys:new Set,currentSize:0,limitSize:ce}),$i(Nt(r),ro,e),r.findAllCurrentDataByApp(e),r}var r=n.prototype;return r.findAllCurrentDataByApp=function(e){try{var t;for(t in qi(this,no)){if(e)if(t.split("_")[0]!==e)continue;qi(this,io).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 qi(this,ro)&&(e="".concat(qi(this,ro),"_").concat(e)),qi(this,io).keys.has(e)?qi(this,no).getItem(e):null},r.set=function(e){var t=this;return Ee((function(){return Oe(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ze(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.setSync=function(e,t){qi(this,ro)&&(e="".concat(qi(this,ro),"_").concat(e)),qi(this,no).setItem(e,t),qi(this,io).keys.add(e)},r.getInfo=function(){var e=this;return Ee((function(){return Oe(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}(qi(this,no),qi(this,ro));return{currentSize:Tt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((ce/1024).toFixed(2))}},r.remove=function(e){var t=this;return Ee((function(){return Oe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},r.removeSync=function(e){qi(this,ro)&&(e="".concat(qi(this,ro),"_").concat(e)),qi(this,io).keys.has(e)&&(qi(this,no).removeItem(e),qi(this,io).keys.delete(e))},r.clearAsync=function(){var e=this;return Ee((function(){return Oe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},r.clearSync=function(){var e=this;qi(this,io).keys.forEach((function(t){qi(e,ro)&&t.indexOf(qi(e,ro))<0||(qi(e,no).removeItem(t),qi(e,io).keys.delete(t))}))},n}(to),ao=new WeakMap,so=new WeakMap,uo=function(e){Ct(n,e);var t=Mt(n);function n(e){var r;return Et(this,n),Qi(Nt(r=t.call(this)),ao,{writable:!0,value:void 0}),Qi(Nt(r),so,{writable:!0,value:void 0}),$i(Nt(r),so,{keys:new Set,currentSize:0,limitSize:ce}),$i(Nt(r),ao,e),r}var r=n.prototype;return r.get=function(e){var t=this;return Ee((function(){return Oe(this,(function(n){return[2,new Promise((function(n,r){ln("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:qi(t,ao)},{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:qi(this,ao)},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 Ee((function(){return Oe(this,(function(n){return[2,new Promise((function(n,r){ln("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:qi(t,ao)},{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:qi(this,ao)},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 Ee((function(){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:qi(e,ao)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:Tt.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(ce/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.getInfoSynchronize=function(){var e={mpds_action:"mpds.get.size",mpds_data:{},appId:qi(this,ao)},t=0,n=this.handleResult(e);return n&&n.mpds_data&&n.mpds_data.size&&(t=n.mpds_data.size),{currentSize:Tt.isNumber(t)?Number(Number(t)/1024):0,limitSize:Number(ce/1024)}},r.remove=function(e){var t=this;return Ee((function(){return Oe(this,(function(n){return[2,new Promise((function(n,r){ln("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:qi(t,ao)},{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:qi(this,ao)},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 Ee((function(){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:qi(e,ao)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},r.clearSynchronize=function(){var e={mpds_action:"mpds.clear.appData",mpds_data:{},appId:qi(this,ao)};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=cn(n).toJSON()}}catch(e){t=e}finally{if(null!==t)throw t}return{}},n}(to),co=function(){function e(){Et(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return Ee((function(){var n,r;return Oe(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]=yn(e)})),[2,r]}}))}))()},t.getItem=function(e){return this.getInstance().getItem(e)},t.putDataToStorage=function(e){var t=this;return Ee((function(){var n,r;return Oe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ze(e,2),n=t[0],i=t[1];Tt.isUndefined(i)||Tt.isNull(i)||(r[n]=wn(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 Ee((function(){return Oe(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 Ee((function(){return Oe(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 Ee((function(){return Oe(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}(),lo=new WeakMap,po=function(e){Ct(n,e);var t=Mt(n);function n(e){var r;return Et(this,n),Qi(Nt(r=t.call(this)),lo,{writable:!0,value:void 0}),$i(Nt(r),lo,e),r}return n.prototype.getInstance=function(){return new oo(qi(this,lo))},n}(co),fo=new WeakMap,ho=function(e){Ct(n,e);var t=Mt(n);function n(e){var r;return Et(this,n),Qi(Nt(r=t.call(this)),fo,{writable:!0,value:void 0}),$i(Nt(r),fo,e),r}return n.prototype.getInstance=function(){return new uo(qi(this,fo))},n}(co),mo=new po(i),vo=(null===(Yi=xe())||void 0===Yi?void 0:Yi.zaloVersion)||"",yo=(null===(Xi=xe())||void 0===Xi?void 0:Xi.platformName)||"unknown";!!Tt.isString(vo)&&parseInt(vo,10)>={android:12100571,iOS:400,wp:0,unknown:0}[yo]&&(null===(eo=xe())||void 0===eo?void 0:eo.appEnv.isMp)&&(mo=new ho(i));var go=mo,_o=[hi({data:Ui.record(ei(),Ui.any())}).optional()];function wo(e){return bo.apply(this,arguments)}function bo(){return bo=Ee((function(e){return Oe(this,(function(t){return[2,An("setStorage",_o,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp||De.isMpWeb?[4,go.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Le("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bo.apply(this,arguments)}var To=[hi({keys:Ui.array(ei())}).optional()];function Eo(e){return So.apply(this,arguments)}function So(){return So=Ee((function(e){return Oe(this,(function(t){return[2,An("getStorage",To,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp||De.isMpWeb?[4,go.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Le("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),So.apply(this,arguments)}function Po(e){return Io.apply(this,arguments)}function Io(){return(Io=Ee((function(e){return Oe(this,(function(t){return[2,An("getStorageInfo",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp||De.isMpWeb?[4,go.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Le("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ao=[hi({keys:Ui.array(ei())}).optional()];function Oo(e){return ko.apply(this,arguments)}function ko(){return ko=Ee((function(e){return Oe(this,(function(t){return[2,An("removeStorage",Ao,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp||De.isMpWeb?[4,go.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Le("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ko.apply(this,arguments)}var Co=[hi({prefix:ei().optional()}).optional()];function No(e){return Mo.apply(this,arguments)}function Mo(){return(Mo=Ee((function(e){return Oe(this,(function(t){return[2,An("clearStorage",Co,[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp||De.isMpWeb?[4,go.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Le("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Ro=function(){var e=Ee((function(e,t){var n,r,o,a;return Oe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,Sn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,fn.getAccessToken(n)];case 3:return o=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(l.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(i),{headers:{access_token:o||""}}).then(function(){var e=Ee((function(e){var t,n,r,i;return Oe(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return r=o.sent(),i=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:i,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)}}(),xo=[hi({avatarType:Ui.enum(["small","normal","large"]).optional(),autoRequestPermission:Ui.boolean().default(!1).optional()}).optional()];function Do(e){return Uo.apply(this,arguments)}function Uo(){return Uo=Ee((function(e){return Oe(this,(function(t){return[2,An("getUserInfo",xo,[e],function(){var e=Ee((function(e){var t,n;return Oe(this,(function(r){switch(r.label){case 0:return De.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,Ro(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return De.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Le("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Uo.apply(this,arguments)}var Lo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},jo=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(t){var n,r,i,o=t.network,a=(null===(n=xe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isAndroid)||!1;switch(o){case Lo(a).NONE:i=d.none;break;case Lo(a).WIFI:i=d.wifi;break;case Lo(a)["2G"]:case Lo(a)["3G"]:case Lo(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function Bo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=Ee((function(e){return Oe(this,(function(t){return[2,An("getNetworkType",[],[e],Ee((function(){var e,t;return Oe(this,(function(n){switch(n.label){case 0:return De.isMp?[4,jo()]:[3,2];case 1:return[2,{networkType:n.sent()}];case 2:if(De.isMpWeb){switch(e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,e.effectiveType){case"none":t=d.none;break;case"4g":t=d.wifi;break;case"3g":case"2g":t=d.cellular;break;default:t=d.unknown}return[2,Promise.resolve({networkType:t})]}return[2,Promise.reject(Le("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=[Ui.function().args(hi({isConnected:Ui.boolean(),networkType:Ui.enum(["none","wifi","cellular","unknown"])})).returns(Ui.void())];function Wo(e){return An("onNetworkStatusChange",zo,[e],(function(e){var t=e;if(De.isMp)!function(e){Lt.getInstance().on(f.NetworkChanged,(function(t){var n=null==t?void 0:t.state;jo().then((function(t){e({isConnected:"CONNECTED"===n,networkType:t})}))}))}(t);else if(De.isMpWeb){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=n.effectiveType;n.addEventListener("change",(function(){var e;switch(r){case"none":e=d.none;break;case"4g":e=d.wifi;break;case"3g":case"2g":e=d.cellular;break;default:e=d.unknown}t({isConnected:!0,networkType:e})}))}}))}var Fo=function(){var e=Ee((function(e){var t,n,r,i,o,a;return Oe(this,(function(s){return a={subaction:0,scanning_type:Tt.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:Tt.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:Tt.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:Tt.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:Tt.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:Tt.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:Tt.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:Tt.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:Tt.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:Tt.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){ln("SCAN_IBEACON",Be({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Vo=[hi({scanningType:Ui.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ui.number().optional(),monitorInterval:Ui.number().optional(),domain:Ui.string().optional(),scanConfig:hi({scanTime:Ui.number().optional(),timeBetweenScan:Ui.number().optional(),beaconTimeout:Ui.number().optional(),delayCheckConnectedTimeout:Ui.number().optional(),beaconConnectedTimeout:Ui.number().optional()}).optional(),items:Ui.array(hi({id:Ui.string().optional(),distance:Ui.number().optional(),monitor:hi({enable:Ui.boolean().optional(),movingRange:Ui.number().optional()}).optional()})).optional(),scanFromSource:Ui.string().optional()}).optional()];function Go(e){return Ho.apply(this,arguments)}function Ho(){return(Ho=Ee((function(e){return Oe(this,(function(t){return[2,An("startBeaconDiscovery",Vo,[e],Ee((function(){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Fo(e)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Le("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ko=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Jo(e){return qo.apply(this,arguments)}function qo(){return(qo=Ee((function(e){return Oe(this,(function(t){return[2,An("stopBeaconDiscovery",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Ko()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Le("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Qo=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("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 $o(e){return Yo.apply(this,arguments)}function Yo(){return(Yo=Ee((function(e){return Oe(this,(function(t){return[2,An("getBeacons",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Qo()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Le("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Xo=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ea(e){return ta.apply(this,arguments)}function ta(){return(ta=Ee((function(e){return Oe(this,(function(t){return[2,An("closeApp",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Xo()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var na=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ra(e){return ia.apply(this,arguments)}function ia(){return(ia=Ee((function(e){return Oe(this,(function(t){return[2,An("scanQRCode",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,na()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Le("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var oa=function(){var e=Ee((function(e,t,n,i){return Oe(this,(function(o){return[2,new Promise((function(o,a){ln("OPEN_PROFILE",{uId:e,type:m[t],zapp:r,sourceId:n,sourceIndex:i},{success:function(){o()},fail:function(e){a(e)}},{})}))]}))}));return function(t,n,r,i){return e.apply(this,arguments)}}(),aa=[hi({id:ei(),type:Ui.enum(["user","oa","aliasOA"]),sourceId:Ui.any().optional(),sourceIndex:Ui.any().optional()}).optional()];function sa(e){return ua.apply(this,arguments)}function ua(){return ua=Ee((function(e){return Oe(this,(function(t){return[2,An("openProfile",aa,[e],function(){var e=Ee((function(e){var t,n,r,i;return Oe(this,(function(o){switch(o.label){case 0:return De.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,oa(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ua.apply(this,arguments)}var ca=function(){var e=Ee((function(e,t){var n,i,o,a=arguments;return Oe(this,(function(s){return n=a.length>2&&void 0!==a[2]?a[2]:"",i=a.length>3?a[3]:void 0,o=a.length>4?a[4]:void 0,[2,new Promise((function(a,s){ln("OPEN_CHAT",{uId:e,type:v[t],msg:n,zapp:r,sourceId:i,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),la=[hi({id:ei(),type:Ui.enum(["user","oa"]),sourceId:Ui.any().optional(),sourceIndex:Ui.any().optional(),message:ei().optional()}).optional()];function da(e){return pa.apply(this,arguments)}function pa(){return pa=Ee((function(e){return Oe(this,(function(t){return[2,An("openChat",la,[e],function(){var e=Ee((function(e){var t,n,r,i,o;return Oe(this,(function(a){switch(a.label){case 0:return De.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,ca(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),pa.apply(this,arguments)}function fa(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 ha=function(){var e=Ee((function(e,t){var n,i;return Oe(this,(function(o){switch(n={},i=e,e){case"image":(null==t?void 0:t.imageUrls)?(i="multi_image",n={photoUrl:null==t?void 0:t.imageUrls}):n={photoUrl:null==t?void 0:t.imageUrl};break;case"link":n={link:null==t?void 0:t.link,title:null==t?void 0:t.title,thumb:null==t?void 0:t.thumb,description:null==t?void 0:t.description};break;case"profile":n={avt:null==t?void 0:t.avatar,uid:null==t?void 0:t.id,dpn:null==t?void 0:t.displayName}}return[2,new Promise((function(e,t){ln("OPEN_POSTFEED",fa(Be({type:y[i]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ma=[Ui.union([hi({type:Ui.enum(["image"]),data:hi({imageUrl:ei().url().optional(),imageUrls:Ui.array(ei().url()).optional()})}),hi({type:Ui.enum(["link"]),data:hi({link:ei().url(),title:ei().max(100).optional(),thumb:ei().url().optional(),description:ei().max(400).default("").optional()})}),hi({type:Ui.enum(["profile"]),data:hi({id:ei().optional()})})])];function va(e){return ya.apply(this,arguments)}function ya(){return ya=Ee((function(e){return Oe(this,(function(t){return[2,An("openPostFeed",ma,[e],function(){var e=Ee((function(e){var t,n;return Oe(this,(function(r){switch(r.label){case 0:return De.isMp?(t=e.type,n=e.data,[4,ha(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Le("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ya.apply(this,arguments)}var ga=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:r},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),_a=[hi({id:ei(),showDialogConfirm:Ui.boolean().optional()}).optional()];function wa(e){return ba.apply(this,arguments)}function ba(){return ba=Ee((function(e){return Oe(this,(function(t){return[2,An("followOA",_a,[e],function(){var e=Ee((function(e){var t;return Oe(this,(function(n){switch(n.label){case 0:return De.isMp?(t=e.id,[4,ga(t)]):[3,2];case 1:return[2,n.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ba.apply(this,arguments)}var Ta=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ea=[hi({id:ei()}).optional()];function Sa(e){return Pa.apply(this,arguments)}function Pa(){return Pa=Ee((function(e){return Oe(this,(function(t){return[2,An("unfollowOA",Ea,[e],function(){var e=Ee((function(e){var t;return Oe(this,(function(n){switch(n.label){case 0:return De.isMp?(t=e.id,[4,Ta(t)]):[3,2];case 1:return[2,n.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pa.apply(this,arguments)}var Ia=function(){var e=Ee((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return Oe(this,(function(y){switch(y.label){case 0:return d=new URL(location.href),p=new URLSearchParams,f="".concat(d.pathname.replace(u,"")).concat(d.search),a&&(f="/".concat(e).concat("/"===a[0]?"":"/").concat(a)),!(h=new URL("".concat(o).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===(c=window.APP_VERSION)||void 0===c?void 0:c.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(l.CREATE_SHARE_LINK,Be({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw un.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,fa(Be({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),Aa=function(){var e=Ee((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return Oe(this,(function(v){switch(v.label){case 0:switch(n={},o=e,e){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 n={text:null==t?void 0:t.text,desc:(null==t?void 0:t.desc)||(null==t?void 0:t.description),autoParseLink:(null==t?void 0:t.autoParseLink)?1:0},[3,14];case 2:return c=[],l=(null===(s=xe())||void 0===s?void 0:s.zaloVersion)||0,d=(null===(u=xe())||void 0===u?void 0:u.platformName)||"unknown",Number(l)>=ue[d]&&(o="multi_image"),Array.isArray(null==t?void 0:t.imageUrls)&&(null==t?void 0:t.imageUrls.length)>0?c=null==t?void 0:t.imageUrls:c.push(null==t?void 0:t.imageUrl),n={photoUrls:c,photoUrl:null==t?void 0:t.imageUrl,caption:null==t?void 0:t.caption},[3,14];case 3:return n={photoUrl:null==t?void 0:t.imageUrl,gifUrl:null==t?void 0:t.gifUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 4:return n={videoThumb:null==t?void 0:t.videoThumb,videoUrl:null==t?void 0:t.videoUrl,width:null==t?void 0:t.width,height:null==t?void 0:t.height},[3,14];case 5:return n={link:null==t?void 0:t.link,chatOnly:(null==t?void 0:t.chatOnly)?1:0},[3,14];case 6:return n={uid:null==t?void 0:t.id},[3,14];case 7:case 10:return[4,fn.getAccessToken()];case 8:case 11:return a=v.sent(),[4,Ia(i,a||"",(null==t?void 0:t.title)||"",(null==t?void 0:t.description)||"",(null==t?void 0:t.thumbnail)||"",null==t?void 0:t.path)];case 9:return p=v.sent(),n={data:{ZInstantAPIInfo:{url:"".concat(p.zinstantApi),zinstantdata_id:"templateId=".concat(p.ztemplateId,"&appId=").concat(i,"&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]),n={link:h.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(e,t){ln("OPEN_SHARESHEET",fa(Be({type:_[o]},n),{zapp:r}),{success:function(t){e({status:null==t?void 0:t.status,shareType:null==t?void 0:t.share_type,numberOfUser:null==t?void 0:t.uid_to_size})},fail:function(e){t(e)}},{timeout:!1})}))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Oa=[Ui.union([hi({type:Ui.enum(["text"]),data:hi({text:ei(),description:ei().default("").optional(),autoParseLink:Ui.boolean().default(!1).optional()})}),hi({type:Ui.enum(["image"]),data:hi({imageUrl:ei().url().optional(),imageUrls:Ui.array(ei().url()).max(10).optional()})}),hi({type:Ui.enum(["link"]),data:hi({link:ei().url(),chatOnly:Ui.boolean().optional()})}),hi({type:Ui.enum(["oa"]),data:hi({id:ei()})}),hi({type:Ui.enum(["gif"]),data:hi({gifUrl:ei().url(),imageUrl:ei().url().optional(),width:ti().min(0).optional(),height:ti().min(0).optional()})}),hi({type:Ui.enum(["video"]),data:hi({videoThumb:ei().url(),videoUrl:ei().url(),width:ti().min(0).optional(),height:ti().min(0).optional()})}),hi({type:Ui.enum(["zmp","zmp_deep_link"]),data:hi({title:ei().max(100),thumbnail:ei().url(),path:ei().optional(),description:ei().max(400).default("").optional()})})])];function ka(e){return Ca.apply(this,arguments)}function Ca(){return Ca=Ee((function(e){return Oe(this,(function(t){return[2,An("openShareSheet",Oa,[e],function(){var e=Ee((function(e){var t,n;return Oe(this,(function(r){switch(r.label){case 0:return De.isMp?(t=e.type,n=e.data,[4,Aa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Le("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ca.apply(this,arguments)}var Na=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=xe())||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=xe())||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 Ma(e){return Ra.apply(this,arguments)}function Ra(){return(Ra=Ee((function(e){return Oe(this,(function(t){return[2,An("requestCameraPermission",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return[4,Na()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var xa=function(){var e=Ee((function(e,t,n){return Oe(this,(function(r){return[2,new Promise((function(r,i){ln("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)}}(),Da=Ee((function(){var e,t,n,r=arguments;return Oe(this,(function(o){switch(o.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:i,t=r.length>1&&void 0!==r[1]?r[1]:0,n=Dn(),[4,Jt(e,t,n.version)];case 1:return[2,o.sent()]}}))})),Ua=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),La=[hi({params:Ui.record(ei(),ei()).optional()}).optional()];function ja(e){return Ba.apply(this,arguments)}function Ba(){return Ba=Ee((function(e){return Oe(this,(function(t){return[2,An("createShortcut",La,[e],function(){var e=Ee((function(e){var t,n,r,a,s,u,c,l;return Oe(this,(function(d){switch(d.label){case 0:return De.isMp?[4,Da(i,0)]:[3,6];case 1:return r=d.sent(),a=null===(t=xe())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||_n("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"),a?(c.append("appId",i),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,Ua(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,xa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,un.success()];case 6:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ba.apply(this,arguments)}var Za=function(){var e=Ee((function(e,t,n){return Oe(this,(function(i){return[2,new Promise((function(i,o){ln("PROMPT_AUTHENTICATION",{secret_data:e,app_id:r,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,r,o;i({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===(r=e.data)||void 0===r?void 0:r.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)}}(),za=[hi({secretData:ei(),ui:hi({title:ei().default("Xác thực").optional(),subTitle:ei().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:ei().default("Đóng").optional()}).optional(),requireFingerprint:ii().default(!0).optional()}).optional()];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=Ee((function(e){return Oe(this,(function(t){return[2,An("openBioAuthentication",za,[e],function(){var e=Ee((function(e){var t,n,r;return Oe(this,(function(i){switch(i.label){case 0:return De.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Za(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Le("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fa.apply(this,arguments)}var Va=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("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 Ga(e){return Ha.apply(this,arguments)}function Ha(){return(Ha=Ee((function(e){return Oe(this,(function(t){return[2,An("checkStateBioAuthentication",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Va()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return De.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Le("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ka=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ja=[hi({message:ei()}).optional()];function qa(e){return Qa.apply(this,arguments)}function Qa(){return Qa=Ee((function(e){return Oe(this,(function(t){return[2,An("showToast",Ja,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Ka(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qa.apply(this,arguments)}var $a=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ya(e){return Xa.apply(this,arguments)}function Xa(){return(Xa=Ee((function(e){return Oe(this,(function(t){return[2,An("hideKeyboard",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,$a()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var es=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ts=[hi({phoneNumber:ei()})];function ns(e){return rs.apply(this,arguments)}function rs(){return rs=Ee((function(e){return Oe(this,(function(t){return[2,An("openPhone",ts,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,es(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rs.apply(this,arguments)}var is=function(){var e=Ee((function(e,t){return Oe(this,(function(n){return[2,new Promise((function(n,r){ln("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),os=[hi({content:ei(),phoneNumber:ei()})];function as(e){return ss.apply(this,arguments)}function ss(){return ss=Ee((function(e){return Oe(this,(function(t){return[2,An("openSMS",os,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,is(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ss.apply(this,arguments)}var us=function(){var e=Ee((function(e){var t,n=arguments;return Oe(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){ln("VIEW_MYQR",{dpn:t,uid:e,zapp:r},{success:function(){n()},fail:function(e){i(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),cs=[hi({id:ei(),displayName:ei().default("").optional()})];function ls(e){return ds.apply(this,arguments)}function ds(){return ds=Ee((function(e){return Oe(this,(function(t){return[2,An("viewOAQr",cs,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,us(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ds.apply(this,arguments)}var ps=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("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)}}(),fs=[hi({keepScreenOn:ii()})];function hs(e){return ms.apply(this,arguments)}function ms(){return ms=Ee((function(e){return Oe(this,(function(t){return[2,An("keepScreen",fs,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ps(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ms.apply(this,arguments)}function vs(e){return ys.apply(this,arguments)}function ys(){return(ys=Ee((function(e){return Oe(this,(function(t){return[2,An("onKeepScreen",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,ps(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function gs(e){return _s.apply(this,arguments)}function _s(){return(_s=Ee((function(e){return Oe(this,(function(t){return[2,An("offKeepScreen",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,ps(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var ws=function(){var e=Ee((function(e,t,n){var r;return Oe(this,(function(i){return r={},e?r={imageBase64Data:e}:t&&(r={imageUrl:t}),[2,new Promise((function(e,t){ln("SAVE_IMAGE_GALLERY",fa(Be({},r),{onProgress:n}),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),bs=[hi({imageBase64Data:ei().optional(),imageUrl:ei().url().optional()}).optional()];function Ts(e){return Es.apply(this,arguments)}function Es(){return Es=Ee((function(e){return Oe(this,(function(t){return[2,An("saveImageToGallery",bs,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ws(e.imageBase64Data,e.imageUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Es.apply(this,arguments)}var Ss=function(){var e=Ee((function(e,t){var n;return Oe(this,(function(r){return{},n={videoUrl:e,onProgress:t},[2,new Promise((function(e,t){ln("SAVE_VIDEO_GALLERY",Be({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ps=[hi({videoUrl:ei().url()}).optional()];function Is(e){return As.apply(this,arguments)}function As(){return As=Ee((function(e){return Oe(this,(function(t){return[2,An("saveVideoToGallery",Ps,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Ss(e.videoUrl,e.onProgress)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("saveVideoToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),As.apply(this,arguments)}var Os=function(){var e=Ee((function(e){var t,n,r,i,o,s,u=arguments;return Oe(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,Da(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(a,"/").concat(e).concat(t);try{s=new URL(o),Object.entries(n).forEach((function(e){var t=Ze(e,2),n=t[0],r=t[1];s.searchParams.append(n,String(r))})),o=s.href}catch(e){}return[2,new Promise((function(e,t){ln("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ks=[hi({appId:ei(),path:ei().optional(),params:Ui.record(ei(),ei()).optional()})];function Cs(e){return Ns.apply(this,arguments)}function Ns(){return Ns=Ee((function(e){return Oe(this,(function(t){return[2,An("openMiniApp",ks,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Os(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ns.apply(this,arguments)}var Ms=Ee((function(){var e,t,n=arguments;return Oe(this,(function(r){return e=n.length>0&&void 0!==n[0]?n[0]:"oneShot",t=n.length>1?n[1]:void 0,[2,new Promise((function(n,r){ln("INTERACTIVE_VIBRATION",{type:b[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),Rs=[hi({type:Ui.enum(["oneShot"]).default("oneShot"),milliseconds:ti().optional()})];function xs(e){return Ds.apply(this,arguments)}function Ds(){return Ds=Ee((function(e){return Oe(this,(function(t){return[2,An("vibrate",Rs,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Ms(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ds.apply(this,arguments)}var Us=function(){var e=Ee((function(e,t){var n,r,i,o;return Oe(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=Tt.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Qt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Qt(null==t?void 0:t.leftButton):"back"},!r&&Tt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){ln("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ls=[hi({url:ei(),config:hi({style:Ui.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ui.enum(["back","none"]).default("back").optional()}).optional()})];function js(e){return Bs.apply(this,arguments)}function Bs(){return Bs=Ee((function(e){return Oe(this,(function(t){return[2,An("openWebview",Ls,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Us(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bs.apply(this,arguments)}function Zs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Zt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function zs(){return An("getRouteParams",[],[],(function(){return Zs()}))}function Ws(e){return Fs.apply(this,arguments)}function Fs(){return(Fs=Ee((function(e){return Oe(this,(function(t){return[2,An("getAppInfo",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Da()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Le("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Vs=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("WEBVIEW_SET_RESULT",{result:wn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Gs=[hi({data:Ui.any()})];function Hs(e){return Ks.apply(this,arguments)}function Ks(){return Ks=Ee((function(e){return Oe(this,(function(t){return[2,An("sendDataToPreviousMiniApp",Gs,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Vs(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ks.apply(this,arguments)}var Js=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){var n,r;ln("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(un.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=xe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function qs(e){return Qs.apply(this,arguments)}function Qs(){return(Qs=Ee((function(e){return Oe(this,(function(t){return[2,An("getPhoneNumber",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Js()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Le("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var $s=Ee((function(){var e,t=arguments;return Oe(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){ln("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})}))]}))})),Ys=[hi({maxProfile:ti().min(1).max(10).optional().default(1)})];function Xs(e){return eu.apply(this,arguments)}function eu(){return eu=Ee((function(e){return Oe(this,(function(t){return[2,An("openProfilePicker",Ys,[e],function(){var e=Ee((function(e){var t,n,r,i,o;return Oe(this,(function(a){switch(a.label){case 0:return De.isMp?[4,$s(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,fn.getAccessToken()];case 3:return r=a.sent(),[4,fetch(l.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(Tt.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 De.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Le("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),eu.apply(this,arguments)}var tu=function(){var e=Ee((function(e,t,n){var r;return Oe(this,(function(i){return r=t&&Tt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){ln("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)}}(),nu=[hi({SSID:ei(),password:ei().optional(),hiddenSSID:ii().optional()})];function ru(e){return iu.apply(this,arguments)}function iu(){return iu=Ee((function(e){return Oe(this,(function(t){return[2,An("connectWifi",nu,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,tu(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),iu.apply(this,arguments)}var ou=function(){var e=Ee((function(e,t,n,r,i,o){var a,s;return Oe(this,(function(u){return a={type:0,url:t,max_size:n||1048576},s={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(t,n){ln("PICK_MEDIA",{media_type:T[e],edit_view:Be({},s,r),silent_request:i,upload:a,max_select_items:o},{success:function(e){t(null==e?void 0:e.result_content)},fail:function(e){n(e)}},{isMultiCallback:!0})}))]}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),au=[hi({type:Ui.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:ei().url(),maxItemSize:ti().min(0).optional(),editView:hi({enable:ii().optional(),aspectRatio:ei().regex(/^d+:d+$/).optional()}).optional(),silentRequest:ii().optional(),maxSelectItem:ti().min(1).optional()})];function su(e){return uu.apply(this,arguments)}function uu(){return uu=Ee((function(e){return Oe(this,(function(t){return[2,An("openMediaPicker",au,[e],function(){var e=Ee((function(e){var t,n,r,i,o,a;return Oe(this,(function(s){switch(s.label){case 0:return De.isMp?(i={},Tt.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,ou(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return De.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Le("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uu.apply(this,arguments)}var cu=[hi({title:ei().max(100),description:ei().max(400).default(""),thumbnail:ei().url().optional(),path:ei().optional()})];function lu(e){return du.apply(this,arguments)}function du(){return du=Ee((function(e){return Oe(this,(function(t){return[2,An("getShareableLink",cu,[e],function(){var e=Ee((function(e){var t;return Oe(this,(function(n){switch(n.label){case 0:return[4,fn.getAccessToken()];case 1:return t=n.sent(),[4,Ia(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)}}())]}))})),du.apply(this,arguments)}var pu=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("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 fu(e){return hu.apply(this,arguments)}function hu(){return(hu=Ee((function(e){return Oe(this,(function(t){return[2,An("closeLoading",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,pu("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function mu(e){return vu.apply(this,arguments)}function vu(){return vu=Ee((function(e){return Oe(this,(function(t){return[2,An("requestUpdateZalo",[],[e],Ee((function(){var e,t,n;return Oe(this,(function(r){switch(r.label){case 0:return De.isMp?(n=(null===(e=xe())||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,Ua(n)]):[3,2];case 1:return[2,r.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("requestUpdateZalo",{}))]}}))})))]}))})),vu.apply(this,arguments)}var yu=Lt.getInstance();yu.addListener=function(e,t,n){var r=e;return yu.addListener(f[r],t,n)};var gu=[Ui.function()];function _u(e){return An("onConfirmToExit",gu,[e],(function(e){var t=e;De.isMp&&(yu.on(f.AppClose,t,'{"handle_h5": 1}'),ji.setNavigationBarLeftButton(void 0,2))}))}function wu(){return An("offConfirmToExit",[],[],(function(){De.isMp&&(yu.off(f.AppClose),ji.setNavigationBarLeftButton(void 0,0))}))}function bu(){return An("getDeviceId",[],[],(function(){return De.isMp&&fn.getSync(c.DEVICE_ID)||""}))}function Tu(e){return Eu.apply(this,arguments)}function Eu(){return(Eu=Ee((function(e){return Oe(this,(function(t){return[2,An("getDeviceIdAsync",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,fn.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function Su(){return An("getContext",[],[],(function(){if(De.isMp){var e=fn.getSync(c.CONTEXT_ID)||"";return{type:fn.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function Pu(e){return Iu.apply(this,arguments)}function Iu(){return(Iu=Ee((function(e){return Oe(this,(function(t){return[2,An("getContextAsync",[],[e],Ee((function(){var e;return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,fn.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,fn.jumpAndGetToken(c.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function Au(e){return Ou.apply(this,arguments)}function Ou(){return(Ou=Ee((function(e){return Oe(this,(function(t){return[2,An("getAuthCode",[],[e],Ee((function(){var e,t;return Oe(this,(function(n){switch(n.label){case 0:return De.isMp?[4,fn.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,fn.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,fn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw qt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),un.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function ku(e){return Cu.apply(this,arguments)}function Cu(){return(Cu=Ee((function(e){return Oe(this,(function(t){return[2,An("getZPIToken",[],[e],Ee((function(){var e,t,n,r;return Oe(this,(function(i){switch(i.label){case 0:return De.isMp?[4,fn.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,fn.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,fn.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,fn.jumpAndGetToken(c.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 Nu=[ei()];function Mu(e){return An("setAccessToken",Nu,[e],(function(e){var t=e;fn.setAccessToken(t)}))}var Ru=[hi({url:ei().url()})];function xu(e){return Du.apply(this,arguments)}function Du(){return Du=Ee((function(e){return Oe(this,(function(t){return[2,An("openOutApp",Ru,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Ua(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var Uu=[hi({count:ti().min(1).optional().default(1),sourceType:Ui.array(Ui.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ui.enum(["back","front"]).default("front").optional()})];function Lu(e){return ju.apply(this,arguments)}function ju(){return ju=Ee((function(e){return Oe(this,(function(t){return[2,An("chooseImage",Uu,[e],function(){var e=Ee((function(e){var t,n,r,i;return Oe(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)}}())]}))})),ju.apply(this,arguments)}var Bu=Ee((function(){var e,t,n=arguments;return Oe(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){ln("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(un.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function Zu(e){return zu.apply(this,arguments)}function zu(){return(zu=Ee((function(e){return Oe(this,(function(t){return[2,An("getLocation",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Bu()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Le("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Wu=[Ui.function().args(hi({data:Ui.any()})).returns(Ui.void())];function Fu(e){return An("onCallbackData",Wu,[e],(function(){!function(e){Lt.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Vu=function(){var e=Ee((function(e){var t,n,r,o,a,s,u,c,l,d,p;return Oe(this,(function(f){switch(f.label){case 0:return n="",e||(e=Zs()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Zt.getParameterByName("orderId",e),o=Zt.getParameterByName("appTransID",e)||Zt.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,fn.getAccessToken().catch((function(){throw un.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(pe),c={orderId:n,transId:t||"",appId:i},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 un.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Be({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Gu=function(){var e=Ee((function(e,t,n,r,o,a,s){var u,c,l,d,p,h,m,v,y,g,_,w,b,T,E,S,P,I,A,O;return Oe(this,(function(k){switch(k.label){case 0:u=i,(c=new URLSearchParams).append("amount",e.toString()),c.append("item",encodeURIComponent(JSON.stringify(t))),c.append("appId",u),n&&c.append("desc",encodeURIComponent(n)),r&&(l=r,"object"==typeof r&&(l=JSON.stringify(r)),c.append("extradata",encodeURIComponent(l))),o&&(d=o,"object"==typeof o&&(d=JSON.stringify(o)),c.append("payload",encodeURIComponent(d))),a&&("string"==typeof a?(c.append("method",a),c.append("isCustom","false")):"object"==typeof a&&(c.append("method",a.id),c.append("isCustom",JSON.stringify(a.isCustom)))),s&&c.append("mac",s),p={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},k.label=1;case 1:return k.trys.push([1,6,,7]),[4,fn.getAccessToken().catch((function(){throw un.error.loginRequired}))];case 2:return h=k.sent(),p.headers.authorization="Bearer ".concat(h),[4,fetch(le,fa(Be({method:"POST"},p),{body:c}))];case 3:return[4,k.sent().json()];case 4:if(!(m=k.sent()).data||0!==m.err)throw un.error.badRequest(m.msg);return v=m.data.id,y=m.data.jwt,g=m.data.messageToken||"",_=window.APP_VERSION,w=window.APP_ENV,b={miniAppId:u,orderId:v},T=m.data.method,E=m.data.isCustom,y&&(b.token=y),_&&(b.version=_),w&&(b.env=w),T&&(b.method=T),E&&(b.isCustom=E),S=Zt.encode(b),P=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),I=Yt(),A=$t()&&I<742?"normal":"bottomSheet",[4,Us(P,{style:A}).then((function(){var e=!1;Lt.getInstance().once(f.WebviewClosed,(function(){setTimeout(Ee((function(){var t;return Oe(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Vu({zmpOrderId:v})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&Lt.getInstance().emit(f.PaymentClose,t.err,fa(Be({},t),{zmpOrderId:v})),n.label=2;case 2:return[2]}}))})),500)})),Lt.getInstance().once(f.OpenApp,(function(){e=!0}))}))];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(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Hu=[hi({amount:Ui.union([ei(),ti()]),item:Ui.array(Ui.record(ei(),Ui.any())),desc:ei(),extradata:Ui.any().optional(),payload:Ui.any().optional(),method:Ui.union([Ui.string(),Ui.object({id:Ui.string(),isCustom:Ui.boolean()})]).optional(),mac:Ui.string().optional()})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=Ee((function(e){return Oe(this,(function(t){return[2,An("createOrder",Hu,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Gu(e.amount,e.item,e.desc,e.extradata,e.payload,e.method,e.mac)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Le("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Qu=function(){var e=Ee((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,y;return Oe(this,(function(g){switch(g.label){case 0:a=i,(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),o&&s.append("mac",o),u={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},g.label=1;case 1:return g.trys.push([1,10,,11]),[4,fn.getAccessToken().catch((function(){throw un.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,fn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=fn.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,qu()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(fe,fa(Be({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw un.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)}}(),$u=[hi({amount:Ui.union([Ui.string(),Ui.number()]),desc:Ui.string(),method:Ui.string(),transId:Ui.string().optional(),mac:Ui.string().optional()})];function Yu(e){return Xu.apply(this,arguments)}function Xu(){return Xu=Ee((function(e){return Oe(this,(function(t){return[2,An("purchase",$u,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Qu(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 De.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:"",transId:""})]:[2,Promise.reject(Le("purchase",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xu.apply(this,arguments)}var ec=function(){var e=Ee((function(e,t){return Oe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;ln("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)}}(),tc=[hi({channels:fi(hi({method:ei(),subMethod:ei().optional(),subInfo:ei().optional()})).optional(),selectedMethod:hi({method:ei(),subMethod:ei().optional()}).optional()}).optional()];function nc(e){return rc.apply(this,arguments)}function rc(){return rc=Ee((function(e){return Oe(this,(function(t){return[2,An("selectPaymentMethod",tc,[e],function(){var e=Ee((function(e){var t,n;return Oe(this,(function(r){switch(r.label){case 0:return De.isMp?(t=e.channels,n=e.selectedMethod,[4,ec(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Le("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rc.apply(this,arguments)}var ic=[hi({data:Ui.union([ei(),Ui.record(ei(),ei())])})];function oc(e){return ac.apply(this,arguments)}function ac(){return ac=Ee((function(e){return Oe(this,(function(t){return[2,An("checkTransaction",ic,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,Vu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Le("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ac.apply(this,arguments)}var sc=function(){var e=Ee((function(e,t,n,r,o,a){var s,u,c,l,d,p,f,h,m,v,y,g,_,w;return Oe(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||E.SUBSCRIPTION),f=S.UNKNOW,n===me&&(f=S.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===he&&(f=S.DEFERRED),p.append("utm",o||"default"),p.append("merchantTransId",a||""),p.append("prorationMode",f.toString()),p.append("appId",d),r&&p.append("method",r),h="",(null===(s=xe())||void 0===s||null===(u=s.platform)||void 0===u?void 0:u.isIOS)?h="ios":(null===(c=xe())||void 0===c||null===(l=c.platform)||void 0===l?void 0:l.isAndroid)&&(h="android"),p.append("os",h),p.append("productId",e),m={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},b.label=1;case 1:return b.trys.push([1,5,,6]),[4,fn.getAccessToken().catch((function(){throw un.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(de,fa(Be({method:"POST"},m),{body:p}))];case 3:return[4,b.sent().json()];case 4:if(!(y=b.sent()).data||!y.data.store||0!==y.err)throw un.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){ln("IAP_REQUESTPAYMENT",Be({},g),{success:function(){e({orderId:_})},fail:function(e){t(e)}})}))];case 5:throw w=b.sent(),console.log("Internal error"),w;case 6:return[2]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),uc=[hi({productId:ei(),payType:Ui.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ui.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:ei().optional(),method:Ui.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:ei().optional()})];function cc(e){return lc.apply(this,arguments)}function lc(){return lc=Ee((function(e){return Oe(this,(function(t){return[2,An("createOrderIAP",uc,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,sc(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Le("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),lc.apply(this,arguments)}var dc=[hi({hide:ii().default(!1).optional()}).optional()];function pc(e){return fc.apply(this,arguments)}function fc(){return fc=Ee((function(e){return Oe(this,(function(t){return[2,An("setAndroidBottomNavigationBar",dc,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ji.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fc.apply(this,arguments)}var hc=[hi({hide:ii().default(!1).optional()}).optional()];function mc(e){return vc.apply(this,arguments)}function vc(){return vc=Ee((function(e){return Oe(this,(function(t){return[2,An("setIOSBottomSafeArea",hc,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ji.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vc.apply(this,arguments)}var yc=[hi({type:Ui.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ui.string().optional()}).optional()];function gc(e){return _c.apply(this,arguments)}function _c(){return _c=Ee((function(e){return Oe(this,(function(t){return[2,An("setStatusBar",yc,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){switch(t.label){case 0:return De.isMp?[4,ji.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_c.apply(this,arguments)}var wc=[hi({headerTextColor:Ui.enum(["black","white"]).optional(),headerColor:Ui.string().optional(),actionBar:hi({hide:Ui.boolean().optional(),title:Ui.string().optional(),leftButton:Ui.enum(["back","none"]).optional(),textAlign:Ui.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ui.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ui.boolean().optional(),hideIOSSafeAreaBottom:Ui.boolean().optional()})];function bc(e){return Tc.apply(this,arguments)}function Tc(){return Tc=Ee((function(e){return Oe(this,(function(t){return[2,An("configAppView",wc,[e],function(){var e=Ee((function(e){var t,n,r,i,o,a,s;return Oe(this,(function(u){switch(u.label){case 0:return De.isMp?Tt.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,ji.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return Tt.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,ji.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,ji.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,ji.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,ji.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 De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tc.apply(this,arguments)}var Ec=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Sc(e){return Pc.apply(this,arguments)}function Pc(){return(Pc=Ee((function(e){return Oe(this,(function(t){return[2,An("minimizeApp",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Ec()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Ic=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function Ac(e){return Oc.apply(this,arguments)}function Oc(){return(Oc=Ee((function(e){return Oe(this,(function(t){return[2,An("openPermissionSetting",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Ic()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var kc=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Cc(e){return Nc.apply(this,arguments)}function Nc(){return(Nc=Ee((function(e){return Oe(this,(function(t){return[2,An("favoriteApp",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,kc()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Mc=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Rc(e){return xc.apply(this,arguments)}function xc(){return(xc=Ee((function(e){return Oe(this,(function(t){return[2,An("openGroupList",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Mc()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Dc=Ee((function(){var e;return Oe(this,(function(t){switch(t.label){case 0:return[4,fn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){ln("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Uc(e){return Lc.apply(this,arguments)}function Lc(){return(Lc=Ee((function(e){return Oe(this,(function(t){return[2,An("requestSendNotification",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,Dc()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var jc=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=Ee((function(e){return Oe(this,(function(t){return[2,An("addRating",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,jc()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Le("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var zc,Wc=(zc=Ee((function(e,t,n){var r,i;return Oe(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(l.CHECK_INTERACT_OA,Be({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return zc.apply(this,arguments)}),Fc=function(){var e=Ee((function(e){return Oe(this,(function(t){return[2,new Promise((function(t,n){ln("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)}}(),Vc=[hi({oaId:ei()})];function Gc(e){return Hc.apply(this,arguments)}function Hc(){return Hc=Ee((function(e){return Oe(this,(function(t){return[2,An("interactOA",Vc,[e],function(){var e=Ee((function(e){var t,n,r;return Oe(this,(function(o){switch(o.label){case 0:return De.isMp?(t=e.oaId,[4,fn.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||Tt.isEmpty(n)?[3,3]:[4,Wc(t,i,n)];case 2:if(0===(null==(r=o.sent())?void 0:r.err))return[2,Promise.resolve({})];o.label=3;case 3:return[4,Fc(t)];case 4:return[2,o.sent()];case 5:return De.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Le("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hc.apply(this,arguments)}var Kc=[hi({oaId:ei()})];function Jc(e){return qc.apply(this,arguments)}function qc(){return qc=Ee((function(e){return Oe(this,(function(t){return[2,An("isAllowedInteractWithOA",Kc,[e],function(){var e=Ee((function(e){var t,n,r;return Oe(this,(function(o){switch(o.label){case 0:return De.isMp?(t=e.oaId,[4,fn.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||Tt.isEmpty(n)?[3,3]:[4,Wc(t,i,n)];case 2:return r=o.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return De.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Le("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qc.apply(this,arguments)}function Qc(e){return $c.apply(this,arguments)}function $c(){return($c=Ee((function(e){return Oe(this,(function(t){return[2,An("getSetting",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,an()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Le("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Yc=Ui.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Xc=[hi({scopes:Ui.array(Yc).max(2).optional()}).optional()];function el(e){return tl.apply(this,arguments)}function tl(){return tl=Ee((function(e){return Oe(this,(function(t){return[2,An("authorize",Xc,[e],function(){var e=Ee((function(e){var t;return Oe(this,(function(n){switch(n.label){case 0:return De.isMp?(t=null==e?void 0:e.scopes,Xt(724,573)?[2,Promise.reject(un.error.clientNotSupport())]:[4,dn(null!=t?t:void 0)]):[3,2];case 1:return[2,n.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Le("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),tl.apply(this,arguments)}var nl=Ee((function(){return Oe(this,(function(e){return[2,new Promise(function(){var e=Ee((function(e,t){var n;return Oe(this,(function(r){switch(r.label){case 0:return Tt.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(un.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function rl(e){return An("checkZaloCameraPermission",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return[4,nl()];case 1:return[2,e.sent()]}}))})))}var il=Ee((function(){return Oe(this,(function(e){return[2,new Promise(function(){var e=Ee((function(e,t){var n,r,i;return Oe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,fn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=fn.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 ol(e){return al.apply(this,arguments)}function al(){return(al=Ee((function(e){return Oe(this,(function(t){return[2,An("getUserID",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,il()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Le("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var sl=Ee((function(){return Oe(this,(function(e){return[2,new Promise(function(){var e=Ee((function(e,t){var n,r,i;return Oe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,fn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=fn.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 ul(e){return cl.apply(this,arguments)}function cl(){return(cl=Ee((function(e){return Oe(this,(function(t){return[2,An("getIDToken",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,sl()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Le("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var ll={format:N.JPEG,quality:M.NORMAL,mirrored:!1,useVideoSourceSize:!1},dl={width:1024,height:768,facingMode:C.FRONT,mirrored:!1,audio:!1,video:!0},pl=function(){function e(t){var n,r,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,u=this;Et(this,e),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(u.haveVideoStream()&&u._userRequestFrameCallback){var e=u.getCanvas();if(u.drawFrame(),e){var t={data:e.toDataURL(N.PNG),width:e.width,height:e.height};Lt.getInstance().emit(k.OnFrameCallback,0,t),requestAnimationFrame(u.tick)}}},this._videoElement=t,this._mediaConstraints=null!=s?s:null,this._facingMode=null!==(n=null==s?void 0:s.facingMode)&&void 0!==n?n:dl.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(r=null==s?void 0:s.deviceId)&&void 0!==r?r:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(i=null==s?void 0:s.mirrored)&&void 0!==i?i:dl.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:dl.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:dl.video}var t=e.prototype;return t.on=function(e,t){Lt.getInstance().on(e,(function(e){t(e)})),e===k.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},t.off=function(e){Lt.getInstance().off(e),e===k.OnFrameCallback&&(this._userRequestFrameCallback=!1)},t.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},t.getFacingMode=function(){return this._facingMode},t.getCameraList=function(){return this._cameraList},t.getCameraCount=function(){return this._cameraList.length},t.getSelectedDeviceId=function(){return this._selectedDeviceId},t.setDeviceId=function(e){var t=this;return Ee((function(){return Oe(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]}}))}))()},t.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},t.updateMediaConstraints=function(e){var t=this;return Ee((function(){var n,r,i,o,a,s;return Oe(this,(function(u){switch(u.label){case 0:return Tt.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]}}))}))()},t.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||dl.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||dl.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}},t.selectCamera=function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._cameraList[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(this._facingMode==C.FRONT&&o.label.toLowerCase().includes("front")||this._facingMode==C.BACK&&o.label.toLowerCase().includes("back")){this._selectedDeviceId=o.deviceId;break}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}},t.flip=function(){var e=this;return Ee((function(){return Oe(this,(function(t){switch(t.label){case 0:return e._facingMode=e._facingMode==C.FRONT?C.BACK:C.FRONT,e._videoElement.style.transform="",e.selectCamera(),e._hasUserMedia?[4,e.stream()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))()},t.start=function(){var e=this;return Ee((function(){var t,n;return Oe(this,(function(r){return t=Lt.getInstance(),n=function(t){try{e._hasUserMedia&&e.stop()}catch(e){}},t.off(f.AppPaused,n),t.on(f.AppPaused,n),[2,new Promise(function(){var t=Ee((function(t,n){var r;return Oe(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.stream()];case 1:return i.sent(),Lt.getInstance().emit(k.OnStartCallback,0),t(e._selectedDeviceId),[3,3];case 2:return r=i.sent(),n(r),[3,3];case 3:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}))}))()},t.info=function(){var e=this;return Ee((function(){return Oe(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)}))}))]}))}))()},t.stream=function(){var e=this;return Ee((function(){return Oe(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=Ee((function(n){return Oe(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)}}))]}))}))()},t.handleUserMedia=function(e,t){var n=this;if(!e&&t){this._stream=t;try{this._videoElement&&(this._videoElement.srcObject=t,(this._facingMode==C.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){n._userRequestFrameCallback&&n.tick()},this._videoElement.play().then((function(){n._hasUserMedia=!0})).catch((function(e){n._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},t.updateTrackEnable=function(e,t){var n=this;return Ee((function(){return Oe(this,(function(r){switch(r.label){case 0:if(e===R.VIDEO){if(n._videoEnabled===t)return[2];n._videoEnabled=t}else{if(n._audioEnabled===t)return[2];n._audioEnabled=t}return[4,n.stream()];case 1:return r.sent(),[2]}}))}))()},t.pause=function(e){var t=this;return Ee((function(){return Oe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},t.resume=function(e){var t=this;return Ee((function(){return Oe(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},t.isUsing=function(){return this._hasUserMedia},t.stop=function(){this._stop(),Lt.getInstance().emit(k.OnStopCallback,0)},t._stop=function(){e.stopMediaStream(this._stream),this._hasUserMedia=!1},t.setFacingMode=function(e){this._facingMode=e},t.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},t.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||ll.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},t.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},t.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},t.drawFrame=function(e){var t=this._videoElement,n=e||{};if(t&&this._ctx&&this._canvasElement){var r=this._canvasElement,i=this._ctx;r.width=(null==n?void 0:n.width)||r.width,r.height=(null==n?void 0:n.height)||r.height,((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===C.FRONT)&&(i.translate(r.width,0),i.scale(-1,1)),i.drawImage(t,0,0,r.width,r.height),((null==n?void 0:n.mirrored)||this._mirror||this._facingMode===C.FRONT)&&(i.scale(-1,1),i.translate(-r.width,0))}},e.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())},e}(),fl=hi({play:Ui.function(),pause:Ui.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),hl=[hi({videoElement:fl,mediaConstraints:Ui.object({width:Ui.number().min(100).optional(),height:Ui.number().min(100).optional(),facingMode:Ui.string().optional(),audio:Ui.boolean().optional(),video:Ui.boolean().optional(),deviceId:Ui.string().optional(),mirrored:Ui.boolean().optional()}).nullish()}).optional()];function ml(e){return An("createCameraContext",hl,[e],(function(e){return new pl(e.videoElement,e.mediaConstraints)}))}var vl=function(){function e(){var t,n;Et(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=Ae(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;Tt.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?Tt.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?Tt.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 yl(e){return gl.apply(this,arguments)}function gl(){return(gl=Ee((function(e){return Oe(this,(function(t){return[2,An("setupAd",[],[e],(function(){return vl.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var _l=[hi({ids:Ui.union([Ui.string(),Ui.array(Ui.string())]),config:hi({display:Ui.boolean().optional(),onClose:Ui.function().optional()}).optional()})];function wl(e){return bl.apply(this,arguments)}function bl(){return bl=Ee((function(e){return Oe(this,(function(t){return[2,An("loadAd",_l,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){return vl.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bl.apply(this,arguments)}var Tl=[hi({id:Ui.string()})];function El(e){return Sl.apply(this,arguments)}function Sl(){return Sl=Ee((function(e){return Oe(this,(function(t){return[2,An("displayAd",Tl,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){return vl.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sl.apply(this,arguments)}var Pl=[hi({id:Ui.string().optional()}).optional()];function Il(e){return Al.apply(this,arguments)}function Al(){return Al=Ee((function(e){return Oe(this,(function(t){return[2,An("refreshAd",Pl,[e],function(){var e=Ee((function(e){return Oe(this,(function(t){return vl.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Al.apply(this,arguments)}var Ol=[hi({id:ei(),guidingText:ei().optional(),color:ei().optional(),onStatusChange:Ui.function().optional()})];function kl(e){return Cl.apply(this,arguments)}function Cl(){return Cl=Ee((function(t){return Oe(this,(function(n){return[2,An("showOAWidget",Ol,[t],function(){var t=Ee((function(t){var n,r,i,o,a,s,u,c;return Oe(this,(function(l){if(De.isMp){try{n=document.getElementById(t.id),r=t.onStatusChange,i=t.guidingText,o=t.color,a=e(t,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="iframeOAWidget_".concat(Date.now()),(c=new URL("https://h5.zalo.me/widgets/oa_widget.html")).searchParams.set("id",u),i&&c.searchParams.set("guidingText",i),o&&c.searchParams.set("color",o),Object.entries(a).forEach((function(e){var t=Ze(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=Ee((function(e){var t,n,i,o,a,s,l,d;return Oe(this,(function(p){switch(p.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(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,fn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=fn.miniProgramConfig)||void 0===a?void 0:a.jwt,null==n||null===(s=n.contentWindow)||void 0===s||s.postMessage({type:i,payload:{jwt:l}},"*"),[3,3];case 2:"oaInfo"===i?null==r||r(null===(d=t.payload)||void 0===d?void 0:d.followed):"openOA"===i?oa(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 De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Cl.apply(this,arguments)}var Nl=[hi({id:ei(),type:ei(),text:ei(),color:ei().optional(),disabled:Ui.boolean().optional(),onDataReceived:Ui.function().optional(),onError:Ui.function().optional()})];function Ml(e){return Rl.apply(this,arguments)}function Rl(){return Rl=Ee((function(t){return Oe(this,(function(n){return[2,An("showFunctionButtonWidget",Nl,[t],function(){var t=Ee((function(t){var n,r,i,o,a,s,u;return Oe(this,(function(c){if(De.isMp){try{n=document.getElementById(t.id),r=t.onDataReceived,i=t.onError,o=e(t,["onDataReceived","onError"]),n&&(a=document.createElement("iframe"),s="iframeFunctionButtonWidget".concat(Date.now()),(u=new URL("https://h5.zalo.me/widgets/function_button_widget.html")).searchParams.set("id",s),Object.entries(o).forEach((function(e){var t=Ze(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=Ze(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=Ee((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return Oe(this,(function(g){switch(g.label){case 0:return t=e.data,e.origin.startsWith("https://h5.zalo.me")?(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,fn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=fn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=fn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Cn()];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}},"*"),[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 De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("openMiniApp",{}))]}))}));return function(e){return t.apply(this,arguments)}}())]}))})),Rl.apply(this,arguments)}var xl=function(){var e=Ee((function(e,t){var n;return Oe(this,(function(r){return n={},"cccd"===e&&(n={mrz:null==t?void 0:t.mrz}),[2,new Promise((function(t,r){ln("SCAN_NFC",{type:g[e],data:n},{success:function(n){if("cccd"===e){var r,i,o,a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E={dg1:null!==(r=n.dg1)&&void 0!==r?r:"",dg2:null!==(i=n.dg2)&&void 0!==i?i:"",dg3:null!==(o=n.dg3)&&void 0!==o?o:"",dg4:null!==(a=n.dg4)&&void 0!==a?a:"",dg5:null!==(s=n.dg5)&&void 0!==s?s:"",dg6:null!==(u=n.dg6)&&void 0!==u?u:"",dg7:null!==(c=n.dg7)&&void 0!==c?c:"",dg8:null!==(l=n.dg8)&&void 0!==l?l:"",dg9:null!==(d=n.dg9)&&void 0!==d?d:"",dg10:null!==(p=n.dg10)&&void 0!==p?p:"",dg11:null!==(f=n.dg11)&&void 0!==f?f:"",dg12:null!==(h=n.dg12)&&void 0!==h?h:"",dg13:null!==(m=n.dg13)&&void 0!==m?m:"",dg14:null!==(v=n.dg14)&&void 0!==v?v:"",dg15:null!==(y=n.dg15)&&void 0!==y?y:"",dg16:null!==(g=n.dg16)&&void 0!==g?g:"",sod:null!==(_=n.sod)&&void 0!==_?_:"",challenge:null!==(w=n.challenge)&&void 0!==w?w:"",aAResult:null!==(b=n.aAResult)&&void 0!==b?b:"",eACCAResult:null!==(T=n.eACCAResult)&&void 0!==T?T:""};t(E)}else t({})},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Dl=[hi({type:Ui.enum(["cccd"]),data:hi({mrz:ei().max(90)})})];function Ul(e){return Ll.apply(this,arguments)}function Ll(){return Ll=Ee((function(e){return Oe(this,(function(t){return[2,An("scanNFC",Dl,[e],function(){var e=Ee((function(e){var t,n;return Oe(this,(function(r){switch(r.label){case 0:return De.isMp?Xt(754,620)?[2,Promise.reject(un.error.clientNotSupport())]:(t=e.type,n=e.data,[4,xl(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Le("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ll.apply(this,arguments)}var jl=Ee((function(){return Oe(this,(function(e){return[2,new Promise((function(e,t){ln("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function Bl(e){return Zl.apply(this,arguments)}function Zl(){return(Zl=Ee((function(e){return Oe(this,(function(t){return[2,An("checkNFC",[],[e],Ee((function(){return Oe(this,(function(e){switch(e.label){case 0:return De.isMp?[4,jl()]:[3,2];case 1:return[2,e.sent()];case 2:return De.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Le("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}var zl=[Ui.string().trim().min(1)];var Wl=[Ui.string().trim().min(1),Ui.string().trim()];var Fl=[Ui.string().trim().min(1)];var Vl={getItem:function(e){return An("getItem",zl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(De.isMp||De.isMpWeb){if(Xt(757,625))throw un.error.clientNotSupport();return go.getItem(t[0])}throw Le("getItem",{})}))},setItem:function(e,t){return An("setItem",Wl,[e,t],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(De.isMp||De.isMpWeb){if(Xt(757,625))throw un.error.clientNotSupport();return go.setItem(t[0],t[1])}throw Le("setItem",{})}))},clear:function(){return An("clear",[],[],(function(){if(De.isMp||De.isMpWeb){if(Xt(757,625))throw un.error.clientNotSupport();return go.clearStorageSync()}throw Le("clear",{})}))},removeItem:function(e){return An("removeItem",Fl,[e],(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(De.isMp||De.isMpWeb){if(Xt(757,625))throw un.error.clientNotSupport();return go.removeItem(t[0])}throw Le("removeItem",{})}))},getStorageInfo:function(){return An("getStorageInfoSync",[],[],(function(){if(De.isMp||De.isMpWeb){if(Xt(757,625))throw un.error.clientNotSupport();return go.getStorageInfoSync()}throw Le("getStorageInfoSync",{})}))}},Gl={createOrder:Ku,checkTransaction:oc,createOrderIAP:cc,selectPaymentMethod:nc},Hl={purchase:Yu,selectPaymentMethod:nc},Kl=function(){var e=Ee((function(e,t){return Oe(this,(function(n){return[2,new Promise((function(n,r){ln("SAVE_FILE",{fileUrl:e,onProgress:t},{success:function(e){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Jl=[hi({url:Ui.string().url()}).optional()];function ql(e){return Ql.apply(this,arguments)}function Ql(){return Ql=Ee((function(e){return Oe(this,(function(t){return[2,An("downloadFile",Jl,[e],function(){var e=Ee((function(e){var t;return Oe(this,(function(n){switch(n.label){case 0:return De.isMp?(t=e.url,[4,Kl(t,e.onProgress)]):[3,2];case 1:return[2,n.sent()];case 2:return De.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Le("downloadFile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ql.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:xn},On();var $l=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:On,getAccessToken:Cn,getVersion:xn,getSystemInfo:Un,setNavigationBarTitle:Zi,setNavigationBarColor:Fi,setNavigationBarLeftButton:Hi,setStorage:wo,getStorage:Eo,getStorageInfo:Po,removeStorage:Oo,clearStorage:No,getUserInfo:Do,getNetworkType:Bo,onNetworkStatusChange:Wo,startBeaconDiscovery:Go,stopBeaconDiscovery:Jo,getBeacons:$o,closeApp:ea,scanQRCode:ra,openProfile:sa,openChat:da,openPostFeed:va,followOA:wa,unfollowOA:Sa,openShareSheet:ka,requestCameraPermission:Ma,createShortcut:ja,openBioAuthentication:Wa,checkStateBioAuthentication:Ga,showToast:qa,hideKeyboard:Ya,openPhone:ns,openSMS:as,viewOAQr:ls,keepScreen:hs,onKeepScreen:vs,offKeepScreen:gs,saveImageToGallery:Ts,saveVideoToGallery:Is,openMiniApp:Cs,vibrate:xs,openWebview:js,getRouteParams:zs,getAppInfo:Ws,sendDataToPreviousMiniApp:Hs,getPhoneNumber:qs,openProfilePicker:Xs,connectWifi:ru,openMediaPicker:su,getShareableLink:lu,closeLoading:fu,requestUpdateZalo:mu,onConfirmToExit:_u,offConfirmToExit:wu,getDeviceId:bu,getDeviceIdAsync:Tu,getContext:Su,getContextAsync:Pu,getAuthCode:Au,getZPIToken:ku,setAccessToken:Mu,openOutApp:xu,chooseImage:Lu,getLocation:Zu,onCallbackData:Fu,createOrder:Ku,purchase:Yu,selectPaymentMethod:nc,checkTransaction:oc,createOrderIAP:cc,events:yu,setAndroidBottomNavigationBar:pc,setIOSBottomSafeArea:mc,setStatusBar:gc,configAppView:bc,minimizeApp:Sc,openPermissionSetting:Ac,favoriteApp:Cc,openGroupList:Rc,requestSendNotification:Uc,addRating:Bc,interactOA:Gc,interactOa:Gc,isAllowedInteractWithOA:Jc,getSetting:Qc,authorize:el,checkZaloCameraPermission:rl,getUserID:ol,getIDToken:ul,createCameraContext:ml,setupAd:yl,loadAd:wl,displayAd:El,refreshAd:Il,showOAWidget:kl,showFunctionButtonWidget:Ml,scanNFC:Ul,checkNFC:Bl,nativeStorage:Vl,Payment:Gl,CheckoutSDK:Hl,downloadFile:ql,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:pl}),Yl=e($l,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]);!function(){var e,t=null===(e=xe())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,$l))}();var Xl=Object.freeze({__proto__:null,default:Yl,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:On,getAccessToken:Cn,getVersion:xn,getSystemInfo:Un,setNavigationBarTitle:Zi,setNavigationBarColor:Fi,setNavigationBarLeftButton:Hi,setStorage:wo,getStorage:Eo,getStorageInfo:Po,removeStorage:Oo,clearStorage:No,getUserInfo:Do,getNetworkType:Bo,onNetworkStatusChange:Wo,startBeaconDiscovery:Go,stopBeaconDiscovery:Jo,getBeacons:$o,closeApp:ea,scanQRCode:ra,openProfile:sa,openChat:da,openPostFeed:va,followOA:wa,unfollowOA:Sa,openShareSheet:ka,requestCameraPermission:Ma,createShortcut:ja,openBioAuthentication:Wa,checkStateBioAuthentication:Ga,showToast:qa,hideKeyboard:Ya,openPhone:ns,openSMS:as,viewOAQr:ls,keepScreen:hs,onKeepScreen:vs,offKeepScreen:gs,saveImageToGallery:Ts,saveVideoToGallery:Is,openMiniApp:Cs,vibrate:xs,openWebview:js,getRouteParams:zs,getAppInfo:Ws,sendDataToPreviousMiniApp:Hs,getPhoneNumber:qs,openProfilePicker:Xs,connectWifi:ru,openMediaPicker:su,getShareableLink:lu,closeLoading:fu,requestUpdateZalo:mu,onConfirmToExit:_u,offConfirmToExit:wu,getDeviceId:bu,getDeviceIdAsync:Tu,getContext:Su,getContextAsync:Pu,getAuthCode:Au,getZPIToken:ku,setAccessToken:Mu,openOutApp:xu,chooseImage:Lu,getLocation:Zu,onCallbackData:Fu,createOrder:Ku,purchase:Yu,selectPaymentMethod:nc,checkTransaction:oc,createOrderIAP:cc,events:yu,setAndroidBottomNavigationBar:pc,setIOSBottomSafeArea:mc,setStatusBar:gc,configAppView:bc,minimizeApp:Sc,openPermissionSetting:Ac,favoriteApp:Cc,openGroupList:Rc,requestSendNotification:Uc,addRating:Bc,interactOA:Gc,interactOa:Gc,isAllowedInteractWithOA:Jc,getSetting:Qc,authorize:el,checkZaloCameraPermission:rl,getUserID:ol,getIDToken:ul,createCameraContext:ml,setupAd:yl,loadAd:wl,displayAd:El,refreshAd:Il,showOAWidget:kl,showFunctionButtonWidget:Ml,scanNFC:Ul,checkNFC:Bl,nativeStorage:Vl,Payment:Gl,CheckoutSDK:Hl,downloadFile:ql,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:pl,get NetworkType(){return d},get PlatformType(){return p},get JumpStatus(){return h},get ProfileType(){return m},get ChatType(){return v},get PostFeedType(){return y},get ScanNFCType(){return g},get ShareSheetType(){return _},get OrientationType(){return w},get VibrateType(){return b},get MediaPickerType(){return T},get IAPPayType(){return E},get ProrationMode(){return S},get StatusBarType(){return P},get AndroidBottomNavigationBarType(){return I},get IOSSafeAreaBottomType(){return A},get TextAlignType(){return O}});window.ZaloMiniAppSDK=Xl}();
|