zmp-sdk 2.39.6 → 3.0.9

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/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @timeBuild 29-07-2024 09:49:55
2
+ * @timeBuild 29-07-2024 20:34:35
3
3
  * @license zmp-sdk
4
4
  *
5
5
  * Copyright @ 2024. Zalo Group.
@@ -7,7 +7,7 @@
7
7
  * This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";function t(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var n,r=1048576,i=window.zAppID,o=window.APP_ID,a="https://zalo.me/s",s="https://h5.zdn.vn/zapps",u="h5.zdn.vn",c="/zapps",l={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},d={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(n||(n={}));var p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k,C,N,M,x,R=0,D=-2e3,j=-1400,U=-1500,B=-1401,L=-1404,Z=-1408,z=-2004,W=-2005,F="Success",G="Unknown error. Please try again later.",H="Request timeout. Please try again later.",V="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",K="Login failed",J="This API is not supported in this version of Zalo",q="User Authentication Required. Please grant User Authentication permission before requesting User Permission",$="Unable to pick media",Q="Unable to save image",Y={SUCCESS:{code:R,message:F},UNKNOWN_ERROR:{code:D,message:G},UNAUTHORIZED:{code:B,message:V},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:L,message:J},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:Z,message:H},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},X={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},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:Y.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:Y.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:Y.USER_DENIED}},iOS:{"-2":{mapTo:Y.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:Y.USER_DENIED}},iOS:{"-1":{mapTo:Y.USER_DENIED}}}},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:W,message:Q},needMoreDetail:!0},"-102":{mapTo:{code:W,message:Q},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:Q},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:Y.USER_DENIED},"-101":{mapTo:Y.USER_DENIED}},iOS:{"-1":{mapTo:Y.USER_DENIED},"-10":{mapTo:Y.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:Y.USER_CANCEL}},iOS:{"-101":{mapTo:Y.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:Y.USER_CANCEL},999:{mapTo:{code:z,message:$},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:z,message:$}}}}},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:Y.USER_DENIED}},iOS:{"-1":{mapTo:Y.USER_DENIED}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1},MP_USER_AUTHORIZE:{skipJump:!1},MP_SELECT_PAYMENT_METHOD:{skipJump:!1}},ee={android:{"-4":Y.DECODE_FAILED,"-5":Y.CLIENT_NOT_SUPPORT,"-14":Y.TIME_OUT},iOS:{"-9":Y.DECODE_FAILED,"-5":Y.CLIENT_NOT_SUPPORT,"-14":Y.TIME_OUT}},te={android:12100615,iOS:460,wp:0,unknown:0},ne=5*r,re={CREATE_ORDER:process.env.CREATE_ORDER,CREATE_IAP_ORDER:process.env.CREATE_IAP_ORDER,GET_TRANSACTION:process.env.GET_TRANSACTION,GET_ORDER_STATUS:process.env.GET_ORDER_STATUS},ie=process.env.PAYMENT_H5_URL,oe="DEFERRED",ae="IMMEDIATE_AND_CHARGE_FULL_PRICE",se={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ue=5,ce=6,le="#1843EF",de=0,pe={"-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 fe(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 he(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){fe(o,r,i,a,s,"next",e)}function s(e){fe(o,r,i,a,s,"throw",e)}a(void 0)}))}}function me(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 ve(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ye(e,t){if(e){if("string"==typeof e)return me(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)?me(e,t):void 0}}function ge(e){return function(e){if(Array.isArray(e))return me(e)}(e)||ve(e)||ye(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 _e(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 we(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,ge(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function be(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}we.async=function(e){return he((function(){var t,n,r,i,o=arguments;return _e(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,ge(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},e.NetworkType=void 0,(p=e.NetworkType||(e.NetworkType={})).none="none",p.wifi="wifi",p.cellular="cellular",p.unknown="unknown",e.PlatformType=void 0,(f=e.PlatformType||(e.PlatformType={})).wp="wp",f.android="android",f.iOS="iOS",f.unknown="unknown",e.Events=void 0,(h=e.Events||(e.Events={})).AppPaused="h5.event.paused",h.AppResumed="h5.event.resumed",h.NetworkChanged="h5.event.connection.changed",h.OnDataCallback="h5.event.webview.result",h.WebviewClosed="h5.event.webview.close",h.OpenApp="h5.event.open.mp",h.AppClose="h5.event.action.close",h.PaymentCallback="payment.callback",h.PaymentResult="action.payment.result",h.PaymentClose="action.payment.close",e.JumpStatus=void 0,(m=e.JumpStatus||(e.JumpStatus={})).DOING="doing",m.DONE="done",e.ProfileType=void 0,(v=e.ProfileType||(e.ProfileType={}))[v.user=1]="user",v[v.oa=0]="oa",v[v.aliasOA=2]="aliasOA",e.ChatType=void 0,(y=e.ChatType||(e.ChatType={}))[y.user=1]="user",y[y.oa=0]="oa",e.PostFeedType=void 0,(g=e.PostFeedType||(e.PostFeedType={}))[g.image=1]="image",g[g.link=4]="link",g[g.profile=5]="profile",e.ShareSheetType=void 0,(_=e.ShareSheetType||(e.ShareSheetType={}))[_.image=1]="image",_[_.gif=11]="gif",_[_.video=12]="video",_[_.link=4]="link",_[_.oa=5]="oa",_[_.zmp=20]="zmp",_[_.multi_image=21]="multi_image",_[_.zmp_deep_link=4]="zmp_deep_link",_[_.text=22]="text",e.OrientationType=void 0,(w=e.OrientationType||(e.OrientationType={}))[w.auto=1]="auto",w[w.portrait=2]="portrait",w[w.landscape=3]="landscape",e.VibrateType=void 0,(b=e.VibrateType||(e.VibrateType={}))[b.oneShot=0]="oneShot",e.MediaPickerType=void 0,(T=e.MediaPickerType||(e.MediaPickerType={}))[T.zcamera=3]="zcamera",T[T.zcamera_photo=1]="zcamera_photo",T[T.zcamera_video=2]="zcamera_video",T[T.zcamera_scan=7]="zcamera_scan",T[T.photo=4]="photo",T[T.video=5]="video",T[T.file=6]="file",e.IAPPayType=void 0,(E=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",E.ONETIME="ONETIME",e.ProrationMode=void 0,(S=e.ProrationMode||(e.ProrationMode={}))[S.UNKNOW=0]="UNKNOW",S[S.DEFERRED=1]="DEFERRED",S[S.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(P=e.StatusBarType||(e.StatusBarType={}))[P.normal=1]="normal",P[P.hidden=0]="hidden",P[P.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(O=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[O.show=1]="show",O[O.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(A=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[A.show=1]="show",A[A.hide=0]="hide",e.TextAlignType=void 0,(I=e.TextAlignType||(e.TextAlignType={}))[I.left=0]="left",I[I.center=1]="center",e.CameraEvents=void 0,(k=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",k.OnStartCallback="h5.event.camera.start",k.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(C=e.FacingMode||(e.FacingMode={})).FRONT="user",C.BACK="environment",e.PhotoFormat=void 0,(N=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",N.PNG="image/png",N.JPEG="image/jpeg",e.PhotoQuality=void 0,(M=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",M.NORMAL="normal",M.LOW="low",e.StreamType=void 0,(x=e.StreamType||(e.StreamType={})).VIDEO="video",x.AUDIO="audio";var Te,Ee=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function Se(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Pe(){var e=function(){var e=we((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:be(),platform:t,platformName:Ee(t),zaloVersion:Se(e).trim()}}}();if(e)return e}var Oe=(null===(Te=Pe())||void 0===Te?void 0:Te.appEnv)||{};function Ae(e){Ae.on&&Ae.engine(e)}Ae.on=!1,Ae.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 Ie=function(e,t){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==t||null===(r=t.fail)||void 0===r||r.call(t,i),Ae({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ce(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){ke(e,t,n[t])}))}return e}function Ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||ve(e)||ye(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 Me="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function xe(){throw new Error("setTimeout has not been defined")}function Re(){throw new Error("clearTimeout has not been defined")}var De=xe,je=Re;function Ue(e){if(De===setTimeout)return setTimeout(e,0);if((De===xe||!De)&&setTimeout)return De=setTimeout,setTimeout(e,0);try{return De(e,0)}catch(t){try{return De.call(null,e,0)}catch(t){return De.call(this,e,0)}}}"function"==typeof Me.setTimeout&&(De=setTimeout),"function"==typeof Me.clearTimeout&&(je=clearTimeout);var Be,Le=[],Ze=!1,ze=-1;function We(){Ze&&Be&&(Ze=!1,Be.length?Le=Be.concat(Le):ze=-1,Le.length&&Fe())}function Fe(){if(!Ze){var e=Ue(We);Ze=!0;for(var t=Le.length;t;){for(Be=Le,Le=[];++ze<t;)Be&&Be[ze].run();ze=-1,t=Le.length}Be=null,Ze=!1,function(e){if(je===clearTimeout)return clearTimeout(e);if((je===Re||!je)&&clearTimeout)return je=clearTimeout,clearTimeout(e);try{je(e)}catch(t){try{return je.call(null,e)}catch(t){return je.call(this,e)}}}(e)}}function Ge(e,t){this.fun=e,this.array=t}Ge.prototype.run=function(){this.fun.apply(null,this.array)};function He(){}var Ve=He,Ke=He,Je=He,qe=He,$e=He,Qe=He,Ye=He;var Xe=Me.performance||{},et=Xe.now||Xe.mozNow||Xe.msNow||Xe.oNow||Xe.webkitNow||function(){return(new Date).getTime()};var tt=new Date;var nt,rt={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];Le.push(new Ge(e,t)),1!==Le.length||Ze||Ue(Fe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ve,addListener:Ke,once:Je,off:qe,removeListener:$e,removeAllListeners:Qe,emit:Ye,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*et.call(Xe),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-tt)/1e3}},it=rt,ot="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function at(e){return e&&e.constructor===Symbol?"symbol":typeof e}function st(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 ot?ot:"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 it&&it.env&&"true"===it.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return S(e,t)}if(!G(e))throw new TypeError;if(!B(t))throw new TypeError;if(!B(r)&&!D(r)&&!j(r))throw new TypeError;return j(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!B(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(!B(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),I(e,t,n)}function _(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function w(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!B(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!B(e))throw new TypeError;return D(t)||(t=F(t)),x(e,t)}function E(e,t,n){if(!B(t))throw new TypeError;D(n)||(n=F(n));var r=O(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)&&!j(r)){if(!V(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!j(o)){if(!B(o))throw new TypeError;r=o}}return r}function O(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(I(e,t,n))return!0;var r=X(t);return!j(r)&&A(e,r,n)}function I(e,t,n){var r=O(t,n,!1);return!D(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 j(r)?void 0:k(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){O(n,r,!0).set(e,t)}function M(e,t){var n=x(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 x(e,t){var n=[],r=O(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function R(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 j(e){return null===e}function U(e){return"symbol"==typeof e}function B(e){return"object"==typeof e?null!==e:"function"==typeof e}function L(e,t){switch(R(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(B(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(!B(i=n.call(e)))return i;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!B(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=L(e,3);return U(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(R(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(!B(n))throw new TypeError;return n}function $(e){return e.value}function Q(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)}()}(nt||(nt={}));var ut=Object.prototype.toString;var ct="[object Null]",lt="[object Undefined]";function dt(e){return null==e?void 0===e?lt:ct:function(e){return ut.call(e)}(e)}function pt(e){return null!=e&&"object"==typeof e}var ft={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||pt(e)&&"[object Number]"==dt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return pt(e)&&"[object RegExp]"==dt(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 ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mt(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 vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(e)}function yt(e){return vt(e)}function gt(e,t,n){return gt="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=yt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},gt(e,t,n)}function _t(e,t,n){return gt(e,t,n)}function wt(e,t){return wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wt(e,t)}function bt(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&&wt(e,t)}function Tt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(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=yt(e);if(t){var i=yt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==at(t)&&"function"!=typeof t?Tt(e):t}(this,n)}}var St=function(e,t){return e(t={exports:{}},t.exports),t.exports
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["zmp-sdk"]={})}(this,(function(e){"use strict";function t(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var n,r=1048576,i=window.zAppID,o=window.APP_ID,a="https://zalo.me/s",s="https://h5.zdn.vn/zapps",u="h5.zdn.vn",c="/zapps",l={ZOAUTH:"h5.zdn.vn_zoauth",ZACC_SESSION:"h5.zdn.vn_zacc_session",JS_TOKEN:"h5.zdn.vn_zlink3rd",ZOAUTH_VRF:"h5.zdn.vn_zoauth_vrf",DEVICE_ID:"h5.zdn.vn_deviceID",CONTEXT_ID:"h5.zdn.vn_contextID",CONTEXT_TYPE:"h5.zdn.vn_contextType",UTOKEN_ZPI:"h5.zdn.vn_utoken_zpi",GTOKEN_ZPI:"h5.zdn.vn_gtoken_zpi",ZPP_ZPI:"h5.zdn.vn_zpp_zpi",ZPT_ZPI:"h5.zdn.vn_zpt_zpi"},d={GET_USER_INFO:"https://graph.zalo.me/v2.0/me",GET_ACCESS_TOKEN:"https://h5.zalo.me/openapi/access_token",GET_ACCESS_TOKEN_V3:"https://oauth.zaloapp.com/v3/access_token",GET_LIST_USER_INFO:"https://graph.zalo.me/v2.0/me/friends/list",CREATE_ORDER:"https://payment-mini.zalo.me/api/order/create",GET_APP_INFO:"https://h5.zalo.me/apps/get-info",SEND_ACTION_LOG:"https://h5.zalo.me/log/async",CREATE_SHARE_LINK:"https://h5.zalo.me/openapi/create-sharelink",CHECK_INTERACT_OA:"https://h5.zalo.me/openapi/check-interact-oa",GET_AUTH_SETTING:"https://h5.zalo.me/apis/users/auth-settings"};!function(e){e.REQUEST="REQUEST",e.MODIFIED_REQUEST="MODIFIED_REQUEST",e.RESPONSE="RESPONSE",e.MODIFIED_RESPONSE="MODIFIED_RESPONSE",e.NOT_FOUND="NOT_FOUND"}(n||(n={}));var p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,k,I,C,N,M,x,R=0,D=-2e3,j=-1400,U=-1500,B=-1401,L=-1404,Z=-1408,z=-2004,W=-2005,F="Success",G="Unknown error. Please try again later.",H="Request timeout. Please try again later.",V="Please login (https://miniapp.zalo.me/docs/api/login) before to call this api",K="Login failed",J="This API is not supported in this version of Zalo",q="User Authentication Required. Please grant User Authentication permission before requesting User Permission",$="Unable to pick media",Q="Unable to save image",Y={SUCCESS:{code:R,message:F},UNKNOWN_ERROR:{code:D,message:G},UNAUTHORIZED:{code:B,message:V},FORBIDDEN:{code:-1403,message:"You don't have permission to call this api"},CLIENT_NOT_SUPPORT:{code:L,message:J},DECODE_FAILED:{code:-2001,message:"Can not decode id. Please check your params again."},TIME_OUT:{code:Z,message:H},USER_DENIED:{code:-2002,message:"User denied"},USER_CANCEL:{code:-2003,message:"User cancel"}},X={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},UNFOLLOW_OA:{haveCallback:!0,requireAccessToken:!0},OPEN_GAMEDETAIL:{},OPEN_SHARESHEET:{haveCallback:!0,requireAccessToken:!0,errorList:{android:{"-101":{mapTo:Y.CLIENT_NOT_SUPPORT}},iOS:{"-101":{mapTo:Y.CLIENT_NOT_SUPPORT}}}},REQUEST_PERMISSION_CAMERA:{errorList:{android:{"-2":{mapTo:Y.USER_DENIED}},iOS:{"-2":{mapTo:Y.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:Y.USER_DENIED}},iOS:{"-1":{mapTo:Y.USER_DENIED}}}},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:W,message:Q},needMoreDetail:!0},"-102":{mapTo:{code:W,message:Q},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:W,message:Q},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:Y.USER_DENIED},"-101":{mapTo:Y.USER_DENIED}},iOS:{"-1":{mapTo:Y.USER_DENIED},"-10":{mapTo:Y.USER_DENIED}}}},MP_OPEN_PROFILE_PICKER:{requireAccessToken:!0,versionLive:{iOS:432},errorList:{android:{"-101":{mapTo:Y.USER_CANCEL}},iOS:{"-101":{mapTo:Y.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:Y.USER_CANCEL},999:{mapTo:{code:z,message:$},needMoreDetail:!0}},iOS:{"-10":{mapTo:{code:z,message:$}}}}},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:Y.USER_DENIED}},iOS:{"-1":{mapTo:Y.USER_DENIED}}}},MP_ADD_RATING:{skipJump:!1},MP_ADD_MYFAVORITES:{skipJump:!1},MP_INTERACT_OA:{skipJump:!1},MP_USER_AUTHORIZE:{skipJump:!1},MP_SELECT_PAYMENT_METHOD:{skipJump:!1}},ee={android:{"-4":Y.DECODE_FAILED,"-5":Y.CLIENT_NOT_SUPPORT,"-14":Y.TIME_OUT},iOS:{"-9":Y.DECODE_FAILED,"-5":Y.CLIENT_NOT_SUPPORT,"-14":Y.TIME_OUT}},te={android:12100615,iOS:460,wp:0,unknown:0},ne=5*r,re="https://payment-mini.zalo.me/api/order/create",ie="https://payment-mini.zalo.me/api/order/iap-create",oe="https://payment-mini.zalo.me/api/transaction",ae="DEFERRED",se="IMMEDIATE_AND_CHARGE_FULL_PRICE",ue={SHOW_BACK:0,HIDE_BACK:3,SHOW_HOME:1,HIDE_HOME:0},ce=5,le=6,de="#1843EF",pe=0,fe={"-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 he(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function me(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){he(o,r,i,a,s,"next",e)}function s(e){he(o,r,i,a,s,"throw",e)}a(void 0)}))}}function ve(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 ye(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ge(e,t){if(e){if("string"==typeof e)return ve(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)?ve(e,t):void 0}}function _e(e){return function(e){if(Array.isArray(e))return ve(e)}(e)||ye(e)||ge(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 we(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 be(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,_e(n))}catch(e){return"undefined"!=typeof console&&console.error&&console.error(e),null}}}function Te(e){var t=new URL(window.location.href).searchParams.get("env");return{isMp:window.location.hostname.includes(u)&&("TESTING_LOCAL"==t||window.location.pathname.startsWith(c)),isMpWeb:window.location.hostname.includes("localhost")}}be.async=function(e){return me((function(){var t,n,r,i,o=arguments;return we(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,_e(n))];case 2:return[2,a.sent()];case 3:return i=a.sent(),"undefined"!=typeof console&&console.error&&console.error(i),[2,null];case 4:return[2]}}))}))},e.NetworkType=void 0,(p=e.NetworkType||(e.NetworkType={})).none="none",p.wifi="wifi",p.cellular="cellular",p.unknown="unknown",e.PlatformType=void 0,(f=e.PlatformType||(e.PlatformType={})).wp="wp",f.android="android",f.iOS="iOS",f.unknown="unknown",e.Events=void 0,(h=e.Events||(e.Events={})).AppPaused="h5.event.paused",h.AppResumed="h5.event.resumed",h.NetworkChanged="h5.event.connection.changed",h.OnDataCallback="h5.event.webview.result",h.WebviewClosed="h5.event.webview.close",h.OpenApp="h5.event.open.mp",h.AppClose="h5.event.action.close",h.PaymentCallback="payment.callback",h.PaymentResult="action.payment.result",h.PaymentClose="action.payment.close",e.JumpStatus=void 0,(m=e.JumpStatus||(e.JumpStatus={})).DOING="doing",m.DONE="done",e.ProfileType=void 0,(v=e.ProfileType||(e.ProfileType={}))[v.user=1]="user",v[v.oa=0]="oa",v[v.aliasOA=2]="aliasOA",e.ChatType=void 0,(y=e.ChatType||(e.ChatType={}))[y.user=1]="user",y[y.oa=0]="oa",e.PostFeedType=void 0,(g=e.PostFeedType||(e.PostFeedType={}))[g.image=1]="image",g[g.link=4]="link",g[g.profile=5]="profile",e.ShareSheetType=void 0,(_=e.ShareSheetType||(e.ShareSheetType={}))[_.image=1]="image",_[_.gif=11]="gif",_[_.video=12]="video",_[_.link=4]="link",_[_.oa=5]="oa",_[_.zmp=20]="zmp",_[_.multi_image=21]="multi_image",_[_.zmp_deep_link=4]="zmp_deep_link",_[_.text=22]="text",e.OrientationType=void 0,(w=e.OrientationType||(e.OrientationType={}))[w.auto=1]="auto",w[w.portrait=2]="portrait",w[w.landscape=3]="landscape",e.VibrateType=void 0,(b=e.VibrateType||(e.VibrateType={}))[b.oneShot=0]="oneShot",e.MediaPickerType=void 0,(T=e.MediaPickerType||(e.MediaPickerType={}))[T.zcamera=3]="zcamera",T[T.zcamera_photo=1]="zcamera_photo",T[T.zcamera_video=2]="zcamera_video",T[T.zcamera_scan=7]="zcamera_scan",T[T.photo=4]="photo",T[T.video=5]="video",T[T.file=6]="file",e.IAPPayType=void 0,(E=e.IAPPayType||(e.IAPPayType={})).SUBSCRIPTION="SUBSCRIPTION",E.ONETIME="ONETIME",e.ProrationMode=void 0,(S=e.ProrationMode||(e.ProrationMode={}))[S.UNKNOW=0]="UNKNOW",S[S.DEFERRED=1]="DEFERRED",S[S.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE",e.StatusBarType=void 0,(P=e.StatusBarType||(e.StatusBarType={}))[P.normal=1]="normal",P[P.hidden=0]="hidden",P[P.transparent=2]="transparent",e.AndroidBottomNavigationBarType=void 0,(O=e.AndroidBottomNavigationBarType||(e.AndroidBottomNavigationBarType={}))[O.show=1]="show",O[O.hide=0]="hide",e.IOSSafeAreaBottomType=void 0,(A=e.IOSSafeAreaBottomType||(e.IOSSafeAreaBottomType={}))[A.show=1]="show",A[A.hide=0]="hide",e.TextAlignType=void 0,(k=e.TextAlignType||(e.TextAlignType={}))[k.left=0]="left",k[k.center=1]="center",e.CameraEvents=void 0,(I=e.CameraEvents||(e.CameraEvents={})).OnFrameCallback="h5.event.camera.frame",I.OnStartCallback="h5.event.camera.start",I.OnStopCallback="h5.event.camera.stop",e.FacingMode=void 0,(C=e.FacingMode||(e.FacingMode={})).FRONT="user",C.BACK="environment",e.PhotoFormat=void 0,(N=e.PhotoFormat||(e.PhotoFormat={})).WEBP="image/webp",N.PNG="image/png",N.JPEG="image/jpeg",e.PhotoQuality=void 0,(M=e.PhotoQuality||(e.PhotoQuality={})).HIGH="high",M.NORMAL="normal",M.LOW="low",e.StreamType=void 0,(x=e.StreamType||(e.StreamType={})).VIDEO="video",x.AUDIO="audio";var Ee,Se=function(t){return t.isAndroid?e.PlatformType.android:t.isIOS?e.PlatformType.iOS:e.PlatformType.unknown};function Pe(e){var t=e.split("zalo")[1];return t&&t.replace(" ","").split("/")[1]||""}function Oe(){var e=function(){var e=be((function(){return window.navigator.userAgent.toLowerCase()}))();if(e){var t=function(e){return{isAndroid:/android/i.test(e)&&!/iemobile/.test(e),isIOS:/iphone|ios|ipad|ipod/.test(e)&&!/iemobile/.test(e),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(e),isZalo:/zalo/.test(e)}}(e);return{appEnv:Te(),platform:t,platformName:Se(t),zaloVersion:Pe(e).trim()}}}();if(e)return e}var Ae=(null===(Ee=Oe())||void 0===Ee?void 0:Ee.appEnv)||{};function ke(e){ke.on&&ke.engine(e)}ke.on=!1,ke.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 Ie=function(e,t){var r,i={error:-1404,errorMessage:"".concat(e," is not found")};null==t||null===(r=t.fail)||void 0===r||r.call(t,i),ke({stage:n.NOT_FOUND,type:"error",name:e,request:t,state:"fail",response:i})};function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(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){Ce(e,t,n[t])}))}return e}function Me(e,t){return function(e){if(Array.isArray(e))return e}(e)||ye(e)||ge(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 xe="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Re(){throw new Error("setTimeout has not been defined")}function De(){throw new Error("clearTimeout has not been defined")}var je=Re,Ue=De;function Be(e){if(je===setTimeout)return setTimeout(e,0);if((je===Re||!je)&&setTimeout)return je=setTimeout,setTimeout(e,0);try{return je(e,0)}catch(t){try{return je.call(null,e,0)}catch(t){return je.call(this,e,0)}}}"function"==typeof xe.setTimeout&&(je=setTimeout),"function"==typeof xe.clearTimeout&&(Ue=clearTimeout);var Le,Ze=[],ze=!1,We=-1;function Fe(){ze&&Le&&(ze=!1,Le.length?Ze=Le.concat(Ze):We=-1,Ze.length&&Ge())}function Ge(){if(!ze){var e=Be(Fe);ze=!0;for(var t=Ze.length;t;){for(Le=Ze,Ze=[];++We<t;)Le&&Le[We].run();We=-1,t=Ze.length}Le=null,ze=!1,function(e){if(Ue===clearTimeout)return clearTimeout(e);if((Ue===De||!Ue)&&clearTimeout)return Ue=clearTimeout,clearTimeout(e);try{Ue(e)}catch(t){try{return Ue.call(null,e)}catch(t){return Ue.call(this,e)}}}(e)}}function He(e,t){this.fun=e,this.array=t}He.prototype.run=function(){this.fun.apply(null,this.array)};function Ve(){}var Ke=Ve,Je=Ve,qe=Ve,$e=Ve,Qe=Ve,Ye=Ve,Xe=Ve;var et=xe.performance||{},tt=et.now||et.mozNow||et.msNow||et.oNow||et.webkitNow||function(){return(new Date).getTime()};var nt=new Date;var rt,it={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];Ze.push(new He(e,t)),1!==Ze.length||ze||Be(Ge)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ke,addListener:Je,once:qe,off:$e,removeListener:Qe,removeAllListeners:Ye,emit:Xe,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*tt.call(et),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-nt)/1e3}},ot=it,at="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function st(e){return e&&e.constructor===Symbol?"symbol":typeof e}function ut(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 at?at:"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 ot&&ot.env&&"true"===ot.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,f=new(l||"function"!=typeof WeakMap?ne():WeakMap);function h(e,t,n,r){if(D(n)){if(!G(e))throw new TypeError;if(!V(t))throw new TypeError;return S(e,t)}if(!G(e))throw new TypeError;if(!B(t))throw new TypeError;if(!B(r)&&!D(r)&&!j(r))throw new TypeError;return j(r)&&(r=void 0),P(e,t,n=F(n),r)}function m(e,t){function n(n,r){if(!B(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(!B(n))throw new TypeError;return D(r)||(r=F(r)),N(e,t,n,r)}function y(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),A(e,t,n)}function g(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),k(e,t,n)}function _(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),I(e,t,n)}function w(e,t,n){if(!B(t))throw new TypeError;return D(n)||(n=F(n)),C(e,t,n)}function b(e,t){if(!B(e))throw new TypeError;return D(t)||(t=F(t)),M(e,t)}function T(e,t){if(!B(e))throw new TypeError;return D(t)||(t=F(t)),x(e,t)}function E(e,t,n){if(!B(t))throw new TypeError;D(n)||(n=F(n));var r=O(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)&&!j(r)){if(!V(r))throw new TypeError;t=r}}return t}function P(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!D(o)&&!j(o)){if(!B(o))throw new TypeError;r=o}}return r}function O(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(k(e,t,n))return!0;var r=X(t);return!j(r)&&A(e,r,n)}function k(e,t,n){var r=O(t,n,!1);return!D(r)&&z(r.has(e))}function I(e,t,n){if(k(e,t,n))return C(e,t,n);var r=X(t);return j(r)?void 0:I(e,r,n)}function C(e,t,n){var r=O(t,n,!1);if(!D(r))return r.get(e)}function N(e,t,n,r){O(n,r,!0).set(e,t)}function M(e,t){var n=x(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 x(e,t){var n=[],r=O(e,t,!1);if(D(r))return n;for(var i=q(r.keys()),o=0;;){var a=Q(i);if(!a)return n.length=o,n;var s=$(a);try{n[o]=s}catch(e){try{Y(i)}finally{throw e}}o++}}function R(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 j(e){return null===e}function U(e){return"symbol"==typeof e}function B(e){return"object"==typeof e?null!==e:"function"==typeof e}function L(e,t){switch(R(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(B(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(!B(i=n.call(e)))return i;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i}else{var r;if(H(r=e.valueOf))if(!B(i=r.call(e)))return i;var i,o=e.toString;if(H(o))if(!B(i=o.call(e)))return i}throw new TypeError}function z(e){return!!e}function W(e){return""+e}function F(e){var t=L(e,3);return U(t)?t:W(t)}function G(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function H(e){return"function"==typeof e}function V(e){return"function"==typeof e}function K(e){switch(R(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(!B(n))throw new TypeError;return n}function $(e){return e.value}function Q(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)}()}(rt||(rt={}));var ct=Object.prototype.toString;var lt="[object Null]",dt="[object Undefined]";function pt(e){return null==e?void 0===e?dt:lt:function(e){return ct.call(e)}(e)}function ft(e){return null!=e&&"object"==typeof e}var ht={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||ft(e)&&"[object Number]"==pt(e)},isArray:function(e){return Array.isArray(e)},isRegExp:function(e){return ft(e)&&"[object RegExp]"==pt(e)},get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=function(n){return String.prototype.split.call(t,n).filter(Boolean).reduce((function(e,t){return null!=e?e[t]:e}),e)},i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===i||i===e?n:i},isPromise:function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}};function mt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vt(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 yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yt(e)}function gt(e){return yt(e)}function _t(e,t,n){return _t="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=gt(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n||e):i.value}},_t(e,t,n)}function wt(e,t,n){return _t(e,t,n)}function bt(e,t){return bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},bt(e,t)}function Tt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bt(e,t)}function Et(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function St(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=gt(e);if(t){var i=gt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==st(t)&&"function"!=typeof t?Et(e):t}(this,n)}}var Pt=function(e,t){return e(t={exports:{}},t.exports),t.exports
11
11
  /*! *****************************************************************************
12
12
  Copyright (C) Microsoft. All rights reserved.
13
13
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -21,4 +21,4 @@
21
21
 
22
22
  See the Apache Version 2.0 License for specific language governing permissions
23
23
  and limitations under the License.
24
- ***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})),Pt="ACTION_CALLBACK";var Ot=function(t){bt(r,t);var n=Et(r);function r(){var e;return ht(this,r),(e=n.apply(this,arguments)).debug=st("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Pt||t===e.Events.PaymentCallback)return _t(yt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return _t(yt(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Pt)return _t(yt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return _t(yt(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(St);function At(e){Ot.getInstance().emit(Pt,e)}function It(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){At({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=st("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=rn(r);i("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a);Ot.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){Ot.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var kt={encode:It,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:It(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":at(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":at(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Ct={},Nt=function(e,t,n){var r=t||"default";return function(){return(r in Ct?Ct[r](e,n):e).apply(this,arguments)}};Nt.setWrapper=function(e){Ct[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var Mt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function xt(e){try{return null===e?Mt:JSON.parse(e)}catch(e){return Mt}}var Rt,Dt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=kt.encode(n);"post"!=t&&(e=kt.appendToUrl(e,i),i="");var o=function(e,t){if(!self.XMLHttpRequest)return null;var n=new XMLHttpRequest,r=function(){};if(!("withCredentials"in n))return null;n.open(e,t,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded");var i={send:function(e){n.send(e)}},o=Nt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Nt((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(xt(e.responseText))},o.onerror=function(e){e.responseText?r(xt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},jt=Dt,Ut=(Rt=he((function(e,t,n){var r,i,o,a;return _e(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},ft.isUndefined(n)||(r.currentVersion=n),i=kt.appendToUrl(d.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Rt.apply(this,arguments)});function Bt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));jt.execute(d.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 Lt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},Zt=function(){var e,t,n=Number((null===(e=Pe())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Pe())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function zt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Wt,Ft,Gt=function(){function e(t,n,r,i){ht(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}(),Ht=function(e,t){return zt(e,Gt)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return zt(e,Error)?new Gt(D,e.message,t).toJSON():ft.isEmpty(null==e?void 0:e.message)||ft.isEmpty(null==e?void 0:e.code)?new Gt(D,G,t,e).toJSON():new Gt(e.code,e.message,t,e.detail).toJSON()}(e,t)},Vt=(Wt=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(d.GET_AUTH_SETTING,Ce({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Wt.apply(this,arguments)}),Kt=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,Xt.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=Xt.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Gt(B,V,"getSetting")),[4,Vt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Gt(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)}}())]}))})),Jt=function(){var t,n,r,i=Pe(),o={},a=Ot.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=on(e.result),r=cn(null==n?void 0:n.action),i=ft.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=ft.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var d=o[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?ft.isFunction(r)&&r(e):ft.isFunction(i)&&i(e)}(l,p),!h&&delete o[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){}s.push(v)}},Ot.getInstance().on(Pt,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],Bt(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],Bt(e)}}),5e3),u=!0),r=he((function(e,t,n,r){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A;return _e(this,(function(I){switch(I.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,d=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),p=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=ln(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(o[u].timeout=setTimeout((function(){return At({serialId:u,result:{error_code:Z,error_message:H,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,Kt()]:[3,2];case 1:if(!1===(null==(y=I.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return At({serialId:u,result:{error_code:B,error_message:q,data:{isMobile:null==i||null===(g=i.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];I.label=2;case 2:return _=cn(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||ft.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!nn(e)||_&&!1===_.isSupported?(At({serialId:u,result:{error_code:L,error_message:J,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=tn(t),f?[3,4]:[4,Xt.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,Xt.getAccessToken()];case 7:return P=I.sent(),[3,9];case 8:P="",I.label=9;case 9:return S=P,[3,11];case 10:return O=I.sent(),At({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=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,S,b,A)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),qt={success:function(e,t){return{code:R,message:t||F,data:e||{}}},error:{badRequest:function(e){return new Gt(j,e)},loginFailed:function(e){return new Gt(B,"".concat(K,": ").concat(e))},loginRequired:function(){return new Gt(B,V)},cannotGetShareInfo:function(){return new Gt(U,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(pe).find((function(t){return t===e.toString()}));return new Gt(e,t||G)},clientNotSupport:function(){return new Gt(L,J)}}},$t=(Ft=function(t){var n,r,i,o=null===(n=Pe())||void 0===n?void 0:n.platformName,a=t.action.replace("action.","").replace(/\./g,"_").toUpperCase(),s=X[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new Gt(D,"Can not get auth code: ".concat(t.error_message));if(Xt.jumpStatus!==e.JumpStatus.DONE&&!u)return new Gt(Y.UNAUTHORIZED.code,Y.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new Gt(Y.FORBIDDEN.code,Y.FORBIDDEN.message);if(o&&(null===(r=ee[o])||void 0===r?void 0:r[t.error_code]))return new Gt(ee[o][t.error_code].code,ee[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;return(null==l?void 0:l.needMoreDetail)&&(h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message)),new Gt(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new Gt(t.error_code,t.error_message)},function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=ft.isEmpty(t)?void 0:t[r];if(o)return Ae({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Ft(i):null==i?void 0:i.data)}}return ft.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=X[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){Jt(e,t,o,Ce({},i,a))}),s)}),Qt=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){ft.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Yt=function(){function t(){ht(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={}}var r,a,u,c=t.prototype;return c.jump=function(){var t=this;return he((function(){return _e(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,Ae({stage:n.REQUEST,type:"log",name:"jump"}),Jt("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||Bt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){Bt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return he((function(){var i;return _e(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=he((function(e){var t,n,i;return _e(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return he((function(){var i,o;return _e(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),ft.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,Ce({method:"POST",body:i},o)).then(function(){var e=he((function(e){var t,n,i,o;return _e(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return he((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(a.getAccessTokenCount<=1||a._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return _e(this,(function(m){switch(m.label){case 0:return r=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(a=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken||t._accessToken.length>0&&r<t.accessTokenExpiresIn&&(null===(n=t._miniProgramConfig)||void 0===n?void 0:n.userAuthorized)?(a.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 3:return s=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 4:return u=m.sent(),c="zmp.getaccesstoken.fail",e?[4,t.verifyUserAuthorized()]:[3,6];case 5:return d=m.sent(),[3,7];case 6:d=!0,m.label=7;case 7:if(!d)throw a.getAccessTokenCount--,Bt([{action:c,error:-104,message:"no user auth",data:{}}]),qt.error.loginFailed("User Authentication Required");if(!s)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),u?[4,t.loginZaloV4(o,s,u)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,s)];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),Bt([{action:c,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Bt([{action:c,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject(qt.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw a.getAccessTokenCount--,Bt([{action:c,error:-102,message:"no oauth",data:{}}]),qt.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return he((function(){var t,n,r,i,o,a;return _e(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=cn("action.mp.user.authorize"))&&r.isSupported?[4,Kt()]:[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,Qt()];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]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return he((function(){var t;return _e(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=he((function(i){var o,a,s,u;return _e(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?ft.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&mt(r.prototype,a),u&&mt(r,u),t}(),Xt=Yt.getInstance(),en=st("zmp:utils:common"),tn=function(e){if(ft.isObject(JSON)&&JSON.stringify)return JSON.stringify(e);if(void 0===e)return"undefined";if(null===e)return"null";try{if("string"==typeof e||null!==e.constructor.toString().match(/string/i))return'"'+e.replace(/"/g,'\\"')+'"'}catch(e){console.log(e)}var t;if(null!==Object.prototype.toString.call(e).match(/array/i)){t=[];for(var n=e.length,r=0;r<n;r++)t.push(tn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+tn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},nn=function(e){var t,n,r=X[e],i=(null===(t=Pe())||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},rn=function(e){try{if(e){en(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return en("formattedValue",t,JSON.parse(t),at(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return en("parse json error:",t),e}},on=function(e){if(ft.isObject(JSON)&&JSON.parse&&ft.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 ft.isObject(e)?e:new Function("return "+e)()},an=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""},sn=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var un=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},cn=function(e){if(void 0!==e){var t=Xt.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},ln=function(e){if(void 0===e)return!1;var t=Xt.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},dn=function(){var e=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n;return _e(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Xt.jumpAndGetToken()];case 1:return t.sent(),n=Xt.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)}}();function pn(e,t,n,r){var i,o,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=qt.error.badRequest(s);throw c.detail=a,Ht(c,e)}u.push(i.data)}));var c=r.apply(void 0,ge(u));return ft.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!ft.isNull(a)&&ft.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Ht(t,e);if(!ft.isNull(s)&&ft.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!ft.isNull(s)&&ft.isFunction(s))return s(t);throw Ht(t,e)}}function fn(e){return hn.apply(this,arguments)}function hn(){return(hn=he((function(e){return _e(this,(function(t){return[2,pn("login",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Xt.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("login",{}))]}}))})))]}))}))).apply(this,arguments)}function mn(e){return vn.apply(this,arguments)}function vn(){return(vn=he((function(e){return _e(this,(function(t){return[2,pn("getAccessToken",[],[e],he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,dn()]:[3,3];case 1:return e=!t.sent(),[4,Xt.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Oe.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var yn,gn="2.39.6";function _n(){return pn("getVersion",[],[],(function(){return gn}))}function wn(){var e,t;return{version:an("version-id")||"",apiVersion:gn,zaloVersion:(null===(e=Pe())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Pe())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function bn(){return pn("getSystemInfo",[],[],(function(){return wn()}))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(yn||(yn={}));const Tn=yn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),En=e=>{switch(typeof e){case"undefined":return Tn.undefined;case"string":return Tn.string;case"number":return isNaN(e)?Tn.nan:Tn.number;case"boolean":return Tn.boolean;case"function":return Tn.function;case"bigint":return Tn.bigint;case"symbol":return Tn.symbol;case"object":return Array.isArray(e)?Tn.array:null===e?Tn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Tn.promise:"undefined"!=typeof Map&&e instanceof Map?Tn.map:"undefined"!=typeof Set&&e instanceof Set?Tn.set:"undefined"!=typeof Date&&e instanceof Date?Tn.date:Tn.object;default:return Tn.unknown}},Sn=yn.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 Pn 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,yn.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()}}Pn.create=e=>new Pn(e);const On=(e,t)=>{let n;switch(e.code){case Sn.invalid_type:n=e.received===Tn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Sn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,yn.jsonStringifyReplacer)}`;break;case Sn.unrecognized_keys:n=`Unrecognized key(s) in object: ${yn.joinValues(e.keys,", ")}`;break;case Sn.invalid_union:n="Invalid input";break;case Sn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${yn.joinValues(e.options)}`;break;case Sn.invalid_enum_value:n=`Invalid enum value. Expected ${yn.joinValues(e.options)}, received '${e.received}'`;break;case Sn.invalid_arguments:n="Invalid function arguments";break;case Sn.invalid_return_type:n="Invalid function return type";break;case Sn.invalid_date:n="Invalid date";break;case Sn.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}"`:yn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Sn.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 Sn.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 Sn.custom:n="Invalid input";break;case Sn.invalid_intersection_types:n="Intersection results could not be merged";break;case Sn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Sn.not_finite:n="Number must be finite";break;default:n=t.defaultError,yn.assertNever(e)}return{message:n}};let An=On;function In(){return An}const kn=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 Cn(e,t){const n=kn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,In(),On].filter((e=>!!e))});e.common.issues.push(n)}class Nn{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 Mn;"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 Nn.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 Mn;if("aborted"===i.status)return Mn;"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 Mn=Object.freeze({status:"aborted"}),xn=e=>({status:"dirty",value:e}),Rn=e=>({status:"valid",value:e}),Dn=e=>"aborted"===e.status,jn=e=>"dirty"===e.status,Un=e=>"valid"===e.status,Bn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Ln;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Ln||(Ln={}));class Zn{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 zn=(e,t)=>{if(Un(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 Pn(e.common.issues)}};function Wn(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 Fn{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 En(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:En(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Nn,ctx:{common:e.parent.common,data:e.data,parsedType:En(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Bn(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:En(e)},i=this._parseSync({data:e,path:r.path,parent:r});return zn(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:En(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Bn(r)?r:Promise.resolve(r));return zn(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:Sn.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 Ar({schema:this,typeName:Br.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ir.create(this,this._def)}nullable(){return kr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sr.create(this,this._def)}promise(){return Or.create(this,this._def)}or(e){return dr.create([this,e],this._def)}and(e){return mr.create(this,e,this._def)}transform(e){return new Ar({...Wn(this._def),schema:this,typeName:Br.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Cr({...Wn(this._def),innerType:this,defaultValue:t,typeName:Br.ZodDefault})}brand(){return new Rr({typeName:Br.ZodBranded,type:this,...Wn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Nr({...Wn(this._def),innerType:this,catchValue:t,typeName:Br.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Dr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Gn=/^c[^\s-]{8,}$/i,Hn=/^[a-z][a-z0-9]*$/,Vn=/^([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,Kn=/^(([^<>()[\]\\.,;:\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 Jn extends Fn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Sn.invalid_string,...Ln.errToObj(n)}),this.nonempty=e=>this.min(1,Ln.errToObj(e)),this.trim=()=>new Jn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==Tn.string){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.string,received:t.parsedType}),Mn}const t=new Nn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Cn(n,{code:Sn.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),Cn(n,{code:Sn.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?Cn(n,{code:Sn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Cn(n,{code:Sn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Kn.test(e.data)||(n=this._getOrReturnCtx(e,n),Cn(n,{validation:"email",code:Sn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Vn.test(e.data)||(n=this._getOrReturnCtx(e,n),Cn(n,{validation:"uuid",code:Sn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Gn.test(e.data)||(n=this._getOrReturnCtx(e,n),Cn(n,{validation:"cuid",code:Sn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Hn.test(e.data)||(n=this._getOrReturnCtx(e,n),Cn(n,{validation:"cuid2",code:Sn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Cn(n,{validation:"url",code:Sn.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),Cn(n,{validation:"regex",code:Sn.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),Cn(n,{code:Sn.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),Cn(n,{code:Sn.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),Cn(n,{code:Sn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else yn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new Jn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ln.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ln.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ln.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ln.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ln.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,...Ln.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ln.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ln.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ln.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ln.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ln.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ln.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 qn(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)}Jn.create=e=>{var t;return new Jn({checks:[],typeName:Br.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Wn(e)})};class $n extends Fn{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)!==Tn.number){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.number,received:t.parsedType}),Mn}let t;const n=new Nn;for(const r of this._def.checks)if("int"===r.kind)yn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Cn(t,{code:Sn.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),Cn(t,{code:Sn.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),Cn(t,{code:Sn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==qn(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Cn(t,{code:Sn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Cn(t,{code:Sn.not_finite,message:r.message}),n.dirty()):yn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ln.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ln.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ln.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ln.toString(t))}setLimit(e,t,n,r){return new $n({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ln.toString(r)}]})}_addCheck(e){return new $n({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ln.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ln.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ln.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ln.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ln.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ln.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ln.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&&yn.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)}}$n.create=e=>new $n({checks:[],typeName:Br.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Wn(e)});class Qn extends Fn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==Tn.bigint){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.bigint,received:t.parsedType}),Mn}return Rn(e.data)}}Qn.create=e=>{var t;return new Qn({typeName:Br.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Wn(e)})};class Yn extends Fn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==Tn.boolean){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.boolean,received:t.parsedType}),Mn}return Rn(e.data)}}Yn.create=e=>new Yn({typeName:Br.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Wn(e)});class Xn extends Fn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==Tn.date){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.date,received:t.parsedType}),Mn}if(isNaN(e.data.getTime())){return Cn(this._getOrReturnCtx(e),{code:Sn.invalid_date}),Mn}const t=new Nn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Cn(n,{code:Sn.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),Cn(n,{code:Sn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):yn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ln.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ln.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}}Xn.create=e=>new Xn({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Br.ZodDate,...Wn(e)});class er extends Fn{_parse(e){if(this._getType(e)!==Tn.symbol){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.symbol,received:t.parsedType}),Mn}return Rn(e.data)}}er.create=e=>new er({typeName:Br.ZodSymbol,...Wn(e)});class tr extends Fn{_parse(e){if(this._getType(e)!==Tn.undefined){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.undefined,received:t.parsedType}),Mn}return Rn(e.data)}}tr.create=e=>new tr({typeName:Br.ZodUndefined,...Wn(e)});class nr extends Fn{_parse(e){if(this._getType(e)!==Tn.null){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.null,received:t.parsedType}),Mn}return Rn(e.data)}}nr.create=e=>new nr({typeName:Br.ZodNull,...Wn(e)});class rr extends Fn{constructor(){super(...arguments),this._any=!0}_parse(e){return Rn(e.data)}}rr.create=e=>new rr({typeName:Br.ZodAny,...Wn(e)});class ir extends Fn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rn(e.data)}}ir.create=e=>new ir({typeName:Br.ZodUnknown,...Wn(e)});class or extends Fn{_parse(e){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.never,received:t.parsedType}),Mn}}or.create=e=>new or({typeName:Br.ZodNever,...Wn(e)});class ar extends Fn{_parse(e){if(this._getType(e)!==Tn.undefined){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.void,received:t.parsedType}),Mn}return Rn(e.data)}}ar.create=e=>new ar({typeName:Br.ZodVoid,...Wn(e)});class sr extends Fn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Tn.array)return Cn(t,{code:Sn.invalid_type,expected:Tn.array,received:t.parsedType}),Mn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Cn(t,{code:e?Sn.too_big:Sn.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&&(Cn(t,{code:Sn.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&&(Cn(t,{code:Sn.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 Zn(t,e,t.path,n))))).then((e=>Nn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new Zn(t,e,t.path,n))));return Nn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new sr({...this._def,minLength:{value:e,message:Ln.toString(t)}})}max(e,t){return new sr({...this._def,maxLength:{value:e,message:Ln.toString(t)}})}length(e,t){return new sr({...this._def,exactLength:{value:e,message:Ln.toString(t)}})}nonempty(e){return this.min(1,e)}}var ur;function cr(e){if(e instanceof lr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ir.create(cr(r))}return new lr({...e._def,shape:()=>t})}return e instanceof sr?sr.create(cr(e.element)):e instanceof Ir?Ir.create(cr(e.unwrap())):e instanceof kr?kr.create(cr(e.unwrap())):e instanceof vr?vr.create(e.items.map((e=>cr(e)))):e}sr.create=(e,t)=>new sr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Br.ZodArray,...Wn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(ur||(ur={}));class lr extends Fn{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=yn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Tn.object){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.object,received:t.parsedType}),Mn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof or&&"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 Zn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof or){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&&(Cn(n,{code:Sn.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 Zn(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=>Nn.mergeObjectSync(t,e))):Nn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Ln.errToObj,new lr({...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=Ln.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new lr({...this._def,unknownKeys:"strip"})}passthrough(){return new lr({...this._def,unknownKeys:"passthrough"})}extend(e){return new lr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new lr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>ur.mergeShapes(this._def.shape(),e._def.shape()),typeName:Br.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new lr({...this._def,catchall:e})}pick(e){const t={};return yn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new lr({...this._def,shape:()=>t})}omit(e){const t={};return yn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new lr({...this._def,shape:()=>t})}deepPartial(){return cr(this)}partial(e){const t={};return yn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new lr({...this._def,shape:()=>t})}required(e){const t={};return yn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ir;)e=e._def.innerType;t[n]=e}})),new lr({...this._def,shape:()=>t})}keyof(){return Er(yn.objectKeys(this.shape))}}lr.create=(e,t)=>new lr({shape:()=>e,unknownKeys:"strip",catchall:or.create(),typeName:Br.ZodObject,...Wn(t)}),lr.strictCreate=(e,t)=>new lr({shape:()=>e,unknownKeys:"strict",catchall:or.create(),typeName:Br.ZodObject,...Wn(t)}),lr.lazycreate=(e,t)=>new lr({shape:e,unknownKeys:"strip",catchall:or.create(),typeName:Br.ZodObject,...Wn(t)});class dr extends Fn{_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 Pn(e.ctx.common.issues)));return Cn(t,{code:Sn.invalid_union,unionErrors:n}),Mn}));{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 Pn(e)));return Cn(t,{code:Sn.invalid_union,unionErrors:i}),Mn}}get options(){return this._def.options}}dr.create=(e,t)=>new dr({options:e,typeName:Br.ZodUnion,...Wn(t)});const pr=e=>e instanceof br?pr(e.schema):e instanceof Ar?pr(e.innerType()):e instanceof Tr?[e.value]:e instanceof Sr?e.options:e instanceof Pr?Object.keys(e.enum):e instanceof Cr?pr(e._def.innerType):e instanceof tr?[void 0]:e instanceof nr?[null]:null;class fr extends Fn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Tn.object)return Cn(t,{code:Sn.invalid_type,expected:Tn.object,received:t.parsedType}),Mn;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}):(Cn(t,{code:Sn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Mn)}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=pr(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 fr({typeName:Br.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Wn(n)})}}function hr(e,t){const n=En(e),r=En(t);if(e===t)return{valid:!0,data:e};if(n===Tn.object&&r===Tn.object){const n=yn.objectKeys(t),r=yn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=hr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===Tn.array&&r===Tn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=hr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===Tn.date&&r===Tn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class mr extends Fn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Dn(e)||Dn(r))return Mn;const i=hr(e.value,r.value);return i.valid?((jn(e)||jn(r))&&t.dirty(),{status:t.value,value:i.data}):(Cn(n,{code:Sn.invalid_intersection_types}),Mn)};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}))}}mr.create=(e,t,n)=>new mr({left:e,right:t,typeName:Br.ZodIntersection,...Wn(n)});class vr extends Fn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Tn.array)return Cn(n,{code:Sn.invalid_type,expected:Tn.array,received:n.parsedType}),Mn;if(n.data.length<this._def.items.length)return Cn(n,{code:Sn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Mn;!this._def.rest&&n.data.length>this._def.items.length&&(Cn(n,{code:Sn.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 Zn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Nn.mergeArray(t,e))):Nn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new vr({...this._def,rest:e})}}vr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vr({items:e,typeName:Br.ZodTuple,rest:null,...Wn(t)})};class yr extends Fn{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!==Tn.object)return Cn(n,{code:Sn.invalid_type,expected:Tn.object,received:n.parsedType}),Mn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new Zn(n,e,n.path,e)),value:o._parse(new Zn(n,n.data[e],n.path,e))});return n.common.async?Nn.mergeObjectAsync(t,r):Nn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new yr(t instanceof Fn?{keyType:e,valueType:t,typeName:Br.ZodRecord,...Wn(n)}:{keyType:Jn.create(),valueType:e,typeName:Br.ZodRecord,...Wn(t)})}}class gr extends Fn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Tn.map)return Cn(n,{code:Sn.invalid_type,expected:Tn.map,received:n.parsedType}),Mn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new Zn(n,e,n.path,[o,"key"])),value:i._parse(new Zn(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 Mn;"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 Mn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}gr.create=(e,t,n)=>new gr({valueType:t,keyType:e,typeName:Br.ZodMap,...Wn(n)});class _r extends Fn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Tn.set)return Cn(n,{code:Sn.invalid_type,expected:Tn.set,received:n.parsedType}),Mn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Cn(n,{code:Sn.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&&(Cn(n,{code:Sn.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 Mn;"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 Zn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new _r({...this._def,minSize:{value:e,message:Ln.toString(t)}})}max(e,t){return new _r({...this._def,maxSize:{value:e,message:Ln.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_r.create=(e,t)=>new _r({valueType:e,minSize:null,maxSize:null,typeName:Br.ZodSet,...Wn(t)});class wr extends Fn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Tn.function)return Cn(t,{code:Sn.invalid_type,expected:Tn.function,received:t.parsedType}),Mn;function n(e,n){return kn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,In(),On].filter((e=>!!e)),issueData:{code:Sn.invalid_arguments,argumentsError:n}})}function r(e,n){return kn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,In(),On].filter((e=>!!e)),issueData:{code:Sn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Or?Rn((async(...e)=>{const t=new Pn([]),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}))})):Rn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new Pn([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new Pn([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new wr({...this._def,args:vr.create(e).rest(ir.create())})}returns(e){return new wr({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new wr({args:e||vr.create([]).rest(ir.create()),returns:t||ir.create(),typeName:Br.ZodFunction,...Wn(n)})}}class br extends Fn{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})}}br.create=(e,t)=>new br({getter:e,typeName:Br.ZodLazy,...Wn(t)});class Tr extends Fn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Cn(t,{received:t.data,code:Sn.invalid_literal,expected:this._def.value}),Mn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Er(e,t){return new Sr({values:e,typeName:Br.ZodEnum,...Wn(t)})}Tr.create=(e,t)=>new Tr({value:e,typeName:Br.ZodLiteral,...Wn(t)});class Sr extends Fn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Cn(t,{expected:yn.joinValues(n),received:t.parsedType,code:Sn.invalid_type}),Mn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Cn(t,{received:t.data,code:Sn.invalid_enum_value,options:n}),Mn}return Rn(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 Sr.create(e)}exclude(e){return Sr.create(this.options.filter((t=>!e.includes(t))))}}Sr.create=Er;class Pr extends Fn{_parse(e){const t=yn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Tn.string&&n.parsedType!==Tn.number){const e=yn.objectValues(t);return Cn(n,{expected:yn.joinValues(e),received:n.parsedType,code:Sn.invalid_type}),Mn}if(-1===t.indexOf(e.data)){const e=yn.objectValues(t);return Cn(n,{received:n.data,code:Sn.invalid_enum_value,options:e}),Mn}return Rn(e.data)}get enum(){return this._def.values}}Pr.create=(e,t)=>new Pr({values:e,typeName:Br.ZodNativeEnum,...Wn(t)});class Or extends Fn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Tn.promise&&!1===t.common.async)return Cn(t,{code:Sn.invalid_type,expected:Tn.promise,received:t.parsedType}),Mn;const n=t.parsedType===Tn.promise?t.data:Promise.resolve(t.data);return Rn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Or.create=(e,t)=>new Or({type:e,typeName:Br.ZodPromise,...Wn(t)});class Ar extends Fn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Br.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=>{Cn(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?Mn:("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?Mn:("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(!Un(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=>Un(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}yn.assertNever(r)}}Ar.create=(e,t,n)=>new Ar({schema:e,typeName:Br.ZodEffects,effect:t,...Wn(n)}),Ar.createWithPreprocess=(e,t,n)=>new Ar({schema:t,effect:{type:"preprocess",transform:e},typeName:Br.ZodEffects,...Wn(n)});class Ir extends Fn{_parse(e){return this._getType(e)===Tn.undefined?Rn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ir.create=(e,t)=>new Ir({innerType:e,typeName:Br.ZodOptional,...Wn(t)});class kr extends Fn{_parse(e){return this._getType(e)===Tn.null?Rn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}kr.create=(e,t)=>new kr({innerType:e,typeName:Br.ZodNullable,...Wn(t)});class Cr extends Fn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Tn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Cr.create=(e,t)=>new Cr({innerType:e,typeName:Br.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Wn(t)});class Nr extends Fn{_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 Bn(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}}Nr.create=(e,t)=>new Nr({innerType:e,typeName:Br.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Wn(t)});class Mr extends Fn{_parse(e){if(this._getType(e)!==Tn.nan){const t=this._getOrReturnCtx(e);return Cn(t,{code:Sn.invalid_type,expected:Tn.nan,received:t.parsedType}),Mn}return{status:"valid",value:e.data}}}Mr.create=e=>new Mr({typeName:Br.ZodNaN,...Wn(e)});const xr=Symbol("zod_brand");class Rr extends Fn{_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 Dr extends Fn{_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?Mn:"dirty"===e.status?(t.dirty(),xn(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?Mn:"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 Dr({in:e,out:t,typeName:Br.ZodPipeline})}}const jr=(e,t={},n)=>e?rr.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})}})):rr.create(),Ur={object:lr.lazycreate};var Br;!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"}(Br||(Br={}));const Lr=Jn.create,Zr=$n.create,zr=Mr.create,Wr=Qn.create,Fr=Yn.create,Gr=Xn.create,Hr=er.create,Vr=tr.create,Kr=nr.create,Jr=rr.create,qr=ir.create,$r=or.create,Qr=ar.create,Yr=sr.create,Xr=lr.create,ei=lr.strictCreate,ti=dr.create,ni=fr.create,ri=mr.create,ii=vr.create,oi=yr.create,ai=gr.create,si=_r.create,ui=wr.create,ci=br.create,li=Tr.create,di=Sr.create,pi=Pr.create,fi=Or.create,hi=Ar.create,mi=Ir.create,vi=kr.create,yi=Ar.createWithPreprocess,gi=Dr.create,_i={string:e=>Jn.create({...e,coerce:!0}),number:e=>$n.create({...e,coerce:!0}),boolean:e=>Yn.create({...e,coerce:!0}),bigint:e=>Qn.create({...e,coerce:!0}),date:e=>Xn.create({...e,coerce:!0})},wi=Mn;var bi=Object.freeze({__proto__:null,defaultErrorMap:On,setErrorMap:function(e){An=e},getErrorMap:In,makeIssue:kn,EMPTY_PATH:[],addIssueToContext:Cn,ParseStatus:Nn,INVALID:Mn,DIRTY:xn,OK:Rn,isAborted:Dn,isDirty:jn,isValid:Un,isAsync:Bn,get util(){return yn},ZodParsedType:Tn,getParsedType:En,ZodType:Fn,ZodString:Jn,ZodNumber:$n,ZodBigInt:Qn,ZodBoolean:Yn,ZodDate:Xn,ZodSymbol:er,ZodUndefined:tr,ZodNull:nr,ZodAny:rr,ZodUnknown:ir,ZodNever:or,ZodVoid:ar,ZodArray:sr,get objectUtil(){return ur},ZodObject:lr,ZodUnion:dr,ZodDiscriminatedUnion:fr,ZodIntersection:mr,ZodTuple:vr,ZodRecord:yr,ZodMap:gr,ZodSet:_r,ZodFunction:wr,ZodLazy:br,ZodLiteral:Tr,ZodEnum:Sr,ZodNativeEnum:Pr,ZodPromise:Or,ZodEffects:Ar,ZodTransformer:Ar,ZodOptional:Ir,ZodNullable:kr,ZodDefault:Cr,ZodCatch:Nr,ZodNaN:Mr,BRAND:xr,ZodBranded:Rr,ZodPipeline:Dr,custom:jr,Schema:Fn,ZodSchema:Fn,late:Ur,get ZodFirstPartyTypeKind(){return Br},coerce:_i,any:Jr,array:Yr,bigint:Wr,boolean:Fr,date:Gr,discriminatedUnion:ni,effect:hi,enum:di,function:ui,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>jr((t=>t instanceof e),t,!0),intersection:ri,lazy:ci,literal:li,map:ai,nan:zr,nativeEnum:pi,never:$r,null:Kr,nullable:vi,number:Zr,object:Xr,oboolean:()=>Fr().optional(),onumber:()=>Zr().optional(),optional:mi,ostring:()=>Lr().optional(),pipeline:gi,preprocess:yi,promise:fi,record:oi,set:si,strictObject:ei,string:Lr,symbol:Hr,transformer:hi,tuple:ii,undefined:Vr,union:ti,unknown:qr,void:Qr,NEVER:wi,ZodIssueCode:Sn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Pn}),Ti=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k;ht(this,t),this.initConfig=window.APP_CONFIG;var C=ft.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?ue:ce;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,x="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)?se.HIDE_BACK:se.SHOW_BACK,R="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)?se.SHOW_HOME:se.HIDE_HOME,D=new URL(location.href),j=un(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)?ce:ue);this.config={actionbarType:C,buttonType:x,statusbarType:j,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||le,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)||de,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return he((function(){var r,i;return _e(this,(function(o){return void 0===(void 0===e?"undefined":at(e))&&null===(void 0===e?"undefined":at(e))||(r="none"===e||"home"===e?se.HIDE_BACK:se.SHOW_BACK,i="home"===e||"both"===e?se.SHOW_HOME:se.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){$t("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ce({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return he((function(){var r,i,o;return _e(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Pe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();$t("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return he((function(){var r,i,o;return _e(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Pe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();$t("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return he((function(){var r;return _e(this,(function(i){return r=n.config,ft.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),ft.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),ft.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=ce:!1===t.hideActionBar&&(r.actionbarType=ue),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){$t("CHANGE_ACTIONBAR",Ce({},r),{success:function(){var o;n.config=Ce({},r);var a,s=null===(o=Pe())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===ce;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),Ei=Ti.getInstance(),Si=[Xr({title:Lr()}).optional()];function Pi(e){return Oi.apply(this,arguments)}function Oi(){return Oi=he((function(e){return _e(this,(function(t){return[2,pn("setNavigationBarTitle",Si,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ei.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Oi.apply(this,arguments)}var Ai=[Xr({color:Lr(),textColor:bi.enum(["black","white"]).optional(),statusBarColor:Lr().optional()}).optional()];function Ii(e){return ki.apply(this,arguments)}function ki(){return ki=he((function(e){return _e(this,(function(t){return[2,pn("setNavigationBarColor",Ai,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ei.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ki.apply(this,arguments)}var Ci=[Xr({type:bi.enum(["none","back","home","both"])}).optional()];function Ni(e){return Mi.apply(this,arguments)}function Mi(){return Mi=he((function(e){return _e(this,(function(t){return[2,pn("setNavigationBarLeftButton",Ci,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ei.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mi.apply(this,arguments)}function xi(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ri(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,xi(e,t,"get"))}function Di(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 ji(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,xi(e,t,"set"),n),n}var Ui,Bi,Li,Zi=new WeakMap,zi=new WeakMap,Wi=new WeakMap,Fi=function(){function e(t){ht(this,e),Di(this,Zi,{writable:!0,value:localStorage}),Di(this,zi,{writable:!0,value:void 0}),Di(this,Wi,{writable:!0,value:void 0}),ji(this,Wi,{keys:new Set,currentSize:0,limitSize:ne}),ji(this,zi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Ri(this,Zi)){if(e)if(t.split("_")[0]!==e)continue;Ri(this,Wi).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 Ri(this,zi)&&(e="".concat(Ri(this,zi),"_").concat(e)),Ri(this,Wi).keys.has(e)?Ri(this,Zi).getItem(e):null},t.set=function(e){var t=this;return he((function(){return _e(this,(function(n){return Object.entries(e).forEach((function(e){var n=Ne(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Ri(this,zi)&&(e="".concat(Ri(this,zi),"_").concat(e)),Ri(this,Zi).setItem(e,t),Ri(this,Wi).keys.add(e)},t.getInfo=function(){var e=this;return he((function(){return _e(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}(Ri(this,Zi),Ri(this,zi));return{currentSize:ft.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((ne/1024).toFixed(2))}},t.remove=function(e){var t=this;return he((function(){return _e(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Ri(this,zi)&&(e="".concat(Ri(this,zi),"_").concat(e)),Ri(this,Wi).keys.has(e)&&(Ri(this,Zi).removeItem(e),Ri(this,Wi).keys.delete(e))},t.clear=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Ri(this,Wi).keys.forEach((function(t){Ri(e,zi)&&t.indexOf(Ri(e,zi))<0||(Ri(e,Zi).removeItem(t),Ri(e,Wi).keys.delete(t))}))},e}(),Gi=new WeakMap,Hi=new WeakMap,Vi=function(){function e(t){ht(this,e),Di(this,Gi,{writable:!0,value:void 0}),Di(this,Hi,{writable:!0,value:void 0}),ji(this,Hi,{keys:new Set,currentSize:0,limitSize:ne}),ji(this,Gi,t)}var t=e.prototype;return t.get=function(e){var t=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){$t("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Ri(t,Gi)},{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 he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){$t("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Ri(t,Gi)},{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 he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Ri(e,Gi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:ft.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(ne/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return he((function(){return _e(this,(function(n){return[2,new Promise((function(n,r){$t("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Ri(t,Gi)},{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 he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Ri(e,Gi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Ki=function(){function e(){ht(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return he((function(){var n,r;return _e(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]=rn(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return he((function(){var n,r;return _e(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Ne(e,2),n=t[0],i=t[1];ft.isUndefined(i)||ft.isNull(i)||(r[n]=sn(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return he((function(){return _e(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 he((function(){return _e(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 he((function(){return _e(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),Ji=new WeakMap,qi=function(e){bt(n,e);var t=Et(n);function n(e){var r;return ht(this,n),Di(Tt(r=t.call(this)),Ji,{writable:!0,value:void 0}),ji(Tt(r),Ji,e),r}return n.prototype.getInstance=function(){return new Fi(Ri(this,Ji))},n}(Ki),$i=new WeakMap,Qi=function(e){bt(n,e);var t=Et(n);function n(e){var r;return ht(this,n),Di(Tt(r=t.call(this)),$i,{writable:!0,value:void 0}),ji(Tt(r),$i,e),r}return n.prototype.getInstance=function(){return new Vi(Ri(this,$i))},n}(Ki),Yi=new qi(o),Xi=(null===(Ui=Pe())||void 0===Ui?void 0:Ui.zaloVersion)||"",eo=(null===(Bi=Pe())||void 0===Bi?void 0:Bi.platformName)||"unknown";!!ft.isString(Xi)&&parseInt(Xi,10)>={android:12100571,iOS:400,wp:0,unknown:0}[eo]&&(null===(Li=Pe())||void 0===Li?void 0:Li.appEnv.isMp)&&(Yi=new Qi(o));var to=Yi,no=[Xr({data:bi.record(Lr(),bi.any())}).optional()];function ro(e){return io.apply(this,arguments)}function io(){return io=he((function(e){return _e(this,(function(t){return[2,pn("setStorage",no,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,to.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),io.apply(this,arguments)}var oo=[Xr({keys:bi.array(Lr())}).optional()];function ao(e){return so.apply(this,arguments)}function so(){return so=he((function(e){return _e(this,(function(t){return[2,pn("getStorage",oo,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,to.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),so.apply(this,arguments)}function uo(e){return co.apply(this,arguments)}function co(){return(co=he((function(e){return _e(this,(function(t){return[2,pn("getStorageInfo",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,to.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var lo=[Xr({keys:bi.array(Lr())}).optional()];function po(e){return fo.apply(this,arguments)}function fo(){return fo=he((function(e){return _e(this,(function(t){return[2,pn("removeStorage",lo,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,to.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),fo.apply(this,arguments)}var ho=[Xr({prefix:Lr().optional()}).optional()];function mo(e){return vo.apply(this,arguments)}function vo(){return(vo=he((function(e){return _e(this,(function(t){return[2,pn("clearStorage",ho,[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp||Oe.isMpWeb?[4,to.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var yo=function(){var e=he((function(e,t){var n,r,i,a;return _e(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,dn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,Xt.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=he((function(e){var t,n,r,i;return _e(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)}}(),go=[Xr({avatarType:bi.enum(["small","normal","large"]).optional(),autoRequestPermission:bi.boolean().default(!1).optional()}).optional()];function _o(e){return wo.apply(this,arguments)}function wo(){return wo=he((function(e){return _e(this,(function(t){return[2,pn("getUserInfo",go,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,yo(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ie("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),wo.apply(this,arguments)}var bo=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},To=he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Pe())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case bo(s).NONE:o=e.NetworkType.none;break;case bo(s).WIFI:o=e.NetworkType.wifi;break;case bo(s)["2G"]:case bo(s)["3G"]:case bo(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function Eo(e){return So.apply(this,arguments)}function So(){return(So=he((function(t){return _e(this,(function(n){return[2,pn("getNetworkType",[],[t],he((function(){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?[4,To()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Oe.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Ie("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Po=[bi.function().args(Xr({isConnected:bi.boolean(),networkType:bi.enum(["none","wifi","cellular","unknown"])})).returns(bi.void())];function Oo(t){return pn("onNetworkStatusChange",Po,[t],(function(t){var n=t;if(Oe.isMp)!function(t){Ot.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;To().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Oe.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var Ao=function(){var e=he((function(e){var t,n,r,i,o,a;return _e(this,(function(s){return a={subaction:0,scanning_type:ft.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:ft.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:ft.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:ft.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:ft.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:ft.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:ft.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:ft.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:ft.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:ft.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){$t("SCAN_IBEACON",Ce({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Io=[Xr({scanningType:bi.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:bi.number().optional(),monitorInterval:bi.number().optional(),domain:bi.string().optional(),scanConfig:Xr({scanTime:bi.number().optional(),timeBetweenScan:bi.number().optional(),beaconTimeout:bi.number().optional(),delayCheckConnectedTimeout:bi.number().optional(),beaconConnectedTimeout:bi.number().optional()}).optional(),items:bi.array(Xr({id:bi.string().optional(),distance:bi.number().optional(),monitor:Xr({enable:bi.boolean().optional(),movingRange:bi.number().optional()}).optional()})).optional(),scanFromSource:bi.string().optional()}).optional()];function ko(e){return Co.apply(this,arguments)}function Co(){return(Co=he((function(e){return _e(this,(function(t){return[2,pn("startBeaconDiscovery",Io,[e],he((function(){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ao(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var No=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function Mo(e){return xo.apply(this,arguments)}function xo(){return(xo=he((function(e){return _e(this,(function(t){return[2,pn("stopBeaconDiscovery",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,No()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Ro=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("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 Do(e){return jo.apply(this,arguments)}function jo(){return(jo=he((function(e){return _e(this,(function(t){return[2,pn("getBeacons",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ro()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ie("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Uo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Bo(e){return Lo.apply(this,arguments)}function Lo(){return(Lo=he((function(e){return _e(this,(function(t){return[2,pn("closeApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Uo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var Zo=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function zo(e){return Wo.apply(this,arguments)}function Wo(){return(Wo=he((function(e){return _e(this,(function(t){return[2,pn("scanQRCode",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Zo()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ie("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Fo=function(){var t=he((function(t,n,r,o){return _e(this,(function(a){return[2,new Promise((function(a,s){$t("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Go=[Xr({id:Lr(),type:bi.enum(["user","oa","aliasOA"]),sourceId:bi.any().optional(),sourceIndex:bi.any().optional()}).optional()];function Ho(e){return Vo.apply(this,arguments)}function Vo(){return Vo=he((function(e){return _e(this,(function(t){return[2,pn("openProfile",Go,[e],function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Fo(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vo.apply(this,arguments)}var Ko=function(){var t=he((function(t,n){var r,o,a,s=arguments;return _e(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){$t("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Jo=[Xr({id:Lr(),type:bi.enum(["user","oa"]),sourceId:bi.any().optional(),sourceIndex:bi.any().optional(),message:Lr().optional()}).optional()];function qo(e){return $o.apply(this,arguments)}function $o(){return $o=he((function(e){return _e(this,(function(t){return[2,pn("openChat",Jo,[e],function(){var e=he((function(e){var t,n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return Oe.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Ko(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$o.apply(this,arguments)}function Qo(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 Yo=function(){var t=he((function(t,n){var r;return _e(this,(function(o){switch(r={},t){case"image":r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){$t("OPEN_POSTFEED",Qo(Ce({type:e.PostFeedType[t]},r),{zapp:i}),{success:function(e){n({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){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),Xo=[bi.union([Xr({type:bi.enum(["image"]),data:Xr({imageUrl:Lr().url().optional()})}),Xr({type:bi.enum(["link"]),data:Xr({link:Lr().url(),title:Lr().max(100).optional(),thumb:Lr().url().optional(),description:Lr().max(400).default("").optional()})}),Xr({type:bi.enum(["profile"]),data:Xr({id:Lr().optional()})})])];function ea(e){return ta.apply(this,arguments)}function ta(){return ta=he((function(e){return _e(this,(function(t){return[2,pn("openPostFeed",Xo,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,Yo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ta.apply(this,arguments)}var na=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ra=[Xr({id:Lr(),showDialogConfirm:bi.boolean().optional()}).optional()];function ia(e){return oa.apply(this,arguments)}function oa(){return oa=he((function(e){return _e(this,(function(t){return[2,pn("followOA",ra,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,na(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oa.apply(this,arguments)}var aa=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),sa=[Xr({id:Lr()}).optional()];function ua(e){return ca.apply(this,arguments)}function ca(){return ca=he((function(e){return _e(this,(function(t){return[2,pn("unfollowOA",sa,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.id,[4,aa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ca.apply(this,arguments)}var la=function(){var e=he((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return _e(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,Ce({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw qt.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Qo(Ce({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),da=function(){var t=he((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return _e(this,(function(y){switch(y.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return l=[],d=(null===(u=Pe())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=Pe())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=te[p]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),r={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,Xt.getAccessToken()];case 8:case 11:return s=y.sent(),[4,la(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return f=y.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(o,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),r={link:m.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){$t("OPEN_SHARESHEET",Qo(Ce({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),pa=[bi.union([Xr({type:bi.enum(["text"]),data:Xr({text:Lr(),description:Lr().default("").optional(),autoParseLink:bi.boolean().default(!1).optional()})}),Xr({type:bi.enum(["image"]),data:Xr({imageUrl:Lr().url(),imageUrls:bi.array(Lr().url()).max(10).optional()})}),Xr({type:bi.enum(["link"]),data:Xr({link:Lr().url(),chatOnly:bi.boolean().optional()})}),Xr({type:bi.enum(["oa"]),data:Xr({id:Lr()})}),Xr({type:bi.enum(["gif"]),data:Xr({gifUrl:Lr().url(),imageUrl:Lr().url().optional(),width:Zr().min(0).optional(),height:Zr().min(0).optional()})}),Xr({type:bi.enum(["video"]),data:Xr({videoThumb:Lr().url(),videoUrl:Lr().url(),width:Zr().min(0).optional(),height:Zr().min(0).optional()})}),Xr({type:bi.enum(["zmp","zmp_deep_link"]),data:Xr({title:Lr().max(100),thumbnail:Lr().url(),path:Lr().optional(),description:Lr().max(400).default("").optional()})})])];function fa(e){return ha.apply(this,arguments)}function ha(){return ha=he((function(e){return _e(this,(function(t){return[2,pn("openShareSheet",pa,[e],function(){var e=he((function(e){var t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(t=e.type,n=e.data,[4,da(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ha.apply(this,arguments)}var ma=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Pe())||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=Pe())||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 va(e){return ya.apply(this,arguments)}function ya(){return(ya=he((function(e){return _e(this,(function(t){return[2,pn("requestCameraPermission",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,ma()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var ga=function(){var e=he((function(e,t,n){return _e(this,(function(r){return[2,new Promise((function(r,i){$t("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)}}(),_a=he((function(){var e,t,n,r=arguments;return _e(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=wn(),[4,Ut(e,t,n.version)];case 1:return[2,i.sent()]}}))})),wa=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ba=[Xr({params:bi.record(Lr(),Lr()).optional()}).optional()];function Ta(e){return Ea.apply(this,arguments)}function Ea(){return Ea=he((function(e){return _e(this,(function(t){return[2,pn("createShortcut",ba,[e],function(){var e=he((function(e){var t,n,r,i,s,u,c,l;return _e(this,(function(d){switch(d.label){case 0:return Oe.isMp?[4,_a(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Pe())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||an("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,wa(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,ga("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,qt.success()];case 6:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ea.apply(this,arguments)}var Sa=function(){var e=he((function(e,t,n){return _e(this,(function(r){return[2,new Promise((function(r,o){$t("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Pa=[Xr({secretData:Lr(),ui:Xr({title:Lr().default("Xác thực").optional(),subTitle:Lr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Lr().default("Đóng").optional()}).optional(),requireFingerprint:Fr().default(!0).optional()}).optional()];function Oa(e){return Aa.apply(this,arguments)}function Aa(){return Aa=he((function(e){return _e(this,(function(t){return[2,pn("openBioAuthentication",Pa,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Sa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ie("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Aa.apply(this,arguments)}var Ia=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("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 ka(e){return Ca.apply(this,arguments)}function Ca(){return(Ca=he((function(e){return _e(this,(function(t){return[2,pn("checkStateBioAuthentication",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Ia()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ie("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Na=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ma=[Xr({message:Lr()}).optional()];function xa(e){return Ra.apply(this,arguments)}function Ra(){return Ra=he((function(e){return _e(this,(function(t){return[2,pn("showToast",Ma,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Na(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ra.apply(this,arguments)}var Da=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function ja(e){return Ua.apply(this,arguments)}function Ua(){return(Ua=he((function(e){return _e(this,(function(t){return[2,pn("hideKeyboard",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Da()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var Ba=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),La=[Xr({phoneNumber:Lr()})];function Za(e){return za.apply(this,arguments)}function za(){return za=he((function(e){return _e(this,(function(t){return[2,pn("openPhone",La,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ba(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),za.apply(this,arguments)}var Wa=function(){var e=he((function(e,t){return _e(this,(function(n){return[2,new Promise((function(n,r){$t("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Fa=[Xr({content:Lr(),phoneNumber:Lr()})];function Ga(e){return Ha.apply(this,arguments)}function Ha(){return Ha=he((function(e){return _e(this,(function(t){return[2,pn("openSMS",Fa,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Wa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ha.apply(this,arguments)}var Va=function(){var e=he((function(e){var t,n=arguments;return _e(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){$t("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ka=[Xr({id:Lr(),displayName:Lr().default("").optional()})];function Ja(e){return qa.apply(this,arguments)}function qa(){return qa=he((function(e){return _e(this,(function(t){return[2,pn("viewOAQr",Ka,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Va(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),qa.apply(this,arguments)}var $a=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("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)}}(),Qa=[Xr({keepScreenOn:Fr()})];function Ya(e){return Xa.apply(this,arguments)}function Xa(){return Xa=he((function(e){return _e(this,(function(t){return[2,pn("keepScreen",Qa,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,$a(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xa.apply(this,arguments)}function es(e){return ts.apply(this,arguments)}function ts(){return(ts=he((function(e){return _e(this,(function(t){return[2,pn("onKeepScreen",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,$a(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function ns(e){return rs.apply(this,arguments)}function rs(){return(rs=he((function(e){return _e(this,(function(t){return[2,pn("offKeepScreen",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,$a(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var is=function(){var e=he((function(e,t){var n;return _e(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){$t("SAVE_IMAGE_GALLERY",Ce({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),os=[Xr({imageBase64Data:Lr().optional(),imageUrl:Lr().url().optional()}).optional()];function as(e){return ss.apply(this,arguments)}function ss(){return ss=he((function(e){return _e(this,(function(t){return[2,pn("saveImageToGallery",os,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,is(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ss.apply(this,arguments)}var us=function(){var e=he((function(e){var t,n,r,i,o,a,u=arguments;return _e(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,_a(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=Ne(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){$t("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),cs=[Xr({appId:Lr(),path:Lr().optional(),params:bi.record(Lr(),Lr()).optional()})];function ls(e){return ds.apply(this,arguments)}function ds(){return ds=he((function(e){return _e(this,(function(t){return[2,pn("openMiniApp",cs,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,us(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ds.apply(this,arguments)}var ps=he((function(){var t,n,r=arguments;return _e(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){$t("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),fs=[Xr({type:bi.enum(["oneShot"]).default("oneShot"),milliseconds:Zr().optional()})];function hs(e){return ms.apply(this,arguments)}function ms(){return ms=he((function(e){return _e(this,(function(t){return[2,pn("vibrate",fs,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,ps(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ms.apply(this,arguments)}var vs=function(){var e=he((function(e,t){var n,r,i,o;return _e(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=ft.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Lt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Lt(null==t?void 0:t.leftButton):"back"},!r&&ft.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){$t("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),ys=[Xr({url:Lr(),config:Xr({style:bi.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:bi.enum(["back","none"]).default("back").optional()}).optional()})];function gs(e){return _s.apply(this,arguments)}function _s(){return _s=he((function(e){return _e(this,(function(t){return[2,pn("openWebview",ys,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,vs(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),_s.apply(this,arguments)}function ws(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=kt.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function bs(){return pn("getRouteParams",[],[],(function(){return ws()}))}function Ts(e){return Es.apply(this,arguments)}function Es(){return(Es=he((function(e){return _e(this,(function(t){return[2,pn("getAppInfo",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,_a()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ie("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ss=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("WEBVIEW_SET_RESULT",{result:sn(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ps=[Xr({data:bi.any()})];function Os(e){return As.apply(this,arguments)}function As(){return As=he((function(e){return _e(this,(function(t){return[2,pn("sendDataToPreviousMiniApp",Ps,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ss(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),As.apply(this,arguments)}var Is=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){var n,r;$t("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(qt.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Pe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function ks(e){return Cs.apply(this,arguments)}function Cs(){return(Cs=he((function(e){return _e(this,(function(t){return[2,pn("getPhoneNumber",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Is()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ie("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Ns=he((function(){var e,t=arguments;return _e(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){$t("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})}))]}))})),Ms=[Xr({maxProfile:Zr().min(1).max(10).optional().default(1)})];function xs(e){return Rs.apply(this,arguments)}function Rs(){return Rs=he((function(e){return _e(this,(function(t){return[2,pn("openProfilePicker",Ms,[e],function(){var e=he((function(e){var t,n,r,i,o;return _e(this,(function(a){switch(a.label){case 0:return Oe.isMp?[4,Ns(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,Xt.getAccessToken()];case 3:return r=a.sent(),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(ft.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 Oe.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ie("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Rs.apply(this,arguments)}var Ds=function(){var e=he((function(e,t,n){var r;return _e(this,(function(i){return r=t&&ft.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){$t("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=[Xr({SSID:Lr(),password:Lr().optional(),hiddenSSID:Fr().optional()})];function Us(e){return Bs.apply(this,arguments)}function Bs(){return Bs=he((function(e){return _e(this,(function(t){return[2,pn("connectWifi",js,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ds(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bs.apply(this,arguments)}var Ls=function(){var t=he((function(t,n,r,i,o,a){var s,u;return _e(this,(function(c){return s={type:0,url:n,max_size:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){$t("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ce({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),Zs=[Xr({type:bi.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Lr().url(),maxItemSize:Zr().min(0).optional(),editView:Xr({enable:Fr().optional(),aspectRatio:Lr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Fr().optional(),maxSelectItem:Zr().min(1).optional()})];function zs(e){return Ws.apply(this,arguments)}function Ws(){return Ws=he((function(e){return _e(this,(function(t){return[2,pn("openMediaPicker",Zs,[e],function(){var e=he((function(e){var t,n,r,i,o,a;return _e(this,(function(s){switch(s.label){case 0:return Oe.isMp?(i={},ft.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,Ls(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Oe.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ie("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ws.apply(this,arguments)}var Fs=[Xr({title:Lr().max(100),description:Lr().max(400).default(""),thumbnail:Lr().url().optional(),path:Lr().optional()})];function Gs(e){return Hs.apply(this,arguments)}function Hs(){return Hs=he((function(e){return _e(this,(function(t){return[2,pn("getShareableLink",Fs,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return[4,Xt.getAccessToken()];case 1:return t=n.sent(),[4,la(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)}}())]}))})),Hs.apply(this,arguments)}var Vs=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("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 Ks(e){return Js.apply(this,arguments)}function Js(){return(Js=he((function(e){return _e(this,(function(t){return[2,pn("closeLoading",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Vs("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function qs(e){return $s.apply(this,arguments)}function $s(){return $s=he((function(e){return _e(this,(function(t){return[2,pn("requestUpdateZalo",[],[e],he((function(){var e,t,n;return _e(this,(function(r){switch(r.label){case 0:return Oe.isMp?(n=(null===(e=Pe())||void 0===e||null===(t=e.platform)||void 0===t?void 0:t.isIOS)?"https://apps.apple.com/vn/app/zalo/id579523206":"https://play.google.com/store/apps/details?id=com.zing.zalo",[4,wa(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestUpdateZalo",{}))]}}))})))]}))})),$s.apply(this,arguments)}var Qs=Ot.getInstance();Qs.addListener=function(t,n,r){var i=t;return Qs.addListener(e.Events[i],n,r)};var Ys=[bi.function()];function Xs(t){return pn("onConfirmToExit",Ys,[t],(function(t){var n=t;Oe.isMp&&(Qs.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Ei.setNavigationBarLeftButton(void 0,2))}))}function eu(){return pn("offConfirmToExit",[],[],(function(){Oe.isMp&&(Qs.off(e.Events.AppClose),Ei.setNavigationBarLeftButton(void 0,0))}))}function tu(){return pn("getDeviceId",[],[],(function(){return Oe.isMp&&Xt.getSync(l.DEVICE_ID)||""}))}function nu(e){return ru.apply(this,arguments)}function ru(){return(ru=he((function(e){return _e(this,(function(t){return[2,pn("getDeviceIdAsync",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Xt.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function iu(){return pn("getContext",[],[],(function(){if(Oe.isMp){var e=Xt.getSync(l.CONTEXT_ID)||"";return{type:Xt.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function ou(e){return au.apply(this,arguments)}function au(){return(au=he((function(e){return _e(this,(function(t){return[2,pn("getContextAsync",[],[e],he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Xt.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,Xt.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function su(e){return uu.apply(this,arguments)}function uu(){return(uu=he((function(e){return _e(this,(function(t){return[2,pn("getAuthCode",[],[e],he((function(){var e,t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?[4,Xt.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,Xt.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,Xt.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Bt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),qt.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function cu(e){return lu.apply(this,arguments)}function lu(){return(lu=he((function(e){return _e(this,(function(t){return[2,pn("getZPIToken",[],[e],he((function(){var e,t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?[4,Xt.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,Xt.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,Xt.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,Xt.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var du=[Lr()];function pu(e){return pn("setAccessToken",du,[e],(function(e){var t=e;Xt.setAccessToken(t)}))}var fu=[Xr({url:Lr().url()})];function hu(e){return mu.apply(this,arguments)}function mu(){return mu=he((function(e){return _e(this,(function(t){return[2,pn("openOutApp",fu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,wa(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),mu.apply(this,arguments)}var vu=[Xr({count:Zr().min(1).optional().default(1),sourceType:bi.array(bi.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:bi.enum(["back","front"]).default("front").optional()})];function yu(e){return gu.apply(this,arguments)}function gu(){return gu=he((function(e){return _e(this,(function(t){return[2,pn("chooseImage",vu,[e],function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){return t=e.sourceType||["album","camera"],n=e.cameraType||"front",r=e.count||1,(i=document.createElement("input")).type="file",i.multiple=r>1,i.accept="image/*",i.style.display="none",1===t.length&&t.includes("camera")&&(i.accept="front"===n?"zcamera/photo-frontfacing":"zcamera/photo-backfacing",i.capture="front"===n?"user":"environment"),[2,new Promise((function(e,t){i.addEventListener("change",(function(n){var i,o=(null==n||null===(i=n.target)||void 0===i?void 0:i.files)||[];if(o.length>r)t(new Error("You are only allowed to choose a maximum of ".concat(r," images at a time")));else{var a={filePaths:[],tempFiles:[]};Array.from(o).forEach((function(e){a.filePaths.push(URL.createObjectURL(e)),a.tempFiles.push({path:URL.createObjectURL(e),size:e.size})})),e(a)}})),document.body.appendChild(i),i.click()}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),gu.apply(this,arguments)}var _u=he((function(){var e,t,n=arguments;return _e(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){$t("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(qt.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function wu(e){return bu.apply(this,arguments)}function bu(){return(bu=he((function(e){return _e(this,(function(t){return[2,pn("getLocation",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,_u()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Ie("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Tu=[bi.function().args(Xr({data:bi.any()})).returns(bi.void())];function Eu(t){return pn("onCallbackData",Tu,[t],(function(){!function(t){Ot.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Su=function(){var e=he((function(e){var t,n,r,i,a,s,u,c,l,d,p;return _e(this,(function(f){switch(f.label){case 0:return n="",e||(e=ws()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=kt.getParameterByName("orderId",e),i=kt.getParameterByName("appTransID",e)||kt.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,Xt.getAccessToken().catch((function(){throw qt.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(re.GET_TRANSACTION),c={orderId:n,transId:t||"",appId:o},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw qt.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ce({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Pu=function(){var t=he((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,I,k;return _e(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),i&&(d=i,"object"==typeof i&&(d=JSON.stringify(i)),l.append("extradata",encodeURIComponent(d))),a&&(p=a,"object"==typeof a&&(p=JSON.stringify(a)),l.append("payload",encodeURIComponent(p))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,Xt.getAccessToken().catch((function(){throw qt.error.loginRequired}))];case 2:return m=C.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(re.CREATE_ORDER,Qo(Ce({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw qt.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:c,orderId:y},E=v.data.method,S=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),S&&(T.isCustom=S),P=kt.encode(T),O=new URL("?".concat(P),ie).toString(),A=Zt(),I=((null===(h=Pe())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,vs(O,{style:"android"===I&&A<742?"normal":"bottomSheet"}).then((function(){var t=!1;Ot.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(he((function(){var n;return _e(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,Su({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&Ot.getInstance().emit(e.Events.PaymentClose,n.err,Qo(Ce({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),Ot.getInstance().once(e.Events.OpenApp,(function(){t=!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(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),Ou=[Xr({amount:bi.union([Lr(),Zr()]),item:bi.array(bi.record(Lr(),bi.any())),desc:Lr(),extradata:bi.any().optional(),payload:bi.any().optional(),method:bi.union([bi.string(),bi.object({id:bi.string(),isCustom:bi.boolean()})]).optional(),mac:bi.string().optional()})];function Au(e){return Iu.apply(this,arguments)}function Iu(){return Iu=he((function(e){return _e(this,(function(t){return[2,pn("createOrder",Ou,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Pu(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 Oe.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ie("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Iu.apply(this,arguments)}var ku=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("MP_SELECT_PAYMENT_METHOD",{method:e,forceUpdate:!0},{success:function(e){console.log(e),t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Cu=[Xr({method:Lr().optional()}).optional()];function Nu(e){return Mu.apply(this,arguments)}function Mu(){return Mu=he((function(e){return _e(this,(function(t){return[2,pn("selectPaymentMethod",Cu,[e],function(){var e=he((function(e){var t;return _e(this,(function(n){switch(n.label){case 0:return Oe.isMp?(t=e.method,[4,ku(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ie("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Mu.apply(this,arguments)}var xu=[Xr({data:bi.union([Lr(),bi.record(Lr(),Lr())])})];function Ru(e){return Du.apply(this,arguments)}function Du(){return Du=he((function(e){return _e(this,(function(t){return[2,pn("checkTransaction",xu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Su(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ie("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Du.apply(this,arguments)}var ju=[Xr({hide:Fr().default(!1).optional()}).optional()];function Uu(e){return Bu.apply(this,arguments)}function Bu(){return Bu=he((function(e){return _e(this,(function(t){return[2,pn("setAndroidBottomNavigationBar",ju,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ei.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Bu.apply(this,arguments)}var Lu=[Xr({hide:Fr().default(!1).optional()}).optional()];function Zu(e){return zu.apply(this,arguments)}function zu(){return zu=he((function(e){return _e(this,(function(t){return[2,pn("setIOSBottomSafeArea",Lu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ei.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),zu.apply(this,arguments)}var Wu=[Xr({type:bi.enum(["normal","hidden","transparent"]).default("normal").optional(),color:bi.string().optional()}).optional()];function Fu(e){return Gu.apply(this,arguments)}function Gu(){return Gu=he((function(e){return _e(this,(function(t){return[2,pn("setStatusBar",Wu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ei.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Gu.apply(this,arguments)}var Hu=[Xr({headerTextColor:bi.enum(["black","white"]).optional(),headerColor:bi.string().optional(),actionBar:Xr({hide:bi.boolean().optional(),title:bi.string().optional(),leftButton:bi.enum(["back","none"]).optional(),textAlign:bi.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:bi.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:bi.boolean().optional(),hideIOSSafeAreaBottom:bi.boolean().optional()})];function Vu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=he((function(e){return _e(this,(function(t){return[2,pn("configAppView",Hu,[e],function(){var e=he((function(e){var t,n,r,i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return Oe.isMp?ft.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Ei.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return ft.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,Ei.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Ei.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,Ei.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Ei.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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ku.apply(this,arguments)}var Ju=function(){var t=he((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,b;return _e(this,(function(T){switch(T.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===ae&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===oe&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Pe())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Pe())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,Xt.getAccessToken().catch((function(){throw qt.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(re.CREATE_IAP_ORDER,Qo(Ce({method:"POST"},v),{body:f}))];case 3:return[4,T.sent().json()];case 4:if(!(g=T.sent()).data||!g.data.store||0!==g.err)throw qt.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){$t("IAP_REQUESTPAYMENT",Ce({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw b=T.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),qu=[Xr({productId:Lr(),payType:bi.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:bi.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Lr().optional(),method:bi.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Lr().optional()})];function $u(e){return Qu.apply(this,arguments)}function Qu(){return Qu=he((function(e){return _e(this,(function(t){return[2,pn("createOrderIAP",qu,[e],function(){var e=he((function(e){return _e(this,(function(t){switch(t.label){case 0:return Oe.isMp?[4,Ju(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ie("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qu.apply(this,arguments)}var Yu=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Xu(e){return ec.apply(this,arguments)}function ec(){return(ec=he((function(e){return _e(this,(function(t){return[2,pn("minimizeApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Yu()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var tc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function nc(e){return rc.apply(this,arguments)}function rc(){return(rc=he((function(e){return _e(this,(function(t){return[2,pn("openPermissionSetting",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,tc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var ic=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function oc(e){return ac.apply(this,arguments)}function ac(){return(ac=he((function(e){return _e(this,(function(t){return[2,pn("favoriteApp",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,ic()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var sc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function uc(e){return cc.apply(this,arguments)}function cc(){return(cc=he((function(e){return _e(this,(function(t){return[2,pn("openGroupList",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,sc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var lc=he((function(){var e;return _e(this,(function(t){switch(t.label){case 0:return[4,Xt.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){$t("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function dc(e){return pc.apply(this,arguments)}function pc(){return(pc=he((function(e){return _e(this,(function(t){return[2,pn("requestSendNotification",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,lc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var fc=he((function(){return _e(this,(function(e){return[2,new Promise((function(e,t){$t("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function hc(e){return mc.apply(this,arguments)}function mc(){return(mc=he((function(e){return _e(this,(function(t){return[2,pn("addRating",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,fc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var vc,yc=(vc=he((function(e,t,n){var r,i;return _e(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,Ce({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return vc.apply(this,arguments)}),gc=function(){var e=he((function(e){return _e(this,(function(t){return[2,new Promise((function(t,n){$t("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)}}(),_c=[Xr({oaId:Lr()})];function wc(e){return bc.apply(this,arguments)}function bc(){return bc=he((function(e){return _e(this,(function(t){return[2,pn("interactOA",_c,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?(t=e.oaId,[4,Xt.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||ft.isEmpty(n)?[3,3]:[4,yc(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,gc(t)];case 4:return[2,i.sent()];case 5:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bc.apply(this,arguments)}var Tc=[Xr({oaId:Lr()})];function Ec(e){return Sc.apply(this,arguments)}function Sc(){return Sc=he((function(e){return _e(this,(function(t){return[2,pn("isAllowedInteractWithOA",Tc,[e],function(){var e=he((function(e){var t,n,r;return _e(this,(function(i){switch(i.label){case 0:return Oe.isMp?(t=e.oaId,[4,Xt.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||ft.isEmpty(n)?[3,3]:[4,yc(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Oe.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ie("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sc.apply(this,arguments)}function Pc(e){return Oc.apply(this,arguments)}function Oc(){return(Oc=he((function(e){return _e(this,(function(t){return[2,pn("getSetting",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,Kt()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ie("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var Ac=bi.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Ic=[Xr({scopes:bi.array(Ac).max(2).optional()}).optional()];function kc(e){return Cc.apply(this,arguments)}function Cc(){return Cc=he((function(e){return _e(this,(function(t){return[2,pn("authorize",Ic,[e],function(){var e=he((function(e){var t,n,r,i;return _e(this,(function(o){switch(o.label){case 0:return Oe.isMp?(n=null==e?void 0:e.scopes,r=Zt(),("android"===(i=((null===(t=Pe())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject(qt.error.clientNotSupport())]:[4,Qt(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Cc.apply(this,arguments)}var Nc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n;return _e(this,(function(r){switch(r.label){case 0:return ft.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(qt.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function Mc(e){return pn("checkZaloCameraPermission",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return[4,Nc()];case 1:return[2,e.sent()]}}))})))}var xc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i;return _e(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Xt.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Xt.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 Rc(e){return Dc.apply(this,arguments)}function Dc(){return(Dc=he((function(e){return _e(this,(function(t){return[2,pn("getUserID",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,xc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var jc=he((function(){return _e(this,(function(e){return[2,new Promise(function(){var e=he((function(e,t){var n,r,i;return _e(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Xt.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=Xt.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 Uc(e){return Bc.apply(this,arguments)}function Bc(){return(Bc=he((function(e){return _e(this,(function(t){return[2,pn("getIDToken",[],[e],he((function(){return _e(this,(function(e){switch(e.label){case 0:return Oe.isMp?[4,jc()]:[3,2];case 1:return[2,e.sent()];case 2:return Oe.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Lc={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},Zc={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},zc=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;ht(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};Ot.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:Zc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:Zc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:Zc.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:Zc.video}var n=t.prototype;return n.on=function(t,n){Ot.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){Ot.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return he((function(){var n,r,i,o,a,s;return _e(this,(function(u){switch(u.label){case 0:return ft.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||Zc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||Zc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return he((function(){var n,r;return _e(this,(function(i){return n=Ot.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=he((function(n,r){var i;return _e(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),Ot.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return he((function(){return _e(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return he((function(){return _e(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=he((function(n){return _e(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return he((function(){return _e(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return he((function(){return _e(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),Ot.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Lc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),Wc=Xr({play:bi.function(),pause:bi.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Fc=[Xr({videoElement:Wc,mediaConstraints:bi.object({width:bi.number().min(100).optional(),height:bi.number().min(100).optional(),facingMode:bi.string().optional(),audio:bi.boolean().optional(),video:bi.boolean().optional(),deviceId:bi.string().optional(),mirrored:bi.boolean().optional()}).nullish()}).optional()];function Gc(e){return pn("createCameraContext",Fc,[e],(function(e){return console.log("createCameraContext",e),new zc(e.videoElement,e.mediaConstraints)}))}var Hc=function(){function e(){var t,n;ht(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=ge(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;ft.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?ft.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?ft.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 Vc(e){return Kc.apply(this,arguments)}function Kc(){return(Kc=he((function(e){return _e(this,(function(t){return[2,pn("setupAd",[],[e],(function(){return Hc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var Jc=[Xr({ids:bi.union([bi.string(),bi.array(bi.string())]),config:Xr({display:bi.boolean().optional(),onClose:bi.function().optional()}).optional()})];function qc(e){return $c.apply(this,arguments)}function $c(){return $c=he((function(e){return _e(this,(function(t){return[2,pn("loadAd",Jc,[e],function(){var e=he((function(e){return _e(this,(function(t){return Hc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$c.apply(this,arguments)}var Qc=[Xr({id:bi.string()})];function Yc(e){return Xc.apply(this,arguments)}function Xc(){return Xc=he((function(e){return _e(this,(function(t){return[2,pn("displayAd",Qc,[e],function(){var e=he((function(e){return _e(this,(function(t){return Hc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Xc.apply(this,arguments)}var el=[Xr({id:bi.string().optional()}).optional()];function tl(e){return nl.apply(this,arguments)}function nl(){return nl=he((function(e){return _e(this,(function(t){return[2,pn("refreshAd",el,[e],function(){var e=he((function(e){return _e(this,(function(t){return Hc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),nl.apply(this,arguments)}var rl=[Xr({id:Lr(),guidingText:Lr().optional(),color:Lr().optional(),onStatusChange:bi.function().optional()})];function il(e){return ol.apply(this,arguments)}function ol(){return ol=he((function(e){return _e(this,(function(n){return[2,pn("showOAWidget",rl,[e],function(){var e=he((function(e){var n,r,i,o,a,s,u,c;return _e(this,(function(l){if(Oe.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="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=Ne(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=he((function(e){var t,n,i,o,a,s,l,d;return _e(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,Xt.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=Xt.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?Fo(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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ol.apply(this,arguments)}var al=[Xr({id:Lr(),type:Lr(),text:Lr(),color:Lr().optional(),disabled:bi.boolean().optional(),onDataReceived:bi.function().optional(),onError:bi.function().optional()})];function sl(e){return ul.apply(this,arguments)}function ul(){return ul=he((function(e){return _e(this,(function(n){return[2,pn("showFunctionButtonWidget",al,[e],function(){var e=he((function(e){var n,r,i,o,a,s,u;return _e(this,(function(c){if(Oe.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["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=Ne(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=Ne(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=he((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return _e(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,Xt.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=Xt.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=Xt.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,mn()];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 Oe.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ul.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:_n},fn();var cl=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},login:fn,getAccessToken:mn,getVersion:_n,getSystemInfo:bn,setNavigationBarTitle:Pi,setNavigationBarColor:Ii,setNavigationBarLeftButton:Ni,setStorage:ro,getStorage:ao,getStorageInfo:uo,removeStorage:po,clearStorage:mo,getUserInfo:_o,getNetworkType:Eo,onNetworkStatusChange:Oo,startBeaconDiscovery:ko,stopBeaconDiscovery:Mo,getBeacons:Do,closeApp:Bo,scanQRCode:zo,openProfile:Ho,openChat:qo,openPostFeed:ea,followOA:ia,unfollowOA:ua,openShareSheet:fa,requestCameraPermission:va,createShortcut:Ta,openBioAuthentication:Oa,checkStateBioAuthentication:ka,showToast:xa,hideKeyboard:ja,openPhone:Za,openSMS:Ga,viewOAQr:Ja,keepScreen:Ya,onKeepScreen:es,offKeepScreen:ns,saveImageToGallery:as,openMiniApp:ls,vibrate:hs,openWebview:gs,getRouteParams:bs,getAppInfo:Ts,sendDataToPreviousMiniApp:Os,getPhoneNumber:ks,openProfilePicker:xs,connectWifi:Us,openMediaPicker:zs,getShareableLink:Gs,closeLoading:Ks,requestUpdateZalo:qs,onConfirmToExit:Xs,offConfirmToExit:eu,getDeviceId:tu,getDeviceIdAsync:nu,getContext:iu,getContextAsync:ou,getAuthCode:su,getZPIToken:cu,setAccessToken:pu,openOutApp:hu,chooseImage:yu,getLocation:wu,onCallbackData:Eu,createOrder:Au,selectPaymentMethod:Nu,checkTransaction:Ru,events:Qs,setAndroidBottomNavigationBar:Uu,setIOSBottomSafeArea:Zu,setStatusBar:Fu,configAppView:Vu,createOrderIAP:$u,minimizeApp:Xu,openPermissionSetting:nc,favoriteApp:oc,openGroupList:uc,requestSendNotification:dc,addRating:hc,interactOA:wc,interactOa:wc,isAllowedInteractWithOA:Ec,getSetting:Pc,authorize:kc,checkZaloCameraPermission:Mc,getUserID:Rc,getIDToken:Uc,createCameraContext:Gc,setupAd:Vc,loadAd:qc,displayAd:Yc,refreshAd:tl,showOAWidget:il,showFunctionButtonWidget:sl,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:zc}),ll=Au,dl=Ru,pl=$u,fl=Nu,hl=t(cl,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),ml={createOrder:ll,checkTransaction:dl,createOrderIAP:pl,selectPaymentMethod:fl};!function(){var e,t=null===(e=Pe())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,cl))}(),e.EventName=e.Events,e.Payment=ml,e.ZMACameraImp=zc,e.addRating=hc,e.authorize=kc,e.checkStateBioAuthentication=ka,e.checkTransaction=Ru,e.checkZaloCameraPermission=Mc,e.chooseImage=yu,e.clearStorage=mo,e.closeApp=Bo,e.closeLoading=Ks,e.configAppView=Vu,e.connectWifi=Us,e.createCameraContext=Gc,e.createOrder=Au,e.createOrderIAP=$u,e.createShortcut=Ta,e.default=hl,e.displayAd=Yc,e.events=Qs,e.favoriteApp=oc,e.followOA=ia,e.getAccessToken=mn,e.getAppInfo=Ts,e.getAuthCode=su,e.getBeacons=Do,e.getContext=iu,e.getContextAsync=ou,e.getDeviceId=tu,e.getDeviceIdAsync=nu,e.getIDToken=Uc,e.getLocation=wu,e.getNetworkType=Eo,e.getPhoneNumber=ks,e.getRouteParams=bs,e.getSetting=Pc,e.getShareableLink=Gs,e.getStorage=ao,e.getStorageInfo=uo,e.getSystemInfo=bn,e.getUserID=Rc,e.getUserInfo=_o,e.getVersion=_n,e.getZPIToken=cu,e.hideKeyboard=ja,e.interactOA=wc,e.interactOa=wc,e.isAllowedInteractWithOA=Ec,e.keepScreen=Ya,e.loadAd=qc,e.login=fn,e.minimizeApp=Xu,e.offConfirmToExit=eu,e.offKeepScreen=ns,e.onCallbackData=Eu,e.onConfirmToExit=Xs,e.onKeepScreen=es,e.onNetworkStatusChange=Oo,e.openBioAuthentication=Oa,e.openChat=qo,e.openGroupList=uc,e.openMediaPicker=zs,e.openMiniApp=ls,e.openOutApp=hu,e.openPermissionSetting=nc,e.openPhone=Za,e.openPostFeed=ea,e.openProfile=Ho,e.openProfilePicker=xs,e.openSMS=Ga,e.openShareSheet=fa,e.openWebview=gs,e.refreshAd=tl,e.removeStorage=po,e.requestCameraPermission=va,e.requestSendNotification=dc,e.requestUpdateZalo=qs,e.saveImageToGallery=as,e.scanQRCode=zo,e.selectPaymentMethod=Nu,e.sendDataToPreviousMiniApp=Os,e.setAccessToken=pu,e.setAndroidBottomNavigationBar=Uu,e.setIOSBottomSafeArea=Zu,e.setNavigationBarColor=Ii,e.setNavigationBarLeftButton=Ni,e.setNavigationBarTitle=Pi,e.setStatusBar=Fu,e.setStorage=ro,e.setupAd=Vc,e.showFunctionButtonWidget=sl,e.showOAWidget=il,e.showToast=xa,e.startBeaconDiscovery=ko,e.stopBeaconDiscovery=Mo,e.unfollowOA=ua,e.vibrate=hs,e.viewOAQr=Ja,Object.defineProperty(e,"__esModule",{value:!0})}));
24
+ ***************************************************************************** */}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})),Ot="ACTION_CALLBACK";var At=function(t){Tt(r,t);var n=St(r);function r(){var e;return mt(this,r),(e=n.apply(this,arguments)).debug=ut("zmp:event-emitter"),e}var i=r.prototype;return i.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},i.on=function(t,n,i){var o=this;if(t===Ot||t===e.Events.PaymentCallback)return wt(gt(r.prototype),"on",this).call(this,t,n,i);this.debug("register ".concat(String(t),": ").concat(i));return wt(gt(r.prototype),"on",this).call(this,t,(function(e,r){o.h5ConfirmHandleEvent(e,t,i),n(r)}),i)},i.once=function(e,t,n){var i=this;if(e===Ot)return wt(gt(r.prototype),"once",this).call(this,e,t,n);this.debug("register once ".concat(String(e),": ").concat(n));return wt(gt(r.prototype),"once",this).call(this,e,(function(r,o){i.h5ConfirmHandleEvent(r,e,n),t(o)}),n)},r.getInstance=function(){return r.instance||(r.instance=new r),r.instance},r}(Pt);function kt(e){At.getInstance().emit(Ot,e)}function It(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){kt({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(t,n,r){var i=ut("zmp:zalo_h5_event_handler");i("eventId: ".concat(t,", eventName: ").concat(n,", eventData: ").concat(r));var a=on(r);i("stringToData",a);var s=function(t,n){try{if(t===e.Events.OpenApp){var r=n.url,i=new URL(r),a=i.pathname.split("/zapps/".concat(o))[1];return{path:"".concat(a||"/").concat(i.search)}}return n}catch(e){return n}}(n,a);At.getInstance().emit(n,t,s)}},window.zaloNative2JS={nativeCall:function(t,n,r){At.getInstance().emit(e.Events.PaymentCallback,t,n,r)}};var Ct={encode:It,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:It(t))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null},getParamsAsObject:function(e){var t={};return e?(e.split("&").map((function(e){var n=e.split("=");n&&2==n.length&&(t[n[0]]=decodeURIComponent(n[1].replace(/\+/g," ")))})),t):t},toQueryString:function(e){if(!e)return"";if("object"!=(void 0===e||void 0===e?"undefined":st(e)))return e;var t=Object.keys(e),n=[];return t.map((function(t){var r=e[t],i=[t,r="object"==(void 0===r||void 0===r?"undefined":st(r))?JSON.stringify(r):encodeURIComponent(r)].join("=");n.push(i)})),n.join("&")}},Nt={},Mt=function(e,t,n){var r=t||"default";return function(){return(r in Nt?Nt[r](e,n):e).apply(this,arguments)}};Mt.setWrapper=function(e){Nt[arguments.length<=1||void 0===arguments[1]?"default":arguments[1]]=e};var xt={error:{code:1,error_subcode:1357046,message:"Received Invalid JSON reply.",type:"http"}};function Rt(e){try{return null===e?xt:JSON.parse(e)}catch(e){return xt}}var Dt,jt={execute:function(e,t,n,r){n.suppress_http_code=1;var i=Ct.encode(n);"post"!=t&&(e=Ct.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=Mt((function(){o=r,"onload"in i&&i.onload(n)}),"entry","XMLHttpRequest:load"),a=Mt((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(Rt(e.responseText))},o.onerror=function(e){e.responseText?r(Rt(e.responseText)):r({error:{code:1,error_subcode:1357045,message:"unknown error (empty response)",status:e.status,type:"http"}})},o.send(i),!0)}},Ut=jt,Bt=(Dt=me((function(e,t,n){var r,i,o,a;return we(this,(function(s){switch(s.label){case 0:return r={appId:e,versionStatus:t},ht.isUndefined(n)||(r.currentVersion=n),i=Ct.appendToUrl(d.GET_APP_INFO,r),[4,fetch(i,{credentials:"include"})];case 1:return(o=s.sent()).ok?[4,o.json()]:[3,3];case 2:if((a=s.sent()).err<0||!a.data)throw new Error(a);return[2,{name:a.data.name,version:a.data.version,description:a.data.description,appUrl:a.data.appUrl,qrCodeUrl:a.data.qrCodeUrl,logoUrl:a.data.logoUrl,cateID:a.data.cateType}];case 3:throw new Error("Can't get app info")}}))})),function(e,t,n){return Dt.apply(this,arguments)});function Lt(e){try{var t=e.map((function(e){return{action:e.action,error:e.error,message:e.message,data:e.data}}));Ut.execute(d.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 Zt=function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))},zt=function(){var e,t,n=Number((null===(e=Oe())||void 0===e?void 0:e.zaloVersion)||""),r=((null===(t=Oe())||void 0===t?void 0:t.platformName)||"").toLowerCase();return"android"===r?n%1e4:n};function Wt(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Ft,Gt,Ht=function(){function e(t,n,r,i){mt(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}(),Vt=function(e,t){return Wt(e,Ht)?function(e,t){return e.api=t,e.toJSON()}(e,t):function(e,t){return Wt(e,Error)?new Ht(D,e.message,t).toJSON():ht.isEmpty(null==e?void 0:e.message)||ht.isEmpty(null==e?void 0:e.code)?new Ht(D,G,t,e).toJSON():new Ht(e.code,e.message,t,e.detail).toJSON()}(e,t)},Kt=(Ft=me((function(e){var t;return we(this,(function(n){switch(n.label){case 0:return t={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer ".concat(e)}},[4,fetch(d.GET_AUTH_SETTING,Ne({method:"GET"},t))];case 1:return[4,n.sent().json()];case 2:return[2,n.sent()]}}))})),function(e){return Ft.apply(this,arguments)}),Jt=me((function(){return we(this,(function(e){return[2,new Promise(function(){var e=me((function(e,t){var n,r,i,o;return we(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,en.jumpAndGetToken()];case 1:return a.sent(),(r=null===(n=en.miniProgramConfig)||void 0===n?void 0:n.jwt)||t(new Ht(B,V,"getSetting")),[4,Kt(r)];case 2:return(i=a.sent())&&0===i.err?e({authSetting:i.data}):t(new Ht(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)}}())]}))})),qt=function(){var t,n,r,i=Oe(),o={},a=At.getInstance(),s=[],u=!1;return u||(n=function(e){var t=e.serialId,n=an(e.result),r=ln(null==n?void 0:n.action),i=ht.isEmpty(null==n?void 0:n.error_code)?0:null==n?void 0:n.error_code,a=null==n?void 0:n.error_message,u=(null==n?void 0:n.data)||n;if(r&&0===i){var c=JSON.parse(null==n?void 0:n.data);i=ht.isEmpty(null==c?void 0:c.error_code)?0:null==c?void 0:c.error_code,a=null==c?void 0:c.error_message,u=(null==c?void 0:c.data)||c}var l={error_code:i,error_message:a,data:u,action:(null==n?void 0:n.action)||e.actionName};if(t&&o[t]){var d=o[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?ht.isFunction(r)&&r(e):ht.isFunction(i)&&i(e)}(l,p),!h&&delete o[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){}s.push(v)}},At.getInstance().on(Ot,n),a.on(e.Events.AppPaused,(function(){if(s.length>0){var e=s;s=[],Lt(e)}})),t?clearInterval(t):t=setInterval((function(){if(s.length>0){var e=s;s=[],Lt(e)}}),5e3),u=!0),r=me((function(e,t,n,r){var a,s,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A;return we(this,(function(k){switch(k.label){case 0:return s=Math.floor(1e6*Math.random()),u="".concat(e,"_").concat(s),c="action.".concat(e.replace(/\_/g,".").toLowerCase()),(null==r?void 0:r.actionName)&&r.actionName.length>0&&(c=null==r?void 0:r.actionName),l=(null==r?void 0:r.isMultiCallback)||!1,d=!1!==(null==r?void 0:r.timeout)&&((null==r?void 0:r.timeout)||!0),p=(null==r?void 0:r.haveCallback)||!1,f=(null==r?void 0:r.skipJump)||!1,h=(null==r?void 0:r.requireAccessToken)||!1,m=dn(c),t&&n&&(o[u]={options:t,callback:n,isMultiCallback:l},d&&p&&(o[u].timeout=setTimeout((function(){return kt({serialId:u,result:{error_code:Z,error_message:H,data:{timeout:d},action:e}}),null}),!0===d?8e3:1e3*d))),m?[4,Jt()]:[3,2];case 1:if(!1===(null==(y=k.sent())||null===(v=y.authSetting)||void 0===v?void 0:v["scope.userInfo"]))return kt({serialId:u,result:{error_code:B,error_message:q,data:{isMobile:null==i||null===(g=i.platform)||void 0===g?void 0:g.isMobile},action:e}}),[2];k.label=2;case 2:return _=ln(c),!(null==i||null===(a=i.platform)||void 0===a?void 0:a.isMobile)||!e||ht.isUndefined(ZaloJavaScriptInterface)||i.platform.isIOS&&!rn(e)||_&&!1===_.isSupported?(kt({serialId:u,result:{error_code:L,error_message:J,data:{isMobile:null==i||null===(w=i.platform)||void 0===w?void 0:w.isMobile},action:e}}),[2]):(b=nn(t),f?[3,4]:[4,en.getJSAccessToken()]);case 3:return E=k.sent(),[3,5];case 4:E="",k.label=5;case 5:T=E,k.label=6;case 6:return k.trys.push([6,10,,11]),f||!h?[3,8]:[4,en.getAccessToken()];case 7:return P=k.sent(),[3,9];case 8:P="",k.label=9;case 9:return S=P,[3,11];case 10:return O=k.sent(),kt({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=i.platform.isIOS?window.onNativeMessage(u,c):'window.onNativeMessage("'.concat(u,'", "').concat(c,'")'),[2,ZaloJavaScriptInterface.jsCall(T,c,S,b,A)]}}))})),function(e,t,n,i){return r.apply(this,arguments)}}(),$t={success:function(e,t){return{code:R,message:t||F,data:e||{}}},error:{badRequest:function(e){return new Ht(j,e)},loginFailed:function(e){return new Ht(B,"".concat(K,": ").concat(e))},loginRequired:function(){return new Ht(B,V)},cannotGetShareInfo:function(){return new Ht(U,"Can not get app info to share")},createIAPOrderFailed:function(e){var t=Object.keys(fe).find((function(t){return t===e.toString()}));return new Ht(e,t||G)},clientNotSupport:function(){return new Ht(L,J)}}},Qt=(Gt=function(t){var n,r,i,o=null===(n=Oe())||void 0===n?void 0:n.platformName,a=t.action.replace("action.","").replace(/\./g,"_").toUpperCase(),s=X[a],u=(null==s?void 0:s.skipJump)||!1,c=(null==s?void 0:s.errorList)||{};if("JUMP_LOGIN"===a)return new Ht(D,"Can not get auth code: ".concat(t.error_message));if(en.jumpStatus!==e.JumpStatus.DONE&&!u)return new Ht(Y.UNAUTHORIZED.code,Y.UNAUTHORIZED.message);if("permission required!"===String(t.error_message).toLowerCase()||"no permission!"===String(t.error_message).toLowerCase())return new Ht(Y.FORBIDDEN.code,Y.FORBIDDEN.message);if(o&&(null===(r=ee[o])||void 0===r?void 0:r[t.error_code]))return new Ht(ee[o][t.error_code].code,ee[o][t.error_code].message);var l=null==c||null===(i=c[o])||void 0===i?void 0:i[String(t.error_code)];if(l){var d,p,f,h=null===(d=l.mapTo)||void 0===d?void 0:d.message;return(null==l?void 0:l.needMoreDetail)&&(h="".concat(null==l||null===(f=l.mapTo)||void 0===f?void 0:f.message,": ").concat(t.error_message)),new Ht(null===(p=l.mapTo)||void 0===p?void 0:p.code,h)}return new Ht(t.error_code,t.error_message)},function(e,t,r,i){var o=function(e,t){function r(r){return function(i){var o=ht.isEmpty(t)?void 0:t[r];if(o)return ke({stage:n.RESPONSE,type:"log",state:r,name:e,response:i}),o("fail"===r?Gt(i):null==i?void 0:i.data)}}return ht.isUndefined(e)&&(e=""),Object.assign({},{success:r("success"),fail:r("fail")})}(e,r),a=X[e],s=(null==i?void 0:i.delay)||0;setTimeout((function(){qt(e,t,o,Ne({},i,a))}),s)}),Yt=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("MP_USER_AUTHORIZE",{scopes:e,forceUpdate:!0},{success:function(e){ht.isEmpty(e)||t(e)},fail:function(e){n(e)}},{isMultiCallback:!1,timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Xt=function(){function t(){mt(this,t),this._jumpStatus=void 0,this.WAITING_QUEUE=[],this.getAccessTokenCount=0,this._accessToken="",this._jsAccessToken="",this.refreshToken="",this._cookies=[],this.accessTokenExpiresIn=0,this.prevGetAccessTokenTimestamp=(new Date).getTime(),this.manualSetAccessToken=!1,this._miniProgramConfig={}}var r,a,u,c=t.prototype;return c.jump=function(){var t=this;return me((function(){return we(this,(function(r){return[2,new Promise((function(r,i){t._jumpStatus?t._jumpStatus===e.JumpStatus.DONE?r(e.JumpStatus.DONE):r(e.JumpStatus.DOING):(t._jumpStatus=e.JumpStatus.DOING,ke({stage:n.REQUEST,type:"log",name:"jump"}),qt("JUMP_LOGIN",{},{success:function(n){var i=n.data;t._miniProgramConfig=(null==i?void 0:i.miniProgramConfig)||{};var o=(null==i?void 0:i.cookiesOAuthLogins)||[],a=o.find((function(e){return e.name===l.JS_TOKEN}));a&&(t._jsAccessToken=a.value,window.ZJSBridge.setJSToken&&window.ZJSBridge.setJSToken(a.value)),t._cookies=o;var s=t._cookies.find((function(e){return e.name===l.ZOAUTH}));(null==s?void 0:s.value)||Lt([{action:"action.jump.login",error:-102,message:"no zoauth",data:{}}]),r(e.JumpStatus.DONE)},fail:function(e){Lt([{action:"action.jump.login",error:-101,message:e.message||"jump error",data:{}}]),i(e)}},{skipJump:!0}))}))]}))}))()},c.loginZaloV3=function(e,t,n){var r=this;return me((function(){var i;return we(this,(function(o){switch(o.label){case 0:return i="".concat(d.GET_ACCESS_TOKEN_V3,"?app_id=").concat(t,"&redirect_uri=").concat(s,"/").concat(e,"/&code=").concat(n,"&isSDK=true"),[4,fetch(i).then(function(){var e=me((function(e){var t,n,i;return we(this,(function(o){switch(o.label){case 0:return[4,e.json()];case 1:return t=o.sent(),n=null==t?void 0:t.access_token,r._accessToken=n,i=1e3*parseInt(t.expires_in),r.accessTokenExpiresIn=i,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(r._accessToken||""),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,o.sent()]}}))}))()},c.loginZaloV4=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this;return me((function(){var i,o;return we(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),ht.isNull(r.refreshToken)||0===r.refreshToken.length?i.append("grant_type","authorization_code"):(i.append("grant_type","refresh_token"),i.append("refresh_token",r.refreshToken||"")),o={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.GET_ACCESS_TOKEN,Ne({method:"POST",body:i},o)).then(function(){var e=me((function(e){var t,n,i,o;return we(this,(function(a){switch(a.label){case 0:return[4,e.json()];case 1:return t=a.sent(),n=(null==t?void 0:t.access_token)||"",i=(null==t?void 0:t.refresh_token)||"",r.refreshToken=i,r._accessToken=n,o=1e3*parseInt(null==t?void 0:t.expires_in),r.accessTokenExpiresIn=o,r.prevGetAccessTokenTimestamp=(new Date).getTime(),window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(n),[2,n]}}))}));return function(t){return e.apply(this,arguments)}}())];case 1:return[2,a.sent()]}}))}))()},c.getAccessToken=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;return me((function(){var n,r,a,s,u,c,d,p,f;function h(){return m.apply(this,arguments)}function m(){return(m=me((function(){return we(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){var t=setInterval((function(){(a.getAccessTokenCount<=1||a._accessToken)&&(e("done"),clearInterval(t))}),200)}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}return we(this,(function(m){switch(m.label){case 0:return r=(new Date).getTime()-t.prevGetAccessTokenTimestamp,(a=t).getAccessTokenCount++,t.getAccessTokenCount>1?[4,h()]:[3,2];case 1:m.sent(),m.label=2;case 2:return t.manualSetAccessToken||t._accessToken.length>0&&r<t.accessTokenExpiresIn&&(null===(n=t._miniProgramConfig)||void 0===n?void 0:n.userAuthorized)?(a.getAccessTokenCount--,[2,Promise.resolve(t._accessToken)]):(t.accessToken="",[4,t.jumpAndGetToken(l.ZOAUTH)]);case 3:return s=m.sent(),[4,t.jumpAndGetToken(l.ZOAUTH_VRF)];case 4:return u=m.sent(),c="zmp.getaccesstoken.fail",e?[4,t.verifyUserAuthorized()]:[3,6];case 5:return d=m.sent(),[3,7];case 6:d=!0,m.label=7;case 7:if(!d)throw a.getAccessTokenCount--,Lt([{action:c,error:-104,message:"no user auth",data:{}}]),$t.error.loginFailed("User Authentication Required");if(!s)return[3,15];m.label=8;case 8:return m.trys.push([8,13,,14]),u?[4,t.loginZaloV4(o,s,u)]:[3,10];case 9:return p=m.sent(),[3,12];case 10:return[4,t.loginZaloV3(o,i,s)];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),Lt([{action:c,error:-103,message:String(f)||"Can not get access token",data:{}}]),[3,14];case 14:return a.getAccessTokenCount--,p?[2,Promise.resolve(t._accessToken)]:(Lt([{action:c,error:-101,message:"no accessToken",data:{}}]),[2,Promise.reject($t.error.loginFailed("Can't get accessToken. Please try again later."))]);case 15:throw a.getAccessTokenCount--,Lt([{action:c,error:-102,message:"no oauth",data:{}}]),$t.error.loginFailed("Zalo app has not been activated")}}))}))()},c.verifyUserAuthorized=function(){var e=this;return me((function(){var t,n,r,i,o,a;return we(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=ln("action.mp.user.authorize"))&&r.isSupported?[4,Jt()]:[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,Yt()];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]}}))}))()},c.setAccessToken=function(e){this.manualSetAccessToken=!0,this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)},c.getJSAccessToken=function(){var e=this;return me((function(){var t;return we(this,(function(n){switch(n.label){case 0:return e._jsAccessToken.length>0?[2,Promise.resolve(e._jsAccessToken)]:[4,e.jumpAndGetToken(l.JS_TOKEN)];case 1:return t=n.sent(),[2,Promise.resolve(t)]}}))}))()},c.getSync=function(e){var t;return null===(t=this._cookies.find((function(t){return t.name===e})))||void 0===t?void 0:t.value},c.jumpAndGetToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;return new Promise(function(){var i=me((function(i){var o,a,s,u;return we(this,(function(c){switch(c.label){case 0:return!n&&r._cookies.length>0?ht.isString(t)?(o=r._cookies.find((function(e){return e.name===t})),[2,i(null==o?void 0:o.value)]):[2,i("")]:(n&&r._jumpStatus===e.JumpStatus.DONE&&(r._jumpStatus=void 0),a={name:t,cb:function(e){return i(e)}},[4,r.jump()]);case 1:return(s=c.sent())===e.JumpStatus.DONE?(r._jumpStatus=s,r.WAITING_QUEUE.length&&(r.WAITING_QUEUE.forEach((function(e){var t=r._cookies.find((function(t){return t.name===e.name}));e.cb(null==t?void 0:t.value)})),r.WAITING_QUEUE=[]),u=r._cookies.find((function(e){return e.name===a.name})),a.cb(null==u?void 0:u.value)):r.WAITING_QUEUE.push(a),[2]}}))}));return function(e){return i.apply(this,arguments)}}())},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},r=t,(a=[{key:"jumpStatus",get:function(){return this._jumpStatus}},{key:"accessToken",set:function(e){this._accessToken=e,window.ZJSBridge.setZAccSession&&window.ZJSBridge.setZAccSession(e)}},{key:"miniProgramConfig",get:function(){return this._miniProgramConfig}}])&&vt(r.prototype,a),u&&vt(r,u),t}(),en=Xt.getInstance(),tn=ut("zmp:utils:common"),nn=function(e){if(ht.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(nn(e[r]));return"["+t.join(",")+"]"}if("object"==typeof e){for(var i in t=[],e)t.push('"'+i+'":'+nn(e[i]));return"{"+t.join(",")+"}"}return e.toString()},rn=function(e){var t,n,r=X[e],i=(null===(t=Oe())||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},on=function(e){try{if(e){tn(e);var t=e.replace(/\\/g,"").replace(/&#39;/g,"'");try{t=decodeURIComponent(atob(e))}catch(e){}return tn("formattedValue",t,JSON.parse(t),st(JSON.parse(t))),JSON.parse(t)}return null}catch(t){return tn("parse json error:",t),e}},an=function(e){if(ht.isObject(JSON)&&JSON.parse&&ht.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 ht.isObject(e)?e:new Function("return "+e)()},sn=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""},un=function(e){return btoa(encodeURIComponent(JSON.stringify(e)))};var cn=function(t){return"hidden"===t?e.StatusBarType.hidden:"transparent"===t?e.StatusBarType.transparent:e.StatusBarType.normal},ln=function(e){if(void 0!==e){var t=en.miniProgramConfig;return((null==t?void 0:t.dynamicApis)||[]).find((function(t){return t.action===e&&!1===t.clientHandle}))}},dn=function(e){if(void 0===e)return!1;var t=en.miniProgramConfig;return((null==t?void 0:t.requiredAuthenList)||[]).indexOf(e)>=0},pn=function(){var e=me((function(){return we(this,(function(e){return[2,new Promise(function(){var e=me((function(e,t){var n;return we(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,en.jumpAndGetToken()];case 1:return t.sent(),n=en.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)}}();function fn(e,t,n,r){var i,o,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=$t.error.badRequest(s);throw c.detail=a,Vt(c,e)}u.push(i.data)}));var c=r.apply(void 0,_e(u));return ht.isPromise(c)?new Promise((function(t,n){c.then((function(e){if(!ht.isNull(a)&&ht.isFunction(a))return a(e);t(c)})).catch((function(t){var r=Vt(t,e);if(!ht.isNull(s)&&ht.isFunction(s))return s(r);n(r)}))})):c}catch(t){if(!ht.isNull(s)&&ht.isFunction(s))return s(t);throw Vt(t,e)}}function hn(e){return mn.apply(this,arguments)}function mn(){return(mn=me((function(e){return we(this,(function(t){return[2,fn("login",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,en.jumpAndGetToken(l.ZOAUTH)]:[3,2];case 1:return e.sent(),[2,"Success"];case 2:return Ae.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("login",{}))]}}))})))]}))}))).apply(this,arguments)}function vn(e){return yn.apply(this,arguments)}function yn(){return(yn=me((function(e){return we(this,(function(t){return[2,fn("getAccessToken",[],[e],me((function(){var e;return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,pn()]:[3,3];case 1:return e=!t.sent(),[4,en.getAccessToken(e)];case 2:return[2,t.sent()||""];case 3:return Ae.isMpWeb?[2,Promise.resolve("")]:[2,Promise.reject(Ie("getAccessToken",{}))]}}))})))]}))}))).apply(this,arguments)}var gn,_n="3.0.9";function wn(){return fn("getVersion",[],[],(function(){return _n}))}function bn(){var e,t;return{version:sn("version-id")||"",apiVersion:_n,zaloVersion:(null===(e=Oe())||void 0===e?void 0:e.zaloVersion)||"",platform:(null===(t=Oe())||void 0===t?void 0:t.platformName)||"",language:navigator.language,zaloLanguage:window.zLanguage||"vi",zaloTheme:window.zTheme||"light"}}function Tn(){return fn("getSystemInfo",[],[],(function(){return bn()}))}!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}(gn||(gn={}));const En=gn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sn=e=>{switch(typeof e){case"undefined":return En.undefined;case"string":return En.string;case"number":return isNaN(e)?En.nan:En.number;case"boolean":return En.boolean;case"function":return En.function;case"bigint":return En.bigint;case"symbol":return En.symbol;case"object":return Array.isArray(e)?En.array:null===e?En.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?En.promise:"undefined"!=typeof Map&&e instanceof Map?En.map:"undefined"!=typeof Set&&e instanceof Set?En.set:"undefined"!=typeof Date&&e instanceof Date?En.date:En.object;default:return En.unknown}},Pn=gn.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 On 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,gn.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()}}On.create=e=>new On(e);const An=(e,t)=>{let n;switch(e.code){case Pn.invalid_type:n=e.received===En.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Pn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gn.jsonStringifyReplacer)}`;break;case Pn.unrecognized_keys:n=`Unrecognized key(s) in object: ${gn.joinValues(e.keys,", ")}`;break;case Pn.invalid_union:n="Invalid input";break;case Pn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gn.joinValues(e.options)}`;break;case Pn.invalid_enum_value:n=`Invalid enum value. Expected ${gn.joinValues(e.options)}, received '${e.received}'`;break;case Pn.invalid_arguments:n="Invalid function arguments";break;case Pn.invalid_return_type:n="Invalid function return type";break;case Pn.invalid_date:n="Invalid date";break;case Pn.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}"`:gn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Pn.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 Pn.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 Pn.custom:n="Invalid input";break;case Pn.invalid_intersection_types:n="Intersection results could not be merged";break;case Pn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Pn.not_finite:n="Number must be finite";break;default:n=t.defaultError,gn.assertNever(e)}return{message:n}};let kn=An;function In(){return kn}const Cn=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 Nn(e,t){const n=Cn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,In(),An].filter((e=>!!e))});e.common.issues.push(n)}class Mn{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 xn;"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 Mn.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 xn;if("aborted"===i.status)return xn;"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 xn=Object.freeze({status:"aborted"}),Rn=e=>({status:"dirty",value:e}),Dn=e=>({status:"valid",value:e}),jn=e=>"aborted"===e.status,Un=e=>"dirty"===e.status,Bn=e=>"valid"===e.status,Ln=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Zn;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(Zn||(Zn={}));class zn{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 Wn=(e,t)=>{if(Bn(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 On(e.common.issues)}};function Fn(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 Gn{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 Sn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Mn,ctx:{common:e.parent.common,data:e.data,parsedType:Sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ln(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:Sn(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Wn(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:Sn(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Ln(r)?r:Promise.resolve(r));return Wn(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:Pn.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 kr({schema:this,typeName:Lr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ir.create(this,this._def)}nullable(){return Cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ur.create(this,this._def)}promise(){return Ar.create(this,this._def)}or(e){return pr.create([this,e],this._def)}and(e){return vr.create(this,e,this._def)}transform(e){return new kr({...Fn(this._def),schema:this,typeName:Lr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Nr({...Fn(this._def),innerType:this,defaultValue:t,typeName:Lr.ZodDefault})}brand(){return new Dr({typeName:Lr.ZodBranded,type:this,...Fn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Mr({...Fn(this._def),innerType:this,catchValue:t,typeName:Lr.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return jr.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Hn=/^c[^\s-]{8,}$/i,Vn=/^[a-z][a-z0-9]*$/,Kn=/^([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,Jn=/^(([^<>()[\]\\.,;:\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 qn extends Gn{constructor(){super(...arguments),this._regex=(e,t,n)=>this.refinement((t=>e.test(t)),{validation:t,code:Pn.invalid_string,...Zn.errToObj(n)}),this.nonempty=e=>this.min(1,Zn.errToObj(e)),this.trim=()=>new qn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==En.string){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.string,received:t.parsedType}),xn}const t=new Mn;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),Nn(n,{code:Pn.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),Nn(n,{code:Pn.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?Nn(n,{code:Pn.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Nn(n,{code:Pn.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Jn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"email",code:Pn.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Kn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"uuid",code:Pn.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Hn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"cuid",code:Pn.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Vn.test(e.data)||(n=this._getOrReturnCtx(e,n),Nn(n,{validation:"cuid2",code:Pn.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),Nn(n,{validation:"url",code:Pn.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),Nn(n,{validation:"regex",code:Pn.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),Nn(n,{code:Pn.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),Nn(n,{code:Pn.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),Nn(n,{code:Pn.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else gn.assertNever(i);var r;return{status:t.value,value:e.data}}_addCheck(e){return new qn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Zn.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,...Zn.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Zn.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Zn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Zn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Zn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Zn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Zn.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 $n(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)}qn.create=e=>{var t;return new qn({checks:[],typeName:Lr.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Fn(e)})};class Qn extends Gn{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)!==En.number){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.number,received:t.parsedType}),xn}let t;const n=new Mn;for(const r of this._def.checks)if("int"===r.kind)gn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Nn(t,{code:Pn.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),Nn(t,{code:Pn.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),Nn(t,{code:Pn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==$n(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Nn(t,{code:Pn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Nn(t,{code:Pn.not_finite,message:r.message}),n.dirty()):gn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Zn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Zn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Zn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Zn.toString(t))}setLimit(e,t,n,r){return new Qn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Zn.toString(r)}]})}_addCheck(e){return new Qn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Zn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Zn.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&&gn.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)}}Qn.create=e=>new Qn({checks:[],typeName:Lr.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...Fn(e)});class Yn extends Gn{_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==En.bigint){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.bigint,received:t.parsedType}),xn}return Dn(e.data)}}Yn.create=e=>{var t;return new Yn({typeName:Lr.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...Fn(e)})};class Xn extends Gn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==En.boolean){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.boolean,received:t.parsedType}),xn}return Dn(e.data)}}Xn.create=e=>new Xn({typeName:Lr.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...Fn(e)});class er extends Gn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==En.date){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.date,received:t.parsedType}),xn}if(isNaN(e.data.getTime())){return Nn(this._getOrReturnCtx(e),{code:Pn.invalid_date}),xn}const t=new Mn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Nn(n,{code:Pn.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),Nn(n,{code:Pn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):gn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new er({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Zn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Zn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}er.create=e=>new er({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Lr.ZodDate,...Fn(e)});class tr extends Gn{_parse(e){if(this._getType(e)!==En.symbol){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.symbol,received:t.parsedType}),xn}return Dn(e.data)}}tr.create=e=>new tr({typeName:Lr.ZodSymbol,...Fn(e)});class nr extends Gn{_parse(e){if(this._getType(e)!==En.undefined){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.undefined,received:t.parsedType}),xn}return Dn(e.data)}}nr.create=e=>new nr({typeName:Lr.ZodUndefined,...Fn(e)});class rr extends Gn{_parse(e){if(this._getType(e)!==En.null){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.null,received:t.parsedType}),xn}return Dn(e.data)}}rr.create=e=>new rr({typeName:Lr.ZodNull,...Fn(e)});class ir extends Gn{constructor(){super(...arguments),this._any=!0}_parse(e){return Dn(e.data)}}ir.create=e=>new ir({typeName:Lr.ZodAny,...Fn(e)});class or extends Gn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Dn(e.data)}}or.create=e=>new or({typeName:Lr.ZodUnknown,...Fn(e)});class ar extends Gn{_parse(e){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.never,received:t.parsedType}),xn}}ar.create=e=>new ar({typeName:Lr.ZodNever,...Fn(e)});class sr extends Gn{_parse(e){if(this._getType(e)!==En.undefined){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.void,received:t.parsedType}),xn}return Dn(e.data)}}sr.create=e=>new sr({typeName:Lr.ZodVoid,...Fn(e)});class ur extends Gn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==En.array)return Nn(t,{code:Pn.invalid_type,expected:En.array,received:t.parsedType}),xn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Nn(t,{code:e?Pn.too_big:Pn.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&&(Nn(t,{code:Pn.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&&(Nn(t,{code:Pn.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 zn(t,e,t.path,n))))).then((e=>Mn.mergeArray(n,e)));const i=[...t.data].map(((e,n)=>r.type._parseSync(new zn(t,e,t.path,n))));return Mn.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new ur({...this._def,minLength:{value:e,message:Zn.toString(t)}})}max(e,t){return new ur({...this._def,maxLength:{value:e,message:Zn.toString(t)}})}length(e,t){return new ur({...this._def,exactLength:{value:e,message:Zn.toString(t)}})}nonempty(e){return this.min(1,e)}}var cr;function lr(e){if(e instanceof dr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ir.create(lr(r))}return new dr({...e._def,shape:()=>t})}return e instanceof ur?ur.create(lr(e.element)):e instanceof Ir?Ir.create(lr(e.unwrap())):e instanceof Cr?Cr.create(lr(e.unwrap())):e instanceof yr?yr.create(e.items.map((e=>lr(e)))):e}ur.create=(e,t)=>new ur({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Lr.ZodArray,...Fn(t)}),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(cr||(cr={}));class dr extends Gn{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=gn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==En.object){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.object,received:t.parsedType}),xn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ar&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||o.push(e);const a=[];for(const e of i){const t=r[e],i=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new zn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ar){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)o.length>0&&(Nn(n,{code:Pn.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 zn(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=>Mn.mergeObjectSync(t,e))):Mn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Zn.errToObj,new dr({...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=Zn.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new dr({...this._def,unknownKeys:"strip"})}passthrough(){return new dr({...this._def,unknownKeys:"passthrough"})}extend(e){return new dr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>cr.mergeShapes(this._def.shape(),e._def.shape()),typeName:Lr.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new dr({...this._def,catchall:e})}pick(e){const t={};return gn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new dr({...this._def,shape:()=>t})}omit(e){const t={};return gn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new dr({...this._def,shape:()=>t})}deepPartial(){return lr(this)}partial(e){const t={};return gn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new dr({...this._def,shape:()=>t})}required(e){const t={};return gn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ir;)e=e._def.innerType;t[n]=e}})),new dr({...this._def,shape:()=>t})}keyof(){return Sr(gn.objectKeys(this.shape))}}dr.create=(e,t)=>new dr({shape:()=>e,unknownKeys:"strip",catchall:ar.create(),typeName:Lr.ZodObject,...Fn(t)}),dr.strictCreate=(e,t)=>new dr({shape:()=>e,unknownKeys:"strict",catchall:ar.create(),typeName:Lr.ZodObject,...Fn(t)}),dr.lazycreate=(e,t)=>new dr({shape:e,unknownKeys:"strip",catchall:ar.create(),typeName:Lr.ZodObject,...Fn(t)});class pr extends Gn{_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 On(e.ctx.common.issues)));return Nn(t,{code:Pn.invalid_union,unionErrors:n}),xn}));{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 On(e)));return Nn(t,{code:Pn.invalid_union,unionErrors:i}),xn}}get options(){return this._def.options}}pr.create=(e,t)=>new pr({options:e,typeName:Lr.ZodUnion,...Fn(t)});const fr=e=>e instanceof Tr?fr(e.schema):e instanceof kr?fr(e.innerType()):e instanceof Er?[e.value]:e instanceof Pr?e.options:e instanceof Or?Object.keys(e.enum):e instanceof Nr?fr(e._def.innerType):e instanceof nr?[void 0]:e instanceof rr?[null]:null;class hr extends Gn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==En.object)return Nn(t,{code:Pn.invalid_type,expected:En.object,received:t.parsedType}),xn;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}):(Nn(t,{code:Pn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),xn)}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=fr(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 hr({typeName:Lr.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Fn(n)})}}function mr(e,t){const n=Sn(e),r=Sn(t);if(e===t)return{valid:!0,data:e};if(n===En.object&&r===En.object){const n=gn.objectKeys(t),r=gn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),i={...e,...t};for(const n of r){const r=mr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===En.array&&r===En.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=mr(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===En.date&&r===En.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class vr extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(jn(e)||jn(r))return xn;const i=mr(e.value,r.value);return i.valid?((Un(e)||Un(r))&&t.dirty(),{status:t.value,value:i.data}):(Nn(n,{code:Pn.invalid_intersection_types}),xn)};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}))}}vr.create=(e,t,n)=>new vr({left:e,right:t,typeName:Lr.ZodIntersection,...Fn(n)});class yr extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==En.array)return Nn(n,{code:Pn.invalid_type,expected:En.array,received:n.parsedType}),xn;if(n.data.length<this._def.items.length)return Nn(n,{code:Pn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),xn;!this._def.rest&&n.data.length>this._def.items.length&&(Nn(n,{code:Pn.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 zn(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>Mn.mergeArray(t,e))):Mn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new yr({...this._def,rest:e})}}yr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yr({items:e,typeName:Lr.ZodTuple,rest:null,...Fn(t)})};class gr extends Gn{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!==En.object)return Nn(n,{code:Pn.invalid_type,expected:En.object,received:n.parsedType}),xn;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new zn(n,e,n.path,e)),value:o._parse(new zn(n,n.data[e],n.path,e))});return n.common.async?Mn.mergeObjectAsync(t,r):Mn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new gr(t instanceof Gn?{keyType:e,valueType:t,typeName:Lr.ZodRecord,...Fn(n)}:{keyType:qn.create(),valueType:e,typeName:Lr.ZodRecord,...Fn(t)})}}class _r extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==En.map)return Nn(n,{code:Pn.invalid_type,expected:En.map,received:n.parsedType}),xn;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],o)=>({key:r._parse(new zn(n,e,n.path,[o,"key"])),value:i._parse(new zn(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 xn;"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 xn;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}_r.create=(e,t,n)=>new _r({valueType:t,keyType:e,typeName:Lr.ZodMap,...Fn(n)});class wr extends Gn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==En.set)return Nn(n,{code:Pn.invalid_type,expected:En.set,received:n.parsedType}),xn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Nn(n,{code:Pn.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&&(Nn(n,{code:Pn.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 xn;"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 zn(n,e,n.path,t))));return n.common.async?Promise.all(a).then((e=>o(e))):o(a)}min(e,t){return new wr({...this._def,minSize:{value:e,message:Zn.toString(t)}})}max(e,t){return new wr({...this._def,maxSize:{value:e,message:Zn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}wr.create=(e,t)=>new wr({valueType:e,minSize:null,maxSize:null,typeName:Lr.ZodSet,...Fn(t)});class br extends Gn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==En.function)return Nn(t,{code:Pn.invalid_type,expected:En.function,received:t.parsedType}),xn;function n(e,n){return Cn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,In(),An].filter((e=>!!e)),issueData:{code:Pn.invalid_arguments,argumentsError:n}})}function r(e,n){return Cn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,In(),An].filter((e=>!!e)),issueData:{code:Pn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Ar?Dn((async(...e)=>{const t=new On([]),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}))})):Dn(((...e)=>{const t=this._def.args.safeParse(e,i);if(!t.success)throw new On([n(e,t.error)]);const a=o(...t.data),s=this._def.returns.safeParse(a,i);if(!s.success)throw new On([r(a,s.error)]);return s.data}))}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new br({...this._def,args:yr.create(e).rest(or.create())})}returns(e){return new br({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new br({args:e||yr.create([]).rest(or.create()),returns:t||or.create(),typeName:Lr.ZodFunction,...Fn(n)})}}class Tr extends Gn{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})}}Tr.create=(e,t)=>new Tr({getter:e,typeName:Lr.ZodLazy,...Fn(t)});class Er extends Gn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Nn(t,{received:t.data,code:Pn.invalid_literal,expected:this._def.value}),xn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Sr(e,t){return new Pr({values:e,typeName:Lr.ZodEnum,...Fn(t)})}Er.create=(e,t)=>new Er({value:e,typeName:Lr.ZodLiteral,...Fn(t)});class Pr extends Gn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Nn(t,{expected:gn.joinValues(n),received:t.parsedType,code:Pn.invalid_type}),xn}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Nn(t,{received:t.data,code:Pn.invalid_enum_value,options:n}),xn}return Dn(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 Pr.create(e)}exclude(e){return Pr.create(this.options.filter((t=>!e.includes(t))))}}Pr.create=Sr;class Or extends Gn{_parse(e){const t=gn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==En.string&&n.parsedType!==En.number){const e=gn.objectValues(t);return Nn(n,{expected:gn.joinValues(e),received:n.parsedType,code:Pn.invalid_type}),xn}if(-1===t.indexOf(e.data)){const e=gn.objectValues(t);return Nn(n,{received:n.data,code:Pn.invalid_enum_value,options:e}),xn}return Dn(e.data)}get enum(){return this._def.values}}Or.create=(e,t)=>new Or({values:e,typeName:Lr.ZodNativeEnum,...Fn(t)});class Ar extends Gn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==En.promise&&!1===t.common.async)return Nn(t,{code:Pn.invalid_type,expected:En.promise,received:t.parsedType}),xn;const n=t.parsedType===En.promise?t.data:Promise.resolve(t.data);return Dn(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ar.create=(e,t)=>new Ar({type:e,typeName:Lr.ZodPromise,...Fn(t)});class kr extends Gn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Lr.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=>{Nn(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?xn:("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?xn:("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(!Bn(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=>Bn(e)?Promise.resolve(r.transform(e.value,i)).then((e=>({status:t.value,value:e}))):e))}gn.assertNever(r)}}kr.create=(e,t,n)=>new kr({schema:e,typeName:Lr.ZodEffects,effect:t,...Fn(n)}),kr.createWithPreprocess=(e,t,n)=>new kr({schema:t,effect:{type:"preprocess",transform:e},typeName:Lr.ZodEffects,...Fn(n)});class Ir extends Gn{_parse(e){return this._getType(e)===En.undefined?Dn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ir.create=(e,t)=>new Ir({innerType:e,typeName:Lr.ZodOptional,...Fn(t)});class Cr extends Gn{_parse(e){return this._getType(e)===En.null?Dn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Cr.create=(e,t)=>new Cr({innerType:e,typeName:Lr.ZodNullable,...Fn(t)});class Nr extends Gn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===En.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Nr.create=(e,t)=>new Nr({innerType:e,typeName:Lr.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Fn(t)});class Mr extends Gn{_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 Ln(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}}Mr.create=(e,t)=>new Mr({innerType:e,typeName:Lr.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Fn(t)});class xr extends Gn{_parse(e){if(this._getType(e)!==En.nan){const t=this._getOrReturnCtx(e);return Nn(t,{code:Pn.invalid_type,expected:En.nan,received:t.parsedType}),xn}return{status:"valid",value:e.data}}}xr.create=e=>new xr({typeName:Lr.ZodNaN,...Fn(e)});const Rr=Symbol("zod_brand");class Dr extends Gn{_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 jr extends Gn{_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?xn:"dirty"===e.status?(t.dirty(),Rn(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?xn:"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 jr({in:e,out:t,typeName:Lr.ZodPipeline})}}const Ur=(e,t={},n)=>e?ir.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})}})):ir.create(),Br={object:dr.lazycreate};var Lr;!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"}(Lr||(Lr={}));const Zr=qn.create,zr=Qn.create,Wr=xr.create,Fr=Yn.create,Gr=Xn.create,Hr=er.create,Vr=tr.create,Kr=nr.create,Jr=rr.create,qr=ir.create,$r=or.create,Qr=ar.create,Yr=sr.create,Xr=ur.create,ei=dr.create,ti=dr.strictCreate,ni=pr.create,ri=hr.create,ii=vr.create,oi=yr.create,ai=gr.create,si=_r.create,ui=wr.create,ci=br.create,li=Tr.create,di=Er.create,pi=Pr.create,fi=Or.create,hi=Ar.create,mi=kr.create,vi=Ir.create,yi=Cr.create,gi=kr.createWithPreprocess,_i=jr.create,wi={string:e=>qn.create({...e,coerce:!0}),number:e=>Qn.create({...e,coerce:!0}),boolean:e=>Xn.create({...e,coerce:!0}),bigint:e=>Yn.create({...e,coerce:!0}),date:e=>er.create({...e,coerce:!0})},bi=xn;var Ti=Object.freeze({__proto__:null,defaultErrorMap:An,setErrorMap:function(e){kn=e},getErrorMap:In,makeIssue:Cn,EMPTY_PATH:[],addIssueToContext:Nn,ParseStatus:Mn,INVALID:xn,DIRTY:Rn,OK:Dn,isAborted:jn,isDirty:Un,isValid:Bn,isAsync:Ln,get util(){return gn},ZodParsedType:En,getParsedType:Sn,ZodType:Gn,ZodString:qn,ZodNumber:Qn,ZodBigInt:Yn,ZodBoolean:Xn,ZodDate:er,ZodSymbol:tr,ZodUndefined:nr,ZodNull:rr,ZodAny:ir,ZodUnknown:or,ZodNever:ar,ZodVoid:sr,ZodArray:ur,get objectUtil(){return cr},ZodObject:dr,ZodUnion:pr,ZodDiscriminatedUnion:hr,ZodIntersection:vr,ZodTuple:yr,ZodRecord:gr,ZodMap:_r,ZodSet:wr,ZodFunction:br,ZodLazy:Tr,ZodLiteral:Er,ZodEnum:Pr,ZodNativeEnum:Or,ZodPromise:Ar,ZodEffects:kr,ZodTransformer:kr,ZodOptional:Ir,ZodNullable:Cr,ZodDefault:Nr,ZodCatch:Mr,ZodNaN:xr,BRAND:Rr,ZodBranded:Dr,ZodPipeline:jr,custom:Ur,Schema:Gn,ZodSchema:Gn,late:Br,get ZodFirstPartyTypeKind(){return Lr},coerce:wi,any:qr,array:Xr,bigint:Fr,boolean:Gr,date:Hr,discriminatedUnion:ri,effect:mi,enum:pi,function:ci,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Ur((t=>t instanceof e),t,!0),intersection:ii,lazy:li,literal:di,map:si,nan:Wr,nativeEnum:fi,never:Qr,null:Jr,nullable:yi,number:zr,object:ei,oboolean:()=>Gr().optional(),onumber:()=>zr().optional(),optional:vi,ostring:()=>Zr().optional(),pipeline:_i,preprocess:gi,promise:hi,record:ai,set:ui,strictObject:ti,string:Zr,symbol:Vr,transformer:mi,tuple:oi,undefined:Kr,union:ni,unknown:$r,void:Yr,NEVER:bi,ZodIssueCode:Pn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:On}),Ei=function(){function t(){var e,n,r,i,a,u,c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,k,I;mt(this,t),this.initConfig=window.APP_CONFIG;var C=ht.isString(null===(e=this.initConfig)||void 0===e||null===(n=e.app)||void 0===n?void 0:n.headerColor)&&(null===(r=this.initConfig)||void 0===r||null===(i=r.app)||void 0===i||null===(a=i.headerColor)||void 0===a?void 0:a.length)>0?ce:le;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,x="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)?ue.HIDE_BACK:ue.SHOW_BACK,R="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)?ue.SHOW_HOME:ue.HIDE_HOME,D=new URL(location.href),j=cn(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)?le:ce);this.config={actionbarType:C,buttonType:x,statusbarType:j,dataConfig:{backgroundColor:(null===(S=this.initConfig)||void 0===S||null===(P=S.app)||void 0===P?void 0:P.headerColor)||de,textColor:(null===(O=this.initConfig)||void 0===O||null===(A=O.app)||void 0===A?void 0:A.textColor)||"",textAlign:(null===(k=this.initConfig)||void 0===k||null===(I=k.app)||void 0===I?void 0:I.textAlign)||pe,viewInLeftType:x,confirmToExit:1},homeConfig:{enable:R,url:"".concat(s,"/").concat(o,"/").concat(D.search)}}}var n=t.prototype;return n.setNavigationBarTitle=function(e){return me((function(){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("CHANGE_TITLE_HEADER",{title:e},{success:function(){t(),document.title=e},fail:function(e){n(e)}},{timeout:!1})}))]}))}))()},n.setNavigationBarLeftButton=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config.dataConfig.confirmToExit,n=this;return me((function(){var r,i;return we(this,(function(o){return void 0===(void 0===e?"undefined":st(e))&&null===(void 0===e?"undefined":st(e))||(r="none"===e||"home"===e?ue.HIDE_BACK:ue.SHOW_BACK,i="home"===e||"both"===e?ue.SHOW_HOME:ue.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){Qt("CHANGE_ACTIONBAR_LEFTBUTTON_TYPE",Ne({},n.config),{success:function(){e()},fail:function(e){t(e)}},{timeout:!1})}))]}))}))()},n.setAndroidBottomNavigationBar=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return me((function(){var r,i,o;return we(this,(function(a){return i=t?e.AndroidBottomNavigationBarType.hide:e.AndroidBottomNavigationBarType.show,o=null===(r=Oe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isAndroid))return e();Qt("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideAndroidBottomNavigationBar=!!t,window.ANDROID_BOTTOM_NAVIGATION_BAR_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1})}))]}))}))()},n.setIOSBottomSafeArea=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;return me((function(){var r,i,o;return we(this,(function(a){return i=t?e.IOSSafeAreaBottomType.hide:e.IOSSafeAreaBottomType.show,o=null===(r=Oe())||void 0===r?void 0:r.platform,[2,new Promise((function(e,r){if(!(null==o?void 0:o.isIOS))return e();Qt("CHANGE_BOTTOMBAR",{bottombarType:i},{success:function(){n.hideIOSSafeAreaBottom=!!t,window.IOS_BOTTOM_SAFE_AREA_HIDDEN=!!t,e()},fail:function(e){r(e)}},{timeout:!1,delay:200})}))]}))}))()},n.configHeader=function(t){var n=this;return me((function(){var r;return we(this,(function(i){return r=n.config,ht.isString(t.headerColor)&&(r.dataConfig.backgroundColor=t.headerColor),ht.isString(t.headerTextColor)&&(r.dataConfig.textColor=t.headerTextColor),ht.isString(t.textAlign)&&("left"===t.textAlign?r.dataConfig.textAlign=e.TextAlignType.left:"center"===t.textAlign&&(r.dataConfig.textAlign=e.TextAlignType.center)),!0===t.hideActionBar?r.actionbarType=le:!1===t.hideActionBar&&(r.actionbarType=ce),"normal"===t.statusBarType?r.statusbarType=e.StatusBarType.normal:"hidden"===t.statusBarType?r.statusbarType=e.StatusBarType.hidden:"transparent"===t.statusBarType&&(r.statusbarType=e.StatusBarType.transparent),[2,new Promise((function(i,o){Qt("CHANGE_ACTIONBAR",Ne({},r),{success:function(){var o;n.config=Ne({},r);var a,s=null===(o=Oe())||void 0===o?void 0:o.platform;window.STATUS_BAR_TYPE=(a=n.config.statusbarType)===e.StatusBarType.hidden?"hidden":a===e.StatusBarType.transparent?"transparent":"normal",window.ACTION_BAR_HIDDEN=n.config.actionbarType===le;var u=null===document||void 0===document?void 0:document.querySelector(":root");if(null==s?void 0:s.isAndroid){var c=0;if(("hidden"===t.statusBarType||"transparent"===t.statusBarType)&&t.hideActionBar){var l=window.ANDROID_STATUS_BAR_HEIGHT;isNaN(l)&&(l=Math.round(ZaloJavaScriptInterface.getStatusBarHeight()/window.devicePixelRatio)),c=l}c?null==u||u.style.setProperty("--zaui-safe-area-inset-top","".concat(c,"px")):null==u||u.style.setProperty("--zaui-safe-area-inset-top","env(safe-area-inset-top, 0px)")}i()},fail:function(e){o(e)}},{timeout:!1})}))]}))}))()},t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t}(),Si=Ei.getInstance(),Pi=[ei({title:Zr()}).optional()];function Oi(e){return Ai.apply(this,arguments)}function Ai(){return Ai=me((function(e){return we(this,(function(t){return[2,fn("setNavigationBarTitle",Pi,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Si.setNavigationBarTitle(e.title)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarTitle",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ai.apply(this,arguments)}var ki=[ei({color:Zr(),textColor:Ti.enum(["black","white"]).optional(),statusBarColor:Zr().optional()}).optional()];function Ii(e){return Ci.apply(this,arguments)}function Ci(){return Ci=me((function(e){return we(this,(function(t){return[2,fn("setNavigationBarColor",ki,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Si.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 Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarColor",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ci.apply(this,arguments)}var Ni=[ei({type:Ti.enum(["none","back","home","both"])}).optional()];function Mi(e){return xi.apply(this,arguments)}function xi(){return xi=me((function(e){return we(this,(function(t){return[2,fn("setNavigationBarLeftButton",Ni,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Si.setNavigationBarLeftButton(e.type)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setNavigationBarLeftButton",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xi.apply(this,arguments)}function Ri(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Di(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ri(e,t,"get"))}function ji(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 Ui(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,Ri(e,t,"set"),n),n}var Bi,Li,Zi,zi=new WeakMap,Wi=new WeakMap,Fi=new WeakMap,Gi=function(){function e(t){mt(this,e),ji(this,zi,{writable:!0,value:localStorage}),ji(this,Wi,{writable:!0,value:void 0}),ji(this,Fi,{writable:!0,value:void 0}),Ui(this,Fi,{keys:new Set,currentSize:0,limitSize:ne}),Ui(this,Wi,t),this.findAllCurrentDataByApp(t)}var t=e.prototype;return t.findAllCurrentDataByApp=function(e){try{var t;for(t in Di(this,zi)){if(e)if(t.split("_")[0]!==e)continue;Di(this,Fi).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 Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,Fi).keys.has(e)?Di(this,zi).getItem(e):null},t.set=function(e){var t=this;return me((function(){return we(this,(function(n){return Object.entries(e).forEach((function(e){var n=Me(e,2),r=n[0],i=n[1];t.setSync(r,i.replace(/\\"/g,'"'))})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.setSync=function(e,t){Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,zi).setItem(e,t),Di(this,Fi).keys.add(e)},t.getInfo=function(){var e=this;return me((function(){return we(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}(Di(this,zi),Di(this,Wi));return{currentSize:ht.isNumber(e)?Number((e/1024).toFixed(2)):0,limitSize:Number((ne/1024).toFixed(2))}},t.remove=function(e){var t=this;return me((function(){return we(this,(function(n){return e.forEach((function(e){t.removeSync(e)})),[2,Promise.resolve({errorKeys:[]})]}))}))()},t.removeSync=function(e){Di(this,Wi)&&(e="".concat(Di(this,Wi),"_").concat(e)),Di(this,Fi).keys.has(e)&&(Di(this,zi).removeItem(e),Di(this,Fi).keys.delete(e))},t.clear=function(){var e=this;return me((function(){return we(this,(function(t){return[2,Promise.resolve(e.clearSync())]}))}))()},t.clearSync=function(){var e=this;Di(this,Fi).keys.forEach((function(t){Di(e,Wi)&&t.indexOf(Di(e,Wi))<0||(Di(e,zi).removeItem(t),Di(e,Fi).keys.delete(t))}))},e}(),Hi=new WeakMap,Vi=new WeakMap,Ki=function(){function e(t){mt(this,e),ji(this,Hi,{writable:!0,value:void 0}),ji(this,Vi,{writable:!0,value:void 0}),Ui(this,Vi,{keys:new Set,currentSize:0,limitSize:ne}),Ui(this,Hi,t)}var t=e.prototype;return t.get=function(e){var t=this;return me((function(){return we(this,(function(n){return[2,new Promise((function(n,r){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.get",mpds_data:{keys:e},appId:Di(t,Hi)},{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 me((function(){return we(this,(function(n){return[2,new Promise((function(n,r){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.set",mpds_data:{map:e},appId:Di(t,Hi)},{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 me((function(){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.get.size",mpds_data:{},appId:Di(e,Hi)},{success:function(e){var n=0;e&&e.mpds_data&&e.mpds_data.size&&(n=e.mpds_data.size),t({currentSize:ht.isNumber(n)?Number(Number(n)/1024):0,limitSize:Number(ne/1024)})},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},t.remove=function(e){var t=this;return me((function(){return we(this,(function(n){return[2,new Promise((function(n,r){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.remove.key",mpds_data:{keys:e},appId:Di(t,Hi)},{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 me((function(){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("ZBROWSER_MPDS",{mpds_action:"mpds.clear.appData",mpds_data:{},appId:Di(e,Hi)},{success:function(){t()},fail:function(e){n(e)}},{isMultiCallback:!1})}))]}))}))()},e}(),Ji=function(){function e(){mt(this,e)}var t=e.prototype;return t.getDataFromStorage=function(e){var t=this;return me((function(){var n,r;return we(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]=on(e)})),[2,r]}}))}))()},t.putDataToStorage=function(e){var t=this;return me((function(){var n,r;return we(this,(function(i){switch(i.label){case 0:return n=t.getInstance(),r={},Object.entries(e).forEach((function(e){var t=Me(e,2),n=t[0],i=t[1];ht.isUndefined(i)||ht.isNull(i)||(r[n]=un(i))})),[4,n.set(r)];case 1:return[2,i.sent()]}}))}))()},t.removeDataFromStorage=function(e){var t=this;return me((function(){return we(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 me((function(){return we(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 me((function(){return we(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),qi=new WeakMap,$i=function(e){Tt(n,e);var t=St(n);function n(e){var r;return mt(this,n),ji(Et(r=t.call(this)),qi,{writable:!0,value:void 0}),Ui(Et(r),qi,e),r}return n.prototype.getInstance=function(){return new Gi(Di(this,qi))},n}(Ji),Qi=new WeakMap,Yi=function(e){Tt(n,e);var t=St(n);function n(e){var r;return mt(this,n),ji(Et(r=t.call(this)),Qi,{writable:!0,value:void 0}),Ui(Et(r),Qi,e),r}return n.prototype.getInstance=function(){return new Ki(Di(this,Qi))},n}(Ji),Xi=new $i(o),eo=(null===(Bi=Oe())||void 0===Bi?void 0:Bi.zaloVersion)||"",to=(null===(Li=Oe())||void 0===Li?void 0:Li.platformName)||"unknown";!!ht.isString(eo)&&parseInt(eo,10)>={android:12100571,iOS:400,wp:0,unknown:0}[to]&&(null===(Zi=Oe())||void 0===Zi?void 0:Zi.appEnv.isMp)&&(Xi=new Yi(o));var no=Xi,ro=[ei({data:Ti.record(Zr(),Ti.any())}).optional()];function io(e){return oo.apply(this,arguments)}function oo(){return oo=me((function(e){return we(this,(function(t){return[2,fn("setStorage",ro,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp||Ae.isMpWeb?[4,no.putDataToStorage(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("setStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),oo.apply(this,arguments)}var ao=[ei({keys:Ti.array(Zr())}).optional()];function so(e){return uo.apply(this,arguments)}function uo(){return uo=me((function(e){return we(this,(function(t){return[2,fn("getStorage",ao,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp||Ae.isMpWeb?[4,no.getDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("getStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),uo.apply(this,arguments)}function co(e){return lo.apply(this,arguments)}function lo(){return(lo=me((function(e){return we(this,(function(t){return[2,fn("getStorageInfo",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp||Ae.isMpWeb?[4,no.getStorageInfo()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("getStorageInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var po=[ei({keys:Ti.array(Zr())}).optional()];function fo(e){return ho.apply(this,arguments)}function ho(){return ho=me((function(e){return we(this,(function(t){return[2,fn("removeStorage",po,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp||Ae.isMpWeb?[4,no.removeDataFromStorage(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,Promise.reject(Ie("removeStorage",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ho.apply(this,arguments)}var mo=[ei({prefix:Zr().optional()}).optional()];function vo(e){return yo.apply(this,arguments)}function yo(){return(yo=me((function(e){return we(this,(function(t){return[2,fn("clearStorage",mo,[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp||Ae.isMpWeb?[4,no.clearStorage()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(Ie("clearStorage",{}))]}}))})))]}))}))).apply(this,arguments)}var go=function(){var e=me((function(e,t){var n,r,i,a;return we(this,(function(s){switch(s.label){case 0:return(r=t)?[3,2]:[4,pn()];case 1:r=!s.sent(),s.label=2;case 2:return n=r,[4,en.getAccessToken(n)];case 3:return i=s.sent(),a="id,name,user_id_by_oa,is_sensitive",a=e?"".concat(a,",picture.type(").concat(e,")"):"".concat(a,",picture"),[4,fetch("".concat(d.GET_USER_INFO,"?fields=").concat(a,"&miniapp_id=").concat(o),{headers:{access_token:i||""}}).then(function(){var e=me((function(e){var t,n,r,i;return we(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)}}(),_o=[ei({avatarType:Ti.enum(["small","normal","large"]).optional(),autoRequestPermission:Ti.boolean().default(!1).optional()}).optional()];function wo(e){return bo.apply(this,arguments)}function bo(){return bo=me((function(e){return we(this,(function(t){return[2,fn("getUserInfo",_o,[e],function(){var e=me((function(e){var t,n;return we(this,(function(r){switch(r.label){case 0:return Ae.isMp?(t=null==e?void 0:e.avatarType,n=null==e?void 0:e.autoRequestPermission,[4,go(t,n)]):[3,2];case 1:return[2,{userInfo:r.sent()}];case 2:return Ae.isMpWeb?[2,Promise.resolve({userInfo:{id:"3368637342326461234",name:"User Name",avatar:"https://h5.zdn.vn/static/images/avatar.png"}})]:[2,Promise.reject(Ie("getUserInfo",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),bo.apply(this,arguments)}var To=function(e){return{NONE:e?-2:0,WIFI:e?0:1,"2G":2,"3G":e?15:2,"4G":e?13:2}},Eo=me((function(){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("WEBVIEW_NETWORKTYPE",{url:window.location.href,featureId:""},{success:function(n){var r,i,o,a=n.network,s=(null===(r=Oe())||void 0===r||null===(i=r.platform)||void 0===i?void 0:i.isAndroid)||!1;switch(a){case To(s).NONE:o=e.NetworkType.none;break;case To(s).WIFI:o=e.NetworkType.wifi;break;case To(s)["2G"]:case To(s)["3G"]:case To(s)["4G"]:o=e.NetworkType.cellular;break;default:o=e.NetworkType.unknown}t(o)},fail:function(e){n(e)}},{})}))]}))}));function So(e){return Po.apply(this,arguments)}function Po(){return(Po=me((function(t){return we(this,(function(n){return[2,fn("getNetworkType",[],[t],me((function(){var t,n;return we(this,(function(r){switch(r.label){case 0:return Ae.isMp?[4,Eo()]:[3,2];case 1:return[2,{networkType:r.sent()}];case 2:if(Ae.isMpWeb){switch(t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t.effectiveType){case"none":n=e.NetworkType.none;break;case"4g":n=e.NetworkType.wifi;break;case"3g":case"2g":n=e.NetworkType.cellular;break;default:n=e.NetworkType.unknown}return[2,Promise.resolve({networkType:n})]}return[2,Promise.reject(Ie("getNetworkType",{}))]}}))})))]}))}))).apply(this,arguments)}var Oo=[Ti.function().args(ei({isConnected:Ti.boolean(),networkType:Ti.enum(["none","wifi","cellular","unknown"])})).returns(Ti.void())];function Ao(t){return fn("onNetworkStatusChange",Oo,[t],(function(t){var n=t;if(Ae.isMp)!function(t){At.getInstance().on(e.Events.NetworkChanged,(function(e){var n=null==e?void 0:e.state;Eo().then((function(e){t({isConnected:"CONNECTED"===n,networkType:e})}))}))}(n);else if(Ae.isMpWeb){var r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,i=r.effectiveType;r.addEventListener("change",(function(){var t;switch(i){case"none":t=e.NetworkType.none;break;case"4g":t=e.NetworkType.wifi;break;case"3g":case"2g":t=e.NetworkType.cellular;break;default:t=e.NetworkType.unknown}n({isConnected:!0,networkType:t})}))}}))}var ko=function(){var e=me((function(e){var t,n,r,i,o,a;return we(this,(function(s){return a={subaction:0,scanning_type:ht.isNumber(null==e?void 0:e.scanningType)?e.scanningType:0,data:{scan_from_source:ht.isString(null==e?void 0:e.scanFromSource)?e.scanFromSource:"",expire:ht.isNumber(null==e?void 0:e.expire)?e.expire:3e3,monitor_interval:ht.isNumber(null==e?void 0:e.monitorInterval)?e.monitorInterval:60,domain:ht.isString(null==e?void 0:e.domain)?e.domain:"",scan_config:{scan_time:ht.isNumber(null==e||null===(t=e.scanConfig)||void 0===t?void 0:t.scanTime)?e.scanConfig.scanTime:15e3,time_between_scan:ht.isNumber(null==e||null===(n=e.scanConfig)||void 0===n?void 0:n.timeBetweenScan)?e.scanConfig.timeBetweenScan:1e4,beacon_timeout:ht.isNumber(null==e||null===(r=e.scanConfig)||void 0===r?void 0:r.beaconTimeout)?e.scanConfig.beaconTimeout:3e4,delayCheckConnectedTimeout:ht.isNumber(null==e||null===(i=e.scanConfig)||void 0===i?void 0:i.delayCheckConnectedTimeout)?e.scanConfig.delayCheckConnectedTimeout:5e3,beaconConnectedTimeout:ht.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){Qt("SCAN_IBEACON",Ne({},a),{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Io=[ei({scanningType:Ti.number().refine((function(e){return[0,1].includes(e)}),{message:"The type must be either 0 or 1"}).default(0).optional(),expire:Ti.number().optional(),monitorInterval:Ti.number().optional(),domain:Ti.string().optional(),scanConfig:ei({scanTime:Ti.number().optional(),timeBetweenScan:Ti.number().optional(),beaconTimeout:Ti.number().optional(),delayCheckConnectedTimeout:Ti.number().optional(),beaconConnectedTimeout:Ti.number().optional()}).optional(),items:Ti.array(ei({id:Ti.string().optional(),distance:Ti.number().optional(),monitor:ei({enable:Ti.boolean().optional(),movingRange:Ti.number().optional()}).optional()})).optional(),scanFromSource:Ti.string().optional()}).optional()];function Co(e){return No.apply(this,arguments)}function No(){return(No=me((function(e){return we(this,(function(t){return[2,fn("startBeaconDiscovery",Io,[e],me((function(){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,ko(e)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("startBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Mo=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("SCAN_IBEACON",{subaction:2},{success:function(){e(!0)},fail:function(e){t(e)}},{})}))]}))}));function xo(e){return Ro.apply(this,arguments)}function Ro(){return(Ro=me((function(e){return we(this,(function(t){return[2,fn("stopBeaconDiscovery",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Mo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve(!0)]:[2,Promise.reject(Ie("stopBeaconDiscovery",{}))]}}))})))]}))}))).apply(this,arguments)}var Do=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("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 jo(e){return Uo.apply(this,arguments)}function Uo(){return(Uo=me((function(e){return we(this,(function(t){return[2,fn("getBeacons",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Do()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({beacons:[]})]:[2,Promise.reject(Ie("getBeacons",{}))]}}))})))]}))}))).apply(this,arguments)}var Bo=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("WINDOW_CLOSE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Lo(e){return Zo.apply(this,arguments)}function Zo(){return(Zo=me((function(e){return we(this,(function(t){return[2,fn("closeApp",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Bo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var zo=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("OPEN_QR",{skipOpenLink:!0},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function Wo(e){return Fo.apply(this,arguments)}function Fo(){return(Fo=me((function(e){return we(this,(function(t){return[2,fn("scanQRCode",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,zo()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({content:""})]:[2,Promise.reject(Ie("scanQRCode",{}))]}}))})))]}))}))).apply(this,arguments)}var Go=function(){var t=me((function(t,n,r,o){return we(this,(function(a){return[2,new Promise((function(a,s){Qt("OPEN_PROFILE",{uId:t,type:e.ProfileType[n],zapp:i,sourceId:r,sourceIndex:o},{success:function(){a()},fail:function(e){s(e)}},{})}))]}))}));return function(e,n,r,i){return t.apply(this,arguments)}}(),Ho=[ei({id:Zr(),type:Ti.enum(["user","oa","aliasOA"]),sourceId:Ti.any().optional(),sourceIndex:Ti.any().optional()}).optional()];function Vo(e){return Ko.apply(this,arguments)}function Ko(){return Ko=me((function(e){return we(this,(function(t){return[2,fn("openProfile",Ho,[e],function(){var e=me((function(e){var t,n,r,i;return we(this,(function(o){switch(o.label){case 0:return Ae.isMp?(t=e.id,n=e.type,r=e.sourceId,i=e.sourceIndex,[4,Go(t,n,r,i)]):[3,2];case 1:return[2,o.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openProfile",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ko.apply(this,arguments)}var Jo=function(){var t=me((function(t,n){var r,o,a,s=arguments;return we(this,(function(u){return r=s.length>2&&void 0!==s[2]?s[2]:"",o=s.length>3?s[3]:void 0,a=s.length>4?s[4]:void 0,[2,new Promise((function(s,u){Qt("OPEN_CHAT",{uId:t,type:e.ChatType[n],msg:r,zapp:i,sourceId:o,sourceIndex:a},{success:function(){s()},fail:function(e){u(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),qo=[ei({id:Zr(),type:Ti.enum(["user","oa"]),sourceId:Ti.any().optional(),sourceIndex:Ti.any().optional(),message:Zr().optional()}).optional()];function $o(e){return Qo.apply(this,arguments)}function Qo(){return Qo=me((function(e){return we(this,(function(t){return[2,fn("openChat",qo,[e],function(){var e=me((function(e){var t,n,r,i,o;return we(this,(function(a){switch(a.label){case 0:return Ae.isMp?(t=e.id,n=e.type,r=e.message,i=e.sourceId,o=e.sourceIndex,[4,Jo(t,n,r,i,o)]):[3,2];case 1:return[2,a.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openChat",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qo.apply(this,arguments)}function Yo(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 Xo=function(){var t=me((function(t,n){var r;return we(this,(function(o){switch(r={},t){case"image":r={photoUrl:null==n?void 0:n.imageUrl};break;case"link":r={link:null==n?void 0:n.link,title:null==n?void 0:n.title,thumb:null==n?void 0:n.thumb,description:null==n?void 0:n.description};break;case"profile":r={avt:null==n?void 0:n.avatar,uid:null==n?void 0:n.id,dpn:null==n?void 0:n.displayName}}return[2,new Promise((function(n,o){Qt("OPEN_POSTFEED",Yo(Ne({type:e.PostFeedType[t]},r),{zapp:i}),{success:function(e){n({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){o(e)}},{})}))]}))}));return function(e,n){return t.apply(this,arguments)}}(),ea=[Ti.union([ei({type:Ti.enum(["image"]),data:ei({imageUrl:Zr().url().optional()})}),ei({type:Ti.enum(["link"]),data:ei({link:Zr().url(),title:Zr().max(100).optional(),thumb:Zr().url().optional(),description:Zr().max(400).default("").optional()})}),ei({type:Ti.enum(["profile"]),data:ei({id:Zr().optional()})})])];function ta(e){return na.apply(this,arguments)}function na(){return na=me((function(e){return we(this,(function(t){return[2,fn("openPostFeed",ea,[e],function(){var e=me((function(e){var t,n;return we(this,(function(r){switch(r.label){case 0:return Ae.isMp?(t=e.type,n=e.data,[4,Xo(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({status:1,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openPostFeed",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),na.apply(this,arguments)}var ra=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("FOLLOW_OA",{uid:e,showDialogConfirm:!0,forceUpdate:!0,zapp:i},{success:function(e){t(e)},fail:function(e){n(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ia=[ei({id:Zr(),showDialogConfirm:Ti.boolean().optional()}).optional()];function oa(e){return aa.apply(this,arguments)}function aa(){return aa=me((function(e){return we(this,(function(t){return[2,fn("followOA",ia,[e],function(){var e=me((function(e){var t;return we(this,(function(n){switch(n.label){case 0:return Ae.isMp?(t=e.id,[4,ra(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("followOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),aa.apply(this,arguments)}var sa=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("UNFOLLOW_OA",{uid:e,forceUpdate:!0,zapp:i},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),ua=[ei({id:Zr()}).optional()];function ca(e){return la.apply(this,arguments)}function la(){return la=me((function(e){return we(this,(function(t){return[2,fn("unfollowOA",ua,[e],function(){var e=me((function(e){var t;return we(this,(function(n){switch(n.label){case 0:return Ae.isMp?(t=e.id,[4,sa(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("unfollowOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),la.apply(this,arguments)}var da=function(){var e=me((function(e,t,n,r,i,o){var s,u,l,p,f,h,m,v;return we(this,(function(y){switch(y.label){case 0:return l=new URL(location.href),p=new URLSearchParams,f="".concat(l.pathname.replace(c,"")).concat(l.search),o&&(f="/".concat(e).concat("/"===o[0]?"":"/").concat(o)),!(h=new URL("".concat(a).concat(f))).searchParams.has("env")&&(null===(s=window.APP_ENV)||void 0===s?void 0:s.length)>0&&h.searchParams.set("env",window.APP_ENV),!h.searchParams.has("version")&&(null===(u=window.APP_VERSION)||void 0===u?void 0:u.length)>0&&h.searchParams.set("version",window.APP_VERSION),p.append("title",n),p.append("description",r||""),p.append("thumbnail",i||""),p.append("url",h.href),p.append("accessToken",t||""),m={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CREATE_SHARE_LINK,Ne({method:"POST",body:p},m))];case 1:return[4,y.sent().json()];case 2:if(!(v=y.sent())||0!==v.err)throw $t.error.cannotGetShareInfo();return h.search="".concat(h.search,"&zshareId=").concat(v.data.shareId),[2,Yo(Ne({},v.data),{shareableLink:h.href})]}}))}));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}(),pa=function(){var t=me((function(t,n){var r,a,s,u,c,l,d,p,f,h,m,v;return we(this,(function(y){switch(y.label){case 0:switch(r={},a=t,t){case"text":return[3,1];case"image":return[3,2];case"gif":return[3,3];case"video":return[3,4];case"link":return[3,5];case"oa":return[3,6];case"zmp":return[3,7];case"zmp_deep_link":return[3,10]}return[3,13];case 1:return r={text:null==n?void 0:n.text,desc:(null==n?void 0:n.desc)||(null==n?void 0:n.description),autoParseLink:(null==n?void 0:n.autoParseLink)?1:0},[3,14];case 2:return l=[],d=(null===(u=Oe())||void 0===u?void 0:u.zaloVersion)||0,p=(null===(c=Oe())||void 0===c?void 0:c.platformName)||"unknown",Number(d)>=te[p]&&(a="multi_image"),Array.isArray(null==n?void 0:n.imageUrls)&&(null==n?void 0:n.imageUrls.length)>0?l=null==n?void 0:n.imageUrls:l.push(null==n?void 0:n.imageUrl),r={photoUrls:l,photoUrl:null==n?void 0:n.imageUrl,caption:null==n?void 0:n.caption},[3,14];case 3:return r={photoUrl:null==n?void 0:n.imageUrl,gifUrl:null==n?void 0:n.gifUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 4:return r={videoThumb:null==n?void 0:n.videoThumb,videoUrl:null==n?void 0:n.videoUrl,width:null==n?void 0:n.width,height:null==n?void 0:n.height},[3,14];case 5:return r={link:null==n?void 0:n.link,chatOnly:(null==n?void 0:n.chatOnly)?1:0},[3,14];case 6:return r={uid:null==n?void 0:n.id},[3,14];case 7:case 10:return[4,en.getAccessToken()];case 8:case 11:return s=y.sent(),[4,da(o,s||"",(null==n?void 0:n.title)||"",(null==n?void 0:n.description)||"",(null==n?void 0:n.thumbnail)||"",null==n?void 0:n.path)];case 9:return f=y.sent(),r={data:{ZInstantAPIInfo:{url:"".concat(f.zinstantApi),zinstantdata_id:"templateId=".concat(f.ztemplateId,"&appId=").concat(o,"&shareId=").concat(f.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},[3,14];case 12:return h=y.sent().shareableLink,m=new URL(h),v=m.searchParams.getAll("zshareId"),m.searchParams.delete("zshareId"),v.length>0&&m.searchParams.append("zshareId",v[0]),r={link:m.href,chatOnly:0},[3,14];case 13:return[3,14];case 14:return[2,new Promise((function(t,n){Qt("OPEN_SHARESHEET",Yo(Ne({type:e.ShareSheetType[a]},r),{zapp:i}),{success:function(e){t({status:null==e?void 0:e.status,shareType:null==e?void 0:e.share_type,numberOfUser:null==e?void 0:e.uid_to_size})},fail:function(e){n(e)}},{timeout:!1})}))]}}))}));return function(e,n){return t.apply(this,arguments)}}(),fa=[Ti.union([ei({type:Ti.enum(["text"]),data:ei({text:Zr(),description:Zr().default("").optional(),autoParseLink:Ti.boolean().default(!1).optional()})}),ei({type:Ti.enum(["image"]),data:ei({imageUrl:Zr().url(),imageUrls:Ti.array(Zr().url()).max(10).optional()})}),ei({type:Ti.enum(["link"]),data:ei({link:Zr().url(),chatOnly:Ti.boolean().optional()})}),ei({type:Ti.enum(["oa"]),data:ei({id:Zr()})}),ei({type:Ti.enum(["gif"]),data:ei({gifUrl:Zr().url(),imageUrl:Zr().url().optional(),width:zr().min(0).optional(),height:zr().min(0).optional()})}),ei({type:Ti.enum(["video"]),data:ei({videoThumb:Zr().url(),videoUrl:Zr().url(),width:zr().min(0).optional(),height:zr().min(0).optional()})}),ei({type:Ti.enum(["zmp","zmp_deep_link"]),data:ei({title:Zr().max(100),thumbnail:Zr().url(),path:Zr().optional(),description:Zr().max(400).default("").optional()})})])];function ha(e){return ma.apply(this,arguments)}function ma(){return ma=me((function(e){return we(this,(function(t){return[2,fn("openShareSheet",fa,[e],function(){var e=me((function(e){var t,n;return we(this,(function(r){switch(r.label){case 0:return Ae.isMp?(t=e.type,n=e.data,[4,pa(t,n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({status:2,shareType:0,numberOfUser:0})]:[2,Promise.reject(Ie("openShareSheet",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ma.apply(this,arguments)}var va=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("REQUEST_PERMISSION_CAMERA",{},{success:function(t){var n,r;(null===(n=Oe())||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=Oe())||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 ya(e){return ga.apply(this,arguments)}function ga(){return(ga=me((function(e){return we(this,(function(t){return[2,fn("requestCameraPermission",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return[4,va()];case 1:return[2,e.sent()]}}))})))]}))}))).apply(this,arguments)}var _a=function(){var e=me((function(e,t,n){return we(this,(function(r){return[2,new Promise((function(r,i){Qt("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)}}(),wa=me((function(){var e,t,n,r=arguments;return we(this,(function(i){switch(i.label){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:o,t=r.length>1&&void 0!==r[1]?r[1]:0,n=bn(),[4,Bt(e,t,n.version)];case 1:return[2,i.sent()]}}))})),ba=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("OPEN_OUTAPP",{url:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ta=[ei({params:Ti.record(Zr(),Zr()).optional()}).optional()];function Ea(e){return Sa.apply(this,arguments)}function Sa(){return Sa=me((function(e){return we(this,(function(t){return[2,fn("createShortcut",Ta,[e],function(){var e=me((function(e){var t,n,r,i,s,u,c,l;return we(this,(function(d){switch(d.label){case 0:return Ae.isMp?[4,wa(o,0)]:[3,6];case 1:return r=d.sent(),i=null===(t=Oe())||void 0===t||null===(n=t.platform)||void 0===n?void 0:n.isIOS,s=r.logoUrl||sn("og:image:url")||"",u=r.name||document.title,(c=(null==e?void 0:e.params)?new URLSearchParams(null==e?void 0:e.params):new URLSearchParams).append("utm_source","zalo-shortcut"),c.append("utm_medium","default"),c.append("utm_campaign","default"),i?(c.append("appId",o),c.append("appName",u),c.append("appIcon",s),l="https://mini.zalo.me/shortcut.html?".concat(c.toString()),[4,ba(encodeURI(l))]):[3,3];case 2:return d.sent(),[3,5];case 3:return[4,_a("".concat(a,"/").concat(o,"/?").concat(c.toString()),u,s)];case 4:d.sent(),d.label=5;case 5:return[2,$t.success()];case 6:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("createShortcut",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Sa.apply(this,arguments)}var Pa=function(){var e=me((function(e,t,n){return we(this,(function(r){return[2,new Promise((function(r,o){Qt("PROMPT_AUTHENTICATION",{secret_data:e,app_id:i,ui:{title:null==t?void 0:t.title,sub_title:null==t?void 0:t.subTitle,negative_text:null==t?void 0:t.negativeButtonText},require_fingerprint:n?1:0},{success:function(e){var t,n,i,o;r({code:null==e?void 0:e.error_code,message:null==e?void 0:e.error_message,data:{domain:null==e||null===(t=e.data)||void 0===t?void 0:t.domain,code:null==e||null===(n=e.data)||void 0===n?void 0:n.error_code,message:null==e||null===(i=e.data)||void 0===i?void 0:i.error_message,payToken:null==e||null===(o=e.data)||void 0===o?void 0:o.pay_token}})},fail:function(e){o(e)}},{})}))]}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Oa=[ei({secretData:Zr(),ui:ei({title:Zr().default("Xác thực").optional(),subTitle:Zr().default("Sử dụng sinh trắc học của bạn để xác thực").optional(),negativeButtonText:Zr().default("Đóng").optional()}).optional(),requireFingerprint:Gr().default(!0).optional()}).optional()];function Aa(e){return ka.apply(this,arguments)}function ka(){return ka=me((function(e){return we(this,(function(t){return[2,fn("openBioAuthentication",Oa,[e],function(){var e=me((function(e){var t,n,r;return we(this,(function(i){switch(i.label){case 0:return Ae.isMp?(t=e.secretData,n=e.ui,r=e.requireFingerprint,[4,Pa(t,n,r)]):[3,2];case 1:return[2,i.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({code:0,message:"OK",data:{domain:"",code:0,message:"",payToken:""}})]:[2,Promise.reject(Ie("openBioAuthentication",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ka.apply(this,arguments)}var Ia=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("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 Ca(e){return Na.apply(this,arguments)}function Na(){return(Na=me((function(e){return we(this,(function(t){return[2,fn("checkStateBioAuthentication",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Ia()]:[3,2];case 1:return[2,{bioState:e.sent()}];case 2:return Ae.isMpWeb?[2,Promise.resolve({bioState:""})]:[2,Promise.reject(Ie("checkStateBioAuthentication",{}))]}}))})))]}))}))).apply(this,arguments)}var Ma=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("SHOW_TOAST",{toast:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),xa=[ei({message:Zr()}).optional()];function Ra(e){return Da.apply(this,arguments)}function Da(){return Da=me((function(e){return we(this,(function(t){return[2,fn("showToast",xa,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Ma(e.message)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("showToast",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Da.apply(this,arguments)}var ja=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("HIDE_KEYBOARD",{},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));function Ua(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=me((function(e){return we(this,(function(t){return[2,fn("hideKeyboard",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,ja()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("hideKeyboard",{}))]}}))})))]}))}))).apply(this,arguments)}var La=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("OPEN_PHONE",{phoneNum:e,phoneCode:e},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Za=[ei({phoneNumber:Zr()})];function za(e){return Wa.apply(this,arguments)}function Wa(){return Wa=me((function(e){return we(this,(function(t){return[2,fn("openPhone",Za,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,La(e.phoneNumber)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPhone",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wa.apply(this,arguments)}var Fa=function(){var e=me((function(e,t){return we(this,(function(n){return[2,new Promise((function(n,r){Qt("OPEN_SMS",{content:t,phoneCode:e},{success:function(){n()},fail:function(e){r(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),Ga=[ei({content:Zr(),phoneNumber:Zr()})];function Ha(e){return Va.apply(this,arguments)}function Va(){return Va=me((function(e){return we(this,(function(t){return[2,fn("openSMS",Ga,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Fa(e.phoneNumber,e.content)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openSMS",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Va.apply(this,arguments)}var Ka=function(){var e=me((function(e){var t,n=arguments;return we(this,(function(r){return t=n.length>1&&void 0!==n[1]?n[1]:"",[2,new Promise((function(n,r){Qt("VIEW_MYQR",{dpn:t,uid:e,zapp:i},{success:function(){n()},fail:function(e){r(e)}},{timeout:!1})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Ja=[ei({id:Zr(),displayName:Zr().default("").optional()})];function qa(e){return $a.apply(this,arguments)}function $a(){return $a=me((function(e){return we(this,(function(t){return[2,fn("viewOAQr",Ja,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Ka(e.id,e.displayName)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("viewOAQr",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),$a.apply(this,arguments)}var Qa=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("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)}}(),Ya=[ei({keepScreenOn:Gr()})];function Xa(e){return es.apply(this,arguments)}function es(){return es=me((function(e){return we(this,(function(t){return[2,fn("keepScreen",Ya,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Qa(e.keepScreenOn)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("keepScreen",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),es.apply(this,arguments)}function ts(e){return ns.apply(this,arguments)}function ns(){return(ns=me((function(e){return we(this,(function(t){return[2,fn("onKeepScreen",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Qa(!0)]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("onKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}function rs(e){return is.apply(this,arguments)}function is(){return(is=me((function(e){return we(this,(function(t){return[2,fn("offKeepScreen",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Qa(!1)]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("offKeepScreen",{}))]}}))})))]}))}))).apply(this,arguments)}var os=function(){var e=me((function(e,t){var n;return we(this,(function(r){return n={},e?n={imageBase64Data:e}:t&&(n={imageUrl:t}),[2,new Promise((function(e,t){Qt("SAVE_IMAGE_GALLERY",Ne({},n),{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),as=[ei({imageBase64Data:Zr().optional(),imageUrl:Zr().url().optional()}).optional()];function ss(e){return us.apply(this,arguments)}function us(){return us=me((function(e){return we(this,(function(t){return[2,fn("saveImageToGallery",as,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,os(e.imageBase64Data,e.imageUrl)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("saveImageToGallery",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),us.apply(this,arguments)}var cs=function(){var e=me((function(e){var t,n,r,i,o,a,u=arguments;return we(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,wa(e,0)];case 2:return r=c.sent(),[3,4];case 3:return c.sent(),[3,4];case 4:i={appId:e},r&&(i.appName=r.name,i.appAvtUrl=r.logoUrl),o="".concat(s,"/").concat(e).concat(t);try{a=new URL(o),Object.entries(n).forEach((function(e){var t=Me(e,2),n=t[0],r=t[1];a.searchParams.append(n,String(r))})),o=a.href}catch(e){}return[2,new Promise((function(e,t){Qt("OPEN_MP",{mpUrl:o,mpInfo:i},{success:function(){e()},fail:function(e){t(e)}},{})}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ls=[ei({appId:Zr(),path:Zr().optional(),params:Ti.record(Zr(),Zr()).optional()})];function ds(e){return ps.apply(this,arguments)}function ps(){return ps=me((function(e){return we(this,(function(t){return[2,fn("openMiniApp",ls,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,cs(e.appId,e.path,e.params)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ps.apply(this,arguments)}var fs=me((function(){var t,n,r=arguments;return we(this,(function(i){return t=r.length>0&&void 0!==r[0]?r[0]:"oneShot",n=r.length>1?r[1]:void 0,[2,new Promise((function(r,i){Qt("INTERACTIVE_VIBRATION",{type:e.VibrateType[t],vibrate_time:n},{success:function(){r()},fail:function(e){i(e)}},{})}))]}))})),hs=[ei({type:Ti.enum(["oneShot"]).default("oneShot"),milliseconds:zr().optional()})];function ms(e){return vs.apply(this,arguments)}function vs(){return vs=me((function(e){return we(this,(function(t){return[2,fn("vibrate",hs,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,fs(null==e?void 0:e.type,null==e?void 0:e.milliseconds)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("vibrate",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vs.apply(this,arguments)}var ys=function(){var e=me((function(e,t){var n,r,i,o;return we(this,(function(a){return n=new URL(e),r=n.href.includes("vnpay"),i=n.searchParams.get("typeInapp"),o=ht.isEmpty(t)?void 0:{modal_style:(null==t?void 0:t.style)?Zt(null==t?void 0:t.style):"bottom_sheet",left_button:(null==t?void 0:t.leftButton)?Zt(null==t?void 0:t.leftButton):"back"},!r&&ht.isEmpty(i)&&n.searchParams.set("typeInapp","1"),[2,new Promise((function(e,t){Qt("OPEN_INAPP",{url:n.href,style:o},{success:function(){e()},fail:function(e){t(e)}},{})}))]}))}));return function(t,n){return e.apply(this,arguments)}}(),gs=[ei({url:Zr(),config:ei({style:Ti.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:Ti.enum(["back","none"]).default("back").optional()}).optional()})];function _s(e){return ws.apply(this,arguments)}function ws(){return ws=me((function(e){return we(this,(function(t){return[2,fn("openWebview",gs,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,ys(e.url,e.config)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openWebview",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ws.apply(this,arguments)}function bs(){var e={},t=window.location.href;try{var n=new URL(t).searchParams.toString();n&&(e=Ct.getParamsAsObject(n))}catch(e){throw new Error("Invalid URL")}return e}function Ts(){return fn("getRouteParams",[],[],(function(){return bs()}))}function Es(e){return Ss.apply(this,arguments)}function Ss(){return(Ss=me((function(e){return we(this,(function(t){return[2,fn("getAppInfo",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,wa()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({description:"",name:"",version:"",appUrl:"",qrCodeUrl:""})]:[2,Promise.reject(Ie("getAppInfo",{}))]}}))})))]}))}))).apply(this,arguments)}var Ps=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("WEBVIEW_SET_RESULT",{result:un(e)},{success:function(){t()},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Os=[ei({data:Ti.any()})];function As(e){return ks.apply(this,arguments)}function ks(){return ks=me((function(e){return we(this,(function(t){return[2,fn("sendDataToPreviousMiniApp",Os,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Ps(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("sendDataToPreviousMiniApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ks.apply(this,arguments)}var Is=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){var n,r;Qt("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($t.error.clientNotSupport())},fail:function(e){t(e)}},{delay:(null===(n=Oe())||void 0===n||null===(r=n.platform)||void 0===r?void 0:r.isIOS)?400:0})}))]}))}));function Cs(e){return Ns.apply(this,arguments)}function Ns(){return(Ns=me((function(e){return we(this,(function(t){return[2,fn("getPhoneNumber",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Is()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({number:""})]:[2,Promise.reject(Ie("getPhoneNumber",{}))]}}))})))]}))}))).apply(this,arguments)}var Ms=me((function(){var e,t=arguments;return we(this,(function(n){return e=t.length>0&&void 0!==t[0]?t[0]:1,[2,new Promise((function(t,n){Qt("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})}))]}))})),xs=[ei({maxProfile:zr().min(1).max(10).optional().default(1)})];function Rs(e){return Ds.apply(this,arguments)}function Ds(){return Ds=me((function(e){return we(this,(function(t){return[2,fn("openProfilePicker",xs,[e],function(){var e=me((function(e){var t,n,r,i,o;return we(this,(function(a){switch(a.label){case 0:return Ae.isMp?[4,Ms(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,en.getAccessToken()];case 3:return r=a.sent(),[4,fetch(d.GET_LIST_USER_INFO,{method:"POST",headers:{"Content-Type":"application/json",access_token:r||""},body:JSON.stringify({fields:"id,name,picture",user_ids:t})})];case 4:return[4,a.sent().json()];case 5:if(0!==(i=a.sent()).error||!i.data)throw new Error(i.message);return n=t.map((function(e){var t,n,r,o,a,s,u,c,l,d,p;return{id:(null===(t=i.data[e])||void 0===t||null===(n=t.user_info)||void 0===n?void 0:n.user_id_by_app)||"",profile:{name:null===(r=i.data[e])||void 0===r||null===(o=r.user_info)||void 0===o?void 0:o.name,avatar:null===(a=i.data[e])||void 0===a||null===(s=a.user_info)||void 0===s||null===(u=s.picture)||void 0===u||null===(c=u.data)||void 0===c?void 0:c.url},code:0!==(null===(l=i.data[e])||void 0===l?void 0:l.error)?-1:0,message:"Get profile: ".concat(ht.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 Ae.isMpWeb?[2,Promise.resolve({users:[]})]:[2,Promise.reject(Ie("openProfilePicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ds.apply(this,arguments)}var js=function(){var e=me((function(e,t,n){var r;return we(this,(function(i){return r=t&&ht.isString(t)&&t.length>0?"wpa_wpa2":"open",[2,new Promise((function(i,o){Qt("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)}}(),Us=[ei({SSID:Zr(),password:Zr().optional(),hiddenSSID:Gr().optional()})];function Bs(e){return Ls.apply(this,arguments)}function Ls(){return Ls=me((function(e){return we(this,(function(t){return[2,fn("connectWifi",Us,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,js(e.SSID,e.password,e.hiddenSSID)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("connectWifi",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ls.apply(this,arguments)}var Zs=function(){var t=me((function(t,n,r,i,o,a){var s,u;return we(this,(function(c){return s={type:0,url:n,max_size:r||1048576},u={enable:1,aspect_ratio:"1:1"},[2,new Promise((function(n,r){Qt("PICK_MEDIA",{media_type:e.MediaPickerType[t],edit_view:Ne({},u,i),silent_request:o,upload:s,max_select_items:a},{success:function(e){n(null==e?void 0:e.result_content)},fail:function(e){r(e)}},{isMultiCallback:!0})}))]}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),zs=[ei({type:Ti.enum(["video","photo","file","zcamera","zcamera_photo","zcamera_video","zcamera_scan"]),serverUploadUrl:Zr().url(),maxItemSize:zr().min(0).optional(),editView:ei({enable:Gr().optional(),aspectRatio:Zr().regex(/^d+:d+$/).optional()}).optional(),silentRequest:Gr().optional(),maxSelectItem:zr().min(1).optional()})];function Ws(e){return Fs.apply(this,arguments)}function Fs(){return Fs=me((function(e){return we(this,(function(t){return[2,fn("openMediaPicker",zs,[e],function(){var e=me((function(e){var t,n,r,i,o,a;return we(this,(function(s){switch(s.label){case 0:return Ae.isMp?(i={},ht.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,Zs(e.type,e.serverUploadUrl,e.maxItemSize,i,o,a)]):[3,2];case 1:return[2,{data:s.sent()}];case 2:return Ae.isMpWeb?[2,Promise.resolve({data:""})]:[2,Promise.reject(Ie("openMediaPicker",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Fs.apply(this,arguments)}var Gs=[ei({title:Zr().max(100),description:Zr().max(400).default(""),thumbnail:Zr().url().optional(),path:Zr().optional()})];function Hs(e){return Vs.apply(this,arguments)}function Vs(){return Vs=me((function(e){return we(this,(function(t){return[2,fn("getShareableLink",Gs,[e],function(){var e=me((function(e){var t;return we(this,(function(n){switch(n.label){case 0:return[4,en.getAccessToken()];case 1:return t=n.sent(),[4,da(window.APP_ID,t||"",e.title,e.description,e.thumbnail,e.path)];case 2:return[2,n.sent().shareableLink]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Vs.apply(this,arguments)}var Ks=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("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 Js(e){return qs.apply(this,arguments)}function qs(){return(qs=me((function(e){return we(this,(function(t){return[2,fn("closeLoading",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Ks("user action")]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("closeLoading",{}))]}}))})))]}))}))).apply(this,arguments)}function $s(e){return Qs.apply(this,arguments)}function Qs(){return Qs=me((function(e){return we(this,(function(t){return[2,fn("requestUpdateZalo",[],[e],me((function(){var e,t,n;return we(this,(function(r){switch(r.label){case 0:return Ae.isMp?(n=(null===(e=Oe())||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,ba(n)]):[3,2];case 1:return[2,r.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestUpdateZalo",{}))]}}))})))]}))})),Qs.apply(this,arguments)}var Ys=At.getInstance();Ys.addListener=function(t,n,r){var i=t;return Ys.addListener(e.Events[i],n,r)};var Xs=[Ti.function()];function eu(t){return fn("onConfirmToExit",Xs,[t],(function(t){var n=t;Ae.isMp&&(Ys.on(e.Events.AppClose,n,'{"handle_h5": 1}'),Si.setNavigationBarLeftButton(void 0,2))}))}function tu(){return fn("offConfirmToExit",[],[],(function(){Ae.isMp&&(Ys.off(e.Events.AppClose),Si.setNavigationBarLeftButton(void 0,0))}))}function nu(){return fn("getDeviceId",[],[],(function(){return Ae.isMp&&en.getSync(l.DEVICE_ID)||""}))}function ru(e){return iu.apply(this,arguments)}function iu(){return(iu=me((function(e){return we(this,(function(t){return[2,fn("getDeviceIdAsync",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,en.jumpAndGetToken(l.DEVICE_ID)]:[3,2];case 1:return[2,e.sent()||""];case 2:return[2,Promise.resolve("")]}}))})))]}))}))).apply(this,arguments)}function ou(){return fn("getContext",[],[],(function(){if(Ae.isMp){var e=en.getSync(l.CONTEXT_ID)||"";return{type:en.getSync(l.CONTEXT_TYPE)||"",id:e}}return{type:"",id:""}}))}function au(e){return su.apply(this,arguments)}function su(){return(su=me((function(e){return we(this,(function(t){return[2,fn("getContextAsync",[],[e],me((function(){var e;return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,en.jumpAndGetToken(l.CONTEXT_ID)]:[3,3];case 1:return e=t.sent()||"",[4,en.jumpAndGetToken(l.CONTEXT_TYPE)];case 2:return[2,{type:t.sent()||"",id:e}];case 3:return[2,Promise.resolve({type:"",id:""})]}}))})))]}))}))).apply(this,arguments)}function uu(e){return cu.apply(this,arguments)}function cu(){return(cu=me((function(e){return we(this,(function(t){return[2,fn("getAuthCode",[],[e],me((function(){var e,t;return we(this,(function(n){switch(n.label){case 0:return Ae.isMp?[4,en.jumpAndGetToken(l.ZOAUTH,!0)]:[3,4];case 1:return e=n.sent()||"",[4,en.jumpAndGetToken(l.ZOAUTH_VRF)];case 2:return t=n.sent()||"",[4,en.verifyUserAuthorized()];case 3:if(n.sent())return[2,{authCode:e,authCodeVerify:t}];throw Lt([{action:"getAuthCode",error:-104,message:"no user auth",data:{}}]),$t.error.loginFailed("User Authentication Required");case 4:return[2,Promise.resolve({authCode:"",authCodeVerify:""})]}}))})))]}))}))).apply(this,arguments)}function lu(e){return du.apply(this,arguments)}function du(){return(du=me((function(e){return we(this,(function(t){return[2,fn("getZPIToken",[],[e],me((function(){var e,t,n,r;return we(this,(function(i){switch(i.label){case 0:return Ae.isMp?[4,en.jumpAndGetToken(l.UTOKEN_ZPI)]:[3,5];case 1:return e=i.sent()||"",[4,en.jumpAndGetToken(l.GTOKEN_ZPI)];case 2:return t=i.sent()||"",[4,en.jumpAndGetToken(l.ZPP_ZPI)];case 3:return n=i.sent()||"",[4,en.jumpAndGetToken(l.ZPT_ZPI)];case 4:return r=i.sent()||"",[2,{utoken:e,gtoken:t,zpp:n,zpt:r}];case 5:return[2,Promise.resolve({utoken:"",gtoken:"",zpp:"",zpt:""})]}}))})))]}))}))).apply(this,arguments)}var pu=[Zr()];function fu(e){return fn("setAccessToken",pu,[e],(function(e){var t=e;en.setAccessToken(t)}))}var hu=[ei({url:Zr().url()})];function mu(e){return vu.apply(this,arguments)}function vu(){return vu=me((function(e){return we(this,(function(t){return[2,fn("openOutApp",hu,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,ba(e.url)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openOutApp",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),vu.apply(this,arguments)}var yu=[ei({count:zr().min(1).optional().default(1),sourceType:Ti.array(Ti.enum(["album","camera"])).max(2).default(["album","camera"]).optional(),cameraType:Ti.enum(["back","front"]).default("front").optional()})];function gu(e){return _u.apply(this,arguments)}function _u(){return _u=me((function(e){return we(this,(function(t){return[2,fn("chooseImage",yu,[e],function(){var e=me((function(e){var t,n,r,i;return we(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)}}())]}))})),_u.apply(this,arguments)}var wu=me((function(){var e,t,n=arguments;return we(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){Qt("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($t.error.clientNotSupport())},fail:function(e){r(e)}},{isMultiCallback:!0,timeout:!1})}))]}))}));function bu(e){return Tu.apply(this,arguments)}function Tu(){return(Tu=me((function(e){return we(this,(function(t){return[2,fn("getLocation",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,wu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({longitude:"105.788026",latitude:"21.0258773",timestamp:(new Date).getTime().toString(),provider:"fused"})]:[2,Promise.reject(Ie("getLocation",{}))]}}))})))]}))}))).apply(this,arguments)}var Eu=[Ti.function().args(ei({data:Ti.any()})).returns(Ti.void())];function Su(t){return fn("onCallbackData",Eu,[t],(function(){!function(t){At.getInstance().on(e.Events.OnDataCallback,(function(e){t({data:e})}))}(t)}))}var Pu=function(){var e=me((function(e){var t,n,r,i,a,s,u,c,l,d,p;return we(this,(function(f){switch(f.label){case 0:return n="",e||(e=bs()),"object"==typeof e&&((n=e.zmpOrderId||"")||(t=e.appTransID||e.orderId||e.apptransid)),"string"==typeof e&&(r=Ct.getParameterByName("orderId",e),i=Ct.getParameterByName("appTransID",e)||Ct.getParameterByName("apptransid",e),t=r||i),a={headers:{authorization:"Bearer "}},[4,en.getAccessToken().catch((function(){throw $t.error.loginRequired}))];case 1:return s=f.sent(),a.headers.authorization="Bearer ".concat(s),u=new URL(oe),c={orderId:n,transId:t||"",appId:o},u.search=new URLSearchParams(c).toString(),[4,fetch(u.toString(),a)];case 2:return[4,f.sent().json()];case 3:if(!(l=f.sent()).data)throw $t.error.badRequest(l.msg);return d=l.data||{},p={err:l.err},0!==Object.keys(d).length&&d.constructor===Object&&Object.assign(p,Ne({msg:d.resultMessage},d)),[2,p]}}))}));return function(t){return e.apply(this,arguments)}}(),Ou=function(){var t=me((function(t,n,r,i,a,s,u){var c,l,d,p,f,h,m,v,y,g,_,w,b,T,E,S,P,O,A,k,I;return we(this,(function(C){switch(C.label){case 0:c=o,(l=new URLSearchParams).append("amount",t.toString()),l.append("item",encodeURIComponent(JSON.stringify(n))),l.append("appId",c),r&&l.append("desc",encodeURIComponent(r)),i&&(d=i,"object"==typeof i&&(d=JSON.stringify(i)),l.append("extradata",encodeURIComponent(d))),a&&(p=a,"object"==typeof a&&(p=JSON.stringify(a)),l.append("payload",encodeURIComponent(p))),s&&("string"==typeof s?(l.append("method",s),l.append("isCustom","false")):"object"==typeof s&&(l.append("method",s.id),l.append("isCustom",JSON.stringify(s.isCustom)))),u&&l.append("mac",u),f={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},C.label=1;case 1:return C.trys.push([1,6,,7]),[4,en.getAccessToken().catch((function(){throw $t.error.loginRequired}))];case 2:return m=C.sent(),f.headers.authorization="Bearer ".concat(m),[4,fetch(re,Yo(Ne({method:"POST"},f),{body:l}))];case 3:return[4,C.sent().json()];case 4:if(!(v=C.sent()).data||0!==v.err)throw $t.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:c,orderId:y},E=v.data.method,S=v.data.isCustom,g&&(T.token=g),w&&(T.version=w),b&&(T.env=b),E&&(T.method=E),S&&(T.isCustom=S),P=Ct.encode(T),O=new URL("?".concat(P),"https://payment-mini.zalo.me").toString(),A=zt(),k=((null===(h=Oe())||void 0===h?void 0:h.platformName)||"").toLowerCase(),[4,ys(O,{style:"android"===k&&A<742?"normal":"bottomSheet"}).then((function(){var t=!1;At.getInstance().once(e.Events.WebviewClosed,(function(){setTimeout(me((function(){var n;return we(this,(function(r){switch(r.label){case 0:return t?[3,2]:[4,Pu({zmpOrderId:y})];case 1:(n=r.sent()).err>=0&&!n.isCustom&&At.getInstance().emit(e.Events.PaymentClose,n.err,Yo(Ne({},n),{zmpOrderId:y})),r.label=2;case 2:return[2]}}))})),500)})),At.getInstance().once(e.Events.OpenApp,(function(){t=!0}))}))];case 5:return C.sent(),[2,{orderId:y,messageToken:_}];case 6:throw I=C.sent(),console.log("Internal error"),I;case 7:return[2]}}))}));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),Au=[ei({amount:Ti.union([Zr(),zr()]),item:Ti.array(Ti.record(Zr(),Ti.any())),desc:Zr(),extradata:Ti.any().optional(),payload:Ti.any().optional(),method:Ti.union([Ti.string(),Ti.object({id:Ti.string(),isCustom:Ti.boolean()})]).optional(),mac:Ti.string().optional()})];function ku(e){return Iu.apply(this,arguments)}function Iu(){return Iu=me((function(e){return we(this,(function(t){return[2,fn("createOrder",Au,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Ou(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 Ae.isMpWeb?[2,Promise.resolve({orderId:"",messageToken:""})]:[2,Promise.reject(Ie("createOrder",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Iu.apply(this,arguments)}var Cu=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("MP_SELECT_PAYMENT_METHOD",{method:e,forceUpdate:!0},{success:function(e){console.log(e),t(e)},fail:function(e){n(e)}},{})}))]}))}));return function(t){return e.apply(this,arguments)}}(),Nu=[ei({method:Zr().optional()}).optional()];function Mu(e){return xu.apply(this,arguments)}function xu(){return xu=me((function(e){return we(this,(function(t){return[2,fn("selectPaymentMethod",Nu,[e],function(){var e=me((function(e){var t;return we(this,(function(n){switch(n.label){case 0:return Ae.isMp?(t=e.method,[4,Cu(t)]):[3,2];case 1:return[2,n.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({method:""})]:[2,Promise.reject(Ie("selectPaymentMethod",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),xu.apply(this,arguments)}var Ru=[ei({data:Ti.union([Zr(),Ti.record(Zr(),Zr())])})];function Du(e){return ju.apply(this,arguments)}function ju(){return ju=me((function(e){return we(this,(function(t){return[2,fn("checkTransaction",Ru,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Pu(e.data)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({msg:"Success",orderId:"",resultCode:1,transTime:(new Date).getTime().toString(),createdAt:(new Date).getTime().toString(),transId:""})]:[2,Promise.reject(Ie("checkTransaction",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),ju.apply(this,arguments)}var Uu=[ei({hide:Gr().default(!1).optional()}).optional()];function Bu(e){return Lu.apply(this,arguments)}function Lu(){return Lu=me((function(e){return we(this,(function(t){return[2,fn("setAndroidBottomNavigationBar",Uu,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Si.setAndroidBottomNavigationBar(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setAndroidBottomNavigationBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Lu.apply(this,arguments)}var Zu=[ei({hide:Gr().default(!1).optional()}).optional()];function zu(e){return Wu.apply(this,arguments)}function Wu(){return Wu=me((function(e){return we(this,(function(t){return[2,fn("setIOSBottomSafeArea",Zu,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Si.setIOSBottomSafeArea(e.hide)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setIOSBottomSafeArea",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Wu.apply(this,arguments)}var Fu=[ei({type:Ti.enum(["normal","hidden","transparent"]).default("normal").optional(),color:Ti.string().optional()}).optional()];function Gu(e){return Hu.apply(this,arguments)}function Hu(){return Hu=me((function(e){return we(this,(function(t){return[2,fn("setStatusBar",Fu,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,Si.configHeader({statusBarType:e.type,headerColor:e.color})]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("setStatusBar",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Hu.apply(this,arguments)}var Vu=[ei({headerTextColor:Ti.enum(["black","white"]).optional(),headerColor:Ti.string().optional(),actionBar:ei({hide:Ti.boolean().optional(),title:Ti.string().optional(),leftButton:Ti.enum(["back","none"]).optional(),textAlign:Ti.enum(["left","center"]).default("left").optional()}).optional(),statusBarType:Ti.enum(["normal","hidden","transparent"]).optional(),hideAndroidBottomNavigationBar:Ti.boolean().optional(),hideIOSSafeAreaBottom:Ti.boolean().optional()})];function Ku(e){return Ju.apply(this,arguments)}function Ju(){return Ju=me((function(e){return we(this,(function(t){return[2,fn("configAppView",Vu,[e],function(){var e=me((function(e){var t,n,r,i,o,a,s;return we(this,(function(u){switch(u.label){case 0:return Ae.isMp?ht.isUndefined(null===(t=e.actionBar)||void 0===t?void 0:t.leftButton)?[3,2]:[4,Si.setNavigationBarLeftButton(null===(a=e.actionBar)||void 0===a?void 0:a.leftButton)]:[3,13];case 1:u.sent(),u.label=2;case 2:return ht.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,Si.setNavigationBarTitle(null===(s=e.actionBar)||void 0===s?void 0:s.title)];case 3:u.sent(),u.label=4;case 4:return[4,Si.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,Si.setAndroidBottomNavigationBar(e.hideAndroidBottomNavigationBar)];case 7:u.sent(),u.label=8;case 8:return"boolean"!=typeof e.hideIOSSafeAreaBottom?[3,10]:[4,Si.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 Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("configAppView",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Ju.apply(this,arguments)}var qu=function(){var t=me((function(t,n,r,i,a,s){var u,c,l,d,p,f,h,m,v,y,g,_,w,b;return we(this,(function(T){switch(T.label){case 0:p=o,(f=new URLSearchParams).append("payType",n||e.IAPPayType.SUBSCRIPTION),h=e.ProrationMode.UNKNOW,r===se&&(h=e.ProrationMode.IMMEDIATE_AND_CHARGE_FULL_PRICE),r===ae&&(h=e.ProrationMode.DEFERRED),f.append("utm",a||"default"),f.append("merchantTransId",s||""),f.append("prorationMode",h.toString()),f.append("appId",p),i&&f.append("method",i),m="",(null===(u=Oe())||void 0===u||null===(c=u.platform)||void 0===c?void 0:c.isIOS)?m="ios":(null===(l=Oe())||void 0===l||null===(d=l.platform)||void 0===d?void 0:d.isAndroid)&&(m="android"),f.append("os",m),f.append("productId",t),v={headers:{"Content-Type":"application/x-www-form-urlencoded",authorization:"Bearer "}},T.label=1;case 1:return T.trys.push([1,5,,6]),[4,en.getAccessToken().catch((function(){throw $t.error.loginRequired}))];case 2:return y=T.sent(),v.headers.authorization="Bearer ".concat(y),[4,fetch(ie,Yo(Ne({method:"POST"},v),{body:f}))];case 3:return[4,T.sent().json()];case 4:if(!(g=T.sent()).data||!g.data.store||0!==g.err)throw $t.error.createIAPOrderFailed(g.err);return _=g.data.store,w=g.data.orderId,[2,new Promise((function(e,t){Qt("IAP_REQUESTPAYMENT",Ne({},_),{success:function(){e({orderId:w})},fail:function(e){t(e)}})}))];case 5:throw b=T.sent(),console.log("Internal error"),b;case 6:return[2]}}))}));return function(e,n,r,i,o,a){return t.apply(this,arguments)}}(),$u=[ei({productId:Zr(),payType:Ti.enum(["ONETIME","SUBSCRIPTION"]).optional(),prorationMode:Ti.enum(["DEFERRED","IMMEDIATE_AND_CHARGE_FULL_PRICE"]).default("DEFERRED").optional(),utm:Zr().optional(),method:Ti.enum(["IAP","IAP_SANDBOX"]).optional(),merchantTransId:Zr().optional()})];function Qu(e){return Yu.apply(this,arguments)}function Yu(){return Yu=me((function(e){return we(this,(function(t){return[2,fn("createOrderIAP",$u,[e],function(){var e=me((function(e){return we(this,(function(t){switch(t.label){case 0:return Ae.isMp?[4,qu(e.productId,e.payType,e.prorationMode,e.method,e.utm,e.merchantTransId)]:[3,2];case 1:return[2,t.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({orderId:""})]:[2,Promise.reject(Ie("createOrderIAP",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Yu.apply(this,arguments)}var Xu=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("MA_MENU_MINIMIZE",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ec(e){return tc.apply(this,arguments)}function tc(){return(tc=me((function(e){return we(this,(function(t){return[2,fn("minimizeApp",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Xu()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("minimizeApp",{}))]}}))})))]}))}))).apply(this,arguments)}var nc=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("MA_MENU_PERMISSION",{},{success:function(t){e(t)},fail:function(e){t(e)}},{}),e()}))]}))}));function rc(e){return ic.apply(this,arguments)}function ic(){return(ic=me((function(e){return we(this,(function(t){return[2,fn("openPermissionSetting",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,nc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openPermissionSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var oc=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("MP_ADD_MYFAVORITES",{timestamp:(new Date).getTime()},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function ac(e){return sc.apply(this,arguments)}function sc(){return(sc=me((function(e){return we(this,(function(t){return[2,fn("favoriteApp",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,oc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("favoriteApp",{}))]}}))})))]}))}))).apply(this,arguments)}var uc=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("OPEN_GROUPLIST",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function cc(e){return lc.apply(this,arguments)}function lc(){return(lc=me((function(e){return we(this,(function(t){return[2,fn("openGroupList",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,uc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openGroupList",{}))]}}))})))]}))}))).apply(this,arguments)}var dc=me((function(){var e;return we(this,(function(t){switch(t.label){case 0:return[4,en.getAccessToken()];case 1:return e=t.sent(),[2,new Promise((function(t,n){Qt("MP_SEND_NOTIFICATION",{accessToken:e},{success:function(e){t(e)},fail:function(e){n(e)}},{delay:500})}))]}}))}));function pc(e){return fc.apply(this,arguments)}function fc(){return(fc=me((function(e){return we(this,(function(t){return[2,fn("requestSendNotification",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,dc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("requestSendNotification",{}))]}}))})))]}))}))).apply(this,arguments)}var hc=me((function(){return we(this,(function(e){return[2,new Promise((function(e,t){Qt("MP_ADD_RATING",{},{success:function(t){e(t)},fail:function(e){t(e)}},{})}))]}))}));function mc(e){return vc.apply(this,arguments)}function vc(){return(vc=me((function(e){return we(this,(function(t){return[2,fn("addRating",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,hc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("addRating",{}))]}}))})))]}))}))).apply(this,arguments)}var yc,gc=(yc=me((function(e,t,n){var r,i;return we(this,(function(o){switch(o.label){case 0:return(r=new URLSearchParams).append("appId",t),r.append("accessToken",n),r.append("oaId",e),i={headers:{"Content-Type":"application/x-www-form-urlencoded"}},[4,fetch(d.CHECK_INTERACT_OA,Ne({method:"POST",body:r},i))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))})),function(e,t,n){return yc.apply(this,arguments)}),_c=function(){var e=me((function(e){return we(this,(function(t){return[2,new Promise((function(t,n){Qt("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)}}(),wc=[ei({oaId:Zr()})];function bc(e){return Tc.apply(this,arguments)}function Tc(){return Tc=me((function(e){return we(this,(function(t){return[2,fn("interactOA",wc,[e],function(){var e=me((function(e){var t,n,r;return we(this,(function(i){switch(i.label){case 0:return Ae.isMp?(t=e.oaId,[4,en.getAccessToken()]):[3,5];case 1:return!(n=i.sent())||ht.isEmpty(n)?[3,3]:[4,gc(t,o,n)];case 2:if(0===(null==(r=i.sent())?void 0:r.err))return[2,Promise.resolve({})];i.label=3;case 3:return[4,_c(t)];case 4:return[2,i.sent()];case 5:return Ae.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("interactOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Tc.apply(this,arguments)}var Ec=[ei({oaId:Zr()})];function Sc(e){return Pc.apply(this,arguments)}function Pc(){return Pc=me((function(e){return we(this,(function(t){return[2,fn("isAllowedInteractWithOA",Ec,[e],function(){var e=me((function(e){var t,n,r;return we(this,(function(i){switch(i.label){case 0:return Ae.isMp?(t=e.oaId,[4,en.getAccessToken()]):[3,4];case 1:return!(n=i.sent())||ht.isEmpty(n)?[3,3]:[4,gc(t,o,n)];case 2:return r=i.sent(),[2,Promise.resolve({status:0===(null==r?void 0:r.err)})];case 3:return[2,Promise.resolve({status:!1})];case 4:return Ae.isMpWeb?[2,Promise.resolve({status:!1})]:[2,Promise.reject(Ie("IsAllowedInteractWithOA",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Pc.apply(this,arguments)}function Oc(e){return Ac.apply(this,arguments)}function Ac(){return(Ac=me((function(e){return we(this,(function(t){return[2,fn("getSetting",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Jt()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({authSetting:{}})]:[2,Promise.reject(Ie("getSetting",{}))]}}))})))]}))}))).apply(this,arguments)}var kc=Ti.enum(["scope.userInfo","scope.userLocation","scope.userPhonenumber"]),Ic=[ei({scopes:Ti.array(kc).max(2).optional()}).optional()];function Cc(e){return Nc.apply(this,arguments)}function Nc(){return Nc=me((function(e){return we(this,(function(t){return[2,fn("authorize",Ic,[e],function(){var e=me((function(e){var t,n,r,i;return we(this,(function(o){switch(o.label){case 0:return Ae.isMp?(n=null==e?void 0:e.scopes,r=zt(),("android"===(i=((null===(t=Oe())||void 0===t?void 0:t.platformName)||"").toLowerCase())&&r<724||"ios"===i&&r<573)&&n&&n.length>0?[2,Promise.reject($t.error.clientNotSupport())]:[4,Yt(null!=n?n:void 0)]):[3,2];case 1:return[2,o.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve({})]:[2,Promise.reject(Ie("authorize",{}))]}}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Nc.apply(this,arguments)}var Mc=me((function(){return we(this,(function(e){return[2,new Promise(function(){var e=me((function(e,t){var n;return we(this,(function(r){switch(r.label){case 0:return ht.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($t.error.clientNotSupport()),[2]}}))}));return function(t,n){return e.apply(this,arguments)}}())]}))}));function xc(e){return fn("checkZaloCameraPermission",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return[4,Mc()];case 1:return[2,e.sent()]}}))})))}var Rc=me((function(){return we(this,(function(e){return[2,new Promise(function(){var e=me((function(e,t){var n,r,i;return we(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,en.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=en.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 Dc(e){return jc.apply(this,arguments)}function jc(){return(jc=me((function(e){return we(this,(function(t){return[2,fn("getUserID",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Rc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getUserID",{}))]}}))})))]}))}))).apply(this,arguments)}var Uc=me((function(){return we(this,(function(e){return[2,new Promise(function(){var e=me((function(e,t){var n,r,i;return we(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,en.jumpAndGetToken()];case 1:return o.sent(),r=null===(n=en.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 Bc(e){return Lc.apply(this,arguments)}function Lc(){return(Lc=me((function(e){return we(this,(function(t){return[2,fn("getIDToken",[],[e],me((function(){return we(this,(function(e){switch(e.label){case 0:return Ae.isMp?[4,Uc()]:[3,2];case 1:return[2,e.sent()];case 2:return Ae.isMpWeb?[2,Promise.resolve(void 0)]:[2,Promise.reject(Ie("getIDToken",{}))]}}))})))]}))}))).apply(this,arguments)}var Zc={format:e.PhotoFormat.JPEG,quality:e.PhotoQuality.NORMAL,mirrored:!1,useVideoSourceSize:!1},zc={width:1024,height:768,facingMode:e.FacingMode.FRONT,mirrored:!1,audio:!1,video:!0},Wc=function(){function t(n){var r,i,o,a,s,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=this;mt(this,t),this._videoEnabled=!0,this._audioEnabled=null,this.tick=function(){if(c.haveVideoStream()&&c._userRequestFrameCallback){var t=c.getCanvas();if(c.drawFrame(),t){var n={data:t.toDataURL(e.PhotoFormat.PNG),width:t.width,height:t.height};At.getInstance().emit(e.CameraEvents.OnFrameCallback,0,n),requestAnimationFrame(c.tick)}}},this._videoElement=n,this._mediaConstraints=null!=u?u:null,this._facingMode=null!==(r=null==u?void 0:u.facingMode)&&void 0!==r?r:zc.facingMode,this._cameraList=[],this._stream=null,this._selectedDeviceId=null!==(i=null==u?void 0:u.deviceId)&&void 0!==i?i:"",this._canvasElement=null,this._ctx=null,this._hasUserMedia=!1,this._mirror=null!==(o=null==u?void 0:u.mirrored)&&void 0!==o?o:zc.mirrored,this._userRequestFrameCallback=!1,this._audioEnabled=null!==(a=null==u?void 0:u.audio)&&void 0!==a?a:zc.audio,this._videoEnabled=null!==(s=null==u?void 0:u.video)&&void 0!==s?s:zc.video}var n=t.prototype;return n.on=function(t,n){At.getInstance().on(t,(function(e){n(e)})),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!0,this.tick())},n.off=function(t){At.getInstance().off(t),t===e.CameraEvents.OnFrameCallback&&(this._userRequestFrameCallback=!1)},n.getQualityNumber=function(e){switch(e){case"high":return.9;case"normal":default:return.6;case"low":return.2}},n.getFacingMode=function(){return this._facingMode},n.getCameraList=function(){return this._cameraList},n.getCameraCount=function(){return this._cameraList.length},n.getSelectedDeviceId=function(){return this._selectedDeviceId},n.setDeviceId=function(e){var t=this;return me((function(){return we(this,(function(n){switch(n.label){case 0:return t._selectedDeviceId=e,t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),this._cameraList},n.updateMediaConstraints=function(e){var t=this;return me((function(){var n,r,i,o,a,s;return we(this,(function(u){switch(u.label){case 0:return ht.isEmpty(e)?[2]:JSON.stringify(e)!==JSON.stringify(t._mediaConstraints)?(t._mediaConstraints=e,t._facingMode=null!==(n=null==e?void 0:e.facingMode)&&void 0!==n?n:t._facingMode,t._selectedDeviceId=null!==(r=null==e?void 0:e.deviceId)&&void 0!==r?r:t._selectedDeviceId,t._mirror=null!==(i=null==e?void 0:e.mirrored)&&void 0!==i?i:t._mirror,t._audioEnabled=null!==(o=null==e?void 0:e.audio)&&void 0!==o?o:t._audioEnabled,t._videoEnabled=null!==(a=null==e?void 0:e.video)&&void 0!==a?a:t._videoEnabled,t._selectedDeviceId=null!==(s=null==e?void 0:e.deviceId)&&void 0!==s?s:t._selectedDeviceId,t._hasUserMedia?[4,t.stream()]:[3,2]):[2];case 1:u.sent(),u.label=2;case 2:return[2]}}))}))()},n.getCurrentMediaConstraints=function(){var e=this._mediaConstraints,t={};this._videoElement.width=(null==e?void 0:e.width)||this._videoElement.width||zc.width,this._videoElement.height=(null==e?void 0:e.height)||this._videoElement.height||zc.height;var n=!1!==this._videoEnabled,r=!1!==this._audioEnabled;return n&&(""==this._selectedDeviceId&&null!==this._facingMode?t.facingMode=this._facingMode:t.deviceId={exact:this._selectedDeviceId},t.width={exact:this._videoElement.width},t.height={exact:this._videoElement.height}),{video:!!n&&t,audio:r}},n.selectCamera=function(){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cameraList[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._facingMode==e.FacingMode.FRONT&&a.label.toLowerCase().includes("front")||this._facingMode==e.FacingMode.BACK&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}},n.flip=function(){var t=this;return me((function(){return we(this,(function(n){switch(n.label){case 0:return t._facingMode=t._facingMode==e.FacingMode.FRONT?e.FacingMode.BACK:e.FacingMode.FRONT,t._videoElement.style.transform="",t.selectCamera(),t._hasUserMedia?[4,t.stream()]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))()},n.start=function(){var t=this;return me((function(){var n,r;return we(this,(function(i){return n=At.getInstance(),r=function(e){try{t._hasUserMedia&&t.stop()}catch(e){}},n.off(e.Events.AppPaused,r),n.on(e.Events.AppPaused,r),[2,new Promise(function(){var n=me((function(n,r){var i;return we(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t.stream()];case 1:return o.sent(),At.getInstance().emit(e.CameraEvents.OnStartCallback,0),n(t._selectedDeviceId),[3,3];case 2:return i=o.sent(),r(i),[3,3];case 3:return[2]}}))}));return function(e,t){return n.apply(this,arguments)}}())]}))}))()},n.info=function(){var e=this;return me((function(){return we(this,(function(t){return[2,new Promise((function(t,n){navigator.mediaDevices.enumerateDevices().then((function(n){e.getVideoInputs(n),t(e._cameraList)})).catch((function(e){n(e)}))}))]}))}))()},n.stream=function(){var e=this;return me((function(){return we(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=me((function(n){return we(this,(function(r){switch(r.label){case 0:return[4,e.info()];case 1:return r.sent(),e.selectCamera(),e.handleUserMedia(null,n),t(e._facingMode),[2]}}))}));return function(e){return n.apply(this,arguments)}}()).catch((function(t){e.handleUserMedia(t),n(t)}))}catch(e){n(e)}}))]}))}))()},n.handleUserMedia=function(t,n){var r=this;if(!t&&n){this._stream=n;try{this._videoElement&&(this._videoElement.srcObject=n,(this._facingMode==e.FacingMode.FRONT||this._mirror)&&(this._videoElement.style.transform="scale(-1,1)"),this._videoElement.onloadedmetadata=function(){r._userRequestFrameCallback&&r.tick()},this._videoElement.play().then((function(){r._hasUserMedia=!0})).catch((function(e){r._hasUserMedia=!1})))}catch(e){this._hasUserMedia=!1}}else this._hasUserMedia=!1},n.updateTrackEnable=function(t,n){var r=this;return me((function(){return we(this,(function(i){switch(i.label){case 0:if(t===e.StreamType.VIDEO){if(r._videoEnabled===n)return[2];r._videoEnabled=n}else{if(r._audioEnabled===n)return[2];r._audioEnabled=n}return[4,r.stream()];case 1:return i.sent(),[2]}}))}))()},n.pause=function(e){var t=this;return me((function(){return we(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!1)];case 1:return n.sent(),[2]}}))}))()},n.resume=function(e){var t=this;return me((function(){return we(this,(function(n){switch(n.label){case 0:return[4,t.updateTrackEnable(e,!0)];case 1:return n.sent(),[2]}}))}))()},n.isUsing=function(){return this._hasUserMedia},n.stop=function(){this._stop(),At.getInstance().emit(e.CameraEvents.OnStopCallback,0)},n._stop=function(){t.stopMediaStream(this._stream),this._hasUserMedia=!1},n.setFacingMode=function(e){this._facingMode=e},n.setMirror=function(e){this._mirror=e,this._videoElement&&(this._videoElement.style.transform=e?"scale(-1,1)":"")},n.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{},n=this.getCanvas(t);if(this.drawFrame(t),n){var r=t.format||Zc.format;return{data:n.toDataURL(r,this.getQualityNumber(t.quality)),width:n.width,height:n.height}}return null},n.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},n.getCanvas=function(e){var t=this._videoElement,n=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var r=t.videoWidth,i=t.videoHeight;if(!n.useVideoSourceSize){var o=r/i;i=(r=n.minScreenshotWidth||t.clientWidth)/o,n.minScreenshotHeight&&i<n.minScreenshotHeight&&(r=(i=n.minScreenshotHeight)*o)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==n?void 0:n.width)||r,this._canvasElement.height=(null==n?void 0:n.height)||i,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},n.drawFrame=function(t){var n=this._videoElement,r=t||{};if(n&&this._ctx&&this._canvasElement){var i=this._canvasElement,o=this._ctx;i.width=(null==r?void 0:r.width)||i.width,i.height=(null==r?void 0:r.height)||i.height,((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.translate(i.width,0),o.scale(-1,1)),o.drawImage(n,0,0,i.width,i.height),((null==r?void 0:r.mirrored)||this._mirror||this._facingMode===e.FacingMode.FRONT)&&(o.scale(-1,1),o.translate(-i.width,0))}},t.stopMediaStream=function(e){e&&(e.getVideoTracks&&e.getAudioTracks?(e.getVideoTracks().map((function(t){e.removeTrack(t),t.stop()})),e.getAudioTracks().map((function(t){e.removeTrack(t),t.stop()}))):e.stop())},t}(),Fc=ei({play:Ti.function(),pause:Ti.function()}).refine((function(e){return"play"in e&&"pause"in e}),{message:"Invalid HTMLVideoElement"}),Gc=[ei({videoElement:Fc,mediaConstraints:Ti.object({width:Ti.number().min(100).optional(),height:Ti.number().min(100).optional(),facingMode:Ti.string().optional(),audio:Ti.boolean().optional(),video:Ti.boolean().optional(),deviceId:Ti.string().optional(),mirrored:Ti.boolean().optional()}).nullish()}).optional()];function Hc(e){return fn("createCameraContext",Gc,[e],(function(e){return console.log("createCameraContext",e),new Wc(e.videoElement,e.mediaConstraints)}))}var Vc=function(){function e(){var t,n;mt(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=_e(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;ht.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?ht.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?ht.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 Kc(e){return Jc.apply(this,arguments)}function Jc(){return(Jc=me((function(e){return we(this,(function(t){return[2,fn("setupAd",[],[e],(function(){return Vc.getInstance().loadSDK()}))]}))}))).apply(this,arguments)}var qc=[ei({ids:Ti.union([Ti.string(),Ti.array(Ti.string())]),config:ei({display:Ti.boolean().optional(),onClose:Ti.function().optional()}).optional()})];function $c(e){return Qc.apply(this,arguments)}function Qc(){return Qc=me((function(e){return we(this,(function(t){return[2,fn("loadAd",qc,[e],function(){var e=me((function(e){return we(this,(function(t){return Vc.getInstance().load(e.ids,e.config),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),Qc.apply(this,arguments)}var Yc=[ei({id:Ti.string()})];function Xc(e){return el.apply(this,arguments)}function el(){return el=me((function(e){return we(this,(function(t){return[2,fn("displayAd",Yc,[e],function(){var e=me((function(e){return we(this,(function(t){return Vc.getInstance().display(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),el.apply(this,arguments)}var tl=[ei({id:Ti.string().optional()}).optional()];function nl(e){return rl.apply(this,arguments)}function rl(){return rl=me((function(e){return we(this,(function(t){return[2,fn("refreshAd",tl,[e],function(){var e=me((function(e){return we(this,(function(t){return Vc.getInstance().refresh(e.id),[2]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),rl.apply(this,arguments)}var il=[ei({id:Zr(),guidingText:Zr().optional(),color:Zr().optional(),onStatusChange:Ti.function().optional()})];function ol(e){return al.apply(this,arguments)}function al(){return al=me((function(e){return we(this,(function(n){return[2,fn("showOAWidget",il,[e],function(){var e=me((function(e){var n,r,i,o,a,s,u,c;return we(this,(function(l){if(Ae.isMp){try{n=document.getElementById(e.id),r=e.onStatusChange,i=e.guidingText,o=e.color,a=t(e,["onStatusChange","guidingText","color"]),n&&(s=document.createElement("iframe"),u="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=Me(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=me((function(e){var t,n,i,o,a,s,l,d;return we(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,en.jumpAndGetToken()]):[3,3];case 1:return p.sent(),l=null===(a=en.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?Go(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 Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),al.apply(this,arguments)}var sl=[ei({id:Zr(),type:Zr(),text:Zr(),color:Zr().optional(),disabled:Ti.boolean().optional(),onDataReceived:Ti.function().optional(),onError:Ti.function().optional()})];function ul(e){return cl.apply(this,arguments)}function cl(){return cl=me((function(e){return we(this,(function(n){return[2,fn("showFunctionButtonWidget",sl,[e],function(){var e=me((function(e){var n,r,i,o,a,s,u;return we(this,(function(c){if(Ae.isMp){try{n=document.getElementById(e.id),r=e.onDataReceived,i=e.onError,o=t(e,["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=Me(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=Me(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=me((function(e){var t,n,a,c,l,d,p,f,h,m,v,y;return we(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,en.jumpAndGetToken()]):[3,4];case 1:return g.sent(),f=null===(l=en.miniProgramConfig)||void 0===l?void 0:l.jwt,h=null===(d=en.miniProgramConfig)||void 0===d?void 0:d.encryptKey,[4,vn()];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 Ae.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(Ie("openMiniApp",{}))]}))}));return function(t){return e.apply(this,arguments)}}())]}))})),cl.apply(this,arguments)}window.ZaloMiniAppSDK={getVersion:wn},hn();var ll=Object.freeze({__proto__:null,get Events(){return e.Events},get EventName(){return e.Events},get CameraEvents(){return e.CameraEvents},login:hn,getAccessToken:vn,getVersion:wn,getSystemInfo:Tn,setNavigationBarTitle:Oi,setNavigationBarColor:Ii,setNavigationBarLeftButton:Mi,setStorage:io,getStorage:so,getStorageInfo:co,removeStorage:fo,clearStorage:vo,getUserInfo:wo,getNetworkType:So,onNetworkStatusChange:Ao,startBeaconDiscovery:Co,stopBeaconDiscovery:xo,getBeacons:jo,closeApp:Lo,scanQRCode:Wo,openProfile:Vo,openChat:$o,openPostFeed:ta,followOA:oa,unfollowOA:ca,openShareSheet:ha,requestCameraPermission:ya,createShortcut:Ea,openBioAuthentication:Aa,checkStateBioAuthentication:Ca,showToast:Ra,hideKeyboard:Ua,openPhone:za,openSMS:Ha,viewOAQr:qa,keepScreen:Xa,onKeepScreen:ts,offKeepScreen:rs,saveImageToGallery:ss,openMiniApp:ds,vibrate:ms,openWebview:_s,getRouteParams:Ts,getAppInfo:Es,sendDataToPreviousMiniApp:As,getPhoneNumber:Cs,openProfilePicker:Rs,connectWifi:Bs,openMediaPicker:Ws,getShareableLink:Hs,closeLoading:Js,requestUpdateZalo:$s,onConfirmToExit:eu,offConfirmToExit:tu,getDeviceId:nu,getDeviceIdAsync:ru,getContext:ou,getContextAsync:au,getAuthCode:uu,getZPIToken:lu,setAccessToken:fu,openOutApp:mu,chooseImage:gu,getLocation:bu,onCallbackData:Su,createOrder:ku,selectPaymentMethod:Mu,checkTransaction:Du,events:Ys,setAndroidBottomNavigationBar:Bu,setIOSBottomSafeArea:zu,setStatusBar:Gu,configAppView:Ku,createOrderIAP:Qu,minimizeApp:ec,openPermissionSetting:rc,favoriteApp:ac,openGroupList:cc,requestSendNotification:pc,addRating:mc,interactOA:bc,interactOa:bc,isAllowedInteractWithOA:Sc,getSetting:Oc,authorize:Cc,checkZaloCameraPermission:xc,getUserID:Dc,getIDToken:Bc,createCameraContext:Hc,setupAd:Kc,loadAd:$c,displayAd:Xc,refreshAd:nl,showOAWidget:ol,showFunctionButtonWidget:ul,get FacingMode(){return e.FacingMode},get PhotoFormat(){return e.PhotoFormat},get PhotoQuality(){return e.PhotoQuality},get StreamType(){return e.StreamType},ZMACameraImp:Wc}),dl=ku,pl=Du,fl=Qu,hl=Mu,ml=t(ll,["createOrder","checkTransaction","createOrderIAP","selectPaymentMethod"]),vl={createOrder:dl,checkTransaction:pl,createOrderIAP:fl,selectPaymentMethod:hl};!function(){var e,t=null===(e=Oe())||void 0===e?void 0:e.appEnv;(null==t?void 0:t.isMp)&&(window.ZaloMiniAppSDK={},Object.assign(window.ZaloMiniAppSDK,ll))}(),e.EventName=e.Events,e.Payment=vl,e.ZMACameraImp=Wc,e.addRating=mc,e.authorize=Cc,e.checkStateBioAuthentication=Ca,e.checkTransaction=Du,e.checkZaloCameraPermission=xc,e.chooseImage=gu,e.clearStorage=vo,e.closeApp=Lo,e.closeLoading=Js,e.configAppView=Ku,e.connectWifi=Bs,e.createCameraContext=Hc,e.createOrder=ku,e.createOrderIAP=Qu,e.createShortcut=Ea,e.default=ml,e.displayAd=Xc,e.events=Ys,e.favoriteApp=ac,e.followOA=oa,e.getAccessToken=vn,e.getAppInfo=Es,e.getAuthCode=uu,e.getBeacons=jo,e.getContext=ou,e.getContextAsync=au,e.getDeviceId=nu,e.getDeviceIdAsync=ru,e.getIDToken=Bc,e.getLocation=bu,e.getNetworkType=So,e.getPhoneNumber=Cs,e.getRouteParams=Ts,e.getSetting=Oc,e.getShareableLink=Hs,e.getStorage=so,e.getStorageInfo=co,e.getSystemInfo=Tn,e.getUserID=Dc,e.getUserInfo=wo,e.getVersion=wn,e.getZPIToken=lu,e.hideKeyboard=Ua,e.interactOA=bc,e.interactOa=bc,e.isAllowedInteractWithOA=Sc,e.keepScreen=Xa,e.loadAd=$c,e.login=hn,e.minimizeApp=ec,e.offConfirmToExit=tu,e.offKeepScreen=rs,e.onCallbackData=Su,e.onConfirmToExit=eu,e.onKeepScreen=ts,e.onNetworkStatusChange=Ao,e.openBioAuthentication=Aa,e.openChat=$o,e.openGroupList=cc,e.openMediaPicker=Ws,e.openMiniApp=ds,e.openOutApp=mu,e.openPermissionSetting=rc,e.openPhone=za,e.openPostFeed=ta,e.openProfile=Vo,e.openProfilePicker=Rs,e.openSMS=Ha,e.openShareSheet=ha,e.openWebview=_s,e.refreshAd=nl,e.removeStorage=fo,e.requestCameraPermission=ya,e.requestSendNotification=pc,e.requestUpdateZalo=$s,e.saveImageToGallery=ss,e.scanQRCode=Wo,e.selectPaymentMethod=Mu,e.sendDataToPreviousMiniApp=As,e.setAccessToken=fu,e.setAndroidBottomNavigationBar=Bu,e.setIOSBottomSafeArea=zu,e.setNavigationBarColor=Ii,e.setNavigationBarLeftButton=Mi,e.setNavigationBarTitle=Oi,e.setStatusBar=Gu,e.setStorage=io,e.setupAd=Kc,e.showFunctionButtonWidget=ul,e.showOAWidget=ol,e.showToast=Ra,e.startBeaconDiscovery=Co,e.stopBeaconDiscovery=xo,e.unfollowOA=ca,e.vibrate=ms,e.viewOAQr=qa,Object.defineProperty(e,"__esModule",{value:!0})}));