app.run(["$rootScope","$timeout",function(e,o){e.checkApprove=function(o="",t,a){if(t&&"function"==typeof a)return a(!0);ajax("/api/approved",(function(t){var n="";"playgame"===o?n='เล่นเกมส์':"money"===o?n='แท็บการเงิน':"logs"===o&&(n='แท็บประวัติ');var l='- กรุณาเปลี่ยนรหัสผ่านใหม่
',i='- กรุณายืนยันบัตรปชช.
',r='- ชื่อบัญชีธนาคาร';let s={};if("object"!=typeof t.status&&(s=JSON.parse(t.status)),t.success)"function"==typeof a&&a(!0);else{if("PAGE_NOT_CHECK_APPROVE"!=t.code&&"MEMBER_APPROVE_NOT_ENABLED"!=t.code)return s.status_first_login&&(l=""),s.status_id_card&&(i=""),s.status_bank&&(r=""),swal({title:'Please contact the customer service to verify your account before use '+n,text:l+i+r,imageUrl:msg_img.fail,showCancelButton:!1,html:!0,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){return e.$emit("goto_profile")}));"function"==typeof a&&a(!0)}}),{tab:o})},e.play_game=function(t,a,n,l,i,r=!1,s=""){if(null!=e.gameNotShowTopupMoney){let o=t;"PP"==t||"SEXYBCRT"==t?o="AWC":"HS"==t&&(o="YGG"),o&&(-1!=e.gameNotShowTopupMoney.indexOf(o)?(e.notShowTopupMoney=!0,e.notShowTopupMoney="fish"!=s||"short77"!=t):e.notShowTopupMoney="fish"==s&&"short77"!=t)}else e.notShowTopupMoney=!1;if(ajax("/api/approved",(function(o){o.success||"PAGE_NOT_CHECK_APPROVE"!=o.code&&"MEMBER_APPROVE_NOT_ENABLED"!=o.code&&(console.log(),e.notShowTopupMoney=!0)}),{tab:"money"}),$(".holds-the-iframe").removeClass("get-url-success"),!_GobalLogin&&!e.userdata.username&&!l)return $("#modal_login").modal();e.datemaintenance(),function(t,a,n,l,i,r){e.checkApprove("playgame",l,(function(s){var c=i?"&webType="+i:"";1==a&&80==n?($("#game_frame").addClass("desktop"==_theme.device?"sport-desktop":"sport-mobile"),$("#game_frame").attr("scrolling","yes")):($("#game_frame").removeClass("sport-desktop sport-mobile"),$("#game_frame").attr("scrolling","no")),e.playing_game=t;let m="";r&&(m="&gamehall="+r);let g="/play/?json=1&vendor="+t+"&g="+a+"&m="+n+c;l&&(g="/playdemo/?json=1&vendor="+t+"&g="+a+"&m="+n+c+"&iframe=true"),ajax(g,(function(o){if(_RES_PLAYGAME=o,_GobalLogin&&_theme.login_not_create_member&&(e.userdata.money.total="*****"),!o.success){if("timeout"!=o)return showErrorFailPlayGame(o.code);swal({title:'Unable to access to game provider. Please try again.',imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){return $('[data-scroll-to="#slot-game"]').length?$('[data-scroll-to="#slot-game"]').click():$("#menu-slot").length?$("#menu-slot").click():$('[data-scroll-to="#topBanner"]').click()}))}if($(".holds-the-iframe").addClass("get-url-success"),o.html){if(o.data)return $("#game-frame").contents().find("body").html(o.data);swal({title:'Unable to access to game provider. Please try again.',imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){return $('[data-scroll-to="#slot-game"]').length?$('[data-scroll-to="#slot-game"]').click():$("#menu-slot").length?$("#menu-slot").click():$('[data-scroll-to="#topBanner"]').click()}))}else{if(o.data)return $("#game-frame").attr("src",o.data);swal({title:'Unable to access to game provider. Please try again.',imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){return $('[data-scroll-to="#slot-game"]').length?$('[data-scroll-to="#slot-game"]').click():$("#menu-slot").length?$("#menu-slot").click():$('[data-scroll-to="#topBanner"]').click()}))}})),o((function(){$(window).trigger("resize")}),800),e.playing=!0,$("#vidFish").length&&$("#vidFish").get(0).pause(),$("#modal_game").length&&$("#modal_game").modal({keyboard:!1,backdrop:"static"})}))}(t,a,n,l,i,r)},e.$on("goto_profile",(function(){void 0!==_theme.device&&("mobile"===_theme.device?location.replace("/app#/info-tabs/profile"):location.replace("/new_profile"))}))}]);