zmp-sdk 2.42.0-beta.1 → 2.43.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/browser.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 04-11-2024 15:31:29
2
+ * @timeBuild 20-11-2024 10:10:02
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,P,S,O,A,I,k,C,N,M,R,x=0,U=-2e3,D=-1400,j=-1500,L=-1401,B=-1404,Z=-1408,z=-1409,W=-2004,F=-2005,G="Success",H="Unknown error. Please try again later.",V="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:G},UNKNOWN_ERROR:{code:U,message:H},UNAUTHORIZED:{code:L,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."}},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}},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 Pe(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 Se(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 Oe(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")}}Se.async=function(e){return _e((function(){var t,n,r,i,o=arguments;return Pe(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.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"}(P||(P={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(S||(S={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(O||(O={})),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"}(I||(I={})),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,Ie=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=Se((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:Oe(),platform:t,platformName:Ie(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 Ue(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 De(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 je="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Le(){throw new Error("setTimeout has not been defined")}function Be(){throw new Error("clearTimeout has not been defined")}var Ze=Le,ze=Be;function We(e){if(Ze===setTimeout)return setTimeout(e,0);if((Ze===Le||!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 je.setTimeout&&(Ze=setTimeout),"function"==typeof je.clearTimeout&&(ze=clearTimeout);var Fe,Ge=[],He=!1,Ve=-1;function Ke(){He&&Fe&&(He=!1,Fe.length?Ge=Fe.concat(Ge):Ve=-1,Ge.length&&Je())}function Je(){if(!He){var e=We(Ke);He=!0;for(var t=Ge.length;t;){for(Fe=Ge,Ge=[];++Ve<t;)Fe&&Fe[Ve].run();Ve=-1,t=Ge.length}Fe=null,He=!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=je.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];Ge.push(new qe(e,t)),1!==Ge.length||He||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(U(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return P(e,t)}if(!G(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(r)&&!U(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),S(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!L(n))throw new TypeError;if(!U(r)&&!K(r))throw new TypeError;N(e,t,n,r)}return n}function v(e,t,n,r){if(!L(n))throw new TypeError;return U(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!L(t))throw new TypeError;return U(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),M(e,t)}function T(e,t){if(!L(e))throw new TypeError;return U(t)||(t=F(t)),R(e,t)}function E(e,t,n){if(!L(t))throw new TypeError;U(n)||(n=F(n));var r=O(t,n,!1);if(U(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}function P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!U(r)&&!D(r)){if(!V(r))throw new TypeError;t=r}}return t}function S(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!U(o)&&!D(o)){if(!L(o))throw new TypeError;r=o}}return r}function O(e,t,n){var r=f.get(e);if(U(r)){if(!n)return;r=new d,f.set(e,r)}var i=r.get(t);if(U(i)){if(!n)return;i=new d,r.set(t,i)}return i}function A(e,t,n){if(I(e,t,n))return!0;var r=X(t);return!D(r)&&A(e,r,n)}function I(e,t,n){var r=O(t,n,!1);return!U(r)&&z(r.has(e))}function k(e,t,n){if(I(e,t,n))return C(e,t,n);var r=X(t);return D(r)?void 0:k(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!U(r))return r.get(e)}function N(e,t,n,r){O(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=O(e,t,!1);if(U(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 U(e){return void 0===e}function D(e){return null===e}function j(e){return"symbol"==typeof e}function L(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(L(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(H(n))if(!L(i=n.call(e)))return i;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!L(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!L(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 j(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(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(!H(n))throw new TypeError;return n}}function q(e){var t=J(e,i);if(!H(t))throw new TypeError;var n=t.call(e);if(!L(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 Pt(e,t,n){return Et(e,t,n)}function St(e,t){return St=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},St(e,t)}function Ot(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&&St(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 It(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){Ot(n,e);var t=It(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 Pt(Tt(n.prototype),"on",this).call(this,e,t,r);this.debug("register ".concat(String(e),": ").concat(r));return Pt(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 Pt(Tt(n.prototype),"once",this).call(this,e,t,r);this.debug("register once ".concat(String(e),": ").concat(r));return Pt(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 Ut(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=dn(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 Dt={encode:Ut,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:Ut(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("&")}},jt={},Lt=function(e,t,n){var r=t||"default";return function(){return(r in jt?jt[r](e,n):e).apply(this,arguments)}};Lt.setWrapper=function(e){jt[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=Dt.encode(n);"post"!=t&&(e=Dt.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=Lt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Lt((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,Gt=(zt=_e((function(e,t,n){var r,i,o,a;return Pe(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},gt.isUndefined(n)||(r.currentVersion=n),i=Dt.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 Ht(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 Vt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Kt=function(){var e,t,n=Number((null===(e=Ce())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Jt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var qt,Qt,$t=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}(),Yt=function(e,t){return Jt(e,$t)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Jt(e,Error)?new $t(U,e.message,t).toJSON():gt.isEmpty(null==e?void 0:e.message)||gt.isEmpty(null==e?void 0:e.code)?new $t(U,H,t,e).toJSON():new $t(e.code,e.message,t,e.detail).toJSON()}(e,t)},Xt=(qt=_e((function(e){var t;return Pe(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,Ue({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return qt.apply(this,arguments)}),en=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,sn.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=sn.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new $t(L,J,"getSetting")),[4,Xt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new $t(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)}}())]}))})),tn=function(){var e,t,n,r=Ce(),i={},o=Rt.getInstance(),a=[],s=!1;return s||(t=function(e){var t=e.serialId,n=pn(e.result),r=vn(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=[],Ht(e)}})),e?clearInterval(e):e=setInterval((function(){if(a.length>0){var e=a;a=[],Ht(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,P,S,O,A;return Pe(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c=wn(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=yn(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,en()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return xt({serialId:u,result:{error_code:L,error_message:$,data:{isMobile:null==r||null===(g=r.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=vn(c),!(null==r||null===(a=r.platform)||void 0===a?void 0:a.isMobile)||!e||gt.isUndefined(ZaloJavaScriptInterface)||r.platform.isIOS&&!ln(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=cn(t),f?[3,4]:[4,sn.getJSAccessToken()]);case 3:return E=I.sent(),[3,5];case 4:E="",I.label=5;case 5:T=E,I.label=6;case 6:return I.trys.push([6,10,,11]),f||!h?[3,8]:[4,sn.getAccessToken()];case 7:return S=I.sent(),[3,9];case 8:S="",I.label=9;case 9:return P=S,[3,11];case 10:return O=I.sent(),xt({serialId:u,result:{error_code:null==O?void 0:O.code,error_message:null==O?void 0:O.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,P,b,A)]}}))})),function(e,t,r,i){return n.apply(this,arguments)}}(),nn={success:function(e,t){return{code:x,message:t||G,data:e||{}}},error:{failLimit:function(){return new $t(z,V)},badRequest:function(e){return new $t(D,e)},loginFailed:function(e){return new $t(L,"".concat(q,": ").concat(e))},loginRequired:function(){return new $t(L,J)},cannotGetShareInfo:function(){return new $t(j,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(ye).find((function(t){return t===e.toString()}));return new $t(e,t||H)},clientNotSupport:function(){return new $t(B,Q)}}},rn=(Qt=function(e){var t,n,r,i,o,a=null===(t=Ce())||void 0===t?void 0:t.platformName,s=_n(e.action),u=ne[s],c=(null==u?void 0:u.skipJump)||!1,l=(null==u?void 0:u.errorList)||{};if("JUMP_LOGIN"===s)return new $t(U,"Can not get auth code: ".concat(e.error_message));if(sn.jumpStatus!==h.DONE&&!c)return new $t(ee.UNAUTHORIZED.code,ee.UNAUTHORIZED.message);if("permission required!"===String(e.error_message).toLowerCase()||"no permission!"===String(e.error_message).toLowerCase())return new $t(ee.FORBIDDEN.code,ee.FORBIDDEN.message);if(a&&(null===(n=re[a])||void 0===n?void 0:n[e.error_code]))return new $t(re[a][e.error_code].code,re[a][e.error_code].message);var d=null!==(o=null==l||null===(r=l[a])||void 0===r?void 0:r[String(e.error_code)])&&void 0!==o?o:null==l||null===(i=l.all)||void 0===i?void 0:i[e.error_code];if(d){var p,f,m,v=null===(p=d.mapTo)||void 0===p?void 0:p.message;return(null==d?void 0:d.needMoreDetail)&&(v="".concat(null==d||null===(m=d.mapTo)||void 0===m?void 0:m.message,": ").concat(e.error_message)),new $t(null===(f=d.mapTo)||void 0===f?void 0:f.code,v)}return new $t(e.error_code,e.error_message)},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?Qt(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(){tn(e,n,o,Ue({},i,a))}),s)}),on=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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)}}(),an=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 Pe(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"}),tn("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)||Ht([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),n(h.DONE)},fail:function(e){Ht([{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 Pe(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 Pe(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 Pe(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,Ue({method:"POST",body:i},o)).then(function(){var e=_e((function(e){var t,n,i,o;return Pe(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 Pe(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 Pe(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--,Ht([{action:d,error:-104,message:"no user auth",data:{}}]),nn.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),Ht([{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)]:(Ht([{action:d,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(nn.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw o.getAccessTokenCount--,Ht([{action:d,error:-102,message:"no oauth",data:{}}]),nn.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 Pe(this,(function(s){switch(s.label){case 0:if(n=!0,!1!==(null===(t=e._miniProgramConfig)||void 0===t?void 0:t.userAuthorized))return[3,6];s.label=1;case 1:return s.trys.push([1,5,,6]),(r=vn("action.mp.user.authorize"))&&r.isSupported?[4,en()]:[3,4];case 2:return!1!==(null==(o=s.sent())||null===(i=o.authSetting)||void 0===i?void 0:i["scope.userInfo"])?[3,4]:[4,on()];case 3:a=s.sent(),n=(null==a?void 0:a["scope.userInfo"])||!1,s.label=4;case 4:return[3,6];case 5:return s.sent(),n=!1,[3,6];case 6: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 Pe(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 Pe(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}(),sn=an.getInstance(),un=pt("zmp:utils:common"),cn=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(cn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+cn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},ln=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},dn=function(e){try{if(e){un(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return un("formattedValue",t,JSON.parse(t),dt(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return un("parse json error:",t),e}},pn=function(e){if(gt.isObject(JSON)&&JSON.parse&&gt.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)()},fn=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""},hn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var mn=function(e){return"hidden"===e?S.hidden:"transparent"===e?S.transparent:S.normal},vn=function(e){if(void 0!==e){var t=sn.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},yn=function(e){if(void 0===e)return!1;var t=sn.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},gn=function(){var e=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Pe(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,sn.jumpAndGetToken()];case 1:return t.sent(),n=sn.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)}}(),_n=function(e){return e.replace("action.","").replace(/\./g,"_").toUpperCase()},wn=function(e){return"action.".concat(e.replace(/\_/g,".").toLowerCase())};function bn(e,t,n,r){var i,o;!function(e,t){if(te[e]){var n=sn.getRetryLimit(e);n.lastCall&&(new Date).getTime()-n.lastCall>1e3&&sn.resetRetryLimit(e);var r=n.limit||3;if(n.retry&&n.retry>=r)throw Yt(nn.error.failLimit(),e);sn.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=nn.error.badRequest(s);throw c.detail=a,Yt(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)&&gt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Yt(t,e);if(!gt.isNull(s)&&gt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!gt.isNull(s)&&gt.isFunction(s))return s(t);throw Yt(t,e)}}function Tn(e){return En.apply(this,arguments)}function En(){return(En=_e((function(e){return Pe(this,(function(t){return[2,bn("login",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,sn.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 Pn(e){return Sn.apply(this,arguments)}function Sn(){return(Sn=_e((function(e){return Pe(this,(function(t){return[2,bn("getAccessToken",[],[e],_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,gn()]:[3,3];case 1:return e=!t.sent(),[4,sn.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,An="2.42.0-beta.1";function In(){return bn("getVersion",[],[],(function(){return An}))}function kn(){var e,t;return{version:fn("version-id")||"",apiVersion:An,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 Cn(){return bn("getSystemInfo",[],[],(function(){return kn()}))}!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 Nn=On.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Mn=e=>{switch(typeof e){case"undefined":return Nn.undefined;case"string":return Nn.string;case"number":return isNaN(e)?Nn.nan:Nn.number;case"boolean":return Nn.boolean;case"function":return Nn.function;case"bigint":return Nn.bigint;case"symbol":return Nn.symbol;case"object":return Array.isArray(e)?Nn.array:null===e?Nn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Nn.promise:"undefined"!=typeof Map&&e instanceof Map?Nn.map:"undefined"!=typeof Set&&e instanceof Set?Nn.set:"undefined"!=typeof Date&&e instanceof Date?Nn.date:Nn.object;default:return Nn.unknown}},Rn=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 xn 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()}}xn.create=e=>new xn(e);const Un=(e,t)=>{let n;switch(e.code){case Rn.invalid_type:n=e.received===Nn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Rn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,On.jsonStringifyReplacer)}`;break;case Rn.unrecognized_keys:n=`Unrecognized key(s) in object: ${On.joinValues(e.keys,", ")}`;break;case Rn.invalid_union:n="Invalid input";break;case Rn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${On.joinValues(e.options)}`;break;case Rn.invalid_enum_value:n=`Invalid enum value. Expected ${On.joinValues(e.options)}, received '${e.received}'`;break;case Rn.invalid_arguments:n="Invalid function arguments";break;case Rn.invalid_return_type:n="Invalid function return type";break;case Rn.invalid_date:n="Invalid date";break;case Rn.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 Rn.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 Rn.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 Rn.custom:n="Invalid input";break;case Rn.invalid_intersection_types:n="Intersection results could not be merged";break;case Rn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Rn.not_finite:n="Number must be finite";break;default:n=t.defaultError,On.assertNever(e)}return{message:n}};let Dn=Un;function jn(){return Dn}const Ln=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 Bn(e,t){const n=Ln({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,jn(),Un].filter((e=>!!e))});e.common.issues.push(n)}class Zn{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 zn;"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 Zn.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 zn;if("aborted"===i.status)return zn;"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 zn=Object.freeze({status:"aborted"}),Wn=e=>({status:"dirty",value:e}),Fn=e=>({status:"valid",value:e}),Gn=e=>"aborted"===e.status,Hn=e=>"dirty"===e.status,Vn=e=>"valid"===e.status,Kn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Jn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Jn||(Jn={}));class qn{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 Qn=(e,t)=>{if(Vn(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 xn(e.common.issues)}};function $n(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 Yn{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 Mn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Mn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zn,ctx:{common:e.parent.common,data:e.data,parsedType:Mn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Kn(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:Mn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Qn(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:Mn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Kn(r)?r:Promise.resolve(r));return Qn(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:Rn.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 Dr({schema:this,typeName:Kr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return jr.create(this,this._def)}nullable(){return Lr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vr.create(this,this._def)}promise(){return Ur.create(this,this._def)}or(e){return wr.create([this,e],this._def)}and(e){return Pr.create(this,e,this._def)}transform(e){return new Dr({...$n(this._def),schema:this,typeName:Kr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Br({...$n(this._def),innerType:this,defaultValue:t,typeName:Kr.ZodDefault})}brand(){return new Fr({typeName:Kr.ZodBranded,type:this,...$n(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Zr({...$n(this._def),innerType:this,catchValue:t,typeName:Kr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Gr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Xn=/^c[^\s-]{8,}$/i,er=/^[a-z][a-z0-9]*$/,tr=/^([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,nr=/^(([^<>()[\]\\.,;:\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 rr extends Yn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Rn.invalid_string,...Jn.errToObj(n)}),this.nonempty=e=>this.min(1,Jn.errToObj(e)),this.trim=()=>new rr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Nn.string){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.string,received:t.parsedType}),zn}const t=new Zn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Bn(n,{code:Rn.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),Bn(n,{code:Rn.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?Bn(n,{code:Rn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Bn(n,{code:Rn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)nr.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"email",code:Rn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)tr.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"uuid",code:Rn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Xn.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"cuid",code:Rn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)er.test(e.data)||(n=this._getOrReturnCtx(e,n),Bn(n,{validation:"cuid2",code:Rn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Bn(n,{validation:"url",code:Rn.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),Bn(n,{validation:"regex",code:Rn.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),Bn(n,{code:Rn.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),Bn(n,{code:Rn.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),Bn(n,{code:Rn.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 rr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Jn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Jn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Jn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Jn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Jn.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,...Jn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Jn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Jn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Jn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Jn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Jn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Jn.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 ir(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)}rr.create=e=>{var t;return new rr({checks:[],typeName:Kr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$n(e)})};class or extends Yn{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)!==Nn.number){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.number,received:t.parsedType}),zn}let t;const n=new Zn;for(const r of this._def.checks)if("int"===r.kind)On.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Bn(t,{code:Rn.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),Bn(t,{code:Rn.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),Bn(t,{code:Rn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==ir(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Bn(t,{code:Rn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Bn(t,{code:Rn.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,Jn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Jn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Jn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Jn.toString(t))}setLimit(e,t,n,r){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Jn.toString(r)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Jn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Jn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Jn.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)}}or.create=e=>new or({checks:[],typeName:Kr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$n(e)});class ar extends Yn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Nn.bigint){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.bigint,received:t.parsedType}),zn}return Fn(e.data)}}ar.create=e=>{var t;return new ar({typeName:Kr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$n(e)})};class sr extends Yn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Nn.boolean){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.boolean,received:t.parsedType}),zn}return Fn(e.data)}}sr.create=e=>new sr({typeName:Kr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$n(e)});class ur extends Yn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Nn.date){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.date,received:t.parsedType}),zn}if(isNaN(e.data.getTime())){return Bn(this._getOrReturnCtx(e),{code:Rn.invalid_date}),zn}const t=new Zn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Bn(n,{code:Rn.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),Bn(n,{code:Rn.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 ur({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Jn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Jn.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}}ur.create=e=>new ur({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Kr.ZodDate,...$n(e)});class cr extends Yn{_parse(e){if(this._getType(e)!==Nn.symbol){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.symbol,received:t.parsedType}),zn}return Fn(e.data)}}cr.create=e=>new cr({typeName:Kr.ZodSymbol,...$n(e)});class lr extends Yn{_parse(e){if(this._getType(e)!==Nn.undefined){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.undefined,received:t.parsedType}),zn}return Fn(e.data)}}lr.create=e=>new lr({typeName:Kr.ZodUndefined,...$n(e)});class dr extends Yn{_parse(e){if(this._getType(e)!==Nn.null){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.null,received:t.parsedType}),zn}return Fn(e.data)}}dr.create=e=>new dr({typeName:Kr.ZodNull,...$n(e)});class pr extends Yn{constructor(){super(...arguments),this._any=!0}_parse(e){return Fn(e.data)}}pr.create=e=>new pr({typeName:Kr.ZodAny,...$n(e)});class fr extends Yn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Fn(e.data)}}fr.create=e=>new fr({typeName:Kr.ZodUnknown,...$n(e)});class hr extends Yn{_parse(e){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.never,received:t.parsedType}),zn}}hr.create=e=>new hr({typeName:Kr.ZodNever,...$n(e)});class mr extends Yn{_parse(e){if(this._getType(e)!==Nn.undefined){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.void,received:t.parsedType}),zn}return Fn(e.data)}}mr.create=e=>new mr({typeName:Kr.ZodVoid,...$n(e)});class vr extends Yn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Nn.array)return Bn(t,{code:Rn.invalid_type,expected:Nn.array,received:t.parsedType}),zn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Bn(t,{code:e?Rn.too_big:Rn.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&&(Bn(t,{code:Rn.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&&(Bn(t,{code:Rn.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 qn(t,e,t.path,n))))).then((e=>Zn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new qn(t,e,t.path,n))));return Zn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new vr({...this._def,minLength:{value:e,message:Jn.toString(t)}})}max(e,t){return new vr({...this._def,maxLength:{value:e,message:Jn.toString(t)}})}length(e,t){return new vr({...this._def,exactLength:{value:e,message:Jn.toString(t)}})}nonempty(e){return this.min(1,e)}}var yr;function gr(e){if(e instanceof _r){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=jr.create(gr(r))}return new _r({...e._def,shape:()=>t})}return e instanceof vr?vr.create(gr(e.element)):e instanceof jr?jr.create(gr(e.unwrap())):e instanceof Lr?Lr.create(gr(e.unwrap())):e instanceof Sr?Sr.create(e.items.map((e=>gr(e)))):e}vr.create=(e,t)=>new vr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Kr.ZodArray,...$n(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(yr||(yr={}));class _r extends Yn{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)!==Nn.object){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.object,received:t.parsedType}),zn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof hr&&"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 qn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof hr){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&&(Bn(n,{code:Rn.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 qn(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=>Zn.mergeObjectSync(t,e))):Zn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Jn.errToObj,new _r({...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=Jn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new _r({...this._def,unknownKeys:"strip"})}passthrough(){return new _r({...this._def,unknownKeys:"passthrough"})}extend(e){return new _r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>yr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Kr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _r({...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 _r({...this._def,shape:()=>t})}omit(e){const t={};return On.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new _r({...this._def,shape:()=>t})}deepPartial(){return gr(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 _r({...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 jr;)e=e._def.innerType;t[n]=e}})),new _r({...this._def,shape:()=>t})}keyof(){return Mr(On.objectKeys(this.shape))}}_r.create=(e,t)=>new _r({shape:()=>e,unknownKeys:"strip",catchall:hr.create(),typeName:Kr.ZodObject,...$n(t)}),_r.strictCreate=(e,t)=>new _r({shape:()=>e,unknownKeys:"strict",catchall:hr.create(),typeName:Kr.ZodObject,...$n(t)}),_r.lazycreate=(e,t)=>new _r({shape:e,unknownKeys:"strip",catchall:hr.create(),typeName:Kr.ZodObject,...$n(t)});class wr extends Yn{_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 xn(e.ctx.common.issues)));return Bn(t,{code:Rn.invalid_union,unionErrors:n}),zn}));{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 xn(e)));return Bn(t,{code:Rn.invalid_union,unionErrors:i}),zn}}get options(){return this._def.options}}wr.create=(e,t)=>new wr({options:e,typeName:Kr.ZodUnion,...$n(t)});const br=e=>e instanceof Cr?br(e.schema):e instanceof Dr?br(e.innerType()):e instanceof Nr?[e.value]:e instanceof Rr?e.options:e instanceof xr?Object.keys(e.enum):e instanceof Br?br(e._def.innerType):e instanceof lr?[void 0]:e instanceof dr?[null]:null;class Tr extends Yn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Nn.object)return Bn(t,{code:Rn.invalid_type,expected:Nn.object,received:t.parsedType}),zn;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}):(Bn(t,{code:Rn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),zn)}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=br(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 Tr({typeName:Kr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...$n(n)})}}function Er(e,t){const n=Mn(e),r=Mn(t);if(e===t)return{valid:!0,data:e};if(n===Nn.object&&r===Nn.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=Er(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Nn.array&&r===Nn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Er(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Nn.date&&r===Nn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Pr extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Gn(e)||Gn(r))return zn;const i=Er(e.value,r.value);return i.valid?((Hn(e)||Hn(r))&&t.dirty(),{status:t.value,value:i.data}):(Bn(n,{code:Rn.invalid_intersection_types}),zn)};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}))}}Pr.create=(e,t,n)=>new Pr({left:e,right:t,typeName:Kr.ZodIntersection,...$n(n)});class Sr extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Nn.array)return Bn(n,{code:Rn.invalid_type,expected:Nn.array,received:n.parsedType}),zn;if(n.data.length<this._def.items.length)return Bn(n,{code:Rn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),zn;!this._def.rest&&n.data.length>this._def.items.length&&(Bn(n,{code:Rn.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 qn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Zn.mergeArray(t,e))):Zn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Sr({...this._def,rest:e})}}Sr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sr({items:e,typeName:Kr.ZodTuple,rest:null,...$n(t)})};class Or extends Yn{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!==Nn.object)return Bn(n,{code:Rn.invalid_type,expected:Nn.object,received:n.parsedType}),zn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new qn(n,e,n.path,e)),value:o._parse(new qn(n,n.data[e],n.path,e))});return n.common.async?Zn.mergeObjectAsync(t,r):Zn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Or(t instanceof Yn?{keyType:e,valueType:t,typeName:Kr.ZodRecord,...$n(n)}:{keyType:rr.create(),valueType:e,typeName:Kr.ZodRecord,...$n(t)})}}class Ar extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Nn.map)return Bn(n,{code:Rn.invalid_type,expected:Nn.map,received:n.parsedType}),zn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new qn(n,e,n.path,[o,"key"])),value:i._parse(new qn(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 zn;"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 zn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Ar.create=(e,t,n)=>new Ar({valueType:t,keyType:e,typeName:Kr.ZodMap,...$n(n)});class Ir extends Yn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Nn.set)return Bn(n,{code:Rn.invalid_type,expected:Nn.set,received:n.parsedType}),zn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Bn(n,{code:Rn.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&&(Bn(n,{code:Rn.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 zn;"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 qn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new Ir({...this._def,minSize:{value:e,message:Jn.toString(t)}})}max(e,t){return new Ir({...this._def,maxSize:{value:e,message:Jn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ir.create=(e,t)=>new Ir({valueType:e,minSize:null,maxSize:null,typeName:Kr.ZodSet,...$n(t)});class kr extends Yn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Nn.function)return Bn(t,{code:Rn.invalid_type,expected:Nn.function,received:t.parsedType}),zn;function n(e,n){return Ln({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,jn(),Un].filter((e=>!!e)),issueData:{code:Rn.invalid_arguments,argumentsError:n}})}function r(e,n){return Ln({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,jn(),Un].filter((e=>!!e)),issueData:{code:Rn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Ur?Fn((async(...e)=>{const t=new xn([]),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}))})):Fn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new xn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new xn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new kr({...this._def,args:Sr.create(e).rest(fr.create())})}returns(e){return new kr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new kr({args:e||Sr.create([]).rest(fr.create()),returns:t||fr.create(),typeName:Kr.ZodFunction,...$n(n)})}}class Cr extends Yn{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})}}Cr.create=(e,t)=>new Cr({getter:e,typeName:Kr.ZodLazy,...$n(t)});class Nr extends Yn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Bn(t,{received:t.data,code:Rn.invalid_literal,expected:this._def.value}),zn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Mr(e,t){return new Rr({values:e,typeName:Kr.ZodEnum,...$n(t)})}Nr.create=(e,t)=>new Nr({value:e,typeName:Kr.ZodLiteral,...$n(t)});class Rr extends Yn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Bn(t,{expected:On.joinValues(n),received:t.parsedType,code:Rn.invalid_type}),zn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Bn(t,{received:t.data,code:Rn.invalid_enum_value,options:n}),zn}return Fn(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 Rr.create(e)}exclude(e){return Rr.create(this.options.filter((t=>!e.includes(t))))}}Rr.create=Mr;class xr extends Yn{_parse(e){const t=On.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Nn.string&&n.parsedType!==Nn.number){const e=On.objectValues(t);return Bn(n,{expected:On.joinValues(e),received:n.parsedType,code:Rn.invalid_type}),zn}if(-1===t.indexOf(e.data)){const e=On.objectValues(t);return Bn(n,{received:n.data,code:Rn.invalid_enum_value,options:e}),zn}return Fn(e.data)}get enum(){return this._def.values}}xr.create=(e,t)=>new xr({values:e,typeName:Kr.ZodNativeEnum,...$n(t)});class Ur extends Yn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Nn.promise&&!1===t.common.async)return Bn(t,{code:Rn.invalid_type,expected:Nn.promise,received:t.parsedType}),zn;const n=t.parsedType===Nn.promise?t.data:Promise.resolve(t.data);return Fn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ur.create=(e,t)=>new Ur({type:e,typeName:Kr.ZodPromise,...$n(t)});class Dr extends Yn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Kr.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=>{Bn(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?zn:("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?zn:("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(!Vn(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=>Vn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}On.assertNever(r)}}Dr.create=(e,t,n)=>new Dr({schema:e,typeName:Kr.ZodEffects,effect:t,...$n(n)}),Dr.createWithPreprocess=(e,t,n)=>new Dr({schema:t,effect:{type:"preprocess",transform:e},typeName:Kr.ZodEffects,...$n(n)});class jr extends Yn{_parse(e){return this._getType(e)===Nn.undefined?Fn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}jr.create=(e,t)=>new jr({innerType:e,typeName:Kr.ZodOptional,...$n(t)});class Lr extends Yn{_parse(e){return this._getType(e)===Nn.null?Fn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:Kr.ZodNullable,...$n(t)});class Br extends Yn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Nn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Br.create=(e,t)=>new Br({innerType:e,typeName:Kr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$n(t)});class Zr extends Yn{_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 Kn(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}}Zr.create=(e,t)=>new Zr({innerType:e,typeName:Kr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$n(t)});class zr extends Yn{_parse(e){if(this._getType(e)!==Nn.nan){const t=this._getOrReturnCtx(e);return Bn(t,{code:Rn.invalid_type,expected:Nn.nan,received:t.parsedType}),zn}return{status:"valid",value:e.data}}}zr.create=e=>new zr({typeName:Kr.ZodNaN,...$n(e)});const Wr=Symbol("zod_brand");class Fr extends Yn{_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 Gr extends Yn{_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?zn:"dirty"===e.status?(t.dirty(),Wn(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?zn:"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 Gr({in:e,out:t,typeName:Kr.ZodPipeline})}}const Hr=(e,t={},n)=>e?pr.create().superRefine(((r,i)=>{if(!e(r)){const e="function"==typeof t?t(r):t,o="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...o,fatal:n})}})):pr.create(),Vr={object:_r.lazycreate};var Kr;!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"}(Kr||(Kr={}));const Jr=rr.create,qr=or.create,Qr=zr.create,$r=ar.create,Yr=sr.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=_r.create,ci=_r.strictCreate,li=wr.create,di=Tr.create,pi=Pr.create,fi=Sr.create,hi=Or.create,mi=Ar.create,vi=Ir.create,yi=kr.create,gi=Cr.create,_i=Nr.create,wi=Rr.create,bi=xr.create,Ti=Ur.create,Ei=Dr.create,Pi=jr.create,Si=Lr.create,Oi=Dr.createWithPreprocess,Ai=Gr.create,Ii={string:e=>rr.create({...e,coerce:!0}),number:e=>or.create({...e,coerce:!0}),boolean:e=>sr.create({...e,coerce:!0}),bigint:e=>ar.create({...e,coerce:!0}),date:e=>ur.create({...e,coerce:!0})},ki=zn;var Ci=Object.freeze({__proto__:null,defaultErrorMap:Un,setErrorMap:function(e){Dn=e},getErrorMap:jn,makeIssue:Ln,EMPTY_PATH:[],addIssueToContext:Bn,ParseStatus:Zn,INVALID:zn,DIRTY:Wn,OK:Fn,isAborted:Gn,isDirty:Hn,isValid:Vn,isAsync:Kn,get util(){return On},ZodParsedType:Nn,getParsedType:Mn,ZodType:Yn,ZodString:rr,ZodNumber:or,ZodBigInt:ar,ZodBoolean:sr,ZodDate:ur,ZodSymbol:cr,ZodUndefined:lr,ZodNull:dr,ZodAny:pr,ZodUnknown:fr,ZodNever:hr,ZodVoid:mr,ZodArray:vr,get objectUtil(){return yr},ZodObject:_r,ZodUnion:wr,ZodDiscriminatedUnion:Tr,ZodIntersection:Pr,ZodTuple:Sr,ZodRecord:Or,ZodMap:Ar,ZodSet:Ir,ZodFunction:kr,ZodLazy:Cr,ZodLiteral:Nr,ZodEnum:Rr,ZodNativeEnum:xr,ZodPromise:Ur,ZodEffects:Dr,ZodTransformer:Dr,ZodOptional:jr,ZodNullable:Lr,ZodDefault:Br,ZodCatch:Zr,ZodNaN:zr,BRAND:Wr,ZodBranded:Fr,ZodPipeline:Gr,custom:Hr,Schema:Yn,ZodSchema:Yn,late:Vr,get ZodFirstPartyTypeKind(){return Kr},coerce:Ii,any:ri,array:si,bigint:$r,boolean:Yr,date:Xr,discriminatedUnion:di,effect:Ei,enum:wi,function:yi,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Hr((t=>t instanceof e),t,!0),intersection:pi,lazy:gi,literal:_i,map:mi,nan:Qr,nativeEnum:bi,never:oi,null:ni,nullable:Si,number:qr,object:ui,oboolean:()=>Yr().optional(),onumber:()=>qr().optional(),optional:Pi,ostring:()=>Jr().optional(),pipeline:Ai,preprocess:Oi,promise:Ti,record:hi,set:vi,strictObject:ci,string:Jr,symbol:ei,transformer:Ei,tuple:fi,undefined:ti,union:li,unknown:ii,void:ai,NEVER:ki,ZodIssueCode:Rn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:xn}),Ni=function(){function e(){var t,n,r,o,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,P,S,O,A,I,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,U=new URL(location.href),D=mn(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:D,dataConfig:{backgroundColor:(null===(P=this.initConfig)||void 0===P||null===(S=P.app)||void 0===S?void 0:S.headerColor)||me,textColor:(null===(O=this.initConfig)||void 0===O||null===(A=O.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(I=this.initConfig)||void 0===I||null===(k=I.app)||void 0===k?void 0:k.textAlign)||ve,viewInLeftType:R,confirmToExit:1},homeConfig:{enable:x,url:"".concat(a,"/").concat(i,"/").concat(U.search)}}}var t=e.prototype;return t.setNavigationBarTitle=function(e){return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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 Pe(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){rn("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ue({},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 Pe(this,(function(o){return r=e?O.hide:O.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();rn("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 Pe(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();rn("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 Pe(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=I.left:"center"===e.textAlign&&(n.dataConfig.textAlign=I.center)),!0===e.hideActionBar?n.actionbarType=he:!1===e.hideActionBar&&(n.actionbarType=fe),"normal"===e.statusBarType?n.statusbarType=S.normal:"hidden"===e.statusBarType?n.statusbarType=S.hidden:"transparent"===e.statusBarType&&(n.statusbarType=S.transparent),[2,new Promise((function(r,i){rn("CHANGE_ACTIONBAR",Ue({},n),{success:function(){var i;t.config=Ue({},n);var o,a=null===(i=Ce())||void 0===i?void 0:i.platform;window.STATUS_BAR_TYPE=(o=t.config.statusbarType)===S.hidden?"hidden":o===S.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}(),Mi=Ni.getInstance(),Ri=[ui({title:Jr()}).optional()];function xi(e){return Ui.apply(this,arguments)}function Ui(){return Ui=_e((function(e){return Pe(this,(function(t){return[2,bn("setNavigationBarTitle",Ri,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.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)}}())]}))})),Ui.apply(this,arguments)}var Di=[ui({color:Jr(),textColor:Ci.enum(["black","white"]).optional(),statusBarColor:Jr().optional()}).optional()];function ji(e){return Li.apply(this,arguments)}function Li(){return Li=_e((function(e){return Pe(this,(function(t){return[2,bn("setNavigationBarColor",Di,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.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)}}())]}))})),Li.apply(this,arguments)}var Bi=[ui({type:Ci.enum(["none","back","home","both"])}).optional()];function Zi(e){return zi.apply(this,arguments)}function zi(){return zi=_e((function(e){return Pe(this,(function(t){return[2,bn("setNavigationBarLeftButton",Bi,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.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)}}())]}))})),zi.apply(this,arguments)}function Wi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Fi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Wi(e,t,"get"))}function Gi(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 Hi(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,Wi(e,t,"set"),n),n}var Vi,Ki,Ji,qi=new WeakMap,Qi=new WeakMap,$i=new WeakMap,Yi=function(){function e(t){_t(this,e),Gi(this,qi,{writable:!0,value:localStorage}),Gi(this,Qi,{writable:!0,value:void 0}),Gi(this,$i,{writable:!0,value:void 0}),Hi(this,$i,{keys:new Set,currentSize:0,limitSize:oe}),Hi(this,Qi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Fi(this,qi)){if(e)if(t.split("_")[0]!==e)continue;Fi(this,$i).keys.add(t)}}catch(e){}},t.get=function(e){var t=this,n=new Map;return e.forEach((function(e){n.set(e,t.getSync(e))})),Promise.resolve(n)},t.getSync=function(e){return Fi(this,Qi)&&(e="".concat(Fi(this,Qi),"_").concat(e)),Fi(this,$i).keys.has(e)?Fi(this,qi).getItem(e):null},t.set=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return Object.entries(e).forEach((function(e){var n=De(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Fi(this,Qi)&&(e="".concat(Fi(this,Qi),"_").concat(e)),Fi(this,qi).setItem(e,t),Fi(this,$i).keys.add(e)},t.getInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.getInfoSync())]}))}))()},t.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}(Fi(this,qi),Fi(this,Qi));return{currentSize:gt.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((oe/1024).toFixed(2))}},t.remove=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Fi(this,Qi)&&(e="".concat(Fi(this,Qi),"_").concat(e)),Fi(this,$i).keys.has(e)&&(Fi(this,qi).removeItem(e),Fi(this,$i).keys.delete(e))},t.clear=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Fi(this,$i).keys.forEach((function(t){Fi(e,Qi)&&t.indexOf(Fi(e,Qi))<0||(Fi(e,qi).removeItem(t),Fi(e,$i).keys.delete(t))}))},e}(),Xi=new WeakMap,eo=new WeakMap,to=function(){function e(t){_t(this,e),Gi(this,Xi,{writable:!0,value:void 0}),Gi(this,eo,{writable:!0,value:void 0}),Hi(this,eo,{keys:new Set,currentSize:0,limitSize:oe}),Hi(this,Xi,t)}var t=e.prototype;return t.get=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Fi(t,Xi)},{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})}))]}))}))()},t.set=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Fi(t,Xi)},{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})}))]}))}))()},t.getInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Fi(e,Xi)},{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})}))]}))}))()},t.remove=function(e){var t=this;return _e((function(){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Fi(t,Xi)},{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})}))]}))}))()},t.clear=function(){var e=this;return _e((function(){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Fi(e,Xi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),no=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 Pe(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]=dn(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return _e((function(){var n,r;return Pe(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=De(e,2),n=t[0],i=t[1];gt.isUndefined(i)||gt.isNull(i)||(r[n]=hn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return _e((function(){return Pe(this,(function(n){switch(n.label){case 0:return[4,t.getInstance().remove(e)];case 1:return[2,n.sent()]}}))}))()},t.clearStorage=function(){var e=this;return _e((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},t.getStorageInfo=function(){var e=this;return _e((function(){return Pe(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),ro=new WeakMap,io=function(e){Ot(n,e);var t=It(n);function n(e){var r;return _t(this,n),Gi(At(r=t.call(this)),ro,{writable:!0,value:void 0}),Hi(At(r),ro,e),r}return n.prototype.getInstance=function(){return new Yi(Fi(this,ro))},n}(no),oo=new WeakMap,ao=function(e){Ot(n,e);var t=It(n);function n(e){var r;return _t(this,n),Gi(At(r=t.call(this)),oo,{writable:!0,value:void 0}),Hi(At(r),oo,e),r}return n.prototype.getInstance=function(){return new to(Fi(this,oo))},n}(no),so=new io(i),uo=(null===(Vi=Ce())||void 0===Vi?void 0:Vi.zaloVersion)||"",co=(null===(Ki=Ce())||void 0===Ki?void 0:Ki.platformName)||"unknown";!!gt.isString(uo)&&parseInt(uo,10)>={android:12100571,iOS:400,wp:0,unknown:0}[co]&&(null===(Ji=Ce())||void 0===Ji?void 0:Ji.appEnv.isMp)&&(so=new ao(i));var lo=so,po=[ui({data:Ci.record(Jr(),Ci.any())}).optional()];function fo(e){return ho.apply(this,arguments)}function ho(){return ho=_e((function(e){return Pe(this,(function(t){return[2,bn("setStorage",po,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.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)}}())]}))})),ho.apply(this,arguments)}var mo=[ui({keys:Ci.array(Jr())}).optional()];function vo(e){return yo.apply(this,arguments)}function yo(){return yo=_e((function(e){return Pe(this,(function(t){return[2,bn("getStorage",mo,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.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)}}())]}))})),yo.apply(this,arguments)}function go(e){return _o.apply(this,arguments)}function _o(){return(_o=_e((function(e){return Pe(this,(function(t){return[2,bn("getStorageInfo",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var wo=[ui({keys:Ci.array(Jr())}).optional()];function bo(e){return To.apply(this,arguments)}function To(){return To=_e((function(e){return Pe(this,(function(t){return[2,bn("removeStorage",wo,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.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)}}())]}))})),To.apply(this,arguments)}var Eo=[ui({prefix:Jr().optional()}).optional()];function Po(e){return So.apply(this,arguments)}function So(){return(So=_e((function(e){return Pe(this,(function(t){return[2,bn("clearStorage",Eo,[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp||Ne.isMpWeb?[4,lo.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Re("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var Oo=function(){var e=_e((function(e,t){var n,r,o,a;return Pe(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,gn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,sn.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 Pe(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)}}(),Ao=[ui({avatarType:Ci.enum(["small","normal","large"]).optional(),autoRequestPermission:Ci.boolean().default(!1).optional()}).optional()];function Io(e){return ko.apply(this,arguments)}function ko(){return ko=_e((function(e){return Pe(this,(function(t){return[2,bn("getUserInfo",Ao,[e],function(){var e=_e((function(e){var t,n;return Pe(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,Oo(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)}}())]}))})),ko.apply(this,arguments)}var Co=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},No=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("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 Co(a).NONE:i=d.none;break;case Co(a).WIFI:i=d.wifi;break;case Co(a)["2G"]:case Co(a)["3G"]:case Co(a)["4G"]:i=d.cellular;break;default:i=d.unknown}e(i)},fail:function(e){t(e)}},{})}))]}))}));function Mo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=_e((function(e){return Pe(this,(function(t){return[2,bn("getNetworkType",[],[e],_e((function(){var e,t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?[4,No()]:[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 xo=[Ci.function().args(ui({isConnected:Ci.boolean(),networkType:Ci.enum(["none","wifi","cellular","unknown"])})).returns(Ci.void())];function Uo(e){return bn("onNetworkStatusChange",xo,[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;No().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 Do=function(){var e=_e((function(e){var t,n,r,i,o,a;return Pe(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){rn("SCAN_IBEACON",Ue({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),jo=[ui({scanningType:Ci.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ci.number().optional(),monitorInterval:Ci.number().optional(),domain:Ci.string().optional(),scanConfig:ui({scanTime:Ci.number().optional(),timeBetweenScan:Ci.number().optional(),beaconTimeout:Ci.number().optional(),delayCheckConnectedTimeout:Ci.number().optional(),beaconConnectedTimeout:Ci.number().optional()}).optional(),items:Ci.array(ui({id:Ci.string().optional(),distance:Ci.number().optional(),monitor:ui({enable:Ci.boolean().optional(),movingRange:Ci.number().optional()}).optional()})).optional(),scanFromSource:Ci.string().optional()}).optional()];function Lo(e){return Bo.apply(this,arguments)}function Bo(){return(Bo=_e((function(e){return Pe(this,(function(t){return[2,bn("startBeaconDiscovery",jo,[e],_e((function(){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Do(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 Zo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function zo(e){return Wo.apply(this,arguments)}function Wo(){return(Wo=_e((function(e){return Pe(this,(function(t){return[2,bn("stopBeaconDiscovery",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Zo()]:[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 Fo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("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 Go(e){return Ho.apply(this,arguments)}function Ho(){return(Ho=_e((function(e){return Pe(this,(function(t){return[2,bn("getBeacons",[],[e],_e((function(){return Pe(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({beacons:[]})]:[2,Promise.reject(Re("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Vo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ko(e){return Jo.apply(this,arguments)}function Jo(){return(Jo=_e((function(e){return Pe(this,(function(t){return[2,bn("closeApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Vo()]:[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 qo=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("OPEN_QR",{skipOpenLink:!0},{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 Pe(this,(function(t){return[2,bn("scanQRCode",[],[e],_e((function(){return Pe(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({content:""})]:[2,Promise.reject(Re("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Yo=function(){var e=_e((function(e,t,n,i){return Pe(this,(function(o){return[2,new Promise((function(o,a){rn("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)}}(),Xo=[ui({id:Jr(),type:Ci.enum(["user","oa","aliasOA"]),sourceId:Ci.any().optional(),sourceIndex:Ci.any().optional()}).optional()];function ea(e){return ta.apply(this,arguments)}function ta(){return ta=_e((function(e){return Pe(this,(function(t){return[2,bn("openProfile",Xo,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Yo(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)}}())]}))})),ta.apply(this,arguments)}var na=function(){var e=_e((function(e,t){var n,i,o,a=arguments;return Pe(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){rn("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)}}(),ra=[ui({id:Jr(),type:Ci.enum(["user","oa"]),sourceId:Ci.any().optional(),sourceIndex:Ci.any().optional(),message:Jr().optional()}).optional()];function ia(e){return oa.apply(this,arguments)}function oa(){return oa=_e((function(e){return Pe(this,(function(t){return[2,bn("openChat",ra,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(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,na(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)}}())]}))})),oa.apply(this,arguments)}function aa(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 sa=function(){var e=_e((function(e,t){var n;return Pe(this,(function(i){switch(n={},e){case"image":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(t,i){rn("OPEN_POSTFEED",aa(Ue({type:y[e]},n),{zapp:r}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ua=[Ci.union([ui({type:Ci.enum(["image"]),data:ui({imageUrl:Jr().url().optional()})}),ui({type:Ci.enum(["link"]),data:ui({link:Jr().url(),title:Jr().max(100).optional(),thumb:Jr().url().optional(),description:Jr().max(400).default("").optional()})}),ui({type:Ci.enum(["profile"]),data:ui({id:Jr().optional()})})])];function ca(e){return la.apply(this,arguments)}function la(){return la=_e((function(e){return Pe(this,(function(t){return[2,bn("openPostFeed",ua,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,sa(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)}}())]}))})),la.apply(this,arguments)}var da=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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)}}(),pa=[ui({id:Jr(),showDialogConfirm:Ci.boolean().optional()}).optional()];function fa(e){return ha.apply(this,arguments)}function ha(){return ha=_e((function(e){return Pe(this,(function(t){return[2,bn("followOA",pa,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,da(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)}}())]}))})),ha.apply(this,arguments)}var ma=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:r},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),va=[ui({id:Jr()}).optional()];function ya(e){return ga.apply(this,arguments)}function ga(){return ga=_e((function(e){return Pe(this,(function(t){return[2,bn("unfollowOA",va,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?(t=e.id,[4,ma(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)}}())]}))})),ga.apply(this,arguments)}var _a=function(){var e=_e((function(e,t,n,r,i,a){var s,c,d,p,f,h,m,v;return Pe(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,Ue({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw nn.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,aa(Ue({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),wa=function(){var e=_e((function(e,t){var n,o,a,s,u,c,l,d,p,f,h,m;return Pe(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,sn.getAccessToken()];case 8:case 11:return a=v.sent(),[4,_a(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){rn("OPEN_SHARESHEET",aa(Ue({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)}}(),ba=[Ci.union([ui({type:Ci.enum(["text"]),data:ui({text:Jr(),description:Jr().default("").optional(),autoParseLink:Ci.boolean().default(!1).optional()})}),ui({type:Ci.enum(["image"]),data:ui({imageUrl:Jr().url(),imageUrls:Ci.array(Jr().url()).max(10).optional()})}),ui({type:Ci.enum(["link"]),data:ui({link:Jr().url(),chatOnly:Ci.boolean().optional()})}),ui({type:Ci.enum(["oa"]),data:ui({id:Jr()})}),ui({type:Ci.enum(["gif"]),data:ui({gifUrl:Jr().url(),imageUrl:Jr().url().optional(),width:qr().min(0).optional(),height:qr().min(0).optional()})}),ui({type:Ci.enum(["video"]),data:ui({videoThumb:Jr().url(),videoUrl:Jr().url(),width:qr().min(0).optional(),height:qr().min(0).optional()})}),ui({type:Ci.enum(["zmp","zmp_deep_link"]),data:ui({title:Jr().max(100),thumbnail:Jr().url(),path:Jr().optional(),description:Jr().max(400).default("").optional()})})])];function Ta(e){return Ea.apply(this,arguments)}function Ea(){return Ea=_e((function(e){return Pe(this,(function(t){return[2,bn("openShareSheet",ba,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.type,n=e.data,[4,wa(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)}}())]}))})),Ea.apply(this,arguments)}var Pa=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("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 Sa(e){return Oa.apply(this,arguments)}function Oa(){return(Oa=_e((function(e){return Pe(this,(function(t){return[2,bn("requestCameraPermission",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Pa()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var Aa=function(){var e=_e((function(e,t,n){return Pe(this,(function(r){return[2,new Promise((function(r,i){rn("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)}}(),Ia=_e((function(){var e,t,n,r=arguments;return Pe(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=kn(),[4,Gt(e,t,n.version)];case 1:return[2,o.sent()]}}))})),ka=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ca=[ui({params:Ci.record(Jr(),Jr()).optional()}).optional()];function Na(e){return Ma.apply(this,arguments)}function Ma(){return Ma=_e((function(e){return Pe(this,(function(t){return[2,bn("createShortcut",Ca,[e],function(){var e=_e((function(e){var t,n,r,a,s,u,c,l;return Pe(this,(function(d){switch(d.label){case 0:return Ne.isMp?[4,Ia(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||fn("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,ka(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,Aa("".concat(o,"/").concat(i,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,nn.success()];case 6:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ma.apply(this,arguments)}var Ra=function(){var e=_e((function(e,t,n){return Pe(this,(function(i){return[2,new Promise((function(i,o){rn("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)}}(),xa=[ui({secretData:Jr(),ui:ui({title:Jr().default("Xác thực").optional(),subTitle:Jr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Jr().default("Đóng").optional()}).optional(),requireFingerprint:Yr().default(!0).optional()}).optional()];function Ua(e){return Da.apply(this,arguments)}function Da(){return Da=_e((function(e){return Pe(this,(function(t){return[2,bn("openBioAuthentication",xa,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Ra(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)}}())]}))})),Da.apply(this,arguments)}var ja=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("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 La(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=_e((function(e){return Pe(this,(function(t){return[2,bn("checkStateBioAuthentication",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,ja()]:[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 Za=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),za=[ui({message:Jr()}).optional()];function Wa(e){return Fa.apply(this,arguments)}function Fa(){return Fa=_e((function(e){return Pe(this,(function(t){return[2,bn("showToast",za,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Za(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)}}())]}))})),Fa.apply(this,arguments)}var Ga=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ha(e){return Va.apply(this,arguments)}function Va(){return(Va=_e((function(e){return Pe(this,(function(t){return[2,bn("hideKeyboard",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ga()]:[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 Ka=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ja=[ui({phoneNumber:Jr()})];function qa(e){return Qa.apply(this,arguments)}function Qa(){return Qa=_e((function(e){return Pe(this,(function(t){return[2,bn("openPhone",Ja,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ka(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)}}())]}))})),Qa.apply(this,arguments)}var $a=function(){var e=_e((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){rn("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ya=[ui({content:Jr(),phoneNumber:Jr()})];function Xa(e){return es.apply(this,arguments)}function es(){return es=_e((function(e){return Pe(this,(function(t){return[2,bn("openSMS",Ya,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,$a(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)}}())]}))})),es.apply(this,arguments)}var ts=function(){var e=_e((function(e){var t,n=arguments;return Pe(this,(function(i){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,i){rn("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)}}(),ns=[ui({id:Jr(),displayName:Jr().default("").optional()})];function rs(e){return is.apply(this,arguments)}function is(){return is=_e((function(e){return Pe(this,(function(t){return[2,bn("viewOAQr",ns,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ts(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)}}())]}))})),is.apply(this,arguments)}var os=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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)}}(),as=[ui({keepScreenOn:Yr()})];function ss(e){return us.apply(this,arguments)}function us(){return us=_e((function(e){return Pe(this,(function(t){return[2,bn("keepScreen",as,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,os(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)}}())]}))})),us.apply(this,arguments)}function cs(e){return ls.apply(this,arguments)}function ls(){return(ls=_e((function(e){return Pe(this,(function(t){return[2,bn("onKeepScreen",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,os(!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 ds(e){return ps.apply(this,arguments)}function ps(){return(ps=_e((function(e){return Pe(this,(function(t){return[2,bn("offKeepScreen",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,os(!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 fs=function(){var e=_e((function(e,t){var n;return Pe(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){rn("SAVE_IMAGE_GALLERY",Ue({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),hs=[ui({imageBase64Data:Jr().optional(),imageUrl:Jr().url().optional()}).optional()];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=_e((function(e){return Pe(this,(function(t){return[2,bn("saveImageToGallery",hs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,fs(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)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=_e((function(e){var t,n,r,i,o,s,u=arguments;return Pe(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,Ia(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=De(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){rn("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),gs=[ui({appId:Jr(),path:Jr().optional(),params:Ci.record(Jr(),Jr()).optional()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=_e((function(e){return Pe(this,(function(t){return[2,bn("openMiniApp",gs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ys(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)}}())]}))})),ws.apply(this,arguments)}var bs=_e((function(){var e,t,n=arguments;return Pe(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){rn("INTERACTIVE_VIBRATION",{type:b[e],vibrate_time:t},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))})),Ts=[ui({type:Ci.enum(["oneShot"]).default("oneShot"),milliseconds:qr().optional()})];function Es(e){return Ps.apply(this,arguments)}function Ps(){return Ps=_e((function(e){return Pe(this,(function(t){return[2,bn("vibrate",Ts,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,bs(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)}}())]}))})),Ps.apply(this,arguments)}var Ss=function(){var e=_e((function(e,t){var n,r,i,o;return Pe(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)?Vt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Vt(null==t?void 0:t.leftButton):"back"},!r&&gt.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){rn("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Os=[ui({url:Jr(),config:ui({style:Ci.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ci.enum(["back","none"]).default("back").optional()}).optional()})];function As(e){return Is.apply(this,arguments)}function Is(){return Is=_e((function(e){return Pe(this,(function(t){return[2,bn("openWebview",Os,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ss(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)}}())]}))})),Is.apply(this,arguments)}function ks(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Dt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Cs(){return bn("getRouteParams",[],[],(function(){return ks()}))}function Ns(e){return Ms.apply(this,arguments)}function Ms(){return(Ms=_e((function(e){return Pe(this,(function(t){return[2,bn("getAppInfo",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Ia()]:[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 Rs=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("WEBVIEW_SET_RESULT",{result:hn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),xs=[ui({data:Ci.any()})];function Us(e){return Ds.apply(this,arguments)}function Ds(){return Ds=_e((function(e){return Pe(this,(function(t){return[2,bn("sendDataToPreviousMiniApp",xs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Rs(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)}}())]}))})),Ds.apply(this,arguments)}var js=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){var n,r;rn("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(nn.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 Ls(e){return Bs.apply(this,arguments)}function Bs(){return(Bs=_e((function(e){return Pe(this,(function(t){return[2,bn("getPhoneNumber",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,js()]:[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 Zs=_e((function(){var e,t=arguments;return Pe(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){rn("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})}))]}))})),zs=[ui({maxProfile:qr().min(1).max(10).optional().default(1)})];function Ws(e){return Fs.apply(this,arguments)}function Fs(){return Fs=_e((function(e){return Pe(this,(function(t){return[2,bn("openProfilePicker",zs,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Ne.isMp?[4,Zs(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,sn.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)}}())]}))})),Fs.apply(this,arguments)}var Gs=function(){var e=_e((function(e,t,n){var r;return Pe(this,(function(i){return r=t&&gt.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){rn("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)}}(),Hs=[ui({SSID:Jr(),password:Jr().optional(),hiddenSSID:Yr().optional()})];function Vs(e){return Ks.apply(this,arguments)}function Ks(){return Ks=_e((function(e){return Pe(this,(function(t){return[2,bn("connectWifi",Hs,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Gs(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)}}())]}))})),Ks.apply(this,arguments)}var Js=function(){var e=_e((function(e,t,n,r,i,o){var a,s;return Pe(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){rn("PICK_MEDIA",{media_type:T[e],edit_view:Ue({},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)}}(),qs=[ui({type:Ci.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Jr().url(),maxItemSize:qr().min(0).optional(),editView:ui({enable:Yr().optional(),aspectRatio:Jr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Yr().optional(),maxSelectItem:qr().min(1).optional()})];function Qs(e){return $s.apply(this,arguments)}function $s(){return $s=_e((function(e){return Pe(this,(function(t){return[2,bn("openMediaPicker",qs,[e],function(){var e=_e((function(e){var t,n,r,i,o,a;return Pe(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,Js(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)}}())]}))})),$s.apply(this,arguments)}var Ys=[ui({title:Jr().max(100),description:Jr().max(400).default(""),thumbnail:Jr().url().optional(),path:Jr().optional()})];function Xs(e){return eu.apply(this,arguments)}function eu(){return eu=_e((function(e){return Pe(this,(function(t){return[2,bn("getShareableLink",Ys,[e],function(){var e=_e((function(e){var t;return Pe(this,(function(n){switch(n.label){case 0:return[4,sn.getAccessToken()];case 1:return t=n.sent(),[4,_a(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)}}())]}))})),eu.apply(this,arguments)}var tu=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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 nu(e){return ru.apply(this,arguments)}function ru(){return(ru=_e((function(e){return Pe(this,(function(t){return[2,bn("closeLoading",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,tu("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 iu(e){return ou.apply(this,arguments)}function ou(){return ou=_e((function(e){return Pe(this,(function(t){return[2,bn("requestUpdateZalo",[],[e],_e((function(){var e,t,n;return Pe(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,ka(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Re("requestUpdateZalo",{}))]}}))})))]}))})),ou.apply(this,arguments)}var au=Rt.getInstance();au.addListener=function(e,t,n){var r=e;return au.addListener(f[r],t,n)};var su=[Ci.function()];function uu(e){return bn("onConfirmToExit",su,[e],(function(e){var t=e;Ne.isMp&&(au.on(f.AppClose,t,'{"handle_h5": 1}'),Mi.setNavigationBarLeftButton(void 0,2))}))}function cu(){return bn("offConfirmToExit",[],[],(function(){Ne.isMp&&(au.off(f.AppClose),Mi.setNavigationBarLeftButton(void 0,0))}))}function lu(){return bn("getDeviceId",[],[],(function(){return Ne.isMp&&sn.getSync(c.DEVICE_ID)||""}))}function du(e){return pu.apply(this,arguments)}function pu(){return(pu=_e((function(e){return Pe(this,(function(t){return[2,bn("getDeviceIdAsync",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function fu(){return bn("getContext",[],[],(function(){if(Ne.isMp){var e=sn.getSync(c.CONTEXT_ID)||"";return{type:sn.getSync(c.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function hu(e){return mu.apply(this,arguments)}function mu(){return(mu=_e((function(e){return Pe(this,(function(t){return[2,bn("getContextAsync",[],[e],_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,sn.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 vu(e){return yu.apply(this,arguments)}function yu(){return(yu=_e((function(e){return Pe(this,(function(t){return[2,bn("getAuthCode",[],[e],_e((function(){var e,t;return Pe(this,(function(n){switch(n.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,sn.jumpAndGetToken(c.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,sn.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Ht([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),nn.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function gu(e){return _u.apply(this,arguments)}function _u(){return(_u=_e((function(e){return Pe(this,(function(t){return[2,bn("getZPIToken",[],[e],_e((function(){var e,t,n,r;return Pe(this,(function(i){switch(i.label){case 0:return Ne.isMp?[4,sn.jumpAndGetToken(c.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,sn.jumpAndGetToken(c.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,sn.jumpAndGetToken(c.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,sn.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 wu=[Jr()];function bu(e){return bn("setAccessToken",wu,[e],(function(e){var t=e;sn.setAccessToken(t)}))}var Tu=[ui({url:Jr().url()})];function Eu(e){return Pu.apply(this,arguments)}function Pu(){return Pu=_e((function(e){return Pe(this,(function(t){return[2,bn("openOutApp",Tu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,ka(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)}}())]}))})),Pu.apply(this,arguments)}var Su=[ui({count:qr().min(1).optional().default(1),sourceType:Ci.array(Ci.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ci.enum(["back","front"]).default("front").optional()})];function Ou(e){return Au.apply(this,arguments)}function Au(){return Au=_e((function(e){return Pe(this,(function(t){return[2,bn("chooseImage",Su,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(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)}}())]}))})),Au.apply(this,arguments)}var Iu=_e((function(){var e,t,n=arguments;return Pe(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){rn("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(nn.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function ku(e){return Cu.apply(this,arguments)}function Cu(){return(Cu=_e((function(e){return Pe(this,(function(t){return[2,bn("getLocation",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Iu()]:[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 Nu=[Ci.function().args(ui({data:Ci.any()})).returns(Ci.void())];function Mu(e){return bn("onCallbackData",Nu,[e],(function(){!function(e){Rt.getInstance().on(f.OnDataCallback,(function(t){e({data:t})}))}(e)}))}var Ru=function(){var e=_e((function(e){var t,n,r,o,a,s,u,c,l,d,p;return Pe(this,(function(f){switch(f.label){case 0:return n="",e||(e=ks()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Dt.getParameterByName("orderId",e),o=Dt.getParameterByName("appTransID",e)||Dt.getParameterByName("apptransid",e),t=r||o),a={headers:{authorization:"Bearer "}},[4,sn.getAccessToken().catch((function(){throw nn.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 nn.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ue({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),xu=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,P,S,O,A,I,k;return Pe(this,(function(C){switch(C.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 "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,sn.getAccessToken().catch((function(){throw nn.error.loginRequired}))];case 2:return m=C.sent(),p.headers.authorization="Bearer ".concat(m),[4,fetch(ae,aa(Ue({method:"POST"},p),{body:c}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw nn.error.badRequest(v.msg);return y=v.data.id,g=v.data.jwt,_=v.data.messageToken||"",w=window.APP_VERSION,b=window.APP_ENV,T={miniAppId:u,orderId:y},E=v.data.method,P=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),P&&(T.isCustom=P),S=Dt.encode(T),O=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),A=Kt(),I=((null===(h=Ce())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,Ss(O,{style:"android"===I&&A<742?"normal":"bottomSheet"}).then((function(){var e=!1;Rt.getInstance().once(f.WebviewClosed,(function(){setTimeout(_e((function(){var t;return Pe(this,(function(n){switch(n.label){case 0:return e?[3,2]:[4,Ru({zmpOrderId:y})];case 1:(t=n.sent()).err>=0&&!t.isCustom&&Rt.getInstance().emit(f.PaymentClose,t.err,aa(Ue({},t),{zmpOrderId:y})),n.label=2;case 2:return[2]}}))})),500)})),Rt.getInstance().once(f.OpenApp,(function(){e=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw k=C.sent(),console.log("Internal error"),k;case 7:return[2]}}))}));return function(t,n,r,i,o,a,s){return e.apply(this,arguments)}}(),Uu=[ui({amount:Ci.union([Jr(),qr()]),item:Ci.array(Ci.record(Jr(),Ci.any())),desc:Jr(),extradata:Ci.any().optional(),payload:Ci.any().optional(),method:Ci.union([Ci.string(),Ci.object({id:Ci.string(),isCustom:Ci.boolean()})]).optional(),mac:Ci.string().optional()})];function Du(e){return ju.apply(this,arguments)}function ju(){return ju=_e((function(e){return Pe(this,(function(t){return[2,bn("createOrder",Uu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,xu(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)}}())]}))})),ju.apply(this,arguments)}var Lu=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MP_CONFIRM_REQUEST_PAYMENT",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))})),Bu=function(){var e=_e((function(e,t,n,r,o){var a,s,u,c,l,d,p,f,h,m,v,y;return Pe(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,sn.getAccessToken().catch((function(){throw nn.error.loginRequired}))];case 2:return l=g.sent(),u.headers.authorization="Bearer ".concat(l),console.log("_purchase"),[4,sn.jumpAndGetToken()];case 3:if(g.sent(),d=null===(c=sn.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,Lu()];case 5:return g.sent(),[3,7];case 6:throw p=g.sent(),console.error("Failed:",p),p;case 7:return[4,fetch(ce,aa(Ue({method:"POST"},u),{body:s}))];case 8:return[4,g.sent().json()];case 9:if(!(f=g.sent()).data||0!==f.err)throw nn.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)}}(),Zu=[ui({amount:Ci.union([Ci.string(),Ci.number()]),desc:Ci.string(),method:Ci.string(),transId:Ci.string().optional(),mac:Ci.string().optional()})];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=_e((function(e){return Pe(this,(function(t){return[2,bn("purchase",Zu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Bu(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)}}())]}))})),Wu.apply(this,arguments)}var Fu=function(){var e=_e((function(e,t){return Pe(this,(function(n){return[2,new Promise((function(n,r){var i=e&&(null==e?void 0:e.length)>0;rn("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)}}(),Gu=[ui({channels:si(ui({method:Jr(),subMethod:Jr().optional(),subInfo:Jr().optional()})).optional(),selectedMethod:ui({method:Jr(),subMethod:Jr().optional()}).optional()}).optional()];function Hu(e){return Vu.apply(this,arguments)}function Vu(){return Vu=_e((function(e){return Pe(this,(function(t){return[2,bn("selectPaymentMethod",Gu,[e],function(){var e=_e((function(e){var t,n;return Pe(this,(function(r){switch(r.label){case 0:return Ne.isMp?(t=e.channels,n=e.selectedMethod,[4,Fu(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)}}())]}))})),Vu.apply(this,arguments)}var Ku=[ui({data:Ci.union([Jr(),Ci.record(Jr(),Jr())])})];function Ju(e){return qu.apply(this,arguments)}function qu(){return qu=_e((function(e){return Pe(this,(function(t){return[2,bn("checkTransaction",Ku,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Ru(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)}}())]}))})),qu.apply(this,arguments)}var Qu=[ui({hide:Yr().default(!1).optional()}).optional()];function $u(e){return Yu.apply(this,arguments)}function Yu(){return Yu=_e((function(e){return Pe(this,(function(t){return[2,bn("setAndroidBottomNavigationBar",Qu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.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)}}())]}))})),Yu.apply(this,arguments)}var Xu=[ui({hide:Yr().default(!1).optional()}).optional()];function ec(e){return tc.apply(this,arguments)}function tc(){return tc=_e((function(e){return Pe(this,(function(t){return[2,bn("setIOSBottomSafeArea",Xu,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.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)}}())]}))})),tc.apply(this,arguments)}var nc=[ui({type:Ci.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ci.string().optional()}).optional()];function rc(e){return ic.apply(this,arguments)}function ic(){return ic=_e((function(e){return Pe(this,(function(t){return[2,bn("setStatusBar",nc,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,Mi.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)}}())]}))})),ic.apply(this,arguments)}var oc=[ui({headerTextColor:Ci.enum(["black","white"]).optional(),headerColor:Ci.string().optional(),actionBar:ui({hide:Ci.boolean().optional(),title:Ci.string().optional(),leftButton:Ci.enum(["back","none"]).optional(),textAlign:Ci.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ci.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ci.boolean().optional(),hideIOSSafeAreaBottom:Ci.boolean().optional()})];function ac(e){return sc.apply(this,arguments)}function sc(){return sc=_e((function(e){return Pe(this,(function(t){return[2,bn("configAppView",oc,[e],function(){var e=_e((function(e){var t,n,r,i,o,a,s;return Pe(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,Mi.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,Mi.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Mi.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,Mi.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Mi.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)}}())]}))})),sc.apply(this,arguments)}var uc=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 Pe(this,(function(b){switch(b.label){case 0:d=i,(p=new URLSearchParams).append("payType",t||E.SUBSCRIPTION),f=P.UNKNOW,n===de&&(f=P.IMMEDIATE_AND_CHARGE_FULL_PRICE),n===le&&(f=P.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,sn.getAccessToken().catch((function(){throw nn.error.loginRequired}))];case 2:return v=b.sent(),m.headers.authorization="Bearer ".concat(v),[4,fetch(se,aa(Ue({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 nn.error.createIAPOrderFailed(y.err);return g=y.data.store,_=y.data.orderId,[2,new Promise((function(e,t){rn("IAP_REQUESTPAYMENT",Ue({},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)}}(),cc=[ui({productId:Jr(),payType:Ci.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ci.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Jr().optional(),method:Ci.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Jr().optional()})];function lc(e){return dc.apply(this,arguments)}function dc(){return dc=_e((function(e){return Pe(this,(function(t){return[2,bn("createOrderIAP",cc,[e],function(){var e=_e((function(e){return Pe(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,uc(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)}}())]}))})),dc.apply(this,arguments)}var pc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function fc(e){return hc.apply(this,arguments)}function hc(){return(hc=_e((function(e){return Pe(this,(function(t){return[2,bn("minimizeApp",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,pc()]:[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 mc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function vc(e){return yc.apply(this,arguments)}function yc(){return(yc=_e((function(e){return Pe(this,(function(t){return[2,bn("openPermissionSetting",[],[e],_e((function(){return Pe(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("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var gc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function _c(e){return wc.apply(this,arguments)}function wc(){return(wc=_e((function(e){return Pe(this,(function(t){return[2,bn("favoriteApp",[],[e],_e((function(){return Pe(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("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var bc=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("OPEN_GROUPLIST",{},{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 Pe(this,(function(t){return[2,bn("openGroupList",[],[e],_e((function(){return Pe(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("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var Pc=_e((function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return[4,sn.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){rn("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function Sc(e){return Oc.apply(this,arguments)}function Oc(){return(Oc=_e((function(e){return Pe(this,(function(t){return[2,bn("requestSendNotification",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Pc()]:[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 Ac=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Ic(e){return kc.apply(this,arguments)}function kc(){return(kc=_e((function(e){return Pe(this,(function(t){return[2,bn("addRating",[],[e],_e((function(){return Pe(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("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var Cc,Nc=(Cc=_e((function(e,t,n){var r,i;return Pe(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,Ue({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return Cc.apply(this,arguments)}),Mc=function(){var e=_e((function(e){return Pe(this,(function(t){return[2,new Promise((function(t,n){rn("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)}}(),Rc=[ui({oaId:Jr()})];function xc(e){return Uc.apply(this,arguments)}function Uc(){return Uc=_e((function(e){return Pe(this,(function(t){return[2,bn("interactOA",Rc,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.oaId,[4,sn.getAccessToken()]):[3,5];case 1:return!(n=o.sent())||gt.isEmpty(n)?[3,3]:[4,Nc(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,Mc(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)}}())]}))})),Uc.apply(this,arguments)}var Dc=[ui({oaId:Jr()})];function jc(e){return Lc.apply(this,arguments)}function Lc(){return Lc=_e((function(e){return Pe(this,(function(t){return[2,bn("isAllowedInteractWithOA",Dc,[e],function(){var e=_e((function(e){var t,n,r;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(t=e.oaId,[4,sn.getAccessToken()]):[3,4];case 1:return!(n=o.sent())||gt.isEmpty(n)?[3,3]:[4,Nc(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)}}())]}))})),Lc.apply(this,arguments)}function Bc(e){return Zc.apply(this,arguments)}function Zc(){return(Zc=_e((function(e){return Pe(this,(function(t){return[2,bn("getSetting",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,en()]:[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 zc=Ci.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Wc=[ui({scopes:Ci.array(zc).max(2).optional()}).optional()];function Fc(e){return Gc.apply(this,arguments)}function Gc(){return Gc=_e((function(e){return Pe(this,(function(t){return[2,bn("authorize",Wc,[e],function(){var e=_e((function(e){var t,n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return Ne.isMp?(n=null==e?void 0:e.scopes,r=Kt(),("android"===(i=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(nn.error.clientNotSupport())]:[4,on(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gc.apply(this,arguments)}var Hc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n;return Pe(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(nn.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Vc(e){return bn("checkZaloCameraPermission",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return[4,Hc()];case 1:return[2,e.sent()]}}))})))}var Kc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=sn.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 Jc(e){return qc.apply(this,arguments)}function qc(){return(qc=_e((function(e){return Pe(this,(function(t){return[2,bn("getUserID",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Kc()]:[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 Qc=_e((function(){return Pe(this,(function(e){return[2,new Promise(function(){var e=_e((function(e,t){var n,r,i;return Pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,sn.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=sn.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 $c(e){return Yc.apply(this,arguments)}function Yc(){return(Yc=_e((function(e){return Pe(this,(function(t){return[2,bn("getIDToken",[],[e],_e((function(){return Pe(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("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Xc={format:N.JPEG,quality:M.NORMAL,mirrored:!1,useVideoSourceSize:!1},el={width:1024,height:768,facingMode:C.FRONT,mirrored:!1,audio:!1,video:!0},tl=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:el.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:el.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(o=null==s?void 0:s.audio)&&void 0!==o?o:el.audio,this._videoEnabled=null!==(a=null==s?void 0:s.video)&&void 0!==a?a:el.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 Pe(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 Pe(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||el.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||el.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 Pe(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 Pe(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 Pe(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 Pe(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 Pe(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 Pe(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 Pe(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 Pe(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 Pe(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||Xc.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}(),nl=ui({play:Ci.function(),pause:Ci.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),rl=[ui({videoElement:nl,mediaConstraints:Ci.object({width:Ci.number().min(100).optional(),height:Ci.number().min(100).optional(),facingMode:Ci.string().optional(),audio:Ci.boolean().optional(),video:Ci.boolean().optional(),deviceId:Ci.string().optional(),mirrored:Ci.boolean().optional()}).nullish()}).optional()];function il(e){return bn("createCameraContext",rl,[e],(function(e){return new tl(e.videoElement,e.mediaConstraints)}))}var ol=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 al(e){return sl.apply(this,arguments)}function sl(){return(sl=_e((function(e){return Pe(this,(function(t){return[2,bn("setupAd",[],[e],(function(){return ol.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var ul=[ui({ids:Ci.union([Ci.string(),Ci.array(Ci.string())]),config:ui({display:Ci.boolean().optional(),onClose:Ci.function().optional()}).optional()})];function cl(e){return ll.apply(this,arguments)}function ll(){return ll=_e((function(e){return Pe(this,(function(t){return[2,bn("loadAd",ul,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return ol.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ll.apply(this,arguments)}var dl=[ui({id:Ci.string()})];function pl(e){return fl.apply(this,arguments)}function fl(){return fl=_e((function(e){return Pe(this,(function(t){return[2,bn("displayAd",dl,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return ol.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fl.apply(this,arguments)}var hl=[ui({id:Ci.string().optional()}).optional()];function ml(e){return vl.apply(this,arguments)}function vl(){return vl=_e((function(e){return Pe(this,(function(t){return[2,bn("refreshAd",hl,[e],function(){var e=_e((function(e){return Pe(this,(function(t){return ol.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vl.apply(this,arguments)}var yl=[ui({id:Jr(),guidingText:Jr().optional(),color:Jr().optional(),onStatusChange:Ci.function().optional()})];function gl(e){return _l.apply(this,arguments)}function _l(){return _l=_e((function(t){return Pe(this,(function(n){return[2,bn("showOAWidget",yl,[t],function(){var t=_e((function(t){var n,r,i,o,a,s,u,c;return Pe(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=De(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 Pe(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,sn.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=sn.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?Yo(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)}}())]}))})),_l.apply(this,arguments)}var wl=[ui({id:Jr(),type:Jr(),text:Jr(),color:Jr().optional(),disabled:Ci.boolean().optional(),onDataReceived:Ci.function().optional(),onError:Ci.function().optional()})];function bl(e){return Tl.apply(this,arguments)}function Tl(){return Tl=_e((function(t){return Pe(this,(function(n){return[2,bn("showFunctionButtonWidget",wl,[t],function(){var t=_e((function(t){var n,r,i,o,a,s,u;return Pe(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=De(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=De(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 Pe(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,sn.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=sn.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=sn.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,Pn()];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)}}())]}))})),Tl.apply(this,arguments)}var El=function(){var e=_e((function(e,t){var n;return Pe(this,(function(r){return n={},"cccd"===e&&(n={mrz:null==t?void 0:t.mrz}),[2,new Promise((function(t,r){rn("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)}}(),Pl=[ui({type:Ci.enum(["cccd"]),data:ui({mrz:Jr().max(90)})})];function Sl(e){return Ol.apply(this,arguments)}function Ol(){return Ol=_e((function(e){return Pe(this,(function(t){return[2,bn("scanNFC",Pl,[e],function(){var e=_e((function(e){var t,n,r,i,o;return Pe(this,(function(a){switch(a.label){case 0:return Ne.isMp?(n=Kt(),"android"===(r=((null===(t=Ce())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&n<754||"ios"===r&&n<620?[2,Promise.reject(nn.error.clientNotSupport())]:(i=e.type,o=e.data,[4,El(i,o)])):[3,2];case 1:return[2,a.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("scanNFC",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ol.apply(this,arguments)}var Al=_e((function(){return Pe(this,(function(e){return[2,new Promise((function(e,t){rn("CHECK_NFC",{},{success:function(t){e(t)},fail:function(e){t(e)}},{timeout:!1})}))]}))}));function Il(e){return kl.apply(this,arguments)}function kl(){return(kl=_e((function(e){return Pe(this,(function(t){return[2,bn("checkNFC",[],[e],_e((function(){return Pe(this,(function(e){switch(e.label){case 0:return Ne.isMp?[4,Al()]:[3,2];case 1:return[2,e.sent()];case 2:return Ne.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Re("checkNFC",{}))]}}))})))]}))}))).apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:In},Tn();var Cl=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Tn,getAccessToken:Pn,getVersion:In,getSystemInfo:Cn,setNavigationBarTitle:xi,setNavigationBarColor:ji,setNavigationBarLeftButton:Zi,setStorage:fo,getStorage:vo,getStorageInfo:go,removeStorage:bo,clearStorage:Po,getUserInfo:Io,getNetworkType:Mo,onNetworkStatusChange:Uo,startBeaconDiscovery:Lo,stopBeaconDiscovery:zo,getBeacons:Go,closeApp:Ko,scanQRCode:Qo,openProfile:ea,openChat:ia,openPostFeed:ca,followOA:fa,unfollowOA:ya,openShareSheet:Ta,requestCameraPermission:Sa,createShortcut:Na,openBioAuthentication:Ua,checkStateBioAuthentication:La,showToast:Wa,hideKeyboard:Ha,openPhone:qa,openSMS:Xa,viewOAQr:rs,keepScreen:ss,onKeepScreen:cs,offKeepScreen:ds,saveImageToGallery:ms,openMiniApp:_s,vibrate:Es,openWebview:As,getRouteParams:Cs,getAppInfo:Ns,sendDataToPreviousMiniApp:Us,getPhoneNumber:Ls,openProfilePicker:Ws,connectWifi:Vs,openMediaPicker:Qs,getShareableLink:Xs,closeLoading:nu,requestUpdateZalo:iu,onConfirmToExit:uu,offConfirmToExit:cu,getDeviceId:lu,getDeviceIdAsync:du,getContext:fu,getContextAsync:hu,getAuthCode:vu,getZPIToken:gu,setAccessToken:bu,openOutApp:Eu,chooseImage:Ou,getLocation:ku,onCallbackData:Mu,createOrder:Du,purchase:zu,selectPaymentMethod:Hu,checkTransaction:Ju,events:au,setAndroidBottomNavigationBar:$u,setIOSBottomSafeArea:ec,setStatusBar:rc,configAppView:ac,createOrderIAP:lc,minimizeApp:fc,openPermissionSetting:vc,favoriteApp:_c,openGroupList:Tc,requestSendNotification:Sc,addRating:Ic,interactOA:xc,interactOa:xc,isAllowedInteractWithOA:jc,getSetting:Bc,authorize:Fc,checkZaloCameraPermission:Vc,getUserID:Jc,getIDToken:$c,createCameraContext:il,setupAd:al,loadAd:cl,displayAd:pl,refreshAd:ml,showOAWidget:gl,showFunctionButtonWidget:bl,scanNFC:Sl,checkNFC:Il,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:tl}),Nl=Du,Ml=Ju,Rl=lc,xl=Hu,Ul=zu,Dl=e(Cl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]),jl={createOrder:Nl,checkTransaction:Ml,createOrderIAP:Rl,selectPaymentMethod:xl},Ll={selectPaymentMethod:xl,purchase:Ul};!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,Cl))}();var Bl=Object.freeze({__proto__:null,Payment:jl,CheckoutSDK:Ll,default:Dl,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Tn,getAccessToken:Pn,getVersion:In,getSystemInfo:Cn,setNavigationBarTitle:xi,setNavigationBarColor:ji,setNavigationBarLeftButton:Zi,setStorage:fo,getStorage:vo,getStorageInfo:go,removeStorage:bo,clearStorage:Po,getUserInfo:Io,getNetworkType:Mo,onNetworkStatusChange:Uo,startBeaconDiscovery:Lo,stopBeaconDiscovery:zo,getBeacons:Go,closeApp:Ko,scanQRCode:Qo,openProfile:ea,openChat:ia,openPostFeed:ca,followOA:fa,unfollowOA:ya,openShareSheet:Ta,requestCameraPermission:Sa,createShortcut:Na,openBioAuthentication:Ua,checkStateBioAuthentication:La,showToast:Wa,hideKeyboard:Ha,openPhone:qa,openSMS:Xa,viewOAQr:rs,keepScreen:ss,onKeepScreen:cs,offKeepScreen:ds,saveImageToGallery:ms,openMiniApp:_s,vibrate:Es,openWebview:As,getRouteParams:Cs,getAppInfo:Ns,sendDataToPreviousMiniApp:Us,getPhoneNumber:Ls,openProfilePicker:Ws,connectWifi:Vs,openMediaPicker:Qs,getShareableLink:Xs,closeLoading:nu,requestUpdateZalo:iu,onConfirmToExit:uu,offConfirmToExit:cu,getDeviceId:lu,getDeviceIdAsync:du,getContext:fu,getContextAsync:hu,getAuthCode:vu,getZPIToken:gu,setAccessToken:bu,openOutApp:Eu,chooseImage:Ou,getLocation:ku,onCallbackData:Mu,createOrder:Du,purchase:zu,selectPaymentMethod:Hu,checkTransaction:Ju,events:au,setAndroidBottomNavigationBar:$u,setIOSBottomSafeArea:ec,setStatusBar:rc,configAppView:ac,createOrderIAP:lc,minimizeApp:fc,openPermissionSetting:vc,favoriteApp:_c,openGroupList:Tc,requestSendNotification:Sc,addRating:Ic,interactOA:xc,interactOa:xc,isAllowedInteractWithOA:jc,getSetting:Bc,authorize:Fc,checkZaloCameraPermission:Vc,getUserID:Jc,getIDToken:$c,createCameraContext:il,setupAd:al,loadAd:cl,displayAd:pl,refreshAd:ml,showOAWidget:gl,showFunctionButtonWidget:bl,scanNFC:Sl,checkNFC:Il,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:tl,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 P},get StatusBarType(){return S},get AndroidBottomNavigationBarType(){return O},get IOSSafeAreaBottomType(){return A},get TextAlignType(){return I}});window.ZaloMiniAppSDK=Bl}();
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,I,P,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 Ie(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 Pe(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")}}Ie.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.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"}(I||(I={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(P||(P={})),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=Ie((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:Pe(),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),I(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=P(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 I(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 P(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=P(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=P(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){P(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=P(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 It(e,t){return It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},It(e,t)}function Pt(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&&It(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){Pt(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,I,P,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 I=O.sent(),[3,9];case 8:I="",O.label=9;case 9:return S=I,[3,11];case 10:return P=O.sent(),xt({serialId:u,result:{error_code:null==P?void 0:P.code,error_message:null==P?void 0:P.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(/&#39;/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&&gt.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?I.hidden:"transparent"===e?I.transparent:I.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)&&gt.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Xt(t,e);if(!gt.isNull(s)&&gt.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!gt.isNull(s)&&gt.isFunction(s))return s(t);throw Xt(t,e)}}function Sn(e){return In.apply(this,arguments)}function In(){return(In=_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 Pn(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.0";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 Pr.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 Ir(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=Ir(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=Ir(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 Pr extends er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Hn(e)||Hn(r))return Fn;const i=Ir(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}))}}Pr.create=(e,t,n)=>new Pr({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=Pr.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,Ii=jr.create,Pi=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:Pr,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:Ii,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:Pi,ostring:()=>Qr().optional(),pipeline:ki,preprocess:Oi,promise:Si,record:vi,set:gi,strictObject:di,string:Qr,symbol:ni,transformer:Ii,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,I,P,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===(I=S.app)||void 0===I?void 0:I.headerColor)||me,textColor:(null===(P=this.initConfig)||void 0===P||null===(A=P.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?P.hide:P.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=I.normal:"hidden"===e.statusBarType?n.statusbarType=I.hidden:"transparent"===e.statusBarType&&(n.statusbarType=I.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)===I.hidden?"hidden":o===I.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){Pt(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){Pt(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){Pt(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){Pt(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 Io.apply(this,arguments)}function Io(){return Io=_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)}}())]}))})),Io.apply(this,arguments)}var Po=[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",Po,[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;return Se(this,(function(i){switch(n={},e){case"image":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(t,i){an("OPEN_POSTFEED",ca(De({type:y[e]},n),{zapp:r}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){i(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),da=[Mi.union([li({type:Mi.enum(["image"]),data:li({imageUrl:Mi.union([Qr().url(),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(),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 Ia(e){return Pa.apply(this,arguments)}function Pa(){return Pa=_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)}}())]}))})),Pa.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)}},{})}))]}))})),Is=[li({type:Mi.enum(["oneShot"]).default("oneShot"),milliseconds:$r().optional()})];function Ps(e){return As.apply(this,arguments)}function As(){return As=_e((function(e){return Se(this,(function(t){return[2,En("vibrate",Is,[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&&gt.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&&gt.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 Iu=[li({url:Qr().url()})];function Pu(e){return Au.apply(this,arguments)}function Au(){return Au=_e((function(e){return Se(this,(function(t){return[2,En("openOutApp",Iu,[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,I,P,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),I=new URL("?".concat(S),"https://payment-mini.zalo.me").toString(),P=Jt(),A=Kt()&&P<742?"normal":"bottomSheet",[4,Os(I,{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=[li({hide:ei().default(!1).optional()}).optional()];function ec(e){return tc.apply(this,arguments)}function tc(){return tc=_e((function(e){return Se(this,(function(t){return[2,En("setAndroidBottomNavigationBar",Xu,[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)}}())]}))})),tc.apply(this,arguments)}var nc=[li({hide:ei().default(!1).optional()}).optional()];function rc(e){return ic.apply(this,arguments)}function ic(){return ic=_e((function(e){return Se(this,(function(t){return[2,En("setIOSBottomSafeArea",nc,[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)}}())]}))})),ic.apply(this,arguments)}var oc=[li({type:Mi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Mi.string().optional()}).optional()];function ac(e){return sc.apply(this,arguments)}function sc(){return sc=_e((function(e){return Se(this,(function(t){return[2,En("setStatusBar",oc,[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)}}())]}))})),sc.apply(this,arguments)}var uc=[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 cc(e){return lc.apply(this,arguments)}function lc(){return lc=_e((function(e){return Se(this,(function(t){return[2,En("configAppView",uc,[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)}}())]}))})),lc.apply(this,arguments)}var dc=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)}}(),pc=[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 fc(e){return hc.apply(this,arguments)}function hc(){return hc=_e((function(e){return Se(this,(function(t){return[2,En("createOrderIAP",pc,[e],function(){var e=_e((function(e){return Se(this,(function(t){switch(t.label){case 0:return Ne.isMp?[4,dc(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)}}())]}))})),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 Ic(e){return Pc.apply(this,arguments)}function Pc(){return(Pc=_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 Il.apply(this,arguments)}function Il(){return Il=_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,Pn()];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)}}())]}))})),Il.apply(this,arguments)}var Pl=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,Pl(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)}window.ZaloMiniAppSDK={getVersion:Cn},Sn();var Rl=Object.freeze({__proto__:null,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Sn,getAccessToken:Pn,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:Ia,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:Ps,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:Pu,chooseImage:ku,getLocation:Mu,onCallbackData:Du,createOrder:Bu,purchase:Vu,selectPaymentMethod:Ju,checkTransaction:$u,events:cu,setAndroidBottomNavigationBar:ec,setIOSBottomSafeArea:rc,setStatusBar:ac,configAppView:cc,createOrderIAP:fc,minimizeApp:vc,openPermissionSetting:_c,favoriteApp:Tc,openGroupList:Ic,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,get FacingMode(){return C},get PhotoFormat(){return N},get PhotoQuality(){return M},get StreamType(){return R},ZMACameraImp:il}),xl=[Mi.string().trim().min(1)];var Dl=[Mi.string().trim().min(1),Mi.string().trim()];var Ul=[Mi.string().trim().min(1)];var Ll=Bu,jl=$u,Bl=fc,Zl=Ju,zl=Vu,Wl=e(Rl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod","purchase"]),Fl={getItem:function(e){return En("getItem",xl,[e],(function(e){return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.getItem(e[0]):Re("getItem",{})}))},setItem:function(e,t){return En("setItem",Dl,[e,t],(function(e){return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.setItem(e[0],e[1]):Re("setItem",{})}))},removeItem:function(e){return En("removeItem",Ul,[e],(function(e){return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.removeItem(e[0]):Re("removeItem",{})}))},clear:function(){return En("clear",[],[],(function(){return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.clearStorageSync():Promise.reject(Re("clear",{}))}))},getStorageInfo:function(){return En("getStorageInfoSync",[],[],(function(){return Ne.isMp||Ne.isMpWeb?qt(757,625)?rn.error.clientNotSupport():ho.getStorageInfoSync():Re("getStorageInfoSync",{})}))}},Vl={createOrder:Ll,checkTransaction:jl,createOrderIAP:Bl,selectPaymentMethod:Zl},Gl={selectPaymentMethod:Zl,purchase:zl};!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,Rl))}();var Hl=Object.freeze({__proto__:null,Payment:Vl,nativeStorage:Fl,CheckoutSDK:Gl,default:Wl,get Events(){return f},get EventName(){return f},get CameraEvents(){return k},login:Sn,getAccessToken:Pn,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:Ia,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:Ps,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:Pu,chooseImage:ku,getLocation:Mu,onCallbackData:Du,createOrder:Bu,purchase:Vu,selectPaymentMethod:Ju,checkTransaction:$u,events:cu,setAndroidBottomNavigationBar:ec,setIOSBottomSafeArea:rc,setStatusBar:ac,configAppView:cc,createOrderIAP:fc,minimizeApp:vc,openPermissionSetting:_c,favoriteApp:Tc,openGroupList:Ic,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,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 I},get AndroidBottomNavigationBarType(){return P},get IOSSafeAreaBottomType(){return A},get TextAlignType(){return O}});window.ZaloMiniAppSDK=Hl}();